gdb/
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
d0a9ace3
ILT
12011-04-22 Vladimir Simonov <sv@sw.ru>
2
3 * descriptors.cc (set_close_on_exec): New function.
4 (Descriptors::open): Use set_close_on_exec.
5 * output.cc (S_ISLNK): Define if not defined.
6
94a3fc8b
CC
72011-04-22 Cary Coutant <ccoutant@google.com>
8
9 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
10 global symbol map.
11 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
12 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
13 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
14 relocations.
15 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
16 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
17 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
18 * incremental.h
19 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
20 function.
21 (Incremental_binary::apply_incremental_relocs): New function.
22 (Incremental_binary::do_apply_incremental_relocs): New function.
23 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
24 data member.
25 (Sized_incremental_binary::add_global_symbol): New function.
26 (Sized_incremental_binary::global_symbol): New function.
27 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
28 (Sized_incremental_binary::symbol_map_): New data member.
29 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
30 * target.h (Sized_target::apply_relocation): New function.
31 * target-reloc.h (apply_relocation): New function.
32 * x86_64.cc (Target_x86_64::apply_relocation): New function.
33
c87e4302
DK
342011-04-22 Doug Kwan <dougkwan@google.com>
35
36 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
37 flag of a SHT_ARM_EXIDX section.
38 * testsuite/Makefile.am (arm_exidx_test): New test rules.
39 * testsuite/Makefile.in: Regenerate.
40 * testsuite/arm_exidx_test.s: New file.
41 * testsuite/arm_exidx_test.sh: Same.
42
e7782cf6
CC
432011-04-20 Cary Coutant <ccoutant@google.com>
44
45 PR gold/12689
46 * archive.h (Incremental_archive_entry::Archive_member):
47 Initialize arg_serial_ (second constructor).
48
308ecdc7
ILT
492011-04-17 Ian Lance Taylor <iant@google.com>
50
51 * object.cc (Relocate_info::location): Simplify location string.
52 * errors.cc (Errors::error_at_location): Don't print program
53 name.
54 (Errors::warning_at_location): Likewise.
55 (Errors::undefined_symbol): Likewise.
56 * testsuite/debug_msg.sh: Update accordingly.
57
bec5b579
CC
582011-04-14 Cary Coutant <ccoutant@google.com>
59
60 * gold/layout.cc (Layout::symtab_section_offset): New function.
61 * gold/layout.h (Layout::symtab_section_offset): New function.
62 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
63
88597d34
ILT
642011-04-12 Ian Lance Taylor <iant@google.com>
65
66 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
67 with MREMAP_MAYMOVE.
68 * output.h (class Output_file): Add map_is_allocated_ field.
69 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
70 not available, provide stubs. If mremap is not available, #define
71 it to gold_mremap.
72 (MREMAP_MAYMOVE): Define if not defined.
73 (Output_file::Output_file): Initialize map_is_allocated_.
74 (Output_file::resize): Check map_is_allocated_.
75 (Output_file::map_anonymous): If mmap fails, use malloc.
76 (Output_file::unmap): Don't do anything for an anonymous map.
77 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
78 is not available, provide stubs.
79 (File_read::View::~View): Use free rather than delete[].
80 (File_read::make_view): Use malloc rather than new[]. If mmap
81 fails, use malloc.
82 (File_read::find_or_make_view): Use malloc rather than new[].
83 * gold.h: Remove HAVE_REMAP code.
84 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
85 exists. Rename mremap to gold_mremap. If mmap is not available
86 don't do anything.
87 * configure, config.in: Rebuild.
88
11e361bc
ILT
892011-04-11 Ian Lance Taylor <iant@google.com>
90
91 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
92 initialize local variable v.
93
cdc29364
CC
942011-04-11 Cary Coutant <ccoutant@google.com>
95
96 * archive.cc (Archive::include_member): Adjust call to
97 report_object.
98 (Add_archive_symbols::run): Track argument serial numbers.
99 (Lib_group::include_member): Likewise.
100 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
101 * archive.h (Incremental_archive_entry::Archive_member):
102 Initialize arg_serial_.
103 (Archive_member::arg_serial_): New data member.
104 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
105 (Sized_dynobj::do_add_symbols): Track symbols when doing an
106 incremental link.
107 (Sized_dynobj::do_for_all_local_got_entries): New function.
108 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
109 function.
110 * fileread.cc (get_mtime): New function.
111 * fileread.h (get_mtime): New function.
112 * gold.cc (queue_initial_tasks): Check for incremental update.
113 (process_incremental_input): New function.
114 (queue_middle_tasks): Don't force valid target for incremental
115 update.
116 * incremental-dump.cc (find_input_containing_global): Adjust
117 size of symbol info entry.
118 (dump_incremental_inputs): Dump argument serial number and
119 in_system_directory flag; bias shndx by 1; print symbol names
120 when dumping per-file symbol lists; use new symbol info readers.
121 * incremental.cc
122 (Output_section_incremental_inputs:update_data_size): New function.
123 (Sized_incremental_binary::setup_readers): Setup input readers
124 for each input file; build maps for files added from libraries
125 and scripts.
126 (Sized_incremental_binary::check_input_args): New function.
127 (Sized_incremental_binary::do_check_inputs): Build map of argument
128 serial numbers to input arguments.
129 (Sized_incremental_binary::do_file_has_changed): Rename
130 do_file_is_unchanged to this; compare file modification times.
131 (Sized_incremental_binary::do_init_layout): New function.
132 (Sized_incremental_binary::do_reserve_layout): New function.
133 (Sized_incremental_binary::do_get_input_reader): Remove.
134 (Sized_incremental_binary::get_symtab_view): New function.
135 (Incremental_checker::can_incrementally_link_output_file): Remove.
136 (Incremental_inputs::report_command_line): Exclude --debug options.
137 (Incremental_inputs::report_archive_begin): Add parameter; track
138 argument serial numbers; don't put input file entry for archive
139 before archive members.
140 (Incremental_inputs::report_archive_end): Put input file entry
141 for archive after archive members.
142 (Incremental_inputs::report_object): Add parameter; track argument
143 serial numbers and in_system_directory flag.
144 (Incremental_inputs::report_script): Add parameter; track argument
145 serial numbers.
146 (Output_section_incremental_inputs::set_final_data_size): Adjust
147 size of symbol info entry; check for forwarding symbols.
148 (Output_section_incremental_inputs::write_input_files): Write
149 in_system_directory flag and argument serial number.
150 (Output_section_incremental_inputs::write_info_blocks): Map section
151 indices between incremental info and original input file; store
152 input section index for each symbol.
153 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
154 change operator() to visit().
155 (class Global_got_offset_visitor): Likewise.
156 (class Global_symbol_visitor_got_plt):
157 (Output_section_incremental_inputs::write_got_plt): Use new visitor
158 classes.
159 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
160 (Sized_incr_relobj::do_read_symbols): New function.
161 (Sized_incr_relobj::do_layout): New function.
162 (Sized_incr_relobj::do_layout_deferred_sections): New function.
163 (Sized_incr_relobj::do_add_symbols): New function.
164 (Sized_incr_relobj::do_should_include_member): New function.
165 (Sized_incr_relobj::do_for_all_global_symbols): New function.
166 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
167 (Sized_incr_relobj::do_section_size): New function.
168 (Sized_incr_relobj::do_section_name): New function.
169 (Sized_incr_relobj::do_section_contents): New function.
170 (Sized_incr_relobj::do_section_flags): New function.
171 (Sized_incr_relobj::do_section_entsize): New function.
172 (Sized_incr_relobj::do_section_address): New function.
173 (Sized_incr_relobj::do_section_type): New function.
174 (Sized_incr_relobj::do_section_link): New function.
175 (Sized_incr_relobj::do_section_info): New function.
176 (Sized_incr_relobj::do_section_addralign): New function.
177 (Sized_incr_relobj::do_initialize_xindex): New function.
178 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
179 (Sized_incr_relobj::do_read_relocs): New function.
180 (Sized_incr_relobj::do_gc_process_relocs): New function.
181 (Sized_incr_relobj::do_scan_relocs): New function.
182 (Sized_incr_relobj::do_count_local_symbols): New function.
183 (Sized_incr_relobj::do_finalize_local_symbols): New function.
184 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
185 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
186 (Sized_incr_relobj::do_relocate): New function.
187 (Sized_incr_relobj::do_set_section_offset): New function.
188 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
189 (Sized_incr_dynobj::do_read_symbols): New function.
190 (Sized_incr_dynobj::do_layout): New function.
191 (Sized_incr_dynobj::do_add_symbols): New function.
192 (Sized_incr_dynobj::do_should_include_member): New function.
193 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
194 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
195 (Sized_incr_dynobj::do_section_size): New function.
196 (Sized_incr_dynobj::do_section_name): New function.
197 (Sized_incr_dynobj::do_section_contents): New function.
198 (Sized_incr_dynobj::do_section_flags): New function.
199 (Sized_incr_dynobj::do_section_entsize): New function.
200 (Sized_incr_dynobj::do_section_address): New function.
201 (Sized_incr_dynobj::do_section_type): New function.
202 (Sized_incr_dynobj::do_section_link): New function.
203 (Sized_incr_dynobj::do_section_info): New function.
204 (Sized_incr_dynobj::do_section_addralign): New function.
205 (Sized_incr_dynobj::do_initialize_xindex): New function.
206 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
207 (make_sized_incremental_object): New function.
208 (Incremental_library::copy_unused_symbols): New function.
209 (Incremental_library::do_for_all_unused_symbols): New function.
210 * incremental.h (enum Incremental_input_flags): New type.
211 (class Incremental_checker): Remove.
212 (Incremental_input_entry::Incremental_input_entry): Add argument
213 serial number.
214 (Incremental_input_entry::arg_serial): New function.
215 (Incremental_input_entry::set_is_in_system_directory): New function.
216 (Incremental_input_entry::is_in_system_directory): New function.
217 (Incremental_input_entry::arg_serial_): New data member.
218 (Incremental_input_entry::is_in_system_directory_): New data member.
219 (class Script_info): Move here from script.h.
220 (Script_info::Script_info): Add filename parameter.
221 (Script_info::filename): New function.
222 (Script_info::filename_): New data member.
223 (Incremental_script_entry::Incremental_script_entry): Add argument
224 serial number.
225 (Incremental_object_entry::Incremental_object_entry): Likewise.
226 (Incremental_object_entry::add_input_section): Build list of input
227 sections with map to original shndx.
228 (Incremental_object_entry::get_input_section_index): New function.
229 (Incremental_object_entry::shndx_): New data member.
230 (Incremental_object_entry::name_key_): Rename; adjust all refs.
231 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
232 (Incremental_archive_entry::Incremental_archive_entry): Add argument
233 serial number.
234 (Incremental_inputs::report_archive_begin): Likewise.
235 (Incremental_inputs::report_object): Likewise.
236 (Incremental_inputs::report_script): Likewise.
237 (class Incremental_global_symbol_reader): New class.
238 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
239 and store flags and input file type.
240 (Incremental_input_entry_reader::arg_serial): New function.
241 (Incremental_input_entry_reader::type): Extract type from flags.
242 (Incremental_input_entry_reader::is_in_system_directory): New function.
243 (Incremental_input_entry_reader::get_input_section_count): Call
244 accessor function for type.
245 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
246 function for type; adjust size of global symbol entry.
247 (Incremental_input_entry_reader::get_global_symbol_count): Call
248 accessor function for type.
249 (Incremental_input_entry_reader::get_object_count): Likewise.
250 (Incremental_input_entry_reader::get_object_offset): Likewise.
251 (Incremental_input_entry_reader::get_member_count): Likewise.
252 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
253 (Incremental_input_entry_reader::get_member_offset): Likewise.
254 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
255 (Incremental_input_entry_reader::Global_symbol_info): Remove.
256 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
257 (Incremental_input_entry_reader::get_global_symbol_reader): New
258 function.
259 (Incremental_input_entry_reader::get_output_symbol_index): New
260 function.
261 (Incremental_input_entry_reader::type_): Remove.
262 (Incremental_input_entry_reader::flags_): New data member.
263 (Incremental_inputs_reader::input_file_offset): New function.
264 (Incremental_inputs_reader::input_file_index): New function.
265 (Incremental_inputs_reader::input_file): Call input_file_offset.
266 (Incremental_inputs_reader::input_file_at_offset): New function.
267 (Incremental_relocs_reader::get_r_type): Reformat.
268 (Incremental_relocs_reader::get_r_shndx): Reformat.
269 (Incremental_relocs_reader::get_r_offset): Reformat.
270 (Incremental_relocs_reader::data): New function.
271 (Incremental_binary::Incremental_binary): Initialize new data members.
272 (Incremental_binary::check_inputs): Add cmdline parameter.
273 (Incremental_binary::file_is_unchanged): Remove.
274 (Input_reader::arg_serial): New function.
275 (Input_reader::get_unused_symbol_count): New function.
276 (Input_reader::get_unused_symbol): New function.
277 (Input_reader::do_arg_serial): New function.
278 (Input_reader::do_get_unused_symbol_count): New function.
279 (Input_reader::do_get_unused_symbol): New function.
280 (Incremental_binary::input_file_count): New function.
281 (Incremental_binary::get_input_reader): Change signature to use
282 index instead of filename.
283 (Incremental_binary::file_has_changed): New function.
284 (Incremental_binary::get_input_argument): New function.
285 (Incremental_binary::get_library): New function.
286 (Incremental_binary::get_script_info): New function.
287 (Incremental_binary::init_layout): New function.
288 (Incremental_binary::reserve_layout): New function.
289 (Incremental_binary::output_file): New function.
290 (Incremental_binary::do_check_inputs): New function.
291 (Incremental_binary::do_file_is_unchanged): Remove.
292 (Incremental_binary::do_file_has_changed): New function.
293 (Incremental_binary::do_init_layout): New function.
294 (Incremental_binary::do_reserve_layout): New function.
295 (Incremental_binary::do_input_file_count): New function.
296 (Incremental_binary::do_get_input_reader): Change signature.
297 (Incremental_binary::input_args_map_): New data member.
298 (Incremental_binary::library_map_): New data member.
299 (Incremental_binary::script_map_): New data member.
300 (Sized_incremental_binary::Sized_incremental_binary): Initialize
301 new data members.
302 (Sized_incremental_binary::output_section): New function.
303 (Sized_incremental_binary::inputs_reader): Add const.
304 (Sized_incremental_binary::symtab_reader): Add const.
305 (Sized_incremental_binary::relocs_reader): Add const.
306 (Sized_incremental_binary::got_plt_reader): Add const.
307 (Sized_incremental_binary::get_symtab_view): New function.
308 (Sized_incremental_binary::Inputs_reader): New typedef.
309 (Sized_incremental_binary::Input_entry_reader): New typedef.
310 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
311 (Sized_incremental_binary::do_file_is_unchanged): Remove.
312 (Sized_incremental_binary::do_file_has_changed): New function.
313 (Sized_incremental_binary::do_init_layout): New function.
314 (Sized_incremental_binary::do_reserve_layout): New function.
315 (Sized_input_reader::Inputs_reader): Remove.
316 (Sized_input_reader::Input_entry_reader): Remove.
317 (Sized_input_reader::do_arg_serial): New function.
318 (Sized_input_reader::do_get_unused_symbol_count): New function.
319 (Sized_input_reader::do_get_unused_symbol): New function.
320 (Sized_incremental_binary::do_input_file_count): New function.
321 (Sized_incremental_binary::do_get_input_reader): Change signature;
322 use index instead of filename.
323 (Sized_incremental_binary::section_map_): New data member.
324 (Sized_incremental_binary::input_entry_readers_): New data member.
325 (class Sized_incr_relobj): New class.
326 (class Sized_incr_dynobj): New class.
327 (make_sized_incremental_object): New function.
328 (class Incremental_library): New class.
329 * layout.cc (Free_list::num_lists): New static data member.
330 (Free_list::num_nodes): New static data member.
331 (Free_list::num_removes): New static data member.
332 (Free_list::num_remove_visits): New static data member.
333 (Free_list::num_allocates): New static data member.
334 (Free_list::num_allocate_visits): New static data member.
335 (Free_list::init): New function.
336 (Free_list::remove): New function.
337 (Free_list::allocate): New function.
338 (Free_list::dump): New function.
339 (Free_list::print_stats): New function.
340 (Layout_task_runner::run): Resize output file for incremental updates.
341 (Layout::Layout): Initialize new data members.
342 (Layout::set_incremental_base): New function.
343 (Layout::init_fixed_output_section): New function.
344 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
345 incremental updates.
346 (Layout::create_gold_note): Do not create gold note section for
347 incremental updates.
348 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
349 for incremental updates.
350 (Layout::set_section_offsets): For incremental updates, allocate space
351 from free list.
352 (Layout::create_symtab_sections): Layout with offsets relative to
353 start of section; for incremental updates, allocate space from free
354 list.
355 (Layout::create_shdrs): For incremental updates, allocate space from
356 free list.
357 (Layout::finish_dynamic_section): For incremental updates, do not
358 check --as-needed (fixed in subsequent patch).
359 * layout.h (class Free_list): New class.
360 (Layout::set_incremental_base): New function.
361 (Layout::incremental_base): New function.
362 (Layout::init_fixed_output_section): New function.
363 (Layout::allocate): New function.
364 (Layout::incremental_base_): New data member.
365 (Layout::free_list_): New data member.
366 * main.cc (main): Print Free_list statistics.
367 * object.cc (Relobj::finalize_incremental_relocs): Add
368 clear_counts parameter; clear counts only when clear_counts is set.
369 (Sized_relobj::Sized_relobj): Initialize new base class.
370 (Sized_relobj::do_layout): Don't report special sections.
371 (Sized_relobj::do_for_all_local_got_entries): New function.
372 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
373 symtab_off to all symbol table offsets.
374 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
375 * object.h (class Got_offset_list): Move to top of file.
376 (Object::Object): Allow case where input_file == NULL.
377 (Object::~Object): Likewise.
378 (Object::input_file): Assert that input_file != NULL.
379 (Object::lock): Allow case where input_file == NULL.
380 (Object::unlock): Likewise.
381 (Object::is_locked): Likewise.
382 (Object::token): Likewise.
383 (Object::release): Likewise.
384 (Object::is_incremental): New function.
385 (Object::get_mtime): New function.
386 (Object::for_all_local_got_entries): New function.
387 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
388 (Object::set_is_in_system_directory): New function.
389 (Object::is_in_system_directory): New function.
390 (Object::do_is_incremental): New function.
391 (Object::do_get_mtime): New function.
392 (Object::do_for_all_local_got_entries): New function.
393 (Object::is_in_system_directory_): New data member.
394 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
395 (class Sized_relobj_base): New class.
396 (class Sized_relobj): Derive from Sized_relobj_base.
397 (class Sized_relobj::Symbols): Redeclare from base class.
398 (class Sized_relobj::local_got_offset_list): Remove.
399 (class Sized_relobj::Output_sections): Redeclare from base class.
400 (class Sized_relobj::do_for_all_local_got_entries): New function.
401 (class Sized_relobj::write_local_symbols): Add offset parameter.
402 (class Sized_relobj::local_symbol_offset_): Update comment.
403 (class Sized_relobj::local_dynsym_offset_): Update comment.
404 * options.cc (Input_arguments::add_file): Remove const.
405 * options.h (Input_file_argument::Input_file_argument):
406 Initialize arg_serial_ (all constructors).
407 (Input_file_argument::set_arg_serial): New function.
408 (Input_file_argument::arg_serial): New function.
409 (Input_file_argument::arg_serial_): New data member.
410 (Input_arguments::Input_arguments): Initialize file_count_.
411 (Input_arguments::add_file): Remove const.
412 (Input_arguments::number_of_input_files): New function.
413 (Input_arguments::file_count_): New data member.
414 (Command_line::number_of_input_files): Call
415 Input_arguments::number_of_input_files.
416 * output.cc (Output_segment_headers::Output_segment_headers):
417 Set current size.
418 (Output_section::Input_section::current_data_size): New function.
419 (Output_section::Output_section): Initialize new data members.
420 (Output_section::add_input_section): Don't do merge sections for
421 an incremental link; allocate space from free list for an
422 incremental update.
423 (Output_section::add_output_section_data): Allocate space from
424 free list for an incremental update.
425 (Output_section::update_data_size): New function.
426 (Output_section::set_fixed_layout): New function.
427 (Output_section::reserve): New function.
428 (Output_segment::set_section_addresses): Remove const.
429 (Output_segment::set_section_list_addresses): Remove const; allocate
430 space from free list for an incremental update.
431 (Output_segment::set_offset): Adjust size of RELRO segment for an
432 incremental update.
433 * output.h (Output_data::current_data_size): Move here from
434 child classes.
435 (Output_data::pre_finalize_data_size): New function.
436 (Output_data::update_data_size): New function.
437 (Output_section_headers::update_data_size): new function.
438 (Output_section_data_build::current_data_size): Move to Output_data.
439 (Output_data_strtab::update_data_size): New function.
440 (Output_section::current_data_size): Move to Output_data.
441 (Output_section::set_fixed_layout): New function.
442 (Output_section::has_fixed_layout): New function.
443 (Output_section::reserve): New function.
444 (Output_section::update_data_size): New function.
445 (Output_section::has_fixed_layout_): New data member.
446 (Output_section::free_list_): New data member.
447 (Output_segment::set_section_addresses): Remove const.
448 (Output_segment::set_section_list_addresses): Remove const.
449 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
450 New function.
451 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
452 New function.
453 * readsyms.cc (Read_symbols::do_read_symbols): Add library
454 parameter when calling Add_symbols constructor; store argument
455 serial number for members of a lib group.
456 (Add_symbols::locks): Allow case where token == NULL.
457 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
458 (Read_member::~Read_member): New function.
459 (Read_member::is_runnable): New function.
460 (Read_member::locks): New function.
461 (Read_member::run): New function.
462 (Check_script::~Check_script): New function.
463 (Check_script::is_runnable): New function.
464 (Check_script::locks): New function.
465 (Check_script::run): New function.
466 (Check_library::~Check_library): New function.
467 (Check_library::is_runnable): New function.
468 (Check_library::locks): New function.
469 (Check_library::run): New function.
470 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
471 (Add_symbols::library_): New data member.
472 (class Read_member): New class.
473 (class Check_script): New class.
474 (class Check_library): New class.
475 * reloc.cc (Read_relocs::is_runnable): Allow case where
476 token == NULL.
477 (Read_relocs::locks): Likewise.
478 (Scan_relocs::locks): Likewise.
479 (Relocate_task::locks): Likewise.
480 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
481 to clear counters.
482 (Sized_relobj::incremental_relocs_scan): Fix comment.
483 (Sized_relobj::do_relocate): Pass output file offset to
484 write_local_symbols.
485 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
486 from class declaration.
487 * script.cc (read_input_script): Allocate Script_info; pass
488 argument serial number to report_script.
489 * script.h (class Script_info): Move to incremental.h.
490 * symtab.cc (Symbol_table::add_from_incrobj): New function.
491 * symtab.h (Symbol_table::add_from_incrobj): New function.
492 (Symbol_table::set_file_offset): New function.
493
b961d0d7
CC
4942011-04-05 Cary Coutant <ccoutant@google.com>
495
496 * incremental-dump.cc (dump_incremental_inputs): Change signature
497 to take a Sized_incremental_binary; change caller. Use readers
498 in Sized_incremental_binary.
499 * incremental.cc
500 (Sized_incremental_binary::find_incremental_inputs_sections):
501 Rename do_find_incremental_inputs_sections to this.
502 (Sized_incremental_binary::setup_readers): New function.
503 (Sized_incremental_binary::do_check_inputs): Check
504 has_incremental_info_ flag; move setup code to setup_readers;
505 use input readers.
506 (Sized_incremental_binary::do_file_is_unchanged): New function.
507 (Sized_incremental_binary::do_get_input_reader): New function.
508 * incremental.h (class Incremental_binary): Move to end of file.
509 (Incremental_binary::file_is_unchanged): New function.
510 (Incremental_binary::do_file_is_unchanged): New function.
511 (Incremental_binary::Input_reader): New class.
512 (Incremental_binary::get_input_reader): New function.
513 (class Sized_incremental_binary): Move to end of file.
514 (Sized_incremental_binary::Sized_incremental_binary): Setup the
515 input section reader classes.
516 (Sized_incremental_binary::has_incremental_info): New function.
517 (Sized_incremental_binary::inputs_reader): New function.
518 (Sized_incremental_binary::symtab_reader): New function.
519 (Sized_incremental_binary::relocs_reader): New function.
520 (Sized_incremental_binary::got_plt_reader): New function.
521 (Sized_incremental_binary::do_file_is_unchanged): New function.
522 (Sized_incremental_binary::Sized_input_reader): New class.
523 (Sized_incremental_binary::get_input_reader): New function.
524 (Sized_incremental_binary::find_incremental_inputs_sections):
525 Rename do_find_incremental_inputs_sections to this.
526 (Sized_incremental_binary::setup_readers): New function.
527 (Sized_incremental_binary::has_incremental_info_): New data member.
528 (Sized_incremental_binary::inputs_reader_): New data member.
529 (Sized_incremental_binary::symtab_reader_): New data member.
530 (Sized_incremental_binary::relocs_reader_): New data member.
531 (Sized_incremental_binary::got_plt_reader_): New data member.
532 (Sized_incremental_binary::current_input_file_): New data member.
533
a869183f
PP
5342011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
535
536 PR gold/12640
537 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
538 violation.
539
5402011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
541
542 * archive.cc (Archive::include_member): Adjust call to report_object.
543 (Add_archive_symbols::run): Add script_info to call to
544 report_archive_begin.
545 (Lib_group::include_member): Adjust call to report_object.
546 (Add_lib_group_symbols::run): Adjust call to report_object.
547 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
548 blocks. Add object count for script input files.
549 * incremental.cc (Incremental_inputs::report_archive_begin): Add
550 script_info parameter; change all callers.
551 (Incremental_inputs::report_object): Add script_info parameter;
552 change all callers.
553 (Incremental_inputs::report_script): Store backpointer to
554 incremental info entry.
555 (Output_section_incremental_inputs::set_final_data_size): Record
556 additional information for scripts.
557 (Output_section_incremental_inputs::write_info_blocks): Likewise.
558 * incremental.h (Incremental_script_entry::add_object): New function.
559 (Incremental_script_entry::get_object_count): New function.
560 (Incremental_script_entry::get_object): New function.
561 (Incremental_script_entry::objects_): New data member; adjust
562 constructor.
563 (Incremental_inputs::report_archive_begin): Add script_info parameter.
564 (Incremental_inputs::report_object): Add script_info parameter.
565 (Incremental_inputs_reader::get_object_count): New function.
566 (Incremental_inputs_reader::get_object_offset): New function.
567 * options.cc (Input_arguments::add_file): Return reference to
568 new input argument.
569 * options.h (Input_argument::set_script_info): New function.
570 (Input_argument::script_info): New function.
571 (Input_argument::script_info_): New data member; adjust all
572 constructors.
573 (Input_file_group::add_file): Return reference to new input argument.
574 (Input_file_lib::add_file): Likewise.
575 (Input_arguments::add_file): Likewise.
576 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
577 * script.cc (Parser_closure::Parser_closure): Add script_info
578 parameter; adjust all callers.
579 (Parser_closure::script_info): New function.
580 (Parser_closure::script_info_): New data member.
581 (read_input_script): Report scripts earlier to incremental info.
582 (script_add_file): Set script_info in Input_argument.
583 (script_add_library): Likewise.
584 * script.h (Script_options::Script_info): Rewrite class.
585
a869183f 5862011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
587
588 * archive.cc (Library_base::should_include_member): Move
589 method here from class Archive.
590 (Archive::Archive): Initialize base class.
591 (Archive::should_include_member): Move to base class.
592 (Archive::do_for_all_unused_symbols): New function.
593 (Add_archive_symbols::run): Remove redundant access to
594 incremental_inputs.
595 (Lib_group::Lib_group): Initialize base class.
596 (Lib_group::do_filename): New function.
597 (Lib_group::include_member): Pass pointer to Lib_group to
598 report_object.
599 (Lib_group::do_for_all_unused_symbols): New function.
600 (Add_lib_group_symbols::run): Report archive information for
601 incremental links.
602 * archive.h (class Library_base): New base class.
603 (class Archive): Derive from Library_base.
604 (Archive::filename): Move to base class.
605 (Archive::set_incremental_info): Likewise.
606 (Archive::incremental_info): Likewise.
607 (Archive::Should_include): Likewise.
608 (Archive::should_include_member): Likewise.
609 (Archive::Armap_entry): Remove.
610 (Archive::Unused_symbol_iterator): Remove.
611 (Archive::unused_symbols_begin): Remove.
612 (Archive::unused_symbols_end): Remove.
613 (Archive::do_filename): New function.
614 (Archive::do_get_mtime): New function.
615 (Archive::do_for_all_unused_symbols): New function.
616 (Archive::task_): Move to base class.
617 (Archive::incremental_info_): Likewise.
618 (class Lib_group): Derive from Library_base.
619 (Lib_group::do_filename): New function.
620 (Lib_group::do_get_mtime): New function.
621 (Lib_group::do_for_all_unused_symbols): New function.
622 (Lib_group::task_): Move to base class.
623 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
624 function.
625 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
626 function.
627 * incremental.cc (Incremental_inputs::report_archive_begin):
628 Use Library_base; call library's get_mtime; add incremental inputs
629 entry before members.
630 (class Unused_symbol_visitor): New class.
631 (Incremental_inputs::report_archive_end): Use Library_base; use
632 visitor class to record unused symbols; don't add incremental inputs
633 entry after members.
634 (Incremental_inputs::report_object): Use Library_base.
635 * incremental.h
636 (Incremental_archive_entry::Incremental_archive_entry): Remove
637 unused Archive parameter.
638 (Incremental_inputs::report_archive_begin): Use Library_base.
639 (Incremental_inputs::report_archive_end): Likewise.
640 (Incremental_inputs::report_object): Likewise.
641 * object.cc (Sized_relobj::do_for_all_global_symbols): New
642 function.
643 * object.h (Object::for_all_global_symbols): New function.
644 (Object::do_for_all_global_symbols): New function.
645 (Sized_relobj::do_for_all_global_symbols): New function.
646 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
647 function.
648 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
649 function.
650
61ab3e40
ILT
6512011-03-27 Ian Lance Taylor <iant@google.com>
652
653 * archive.cc (Archive::interpret_header): Return -1 if something
654 goes wrong. Change callers accordingly.
655
30e1f9e6
CC
6562011-03-25 Cary Coutant <ccoutant@google.com>
657
658 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
659 * testsuite/Makefile.in: Regenerate.
660
9c793f14
RÁE
6612010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
662
663 * plugin.cc (get_view): New.
664 (Plugin::load): Pass get_view to the plugin.
665 (Plugin_manager::get_view): New.
666
9312bb0a
ILT
6672011-03-21 Ian Lance Taylor <iant@google.com>
668
669 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 670 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 671
7e12ba9e
ST
6722011-03-21 Sriraman Tallam <tmsriram@google.com>
673
674 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
675 Change == to -eq.
676 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
677 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
678 Change == to -eq.
679 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
680 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
681
fd7a005d
ILT
6822011-03-14 Ian Lance Taylor <iant@google.com>
683
684 * script-sections.cc (Sort_output_sections::script_compare):
685 Rename from is_before, change return type.
686 (Sort_output_sections::operator()): Adjust accordingly.
687
ed16fd1b
ILT
6882011-03-11 Jeffrey Yasskin <jyasskin@google.com>
689
690 PR gold/12572
691 * testsuite/odr_violation2.cc: Add comment to make all error line
692 numbers double digits.
693 * testsuite/debug_msg.sh: Adjust expected errors.
694
71ff8986
ILT
6952011-03-09 Jeffrey Yasskin <jyasskin@google.com>
696
697 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
698 but mark earlier ones as non-canonical
699 (offset_to_iterator): Update search target and example
700 (do_addr2line): Return extra lines in a vector*
701 (format_file_lineno): Extract from do_addr2line
702 (one_addr2line): Add vector* out-param
703 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
704 when a lineno entry appeared last for its instruction
705 (Dwarf_line_info): Add vector* out-param
706 * object.cc (Relocate_info): Pass NULL for the vector* out-param
707 * symtab.cc (Odr_violation_compare): Include the lineno in the
708 comparison again.
709 (linenos_from_loc): New. Combine the canonical line for an
710 address with its other lines.
711 (True_if_intersect): New. Helper functor to make
712 std::set_intersection a query.
713 (detect_odr_violations): Compare sets of lines instead of just
714 one line for each function. This became less deterministic, but
715 has fewer false positives.
716 * symtab.h: Declarations.
717 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
718 mix an optimized and non-optimized object in the same binary
719 (odr_violation2.so): Same.
720 * testsuite/Makefile.in: Regenerate from Makefile.am.
721 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
722 * testsuite/debug_msg.sh: Update line numbers and add
723 assertions.
724 * testsuite/odr_violation1.cc: Use OdrDerived, in a
725 non-optimized context.
726 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
727 isn't inlined, and use OdrDerived in an optimized context.
728 * testsuite/odr_header1.h: Defines OdrDerived, where
729 optimization will change the
730 first-instruction-in-the-destructor's file and line number.
731 * testsuite/odr_header2.h: Defines OdrBase.
732
a19fefdc
ILT
7332011-03-09 Ian Lance Taylor <iant@google.com>
734
735 * fileread.cc (File_read::clear_views): Don't delete the whole
736 file view.
737
ecb351e9
ILT
7382011-03-08 Ian Lance Taylor <iant@google.com>
739
740 PR gold/12525
741 * fileread.cc: #include <climits>.
742 (GOLD_IOV_MAX): Define.
743 (File_read::read_multiple): Limit number of entries by iov_max.
744 * fileread.h (class File_read): Always set max_readv_entries to
745 128.
746
b821d13c
ILT
7472011-03-07 Ian Lance Taylor <iant@google.com>
748
749 PR gold/12525
750 * options.h (class General_options): Add -dy and -dn.
751
89243142
CC
7522011-03-02 Cary Coutant <ccoutant@google.com>
753
754 * testsuite/script_test_9.t: Add TLS segment.
755
d0773f31
ILT
7562011-03-02 Simon Baldwin <simonb@google.com>
757
758 * configure.ac: Add check for gnu_indirect_function support in
759 the toolchain building binutils.
760 * configure: Rebuild.
761
badc8139
RÁE
7622010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
763
764 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
765 plugin only symbols.
766 (Symbol_table::sized_finalize_symbol) Mark symbol only present
767 in plugin files as not needed in the symbol table.
768
4cf7a849
ST
7692011-02-11 Sriraman Tallam <tmsriram@google.com>
770
771 * output.cc (Output_section::add_input_section): Delay fill
772 generation for section ordering.
773
b578bd7d
ILT
7742011-02-09 Ian Lance Taylor <iant@google.com>
775
776 PR gold/12316
777 * object.h (class Sized_relobj): Remove clear_local_symbols.
778 * reloc.cc (Sized_relobj::do_relocate): Don't call
779 clear_local_symbols.
780
84ced98a
RÁE
7812010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
782
783 * plugin.cc (is_visible_from_outside): Return true for symbols
784 in the -u option.
785
55382fb7
ILT
7862011-02-04 Jeffrey Yasskin <jyasskin@google.com>
787
788 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
789 filename.
790
4e271fff
ST
7912011-02-02 Sriraman Tallam <tmsriram@google.com>
792
793 * icf.h (is_section_foldable_candidate): Change type of parameter
794 to std::string.
795 * icf.cc (Icf::find_identical_sections): Change type of local variable
796 section_name to be std::string.
797 (is_function_ctor_or_dtor): Change type of parameter to std::string.
798
d433c3ac
ILT
7992011-01-25 Ian Lance Taylor <iant@google.com>
800
801 * script.cc (script_add_extern): Rewrite to use
802 add_symbol_reference.
803
880473a6
DK
8042011-01-25 Doug Kwan <dougkwan@google.com>
805
d433c3ac 806 * icf.cc (get_section_contents): Always lock section's object.
880473a6 807
f30f86fa
ILT
8082011-01-24 Ian Lance Taylor <iant@google.com>
809
810 * options.h (class General_options): Accept
811 --no-detect-odr-violations.
812
8e51a0b9
ILT
8132011-01-24 Ian Lance Taylor <iant@google.com>
814
815 * version.cc (version_string): Bump to 1.11.
816
0f3b89d8
ILT
8172011-01-24 Ian Lance Taylor <iant@google.com>
818
819 * plugin.cc (class Plugin_rescan): Define new class.
820 (Plugin_manager::claim_file): Set any_claimed_.
821 (Plugin_manager::save_archive): New function.
822 (Plugin_manager::save_input_group): New function.
823 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
824 necessary.
825 (Plugin_manager::new_undefined_symbol): New function.
826 (Plugin_manager::rescan): New function.
827 (Plugin_manager::rescannable_defines): New function.
828 (Plugin_manager::add_input_file): Set any_added_.
829 * plugin.h (class Plugin_manager): define new fields rescannable_,
830 undefined_symbols_, any_claimed_, and any_added_. Declare
831 Plugin_rescan as friend. Declare new functions.
832 (Plugin_manager::Rescannable): Define type.
833 (Plugin_manager::Rescannable_list): Define type.
834 (Plugin_manager::Undefined_symbol_list): Define type.
835 (Plugin_manager::Plugin_manager): Initialize new fields.
836 * archive.cc (Archive::defines_symbol): New function.
837 (Add_archive_symbols::run): Pass archive to plugins if any.
838 * archive.h (class Archive): Declare defines_symbol.
839 * readsyms.cc (Input_group::~Input_group): New function.
840 (Finish_group::run): Pass input_group to plugins if any.
841 * readsyms.h (class Input_group): Declare destructor.
842 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
843 any.
844
3bb951e5
ILT
8452011-01-10 Ian Lance Taylor <iant@google.com>
846
847 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
848 section as relro.
849 (Layout::set_segment_offsets): Reset increase_relro before calling
850 set_section_addresses a second time.
851
0aa45fac
CC
8522011-01-04 Cary Coutant <ccoutant@google.com>
853
854 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
855 sections before NOBITS sections.
856
0db46eb4
L
8572011-01-01 H.J. Lu <hongjiu.lu@intel.com>
858
859 * version.cc (print_version): Update copyright to 2011.
860
829c9745
CC
8612010-12-23 Cary Coutant <ccoutant@google.com>
862
863 * output.h (Output_data_reloc::add_output_section): Pass OD instead
864 of OS to this->add. Add OD parameter to second form of the function.
865
7500420b
ILT
8662010-12-20 Ian Lance Taylor <iant@google.com>
867
868 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
869 second of two consecutive entries with same offset.
870
f8e9a930
RW
8712010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
872
873 * testsuite/Makefile.am (ifuncmain2static_LDADD)
874 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
875 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
876 to avoid unneeded links against $(LDADD).
877 * testsuite/Makefile.in: Regenerate.
878
2fbb4320
ILT
8792010-12-15 Ian Lance Taylor <iant@google.com>
880
881 PR gold/12324
882 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
883 for R_X86_64_32 and R_X86_64_PC32.
884 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
885 ver_matching_def_pic.o.
886 (ver_matching_def_pic.o): New target.
887
fedb228d
RW
8882010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
889
890 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
891 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
892 Move definition before File_read::View member definitions.
893 (File_read::View::~View): Initialize and hold lock before
894 updating current_mapped_bytes.
895
9b547ce6
RW
8962010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
897
898 * dwarf_reader.cc: Remove outdated comment.
899 * gold-threads.cc: Fix typo in error message.
900 * archive.cc: Fix typos in comments.
901 * archive.h: Likewise.
902 * arm-reloc-property.cc: Likewise.
903 * arm-reloc-property.h: Likewise.
904 * arm-reloc.def: Likewise.
905 * arm.cc: Likewise.
906 * attributes.h: Likewise.
907 * cref.cc: Likewise.
908 * ehframe.cc: Likewise.
909 * fileread.h: Likewise.
910 * gold.h: Likewise.
911 * i386.cc: Likewise.
912 * icf.cc: Likewise.
913 * incremental.h: Likewise.
914 * int_encoding.cc: Likewise.
915 * layout.h: Likewise.
916 * main.cc: Likewise.
917 * merge.h: Likewise.
918 * object.cc: Likewise.
919 * object.h: Likewise.
920 * options.cc: Likewise.
921 * readsyms.cc: Likewise.
922 * reduced_debug_output.cc: Likewise.
923 * reloc.cc: Likewise.
924 * script-sections.cc: Likewise.
925 * sparc.cc: Likewise.
926 * symtab.h: Likewise.
927 * target-reloc.h: Likewise.
928 * target.cc: Likewise.
929 * target.h: Likewise.
930 * timer.cc: Likewise.
931 * timer.h: Likewise.
932 * x86_64.cc: Likewise.
933
83e17bd5
CC
9342010-12-09 Cary Coutant <ccoutant@google.com>
935
936 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
937 stack.
938 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
939 parameter; change all callers.
940 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
941 * options.h (warn_execstack): New option.
942
017257f8
DK
9432010-12-07 Doug Kwan <dougkwan@google.com>
944
945 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
946 like function call relocations.
947
c20cbc06
ILT
9482010-12-07 Ian Lance Taylor <iant@google.com>
949
950 * archive.cc (Archive::get_elf_object_for_member): Permit
951 punconfigured to be NULL.
952 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
953 (Archive::include_member): Pass NULL to get_elf_object_for_member
954 if we searched for the archive and this is the first included
955 object.
956
4dbfafcc
ILT
9572010-12-01 Ian Lance Taylor <iant@google.com>
958
959 * dwarf_reader.h (class Sized_dwarf_line_info): Add
960 track_relocs_type_ field.
961 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
962 Set track_relocs_type_.
963 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
964 contents when using RELA relocs.
965 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
966 reloc_map_.
967 * reloc.cc (Track_relocs::next_addend): New function.
968 * reloc.h (class Track_relocs): Declare next_addend.
969
e5e19edd
ILT
9702010-12-01 Ian Lance Taylor <iant@google.com>
971
972 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
973 virtual destructor.
974
9a5ce24c
ILT
9752010-12-01 Ian Lance Taylor <iant@google.com>
976
977 * README: Update compilers known to work and fail.
978
c7791212
NC
9792010-11-23 Matthias Klose <doko@ubuntu.com>
980
981 * configure.in: For --enable-gold, handle value `default' instead of
982 `both*'. Always install ld as ld.bfd, install as ld if gold is
983 not the default.
984 * configure: Regenerate.
985
0ad220c9
DK
9862010-11-18 Doug Kwan <dougkwan@google.com>
987
988 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
989 and right_alignment to be zero. Store result alignment only if it is
990 greater than existing alignment.
991
ab8056e0
CC
9922010-11-16 Cary Coutant <ccoutant@google.com>
993
994 PR gold/12220
995 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
996 Check for ".zdebug_line".
997
fd064a5b
CC
9982010-11-16 Doug Kwan <dougkwan@google.com>
999 Cary Coutant <ccoutant@google.com>
1000
1001 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1002 by reference; adjust all callers.
1003 * output.cc (Output_segment::set_section_addresses): Adjust references
1004 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1005 list is empty.
1006 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1007 end at page boundary.
1008
6fc6ea19
CC
10092010-11-16 Cary Coutant <ccoutant@google.com>
1010
1011 PR gold/12220
1012 * layout.cc (Layout::choose_output_section): Transform names of
1013 compressed sections even when using a script with a SECTIONS clause.
1014 (Layout::output_section_name): Remove code to transform
1015 compressed debug section names.
1016 * output.cc (Output_section::add_input_section): Use uncompressed
1017 section size when tracking input sections.
1018
95a2c8d6
RS
10192010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1020
1021 * symtab.h (Symbol::NON_PIC_REF): Remove.
1022 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1023 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1024 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1025 (Symbol::use_plt_offset): Take a flags argument and pass it
1026 directly to needs_dynamic_reloc. Restrict check for undefined
1027 weak symbols to function calls.
1028 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1029 (Target_arm::Scan::global): Use it.
1030 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1031 (Target_arm::Relocate::relocate): Likewise.
1032 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1033 parameter with an r_type parameter. Use get_reference_flags
1034 to get the flags.
1035 (Target_arm::Relocate::relocate): Update accordingly.
1036 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1037 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1038 (Target_i386::Scan::global): Likewise.
1039 (Target_i386::Relocate::relocate): Likewise.
1040 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1041 parameter with an r_type parameter. Use get_reference_flags
1042 to get the flags.
1043 (Target_i386::Relocate::relocate): Update accordingly.
1044 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1045 (Target_powerpc::Scan::global): Use it.
1046 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1047 (Target_powerpc::Relocate::relocate): Likewise.
1048 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1049 (Target_sparc::Scan::global): Use it.
1050 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1051 (Target_sparc::Relocate::relocate): Likewise.
1052 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1053 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1054 (Target_x86_64::Scan::global): Likewise.
1055 (Target_x86_64::Relocate::relocate): Likewise.
1056
f625ae50
DK
10572010-11-08 Doug Kwan <dougkwan@google.com>
1058 Cary Coutant <ccoutant@google.com>
1059
1060 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1061 (Arm_exidx_merge_section::section_contents_): New data member.
1062 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1063 (Arm_input_section::~Arm_input_section): De-allocate memory.
1064 (Arm_input_section::original_contents_): New data member.
1065 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1066 in parameters instead of calling Object::section_contents without
1067 locking.
1068 (Arm_output_section::group_section): New parameter TASK. Pass it
1069 to callees that need locking objects.
1070 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1071 to lock EXIDX input sections. Fix a formatting issue. Call
1072 Arm_exidx_merged_section::build_contents to create merged section
1073 contents.
1074 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1075 to lock object of stub table owner.
1076 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1077 TEXT_SIZE to initialize data member TEXT_SIZE_.
1078 (Arm_exidx_input_section::addralign): Fix typo in comment.
1079 (Arm_exidx_input_section::text_size): New method.
1080 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1081 that require locking objects. Lock objects before scanning for stubs
1082 and updating local symbols.
1083 (Arm_input_section<big_endian>::init): Copy contents of original
1084 input section.
1085 (Arm_input_section<big_endian>::do_write): Use saved contents of
1086 original input section instead of calling Object::section_contents
1087 without locking.
1088 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1089 size without calling Object::section_size().
1090 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1091 for size. Allocate a buffer for merged EXIDX entries.
1092 (Arm_exidx_merged_section::build_contents): New method.
1093 (Arm_exidx_merged_section::do_write): Move merge section contents
1094 building code to Arm_exidx_merged_section::build_contetns. Write
1095 out contetns in buffer instead of building it on the fly.
1096 (Arm_relobj::make_exidx_input_section): Also pass text section size
1097 to Arm_exidx_input_section constructor.
1098 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1099 (Arm_dynobj::do_read_symbols): Fix memory leak.
1100 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1101 * target.h: (class Task): Add forward declaration.
1102 (Target::relax): Add new parameter TASK and pass it to
1103 Target::do_relax().
1104 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1105
5f9bcf58
CC
11062010-11-05 Cary Coutant <ccoutant@google.com>
1107
1108 PR gold/10708
1109 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1110 object when reading from the file.
1111 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1112 second layout pass.
1113 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1114 when reading section contents.
1115 (get_section_contents): Likewise.
1116 (icf::find_identical_sections): Likewise.
1117 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1118 object when reading from the file.
1119 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1120 the object when doing deferred section layout.
1121
e597fa08
NC
11222010-11-03 Nick Clifton <nickc@redhat.com>
1123
1124 PR gold/12001
1125 * script.h (class Symbol_assignment: name): New member. Returns
1126 the name of the symbol.
1127 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1128 Returns true if the given symbol name is on the list of
1129 assignments wating to be processed.
1130 * archive.cc (should_incldue_member): If the symbol is undefined,
1131 check to see if it is on the list of symbols pending assignment.
1132
3f9a3278
ILT
11332010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1134
1135 * script-sections.cc (Script_sections::find_memory_region): Check
1136 for a NULL output section pointer.
1137
d06fb4d1
DK
11382010-10-29 Doug Kwan <dougkwan@google.com>
1139
1140 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1141 Output_section::add_relaxed_input_section.
1142 * output.cc (Output_section::add_relaxed_input_section): Add new
1143 arguments LAYOUT and NAME. Set section order index.
1144 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1145 Copy section order index.
1146 * output.h (Output_section::add_relaxed_input_section): Add new
1147 arguments LAYOUT and NAME.
1148
90e24de5
ILT
11492010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1150
1151 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1152 NATIVE_OR_CROSS_LINKER.
1153 * testsuite/Makefile.in: Regenerate.
1154
c9484ea5
DK
11552010-10-20 Doug Kwan <dougkwan@google.com>
1156
1157 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1158 without SHF_LINK_ORDER flags.
1159 * layout.cc (Layout::choose_output_section): Do not filter
1160 SHF_LINK_ORDER flag in a relocatable link.
1161
5bc2f5be
CC
11622010-10-17 Cary Coutant <ccoutant@google.com>
1163
1164 * output.h (Output_segment::set_section_addresses): Change function
1165 signature. Update all callers.
1166 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1167 sections.
1168 (Output_segment::set_section_addresses): Align after last TLS
1169 section. Add padding before last relro section instead of after.
1170
0c91cf04
DK
11712010-10-17 Doug Kwan <dougkwan@google.com>
1172
1173 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1174 GOT output section to be writable.
1175
8c21d9d3
CC
11762010-10-14 Cary Coutant <ccoutant@google.com>
1177
1178 * debug.h (DEBUG_INCREMENTAL): New flag.
1179 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1180 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1181 mode.
1182 * incremental.cc (report_command_line): Ignore all forms of
1183 --incremental.
1184 * layout.cc (Layout::Layout): Check parameters for incremental link
1185 mode.
1186 * options.cc (General_options::parse_incremental): New function.
1187 (General_options::parse_no_incremental): New function.
1188 (General_options::parse_incremental_full): New function.
1189 (General_options::parse_incremental_update): New function.
1190 (General_options::incremental_mode_): New data member.
1191 (General_options::finalize): Check incremental_mode_.
1192 * options.h (General_options): Update help text for --incremental.
1193 Add --no-incremental, --incremental-full, --incremental-update.
1194 (General_options::Incremental_mode): New enum type.
1195 (General_options::incremental_mode): New function.
1196 (General_options::incremental_mode_): New data member.
1197 * parameters.cc (Parameters::incremental_mode_): New data member.
1198 (Parameters::set_options): Set incremental_mode_.
1199 (Parameters::set_incremental_full): New function.
1200 (Parameters::incremental): New function.
1201 (Parameters::incremental_update): New function.
1202 (set_parameters_incremental_full): New function.
1203 * parameters.h (Parameters::set_incremental_full): New function.
1204 (Parameters::incremental): New function.
1205 (Parameters::incremental_update): New function.
1206 (Parameters::incremental_mode_): New data member.
1207 (set_parameters_incremental_full): New function.
1208 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1209 incremental link mode.
1210 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1211 (Sized_relobj::do_relocate_sections): Likewise.
1212 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1213 option.
1214 * testsuite/Makefile.in: Regenerate.
1215 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1216
bb32aa18 12172010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1218
1219 * script-sections.h (class Script_sections): Make
1220 Sections_elements typedef public.
1221 * script-sections.cc (class Sort_output_sections): Add elements_
1222 field. Add constructor which sets it; change all callers.
1223 (Sort_output_sections::is_before): New function.
1224 (Sort_output_sections::operator()): Call is_before.
1225 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1226 conditional.
1227 * testsuite/script_test_10.sh: New test. Test script section
1228 order.
1229 * testsuite/script_test_10.t: Likewise.
1230 * testsuite/script_test_10.s: Likewise.
1231 * testsuite/Makefile.am: Wrap the cross linker tests and the
1232 common tests into NATIVE_OR_CROSS_LINKER.
1233 (check_SCRIPTS): Add script_test_10.sh.
1234 (check_DATA): Add script_test_10.stdout.
1235 (script_test_10.o, script_test_10): New targets.
1236 (script_test_10.stdout): New target.
1237 * configure, testsuite/Makefile.in: Regenerate.
1238
3cef7179
ILT
12392010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1240
1241 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
1242 error for the deprecated relocations.
1243 (Target_arm::Scan::global): Likewise.
1244 (Target_arm::Relocate::relocate): Likewise.
1245
7411e9a8
RS
12462010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
1247
1248 * fileread.cc (Input_file::find_file): Initialize *found_name
1249 and *namep when using the fallback search for case 4.
1250
6a9da32a
CC
12512010-10-11 Cary Coutant <ccoutant@google.com>
1252
1253 * options.h (class General_options): Redefine -z lazy as an alias for
1254 the negation of -z now.
1255
ac897c20
ILT
12562010-10-11 Ian Lance Taylor <iant@google.com>
1257
1258 * resolve.cc (symbol_to_bits): Report the value of the unsupported
1259 binding.
1260
ea5cae92
NC
12612010-10-06 Nick Clifton <nickc@redhat.com>
1262
1263 * script-sections.cc(class Memory_region): Remove
1264 current_lma_offset_ field. Rename current_vma_offset_ to
1265 current_offset_. Add last_section_ field.
1266 (Memory_region::get_current_vma_address): Rename to
1267 get_current_address.
1268 (Memory_region::get_current_lma_address): Delete.
1269 (Memory_region::increment_vma_offset): Rename to
1270 increment_offset.
1271 (Memory_region::increment_lma_offset): Delete.
1272 (Memory_region::attributes_compatible): New method. Returns
1273 true if the provided section is compatible with the region.
1274 (Memory_region::get_last_section): New method. Returns the last
1275 section to use the region.
1276 (Memory_region::set_last_section): New method. Stores the last
1277 section to use the region.
1278 (Script_sections::block_in_region): New method. Returns true if
1279 a block of memory is contained within a region.
1280 (Script_sections::find_memory_region): New method. Locates a
1281 memory region to be used to set a VMA or LMA address.
1282 (Output_section_definition::set_section_addresses): Add code to
1283 check for addresses set by memory regions.
1284 (Output_segment::set_section_addresses): Remove memory region
1285 walking code.
1286 (Script_sections::create_segment): Add a warning if a header
1287 segment is created outside of any region.
1288 * script-sections.h (class Script_sections): Add prototypes for
1289 find_memory_region and block_in_region methods.
1290 * testsuite/memory_test.s: Use .long instead of .word.
1291 * testsuite/memory_test.t: Add some more output sections.
1292 * testsuite/memory_test.sh: Update expected output.
1293
a9bfd952
DK
12942010-10-02 Doug Kwan <dougkwan@google.com>
1295
1296 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
1297 defintion to symtab.h
1298 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
1299 declaration to defintion.
1300
bacff3ab
NC
13012010-10-01 Nick Clifton <nickc@redhat.com>
1302
1303 * expression.cc (eval): Replace dummy argument with NULL.
1304 (eval_maybe_dot): Check for a NULL result section pointer.
1305 (Symbol_expression::value): Likewise.
1306 (Dot_expression::value): Likewise.
1307 (BINARY_EXPRESSION): Likewise.
1308 (Max_expression::value): Likewise.
1309 (Min_expression::value): Likewise.
1310 (Absolute_expression::value): Likewise.
1311 (Addr_expression::value_from_output_section): Likewise.
1312 (Loaddddr_expression::value_from_output_section): Likewise.
1313 (Segment_start_expression::value): Likewise.
1314 * script-sections.cc
1315 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
1316 argument with NULL.
1317 (Sections_elememt_dot_assignment::set_section_addresses):
1318 Likewise.
1319 (Output_data_expression::do_write_to_buffer): Likewise.
1320 (Output_section_definition::finalize_symbols): Likewise.
1321 (Output_section_definition::set_section_addresses): Likewise.
1322
f81bc8b5
DK
13232010-09-30 Doug Kwan <dougkwan@google.com>
1324
1325 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
1326
c95e9f27
ST
13272010-09-28 Sriraman Tallam <tmsriram@google.com>
1328
1329 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 1330 function.
c95e9f27
ST
1331 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
1332 virtual function.
1333 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
1334 virtual function.
1335 * icf.cc (get_section_contents): Inline merge sections only when
1336 target allows it.
1337
3cac54d2
RW
13382010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1339
1340 * configure: Regenerate.
1341
2904037a
ILT
13422010-09-17 Ian Lance Taylor <iant@google.com>
1343
1344 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
1345 * testsuite/Makefile.am (memory_test.o): New target.
1346 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
1347 memory_test.t.
1348 * testsuite/Makefile.in: Rebuild.
2904037a 1349
bca7fb63
DK
13502010-09-17 Doug Kwan <dougkwan@google.com>
1351
1352 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
1353 defintion if relocation uses GOT entries of the symbol.
1354 * testsuite/icf_safe_test.sh: Fix test.
1355 * testsuite/icf_safe_so_test.sh: Fix test.
1356
4ef28648
CC
13572010-09-16 Cary Coutant <ccoutant@google.com>
1358
1359 * script_sections.cc (class Memory_region): Remove "NULL" from
1360 vector initializations.
1361
793990de
CC
13622010-09-15 Cary Coutant <ccoutant@google.com>
1363
1364 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
1365 Resolve forwarding symbols.
1366
81e015e2
DK
13672010-09-15 Doug Kwan <dougkwan@google.com>
1368
1369 * gold/testsuite/script_test_3.t: Add ARM special sections.
1370 * gold/testsuite/script_test_4.t: Same.
1371 * gold/testsuite/script_test_5.t: Same.
1372 * gold/testsuite/script_test_6.t: Same.
1373 * gold/testsuite/script_test_7.t: Same.
1374 * gold/testsuite/script_test_7.t: Same.
1375 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
1376
36171d64
CC
13772010-09-14 Cary Coutant <ccoutant@google.com>
1378
1379 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
1380 (Target_x86_64::Relocate::relocate_tls): Replace check for
1381 saw_tls_block_reloc_ with test for executable section.
1382
d89051bd
CC
13832010-09-12 Cary Coutant <ccoutant@google.com>
1384
1385 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
1386 position-independent executables to shared libraries need dynamic
1387 relocations.
1388 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
1389 position-independent executables.
1390 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
1391 * testsuite/Makefile.in: Regenerate.
1392
fca41f0f
NC
13932010-09-10 Nick Clifton <nickc@redhat.com>
1394
1395 PR gold/11997
1396 * testsuite/memory_test.t: Discard any sections that are not
1397 needed.
1398
6695e4b3
L
13992010-09-09 H.J. Lu <hongjiu.lu@intel.com>
1400
1401 PR gold/11996
1402 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
1403 "This::" to work around a bug in gcc 4.2.
1404
1405 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
1406
0f72bf6f
RÁE
14072010-09-09 Rafael Espindola <espindola@google.com>
1408
1409 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
1410 sections with different PF_X flags in the same segment.
1411 (Layout::find_first_load_seg): Search all segments to find the first
1412 one.
1413 * options.h (rosegment): New.
1414
14152010-09-08 Rafael Espindola <espindola@google.com>
a6577478 1416
05a79166 1417 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 1418
aa98ff75
DK
14192010-09-08 Doug Kwan <dougkwan@google.com>
1420
1421 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
1422 (Arm_relobj::do_relocate_sections): Add new parameter for output
1423 file to match the parent.
1424 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
1425 of local symbols instead of input values. Update code to track
1426 changes in gold::relocate_section.
1427 * object.cc (Sized_relobj::compute_final_local_value): New methods.
1428 (Sized_relobj::compute_final_local_value_internal): New methods.
1429 (Sized_relobj::do_finalize_local_symbols): Move code from loop
1430 body into private version of Sized_relobj::compute_final_local_value.
1431 Call the inline method.
1432 * object.h (Symbol_value::Symbol_value): Define destructor. Free
1433 merged symbol value if there is one.
1434 (Symbol_value::has_output_value): New method defintiion.
1435 (Sized_relobj::Compute_final_local_value_status): New enum type.
1436 (Sized_relobj::compute_final_local_value): New methods.
1437 (Sized_relobj::compute_final_local_value_internal): New methods.
1438 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
1439 and arm_cortex_a8.sh.
1440 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
1441 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
1442 New tests.
1443 * Makefile.in: Regenerate.
1444 * testsuite/arm_bl_out_of_range.s: Update test.
1445 * testsuite/thumb_bl_out_of_range.s: Ditto.
1446 * testsuite/thumb_blx_out_of_range.s: Ditto.
1447 * testsuite/arm_branch_out_of_range.sh: New file.
1448 * testsuite/arm_cortex_a8.sh: Ditto.
1449 * testsuite/arm_cortex_a8_b.s: Ditto.
1450 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
1451 * testsuite/arm_cortex_a8_b_local.s: Ditto.
1452 * testsuite/arm_cortex_a8_bl.s: Ditto.
1453 * testsuite/arm_cortex_a8_blx.s: Ditto.
1454 * testsuite/arm_cortex_a8_local.s: Ditto.
1455 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
1456 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
1457
05a79166
L
14582010-09-08 Rafael Espindola <espindola@google.com>
1459
1460 * Makefile.am (memory_test.stdout): Run readelf with -W.
1461 * Makefile.in: Regenerate.
1462 * testsuite/memory_test.sh: Make the regexps accept both 32 and
1463 64 bit output.
1464
33dbc701
RÁE
14652010-09-08 Rafael Espindola <espindola@google.com>
1466
1467 * script-sections.cc (Script_sections::add_memory_region): Convert
1468 field precision to int.
1469 * script.cc (script_set_section_region, script_set_section_region):
1470 Convert field precision to int.
1471
731ca54a
RÁE
14722010-09-08 Rafael Espindola <espindola@google.com>
1473
1474 * arm.cc (do_finalize_sections): Create the __exidx_start and
1475 __exdix_end symbols even when the section is missing.
1476
7f8cd844
NC
14772010-09-08 Nick Clifton <nickc@redhat.com>
1478
1479 * README: Remove claim that MEMORY is not supported.
1480 * expression.cc (script_exp_function_origin)
1481 (script_exp_function_length): Move from here to ...
1482 * script.cc: ... here.
1483 (script_set_section_region, script_add_memory)
1484 (script_parse_memory_attr, script_include_directive): New
1485 functions.
1486 * script-sections.cc
1487 (class Memory_region): New class.
1488 (class Output_section_definition): Add set_memory_region,
1489 set_section_vma, set_section_lma and get_section_name methods.
1490 (class Script_Sections): Add add_memory_region,
1491 find_memory_region, find_memory_region_origin,
1492 find_memory_region_length and set_memory_region methods.
1493 Have set_section_addresses method walk the list of set memory
1494 regions.
1495 Extend the print methos to display memory regions.
1496 * script-sections.h: Add prototypes for new methods.
1497 Add enum for MEMORY region attributes.
1498 * yyscript.y: Add support for parsing MEMORY regions.
1499 * script-c.h: Add prototypes for new functions.
1500 * testsuite/Makefile.am: Add test of MEMORY region functionality.
1501 * testsuite/Makefile.in: Regenerate.
1502 * testsuite/memory_test.sh: New script.
1503 * testsuite/memory_test.s: New assembler source file.
1504 * testsuite/memory_test.t: New linker script.
1505
a4649286
DK
15062010-08-27 Doug Kwan <dougkwan@google.com>
1507
1508 * gold/resolve.cc (Symbol_table::should_override): Let a weak
1509 reference override an existing dynamic weak reference.
1510 * testsuite/Makefile.am: Add new test dyn_weak_ref.
1511 * testsuite/Makefile.in: Regenerate.
1512 * testsuite/dyn_weak_ref.sh: New file.
1513 * testsuite/dyn_weak_ref_1.c: Ditto.
1514 * testsuite/dyn_weak_ref_2.c: Ditto.
1515
b56648ad
ILT
15162010-08-27 Ian Lance Taylor <iant@google.com>
1517
1518 * incremental.h (class Incremental_input_entry): Add virtual
1519 destructor.
1520
809313cb
ILT
15212010-08-27 Ian Lance Taylor <iant@google.com>
1522
1523 * testsuite/start_lib_test_3.c: Mark t3 as used.
1524
11e32464
NC
15252010-08-27 Nick Clifton <nickc@redhat.com>
1526
1527 * options.cc (version_script): Fix small typo in previous
1528 whitespace tidyup.
1529
ca09d69a
NC
15302010-08-25 Nick Clifton <nickc@redhat.com>
1531
1532 * archive.cc: Formatting fixes: Remove whitespace between
1533 typename and following asterisk. Remove whitespace between
1534 function name and opening parenthesis.
1535 * archive.h: Likewise.
1536 * arm.cc: Likewise.
1537 * attributes.cc: Likewise.
1538 * attributes.h: Likewise.
1539 * common.cc: Likewise.
1540 * copy-relocs.cc: Likewise.
1541 * dirsearch.h: Likewise.
1542 * dynobj.cc: Likewise.
1543 * ehframe.cc: Likewise.
1544 * ehframe.h: Likewise.
1545 * expression.cc: Likewise.
1546 * fileread.cc: Likewise.
1547 * fileread.h: Likewise.
1548 * gc.h: Likewise.
1549 * gold-threads.cc: Likewise.
1550 * gold.cc: Likewise.
1551 * i386.cc: Likewise.
1552 * icf.h: Likewise.
1553 * incremental-dump.cc: Likewise.
1554 * incremental.cc: Likewise.
1555 * layout.cc: Likewise.
1556 * layout.h: Likewise.
1557 * main.cc: Likewise.
1558 * merge.cc: Likewise.
1559 * merge.h: Likewise.
1560 * object.cc: Likewise.
1561 * object.h: Likewise.
1562 * options.cc: Likewise.
1563 * options.h: Likewise.
1564 * output.cc: Likewise.
1565 * output.h: Likewise.
1566 * plugin.cc: Likewise.
1567 * plugin.h: Likewise.
1568 * powerpc.cc: Likewise.
1569 * reloc.cc: Likewise.
1570 * script-c.h: Likewise.
1571 * script-sections.cc: Likewise.
1572 * script.cc: Likewise.
1573 * stringpool.cc: Likewise.
1574 * symtab.cc: Likewise.
1575 * symtab.h: Likewise.
1576 * target.cc: Likewise.
1577 * timer.cc: Likewise.
1578 * timer.h: Likewise.
1579 * version.cc: Likewise.
1580 * x86_64.cc: Likewise.
1581
b8fa8750
NC
15822010-08-24 Nick Clifton <nickc@redhat.com>
1583
1584 PR 11899
1585 * layout.cc (segment_precedes): Sort segments by their physical
1586 addresses, if they have been set.
1587
9919d93b
CC
15882010-08-23 Cary Coutant <ccoutant@google.com>
1589
1590 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
1591 symbols data.
1592 (Lib_group::include_member): Unlock object after deleting its
1593 symbols data.
1594 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
1595 the bug fixed here.
1596
97b4be1c
CC
15972010-08-19 Neil Vachharajani <nvachhar@google.com>
1598 Cary Coutant <ccoutant@google.com>
1599
1600 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
1601 constructor, and set_blocker.
1602 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
1603 readsyms_blocker_.
1604 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
1605 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
1606 * testsuite/Makefile.am (start_lib_test): New test case.
1607 * testsuite/Makefile.in: Regenerate.
1608 * testsuite/start_lib_test_main.c: New file.
1609 * testsuite/start_lib_test_1.c: New file.
1610 * testsuite/start_lib_test_2.c: New file.
1611 * testsuite/start_lib_test_3.c: New file.
1612
dd0b1884
ILT
16132010-08-19 Ian Lance Taylor <iant@google.com>
1614
1615 * Makefile.in: Rebuild with automake 1.11.1.
1616 * aclocal.m4: Likewise.
1617 * testsuite/Makefile.in: Likewise.
1618
7223e9ca
ILT
16192010-08-19 Ian Lance Taylor <iant@google.com>
1620
1621 PR 10893
1622 * i386.cc (class Output_data_plt_i386): Update declarations.
1623 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
1624 local_ifuncs_ fields.
1625 (Target_i386::do_plt_section_for_global): New function.
1626 (Target_i386::do_plt_section_for_local): New function.
1627 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
1628 parameter; change all callers. Initialize global_ifuncs_ and
1629 local_ifuncs_. If doing a static link define __rel_iplt_start and
1630 __rel_iplt_end.
1631 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
1632 (Output_data_plt_i386::add_local_ifunc_entry): New function.
1633 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
1634 symbols.
1635 (Target_i386::make_plt_section): New function, broken out of
1636 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
1637 (Target_i386::make_plt_entry): Call make_plt_section.
1638 (Target_i386::make_local_ifunc_plt_entry): New function.
1639 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
1640 (Target_i386::Scan::local): Handle IFUNC symbols. Add
1641 R_386_IRELATIVE to switch.
1642 (Target_i386::Scan::global): Likewise.
1643 (Target_i386::Relocate::relocate): Likewise.
1644 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
1645 switch.
1646 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
1647 (Target_x86_64::do_plt_section_for_global): New function.
1648 (Target_x86_64::do_plt_section_for_local): New function.
1649 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
1650 parameter; change all callers. If doing a static link define
1651 __rela_iplt_start and __rela_iplt_end.
1652 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
1653 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
1654 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
1655 to point to .plt.
1656 (Target_x86_64::make_local_ifunc_plt_entry): New function.
1657 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
1658 switch.
1659 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
1660 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
1661 R_X86_64_IRELATIVE to switch.
1662 (Target_x86_64::Scan::global): Likewise.
1663 (Target_x86_64::Relocate::relocate): Likewise.
1664 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
1665 switch.
1666 * target.h (class Target): Add plt_section_for_global and
1667 plt_section_for_local functions. Add do_plt_section_for_global
1668 and do_plt_section_for_local virtual functions.
1669 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
1670 clarifying comments.
1671 (Symbol::use_plt_offset): Handle IFUNC symbol.
1672 * object.cc (Sized_relobj::Sized_relobj): Initialize
1673 local_plt_offsets_.
1674 (Sized_relobj::local_has_plt_offset): New function.
1675 (Sized_relobj::local_plt_offset): New function.
1676 (Sized_relobj::set_local_plt_offset): New function.
1677 (Sized_relobj::do_count): Handle IFUNC symbol.
1678 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
1679 a bit away from input_shndx_ field. Add set_is_func_symbol and
1680 is_ifunc_symbol functions.
1681 (class Sized_relobj): Update declarations. Remove Tls_got_entry
1682 and Local_tls_got_offsets. Define Local_plt_offsets. Add
1683 local_plt_offsets_ field.
1684 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
1685 * output.h (class Output_section_data): Add non-const
1686 output_section function.
1687 (class Output_data_got): Update declarations.
1688 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
1689 Add use_plt_offset parameter to global and local constructors.
1690 Change all callers. Change local_sym_index_ field to 31 bits.
1691 Change GSYM_CODE and CONSTANT_CODE accordingly.
1692 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
1693 doing a static link don't set sh_link field.
1694 (Output_data_got::Got_entry::write): Use PLT offset if
1695 appropriate.
1696 (Output_data_got::add_global_plt): New function.
1697 (Output_data_got::add_local_plt): New function.
1698 * target-reloc.h (relocate_section): Handle IFUNC symbol.
1699 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
1700 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
1701 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
1702 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
1703 IFUNC conditional.
1704 * testsuite/ifunc-sel.h: New file.
1705 * testsuite/ifuncmain1.c: New file.
1706 * testsuite/ifuncmain1vis.c: New file.
1707 * testsuite/ifuncmod1.c: New file.
1708 * testsuite/ifuncdep2.c: New file.
1709 * testsuite/ifuncmain2.c: New file.
1710 * testsuite/ifuncmain3.c: New file.
1711 * testsuite/ifuncmod3.c: New file.
1712 * testsuite/ifuncmain4.c: New file.
1713 * testsuite/ifuncmain5.c: New file.
1714 * testsuite/ifuncmod5.c: New file.
1715 * testsuite/ifuncmain6pie.c: New file.
1716 * testsuite/ifuncmod6.c: New file.
1717 * testsuite/ifuncmain7.c: New file.
1718 * configure, testsuite/Makefile.in: Rebuild.
1719
56f75c03
ILT
17202010-08-18 Ian Lance Taylor <iant@google.com>
1721
1722 * incremental.cc
1723 (Output_section_incremental_inputs::write_input_files): Add cast
1724 to avoid signed/unsigned comparison warning.
1725 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1726
55455f89
CC
17272010-08-12 Cary Coutant <ccoutant@google.com>
1728
1729 * common.cc (Sort_commons::operator()): Remove unnecessary code.
1730
e2054bcb
ILT
17312010-08-13 Ian Lance Taylor <iant@google.com>
1732
1733 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
1734
74f67560
DK
17352010-08-12 Cary Coutant <ccoutant@google.com>
1736 Doug Kwan <dougkwan@google.com>
1737
1738 * resolve.cc (Symbol_table::should_override): When a weak dynamic
1739 defintion overrides non-weak undef, remember that the original undef
1740 is not weak.
1741 * symtab.cc (Symbol_table::sized_write_global): For undef without
1742 an original weak binding, set binding to global in output.
1743 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
1744 * testsuite/Makefile.in: Regenerate.
1745 * testsuite/strong_ref_weak_def.sh: New file.
1746 * testsuite/strong_ref_weak_def_1.c: Ditto.
1747 * testsuite/strong_ref_weak_def_2.c: Ditto.
1748
d1238d12
CC
17492010-08-12 Cary Coutant <ccoutant@google.com>
1750
1751 * testsuite/incremental_test.sh: Rewrite.
1752 * testsuite/incremental_test_1.c: Rewrite.
1753 * testsuite/incremental_test_2.c: Rewrite.
1754
0e70b911
CC
17552010-08-12 Cary Coutant <ccoutant@google.com>
1756
1757 * arm.cc (Target_arm::got_size): Add const.
1758 (Target_arm::got_entry_count): New function.
1759 (Target_arm::plt_entry_count): New function.
1760 (Target_arm::first_plt_entry_offset): New function.
1761 (Target_arm::plt_entry_size): New function.
1762 (Output_data_plt_arm::entry_count): New function.
1763 (Output_data_plt_arm::first_plt_entry_offset): New function.
1764 (Output_data_plt_arm::get_plt_entry_size): New function.
1765 * i386.cc (Target_i386::got_size): Add const.
1766 (Target_i386::got_entry_count): New function.
1767 (Target_i386::plt_entry_count): New function.
1768 (Target_i386::first_plt_entry_offset): New function.
1769 (Target_i386::plt_entry_size): New function.
1770 (Output_data_plt_i386::entry_count): New function.
1771 (Output_data_plt_i386::first_plt_entry_offset): New function.
1772 (Output_data_plt_i386::get_plt_entry_size): New function.
1773 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
1774 find_incremental_inputs_sections. Dump incremental_got_plt section.
1775 * incremental.cc: Include target.h.
1776 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
1777 parameter. Adjust all callers. Find incremental_got_plt section.
1778 (Incremental_inputs::create_data_sections): Create incremental_got_plt
1779 section.
1780 (Output_section_incremental_inputs::set_final_data_size): Calculate
1781 size of incremental_got_plt section.
1782 (Output_section_incremental_inputs::do_write): Write the
1783 incremental_got_plt section.
1784 (Got_plt_view_info): New struct.
1785 (Local_got_offset_visitor): New class.
1786 (Global_got_offset_visitor): New class.
1787 (Global_symbol_visitor_got_plt): New class.
1788 (Output_section_incremental_inputs::write_got_plt): New function.
1789 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
1790 Add parameter. Adjust all callers.
1791 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1792 (Incremental_inputs::got_plt_section): New function.
1793 (Incremental_inputs::got_plt_section_): New data member.
1794 (Incremental_got_plt_reader): New class.
1795 * layout.cc (Layout::create_incremental_info_sections): Add the
1796 incremental_got_plt section.
1797 * object.h (Got_offset_list::get_list): New function.
1798 (Got offset_list::for_all_got_offsets): New function.
1799 (Sized_relobj::local_got_offset_list): New function.
1800 * powerpc.cc (Target_powerpc::got_size): Add const.
1801 (Target_powerpc::got_entry_count): New function.
1802 (Target_powerpc::plt_entry_count): New function.
1803 (Target_powerpc::first_plt_entry_offset): New function.
1804 (Target_powerpc::plt_entry_size): New function.
1805 (Output_data_plt_powerpc::entry_count): New function.
1806 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
1807 (Output_data_plt_powerpc::get_plt_entry_size): New function.
1808 * sparc.cc (Target_sparc::got_size): Add const.
1809 (Target_sparc::got_entry_count): New function.
1810 (Target_sparc::plt_entry_count): New function.
1811 (Target_sparc::first_plt_entry_offset): New function.
1812 (Target_sparc::plt_entry_size): New function.
1813 (Output_data_plt_sparc::entry_count): New function.
1814 (Output_data_plt_sparc::first_plt_entry_offset): New function.
1815 (Output_data_plt_sparc::get_plt_entry_size): New function.
1816 * symtab.h (Symbol::got_offset_list): New function.
1817 (Symbol_table::for_all_symbols): New function.
1818 * target.h (Sized_target::got_entry_count): New function.
1819 (Sized_target::plt_entry_count): New function.
1820 (Sized_target::plt_entry_size): New function.
1821 * x86_64.cc (Target_x86_64::got_size): Add const.
1822 (Target_x86_64::got_entry_count): New function.
1823 (Target_x86_64::plt_entry_count): New function.
1824 (Target_x86_64::first_plt_entry_offset): New function.
1825 (Target_x86_64::plt_entry_size): New function.
1826 (Output_data_plt_x86_64::entry_count): New function.
1827 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
1828 (Output_data_plt_x86_64::get_plt_entry_size): New function.
1829
09ec0418
CC
18302010-08-12 Cary Coutant <ccoutant@google.com>
1831
1832 * archive.cc: Include incremental.h.
1833 (Archive::Archive): Initialize incremental_info_.
1834 (Archive::include_member): Record archive members in incremental info.
1835 (Add_archive_symbols::run): Record begin and end of an archive in
1836 incremental info.
1837 (Lib_group::include_member): Record objects in incremental info.
1838 * archive.h (Incremental_archive_entry): Forward declaration.
1839 (Archive::set_incremental_info): New member function.
1840 (Archive::incremental_info): New member function.
1841 (Archive::Unused_symbol_iterator): New class.
1842 (Archive::unused_symbols_begin): New member function.
1843 (Archive::unused_symbols_end): New member function.
1844 (Archive::incremental_info_): New data member.
1845 * incremental-dump.cc (find_input_containing_global): New function.
1846 (dump_incremental_inputs): Dump new incremental info sections.
1847 * incremental.cc: Include symtab.h.
1848 (Output_section_incremental_inputs): New class.
1849 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
1850 new incremental info sections.
1851 (Sized_incremental_binary::do_check_inputs): Likewise.
1852 (Incremental_inputs::report_archive): Remove.
1853 (Incremental_inputs::report_archive_begin): New function.
1854 (Incremental_inputs::report_archive_end): New function.
1855 (Incremental_inputs::report_object): New function.
1856 (Incremental_inputs::finalize_inputs): Remove.
1857 (Incremental_inputs::report_input_section): New function.
1858 (Incremental_inputs::report_script): Rewrite.
1859 (Incremental_inputs::finalize): Do nothing but finalize string table.
1860 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1861 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1862 (Incremental_inputs::create_data_sections): New function.
1863 (Incremental_inputs::relocs_entsize): New function.
1864 (Output_section_incremental_inputs::set_final_data_size): New function.
1865 (Output_section_incremental_inputs::do_write): New function.
1866 (Output_section_incremental_inputs::write_header): New function.
1867 (Output_section_incremental_inputs::write_input_files): New function.
1868 (Output_section_incremental_inputs::write_info_blocks): New function.
1869 (Output_section_incremental_inputs::write_symtab): New function.
1870 * incremental.h (Incremental_script_entry): Forward declaration.
1871 (Incremental_object_entry): Forward declaration.
1872 (Incremental_archive_entry): Forward declaration.
1873 (Incremental_inputs): Forward declaration.
1874 (Incremental_inputs_header_data): Remove.
1875 (Incremental_inputs_header): Remove.
1876 (Incremental_inputs_header_write): Remove.
1877 (Incremental_inputs_entry_data): Remove.
1878 (Incremental_inputs_entry): Remove.
1879 (Incremental_inputs_entry_write): Remove.
1880 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
1881 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
1882 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1883 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
1884 Likewise.
1885 (Incremental_input_entry): New class.
1886 (Incremental_script_entry): New class.
1887 (Incremental_object_entry): New class.
1888 (Incremental_archive_entry): New class.
1889 (Incremental_inputs::Incremental_inputs): Initialize new data members.
1890 (Incremental_inputs::report_inputs): Remove.
1891 (Incremental_inputs::report_archive): Remove.
1892 (Incremental_inputs::report_archive_begin): New function.
1893 (Incremental_inputs::report_archive_end): New function.
1894 (Incremental_inputs::report_object): Change prototype.
1895 (Incremental_inputs::report_input_section): New function.
1896 (Incremental_inputs::report_script): Change prototype.
1897 (Incremental_inputs::get_reloc_count): New function.
1898 (Incremental_inputs::set_reloc_count): New function.
1899 (Incremental_inputs::create_data_sections): New function.
1900 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1901 (Incremental_inputs::inputs_section): New function.
1902 (Incremental_inputs::symtab_section): New function.
1903 (Incremental_inputs::relocs_section): New function.
1904 (Incremental_inputs::get_stringpool): Add const.
1905 (Incremental_inputs::command_line): Add const.
1906 (Incremental_inputs::inputs): Remove.
1907 (Incremental_inputs::command_line_key): New function.
1908 (Incremental_inputs::input_file_count): New function.
1909 (Incremental_inputs::input_files): New function.
1910 (Incremental_inputs::relocs_entsize): New function.
1911 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1912 (Incremental_inputs::finalize_inputs): Remove.
1913 (Incremental_inputs::Input_info): Remove.
1914 (Incremental_inputs::lock_): Remove.
1915 (Incremental_inputs::inputs_): Change type.
1916 (Incremental_inputs::inputs_map_): Remove.
1917 (Incremental_inputs::current_object_entry_): New data member.
1918 (Incremental_inputs::inputs_section_): New data member.
1919 (Incremental_inputs::symtab_section_): New data member.
1920 (Incremental_inputs::relocs_section_): New data member.
1921 (Incremental_inputs::reloc_count_): New data member.
1922 (Incremental_inputs_reader): New class.
1923 (Incremental_symtab_reader): New class.
1924 (Incremental_relocs_reader): New class.
1925 * layout.cc (Layout::finalize): Move finalization of incremental info
1926 and creation of incremental info sections to follow finalization of
1927 symbol table. Set offsets for postprocessing sections.
1928 (Layout::create_incremental_info_sections): Call
1929 Incremental_inputs::create_data_sections. Add incremental symtab
1930 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
1931 sections to layout after input sections.
1932 * layout.h (struct Timespec): Forward declaration.
1933 (Layout::incremental_inputs): Add const.
1934 (Layout::create_incremental_info_sections): Add parameter.
1935 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
1936 * object.cc: Include incremental.h.
1937 (Relobj::finalize_incremental_relocs): New function.
1938 (Sized_relobj::do_layout): Record input sections in incremental info.
1939 * object.h (Object::output_section): New function.
1940 (Object::output_section_offset): Moved from Relobj.
1941 (Object::get_incremental_reloc_base): New function.
1942 (Object::get_incremental_reloc_count): New function.
1943 (Object::do_output_section): New function.
1944 (Object::do_output_section_offset): Moved from Relobj.
1945 (Object::do_get_incremental_reloc_base): New function.
1946 (Object::do_get_incremental_reloc_count): New function.
1947 (Object::Object): Initialize new data members.
1948 (Relobj::output_section): Renamed do_output_section and moved to
1949 protected.
1950 (Relobj::output_section_offset): Moved to Object.
1951 (Relobj::do_get_incremental_reloc_base): New function.
1952 (Relobj::do_get_incremental_reloc_count): New function.
1953 (Relobj::allocate_incremental_reloc_counts): New function.
1954 (Relobj::count_incremental_reloc): New function.
1955 (Relobj::finalize_incremental_relocs): New function.
1956 (Relobj::next_incremental_reloc_index): New function.
1957 (Relobj::reloc_counts_): New data member.
1958 (Relobj::reloc_bases_): New data member.
1959 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
1960 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
1961 (Sized_relobj::incremental_relocs_scan): New function.
1962 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1963 (Sized_relobj::incremental_relocs_write): New function.
1964 (Sized_relobj::incremental_relocs_write_reltype): New function.
1965 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
1966 incremental link.
1967 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
1968 archives and object files elsewhere.
1969 (Add_symbols::run): Report object files here.
1970 (Finish_group::run): Report end of archive at end of group.
1971 * reloc.cc: Include layout.h, incremental.h.
1972 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
1973 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
1974 (Sized_relobj::incremental_relocs_scan): New function.
1975 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1976 (Sized_relobj::do_relocate_sections): Write incremental relocations.
1977 (Sized_relobj::incremental_relocs_write): New function.
1978 (Sized_relobj::incremental_relocs_write_reltype): New function.
1979 * script.cc (read_input_script): Rewrite test for incremental link.
1980 Change call to Incremental_inputs::report_script.
1981 * symtab.h (Symbol_table::first_global_index): New function.
1982 (Symbol_table::output_count): New function.
1983
ce0d1972
DK
19842010-08-12 Doug Kwan <dougkwan@google.com>
1985
1986 * arm.cc (Target_arm::merge_object_attributes): Check command line
1987 options --no-wchar-size-warning and --no-enum-size-warning.
1988 * options.h (General_options): Add ld-compatible options
1989 --no-enum-size-warning and --no-wchar-size-warning.
1990
6e5710ce
ILT
19912010-08-04 Ian Lance Taylor <iant@google.com>
1992
1993 * x86_64.cc (Target_x86_64::Scan::local): Use
1994 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
1995 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
1996 (Target_x86_64::Scan::global): Likewise.
1997 (Target_x86_64::Relocate::relocate): Likewise.
1998 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1999 Likewise.
2000
fef830db
CC
20012010-08-03 Cary Coutant <ccoutant@google.com>
2002
2003 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2004 to reserve space in merged_strings vector. Keep total input size
2005 for stats.
2006 (Output_merge_string::do_print_merge_stats): Print total input size.
2007 * merge.h (Output_merge_string): Add input_size_ field.
2008 * stringpool.cc (Stringpool_template::string_length): Move
2009 implementations out of Stringpool_template class and place in
2010 stringpool.h.
2011 * stringpool.h (string_length): Move out of Stringpool_template.
2012
1e3811b0
ILT
20132010-08-03 Ian Lance Taylor <iant@google.com>
2014
2015 PR 11712
2016 * layout.cc (relaxation_loop_body): If address of load segment is
2017 set, adjust address to include headers if possible.
2018
7af0c620
ILT
20192010-08-03 Ian Lance Taylor <iant@google.com>
2020
2021 * version.cc (version_string): Bump to 1.10.
2022
22f0da72
ILT
20232010-08-03 Ian Lance Taylor <iant@google.com>
2024
2025 PR 11805
2026 * layout.h (enum Output_section_order): Define.
2027 (class Layout): Update declarations.
2028 * layout.cc (Layout::get_output_section): Add order parameter.
2029 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2030 is_first_non_relro parameters. Change all callers.
2031 (Layout::choose_output_section): Likewise.
2032 (Layout::add_output_section_data): Likewise.
2033 (Layout::make_output_section): Likewise. Set order.
2034 (Layout::default_section_order): New function.
2035 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2036 * output.cc (Output_section::Output_section): Initialize order_.
2037 Don't initialize deleted fields.
2038 (Output_segment::Output_segment): Don't initialize deleted
2039 fields.
2040 (Output_segment::add_output_section_to_load): New function
2041 replacing add_output_section. Change all callers to call this or
2042 add_output_section_to_nonload.
2043 (Output_segment::add_output_section_to_nonload): New function.
2044 (Output_segment::remove_output_section): Rewrite.
2045 (Output_segment::add_initial_output_data): Likewise.
2046 (Output_segment::has_any_data_sections): Likewise.
2047 (Output_segment::is_first_section_relro): Likewise.
2048 (Output_segment::maximum_alignment): Likewise.
2049 (Output_segment::has_dynamic_reloc): New function replacing
2050 dynamic_reloc_count. Change all callers.
2051 (Output_segment::has_dynamic_reloc_list): New function replacing
2052 dynamic_reloc_count_list. Change all callers.
2053 (Output_segment::set_section_addresses): Rewrite.
2054 (Output_segment::set_offset): Rewrite.
2055 (Output_segment::find_first_and_last_list): Remove.
2056 (Output_segment::set_tls_offsets): Rewrite.
2057 (Output_segment::first_section_load_address): Likewise.
2058 (Output_segment::output_section_count): Likewise.
2059 (Output_segment::section_with_lowest_load_address): Likewise.
2060 (Output_segment::write_section_headers): Likewise.
2061 (Output_segment::print_sections_to_map): Likewise.
2062 * output.h (class Output_data): Remove dynamic_reloc_count_
2063 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2064 (Output_data::add_dynamic_reloc): Rewrite.
2065 (Output_data::has_dynamic_reloc): New function.
2066 (Output_data::dynamic_reloc_count): Remove.
2067 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2068 is_last_relro_, is_first_non_relro_, is_interp_,
2069 is_dynamic_linker_section_ fields. Add order and set_order
2070 functions. Remove is_relro_local, set_is_relro_local,
2071 is_last_relro, set_is_last_relro, is_first_non_relro,
2072 set_is_first_non_relro functions, is_interp, set_is_interp,
2073 is_dynamic_linker_section, and set_is_dynamic_linker_section
2074 functions.
2075 (class Output_segment): Change Output_data_list from std::list to
2076 std:;vector. Add output_lists_ field. Remove output_data_ and
2077 output_bss_ fields. Update declarations.
2078
3ff2ccb0
ILT
20792010-08-02 Ian Lance Taylor <iant@google.com>
2080
2081 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2082 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2083 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2084
88a4108b
ILT
20852010-08-02 Ian Lance Taylor <iant@google.com>
2086
2087 PR 11855
2088 * script.cc (Script_options::Script_options): Initialize
2089 symbol_definitions_ and symbol_references_.
2090 (Script_options::add_symbol_assignment): Update
2091 symbol_definitions_ and symbol_references_.
2092 (Script_options::add_symbol_reference): New function.
2093 (script_symbol): New function.
2094 * script.h (class Script_options): Add symbol_definitions_ and
2095 symbol_references_ fields.
2096 (Script_options::referenced_const_iterator): New type.
2097 (Script_options::referenced_begin): New function.
2098 (Script_options::referenced_end): New function.
2099 (Script_options::is_referenced): New function.
2100 (Script_options::any_unreferenced): New function.
2101 * script-c.h (script_symbol): Declare.
2102 * yyscript.y (exp): Call script_symbol.
2103 * symtab.cc: Include "script.h".
2104 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2105 Change all callers. Check symbols referenced by scripts.
2106 (Symbol_table::add_undefined_symbols_from_command_line): Add
2107 layout parameter. Change all callers.
2108 (Symbol_table::do_add_undefined_symbols_from_command_line):
2109 Likewise. Break out loop body. Check symbols referenced by
2110 scripts.
2111 (Symbol_table::add_undefined_symbol_from_command_line): New
2112 function broken out of
2113 do_add_undefined_symbols_from_command_line.
2114 * symtab.h (class Symbol_table): Update declarations.
2115 * archive.cc: Include "layout.h".
2116 (Archive::should_include_member): Add layout parameter. Change
2117 all callers. Check for symbol mentioned in expression.
2118 * archive.h (class Archive): Update declaration.
2119 * object.cc (Sized_relobj::do_should_include_member): Add layout
2120 parameter.
2121 * object.h (Object::should_include_member): Add layout parameter.
2122 Change all callers.
2123 (Object::do_should_include_member): Add layout parameter.
2124 (class Sized_relobj): Update declaration.
2125 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2126 parameter.
2127 * dynobj.h (class Sized_dynobj): Update declaration.
2128 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2129 layout parameter.
2130 * plugin.h (class Sized_pluginobj): Update declaration.
2131
5f1ab67a
ILT
21322010-08-02 Ian Lance Taylor <iant@google.com>
2133
2134 PR 11866
2135 * output.cc (Output_segment::set_offset): Search for the first and
2136 last sections rather than assuming that the list is in order.
2137 (Output_segment::find_first_and_last_list): New function.
2138 * output.h (class Output_segment): Update declarations.
2139 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2140 (relro_strip_test_SOURCES): New variable.
2141 (relro_strip_test_DEPENDENCIES): New variable.
2142 (relro_strip_test_LDFLAGS): New variable.
2143 (relro_strip_test_LDADD): New variable.
2144 (relro_strip_test.so): New target.
2145
a8df5856
ILT
21462010-08-02 Ian Lance Taylor <iant@google.com>
2147
2148 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2149 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2150 (Target_i386::got_tlsdesc_section): New function.
2151 (Target_i386::got_section): Create space for GOT entries for
2152 TLSDESC relocations.
2153 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2154 R_386_TLS_GOTDESC.
2155 (Target_i386::Scan::global): Likewise.
2156 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2157 using TLSDESC GOT.
2158 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2159 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2160 (Target_x86_64::got_tlsdesc_section): New function.
2161 (Target_x86_64::got_section): Create space for GOT entries for
2162 TLSDESC relocations.
2163 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2164 R_386_TLS_GOTDESC.
2165 (Target_x86_64::Scan::global): Likewise.
2166 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2167 using TLSDESC GOT.
2168
0c10a0a6
ILT
21692010-08-02 Ian Lance Taylor <iant@google.com>
2170
2171 * testsuite/final_layout.sh: Use dc to convert from hex to
2172 decimal.
2173
41cbeecc
ST
21742010-07-29 Sriraman Tallam <tmsriram@google.com>
2175
2176 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2177 paramter to the call to gold::gc_process_relocs.
2178 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2179 paramter to the call to gold::gc_process_relocs.
2180 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2181 parameter to the call to gold::gc_process_relocs.
2182 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2183 template parameter to the call to gold::gc_process_relocs.
2184 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2185 paramter to the call to gold::gc_process_relocs.
2186 * gc.h (get_embedded_addend_size): New function.
2187 (gc_process_relocs): Save the size of the reloc for use by ICF.
2188 * icf.cc (get_section_contents): Get the addend from the text section
2189 for SHT_REL relocation sections.
2190 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2191 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2192 * int_encoding.h (read_from_pointer): New overloaded function.
2193 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2194 * testsuite/icf_sht_rel_addend_test.sh: New file.
2195 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2196 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2197
6ea55b82
RW
21982010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2199
2200 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2201 * Makefile.in: Regenerate.
2202 * testsuite/Makefile.in: Regenerate.
2203
9691462b
ILT
22042010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2205
2206 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2207 * gold/testsuite/debug_msg.cc: Likewise.
2208 * gold/testsuite/odr_violation1.cc
2209 * gold/testsuite/odr_violation2.cc
2210
76897331
CC
22112010-07-21 Cary Coutant <ccoutant@google.com>
2212
2213 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2214 string, and length fields.
2215 (Output_merge_string::Merged_strings_list): New type.
2216 (Output_merge_string::Merged_strings_lists): New typedef.
2217 (Output_merge_string): Replace merged_strings_ with
2218 merged_strings_lists_.
2219 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2220 Merged_strings_list per input object and section. Don't store pointer
2221 to the string. Don't store length with each merged string entry.
2222 (Output_merge_string::finalize_merged_data): Loop over list of merged
2223 strings lists. Recompute length of each merged string.
2224
78384e8f
CC
22252010-07-15 Cary Coutant <ccoutant@google.com>
2226
2227 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2228 here.
2229
783659f9
ILT
22302010-07-14 Ian Lance Taylor <iant@google.com>
2231
2232 * descriptors.cc (Descriptors::open): Report correct name in error
2233 message.
2234
131687b4
DK
22352010-07-13 Doug Kwan <dougkwan@google.com>
2236
2237 * arm.cc (Arm_input_section::Arm_input_section): For a
2238 SHT_ARM_EXIDX section, always keeps the input sections.
2239 (Arm_input_section::set_exidx_section_link): New method.
2240 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
2241 has_errors_ to false.
2242 (Arm_exidx_input_section::has_errors,
2243 Arm_exidx_input_section::set_has_errors): New methods.
2244 (Arm_exidx_input_section::has_errors_): New data member.
2245 (Arm_relobj::get_exidx_shndx_list): New method.
2246 (Arm_output_section::append_text_sections_to_list): Do not skip
2247 section without SHF_EXECINSTR.
2248 (Arm_output_section::fix_exidx_coverage): Skip input sections with
2249 errors.
2250 (Arm_relobj::make_exidx_input_section): Add new parameter for text
2251 section header. Make error messages more verbose. Check for
2252 a non-executable section linked to an EXIDX section.
2253 (Arm_relobj::do_read_symbols): Remove error checking, which has been
2254 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
2255 check that there is no deferred EXIDX section if we exit early.
2256 Instead of not making an EXIDX section in case of an error, make one
2257 and set the has_errors flag of it.
2258 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
2259 in a relocatable link.
2260 (Target_arm::do_relax): Look for the EXIDX output section instead of
2261 assuming that it is called .ARM.exidx.
2262 (Target_arm::fix_exidx_coverage): Add a new parameter for input
2263 section list. Do not check for SHF_EXECINSTR section flags but
2264 skip any input section with errors.
2265 * output.cc (Output_section::Output_section): Initialize
2266 always_keeps_input_sections_ to false.
2267 (Output_section::add_input_section): Check for
2268 always_keeps_input_sections_.
2269 * output.h (Output_section::always_keeps_input_sections,
2270 Output_section::set_always_keeps_input_sections): New methods.
2271 (Output_section::always_keeps_input_sections): New data member.
2272
69517287
RÁE
22732010-07-13 Rafael Espindola <espindola@google.com>
2274
2275 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
2276 * fileread.h (Input_file): Add try_extra_search_path and find_file.
2277
82742395
ILT
22782010-07-13 Philip Herron <herron.philip@googlemail.com>
2279 Ian Lance Taylor <iant@google.com>
2280
2281 * output.h (Output_section_lookup_maps::add_merge_section):
2282 Correct check of whether value was inserted.
2283 (Output_section_lookup_maps::add_merge_input_section): Likewise.
2284 (Output_section_lookup_maps::add_relaxed_input_section):
2285 Likewise.
2286 * arm.cc (Target_arm::got_section): Remove used local os.
2287 * i386.cc (Target_i386::got_section): Likewise.
2288 * x86_64.cc (Target_x86_64::got_section): Likewise.
2289 * sparc.cc (Target_sparc::got_section): Likewise.
2290 (Target_sparc::relocate): Remove unused local have_got_offset.
2291 * powerpc.cc (Target_powerpc::relocate): Likewise.
2292
f2d707b5
ILT
22932010-07-13 Ian Lance Taylor <iant@google.com>
2294
241531d6
ILT
2295 * compressed_output.cc (zlib_decompress): Fix signature in
2296 !HAVE_ZLIB_H case.
2297
f2d707b5
ILT
2298 * archive.cc (Archive::include_member): Unlock an external member
2299 of a thin archive. Don't bother to delete an object we know is
2300 NULL.
2301
a2e47362
CC
23022010-07-12 Cary Coutant <ccoutant@google.com>
2303
2304 * compressed_output.cc (zlib_decompress): New function.
2305 (get_uncompressed_size): New function.
2306 (decompress_input_section): New function.
2307 * compressed_output.h (get_uncompressed_size): New function.
2308 (decompress_input_section): New function.
2309 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
2310 Handle compressed debug sections.
2311 * layout.cc (is_compressed_debug_section): New function.
2312 (Layout::output_section_name): Map compressed section names to
2313 canonical names.
2314 * layout.h (is_compressed_debug_section): New function.
2315 (is_debug_info_section): Recognize compressed debug sections.
2316 * merge.cc: Include compressed_output.h.
2317 (Output_merge_data::do_add_input_section): Handle compressed
2318 debug sections.
2319 (Output_merge_string::do_add_input_section): Handle compressed
2320 debug sections.
2321 * object.cc: Include compressed_output.h.
2322 (Sized_relobj::Sized_relobj): Initialize new data members.
2323 (build_compressed_section_map): New function.
2324 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
2325 * object.h (Object::section_is_compressed): New method.
2326 (Object::do_section_is_compressed): New method.
2327 (Sized_relobj::Compressed_section_map): New type.
2328 (Sized_relobj::do_section_is_compressed): New method.
2329 (Sized_relobj::compressed_sections_): New data member.
2330 * output.cc (Output_section::add_input_section): Handle compressed
2331 debug sections.
2332 * reloc.cc: Include compressed_output.h.
2333 (Sized_relobj::write_sections): Handle compressed debug sections.
2334
ce279a62
CC
23352010-07-08 Cary Coutant <ccoutant@google.com>
2336
2337 * resolve.cc (Symbol_table::resolve): Remember whether undef was
2338 weak when resolving to a dynamic def.
2339 (Symbol_table::should_override): Add adjust_dyndef flag; set it
2340 for weak undef/dynamic def cases. Adjust callers.
2341 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
2342 undef_binding_weak_.
2343 (Symbol_table::sized_write_globals): Adjust symbol binding.
2344 (Symbol_table::sized_write_symbol): Add binding parameter.
2345 * symtab.h (Symbol::set_undef_binding): New method.
2346 (Symbol::is_undef_binding_weak): New method.
2347 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
2348 (Symbol_table::should_override): Add new parameter.
2349 (Symbol_table::sized_write_symbol): Add new parameter.
2350
2351 * testsuite/weak_undef_file1.cc: Add new test case.
2352 * testsuite/weak_undef_file2.cc: Fix header comment.
2353 * testsuite/weak_undef_test.cc: Add new test case.
2354
b2286c10
DK
23552010-06-29 Doug Kwan <dougkwan@google.com>
2356
2357 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
2358 Initialize USE_SYMBOL_.
2359 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
2360 definition.
2361 (Arm_reloc_property::uses_symbol_): New data member declaration.
2362 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
2363 uses symbol value and symbol is undefined but not weakly undefined.
2364
4802450a
RÁE
23652010-06-28 Rafael Espindola <espindola@google.com>
2366
2367 * plugin.cc (Plugin::load): Use dlerror.
2368
e5ca47ba
ILT
23692010-06-26 Jeffrey Yaskin <jyasskin@google.com>
2370
2371 * symtab.cc (detect_odr_violations): When reporting an ODR
2372 violation, report an object where the symbol is defined.
2373
8a75a161
DK
23742010-06-25 Doug Kwan <dougkwan@google.com>
2375
2376 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
2377 (Target_arm::section_may_have_icf_unsafe_pointers): New method
2378 definition.
2379 (Target_arm::Scan::local_reloc_may_be_function_pointer,
2380 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
2381 target hook to detect function points.
2382 (Target_arm::Scan::possible_function_pointer_reloc): New method.
2383 * icf.h (Icf::check_section_for_function_pointers): Change type of
2384 parameter SECTION_NAME to const reference to std::string. Use
2385 target hook to determine if section may have unsafe pointers.
2386 * target.h (Target::section_may_have_icf_unsafe_pointers): New
2387 method definition.
2388
42218b9f
RÁE
23892010-06-21 Rafael Espindola <espindola@google.com>
2390
2391 * fileread.cc (Input_file::find_fie): New
2392 (Input_file::open): Use Input_file::find_fie.
2393 * fileread.h (Input_file::find_fie): New
2394 * plugin.cc (set_extra_library_path): New.
2395 (Plugin::load): Add set_extra_library_path to the transfer vector.
2396 (Plugin_manager::set_extra_library_path): New.
2397 (Plugin_manager::add_input_file): Use the extra search path if set.
2398 (set_extra_library_path(): New.
2399 * plugin.h (Plugin_manager): Add set_extra_library_path and
2400 extra_search_path_.
2401
a0506cca
CC
24022010-06-19 Cary Coutant <ccoutant@google.com>
2403
2404 * layout.cc (gdb_sections): Add .debug_types.
2405 (lines_only_debug_sections): Likewise.
2406
6508b958
RÁE
24072010-06-18 Rafael Espindola <espindola@google.com>
2408
2409 * plugin.cc (add_input_file,add_input_library)
2410 (Plugin_manager::add_input_file): Make filename arguments const.
2411 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
2412 const.
2413
3e235302
DK
24142010-06-16 Doug Kwan <dougkwan@google.com>
2415
2416 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
2417 .ARM.attributes section if we have not merged any input
2418 attributes sections.
2419
106e8a6c
DK
24202010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2421
2422 * arm.cc: Allow combining objects with no EABI version
2423 information.
2424
91ff43fe
RÁE
24252010-06-15 Rafael Espindola <espindola@google.com>
2426
2427 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
2428
68ed838c
ILT
24292010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2430
2431 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
2432 (struct iovec): Correct !HAVE_READV definition.
2433
f3a2388f
CC
24342010-06-10 Cary Coutant <ccoutant@google.com>
2435
2436 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
2437 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
2438 reloc sections.
2439 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
2440
2441 PR 11683
2442 * symtab.h (Symbol::is_placeholder): New member function.
2443 * target-reloc.h (relocate_section): Check for placeholder symbols.
2444
2445 * testsuite/Makefile.am (plugin_test_8): New test.
2446 (plugin_test_9): New test.
2447 * testsuite/Makefile.in: Regenerate.
2448
e1df38aa
NC
24492010-06-09 Nick Clifton <nickc@redhat.com>
2450
2451 * yyscript.y (input_list_element): Allow strings prefixed with
2452 the '-' character. Treat these as libraries.
2453 * script.cc (script_add_library): New function. Adds a library
2454 specified by "-l<name>" found in an input script.
2455 * script-c.h: Add prototype for script_add_library.
2456
25bbe950
DK
24572010-06-07 Doug Kwan <dougkwan@google.com>
2458
2459 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
2460 Restrict stub-group size to be within long conditional branch
2461 range when working around cortex-A8 erratum.
2462
0f32ea4c
ILT
24632010-06-07 Damien Diederen <dd@crosstwine.com>
2464
2465 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
2466 #ifdef typo.
2467
8fe2a369
ST
24682010-06-03 Sriraman Tallam <tmsriram@google.com>
2469
2470 PR gold/11658
2471 * output.cc
2472 (Output_section::Input_section_sort_entry::compare_section_ordering):
2473 Change to return non-zero correctly.
2474 (Output_section::Input_section_sort_section_order_index_compare
2475 ::operator()): Change to fix ambiguity in comparisons.
2476
6e9ba2ca
ST
24772010-06-01 Sriraman Tallam <tmsriram@google.com>
2478
2479 * gold.h (is_wildcard_string): New function.
2480 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
2481 (Layout::layout_eh_frame): Ditto.
2482 (Layout::find_section_order_index): New method.
2483 (Layout::read_layout_from_file): New method.
2484 * layout.h (Layout::find_section_order_index): New method.
2485 (Layout::read_layout_from_file): New method.
2486 (Layout::input_section_position_): New private member.
2487 (Layout::input_section_glob_): New private member.
2488 * main.cc (main): Call read_layout_from_file here.
2489 * options.h (--section-ordering-file): New option.
2490 * output.cc (Output_section::input_section_order_specified_): New
2491 member.
2492 (Output_section::Output_section): Initialize new member.
2493 (Output_section::add_input_section): Add new parameter.
2494 Keep input sections when --section-ordering-file is used.
2495 (Output_section::set_final_data_size): Sort input sections when
2496 section ordering file is specified.
2497 (Output_section::Input_section_sort_entry): Add new parameter.
2498 Check sorting type.
2499 (Output_section::Input_section_sort_entry::compare_section_ordering):
2500 New method.
2501 (Output_section::Input_section_sort_compare::operator()): Change to
2502 consider section_order_index.
2503 (Output_section::Input_section_sort_init_fini_compare::operator()):
2504 Change to consider section_order_index.
2505 (Output_section::Input_section_sort_section_order_index_compare
2506 ::operator()): New method.
2507 (Output_section::sort_attached_input_sections): Change to sort
2508 according to section order when specified.
e1df38aa
NC
2509 (Output_section::add_input_section<32, true>): Add new parameter.
2510 (Output_section::add_input_section<64, true>): Add new parameter.
2511 (Output_section::add_input_section<32, false>): Add new parameter.
2512 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
2513 * output.h (Output_section::add_input_section): Add new parameter.
2514 (Output_section::input_section_order_specified): New
2515 method.
2516 (Output_section::set_input_section_order_specified): New method.
2517 (Input_section::Input_section): Initialize section_order_index_.
2518 (Input_section::section_order_index): New method.
2519 (Input_section::set_section_order_index): New method.
2520 (Input_section::section_order_index_): New member.
2521 (Input_section::Input_section_sort_section_order_index_compare): New
2522 struct.
2523 (Output_section::input_section_order_specified_): New member.
2524 * script-sections.cc (is_wildcard_string): Delete and move modified
2525 method to gold.h.
2526 (Output_section_element_input::Output_section_element_input): Modify
2527 call to is_wildcard_string.
2528 (Output_section_element_input::Input_section_pattern
2529 ::Input_section_pattern): Ditto.
2530 (Output_section_element_input::Output_section_element_input): Ditto.
2531 * testsuite/Makefile.am (final_layout): New test case.
2532 * testsuite/Makefile.in: Regenerate.
2533 * testsuite/final_layout.cc: New file.
2534 * testsuite/final_layout.sh: New file.
2535
3537c84b
RÁE
25362010-06-01 Rafael Espindola <espindola@google.com>
2537
2538 * plugin.cc (Plugin::load): Pass the output name to the plugin.
2539
105b6afd
RÁE
25402010-06-01 Rafael Espindola <espindola@google.com>
2541
2542 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
2543 visibility of symbols.
2544
29e11421
DK
25452010-05-27 Doug Kwan <dougkwan@google.com>
2546
2547 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
2548 from start of output section instead of address for a local symbol
2549 in a merged or relaxed section when doing a relocatable link.
2550
5e0f337e
RÁE
25512010-05-26 Rafael Espindola <espindola@google.com>
2552
2553 PR 11604
2554 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
2555 adding sections the garbage collector removed.
2556 * gold/testsuite/Makefile.am: Add test.
2557 * gold/testsuite/Makefile.in: Regenerate.
2558 * gold/testsuite/plugin_test_7.sh: New.
2559 * gold/testsuite/plugin_test_7_1.c: New.
2560 * gold/testsuite/plugin_test_7_2.c: New.
2561
f4187277
RÁE
25622010-05-26 Rafael Espindola <espindola@google.com>
2563
2564 * script-sections.cc (Output_section_definition::set_section_addresses):
2565 Check for --section-start.
2566
5c388529
DK
25672010-05-26 Doug Kwan <dougkwan@google.com>
2568
2569 * arm.cc (Arm_scan_relocatable_relocs): New class.
2570 (Target_arm::relocate_special_relocatable): New method.
2571 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
2572 (Arm_relocate_functions::thumb_branch_common): Same.
2573 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
2574 instead of Default_scan_relocatable_relocs.
2575 * target-reloc.h (relocate_for_relocatable): Let target handle
2576 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
2577 * target.h (Sized_target::relocate_special_relocatable): New method.
2578
bca1c3ae
ILT
25792010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2580
2581 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
2582
0439c796
DK
25832010-05-23 Doug Kwan <dougkwan@google.com>
2584
2585 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
2586 instead of a cast.
2587 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
2588 with a direct branch, not a conditional branch, to a stub.
2589 * merge.cc (Output_merge_base::record_input_section): New method
2590 defintion.
2591 (Output_merge_data::do_add_input_section): Record input section if
2592 keeps-input-sections flag is set.
2593 (Output_merge_string::do_add_input_section): Ditto.
2594 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
2595 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
2596 INPUT_SECTIONS_.
2597 (Output_merge_base::keeps_input_sections,
2598 Output_merge_base::set_keeps_input_sections,
2599 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
2600 method definitions.
2601 (Output_merge_base::Input_sections): New type declaration.
2602 (Output_merge_base::input_sections_begin,
2603 Output_merge_base::input_sections_end,
2604 Output_merge_base::do_set_keeps_input_sections): New method definitions.
2605 (Output_merge_base::bool keeps_input_sections_,
2606 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
2607 Output_merge_base::input_sections_): New data members.
2608 (Output_merge_data::do_set_keeps_input_sections): New method
2609 defintion.
2610 (Output_merge_string::do_set_keeps_input_sections): Ditto.
2611 * output.cc (Output_section::Input_section::relobj): Move method
2612 defintion from class declaration to here and handle merge sections.
2613 (Output_section::Input_section::shndx): Ditto.
2614 (Output_section::Output_section): Remove initializations of removed
2615 data members and initialize new data member LOOKUP_MAPS_.
2616 (Output_section::add_input_section): Set keeps-input-sections flag
2617 for a newly created merge output section as appropriate. Adjust code
2618 to use Output_section_lookup_maps class.
2619 (Output_section::add_relaxed_input_section): Adjst code for lookup
2620 maps code refactoring.
2621 (Output_section::add_merge_input_section): Add a new parameter
2622 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
2623 class. If adding input section to a newly created merge output
2624 section fails, remove the new merge section.
2625 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 2626 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
2627 (Output_section::find_merge_section): Ditto.
2628 (Output_section::build_lookup_maps): New method defintion.
2629 (Output_section::find_relaxed_input_section): Adjust code to use
2630 Output_section_lookup_maps class.
2631 (Output_section::get_input_sections): Export merge sections. Adjust
2632 code to use Output_section_lookup_maps class.
2633 (Output_section:::add_script_input_section): Adjust code to use
2634 Output_section_lookup_maps class. Update lookup maps for merge
2635 sections also.
2636 (Output_section::discard_states): Use Output_section_lookup_maps.
2637 (Output_section::restore_states): Same.
2638 * output.h (Merge_section_properties): Move class defintion out of
2639 Output_section.
2640 (Output_section_lookup_maps): New class.
2641 (Output_section::Input_section::is_merge_section): New method
2642 defintion.
2643 (Output_section::Input_section::relobj): Move defintion out of class
2644 defintion. Declare method only.
2645 (Output_section::Input_section::shndx): Ditto.
2646 (Output_section::Input_section::output_merge_base): New method defintion.
2647 (Output_section::Input_section::u2_.pomb): New union field.
2648 (Output_section::Merge_section_by_properties_map,
2649 Output_section::Output_section_data_by_input_section_map,
2650 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
2651 Remove types.
2652 (Output_section::add_merge_input_section): Add new parameter
2653 KEEPS_INPUT_SECTIONS.
2654 (Output_section::build_lookup_maps): New method declaration.
2655 (Output_section::merge_section_map_,
2656 Output_section::merge_section_by_properties_map_,
2657 Output_section::relaxed_input_section_map_,
2658 Output_section::is_relaxed_input_section_map_valid_): Remove data
2659 members.
2660 (Output_section::lookup_maps_): New data member.
2661
76295588
L
26622010-05-21 Doug Kwan <dougkwan@google.com>
2663
2664 PR gold/11619
2665 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
2666 avoid a compilation error.
2667
d103a984
RÁE
26682010-05-19 Rafael Espindola <espindola@google.com>
2669
2670 * script-sections.cc (Output_section_definition::allocate_to_segment):
2671 Update the phdrs_list even when the output section is NULL.
2672 * testsuite/Makefile.am: Add test.
2673 * testsuite/Makefile.in: Regenerate.
2674 * testsuite/script_test_9.cc: New.
2675 * testsuite/script_test_9.sh: New.
2676 * testsuite/script_test_9.t: New.
2677
6625d24e
DK
26782010-05-19 Doug Kwan <dougkwan@google.com>
2679
2680 * arm.cc (Arm_input_section::original_size): New method.
2681 (Arm_input_section::do_addralign): Add a cast.
2682 (Arm_input_section::do_output_offset): Remove static cast.
2683 (Arm_input_section::original_addralign,
2684 Arm_input_section::original_size_): Change type to uint32_t.
2685 (Arm_input_section::init): Add safe casts for section alignment
2686 and size.
2687 (Arm_input_section::set_final_data_size): Do not set address and
2688 offset of stub table.
2689 (Arm_output_section::fix_exidx_coverage): Change use of of
2690 Output_section::Simple_input_section to that of
2691 Output_section::Input_section.
2692 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
2693 except for the first pass.
2694 * output.cc (Output_section::get_input_sections): Change type of
2695 input_sections to std::list<Input_section>.
2696 (Output_section::add_script_input_section): Rename from
2697 Output_section::add_simple_input_section. Change type of SIS
2698 parameter from Simple_input_section to Input_section.
2699 * output.h (Output_section::Simple_input_section): Remove class.
2700 (Output_section::Input_section): Change class visibility to public.
2701 (Output_section::Input_section::addralign): Use stored alignments
2702 for special input sections if set.
2703 (Output_section::Input_section::set_addralign): New method.
2704 (Output_section::get_input_sections): Change parameter type from
2705 list of Simple_input_section to list of Input_section.
2706 (Output_section::add_script_input_section): Rename from
2707 Output_section::add_simple_input_section. Change first parameter's
2708 type from Simple_input_section to Input_section and remove the
2709 second and third parameters.
2710 * script-sections.cc (Input_section::Input_section_list): Change
2711 type to list of Output_section::Input_section/
2712 (Input_section_info::Input_section_info): Change parameter type of
2713 INPUT_SECTION to Output_section::Input_section.
2714 (Input_section_info::input_section): Change return type.
2715 (Input_section_info::input_section_): Change type to
2716 Output_section::Input_section.
2717 (Output_section_element_input::set_section_addresses): Adjust code
2718 to use Output_section::Input_section instead of
2719 Output_section::Simple_input_section. Adjust code for renaming
2720 of Output_section::add_simple_input_section.
2721 (Orphan_output_section::set_section_addresses): Ditto.
2722
e1e82ea4
RW
27232010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2724
2725 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
2726 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
2727
91e75c8a
RÁE
27282010-05-18 Rafael Espindola <espindola@google.com>
2729
2730 * options.cc (General_options::finalize): Handle -nostdlib.
2731 * options.h (nostdlib): New option.
2732 * script.cc (script_add_search_dir): Handle -nostdlib.
2733
da59ad79
DK
27342010-05-12 Doug Kwan <dougkwan@google.com>
2735
2736 * arm.cc (Target_arm::do_finalize_sections): Create an empty
2737 attributes section only if there no attributes section after merging.
2738 (Target_arm::merge_object_attributes): Move value of
e1df38aa 2739 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
2740 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
2741 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
2742 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
2743 and arm_attr_merge_7.stdout.
2744 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
2745 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
2746 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
2747 arm_attr_merge_7b.o): New rules.
2748 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
2749 arm_attr_merge_7
2750 * testsuite/Makefile.in: Regenerate.
2751 * testsuite/arm_attr_merge.sh: New file.
2752 * testsuite/arm_attr_merge_[67][ab].s: Same.
2753
3e01a7fd
NC
27542010-05-05 Nick Clifton <nickc@redhat.com>
2755
2756 * po/es.po: Updated Spanish translation.
2757
7ad2014a
L
27582010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2759
2760 * Makefile.am (install-exec-local): Properly install gold as
2761 default cross linker.
2762 * Makefile.in: Regenerated.
2763
4fda8867
NC
27642010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2765 Nick Clifton <nickc@redhat.com>
2766
2767 * configure.ac (install_as_default): Define and set to false
2768 unless --enable-gold or --enable-gold=both/gold has been
2769 specified.
2770 * configure: Regenerate.
2771
2772 * Makefile.am (install-exec-local): Install the executable as
2773 'ld.gold'. If install_as_default is true then also install it as
2774 'ld'.
2775 * Makefile.in: Regenerated.
2776
bd288ea2
ILT
27772010-04-24 Ian Lance Taylor <iant@google.com>
2778
2779 * layout.cc (Layout::layout_reloc): In relocatable link don't
2780 combine reloc sections for grouped sections.
2781
ef38fd8a
ST
27822010-04-23 Sriraman Tallam <tmsriram@google.com>
2783
2784 * gc.h (gc_process_relocs): Pass information on relocs pointing to
2785 sections that are not ordinary to icf.
2786 * icf.cc (get_section_contents): Handle relocation pointing to section
2787 with no object or shndx information.
2788 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
2789 * testsuite/Makefile.in: Regenerate.
2790 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
2791 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
2792
f6973bdc
ILT
27932010-04-22 Ian Lance Taylor <iant@google.com>
2794
2795 * expression.cc (Expression::Expression_eval_info): Add
2796 result_alignment_pointer field.
2797 (Expression::eval_with_dot): Add result_alignment_pointer
2798 parameter. Change all callers.
2799 (Expression::eval_maybe_dot): Likewise.
2800 (class Binary_expression): Add alignment_pointer parameter to
2801 left_value and right_value. Change all callers.
2802 (BINARY_EXPRESSION): Set result alignment.
2803 (class Trinary_expression): Add alignment_pointer parameter to
2804 arg2_value and arg3_value. Change all callers.
2805 (Trinary_cond::value): Set result alignment.
2806 (Max_expression::value, Min_expression::value): Likewise.
2807 (Align_expression::value): Likewise.
2808 * script-sections.cc (class Sections_element): Add dot_alignment
2809 parameter to set_section_addresses virtual function. Update
2810 instantiations.
2811 (class Output_section_element): Likewise.
2812 (Script_sections::create_segments): Add dot_alignment parameter.
2813 Change all callers.
2814 (Script_sections::create_segments_from_phdrs_clause): Likewise.
2815 (Script_sections::set_phdrs_clause_addresses): Likewise.
2816 * script-sections.h: Update declarations.
2817 * script.h: Update declarations.
2818 * output.h (Output_segment::set_minimum_p_align): Don't decrease
2819 min_p_align.
2820 * testsuite/script_test_3.t: Set large alignment.
2821 * testsuite/script_test_3.sh: Make sure that at least one LOAD
2822 segment has expected alignment.
2823
9c9c98a5
NC
28242010-04-22 Nick Clifton <nickc@redhat.com>
2825
2826 * po/gold.pot: Updated by the Translation project.
2827 * po/vi.po: Updated Vietnamese translation.
2828
2253bfba
L
28292010-04-22 H.J. Lu <hongjiu.lu@intel.com>
2830
2831 * testsuite/Makefile.am (check_PROGRAMS): Add
2832 icf_virtual_function_folding_test.
2833 * testsuite/Makefile.in: Regenerated.
2834
85fdf906
AH
28352010-04-15 Andrew Haley <aph@redhat.com>
2836
2837 * options.h (merge_exidx_entries): New option.
2838 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
2839 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
2840 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
2841 (Target_arm::merge_exidx_entries): New function.
2842 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
2843 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
2844 to Arm_exidx_fixup constructor.
2845 Add new arg, merge_exidx_entries.
2846 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
2847 Arm_output_section::fix_exidx_coverage.
2848
ce97fa81
ST
28492010-04-18 Sriraman Tallam <tmsriram@google.com>
2850
2851 * icf.cc (get_section_contents): Check for preemptible functions.
2852 Ignore addend when appropriate.
2853 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
2854 section folded.
2855 (add_from_relobj): Check for section folded.
2856 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
2857 * symtab.h (should_add_dynsym_entry): Add new parameter.
2858 * target-reloc.h (scan_relocs): Check for section folded.
2859 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
2860 Check reloc types for function pointers in shared objects.
2861 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
2862 case.
2863 (icf_preemptible_functions_test): New test case.
2864 (icf_string_merge_test): New test case.
2865 * testsuite.Makefile.in: Regenerate.
2866 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
2867 bar_glob. Refactor code.
2868 * testsuite/icf_preemptible_functions_test.cc: New file.
2869 * testsuite/icf_preemptible_functions_test.sh: New file.
2870 * testsuite/icf_string_merge_test.cc: New file.
2871 * testsuite/icf_string_merge_test.sh: New file.
2872 * testsuite/icf_virtual_function_folding_test.cc: New file.
2873 * testsuite/icf_virtual_function_folding_test.sh: New file.
2874
04ceb17c
DK
28752010-04-14 Doug Kwan <dougkwan@google.com>
2876
2877 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
2878 for local symbol recounting if we remove a section due to ICF.
2879 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
2880 there are no regular objects in input.
2881
153e7da4
DK
28822010-04-13 Doug Kwan <dougkwan@google.com>
2883
2884 * arm.cc (Arm_input_section::set_final_data_size): Compute
2885 accurate final data size instead of using current data size.
2886
4dbd9faf
DK
28872010-04-09 Doug Kwan <dougkwan@google.com>
2888
2889 * layout.cc (Layout::choose_output_section): Handle script section
2890 types.
2891 (Layout::make_output_section_for_script): Add section type parameter.
2892 Handle script section types.
2893 * layout.h (Layout::make_output_section_for_script): Add section
2894 type parameter.
2895 * output.cc (Output_section::Output_section): Initialize data member
2896 is_noload_.
2897 (Output_section::do_reset_address_and_file_offset): Do not set address
2898 to 0 if section is a NOLOAD section.
2899 * output.h (Output_section::is_noload): New method.
2900 (Output_section::set_is_noload): Ditto.
2901 (Output_section::is_noload_): New data member.
2902 * script-c.h (Script_section_type): New enum type.
2903 (struct Parser_output_section_header): Add new file section_type.
2904 * script-sections.cc (Sections_element::output_section_name): Add
2905 parameter for returning script section type.
2906 (Output_section_definition::output_section_name): Ditto.
2907 (Output_section_definition::section_type)P; New method.
2908 (Output_section_definiton::script_section_type_name): Ditto.
2909 (Output_section_definition::script_section_type_): New data member.
2910 (Output_section_definition::Output_section_definition): Initialize
2911 data member Output_section_definition::script_section_type_.
2912 (Output_section_definition::create_sections): Pass script section type
2913 to Layout::make_output_section_for_script.
2914 (Output_section_definition::output_section_name): Return script
2915 section type to caller.
2916 (Output_section_definition::set_section_address): Do not advance
2917 dot value and load address if section type is NOLOAD. Set address
2918 of NOLOAD sections regardless of section flags.
2919 (Output_section_definition::print): Print section type if it is
2920 not SCRIPT_SECTION_TYPE_NONE.
2921 (Output_section_definition::section_type): New method.
2922 (Output_section_definition::script_section_type_name): Ditto.
2923 (Script_sections::output_section_name): Add new parameter
2924 PSECTION_TYPE for returning script section type. Pass it to
2925 section elements. Handle discard sections.
2926 (Sort_output_sections::operator()): Handle NOLOAD sections.
2927 * script-sections.h (Script_sections::Section_type): New enum type.
2928 (Script_sections::output_section_name): Add a new parameter for
2929 returning script section type.
2930 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
2931 INFO and NOLOAD.
2932 * yyscript.y (union): Add new field SECTION_TYPE.
2933 (COPY, DSECT, INFO, NOLOAD): New tokens.
2934 (opt_address_and_section_type): Change type to output_section_header.
2935 (section_type): New non-terminal
2936 (section_header): Handle section type.
2253bfba 2937 (opt_address_and_section_type): Return section type value.
4dbd9faf 2938
721ea635
L
29392010-04-09 H.J. Lu <hongjiu.lu@intel.com>
2940
2941 * testsuite/plugin_common_test_1.c (foo): Add prototype.
2942 * testsuite/plugin_common_test_2.c (foo): Likewise.
2943
6bf924b0
DK
29442010-04-08 Doug Kwan <dougkwan@google.com>
2945
2946 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
2947 Output_merge_data.
2948 * output.cc (Output_section::add_merge_input_section): Simplify
2949 code and return status of Output_merge_base::add_input_section.
e1df38aa 2950 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
2951 returns true.
2952
24af6f92
DK
29532010-04-07 Doug Kwan <dougkwan@google.com>
2954
2955 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
2956 if section is marked as containing instructions but has no mapping
2957 symbols.
2958 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
2959 correct section index.
2960 (Arm_relobj::find_linked_text_section): Ditto.
2961
00698fc5
CC
29622010-04-07 Cary Coutant <ccoutant@google.com>
2963
2964 * archive.cc (include_member): Destroy Read_symbols_data object before
2965 releasing file.
2966 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
2967 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
2968 (Read_symbols_data::~Read_symbols_data) New destructor.
2969 (Section_relocs::Section_relocs) New constructor.
2970 (Section_relocs::~Section_relocs) New destructor.
2971 (Read_relocs_data::Read_relocs_data) New constructor.
2972 (Read_relocs_data::~Read_relocs_data) New destructor.
2973 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
2974 pointers to NULL after deleting.
2975
7296d933
DK
29762010-04-07 Doug Kwan <dougkwan@google.com>
2977
2978 * arm.cc: Replace "endianity" with "endianness" in comments.
2979 (Arm_exidx_cantunwind): Ditto.
2980 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
2981 (Arm_relobj::merge_flags_and_attributes): New method.
2982 (Arm_relobj::merge_flags_and_attributes_): New data member.
2983 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
2984 (Arm_relobj::scan_sections_for_stubs): Ditto.
2985 (Arm_relobj::do_read_symbols): Check to see if we really want to
2986 merge processor-specific flags and attributes. Exit early if
2987 an object is empty except for section names and the undefined symbol.
2988 (Target_arm::do_finalize_sections): Move check for ELF format to
2989 Arm_relobj::do_read_symbols. Merge processor specific flags and
2990 attributes from a regular object only when we have determined that
2991 it is aapropriate. Do not create an .ARM.attributes section in
2992 output if there is no regular input object.
2993 (Target_arm::merge_processor_specific_flags): Check
2994 --warn-mismatch before printing any error.
2995 (Target_arm::merge_object_attributes): Ditto.
2996 * gold.cc (queue_middle_tasks): Handle the case in which there is
2997 no regular object in input.
2998 * options.cc (General_options::parse_EB): New method.
2999 (General_options::parse_EL): Same.
3000 (General_options::General_options): Initialize endianness_.
3001 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3002 New options.
3003 (General_options::Endianness): New enum.
3004 (General_options::endianness): New method.
3005 (General_options::endianness_): New data member.
3006 * parameters.cc (Parameters::set_options): Check target endianness.
3007 (Parameters::set_target_once): Ditto.
3008 (Parameters::check_target_endianness): New method.
3009 (parameters_force_valid_target): If either -EL or -EB is specified,
3010 use it to define endianness of default target.
3011 * parameters.h (Parameters::check_target_endianness): New method
3012 declaration.
3013 * target.h (class Target): Change "endianity" to "endianness"
3014 in comments.
3015
efc8d4f2
RW
30162010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3017
3018 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3019 * configure: Regenerate.
3020 * Makefile.in: Regenerate.
3021 * testsuite/Makefile.in: Regenerate.
3022
be234d88
CC
30232010-04-06 Cary Coutant <ccoutant@google.com>
3024
3025 gcc PR lto/42757
3026 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3027 prevailing definitions of common symbols.
3028 * testsuite/plugin_test_6.sh: New test case.
3029 * testsuite/plugin_common_test_1.c: New test case.
3030 * testsuite/plugin_common_test_2.c: New test case.
3031 * testsuite/Makefile.am (plugin_test_6): New test case.
3032 * testsuite/Makefile.in: Regenerate.
3033
bd32c6bd
NC
30342010-04-06 Nick Clifton <nickc@redhat.com>
3035
3036 * po/vi.po: New Vietnamese translation.
3037
323c532f
DK
30382010-03-30 Doug Kwan <dougkwan@google.com>
3039
3040 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3041
4fcd97eb
DK
30422010-03-25 Doug Kwan <dougkwan@google.com>
3043
3044 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3045 to avoid a conversion warning on a 32-bit host.
3046
4ebf39db
ILT
30472010-03-24 Ian Lance Taylor <iant@google.com>
3048
3049 * testsuite/script_test_3.t: Add a TLS segment.
3050 * testsuite/Makefile.am (check_PROGRAMS): Add
3051 tls_phdrs_script_test.
3052 (tls_phdrs_script_test_SOURCES): Define.
3053 (tls_phdrs_script_test_DEPENDENCIES): Define.
3054 (tls_phdrs_script_test_LDFLAGS): Define.
3055 (tls_phdrs_script_test_LDADD): Define.
3056 * testsuite/Makefile.in: Rebuild.
3057
4a599bdd
CC
30582010-03-23 Cary Coutant <ccoutant@google.com>
3059
3060 * fileread.cc (find_or_make_view): Fix comment.
3061
6c93b22c
ILT
30622010-03-23 Ian Lance Taylor <iant@google.com>
3063
3064 * script-sections.cc (class Orphan_section_placement): Define
3065 PLACE_TLS and PLACE_TLS_BSS.
3066 (Orphan_section_placement::Orphan_section_placement): Initialize
3067 new places.
3068 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3069 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3070 (tls_script_test_SOURCES): Define.
3071 (tls_script_test_DEPENDENCIES): Define.
3072 (tls_script_test_LDFLAGS): Define.
3073 (tls_script_test_LDADD): Define.
3074 * testsuite/Makefile.in: Rebuild.
3075
a2c7281b
DK
30762010-03-22 Doug Kwan <dougkwan@google.com>
3077
3078 * arm.cc (Arm_relocate_functions::abs8,
3079 Arm_relocate_functions::abs16): Use correct check for overflow
3080 specified in the ARM ELF specs.
3081 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3082 target of a BLX instruction specially.
3083 (Reloc_stub::stub_type_for_reloc): Ditto.
3084 (Relocate::relocate): Use symbolic names instead of numeric relocation
3085 codes to report error.
3086 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3087 workaround.
3088 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3089 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3090 thumb2_blx_out_of_range.stdout
3091 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3092 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3093 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3094 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3095 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3096 thumb2_blx_in_range, thumb2_blx_in_range.o,
3097 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3098 thumb2_blx_out_of_range.o): New rules.
3099 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3100 thumb2_blx_in_range and thumb2_blx_out_of_range.
3101 * testsuite/Makefile.in: Regenerate.
3102 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3103 * testsuite/thumb_blx_in_range.s: New file.
3104 * testsuite/thumb_blx_out_of_range.s: New file.
3105
b0193076
RÁE
31062010-03-22 Rafael Espindola <espindola@google.com>
3107
3108 * archive.cc (Should_include): Move to archive.h.
3109 (should_include_member): Make it a member of Archive.
3110 (Lib_group): New.
3111 (Add_lib_group_symbols): New.
3112 * archive.h: Include options.h.
3113 (Archive_member): Moved from Archive.
3114 (Should_include): Moved from archive.cc.
3115 (Lib_group): New.
3116 (Add_lib_group_symbols): New.
3117 * dynobj.cc (do_should_include_member): New.
3118 * dynobj.h (do_should_include_member): New.
3119 * gold.cc (queue_initial_tasks): Update call to queue.
3120 * main.cc (main): Print lib group stats.
3121 * object.cc (do_should_include_member): New.
3122 * object.h: Include archive.h.
3123 (Object::should_include_member): New.
3124 (Object::do_should_include_member): New.
3125 (Sized_relobj::do_should_include_member): New.
3126 * options.cc (General_options::parse_start_lib): New.
3127 (General_options::parse_end_lib): New.
3128 (Input_arguments::add_file): Handle lib groups.
3129 (Input_arguments::start_group): Check we are not in a lib.
3130 (Input_arguments::start_lib): New.
3131 (Input_arguments::end_lib): New.
3132 * options.h (General_options): Add start_lib and end_lib.
3133 (Input_argument::lib_): New.
3134 (Input_argument::lib): New.
3135 (Input_argument::is_lib): New.
3136 (Input_file_lib): New.
3137 (Input_arguments::in_lib_): New.
3138 (Input_arguments::in_lib): New.
3139 (Input_arguments::start_lib): New.
3140 (Input_arguments::end_lib_): New.
3141 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3142 in unused members as preempted.
3143 (Sized_pluginobj::do_should_include_member): New.
3144 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3145 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3146 return the blocker.
3147 (Read_symbols::do_whole_lib_group): New.
3148 (Read_symbols::do_lib_group): New.
3149 (Read_symbols::do_read_symbols): Handle lib groups.
3150 (Read_symbols::get_name): Handle lib groups.
3151 * readsyms.h (Read_symbols): Add an archive member pointer.
3152 (Read_symbols::do_whole_lib_group): New.
3153 (Read_symbols::do_lib_group): New.
3154 (Read_symbols::member_): New.
3155 * script.cc (read_input_script): Update call to queue_soon.
3156
d099120c
DK
31572010-03-19 Doug Kwan <dougkwan@google.com>
3158
3159 * arm.cc (Stub_table::Stub_table): Initialize new data members
3160 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3161 (Stub_table::add_reloc_stub): Assign stub offset and update
3162 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3163 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3164 New data members.
3165 (Stub_table::update_data_size_and_addralign): Use
3166 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3167 instead of going over all reloc stubs.
3168 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3169 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3170 Stringpool_template::offset_ to size of Stringpool_char.
3171 (Stringpool_template::new_key_offset): Remove code to initialize
3172 Stringpool_template::offset_.
3173 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3174 Stringpool_template::offset_ to zero.
3175
1aa37384
DK
31762010-03-15 Doug Kwan <dougkwan@google.com>
3177
3178 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3179 offset_.
3180 (Stringpool_template::new_key_offset): New method.
3181 (Stringpool_template::add_string): Assign offsets when adding new
3182 strings.
3183 (Stringpool_template::set_string_offsets): Do not set string offsets
3184 when not optimizing.
3185 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3186 member size_.
3187 (Chunked_vector::clear): Clear size_.
3188 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3189 (Chunked_vector::size): Return size_.
3190 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3191 (Chunked_vector::size_): New data member.
1aa37384
DK
3192 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3193 (Stringpool_template::new_key_offset): New method declaration.
3194 (Stringpool_template::offset_): New data member.
3195
b672b057
RÁE
31962010-03-15 Rafael Espindola <espindola@google.com>
3197
3198 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3199 Add_symbols' constructor.
3200 * readsyms.h (Add_symbols): Remove the input_group member.
3201
b6848d3c
ILT
32022010-03-10 Ian Lance Taylor <iant@google.com>
3203
3204 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3205 target to ask whether a reference to a symbol requires a stack
3206 split.
3207 * target.h (Target::is_call_to_non_split): New function.
3208 (Target::do_is_call_to_non_split): Declare virtual function.
3209 * target.cc: Include "symtab.h".
3210 (Target::do_is_call_to_non_split): New function.
3211 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3212
a2a5469e
CC
32132010-03-10 Cary Coutant <ccoutant@google.com>
3214
3215 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3216 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3217 (File_read::open[2]): Add whole_file_view_ to list of views.
3218 (File_read::make_view): Remove test of whole_file_view_.
3219 (File_read::find_or_make_view): Create whole_file_view_ if
3220 necessary.
3221 (File_read::clear_views): Replace bool parameter with enum;
3222 adjust all callers. Don't delete views with permanent data;
3223 do delete cached views and views from archives if
3224 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3225 if clearing the corresponding view.
3226 * fileread.h (File_read::Clear_views_mode): New enum.
3227 (File_read::View::is_permanent_view): New method.
3228 (File_read::clear_views): Replace bool parameter
3229 with enum; adjust all callers.
3230 * options.h (General_options): Change keep_files_mapped option;
3231 add map_whole_files.
3232 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3233 releasing the file.
3234 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3235 the file.
3236
8861f32b
DM
32372010-03-10 David S. Miller <davem@davemloft.net>
3238
3239 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
3240
d62d0f5f
ST
32412010-03-09 Sriraman Tallam <tmsriram@google.com>
3242
3243 * icf.cc (get_section_contents): Add '@' marker after processing the
3244 merge reloc.
3245
9177756d
DK
32462010-03-08 Doug Kwan <dougkwan@google.com>
3247
3248 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
3249 due to a conversion warning.
3250 (Arm_relobj::update_output_local_symbol_count): Check for local
3251 symbol with unset output index.
3252
9e9e071b
ILT
32532010-03-05 Ian Lance Taylor <iant@google.com>
3254
3255 * options.h (class General_options): Add --spare-dynamic-tags.
3256 * output.cc (Output_data_dynamic::set_final_data_size): Implement
3257 --spare-dynamic-tags.
3258
a81ee015
ILT
32592010-03-05 Ian Lance Taylor <iant@google.com>
3260
3261 * incremental.cc: Include "libiberty.h".
3262
44ec90b9
RO
32632010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3264
3265 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
3266 function, is_info_ member.
3267 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
3268 (Versions::Versions): Update caller.
3269 (Versions::define_base_version): Likewise.
3270 (Versions::add_def): Likewise.
3271
0897ed3b
ST
32722010-03-03 Sriraman Tallam <tmsriram@google.com>
3273
3274 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
3275 (Scan::possible_function_pointer_reloc): New function.
3276 (Scan::local_reloc_may_be_function_pointer): Change to call
3277 possible_function_pointer_reloc.
3278 (Scan::global_reloc_may_be_function_pointer): Ditto.
3279 * icf.h (Icf::check_section_for_function_pointers): Change to reject
3280 relocations in ".data.rel.ro._ZTV" section.
3281 * testsuite/icf_safe_so_test.sh: Change to pass i386.
3282 * testsuite/icf_safe_so_test.cc: Ditto.
3283 * testsuite/icf_safe_test.cc: Ditto.
3284 * testsuite/icf_safe_test.sh: Ditto.
3285
d3bbad62
ILT
32862010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3287 Ian Lance Taylor <iant@google.com>
3288
3289 * target-reloc.h (relocate_section): Check the symbol table index
3290 for -1U before setting the local symbol index.
3291 (scan_relocatable_relocs): If copying the relocation, record that
3292 the local symbol is required.
3293 * object.h (Symbol_value::is_output_symtab_index_set): New
3294 function.
3295 (Symbol_value::may_be_discarded_from_output_symtab): New
3296 function.
3297 (Symbol_value::has_output_symtab_entry): New function.
3298 (Symbol_value::needs_output_symtab_entry): Remove.
3299 (Symbol_value::output_symtab_index): Make sure the symbol index is
3300 set.
3301 (Symbol_value::set_output_symtab_index): Make sure the symbol
3302 index is not set. Make sure the new index is valid.
3303 (Symbol_value::set_must_have_output_symtab_entry): New function.
3304 (Symbol_value::has_output_dynsym_entry): New function.
3305 (Symbol_value::set_output_dynsym_index): Make sure the new index
3306 is valid.
3307 (Sized_relobj::set_must_have_output_symtab_entry): New function.
3308 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
3309 local symbol if permitted.
3310 (Sized_relobj::do_finalize_local_symbols): Call
3311 is_output_symtab_index_set rather than needs_output_symtab_entry.
3312 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
3313 rather than needs_output_symtab_entry. Call
3314 has_output_dynsym_entry rather than needs_output_dynsym_entry.
3315 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
3316 is_output_symtab_index_set rather than needs_output_symtab_entry.
3317 * testsuite/discard_locals_relocatable_test.c: New file.
3318 * testsuite/discard_locals_test.sh: Test -r.
3319 * testsuite/Makefile.am (check_DATA): Add
3320 discard_locals_relocatable_test1.syms,
3321 discard_local_relocatable_test2.syms.
3322 (MOSTLYCLEANFILES): Likewise. Also add
3323 discard_locals_relocatable_test1.lout and
3324 discard_locals_relocatable_test2.out.
3325 (discard_locals_relocatable_test1.syms): New target.
3326 (discard_locals_relocatable_test.o): New target.
3327 (discard_locals_relocatable_test1.out): New target.
3328 (discard_locals_relocatable_test2.syms): New target.
3329 (discard_locals_relocatable_test2.out): New target.
3330 (various): Add missing ../ld-new dependencies.
3331 * testsuite/Makefile.in: Rebuild.
3332
7e8ccf26
NC
33332010-03-03 Nick Clifton <nickc@redhat.com>
3334
3335 * po/fi.po: New Finnish translation.
3336
2a0ff005
DK
33372010-03-01 Doug Kwan <dougkwan@google.com>
3338
3339 * layout.cc (Layout::Layout): Force section types of .init_array*,
3340 .preinit_array* and .fini_array* sections.
3341 * output.cc (Output_section::Input_section_sort_entry::has_priority):
3342 Fix check of return value of std::string::find.().
3343 (Output_section::Input_section_sort_compare::operator()): Remove
3344 comment about .init_array.
3345 (Output_section::Input_section_sort_init_fini_compare::operator()):
3346 New method.
3347 (Output_section::sort_attached_input_sections): Handle .init_array
3348 and .fini_array specially.
3349 * output.h (Output_section::Inut_section_sort_compare): Update
3350 comment.
3351 (Output_section::Input_section_sort_init_fini_compare): New struct.
3352
c3e4ae29
DK
33532010-02-26 Doug Kwan <dougkwan@google.com>
3354
3355 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
3356 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
3357 * testsuite/debug_msg.sh: Avoid matching source line number for
3358 use of global variable undef_int.
3359
2fd9ae7a
DK
33602010-02-26 Doug Kwan <dougkwan@google.com>
3361
3362 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
3363 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
3364 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
3365 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
3366 * options.cc (General_options::General_options): Initialize member
3367 fix_v4bx_.
3368 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
3369 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
3370 and rm_no_fix_v4bx.stdout
3371 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
3372 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
3373 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
3374 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
3375 and arm_no_fix_v4bx.
3376 * Makefile.in: Regenerate.
3377 * testsuite/arm_fix_v4bx.s: New file.
3378 * testsuite/arm_fix_v4bx.sh: Ditto.
3379
67ec7d0b
DK
33802010-02-24 Doug Kwan <dougkwan@google.com>
3381
3382 * arm.cc (Target_arm::got_section): Make the .got section the first
3383 non RELRO section in the data segment.
3384 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
3385 suffixes of section names.
3386
10165461
DK
33872010-02-24 Doug Kwan <dougkwan@google.com>
3388
3389 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
3390 flags and attributes merging if an input file is a binary file.
3391 * fileread.cc (Input_file::open): Record format of original file.
3392 * fileread.h (Input_file::Format): New enum type.
3393 (Input_file::Input_file): Initialize data member format_.
3394 (Input_file::format): New method definition.
3395 (Input_file::format_):: New data member.
3396
4a54abbb
DK
33972010-02-24 Doug Kwan <dougkwan@google.com>
3398
3399 * arm.cc (Arm_output_data_got): New class.
3400 (ARM_TCB_SIZE): New constant
3401 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
3402 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
3403 If user uses a script with a SECTIONS clause, issue only a warning
3404 for a misplaced EXIDX input section. Otherwise, issue an error.
3405 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
3406 garbage collection.
3407 (Target_arm::got_mode_index_entry): Handle static linking.
3408 (Target_arm::Scan::local): Ditto.
3409 (Target_arm::Scan::global): Ditto.
3410 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
3411 all incorrectly implemented relocations.
e1df38aa 3412 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
3413 Arm_output_section::fix_exidx_coverage.
3414 * layout.cc (Layout::section_name_mapping): Remove trailing dots
3415 from ".ARM.exidx." and ".ARM.extab.".
3416
ca419a6f
ILT
34172010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3418
3419 * arm.cc (Target_arm::do_finalize_sections): Create attribute
3420 section if it does not already exist.
3421 * attributes.cc (Attributes_section_data::Attributes_section_data):
3422 Don't crash if size is zero.
3423
135b9c78
ILT
34242010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3425 Ian Lance Taylor <iant@google.com>
3426
3427 * gold.cc (queue_middle_tasks): If no input files were opened,
3428 exit.
3429 * workqueue.h (Task_function::Task_function): Assert that there is
3430 a blocker.
3431
bb0bfe4f
DK
34322010-02-22 Doug Kwan <dougkwan@google.com>
3433
3434 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
3435 * icf.cc (get_section_contents): Cast snprintf arguments to long long
3436 types to avoid warnings due to different uint64_t implementations
3437 on different hosts.
3438
2a2b6d42
DK
34392010-02-21 Doug Kwan <dougkwan@google.com>
3440
3441 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
3442 handling of the maximum backward branch offset.
3443 (Arm_relocate_functions::thumb_branch_common): Ditto.
3444 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
3445 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 3446 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
3447 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
3448 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
3449 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
3450 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
3451 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
3452 thumb_bl_out_of_range thumb_bl_out_of_range.o,
3453 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
3454 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
3455 thumb2_bl_out_of_range.o): New rules.
3456 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
3457 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
3458 thumb2_bl_out_of_range
3459 * testsuite/Makefile.in: Regenerate.
3460 * testsuite/arm_bl_in_range.s: New file.
3461 * testsuite/arm_bl_out_of_range.s: Ditto.
3462 * testsuite/arm_branch_in_range.sh: Ditto.
3463 * testsuite/arm_branch_range.t: Ditto.
3464 * testsuite/thumb2_branch_range.t: Ditto.
3465 * testsuite/thumb_bl_in_range.s: Ditto.
3466 * testsuite/thumb_bl_out_of_range.s: Ditto.
3467 * testsuite/thumb_branch_range.t: Ditto.
3468
b487ad64
ST
34692010-02-20 Sriraman Tallam <tmsriram@google.com>
3470
3471 * gc.h (gc_process_relocs): Change vectors to point to the new list.
3472 Add reloc offset information.
3473 * icf.cc (get_section_contents): Change iterators to point to the new
3474 vectors. Add reloc offset information to the contents.
3475 * icf.h (Icf::Sections_reachable_info): New typedef.
3476 (Icf::Sections_reachable_list): New typedef.
3477 (Icf::Offset_info): New typedef.
3478 (Icf::Reloc_info): New struct typedef.
3479 (Icf::Reloc_info_list): New typedef.
3480 (Icf::symbol_reloc_list): Delete method.
3481 (Icf::addend_reloc_list): Delete method.
3482 (Icf::section_reloc_list): Delete method.
3483 (Icf::reloc_info_list): New method.
3484 (Icf::reloc_info_list_): New member.
3485
f96accdf
DK
34862010-02-19 Doug Kwan <dougkwan@google.com>
3487
3488 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
3489 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
3490 * arm.cc (Arm_relocation_functions): New forward declaration.
3491 (Target_arm::Target_arm): Initialize new data members
3492 got_mod_index_offset_ and tls_base_symbol_defined_.
3493 (Target_arm::Relocate::relocate_tls): New method.
3494 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
3495 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
3496 New methods.
3497 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
3498 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
3499 (Target_arm::got_mod_index_offset_,
3500 Target_arm::tls_base_symbol_defined_): New data members.
3501 (Target_arm::Scan::local, Target::Scan::global,
3502 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
3503 relocations.
3504
c8761b9a
DK
35052010-02-18 Doug Kwan <dougkwan@google.com>
3506
3507 * arm.cc (Arm_relobj::find_linked_text_section): New method.
3508 (Arm_relobj::make_exidx_input_section): Pass section index of linked
3509 text section as a parameter becuase some broken tools may not set
3510 the link in section header.
3511 (Target_arm::has_got_section): New method.
3512 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
3513 without any mapping symbol as data only. Remove warning.
3514 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
3515 link in its section header, try to discover the link by inspecting the
3516 REL31 relocation at the beginning of the section.
3517 (Target_arm::Scan::check_non_pic): Report name of offending relocation
3518 in error message.
3519 (Target_arm::Scan::global): Treat any reference to the symbol
3520 _GLOBAL_OFFSET_TABLE_ as a GOT access.
3521
21bb3914
ST
35222010-02-12 Sriraman Tallam <tmsriram@google.com>
3523
3524 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
3525 (Scan::global_reloc_may_be_function_pointer): New function.
3526 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3527 (Scan::global_reloc_may_be_function_pointer): New function.
3528 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3529 (Scan::global_reloc_may_be_function_pointer): New function.
3530 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
3531 (Scan::global_reloc_may_be_function_pointer): New function.
3532 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
3533 (Scan::global_reloc_may_be_function_pointer): New function.
3534 (Scan::possible_function_pointer_reloc): New function.
3535 (Target_x86_64::can_check_for_function_pointers): New function.
3536 * gc.h (gc_process_relocs): Scan relocation types to determine if
3537 function pointers were taken for targets that support it.
3538 * icf.cc (Icf::find_identical_sections): Include functions for
3539 folding in safe ICF whose pointer is not taken.
3540 * icf.h (Secn_fptr_taken_set): New typedef.
3541 (fptr_section_id_): New member.
3542 (section_has_function_pointers): New function.
3543 (set_section_has_function_pointers): New function.
3544 (check_section_for_function_pointers): New function.
3545 * options.h: Fix comment for safe ICF option.
3546 * target.h (can_check_for_function_pointers): New function.
3547 * testsuite/Makefile.am: Add icf_safe_so_test test case.
3548 Modify icf_safe_test for X86-64.
3549 * testsuite/Makefile.in: Regenerate.
3550 * testsuite/icf_safe_so_test.cc: New file.
3551 * testsuite/icf_safe_so_test.sh: New file.
3552 * testsuite/icf_safe_test.cc (kept_func_3): New function.
3553 (main): Change to take pointer to function kept_func_3.
3554 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
3555 folding is done correctly for X86-64.
3556
0da6fa6c
DM
35572010-02-12 David S. Miller <davem@davemloft.net>
3558
3559 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
3560 is_symbolless parameter.
3561 (Output_reloc<SHT_REL>::is_symbolless): New.
3562 (Output_reloc<SHT_REL>::is_symbolless_): New.
3563 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
3564 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
3565 (Output_reloc<SHT_RELA>::is_symbolless): New.
3566 (Output_data_reloc::add_global): Handle is_symbolless.
3567 (Output_data_reloc::add_global_relative): Likewise.
3568 (Output_data_reloc::add_local): Likewise.
3569 (Output_data_reloc::add_local_relative): Likewise.
3570 (Output_data_reloc::add_symbolless_global_addend): New.
3571 (Output_data_reloc::add_symbolless_local_addend): New.
3572 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
3573 is_symbolless.
3574 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
3575 instead of ->is_relative_
3576 (Output_reloc::write): Likewise.
3577 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
3578 (Output_reloc::write_rel): Simplify.
3579
3580 * sparc.cc (Target_sparc::Scan::local): Use
3581 ->add_symbolless_local_addend as needed.
3582 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
3583 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
3584 based upon relocation offset.
3585
e4782e83
DK
35862010-02-11 Doug Kwan <dougkwan@google.com>
3587
3588 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
3589 (Target_arm::Scan::global): Ditto. Also remove a comment before the
3590 beginning of function.
3591 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
3592 and MOVT_ABS relocations. Those are non issued in scanning. Fix
3593 parameter is_32bit in calls to should_apply_static_reloc.
3594 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
3595 (check_DATA): Add arm_abs_global.stdout.
3596 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
3597 arm_abs_global.stdout): New rules.
3598 (MOSTLLYCLEANFILES): Add arm_abs_global
3599 * Makefile.in: Regenerate.
3600 * testsuite/arm_abs_global.s: New file.
3601 * testsuite/arm_abs_global.sh: Ditto.
3602 * testsuite/arm_abs_lib.s: Ditto.
3603
93ceb764
ILT
36042010-02-11 Ian Lance Taylor <iant@google.com>
3605
3606 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
3607 Read_relocs task.
3608 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
3609 Allocate_commons_task first.
3610 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
3611 task, rather than symtab_lock_.
3612 (Gc_process_relocs::~Gc_process_relocs): New function.
3613 (Gc_process_relocs::is_runnable): Check this_blocker_.
3614 (Gc_process_relocs::locks): Use next_blocker_ rather than
3615 blocker_.
3616 (Scan_relocs::~Scan_relocs): New function.
3617 (Scan_relocs::is_runnable): Check this_blocker_ rather than
3618 symtab_lock_.
3619 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
3620 next_blocker_.
3621 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
3622 fields. Add this_blocker_ and next_blocker_ fields. Adjust
3623 constructor accordingly.
3624 (class Gc_process_relocs): Likewise.
3625 (class Scan_relocs): Likewise.
3626 * common.h (class Allocate_commons_task): Remove symtab_lock_
3627 field, and corresponding constructor parameter.
3628 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
3629 symtab_lock_.
3630 (Allocate_commons_task::locks): Likewise.
3631
114dfbe1
ILT
36322010-02-11 Ian Lance Taylor <iant@google.com>
3633
3634 * gold-threads.h (class Once): Define.
3635 (class Initialize_lock): Rewrite as child of Once.
3636 * gold-threads.cc (class Once_initialize): Define.
3637 (once_pointer_control): New static variable.
3638 (once_pointer, once_arg): New static variables.
3639 (c_run_once): New static function.
3640 (Once::Once, Once::run_once, Once::internal_run): New functions.
3641 (class Initialize_lock_once): Remove.
3642 (initialize_lock_control): Remove.
3643 (initialize_lock_pointer): Remove.
3644 (initialize_lock_once): Remove.
3645 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
3646 (Initialize_lock::initialize): Rewrite.
3647 (Initialize_lock::do_run_once): New function.
3648 * archive.cc (Archive::interpret_header): Only clear name if it is
3649 not already empty.
3650 * fileread.cc: Include "gold-threads.h"
3651 (file_counts_lock): New static variable.
3652 (file_counts_initialize_lock): Likewise.
3653 (File_read::release): Only increment counts when using --stats.
3654 Use a lock around the increment.
3655 * parameters.cc (class Set_parameters_target_once): Define.
3656 (set_parameters_target_once): New static variable.
3657 (Parameters::Parameters): Move here from parameters.h.
3658 (Parameters::set_target): Rewrite.
3659 (Parameters::set_target_once): New function.
3660 (Parameters::clear_target): Move here and rewrite.
3661 * parameters.h (class Parameters): Update declarations. Add
3662 set_parameters_target_once_ field.
3663 (Parameters::Parameters): Move to parameters.cc.
3664 (Parameters::clear_target): Likewise.
3665 * readsyms.cc (Read_symbols::do_group): Create a Start_group
3666 task.
3667 (Start_group::~Start_group): New function.
3668 (Start_group::is_runnable): New function.
3669 (Start_group::locks, Start_group::run): New functions.
3670 (Finish_group::run): Change saw_undefined to size_t.
3671 * readsyms.h (class Start_group): Define.
3672 (class Finish_group): Change saw_undefined_ field to size_t.
3673 (Finish_group::Finish_group): Remove saw_undefined and
3674 this_blocker parameters. Change all callers.
3675 (Finish_group::set_saw_undefined): New function.
3676 (Finish_group::set_blocker): New function.
3677 * symtab.h (class Symbol_table): Change saw_undefined to return
3678 size_t. Change saw_undefined_ field to size_t.
3679 * target-select.cc (Set_target_once::do_run_once): New function.
3680 (Target_selector::Target_selector): Initialize set_target_once_
3681 field. Don't initialize lock_ and initialize_lock_ fields.
3682 (Target_selector::instantiate_target): Rewrite.
3683 (Target_selector::set_target): New function.
3684 * target-select.h (class Set_target_once): Define.
3685 (class Target_selector): Update declarations. Make
3686 Set_target_once a friend. Remove lock_ and initialize_lock_
3687 fields. Add set_target_once_ field.
3688
fa17a3f4
ILT
36892010-02-10 Ian Lance Taylor <iant@google.com>
3690
3691 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
3692 queueing any tasks.
3693 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
3694 (queue_middle_tasks): Add all blockers before queueing any tasks.
3695 (queue_final_tasks): Likewise.
3696 * token.h (Task_token::add_blockers): New function.
3697 * object.h (Input_objects::number_of_relobjs): New function.
3698
c7177d31
ILT
36992010-02-10 Ian Lance Taylor <iant@google.com>
3700
5de0e392
ILT
3701 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
3702 shared, not if not position independent.
3703 * x86_64.cc (Relocate::relocate_tls): Likewise.
3704 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
3705 (tls_pie_pic_test): New target.
3706 * testsuite/Makefile.in: Rebuild.
3707
c7177d31
ILT
3708 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
3709 (tls_test_main_pie.o, tls_test_pie.o): New targets.
3710 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
3711 * testsuite/Makefile.in: Rebuild.
3712
684b268a
DM
37132010-02-09 David S. Miller <davem@davemloft.net>
3714
3715 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
3716 R_SPARC_RELATIVE using ->add_local_relative().
3717 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
3718
612a8d3d
DM
3719 * output.h (Output_data_dynamic::add_section_size): New method
3720 that takes two Output_data objects.
3721 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
3722 entry param. Handle it in initializers.
3723 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
3724 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
3725 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
3726 arg.
3727 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
3728 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
3729 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
3730 for dynrel_includes_plt.
3731 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3732 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3733 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
3734 before .rela.plt
3735 (Target_sparc::do_finalize_sections): Update to pass true for
3736 dynrel_includes_plt.
3737 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
3738 output before .rela.plt
3739 (Target_powerpc::do_finalize_sections): Update to pass true for
3740 dynrel_includes_plt when 32-bit.
3741
cb1be87e
DK
37422010-02-08 Doug Kwan <dougkwan@google.com>
3743
3744 * arm.cc (Arm_relobj::simple_input_section_output_address): New
3745 method.
3746 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
3747 Arm_relobj::scan_section_for_cortex_a8_stubs,
3748 Arm_relobj::do_relocation_section): Instead of calling
3749 Output_section::output_address, use faster
3750 Arm_relobj::simple_input_section_output_address.
3751
705b5121
DM
37522010-02-08 David S. Miller <davem@davemloft.net>
3753
3754 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
3755 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
3756 relocation helper function.
3757
024c4466
DM
3758 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
3759 just like R_SPARC_GOT{10,13,22}.
3760 (Target_sparc::Scan::local): Likewise.
3761 (Target_sparc::Relocate:relocate): Likewise.
3762
9109c078
ILT
37632010-02-06 Ian Lance Taylor <iant@google.com>
3764
3765 * configure.ac: Rewrite targetobjs duplicate removal code to use
3766 only shell constructs.
3767 * configure: Rebuild.
3768
cf846138
DK
37692010-02-05 Doug Kwan <dougkwan@google.com>
3770
3771 PR 11247
3772 * arm.cc (Arm_relobj::section_is_scannable): New method.
3773 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
3774 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
3775
6cfaf60b
DK
37762010-02-04 Doug Kwan <dougkwan@google.com>
3777
3778 PR 11247
3779 * arm-reloc-property.cc (cstdio): Include.
3780 * configure.ac (targetobjs): Remove duplicates.
3781 * configure: Regenerate.
3782 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
3783 big and little endian version for a given address size.
3784
5c57f1be
DK
37852010-02-03 Doug Kwan <dougkwan@google.com>
3786
3787 * arm-reloc-property.cc
3788 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3789 definition.
3790 * arm-reloc-property.h
3791 (Arm_reloc_property_table::get_implemented_static_reloc_property):
3792 New method definition.
3793 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3794 declaration.
3795 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
3796 overflow to N.
3797 (GOT_PREL): Change implemented to Y.
3798 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
3799 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
3800 (Arm_relocate_functions::movw_abs_nc): Remove method.
3801 (Arm_relocate_functions::movt_abs): Ditto.
3802 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
3803 (Arm_relocate_functions::thm_movt_abs): Ditto.
3804 (Arm_relocate_functions::movw_rel_nc): Ditto.
3805 (Arm_relocate_functions::movw_rel): Ditto.
3806 (Arm_relocate_functions::movt_rel): Ditto.
3807 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
3808 (Arm_relocate_functions:thm_movw_rel): Ditto.
3809 (Arm_relocate_functions:thm_movt_rel): Ditto.
3810 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
3811 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
3812 New method definitions.
3813 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
3814 (Arm_relocation_functions::arm_grp_ldr): Ditto.
3815 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
3816 (Arm_relocation_functions::arm_grp_ldc): Ditto.
3817 (Target_arm::Relocate::relocate): Check for non-static or
3818 unimplemented relocation code and exit early. Change calls to
3819 Target_arm::reloc_uses_thumb_bit and
3820 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
3821 instead. Refactor code to handle similar relocations to increase
3822 code sharing. Remove check for unsupported relocation code in switch
3823 statement.
3824 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
3825 relocation property table to find out size. Change error message to
3826 print out the name of a relocation code instead of the numeric value.
3827 (Target_arm::scan_reloc_for_stub): Use relocation property table
3828 instead of calling Target_arm::reloc_uses_thumb_bit().
3829
218c5831
DK
38302010-02-02 Doug Kwan <dougkwan@google.com>
3831
3832 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
3833 types of relaxed input section.
3834
0d31c79d
DK
38352010-02-02 Doug Kwan <dougkwan@google.com>
3836
3837 * Makefile.am (HFILES): Add arm-reloc-property.h.
3838 (DEFFILES): New.
3839 (TARGETSOURCES): Add arm-reloc-property.cc
3840 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
3841 (libgold_a_SOURCES): $(DEFFILES)
3842 * Makefile.in: Regenerate.
3843 * arm-reloc-property.cc: New file.
3844 * arm-reloc-property.h: New file.
3845 * arm-reloc.def: New file.
3846 * arm.cc: Update comments.
3847 (arm-reloc-property.h): New included header.
3848 (arm_reloc_property_table): New global variable.
3849 (Target_arm::do_select_as_default_target): New method definition.
3850 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
3851 arm-reloc-property to targ_extra_obj.
3852 * parameters.cc (set_parameters_target): Call
3853 Target::select_as_default_target().
3854 * target.h (Target::select_as_default_target): New method definition.
3855 (Target::do_select_as_default_target): Same.
3856
546c7457
DK
38572010-02-01 Doug Kwan <dougkwan@google.com>
3858
3859 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
3860 first_output_text_section_.
3861 (Arm_exidx_fixup::first_output_text_section): New method definition.
3862 (Arm_exidx_fixup::first_output_text_section_): New data member.
3863 (Arm_exidx_fixup::process_exidx_section): Record the first text
3864 output section seen.
3865 (Arm_output_section::fix_exidx_coverage): Set correct linked section
3866 and entsize in output section header.
3867
11b861d5
DK
38682010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3869
3870 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
3871 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
3872 (Arm_relocate_functions::thm_alu11): New Method.
3873 (Arm_relocate_functions::thm_pc8): New Method.
3874 (Arm_relocate_functions::thm_pc12): New Method.
3875 (Target_arm::Scan::local): Handle the relocations.
3876 (Target_arm::Scan::global): Likewise.
3877 (Target_arm::Relocate::relocate): Likewise.
3878 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
3879
c9a2c125
DK
38802010-01-29 Doug Kwan <dougkwan@google.com>
3881
3882 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
3883 of relocation types as ld.
3884
1521477a
DK
38852010-01-29 Doug Kwan <dougkwan@google.com>
3886
3887 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
3888 to public.
3889 (Arm_relocate_functions::thumb_branch_common): Ditto.
3890 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
3891 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
3892 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
3893 Arm_relocate_functions::jump24): Remove.
3894 (Target_arm::Relocate::relocate): Adjust code to call
3895 Arm_relocation_functions::arm_branch_common and
3896 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 3897 wrappers. Merge switch-cases together to reduce source code size.
1521477a 3898
e7eca48c
DK
38992010-01-29 Doug Kwan <dougkwan@google.com>
3900
3901 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
3902 output_local_symbol_count_needs_update_.
3903 (Arm_relobj::output_local_symbol_count_needs_update,
3904 Arm_relobj::set_output_local_symbol_count_needs_update,
3905 Arm_relobj::update_output_local_symbol_count): New methods.
3906 (Arm_relobj::output_local_symbol_count_needs_update_): New data
3907 member.
3908 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
3909 of pointed function as in a R_ARM_PREL31 relocation.
3910 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
3911 for output local symbol count updating.
3912 (Target_arm::do_relax): Update output local symbol counts in objects
3913 if necessary.
3914 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
3915
02961d7e
ILT
39162010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3917
3918 * arm.cc: Added support for the ARM relocations:
3919 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
3920 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
3921 (Arm_relocate_functions::movw_rel_nc): Renamed (was
3922 movw_prel_nc).
3923 (Arm_relocate_functions::movw_rel): New method.
3924 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
3925 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
3926 thm_movw_prel_nc).
3927 (Arm_relocate_functions::thm_movw_rel): New method.
3928 (Arm_relocate_functions::thm_movt_rel): Renamed (was
3929 thm_movt_prel).
3930 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
3931 relocations.
3932 (Target_arm::Scan::global): Likewise.
3933 (Target_arm::Relocate::relocate): Likewise.
3934 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3935 Likewise.
3936
b10d2873
ILT
39372010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3938
3939 * arm.cc: Added support for ARM group relocations.
3940 (Target_arm::reloc_needs_sym_origin): New method.
3941 (Arm_relocate_functions::calc_grp_kn): New method.
3942 (Arm_relocate_functions::calc_grp_residual): New method.
3943 (Arm_relocate_functions::calc_grp_gn): New method.
3944 (Arm_relocate_functions::arm_grp_alu): New Method.
3945 (Arm_relocate_functions::arm_grp_ldr): New Method.
3946 (Arm_relocate_functions::arm_grp_ldrs): New Method.
3947 (Arm_relocate_functions::arm_grp_ldc): New Method.
3948 (Target_arm::Scan::local): Handle the ARM group relocations.
3949 (Target_arm::Scan::global): Likewise.
3950 (Target_arm::Relocate::relocate): Likewise.
3951 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3952 Likewise.
3953
2b328d4e
DK
39542010-01-26 Doug Kwan <dougkwan@google.com>
3955
3956 * arm.cc (set): Include.
3957 (class Arm_exidx_fixup): Change type of last_input_section_ to const
3958 pointer type.
3959 (Arm_output_section::Text_section_list): New type.
3960 (Arm_output_section::append_text_sections_to_list): New method.
3961 (Arm_output_section::fix_exidx_coverage): Ditto.
3962 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
3963 (Arm_relobj::convert_input_section_to_relaxed_section): Use
3964 Relobj::set_section_offset() instead of
3965 Sized_relobj::invalidate_section_offset().
3966 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
3967 parameter for section headers. Ignore relocation sections for
3968 unallocated sections and EXIDX sections.
3969 (Target_arm::fix_exidx_coverage): New method.
3970 (Target_arm::output_section_address_less_than): New type.
3971 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
3972 linked text section instead of the EXIDX section.
3973 (Arm_output_section::create_stub_group): Add an assertion to check
3974 that this is not an EXIDX output section.
3975 (Arm_output_section::append_text_sections_to_list): New method.
3976 (Arm_output_section::fix_exidx_coverage): Ditto.
3977 (Arm_relobj::scan_sections_for_stubs): Adjust call to
3978 Arm_relobj::section_needs_reloc_stub_scanning.
3979 (Target_arm::do_relax): Fix EXIDX output section coverage in the
3980 first pass.
3981 (Target_arm::fix_exidx_coverage): New method.
3982 * object.h (Relobj::set_output_section): New method.
3983 (Sized_relobj::invalidate_section_offset): Remove method.
3984 (Sized_relobj::do_invalidate_section_offset): Remove method.
3985 (Sized_relobj::do_set_section_offset): Handle offset value -1.
3986
c7f3c371
DK
39872010-01-25 Doug Kwan <dougkwan@google.com>
3988
3989 * arm.cc (Arm_exidx_merged_section::do_output_offset):
3990 Fix warning due to signed and unsigned comparison on a 32-bit host.
3991
8923b24c
DK
39922010-01-22 Doug Kwan <dougkwan@google.com>
3993
3994 * arm.cc (Target_arm::do_relax): Record an output section for section
3995 offset adjustment it contains any stub table that has changed.
3996 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
3997 offsets in an output section if necessary.
3998 * output.cc (Output_section::Output_section): Initialize
3999 section_offsets_need_adjustments_.
4000 (Output_section::add_input_section_for_script): Renamed to
4001 Output_section::add_simple_input_section.
4002 (Output_section::save_states): Add a comment.
4003 (Output_section::discard_states): New method defintion.
4004 (Output_section::adjust_section_offsets): Same.
4005 * output.h (Output_section::add_input_section_for_script): Renamed to
4006 Output_section::add_simple_input_section.
4007 (Output_section::discard_states): New method declaration.
4008 (Output_section::adjust_section_offsets): Same.
4009 (Output_section::section_offsets_need_adjustment,
4010 Output_section::set_section_offsets_need_adjustment): New method
4011 definitions.
4012 (Output_section::section_offsets_need_adjustment_): New data member.
4013 * script-sections.cc
4014 (Output_section_element_input::set_section_address): Adjust code for
4015 renaming of Output_section::add_input_section_for_script.
4016 (Orphan_output_section::set_section_address): Same.
4017
9b2fd367
DK
40182010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4019
4020 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4021 Fix_v4bx enum values .
4022 * gold/options.h (General_options): New option definitions.
4023 (General_options::fix_v4bx): New method.
4024 (General_options::Fix_v4bx): New enum.
4025 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4026 (General_options::parse_fix_v4bx_interworking): New method.
4027
80d0d023
DK
40282010-01-22 Doug Kwan <dougkwan@google.com>
4029
4030 * arm.cc (Arm_exidx_fixup): New class.
4031
af2cdeae
DK
40322010-01-21 Doug Kwan <dougkwan@google.com>
4033
4034 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4035 classes.
4036 (Arm_exidx_section_offset_map): New type.
4037
993d07c1
DK
40382010-01-21 Doug Kwan <dougkwan@google.com>
4039
4040 * arm.cc (Arm_exidx_input_section): New class.
4041 (Arm_relobj::exidx_input_section_by_link,
4042 Arm_relobj::exidx_input_section_by_shndx,
4043 Arm_relobj::make_exidx_input_section): New methods.
4044 (read_arm_attributes_section): Remove.
4045 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4046 information about them.
4047 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4048 to here.
4049
5ac169d4
DK
40502010-01-20 Doug Kwan <dougkwan@google.com>
4051
4052 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4053 Input_section_specifier to Section_id.
4054 (Target_arm::new_arm_input_section: Adjust code for change of key
4055 type.
4056 (Target_arm::find_arm_input_section): Ditto.
4057 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4058 (Section_id): Remove.
4059 (Garbage_collection::Section_id_hash): Remove.
4060 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4061 (Section_id): Remove.
4062 (Icf::Section_id_hash): Remove.
4063 * object.h (Section_id, Const_section_id, Section_id_hash,
4064 Const_section_id_hash): New type definitions.
4065 * output.cc (Output_section::add_relaxed_input_section): Change to
4066 use Const_section_id instead of Input_section_specifier as key type.
4067 (Output_section::add_merge_input_section): Ditto.
4068 (Output_section::build_relaxation_map): Change to use Section_id
4069 instead of Input_section_specifier as key type.
4070 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4071 Ditto.
4072 (Output_section::convert_input_sections_to_relaxed_sections): Change
4073 to use Const_section_id instead of Input_section_specifier as key type.
4074 (Output_section::find_merge_section): Ditto.
4075 (Output_section::find_relaxed_input_section): Ditto.
4076 * output.h (Input_section_specifier): Remove class.
4077 (Output_section::Output_section_data_by_input_section_map): Change
4078 key type to Const_section_id.
4079 (Output_section::Output_relaxed_input_section_by_input_section_map):
4080 Ditto.
4081 (Output_section::Relaxation_map): Change key type to Section_id.
4082
a2162063
ILT
40832010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4084
4085 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4086 (class Arm_v4bx_stub): New class.
4087 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4088 (Stub_factory::make_arm_v4bx_stub): New method.
4089 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4090 (Stub_table::empty): Handle v4bx stubs.
4091 (Stub_table::add_arm_v4bx_stub): New method.
4092 (Stub_table::find_arm_v4bx_stub): New method.
4093 (Arm_relocate_functions::v4bx): New method.
4094 (Target_arm::fix_v4bx): New method.
4095 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4096 (Stub_table::relocate_stubs): Likewise.
4097 (Stub_table::do_write): Likewise.
4098 (Stub_table::update_data_size_and_addralign): Likewise.
4099 (Stub_table::finalize_stubs): Likewise.
4100 (Target_arm::Scan::local): Likewise.
4101 (Target_arm::Scan::global): Likewise.
4102 (Target_arm::do_finalize_sections): Likewise.
4103 (Target_arm::Relocate::relocate): Likewise.
4104 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4105 Likewise.
4106 (Target_arm::scan_reloc_for_stub): Likewise.
4107 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4108
5696ab0b
ILT
41092010-01-19 Ian Lance Taylor <iant@google.com>
4110
4111 * output.cc (Output_section_headers::do_sized_write): Write large
4112 segment count to sh_info field.
4113 (Output_file_header::do_sized_write): For large segment count,
4114 write PN_XNUM to e_phnum field.
4115
800d0f56
ILT
41162010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4117
4118 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4119 (Arm_relocate_functions::thm_jump8): New function.
4120 (Arm_relocate_functions::thm_jump11): New function.
4121 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4122 R_ARM_THM_JUMP11.
4123 (Target_arm::Scan::global): Likewise.
4124 (Target_arm::Relocate::relocate): Likewise.
4125 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4126 Likewise.
4127
41263c05
DK
41282010-01-14 Doug Kwan <dougkwan@google.com>
4129
4130 * arm.cc (map, utility): Include headers.
4131 (Target_arm::apply_cortex_a8_workaround): New method.
4132 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4133 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4134 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4135 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4136 the --[no-]fix-cortex-a8 command line options.
4137 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4138 (Target_arm::relocate_stub): Use addend in instruction template.
4139 * options.h (DEFINE_bool): Set the user-set flag.
4140 (General_options): Add --[no-]-fix-cortex options.
4141 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4142 : Update fast look-up map after conversion.
41263c05 4143
459e9b03
ST
41442010-01-14 Sriraman Tallam <tmsriram@google.com>
4145
4146 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4147 in the first pass of do_layout.
4148
b521dfe4
DK
41492010-01-13 Doug Kwan <dougkwan@google.com>
4150
4151 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4152 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4153 apparent compiler problem of not folding static constant integral
4154 data members of elfcpp::Elf_sizes<32>.
4155
44272192
DK
41562010-01-13 Doug Kwan <dougkwan@google.com>
4157
4158 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4159 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4160 Arm_relobj::scan_section_for_cortex_a8_erratum,
4161 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4162 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4163 sections to scan for relocation stubs into a new method
4164 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4165 relocation and Cortex-A8 stub scanning.
4166 (Target_arm::do_relax): Force stubs to be after stubbed sections
4167 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4168 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4169 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4170
44b71ece
ILT
41712010-01-12 Ian Lance Taylor <iant@google.com>
4172
4173 * target-reloc.h (visibility_error): New inline function.
4174 (relocate_section): Call visibility_error.
4175 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4176 (MOSTLYCLEANFILES): Likewise.
4177 (protected_4_pic.o, protected_3.err): New targets.
4178 * testsuite/protected_4.cc: New file.
4179
a120bc7f
DK
41802010-01-12 Doug Kwan <dougkwan@google.com>
4181
4182 * arm.cc (Cortex_a8_reloc): New class.
4183 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4184 and cortex_a8_relocs_info_.
4185 (Target_arm::fix_cortex_a8): New method definition.
4186 (Target_arm::Cortex_a8_relocs_info): New type.
4187 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4188 New data member declarations.
4189 (Target_arm::scan_reloc_for_stub): Record information about
4190 relocations for THUMB branches that might be exempted from the
4191 Cortex-A8 workaround.
4192 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4193 at the beginning of a relaxation pass.
4194
20138696
DK
41952010-01-12 Doug Kwan <dougkwan@google.com>
4196
4197 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4198 (Arm_relobj::Mapping_symbol_position,
4199 Arm_reloj::Mapping_symbol_position_less,
4200 Arm_relobj::Mapping_symbols_info): New types.
4201 (Target_arm::is_mapping_symbol_name): New method definition.
4202 (Arm_relobj::do_count_local_symbols): Save information about mapping
4203 symbols.
4204
089d69dc
DK
42052010-01-11 Doug Kwan <dougkwan@google.com>
4206
4207 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4208 Arm_relocate_functions::thumb32_branch_upper,
4209 Arm_relocate_functions::thumb32_branch_lower,
4210 Arm_relocate_functions::thumb32_cond_branch_offset,
4211 Arm_relocate_functions::thumb32_cond_branch_upper,
4212 Arm_relocate_functions::thumb32_cond_branch_lower,
4213 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4214 branch offset encoding.
4215 (Arm_relocate_functions::thumb_branch_common): Use new branch
4216 offset encoding methods to avoid code duplication.
4217 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4218 (Stub_addend_reader::operator()): Use new branch encoding method
4219 to avoid code duplication.
4220
99e5bff2
DK
42212010-01-11 Doug Kwan <dougkwan@google.com>
4222
4223 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4224 (Target_arm::do_finalize_sections): Define special EXIDX section
4225 symbols only if referenced.
4226 * gc.h (Garbage_collection::add_reference): New method.
4227 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4228 code duplication.
4229
98e090bd
ILT
42302010-01-11 Ian Lance Taylor <iant@google.com>
4231
d0a91bd8
ILT
4232 * script.cc (Version_script_info::build_expression_list_lookup):
4233 Change complaing about duplicate wildcard match from error to
4234 warning.
4235
98e090bd
ILT
4236 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4237 of 2009-12-30.
4238 (Version_script_info::Version_script_info): Initialize globs_,
4239 default_version_, default_is_global_, and exact_. Don't
4240 initialize globals_ or locals_.
4241 (Version_script_info::build_lookup_tables): Build local symbols
4242 first.
4243 (Version_script_info::unquote): New function.
4244 (Version_script_info::add_exact_match): New function.
4245 (Version_script_info::build_expression_list_lookup): Remove lookup
4246 parameter. Add is_global parameter. Change all callers. Handle
4247 wildcard pattern specially. Unquote pattern. Call
4248 add_exact_match.
4249 (Version_script_info::get_name_to_match): New function.
4250 (Version_script_info::get_symbol_version): New function.
4251 (Version_script_info::get_symbol_version_helper): Remove.
4252 (Version_script_info::check_unmatched_names): Call unquote.
4253 * script.h (class Version_script_info): Change get_symbol_version
4254 to be non-inline and add is_global parameter; change all callers.
4255 Rewrite symbol_is_local. Update declarations. Define struct
4256 Version_tree_match, Exact, Globs. Don't define struct Lookup.
4257 Remove globals_ and locals_ members. Add exact_, globs_,
4258 default_version_, is_global_.
4259 (Version_script_info::Glob): Remove pattern, add expression and
4260 is_global. Update constructor. Change all callers.
4261 * dynobj.cc (Versions::finalize): Mark the version symbol as the
4262 default version.
4263 (Versions::symbol_section_contents): If a symbol is undefined, or
4264 defined in a dynamic object, set the version index to
4265 VER_NDX_LOCAL.
4266 * symtab.cc (Symbol_table::add_from_relobj): Don't call
4267 symbol_is_local.
4268 (Symbol_table::add_from_pluginobj): Likewise.
4269 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
4270
d56962d3
DK
42712010-01-11 Doug Kwan <dougkwan@google.com>
4272
4273 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
4274 (incremental_dump_LDADD): Add linking option for libintl.
4275 * Makefile.in: Regenerate.
4276
94e6ee91
L
42772010-01-11 H.J. Lu <hongjiu.lu@intel.com>
4278
4279 PR gold/11144
4280 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
4281 instead of -Ds.
4282 * testsuite/Makefile.in: Regenerated.
4283
e96c574b
DK
42842010-01-10 Doug Kwan <dougkwan@google.com>
4285
4286 * options.h (DEFINE_var): Use parentheses around argument varname__
4287 in macro body to avoid any unintended subsequent substitutions.
4288
7198066b
ILT
42892010-01-10 Ian Lance Taylor <iant@google.com>
4290
ba4d53bf
ILT
4291 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
4292 candidates before doing symbol resolution.
4293
7198066b
ILT
4294 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
4295 ODR candidates if only one is weak.
4296
a2beed37
ILT
42972010-01-08 Ian Lance Taylor <iant@google.com>
4298
4299 * script.cc (Version_script_info::build_expression_list_lookup):
4300 Don't warn about ambiguous version, just record the ambiguity.
4301 (Version_script_info::get_symbol_version_helper): Give error if
4302 version is ambiguous.
4303
2fb7225c
DK
43042010-01-08 Doug Kwan <dougkwan@google.com>
4305
4306 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
4307 prev_data_size_ and prev_addralign_. Remove initializer for
4308 deleted data member has_been_changed_.
4309 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
4310 to determine if the table is empty.
4311 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
4312 Remove.
4313 (Stub_table::add_reloc_stub): Define method in class definition
4314 instead of just declaring it there.
4315 (Stub_table::add_cortex_a8_stub): New method definition.
4316 (Stub_table::update_data_size_and_addralign): Ditto.
4317 (Stub_table::finalize_stubs): Ditto.
4318 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
4319 (Stub_table::do_addralign_): Return address alignment in the
4320 (Stub_table::do_reset_address_and_file_offset): Define method in
4321 class definition instead of declaring it there. Set current data
4322 size to be the data size of the previous pass.
4323 (Stub_table::set_final_data_size): Use current data size as the
4324 final data size.
4325 (Stub_table::relocate_stub): Change parameter type of stub from
4326 Reloc_stub pointer to Stub pointer.
4327 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
4328 (Stub_table::Cortex_a8_stub_list): New typedef.
4329 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
4330 Stub_table::prev_addralign_): New data member.
4331 (Arm_relobj::Arm_relobj): Initialize data member
4332 section_has_cortex_a8_workaround_.
4333 (Arm_relobj::section_has_cortex_a8_workaround,
4334 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
4335 definitions.
4336 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
4337 declarations.
4338 (Target_arm::relocate_stub): Change parameter type of stub from
4339 Reloc_stub pointer to Stub pointer.
4340 (Insn_template::size, Insn_template::alignment): Handle
4341 THUMB16_SPECIAL_TYPE.
4342 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
4343 Stub_table::update_data_size_and_addralign,
4344 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
4345 definitions.
4346 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
4347 (Stub_table::do_write): Ditto.
4348 (Target_arm::do_relax): Adjust code for changes in Stub_table.
4349
880cd20d
ILT
43502010-01-08 Ian Lance Taylor <iant@google.com>
4351
4352 PR 11108
4353 * symtab.h (class Symbol): Remove fields is_target_special_ and
4354 has_plt_offset_. Add field is_defined_in_discarded_section_.
4355 (Symbol::is_defined_in_discarded_section): New function.
4356 (Symbol::set_is_defined_in_discarded_section): New function.
4357 (Symbol::has_plt_offset): Rewrite.
4358 (Symbol::set_plt_offset): Verify that new offset is not -1U.
4359 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
4360 Don't initialize is_target_special_ or has_plt_offset_.
4361 Initialize is_defined_in_discarded_section_.
4362 (Symbol_table::add_from_relobj): If appropriate, set
4363 is_defined_in_discarded_section.
4364 * resolve.cc (Symbol::override_base_with_special): Don't test
4365 is_target_special_. Change has_plt_offset_ to has_plt_offset().
4366 * target-reloc.h (relocate_section): Do special handling for
4367 symbols defined in discarded sections for global symbols as well
4368 as local symbols.
4369
2703e3eb
ILT
43702010-01-08 Ian Lance Taylor <iant@google.com>
4371
4372 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
4373 the SHT_SYMTAB case.
4374
339d40a3
ILT
43752010-01-08 Ian Lance Taylor <iant@google.com>
4376
4377 * object.cc (Sized_relobj::do_layout): Don't get confused if
4378 layout_eh_frame returns NULL.
4379
abecea76
ILT
43802010-01-08 Ian Lance Taylor <iant@google.com>
4381
4382 PR 11084
4383 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
4384 dynamic symbol table, use the normal symbol table.
4385 (Sized_dynobj::do_read_symbols): Remove assertion about type of
4386 symbol table.
4387
6b7dd3f3
ILT
43882010-01-08 Ian Lance Taylor <iant@google.com>
4389
4390 PR 11072
4391 * layout.cc (Layout::include_section): Remove .gnu_debuglink
4392 sections.
4393
36c50e63
L
43942010-01-08 H.J. Lu <hongjiu.lu@intel.com>
4395
4396 * version.cc (print_version): Change to "Copyright 2010".
4397
e291e7b9
ILT
43982010-01-08 Ian Lance Taylor <iant@google.com>
4399
4400 PR 10287
4401 PR 11063
4402 * i386.cc (class Target_i386): Change return type of plt_section
4403 to be non-const.
4404 (class Output_data_plt_i386): Add tls_desc_rel_ field.
4405 (Output_data_plt_i386::Output_data_plt_i386): Initialize
4406 tls_desc_rel_ field.
4407 (Output_data_plt_i386::rel_tls_desc): New function.
4408 (Target_i386::rel_tls_desc_section): New function.
4409 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
4410 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
4411 R_386_TLS_DESC reloc in rel_tls_desc_section.
4412 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
4413 Define struct Tlsdesc_info.
4414 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
4415 (Target_x86_64::do_reloc_symbol_index): New function.
4416 (Target_x86_64::add_tlsdesc_info): New function.
4417 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
4418 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
4419 tlsdesc_rel_ field.
4420 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
4421 all callers.
4422 (Output_data_plt_x86_64::rela_tlsdesc): New function.
4423 (Target_x86_64::rela_tlsdesc_section): New function.
4424 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
4425 handling.
4426 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
4427 (Target_x86_64::do_reloc_addend): New function.
4428 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
4429 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
4430 declarations. Define TARGET_CODE. Add arg field to u1_ union.
4431 (Output_reloc::type): New function.
4432 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
4433 (Output_reloc::is_target_specific): New function.
4434 (Output_reloc::target_arg): New function.
4435 (class Output_reloc) [SHT_RELA]: Add four new constructors for
4436 absolute relocs and target specific relocs.
4437 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
4438 add_target_specific.
4439 (class Output_data_reloc) [SHT_RELA]: Likewise.
4440 * output.cc (Output_reloc::Output_reloc): Add four new versions
4441 for absolute relocs and target specific relocs.
4442 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
4443 (Output_reloc::get_symbol_index): Likewise.
4444 (Output_reloc::local_section_offset): Check that local_sym_index_
4445 is not TARGET_CODE or 0.
4446 (Output_reloc::symbol_value): Likewise.
4447 (Output_reloc::write) [SHT_RELA]: Call target for target specific
4448 reloc.
4449 * target.h (class Target): Add reloc_symbol_index and reloc_addend
4450 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
4451 functions.
4452 * layout.cc (add_target_dynamic_tags): Use output section for
4453 DT_PLTRELSZ and DT_JMPREL.
4454
3a44184e
ILT
44552010-01-07 Ian Lance Taylor <iant@google.com>
4456
4457 PR 11061
4458 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
4459 function.
4460 (class Output_data_reloc_generic): Define.
4461 (class Output_data_reloc_base): Change base class to
4462 Output_data_reloc_generic. Change add() method to call
4463 bump_relative_reloc_count for a relative reloc. Remove
4464 sort_relocs_ field.
4465 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
4466 to sort_relocs().
4467 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
4468 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
4469 appropriate.
4470 * layout.h (class Layout): Update declaration.
4471
ea715a34
ILT
44722010-01-07 Ian Lance Taylor <iant@google.com>
4473
4474 * output.h (class Output_data): Add const version of
4475 output_section and do_output_section.
4476 (class Output_section_data): Add const version of
4477 do_output_section.
4478 (class Output_section): Likewise.
4479 * layout.cc (Layout::add_target_dynamic_tags): New function.
4480 * layout.h (class Layout): Update declarations.
4481 * arm.cc (Target_arm::do_finalize_sections): Use
4482 add_target_dynamic_tags.
4483 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4484 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4485 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4486 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4487
659948a4
ILT
44882010-01-07 Ian Lance Taylor <iant@google.com>
4489
4490 PR 11042
4491 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
4492 object as needed.
4493
9d3b86f6
ILT
44942010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
4495 Ian Lance Taylor <iant@google.com>
4496
4497 PR 11019
4498 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
4499 Xindex::read_symtab_xindex.
4500
bb0d3eb0
DK
45012010-01-07 Doug Kwan <dougkwan@google.com>
4502
4503 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
4504 (Insn_template::thumb16_bcond_insn): New method declaration.
4505 (Insn_template): Fix spelling.
4506 (Stub::thumb16_special): New method declaration.
4507 (Stub::do_write): Define virtual method which was previously pure
4508 virtual.
4509 (Stub::do_thumb16_special): New method declaration.
4510 (Stub::do_fixed_endian_write): New template member.
4511 (Reloc_stub::do_write): Remove.
4512 (Reloc_stub::do_fixed_endian_write): Remove.
4513 (Cortex_a8_stub): New class definition.
4514 (Stub_factory::make_cortex_a8_stub): New method definition.
4515 (Stub_factory::Stub_factory): Add missing static storage class
4516 qualifier for elf32_arm_stub_a8_veneer_blx.
4517
ffeef7df
ILT
45182010-01-07 Ian Lance Taylor <iant@google.com>
4519
dc3f80fe
ILT
4520 PR 10980
4521 * options.h (class General_options): Add --warn-unresolved-symbols
4522 and --error-unresolved-symbols.
4523 * errors.cc (Errors::undefined_symbol): Implement
4524 --warn-unresolved-symbols.
4525
ffeef7df
ILT
4526 * options.h (class General_options): Add -z text and -z textoff.
4527 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
4528
f1ec9ded
ST
45292010-01-06 Sriraman Tallam <tmsriram@google.com>
4530
4531 * gc.h (Garbage_collection::Cident_section_map): New typedef.
4532 (Garbage_collection::cident_sections): New function.
4533 (Garbage_collection::add_cident_section): New function.
4534 (Garbage_collection::cident_sections_): New member.
4535 (gc_process_relocs): Add references to sections whose names are C
4536 identifiers.
4537 * gold.h (cident_section_start_prefix): New constant.
4538 (cident_section_stop_prefix): New constant.
4539 (is_cident): New function.
4540 * layout.cc (Layout::define_section_symbols): Replace string constants
4541 with the newly defined constants.
4542 * object.cc (Sized_relobj::do_layout): Track sections whose names are
4543 C identifiers.
4544 * testsuite/Makefile.am: Add gc_orphan_section_test.
4545 * testsuite/Makefile.in: Regenerate.
4546 * testsuite/gc_orphan_section_test.cc: New file.
4547 * testsuite/gc_orphan_section_test.sh: New file.
4548
6eda8c29
ILT
45492010-01-06 Ian Lance Taylor <iant@google.com>
4550
b9674e17
ILT
4551 PR 10980
4552 * options.h (class General_options): Add --warn-shared-textrel.
4553 * layout.cc (Layout::finish_dynamic_section): Implement
4554 --warn-shared-textrel.
4555
6eda8c29
ILT
4556 PR 10980
4557 * options.h (class General_options): Add --warn-multiple-gp.
4558
32dcd44e
ILT
45592010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4560
4561 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
4562 $(THREADSLIB) and $(LIBDL).
4563 * Makefile.in: Rebuild.
4564
a192ba05
ILT
45652010-01-06 Ian Lance Taylor <iant@google.com>
4566
4567 PR 10980
4568 * options.cc (General_options::parse_section_start): New function.
4569 (General_options::section_start): New function.
4570 (General_options::General_options): Initialize all members.
4571 * options.h: Include <map>
4572 (class General_options): Add --section-start. Add section_starts_
4573 member.
4574 * layout.cc (Layout::attach_allocated_section_to_segment): If
4575 --section-start was used, set the address of the segment. Remove
4576 local sort_sections.
4577 (Layout::relaxation_loop_body): If the address of the load segment
4578 has been set by --section-start, don't use it.
4579 * output.h (Output_segment::update_flags_for_output_section): New
4580 function.
4581 * output.cc (Output_segment::add_output_section): Call
4582 update_flags_for_output_section.
4583
dde3f402
ILT
45842010-01-05 Ian Lance Taylor <iant@google.com>
4585
62dfdd4d
ILT
4586 PR 10980
4587 * options.h (class General_options): Add --undefined-version.
4588 * script.cc (struct Version_expression): Add was_matched_by_symbol
4589 field.
4590 (Version_script_info::matched_symbol): New function.
4591 (Version_script_info::get_symbol_version_helper): Call
4592 matched_symbol.
4593 (Version_script_info::check_unmatched_names): New function.
4594 * script.h (class Version_script_info): Update declarations.
4595 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
4596
9c4ae156
ILT
4597 * options.h (class General_options): Use DEFINE_bool_alias for
4598 allow_multiple_definition.
4599 * resolve.cc (Symbol_table::should_override): Don't test
4600 allow_multiple_definition.
4601
dde3f402
ILT
4602 PR 10980
4603 * options.h (class General_options): Add --cref.
4604 * main.cc (main): Print cref table if --cref. Don't close mapfile
4605 until after printing cref table.
4606 * cref.cc: Include "symtab.h".
4607 (class Cref_inputs): Define Cref_table_compare and Cref_table.
4608 (Cref_table_compare::operator()): New function.
4609 (Cref_inputs::gather_cref): New function.
4610 (filecol): New static const.
4611 (Cref_inputs::print_cref): New function.
4612 (Cref::print_cref): New function.
4613 * cref.h: Include <cstdio>.
4614 (class Cref): Update declarations.
4615 * mapfile.h (Mapfile::file): New function.
4616 * object.h (class Object): Define Symbols. Declare virtual
4617 do_get_global_symbols.
4618 (Object::get_global_symbols): New function.
4619 * object.cc (Input_objects::add_object): Pass object to cref_ if
4620 --cref.
4621 (Input_objects::archive_start): Likewise.
4622 (Input_objects::archive_stop): Likewise.
4623 (Input_objects::print_cref): New function.
4624 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
4625 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
4626 --cref.
4627 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
4628 function.
4629 * plugin.h (class Sized_pluginobj): Update declarations.
4630
8781f709
ILT
46312010-01-05 Ian Lance Taylor <iant@google.com>
4632
4633 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
4634 to is_default_version. Rename insdef to insdefault.
4635 (Symbol_table::add_from_relobj): Rename def to is_default_version
4636 and local to is_forced_local.
4637 (Symbol_table::add_from_pluginobj): Likewise.
4638 (Symbol_table::add_from_dynobj): Likewise.
4639 (Symbol_table::define_special_symbol): Rename insdef to
4640 insdefault.
4641
fe35d28d
ILT
46422010-01-04 Ian Lance Taylor <iant@google.com>
4643
30bc8c46
ILT
4644 PR 10980
4645 * options.h (class General_options): Add
4646 --allow-multiple-definition and -z muldefs.
4647 * resolve.cc (Symbol_table::should_override): Don't warn about a
4648 multiple symbol definition if --allow-multiple-definition or -z
4649 muldefs.
4650
7eaea549
ILT
4651 PR 10980
4652 * options.h (class General_options): Add --add-needed and
4653 --copy-dt-needed-entries. Tweak --as-needed help entry.
4654 * object.cc (Input_objects::check_dynamic_dependencies): Give an
4655 error if --copy-dt-needed-entries aka --add-needed is used and
4656 would cause a change in behaviour.
4657
fe35d28d
ILT
4658 PR 10980
4659 * options.h (class General_options): Add -G as a short version of
4660 --shared. Add no-op options -assert, -g, and -i.
4661
55a2bb35
ST
46622010-01-04 Sriraman Tallam <tmsriram@google.com>
4663
4664 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
4665 check for .text or .gnu.linkonce.t sections.
4666 * icf.cc (Icf::find_identical_sections): Ditto.
4667 Change the detection for mangled function name within the section
4668 name.
4669 * icf.h (is_section_foldable_candidate): New function.
4670
719328e1
ILT
46712009-12-30 Ian Lance Taylor <iant@google.com>
4672
4673 PR 10980
4674 * options.h (class General_options): Permit two dashes with
4675 --retain-symbols-file.
4676
d7bb5745
ILT
46772009-12-30 Ian Lance Taylor <iant@google.com>
4678
403a15dd
ILT
4679 PR 10979
4680 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
4681 don't put the file header and segment headers in the text
4682 segment.
4683
eda294df
ILT
4684 PR 10979
4685 * common.cc (Sort_commons::operator()): Stabilize sort when both
4686 entries are NULL.
4687 (Symbol_table::do_allocate_commons_list): When allocating common
4688 symbols, skip a symbol which is no longer common.
4689 * symtab.h (Symbol::is_common): Test whether the symbol comes from
4690 an object before checking its type.
4691 * testsuite/common_test_2.c: New file.
4692 * testsuite/common_test_3.c: New file.
4693 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
4694 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
4695 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
4696 (common_test_2_pic.o, common_test_2.so): New targets.
4697 (common_test_3_pic.o, common_test_3.so): New targets.
4698 * testsuite/Makefile.in: Rebuild.
4699
d7bb5745
ILT
4700 PR 10979
4701 * script.cc (read_input_script): If we see a new SECTIONS clause,
4702 and we have added an input section, give an error.
4703 * layout.h (class Layout): Add have_added_input_section function.
4704 Add have_added_input_section_ field.
4705 * layout.cc (Layout::Layout): Initialize
4706 have_added_input_section_.
4707 (Layout::layout): Set have_added_input_section_.
4708 (Layout::layout_eh_frame): Likewise.
4709
fc59c572
ILT
47102009-12-30 Ian Lance Taylor <iant@google.com>
4711
4712 PR 10931
4713 * options.h (class General_options): Add --sort-common option.
4714 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
4715 * common.cc (Sort_common): Add sort_order parameter to
4716 constructor. Add sort_order_ field.
4717 (Sort_commons::operator): Check sort_order_.
4718 (Symbol_table::allocate_commons): Determine the sort order.
4719 (Symbol_table::do_allocate_commons): Add sort_order parameter.
4720 Change all callers.
4721 (Symbol_table::do_allocate_commons_list): Likewise.
4722
1c74fab0
ILT
47232009-12-30 Ian Lance Taylor <iant@google.com>
4724
4725 PR 10916
4726 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
4727 symbols from this object, don't change the visibility of an
4728 undefined symbol.
4729 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
4730
6affe781
ILT
47312009-12-30 Ian Lance Taylor <iant@google.com>
4732
4733 PR 10861
4734 * script.h (class Version_script_info): Define Language enum.
4735 Update declarations. Define Glob, Exact, and Lookup types. Add
4736 new fields globals_, locals_, and is_finalized_.
4737 * script.cc: Various formatting fixes.
4738 (class Parser_closure): Change language_stack_ from a vector of
4739 std::string to one of Version_script_info::Language. Adjust all
4740 uses accordingly.
4741 (class Lazy_demangler): Remove.
4742 (struct Version_expression): Change language from std::string to
4743 Version_script_info::Language.
4744 (Version_script_info::Version_script_info): New function.
4745 (Version_script_info::~Version_script_info): Don't call clear.
4746 (Version_script_info::finalize): New function.
4747 (Version_script_info::build_lookup_tables): New function.
4748 (Version_script_info::build_expression_list_lookup): New
4749 function.
4750 (Version_script_info::get_symbol_version_helper): Rewrite to use
4751 lookup tables.
4752 (Version_script_info::print_expression_list): Adjust to use
4753 Version_script_info::Language.
4754 (script_push_lex_into_version_mode): Check that the version script
4755 has not been finalized.
4756 (version_script_push_lang): Change language string to
4757 Version_script_info::Language.
4758 * options.cc (Command_line::version_script): New function.
4759 * options.h (class General_options): Add finalize_dynamic_list
4760 function. Change version_script from declaration to definition.
4761 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
4762 * testsuite/version_script.map: Remove duplicate def of foo.
4763 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
4764 version_script.map.
4765 * testsuite/Makefile.in: Rebuild.
4766
818bf354
ILT
47672009-12-30 Ian Lance Taylor <iant@google.com>
4768
4769 PR 10843
4770 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
4771 if the input symbol index is 0, make the output symbol index 0.
4772
ebcc8304
ILT
47732009-12-30 Ian Lance Taylor <iant@google.com>
4774
4775 PR 10670
4776 * options.h (class General_options): Add -x/--discard-all.
4777 * object.cc (Sized_relobj::do_count_local_symbols): Handle
4778 --discard-all. If the local symbol needs a dynamic entry, check
4779 that before handling --discard-locals.
4780
176fe33f
ILT
47812009-12-30 Ian Lance Taylor <iant@google.com>
4782
bb321bb1
ILT
4783 PR 10450
4784 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
4785 flags to PF_R.
4786 (Output_segment::add_output_section): Don't change the flags if
4787 the type is PT_TLS.
4788
176fe33f
ILT
4789 PR 10450
4790 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
4791 GNU hash table if they need a dynamic value. Otherwise, don't add
4792 them if they are defined in a dynamic object or are forced local.
4793
e8cd95c7
ILT
47942009-12-29 Ian Lance Taylor <iant@google.com>
4795
1b81fb71
ILT
4796 PR 10450
4797 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
4798 .gnu.hash table for a 32-bit target.
4799
8d6d383d
ILT
4800 PR 10450
4801 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
4802 regular and a dynamic object only needs a dynamic symbol table
4803 entry if it is externally visible.
4804
e785ec03
ILT
4805 PR 10450
4806 * i386.cc (class Target_i386): Initialize global_offset_table_ in
4807 constructor. Add global_offset_table_ field.
4808 (Target_i386::got_section): Set global_offset_table_.
4809 (Target_i386::do_finalize_sections): Set global_offset_table_
4810 size.
4811 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
4812 in constructor. Add global_offset_table_ field.
4813 (Target_x86_64::got_section): Set global_offset_table_.
4814 (Target_x86_64::do_finalize_sections): Set global_offset_table_
4815 size.
4816
1a2dff53
ILT
4817 * layout.cc (Layout::Layout): Initialize increase_relro_.
4818 (Layout::get_output_section): Add is_relro, is_last_relro, and
4819 is_first_non_relro parameters. Change all callers.
4820 (Layout::choose_output_section): Likewise.
4821 (Layout::add_output_section_data): Likewise.
4822 (Layout::make_output_section): Likewise.
4823 (Layout::set_segment_offsets): Clear increase_relro when using a
4824 linker script.
4825 * layout.h (class Layout): Add increase_relro method. Add
4826 increase_relro_ field. Update declarations.
4827 * output.cc (Output_section::Output_section): Initialize
4828 is_last_relro_ and is_first_non_relro_.
4829 (Output_segment::add_output_section): Group relro sections is
4830 do_sort is true. Handle is_last_relro and is_first_non_relro.
4831 (Output_segment::maximum_alignment): Remove relro handling.
4832 (Output_segment::set_section_addresses): Add increase_relro
4833 parameter. Change all callers. Add initial alignment to align
4834 relro sections on separate page. Remove old relro handling.
4835 (Output_segment::set_section_list_addresses): Remove in_relro
4836 parameter. Change all callers.
4837 (Output_segment::set_offset): Add increase parameter. Change all
4838 callers. Remove old relro handling.
4839 * output.h (class Output_section): Add new methods: is_last_relro,
4840 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
4841 Add is_last_relro_ and is_first_non_relro_ fields.
4842 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
4843 Create separate .got.plt section. Call increase_relro.
4844 * x86_64.cc (Target_x86_64::got_section): Likewise.
4845 * testsuite/relro_script_test.t: Add .got.plt.
4846
f0ba79e2
ILT
4847 PR 10450
4848 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
4849 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
4850 (Layout::finalize): Call set_dynamic_symbol_size.
4851 (Layout::set_dynamic_symbol_size): New function.
4852 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
4853 set_dynamic_symbol_size.
4854
e8cd95c7
ILT
4855 PR 10450
4856 * output.h (class Output_section): Add is_entsize_zero_ field.
4857 * output.cc (Output_section::Output_section): Initialize
4858 is_entsize_zero_.
4859 (Output_section::set_entsize): If two different entsizes are
4860 requested, force it to zero.
4861 (Output_section::add_input_section): Set flags for .debug_str
4862 before updating section flags. Set entsize.
4863 (Output_section::update_flags_for_input_section): Set SHF_MERGE
4864 and SHF_STRING if all input sections have those flags.
4865
3e1b9a8a
RÁE
48662009-12-29 Rafael Espindola <espindola@google.com>
4867
4868 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
4869 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
4870 reporting.
3e1b9a8a 4871
3dcad376
ST
48722009-12-29 Sriraman Tallam <tmsriram@google.com>
4873
4874 * options.cc (General_options::parse_version): Allow -v to exit
4875 without an error if there is nothing to link.
4876
084e2665
ILT
48772009-12-29 Ian Lance Taylor <iant@google.com>
4878
4879 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
4880 using a version of gcc before 4.1.
4881 * configure: Rebuild.
4882
250acde3
CD
48832009-12-28 Chris Demetriou <cgd@google.com>
4884
4885 * attributes.cc (Output_attributes_section_data::do_write): Use
4886 std::vector::front rather than std::vector::data.
4887
99fff23b
ILT
48882009-12-28 Ian Lance Taylor <iant@google.com>
4889
4890 * symtab.h (class Symbol_table): Add enum Defined.
4891 * resolve.cc (Symbol_table::should_override): Add defined
4892 parameter. Change all callers. Test whether object is NULL
4893 before calling a method on it.
4894 (Symbol_table::report_resolve_problem): Add defined parameter.
4895 Change all callers.
4896 (Symbol_table::should_override_with_special): Likewise.
4897 * symtab.cc (Symbol_table::define_in_output_data): Add defined
4898 parameter. Change all callers.
4899 (Symbol_table::do_define_in_output_data): Likewise.
4900 (Symbol_table::define_in_output_segment): Likewise.
4901 (Symbol_table::do_define_in_output_segment): Likewise.
4902 (Symbol_table::define_as_constant): Likewise.
4903 (Symbol_table::do_define_as_constant): Likewise.
4904 * script.h (class Symbol_assignment): Add is_defsym parameter to
4905 constructor; change all callers.
4906 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
4907 parameter. Change all callers. Add is_defsym_ field.
4908 (class Parser_closure): Add parsing_defsym parameter to
4909 constructor; change all callers. Add parsing_defsym accessor
4910 function. Add parsing_defsym_ field.
4911
556bd683
ILT
49122009-12-28 Ian Lance Taylor <iant@google.com>
4913
4914 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 4915 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 4916
1782c879
ILT
49172009-12-23 Ian Lance Taylor <iant@google.com>
4918
4919 * i386.cc (Target_i386::do_calls_non_split): Recognize
4920 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
4921 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
4922 -fsplit-stack prologue when using %r11.
1782c879 4923
329ca2b1
ST
49242009-12-21 Sriraman Tallam <tmsriram@google.com>
4925
4926 * options.cc (General_options::parse_version): Make -v continue and do
4927 the link like GNU ld does.
4928
d675ff46
RÁE
49292009-12-17 Rafael Avila de Espindola <espindola@google.com>
4930
4931 * Makefile.am (CCFILES): Add timer.cc.
4932 (HFILES): Add timer.h.
4933 * configure.ac: Check for sysconf and times.
4934 * main.cc: include timer.h.
4935 (main): Use Timer instead of get_run_time.
4936 * timer.cc: New.
4937 * timer.h: New.
4938 * workqueue.cc: include timer.h.
4939 (Workqueue::find_and_run_task):
4940 Report user, sys and wall time.
4941 * Makefile.in: Regenerate.
4942 * config.in: Regenerate.
4943 * configure: Regenerate.
4944
d6344fb5
DK
49452009-12-16 Doug Kwan <dougkwan@google.com>
4946
4947 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
4948 sections.
4949 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
4950 relaxed input sections.
4951 * output.cc (Output_section::find_relaxed_input_section): Change
4952 return type to Output_relaxed_input_section pointer. Adjust code
4953 for new type of relaxed_input_section_map_.
4954 * output.h (Output_section::find_relaxed_input_section): Change
4955 return type to Output_relaxed_input_section pointer.
4956 (Output_section::Output_relaxed_input_section_by_input_section_map):
4957 New type.
4958 (Output_section::relaxed_input_section_map_): Change type to
4959 Output_section::Output_relaxed_input_section_by_input_section_map.
4960 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
4961 input section.
4962
0e0d5469
ILT
49632009-12-15 Ian Lance Taylor <iant@google.com>
4964
4965 * layout.cc (Layout::create_shstrtab): Only write out after input
4966 sections if we are compressing debug sections.
4967
0649a889
ILT
49682009-12-15 Ian Lance Taylor <iant@google.com>
4969
4970 * archive.cc (Archive::add_symbols): Only look up a symbol without
4971 a version if there is, in fact, a version.
4972
2ea97941
ILT
49732009-12-14 Ian Lance Taylor <iant@google.com>
4974
4975 Revert -Wshadow changes, all changes from:
4976 2009-12-11 Doug Kwan <dougkwan@google.com>
4977 2009-12-11 Nick Clifton <nickc@redhat.com>
4978 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
4979
b0eec2cc
DK
49802009-12-11 Doug Kwan <dougkwan@google.com>
4981
4982 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
4983 due to -Wshadow.
4984 * attributes.cc (Object_attribute::size): Ditto.
4985 (Attributes_section_data::size): Ditto.
4986 (Attributes_section_data::Attributes_section_data): Ditto.
4987 (Output_attributes_section_data::do_write): Ditto.
4988 * attributes.h (Object_attribute::set_type): Ditto.
4989 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
4990
91d6fa6a
NC
49912009-12-11 Nick Clifton <nickc@redhat.com>
4992
4993 * archive.cc: Fix shadowed variable warnings.
4994 * arm.cc: Likewise.
4995 * compressed_output.cc: Likewise.
4996 * compressed_output.h: Likewise.
4997 * configure: Likewise.
4998 * dwarf_reader.cc: Likewise.
4999 * dynobj.cc: Likewise.
5000 * dynobj.h: Likewise.
5001 * ehframe.cc: Likewise.
5002 * ehframe.h: Likewise.
5003 * errors.cc: Likewise.
5004 * expression.cc: Likewise.
5005 * fileread.cc: Likewise.
5006 * fileread.h: Likewise.
5007 * freebsd.h: Likewise.
5008 * i386.cc: Likewise.
5009 * icf.cc: Likewise.
5010 * incremental.h: Likewise.
5011 * layout.cc: Likewise.
5012 * layout.h: Likewise.
5013 * mapfile.cc: Likewise.
5014 * merge.cc: Likewise.
5015 * merge.h: Likewise.
5016 * object.cc: Likewise.
5017 * object.h: Likewise.
5018 * options.h: Likewise.
5019 * output.cc: Likewise.
5020 * output.h: Likewise.
5021 * parameters.cc: Likewise.
5022 * plugin.cc: Likewise.
5023 * powerpc.cc: Likewise.
5024 * reduced_debug_output.cc: Likewise.
5025 * reduced_debug_output.h: Likewise.
5026 * reloc.cc: Likewise.
5027 * reloc.h: Likewise.
5028 * resolve.cc: Likewise.
5029 * script-sections.cc: Likewise.
5030 * script.cc: Likewise.
5031 * script.h: Likewise.
5032 * sparc.cc: Likewise.
5033 * symtab.cc: Likewise.
5034 * symtab.h: Likewise.
5035 * target-select.cc: Likewise.
5036 * target-select.h: Likewise.
5037 * token.h: Likewise.
5038 * workqueue.cc: Likewise.
5039 * workqueue.h: Likewise.
5040 * x86_64.cc: Likewise.
5041
a0351a69
DK
50422009-12-10 Doug Kwan <dougkwan@google.com>
5043
5044 * arm.cc (attributes.h): New include.
5045 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5046 (Arm_relobj::~Arm_relobj): Delete object pointed by
5047 attributes_section_data_.
5048 (Arm_relobj::attributes_section_data): New method definition.
5049 (Arm_relobj::attributes_section_data_): New data member declaration.
5050 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5051 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5052 attributes_section_data_.
5053 (Arm_dynobj::attributes_section_data): New method definition.
5054 (Arm_dynobj::attributes_section_data_): New data member declaration.
5055 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5056 initialization value of may_use_blx_ to false.
5057 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5058 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5059 object attributes to compute results instead of hard-coding.
5060 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5061 Target_arm::get_secondary_compatible_arch,
5062 Target_arm::set_secondary_compatible_arch
5063 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5064 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5065 New method declarations.
5066 (Target_arm::get_aeabi_object_attribute): New method definition.
5067 (Target_arm::attributes_section_data_): New data member declaration.
5068 (read_arm_attributes_section): New template definition.
5069 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5070 (Arm_dynobj::do_read_symbols): Ditto.
5071 (Target_arm::do_finalize_sections): Merge attributes sections from
5072 input. Check for BLX use after attributes section merging.
5073 Fix __exidx_start and __exidx_end visibility. Create an
5074 .ARM.attributes section if necessary.
5075 (Target_arm::get_secondary_compatible_arch,
5076 Target_arm::set_secondary_compatible_arch,
5077 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5078 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5079 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5080 New method definitions.
5081
b59befec
ILT
50822009-12-09 Ian Lance Taylor <iant@google.com>
5083
5084 * plugin.cc (Plugin::load): Don't cast from void* to a function
5085 pointer.
5086
1276bc89
ILT
50872009-12-09 Ian Lance Taylor <iant@google.com>
5088
5089 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5090 information fields.
5091
2f2de248
L
50922009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5093
5094 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5095 Replace two_file_shared_1.so with two_file_shared_2.so.
5096 * testsuite/Makefile.in: Regenerated.
5097
4f787271
DK
50982009-12-08 Doug Kwan <dougkwan@google.com>
5099
5100 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5101 (HFILES): Add attributes.h and int_encoding.h.
5102 * Makefile.in: Regenerate.
5103 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5104 function definitions to int_encoding.cc
5105 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5106 prototypes to int_encoding.h
5107 * reduced_debug_output.cc (int_encoding.h): New include.
5108 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5109 function definitions to int_encoding.cc
5110 (insert_into_vector, read_from_pointer): Move template definitions to
5111 int_encoding.h
5112 * attributes.cc: New file.
5113 * attributes.h: New file.
5114 * int_encoding.cc: New file.
5115 * int_encoding.h: New file.
5116
20b52f1a
RÁE
51172009-12-07 Rafael Avila de Espindola <espindola@google.com>
5118
5119 PR gold/11055
5120 * incremental-dump.cc (dump_incremental_inputs): New.
5121 (main): Use dump_incremental_inputs.
5122
53d7974c
L
51232009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5124
5125 PR gold/10893
5126 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5127 checking elfcpp::STT_FUNC.
5128 (Target_i386::Relocate::relocate): Likewise.
5129 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5130
5131 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5132 symbols from shared libraries into normal FUNC symbols.
5133
5134 * symtab.h (Symbol): Add is_func and use it.
5135
05a352e6
DK
51362009-12-05 Doug Kwan <dougkwan@google.com>
5137
5138 * arm.cc (Target_arm::arm_info): Initialize new fields
5139 attributes_section and attributes_vendor.
5140 * i386.cc (Target_i386::i386_info): Same.
5141 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5142 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5143 fields attributes_section and attributes_vendor.
53d7974c 5144 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5145 * target.h (Target::attributes_section, Target::attributes_vendor,
5146 Target::is_attributes_section, Target::attribute_arg_type,
5147 Target::attributes_order): New method definitions.
5148 (Target::Target_info::attributes_section,
5149 Target::Target_info::attributes_vendor): New fields.
5150 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5151 virtual method definitions.
5152 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5153 attributes_section and attributes_vendor.
5154 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5155
f4e5969c
DK
51562009-12-05 Doug Kwan <dougkwan@google.com>
5157
5158 * arm.cc: Update comments about interworking and stub generation.
5159 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5160 considered as non-PIC.
5161 (Arm_relocate_functions::base_abs): Fix formatting.
5162 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5163 of function to use GOT entry address instead of offset.
5164 (Target_arm::Scan::global): Issue an error if a symbol would need a
5165 PLT does not get one because it is untyped. Remove code to create
5166 dynamic symbols for relative branches.
5167 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5168 takes unsigned integer instead of boolean.
5169
1abce4a6
L
51702009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5171
5172 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5173 (two_file_test_LDADD): Likewise.
5174 (common_test_1_LDADD): Likewise.
5175 (exception_test_LDADD) Likewise.
5176 (weak_test_LDADD): Likewise.
5177 (many_sections_test_LDADD): Likewise.
5178 (initpri1_LDADD): Likewise.
5179 (script_test_1_LDADD): Likewise.
5180 (script_test_2_LDADD): Likewise.
5181 (justsyms_LDADD): Likewise.
5182 (binary_test_LDADD): Likewise.
5183 (large_LDADD): Likewise.
5184 * testsuite/Makefile.in: Regenerated.
5185
adcf2816 51862009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5187
adcf2816
L
5188 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5189 (Symbol_table::override_with_special): Likewise.
5190 (Symbol_table::add_from_object): Likewise.
5191
28e67f5d
RÁE
51922009-12-04 Rafael Avila de Espindola <espindola@google.com>
5193
5194 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5195 Don't set the data_offset twice.
5196
ae10a101
RÁE
51972009-12-04 Rafael Avila de Espindola <espindola@google.com>
5198
5199 * testsuite/Makefile.in: Regenerate.
5200
f59f41f3
DK
52012009-12-03 Doug Kwan <dougkwan@google.com>
5202
5203 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5204 (Target_arm::do_finalize_sections): Add parameter for symbol table
5205 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5206 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5207 parameter for symbol table pointer.
5208 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5209 an additional parameter for a pointer to symbol table.
5210 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5211 parameter for a symbol table pointer.
5212 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5213 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5214 Ditto.
5215 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5216 parameter for a symbol table pointer.
5217
ca55d848
RÁE
52182009-12-03 Rafael Avila de Espindola <espindola@google.com>
5219
5220 * incremental.cc (Incremental_inputs_header)
5221 (Incremental_inputs_header_write, Incremental_inputs_entry)
5222 (Incremental_inputs_entry_write): Move ...
5223 * incremental.h (Incremental_inputs_header)
5224 (Incremental_inputs_header_write, Incremental_inputs_entry)
5225 (Incremental_inputs_entry_write): here.
5226
3aec4f9c
RÁE
52272009-12-02 Rafael Avila de Espindola <espindola@google.com>
5228
5229 * incremental.cc (make_sized_incremental_binary): Set the target.
5230 Error if it is incompatible.
5231 * output.h (Output_file): Add filename method.
5232
9c0ae74d
RÁE
52332009-12-02 Rafael Avila de Espindola <espindola@google.com>
5234
5235 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5236 from the get_* methods.
5237
a45500ae
RÁE
52382009-12-02 Rafael Avila de Espindola <espindola@google.com>
5239
5240 * incremental-dump.cc (main): Check that the offeset of a script is 0.
5241 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5242 Write 0 for the data_offset of scripts.
5243
325e6408
RÁE
52442009-12-02 Rafael Avila de Espindola <espindola@google.com>
5245
5246 * testsuite/Makefile.am: Add the incremental_test.sh test.
5247 * testsuite/incremental_test.sh: New.
5248 * testsuite/incremental_test_1.c: New.
5249 * testsuite/incremental_test_2.c: New.
5250
954c3e2e
RÁE
52512009-12-01 Rafael Avila de Espindola <espindola@google.com>
5252
5253 * incremental-dump.cc (main): Fix typos.
5254
f8086623
RÁE
52552009-11-27 Rafael Avila de Espindola <espindola@google.com>
5256
5257 PR gold/11025
5258 * incremental-dump.cc (main): Use llu to print 64 bit values.
5259
3b0dd6ac
L
52602009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
5261 H.J. Lu <hongjiu.lu@intel.com>
5262
5263 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
5264 $(LIBDL).
5265 (incremental_dump_LDADD): Likewise.
5266 * Makefile.in: Regenerated.
5267
a6d1ef57 52682009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 5269
a6d1ef57
DK
5270 Revert:
5271
5272 2009-11-25 Doug Kwan <dougkwan@google.com>
5273
5274 * arm.cc (Target_arm::Target_arm): Move method definition
5275 outside of class definition. Add code to handle
5276 --target1-rel, --target1-abs and --target2= options.
5277 (Target_arm::get_reloc_reloc_type): Change method to be
5278 non-static and const.
5279 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
5280 New data member declaration.
5281 (Target_arm::Scan::local, Target_arm::Scan::global,
5282 Target_arm::Relocate::relocate,
5283 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5284 Adjust call to Target_arm::get_real_reloc_type.
5285 (Target_arm::get_real_reloc_type): Use command line options
5286 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5287 * options.h (--target1-rel, --target1-abs, --target2): New
5288 ARM-only options.
5289
50aeb7d4
DK
52902009-11-25 Doug Kwan <dougkwan@google.com>
5291
5292 * arm.cc (Target_arm::Target_arm): Move method definition outside of
5293 class definition. Add code to handle --target1-rel, --target1-abs
5294 and --target2= options.
5295 (Target_arm::get_reloc_reloc_type): Change method to be non-static
5296 and const.
5297 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
5298 member declaration.
5299 (Target_arm::Scan::local, Target_arm::Scan::global,
5300 Target_arm::Relocate::relocate,
5301 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
5302 call to Target_arm::get_real_reloc_type.
5303 (Target_arm::get_real_reloc_type): Use command line options to
5304 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5305 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
5306 options.
5307
51938283
DK
53082009-11-25 Doug Kwan <dougkwan@google.com>
5309
5310 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
5311 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
5312 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
5313 formatting.
5314 (Arm_relocate_functions::thm_call): Replace body with a call to
5315 Arm_relocate_functions::thumb_branch_common.
5316 (Arm_relocate_functions::thm_jump24,
5317 Arm_relocate_functions::thm_xpc22): New method definitions.
5318 (Arm_relocate_functions::thumb_branch_common): New method definition.
5319 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
5320 operator.
5321 (Target_arm::Relocate::relocate): Adjust call to thm_call.
5322 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
5323
e2b8f3c4
RÁE
53242009-11-24 Rafael Avila de Espindola <espindola@google.com>
5325
5326 * Makefile.am: Build incremental-dump
5327 * Makefile.in: Regenerate.
5328 * incremental-dump.cc: New.
5329 * incremental.cc (Incremental_inputs_header_data,
5330 Incremental_inputs_entry_data): Move to incremental.h
5331 * incremental.h: (Incremental_inputs_header_data,
5332 Incremental_inputs_entry_data): Move from incremental.cc
5333
bcba9aec
RÁE
53342009-11-24 Rafael Avila de Espindola <espindola@google.com>
5335
5336 * incremental.cc (Incremental_inputs_header,
5337 Incremental_inputs_header_write, Incremental_inputs_entry,
5338 Incremental_inputs_entry_write): Add a typedef with the data type.
5339
7c3afe08
RÁE
53402009-11-24 Rafael Avila de Espindola <espindola@google.com>
5341
5342 * incremental.cc (Incremental_inputs_header,
5343 Incremental_inputs_header_write, Incremental_inputs_entry,
5344 Incremental_inputs_entry_write): Update comment about which
5345 type has the filed descriptions.
5346
d204b6e9
DK
53472009-11-15 Doug Kwan <dougkwan@google.com>
5348
5349 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
5350 (Arm_relocate_functions::arm_branch_common): Change method defintion
5351 in class definition to a method declaration and update list of formal
5352 parameters.
5353 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
5354 Arm_relocation_functions::jump24): Adjust call to
5355 Arm_relocate_functions::arm_branch_common. Update list of formal
5356 parameters.
5357 (Arm_relocate_functions::xpc25): New method definition.
5358 (Arm_relocate_functions::arm_branch_common): Move method defintion
5359 out from class definition. Use stubs for mode-switching and extending
5360 branch ranges.
5361 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
5362 specially. Change code to enable use of stubs in ARM branches.
5363
43d12afe
DK
53642009-11-10 Doug Kwan <dougkwan@google.com>
5365
5366 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
5367 in method declaration.
5368 (Target_arm::relocate_stub): New method declaration.
5369 (Target_arm::default_target): Change to return a pointer instead of
5370 a const reference.
5371 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
5372 Target_arm::default_target.
5373 (Arm_Relobj::do_relocate_sections): Remove options paramater in
5374 method definition.
5375 (Target_arm::relocate_section): Adjust view.
5376 (Target_arm::relocate_stub): New method definition.
5377
ac33a407
DK
53782009-11-10 Doug Kwan <dougkwan@google.com>
5379
5380 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
5381 a format warning.
5382 * incremental.cc (open_incremental_binary): Initialized local
5383 variables to avoid warnings.
5384 * object.cc (make_elf_object): Ditto.
5385 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
5386 a format warning.
e1df38aa 5387
88ee28e9
L
5388009-11-09 H.J. Lu <hongjiu.lu@intel.com>
5389
5390 PR gold/10930
5391 * testsuite/plugin_test.c: Include "config.h".
5392
2daedcd6
DK
53932009-11-09 Doug Kwan <dougkwan@google.com>
5394
5395 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
5396 (arm_symbol_value): Remove.
5397 (Arm_relocate_functions::arm_branch_common,
5398 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
5399 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
5400 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
5401 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
5402 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
5403 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
5404 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
5405 Arm_relocate_functions::thm_mobw_abs_nc,
5406 Arm_relocate_functions::thm_mov_abs,
5407 Arm_relocate_functions::movw_prel_nc,
5408 Arm_relocate_functions::thm_movt_abs,
5409 Arm_relocate_functions::movt_prel,
5410 Arm_relocate_functions::thm_movw_prel_nc,
5411 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
5412 (Target_arm::Relocate::relocate): Only decompose address into two
5413 parts if relocation type uses the thumb-bit and pass the actual
5414 bit instead of a flag indicating that the thumb-bit is used. Adjust
5415 calls to methods in Arm_relocate_functions for this change.
5416
1276bc89 54172009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
5418
5419 PR 10925
5420 * reloc.cc: Instantiate
5421 Sized_relobj::initialize_input_to_output_maps and
5422 Sized_relobj:free_input_to_output_maps.
5423
e53ad1b5
ILT
54242009-11-06 Ian Lance Taylor <iant@google.com>
5425
5426 PR 10876
5427 * defstd.cc (in_segment): Set only_if_ref true for "end".
5428
eb44217c
DK
54292009-11-06 Doug Kwan <dougkwan@google.com>
5430
5431 * arm.cc (class Reloc_stub): Correct a comment.
5432 (Target_arm::Target_arm): Initialize arm_input_section_map_.
5433 (Target_arm::scan_section_for_stubs): New method declaration.
5434 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
5435 Change methods from private to protected.
5436 (Target_arm::do_may_relax): New method definition.
5437 (Target_arm::do_relax, Target_arm::group_sections,
5438 Target_arm::scan_reloc_for_stub,
5439 Target_arm::scan_reloc_section_for_stubs): New method declarations.
5440 (Target_arm::arm_input_section_map_): New data member declaration.
5441 (Target_arm::scan_reloc_for_stub,
5442 Target_arm::scan_reloc_section_for_stubs,
5443 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
5444 Target_arm::do_relax): New method definitions.
5445
5d329b7d
ILT
54462009-11-06 Mikolaj Zalewski <mikolaj@google.com>
5447
5448 * configure.ac: Check for (struct stat)::st_mtim
5449 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
5450 * config.in: Regenerate.
5451 * configure: Regenerate.
5452
96a0d71b
ILT
54532009-11-05 Ian Lance Taylor <iant@google.com>
5454
5455 PR 10910
5456 * output.cc (Output_segment::add_output_section): Add missing
5457 return statement.
5458
594c8e5e
ILT
54592009-11-04 Ian Lance Taylor <iant@google.com>
5460
5461 PR 10880
5462 * object.h (class Object): Add is_needed and set_is_needed
5463 methods. Add is_needed_ field. Make bool fields into bitfields.
5464 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
5465 defined in a dynamic object and referenced by a regular object,
5466 set is_needed for the dynamic object.
5467 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
5468 if the file is marked with as_needed and it is not needed.
5469
22b127cc
ILT
54702009-11-04 Ian Lance Taylor <iant@google.com>
5471
5472 PR 10887
5473 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
5474 tags if data is discarded by linker script.
5475 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5476 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5477 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5478 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5479
f5c870d2
ILT
54802009-11-04 Ian Lance Taylor <iant@google.com>
5481
5482 * layout.cc (Layout::get_output_section): Add is_interp and
5483 is_dynamic_linker_section parameters. Change all callers.
5484 (Layout::choose_output_section): Likewise.
5485 (Layout::make_output_section): Likewise.
5486 (Layout::add_output_section_data): Add is_dynamic_linker_section
5487 parameter. Change all callers.
5488 * layout.h (class Layout): Update declarations.
5489 * output.h (class Output_section): Add is_interp, set_is_interp,
5490 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
5491 Add is_interp_, is_dynamic_linker_section_ fields. Change
5492 generate_code_fills_at_write_ to a bitfield.
5493 * output.cc (Output_section::Output_sections): Initialize new
5494 fields.
5495 (Output_segment::add_output_section): Add do_sort parameter.
5496 Change all callers.
5497
1ae4d23b
ILT
54982009-11-03 Ian Lance Taylor <iant@google.com>
5499
5500 PR 10860
5501 * options.h (class General_options): Add --warn-common.
5502 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
5503 merging two common symbols.
5504 (Symbol_table::should_override): Handle --warn-common when merging
5505 a common symbol with a defined symbol. Use report_resolve_problem
5506 for multiple definitions.
5507 (Symbol_table::report_resolve_problem): New function.
5508 * symtab.h (class Symbol_table): Declare report_resolve_problem.
5509
55da9579
DK
55102009-11-03 Doug Kwan <dougkwan@google.com>
5511
5512 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
5513 stub_factory_.
5514 (Target_arm::stub_factory): New method definition.
5515 (Target_arm::new_arm_input_section,
5516 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
5517 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 5518 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
5519 New type definitions.
5520 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
5521 member declarations.
5522 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
5523 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
5524 New method definitions.
5525
37a9ac43
ILT
55262009-11-03 Ian Lance Taylor <iant@google.com>
5527
5528 * options.h (class General_options): Add --warn_constructors.
5529
b3d6a3d4
ILT
55302009-11-03 Ian Lance Taylor <iant@google.com>
5531
5532 PR 10893
5533 * defstd.cc (in_section): Add entries for __rel_iplt_start,
5534 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
5535
934b01dd
ILT
55362009-11-03 Ian Lance Taylor <iant@google.com>
5537
5538 PR 10895
5539 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
5540 --msgid-bugs-address.
5541 (install-pdf): New target.
5542 (install-data_yes): Look up one directory to find mkinstalldirs.
5543
03c1939b
L
55442009-11-03 H.J. Lu <hongjiu.lu@intel.com>
5545
5546 * po/Make-in (.po.gmo): Don't generate .gmo files in source
5547 tree.
5548
ebd95253
DK
55492009-10-30 Doug Kwan <dougkwan@google.com>
5550
5551 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
5552
e9bbb538
DK
55532009-10-30 Doug Kwan <dougkwan@google.com>
5554
5555 * arm.cc (Stub_addend_reader): New struct template definition
5556 and partial specializations.
5557 (Stub_addend_reader::operator()): New method definition for a
5558 partially specialized template.
5559
d5b40221
DK
55602009-10-30 Doug Kwan <dougkwan@google.com>
5561
5562 * arm.cc (Arm_relobj::processor_specific_flags): New method
5563 definition.
5564 (Arm_relobj::do_read_symbols): New method declaration.
5565 (Arm_relobj::processor_specific_flags_): New data member declaration.
5566 (Arm_dynobj): New class definition.
5567 (Target_arm::do_finalize_sections): Add input_objects parameter.
5568 (Target_arm::do_adjust_elf_header): New method declaration.
5569 (Target_arm::are_eabi_versions_compatible,
5570 (Target_arm::merge_processor_specific_flags): New method declaration.
5571 (Target_arm::do_make_elf_object): New overloaded method definitions
5572 and declaration.
5573 (Arm_relobj::do_read_symbols): New method definition.
5574 (Arm_dynobj::do_read_symbols): Ditto.
5575 (Target_arm::do_finalize_sections): Add input_objects parameters.
5576 Merge processor-specific flags from all input objects.
5577 (Target_arm::are_eabi_versions_compatible,
5578 Target_arm::merge_processor_specific_flags,
5579 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
5580 New method definitions.
5581 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
5582 Input_objects pointer type parameter.
5583 * layout.cc (Layout::finalize): Pass input objects to target's.
5584 finalize_sections function.
5585 * output.cc (Output_file_header::do_sized_write): Set ELF file
5586 header's processor-specific flags.
5587 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
5588 Input_objects pointer type parameter.
5589 * sparc.cc (Target_sparc::do_finalize_sections): Same.
5590 * target.h (Input_objects): New forward class declaration.
5591 (Target::processor_specific_flags,
5592 Target::are_processor_specific_flags_sect): New method definitions.
5593 (Target::finalize_sections): Add input_objects parameter.
5594 (Target::Target): Initialize processor_specific_flags_ and
5595 are_processor_specific_flags_set_.
5596 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
5597 parameter.
5598 (Target::set_processor_specific_flags): New method definition.
5599 (Target::processor_specific_flags_,
5600 Target::are_processor_specific_flags_set_): New data member
5601 declarations.
5602 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
5603 Input_objects pointer type parameter.
5604
ebabffbd
DK
56052009-10-30 Doug Kwan <dougkwan@google.com>
5606
5607 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
5608
ad0f2072
ILT
56092009-10-28 Ian Lance Taylor <iant@google.com>
5610
5611 * object.h (class Relobj): Drop options parameter from
5612 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
5613 do_scan_relocs, do_relocate. Change all callers.
5614 (class Sized_relobj): Drop options parameters from
5615 do_gc_process_relocs, do_scan_relocs, do_relocate,
5616 do_relocate_sections, relocate_sections, emit_relocs_scan,
5617 emit_relocs_scan_reltype. Change all callers.
5618 (struct Relocate_info): Remove options field and all references to
5619 it.
5620 * reloc.h (class Read_relocs): Remove options constructor
5621 parameter and options_ field. Change all callers.
5622 (class Gc_process_relocs, class Scan_relocs): Likewise.
5623 (class Relocate_task): Likewise.
5624 * target-reloc.h (scan_relocs): Remove options parameter. Change
5625 all callers.
5626 (scan_relocatable_relocs): Likewise.
5627 * target.h (class Sized_target): Remove options parameter from
5628 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
5629 all callers.
5630 * gc.h (gc_process_relocs): Remove options parameter. Change all
5631 callers.
5632 * arm.cc: Update functions to remove options parameters.
5633 * i386.cc: Likewise.
5634 * powerpc.cc: Likewise.
5635 * sparc.cc: Likewise.
5636 * x86_64.cc: Likewise.
5637 * testsuite/testfile.cc: Likewise.
5638
8ffa3667
DK
56392009-10-28 Doug Kwan <dougkwan@google.com>
5640
5641 * arm.cc (Arm_relobj): New class definition.
e1df38aa 5642 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
5643 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
5644 New method definitions.
5645
40f36857
CC
56462009-10-28 Cary Coutant <ccoutant@google.com>
5647
5648 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
5649 (Plugin::cleanup_done_): New member.
5650 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
5651 (Plugin_manager::cleanup_done_): Remove.
5652 (Plugin_manager::add_input_file): Edit error message.
5653 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
5654 (Plugin_manager::cleanup): Remove use of cleanup_done_.
5655
2c849493
ILT
56562009-10-27 Mikolaj Zalewski <mikolajz@google.com>
5657
5658 * fileread.cc: (File_read::View::~View): Use the new
5659 data_ownership_ filed.
5660 (File_read::~File_read): Dispose the new whole_file_view_.
5661 (File_read::open): Mmap the whole file if needed.
5662 (File_read::open): Use whole_file_view_ instead of contents_.
5663 (File_read::find_view): Use whole_file_view_ if applicable.
5664 (File_read::do_read): Use whole_file_view_ instead of contents_.
5665 (File_read::make_view): Use whole_file_view_ instead of contents_,
5666 update File_read::View::View call.
5667 (File_read::find_or_make_view): Update File_read::View::View
5668 call.
5669 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
5670 remove contents_
5671 (File_read::View::Data_ownership): New enum.
5672 (File_read::View::View): Replace bool mapped_ with Data_ownership
5673 argument.
5674 (File_read::View::mapped_): Remove (replaced by data_ownership_).
5675 (File_read::View::data_ownership_): New field.
5676 (File_read::contents_): Remove (replaced by whole_file_view_).
5677 (File_read::whole_file_view_): New field.
5678 * options.h (class General_options): Add --keep-files-mapped.
5679
24998053
CC
56802009-10-27 Cary Coutant <ccoutant@google.com>
5681
5682 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
5683 * testsuite/Makefile.am (plugin_test_5): New test case.
5684 * testsuite/Makefile.in: Regenerate.
5685
72adc4fa
DK
56862009-10-25 Doug Kwan <dougkwan@google.com>
5687
5688 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
5689 from private to protected to allow access by child class.
5690 (Sized_relobj::do_relocate_sections): New method declaration.
5691 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 5692 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
5693 Sized_relobj::relocate_sections. Instantiate template explicitly
5694 for different target sizes and endianity.
5695
07f508a2
DK
56962009-10-24 Doug Kwan <dougkwan@google.com>
5697
5698 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
5699 (Arm_input_section::as_arm_input_section): New method.
5700 (Arm_output_section): New class definition.
5701 (Arm_output_section::create_stub_group,
5702 Arm_output_section::group_sections): New method definitions.
5703
10ad9fe5
DK
57042009-10-22 Doug Kwan <dougkwan@google.com>
5705
5706 * arm.cc (Arm_input_section): New class definition.
5707 (Arm_input_section::init, Arm_input_section:do_write,
5708 Arm_input_section::set_final_data_size,
5709 Arm_input_section::do_reset_address_and_file_offset): New method
5710 definitions.
5711
56ee5e00
DK
57122009-10-21 Doug Kwan <dougkwan@google.com>
5713
5714 * arm.cc (Stub_table, Arm_input_section): New forward class
5715 declarations.
5716 (Stub_table): New class defintion.
5717 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
5718 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
5719 New method definition.
5720
b569affa
DK
57212009-10-21 Doug Kwan <dougkwan@google.com>
5722
5723 * arm.cc: Update copyright comments.
5724 (Target_arm): New forward class template declaration.
5725 (Arm_address): New type.
5726 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
5727 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
5728 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
5729 constants.
5730 (Insn_template): Same.
5731 (DEF_STUBS): New macro.
5732 (Stub_type): New enum type.
5733 (Stub_template): New class definition.
5734 (Stub): Same.
5735 (Reloc_stub): Same.
5736 (Stub_factory): Same.
5737 (Target_arm::Target_arm): Initialize may_use_blx_ and
5738 should_force_pic_veneer_.
5739 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
5740 Target_arm::should_force_pic_veneer,
5741 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
5742 Target_arm::using_thumb_only, Target_arm:;default_target): New
5743 method defintions.
5744 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
5745 New data member declarations.
5746 (Insn_template::size, Insn_template::alignment): New method defintions.
5747 (Stub_template::Stub_template): New method definition.
5748 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
5749 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
5750 (Stub_factory::Stub_factory): New method definition.
5751 * gold.h (string_hash): New template.
5752 * output.h (Input_section_specifier::hash_value): Use
5753 gold::string_hash.
5754 (Input_section_specifier::string_hash): Remove.
5755 * stringpool.cc (Stringpool_template::string_hash): Use
5756 gold::string_hash.
5757
6c172549
DK
57582009-10-20 Doug Kwan <dougkwan@google.com>
5759
5760 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
5761 symbols of relaxed input sections.
5762 * output.h (Output_section::find_relaxed_input_section): Make
5763 method public.
5764
c5617f2f
DK
57652009-10-16 Doug Kwan <dougkwan@google.com>
5766
5767 * dynobj.cc (Versions::Versions): Initialize version_script_.
5768 Only insert base version symbol definition for a shared object
5769 if version script defines any version versions.
5770 (Versions::define_base_version): New method definition.
5771 (Versions::add_def): Check that base version is not needed.
5772 (Versions::add_need): Define base version lazily.
5773 * dynobj.h (Versions::define_base_version): New method declaration.
5774 (Versions::needs_base_version_): New data member declaration.
5775 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
5776 (check_DATA): Add no_version_test.stdout.
5777 (libno_version_test.so, no_version_test.o no_version_test.stdout):
5778 New make rules.
5779 * testsuite/Makefile.in: Regenerate.
5780 * testsuite/no_version_test.c: New file.
5781 * testsuite/no_version_test.sh: Ditto.
5782
3c12dcdb
DK
57832009-10-16 Doug Kwan <dougkwan@google.com>
5784
5785 * expression.cc (class Segment_start_expression): New class definition.
5786 (Segment_start_expression::value): New method definition.
5787 (script_exp_function_segment_start): Return a new
5788 Segment_start_expression.
5789 * gold/script-c.h (script_saw_segment_start_expression): New function
5790 prototype.
5791 * script-sections.cc (Script_sections::Script_sections): Initialize
5792 SAW_SEGMENT_START_EXPRESSION_ to false.
5793 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
5794 and -Tbbs options to specify section addresses if given in
5795 command line and no SEGMENT_START expression is seen in a script.
5796 * script-sections.h (Script_sections::saw_segment_start_expression,
5797 Script_sections::set_saw_segment_start_expression): New method
5798 definition.
5799 (Script_sections::saw_segment_start_expression_): New data member
5800 declaration.
5801 * script.cc (script_saw_segment_start_expression): New function.
5802 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
5803 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
5804 script_test_7.sh and script_test_8.sh.
5805 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
5806 script_test_8.stdout.
5807 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
5808 (script_test_6, script_test_6.stdout, script_test_7,
5809 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
5810 * Makefile.in: Regenerate.
5811 * testsuite/script_test_6.sh: New file.
5812 * testsuite/script_test_6.t: Same.
5813 * testsuite/script_test_7.sh: Same.
5814 * testsuite/script_test_7.t: Same.
5815 * testsuite/script_test_8.sh: Same.
5816
64b1ae37
DK
58172009-10-16 Doug Kwan <dougkwan@google.com>
5818
5819 * output.cc (Output_segment::set_section_list_address): Cast
5820 expressions to unsigned long long type to avoid format warnings.
5821
661be1e2
ILT
58222009-10-15 Ian Lance Taylor <iant@google.com>
5823
12edd763 5824 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 5825 dot assignment to script_sections_.
12edd763
ILT
5826 * script-sections.cc (Script_sections::add_dot_assignment):
5827 Initialize if necessary.
5828
68b6574b
ILT
5829 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
5830 program headers with no load segment if there is a linker script.
5831
661be1e2
ILT
5832 * layout.cc (Layout::set_segment_offsets): Align the file offset
5833 to the segment aligment for -N or -n with no load segment.
5834 * output.cc (Output_segment::add_output_section): Don't crash if
5835 the first section is a TLS section.
5836 (Output_segment::set_section_list_addresses): Print an error
5837 message if the address moves backward in a linker script.
5838 * script-sections.cc
5839 (Output_section_element_input::set_section_addresses): Don't
5840 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
5841 (Orphan_output_section::set_section_addresses): Likewise.
5842
f15f61a7
DK
58432009-10-15 Doug Kwan <dougkwan@google.com>
5844
5845 * layout.cc (Layout::finish_dynamic_section): Generate tags
5846 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
5847 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
5848 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
5849
82bb573a
ILT
58502009-10-14 Ian Lance Taylor <iant@google.com>
5851
5852 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
5853 fields.
5854 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
5855 data_shdr fields of relinfo.
5856 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
5857 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
5858 R_386_TLS_LDO_32, adjust based on section flags.
5859 (Target_i386::Relocate::fix_up_ldo): Remove.
5860
374ad285
ILT
58612009-10-13 Ian Lance Taylor <iant@google.com>
5862
5863 Add support for -pie.
5864 * options.h (class General_options): Add -pie and
5865 --pic-executable.
5866 (General_options::output_is_position_independent): Test -pie.
5867 (General_options::output_is_executable): Return true if not shared
5868 and not relocatable.
5869 (General_options::output_is_pie): Remove.
5870 * options.cc (General_options::finalize): Reject incompatible uses
5871 of -pie.
5872 * gold.cc (queue_middle_tasks): A -pie link is not static.
5873 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
5874 * symtab.cc (Symbol::final_value_is_known): Return false if
5875 output_is_position_independent.
5876 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
5877 output_is_position_independent.
5878 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
5879 output_is_position_independent.
5880 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
5881 output_is_position_independent.
5882 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
5883 two_file_pie_test.
5884 (basic_pie_test.o, basic_pie_test): New targets.
5885 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
5886 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
5887 (two_file_pie_test): New target.
5888 * testsuite/Makefile.in: Rebuild.
5889 * README: Remove note saying that -pie is not supported.
5890
c6585162
ILT
58912009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
5892
5893 * options.h (class General_options): Add -init and -fini.
5894 * layout.cc (Layout::finish_dynamic_section): Emit
5895 given init and fini functions.
5896
032ce4e9
ST
58972009-10-13 Sriraman Tallam <tmsriram@google.com>
5898
5899 * gc.h (gc_process_relocs): Check if icf is enabled using new
5900 function.
5901 * gold.cc (queue_initial_tasks): Likewise.
5902 (queue_middle_tasks): Likewise.
5903 * object.cc (do_layout): Likewise.
5904 * symtab.cc (is_section_folded): Likewise.
5905 * main.cc (main): Likewise.
5906 * reloc.cc (Read_relocs::run): Likewise.
5907 (Sized_relobj::do_scan_relocs): Likewise.
5908 * icf.cc (is_function_ctor_or_dtor): New function.
5909 (Icf::find_identical_sections): Check if function is ctor or dtor when
5910 safe icf is chosen.
5911 * options.h (General_options::icf): Change option to be an enum.
5912 (Icf_status): New enum.
5913 (icf_enabled): New method.
5914 (icf_safe_folding): New method.
5915 (set_icf_status): New method.
5916 (icf_status_): New variable.
5917 * (options.cc) (General_options::finalize): Set icf_status_.
5918 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
5919 icf_test and icf_keep_unique_test to use the --icf enum flag.
5920 * testsuite/icf_safe_test.sh: New file.
e1df38aa 5921 * testsuite/icf_safe_test.cc: New file.
032ce4e9 5922
f345227a
ST
59232009-10-12 Sriraman Tallam <tmsriram@google.com>
5924
5925 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
5926 includes to gc.h and icf.h.
5927 * arm.cc: Include gc.h.
5928 * gold.cc: Likewise.
5929 * i386.cc: Likewise.
5930 * powerpc.cc: Likewise.
5931 * sparc.cc: Likewise.
5932 * x86_64.cc: Likewise.
5933 * gc.h: Include icf.h.
5934
1c7814ed
ILT
59352009-10-11 Ian Lance Taylor <iant@google.com>
5936
5937 * plugin.cc: Include "gold.h" before other header files.
5938
ae3b5189
CD
59392009-10-10 Chris Demetriou <cgd@google.com>
5940
5941 * options.h (Input_file_argument::Input_file_type): New enum.
5942 (Input_file_argument::is_lib_): Replace with...
5943 (Input_file_argument::type_): New member.
5944 (Input_file_argument::Input_file_argument): Take Input_file_type
5945 'type' rather than boolean 'is_lib' as second argument.
5946 (Input_file_argument::is_lib): Use type_.
5947 (Input_file_argument::is_searched_file): New function.
5948 (Input_file_argument::may_need_search): Handle is_searched_file.
5949 * options.cc (General_options::parse_library): Support -l:filename.
5950 (General_options::parse_just_symbols): Update for Input_file_argument
5951 changes.
5952 (Command_line::process): Likewise.
5953 * archive.cc (Archive::get_file_and_offset): Likewise.
5954 * plugin.cc (Plugin_manager::release_input_file): Likewise.
5955 * script.cc (read_script_file, script_add_file): Likewise.
5956 * fileread.cc (Input_file::Input_file): Likewise.
5957 (Input_file::will_search_for): Handle is_searched_file.
5958 (Input_file::open): Likewise.
5959 * readsyms.cc (Read_symbols::get_name): Likewise.
5960 * testsuite/Makefile.am (searched_file_test): New test.
5961 * testsuite/Makefile.in: Regenerate.
5962 * testsuite/searched_file_test.cc: New file.
5963 * testsuite/searched_file_test_lib.cc: New file.
5964
f3048a1d
ILT
59652009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5966 Ian Lance Taylor <iant@google.com>
5967
5968 * descriptor.cc: Include <cstdio> and "binary-io.h".
5969 (Descriptors::open): Open the files in binary mode always.
5970 * script.cc (Lex::get_token): Treat \r as whitespace.
5971
d4780e57
ILT
59722009-10-09 Ian Lance Taylor <iant@google.com>
5973
5974 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
5975
d9a893b8
ILT
59762009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5977 Ian Lance Taylor <iant@google.com>
5978
5979 * configure.ac: Check for readv function also.
5980 * fileread.cc (readv): Define if not HAVE_READV.
5981 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
5982 does not exist.
5983 * config.in: Regenerate.
5984 * configure: Regenerate.
5985
c0a62865
DK
59862009-10-09 Doug Kwan <dougkwan@google.com>
5987
5988 * layout.cc (Layout::make_output_section): Call target hook to make
5989 ordinary output section.
5990 (Layout::finalize): Adjust parameter list of call the
5991 Target::may_relax().
5992 * layout.h (class Layout::section_list): New method.
5993 * merge.h (Output_merge_base::entsize): Change visibility to public.
5994 (Output_merge_base::is_string, Output_merge_base::do_is_string):
5995 New methods.
5996 (Output_merge_string::do_is_string): New method.
5997 * object.cc (Sized_relobj::do_setup): renamed from
5998 Sized_relobj::set_up.
5999 * object.h (Sized_relobj::adjust_shndx,
6000 Sized_relobj::initializ_input_to_output_maps,
6001 Sized_relobj::free_input_to_output_maps): Change visibilities to
6002 protected.
6003 (Sized_relobj::setup): Virtualize.
6004 (Sized_relobj::do_setup): New method declaration.
6005 (Sized_relobj::invalidate_section_offset,
6006 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6007 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6008 * options.cc (parse_int): New function.
6009 * options.h (parse_int): New declaration.
6010 (DEFINE_int): New macro.
6011 (stub_group_size): New option.
6012 * output.cc (Output_section::Output_section): Initialize memebers
6013 merge_section_map_, merge_section_by_properties_map_,
6014 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6015 (Output_section::add_input_section): Handled deferred code-fill
6016 generation and remove an old comment.
6017 (Output_section::add_relaxed_input_section): New method definition.
6018 (Output_section::add_merge_input_section): Use merge section by
6019 properties map to speed to search. Update merge section maps
6020 as appropriate.
6021 (Output_section::build_relaxation_map): New method definition.
6022 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6023 Same.
6024 (Output_section::relax_input_section): Renamed to
6025 Output_section::convert_input_sections_to_relaxed_sections and change
6026 interface to take a vector of pointers to relaxed sections.
6027 (Output_section::find_merge_section,
6028 Output_section::find_relaxed_input_section): New method definitions.
6029 (Output_section::is_input_address_mapped,
6030 Output_section::output_offset, Output_section::output_address):
6031 Use output section data maps to speed up searching.
6032 (Output_section::find_starting_output_address): Add comments.
6033 (Output_section::do_write,
6034 Output_section::write_to_postprocessing_buffer): Do code-fill
6035 generation as appropriate.
6036 (Output_section::get_input_sections): Invalidate relaxed input section
6037 map.
6038 (Output_section::restore_states): Adjust type of checkpoint .
6039 Invalidate relaxed input section map.
6040 * output.h (Output_merge_base): New class declaration.
6041 (Input_section_specifier): New class defintion.
6042 (class Output_relaxed_input_section) Change base class to
6043 Output_section_data_build.
6044 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6045 base class initializer.
6046 (Output_section::add_relaxed_input_section): New method declaration.
6047 (Output_section::Input_section): Change visibility to protected.
6048 (Output_section::Input_section::relobj,
6049 Output_section::Input_section::shndx): Handle relaxed input sections.
6050 Output_section::input_sections) Change visibility to protected. Also
6051 define overload to return a non-const pointer.
6052 (Output_section::Merge_section_properties): New class defintion.
6053 (Output_section::Merge_section_by_properties_map,
6054 Output_section::Output_section_data_by_input_section_map,
6055 Output_section::Relaxation_map): New types.
6056 (Output_section::relax_input_section): Rename method to
6057 Output_section::convert_input_sections_to_relaxed_sections and change
6058 interface to take a vector of relaxed section pointers.
6059 (Output_section::find_merge_section,
6060 Output_section::find_relaxed_input_section,
6061 Output_section::build_relaxation_map,
6062 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6063 New method declarations.
6064 (Output_section::merge_section_map_
6065 Output_section::merge_section_by_properties_map_,
6066 Output_section::relaxed_input_section_map_,
6067 Output_section::is_relaxed_input_section_map_valid_,
6068 Output_section::generate_code_fills_at_write_): New data members.
6069 * script-sections.cc
6070 (Output_section_element_input::set_section_addresses): Call
6071 current_data_size and addralign methods of relaxed input sections.
6072 (Orphan_output_section::set_section_addresses): Call current_data_size
6073 and addralign methods of relaxed input sections.
6074 * symtab.cc (Symbol_table::compute_final_value): Extract template
6075 from the body of Symbol_table::sized_finalize_symbol.
6076 (Symbol_table::sized_finalized_symbol): Call
6077 Symbol_table::compute_final_value.
6078 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6079 (Symbol_table::compute_final_value): New templated method declaration.
6080 * target.cc (Target::do_make_output_section): New method defintion.
6081 * target.h (Target::make_output_section): New method declaration.
6082 (Target::relax): Add more parameters for input objects, symbol table
6083 and layout. Adjust call to do_relax.
6084 (Target::do_make_output_section): New method declaration.
6085 (Target::do_relax): Add parameters for input objects, symbol table
6086 and layout.
6087
d446d6c4
ILT
60882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6089
6090 * pread.c: Include stdio.h.
6091
bc06c745
ILT
60922009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6093
6094 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6095 defined.
6096
75aea3d0
ILT
60972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6098
6099 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6100 Change read_shndx type to unsigned int.
6101 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6102 int.
6103 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6104 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6105 Change read_shndx type to unsigned int.
6106 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6107 int.
6108 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6109 * layout.cc (Layout::create_symtab_sections): Cast the result of
6110 local_symcount * symsize to off_t in the gold_assert.
6111
be8fcb75
ILT
61122009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6113
6114 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6115 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6116 R_ARM_BASE_ABS.
6117 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6118 (Arm_relocate_functions::thm_abs5): New function.
6119 (Arm_relocate_functions::abs12): New function.
6120 (Arm_relocate_functions::abs16): New function.
6121 (Arm_relocate_functions::base_abs): New function.
6122 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6123 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6124 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6125 R_ARM_BASE_ABS.
6126 (Scan::global): Likewise.
6127 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6128 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6129 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6130 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6131 R_ARM_BASE_ABS.
6132
c2a122b6
ILT
61332009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6134
6135 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6136 (Arm_relocate_functions::movt_prel): New function.
6137 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6138 (Arm_relocate_functions::thm_movt_prel): New function.
6139 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6140 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6141 (Scan::global, Relocate::relocate): Likewise.
6142 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6143
c4aa1e2d
ILT
61442009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6145
6146 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6147 Incremental_checker.
6148 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6149 unsigned int.
6150 (class Incremental_inputs_header): New class.
6151 (Incremental_inputs_header_writer): Edit comment.
6152 (Incremental_inputs_entry): New class.
6153 (Incremental_inputs_entry_writer): Edit comment.
6154 (Sized_incremental_binary::do_find_incremental_inputs_section):
6155 Add *strtab_shndx parameter, fill it.
6156 (Sized_incremental_binary::do_check_inputs): New method.
6157 (Incremental_checker::can_incrementally_link_output_file): Use
6158 Sized_incremental_binary::check_inputs.
6159 (Incremental_inputs::report_command_line): Save command line in
6160 command_line_.
6161 * incremental.h:
6162 (Incremental_binary::find_incremental_inputs_section): New
6163 method.
6164 (Incremental_binary::do_find_incremental_inputs_section): Add
6165 strtab_shndx parameter.
6166 (Incremental_binary::do_check_inputs): New pure virtual method.
6167 (Sized_incremental_binary::do_check_inputs): Declare.
6168 (Incremental_checker::Incremental_checker): Add incremental_inputs
6169 parameter, use it to initialize incremental_inputs_.
6170 (Incremental_checker::incremental_inputs_): New field.
6171 (Incremental_checker::command_line): New method.
6172 (Incremental_checker::inputs): New method.
6173 (Incremental_checker::command_line_): New field.
6174
c549a694
ILT
61752009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6176
6177 * incremental.cc: Include <cstdarg> and "target-select.h".
6178 (vexplain_no_incremental): New function.
6179 (explain_no_incremental): New function.
6180 (Incremental_binary::error): New method.
6181 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6182 method.
6183 (make_sized_incremental_binary): New function.
6184 (open_incremental_binary): New function.
6185 (can_incrementally_link_file): Add checks if output is ELF and has
6186 inputs section.
6187 * incremental.h: Include "elfcpp_file.h" and "output.h".
6188 (Incremental_binary): New class.
6189 (Sized_incremental_binary): New class.
6190 (open_incremental_binary): Declare.
6191 * object.cc (is_elf_object): Use
6192 elfcpp::Elf_recognizer::is_elf_file.
6193 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6194 * output.h (Output_file::filesize): New method.
6195
fd3c5f0b
ILT
61962009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6197
6198 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6199 New function.
6200 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6201 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6202 function.
6203 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6204 function.
6205 (Arm_relocate_functions::movw_abs_nc): New function.
6206 (Arm_relocate_functions::movt_abs): New function.
6207 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6208 (Arm_relocate_functions::thm_movt_abs): New function.
6209 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6210 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6211 (Scan::global): Likewise.
6212 (Relocate::relocate): Likewise.
6213 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6214
7f5309a5
ILT
62152009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6216
6217 * arm.cc (Arm_relocate_functions::got_prel) New function.
6218 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6219 (Relocate::relocate): Likewise.
6220 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6221
364c7fa5
ILT
62222009-10-06 Ian Lance Taylor <iant@google.com>
6223
6224 * options.h (class General_options): Define
6225 split_stack_adjust_size parameter.
6226 * object.h (class Object): Add uses_split_stack_ and
6227 has_no_split_stack_ fields. Add uses_split_stack and
6228 has_no_split_stack accessor functions. Declare
6229 handle_split_stack_section.
6230 (class Reloc_symbol_changes): Define.
6231 (class Sized_relobj): Define Function_offsets. Declare
6232 split_stack_adjust, split_stack_adjust_reltype, and
6233 find_functions.
6234 * object.cc (Object::handle_split_stack_section): New function.
6235 (Sized_relobj::do_layout): Call handle_split_stack_section.
6236 * dynobj.cc (Sized_dynobj::do_layout): Call
6237 handle_split_stack_section.
6238 * reloc.cc (Sized_relobj::relocate_sections): Call
6239 split_stack_adjust for executable sections in split_stack
6240 objects. Pass reloc_map to relocate_section.
6241 (Sized_relobj::split_stack_adjust): New function.
6242 (Sized_relobj::split_stack_adjust_reltype): New function.
6243 (Sized_relobj::find_functions): New function.
6244 * target-reloc.h: Include "object.h".
6245 (relocate_section): Add reloc_symbol_changes parameter. Change
6246 all callers.
6247 * target.h (class Target): Add calls_non_split method. Declare
6248 do_calls_non_split virtual method. Declare match_view and
6249 set_view_to_nop.
6250 * target.cc: Include "elfcpp.h".
6251 (Target::do_calls_non_split): New function.
6252 (Target::match_view): New function.
6253 (Target::set_view_to_nop): New function.
6254 * gold.cc (queue_middle_tasks): Give an error if mixing
6255 split-stack and non-split-stack objects with -r.
6256 * i386.cc (Target_i386::relocate_section): Add
6257 reloc_symbol_changes parameter.
6258 (Target_i386::do_calls_non_split): New function.
6259 * x86_64.cc (Target_x86_64::relocate_section): Add
6260 reloc_symbol_changes parameter.
6261 (Target_x86_64::do_calls_non_split): New function.
6262 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
6263 parameter.
6264 * powerpc.cc (Target_powerpc::relocate_section): Add
6265 reloc_symbol_changes parameter.
6266 * sparc.cc (Target_sparc::relocate_section): Add
6267 reloc_symbol_changes parameter.
6268 * configure.ac: Call AM_CONDITIONAL for the default target.
6269 * configure: Rebuild.
6270 * testsuite/Makefile.am (TEST_AS): New variable.
6271 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
6272 (check_DATA): Add split_i386 and split_x86_64 files.
6273 (SPLIT_DEFSYMS): Define.
6274 (split_i386_[1234n].o): New targets.
6275 (split_i386_[124]): New targets.
6276 (split_i386_[1234r].stdout): New targets.
6277 (split_x86_64_[1234n].o): New targets.
6278 (split_x86_64_[124]): New targets.
6279 (split_x86_64_[1234r].stdout): New targets.
6280 (MOSTLYCLEANFILES): Add new executables.
6281 * testsuite/split_i386.sh: New file.
6282 * testsuite/split_x86_64.sh: New file.
6283 * testsuite/split_i386_1.s: New file.
6284 * testsuite/split_i386_2.s: New file.
6285 * testsuite/split_i386_3.s: New file.
6286 * testsuite/split_i386_4.s: New file.
6287 * testsuite/split_i386_n.s: New file.
6288 * testsuite/split_x86_64_1.s: New file.
6289 * testsuite/split_x86_64_2.s: New file.
6290 * testsuite/split_x86_64_3.s: New file.
6291 * testsuite/split_x86_64_4.s: New file.
6292 * testsuite/split_x86_64_n.s: New file.
6293 * testsuite/testfile.cc (Target_test): Update relocation_section
6294 function.
6295 * testsuite/Makefile.in: Rebuild.
6296
e8a9fcda
ILT
62972009-10-06 Ian Lance Taylor <iant@google.com>
6298
6299 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
6300 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
6301 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
6302 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
6303 the address on ldo_addrs_.
6304 (Target_i386::Relocate::fix_up_ldo): New function.
6305
e99daf92
ILT
63062009-10-06 Rafael Espindola <espindola@google.com>
6307
6308 * plugin.cc (add_input_library): New.
6309 (Plugin::load): Add add_input_library to tv.
6310 (Plugin_manager::add_input_file): Add the is_lib argument.
6311 (add_input_file): Update call to Plugin_manager::add_input_file.
6312 (add_input_library): New.
6313 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
6314
966d4097
DK
63152009-09-30 Doug Kwan <dougkwan@google.com>
6316
6317 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
6318 symbol and call Symbol::may_need_copy_reloc to determine if
6319 a copy reloc is needed.
6320 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
6321 nocopyreloc is given in command line.
6322 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
6323 given in command line.
6324 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
6325 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
6326 of the removed Target_i386::may_need_copy_reloc.
6327 * options.h (copyreloc): New option with default value false.
6328 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6329 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
6330 instead of the removed Target_powerpc::may_need_copy_reloc.
6331 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6332 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
6333 instead of the removed Target_sparc::may_need_copy_reloc.
6334 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
6335 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
6336 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
6337 instead of the removed Target_x86_64::may_need_copy_reloc.
6338
029ba973
ILT
63392009-09-30 Ian Lance Taylor <iant@google.com>
6340
6341 * object.h (class Object): Remove target_ field, and target,
6342 sized_target, and set_target methods.
6343 (Object::sized_target): Remove.
6344 (class Sized_relobj): Update declarations. Remove sized_target.
6345 * object.cc (Sized_relobj::setup): Remove target parameter.
6346 Change all callers.
6347 (Input_objects::add_object): Don't do anything with the target.
6348 (make_elf_sized_object): Add punconfigured parameter. Change all
6349 callers. Set or test parameter target.
6350 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
6351 Change all callers.
6352 * parameters.cc (Parameters::set_target): Change parameter type to
6353 be non-const.
6354 (Parameters::default_target): Remove.
6355 (set_parameters_target): Change parameter type to be non-const.
6356 (parameters_force_valid_target): New function.
6357 (parameters_clear_target): New function.
6358 * parameters.h (class Parameters): Update declarations. Remove
6359 default_target method. Add sized_target and clear_target
6360 methods. Change target_ to be non-const.
6361 (set_parameters_target): Update declaration.
6362 (parameters_force_valid_target): Declare.
6363 (parameters_clear_target): Declare.
6364 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
6365 as NULL if we aren't searching.
6366 (Add_symbols::run): Don't check for compatible target.
6367 * fileread.cc (Input_file::open_binary): Call
6368 parameters_force_valid_target.
6369 * gold.cc (queue_middle_tasks): Likewise.
6370 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
6371 set_target on object.
6372 * dynobj.h (class Sized_dynobj): Update declarations.
6373 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
6374 make_elf_object returns NULL.
6375 (Archive::include_member): Don't check whether object target is
6376 compatible.
6377 * output.cc (Output_section::add_input_section): Get target from
6378 parameters.
6379 (Output_section::relax_input_section): Likewise.
6380 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
6381 parameters.
6382 (Sized_relobj::do_scan_relocs): Likewise.
6383 (Sized_relobj::relocate_sections): Likewise.
6384 * resolve.cc (Symbol_table::resolve): Likewise.
6385 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
6386 parameter. Change all callers.
6387 (Symbol_table::add_from_object): Get target from parameters.
6388 (Symbol_table::add_from_relobj): Don't check object target.
6389 (Symbol_table::add_from_dynobj): Likewise.
6390 (Symbol_table::define_special_symbol): Get target from
6391 parameters.
6392 * symtab.h (class Symbol_table): Update declaration.
6393 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
6394 parameter. Change all callers. Clear parameter target.
6395 (Binary_test): Test target here.
6396 * testsuite/object_unittest.cc (gold_testsuite): Remove
6397 target_test_pointer parameter. Change all callers.
6398 (Object_test): Test target here.
6399
a6a22b83
ILT
64002009-09-26 Ian Lance Taylor <iant@google.com>
6401
6402 * testsuite/initpri1.c: Don't try to use constructor priorities if
6403 compiling with gcc before 4.3.
6404
6a8f49fe
ILT
64052009-09-22 Mikolaj Zalewski <mikolajz@google.com>
6406
6407 * testsuite/retain_symbols_file_test.sh (check_present): Change
6408 output file name to retain_symbols_file_test.stdout.
6409 (check_absent): Likewise.
6410
8c604651
CS
64112009-09-18 Craig Silverstein <csilvers@google.com>
6412
6413 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
6414 * options.cc: Include <cerrno> and <fstream>.
6415 (General_options::finalize): Parse -retain-symbols-file tag.
6416 * options.h: New flag.
6417 (General_options): New method should_retain_symbol, new
6418 variable symbols_to_retain.
6419 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
6420 should_retain_symbol map.
6421 * testsuite/Makefile.am (retain_symbols_file_test): New test.
6422 * testsuite/Makefile.in: Regenerate.
6423 * testsuite/retain_symbols_file_test.sh: New file.
6424
ca58b19f
NC
64252009-09-18 Nick Clifton <nickc@redhat.com>
6426
6427 * po/es.po: Updated Spanish translation.
6428
20e6d0d6
DK
64292009-09-17 Doug Kwan <dougkwan@google.com>
6430
6431 * debug.h (DEBUG_RELAXATION): New constant.
6432 (DEBUG_ALL): Add DEBUG_RELAXATION.
6433 (debug_string_to_enum): Add relaxation debug option.
6434 * layout.cc
6435 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
6436 Layout::Relaxation_debug_check::read_sections,
6437 Layout::Relaxation_debug_check::read_sections): New method definitions.
6438 (Layout::Layout): Initialize data members
6439 record_output_section_data_from_scrips_,
6440 script_output_section_data_list_ and relaxation_debug_check_.
6441 (Layout::save_segments, Layout::restore_segments,
6442 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6443 Layout::relaxation_loop_body): New method definitions.
6444 (Layout::finalize): Support relaxation. Move section layout code to
6445 Layout::relaxation_loop_body.
6446 (Layout::set_asection_address_from_script): Move code for orphan
6447 section placement out.
6448 (Layout::place_orphan_sections_in_script): New method definition.
6449 * layout.h (Output_segment_headers, Output_file_header):
6450 New forward class declarations.
6451 (Layout::~Layout): Define.
6452 (Layout::new_output_section_data_from_script): New method definition.
6453 (Layout::place_orphan_sections_in_script): New method declaration.
6454 (Layout::Segment_states): New type declaration.
6455 (Layout::save_segments, Layout::restore_segments,
6456 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6457 Layout::relaxation_loop_body): New method declarations.
6458 (Layout::Output_section_data_list): New type declaration.
6459 (Layout::Relaxation_debug_check): New class definition.
6460 (Layout::record_output_section_data_from_script_,
6461 Layout::script_output_section_data_list_, Layout::segment_states_,
6462 Layout::relaxation_debug_check_): New data members.
6463 * output.cc: (Output_section_headers::do_size): New method definition.
6464 (Output_section_headers::Output_section_headers): Move size
6465 computation to Output_section_headers::do_size.
6466 (Output_segment_headers::do_size): New method definition.
e1df38aa 6467 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
6468 Output_file_header::do_size and call it.
6469 (Output_file_header::do_size): New method definition.
6470 (Output_data_group::Output_data_group): Adjust call to
6471 Output_section_data.
6472 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
6473 (Output_symtab_xindex::do_write): Add array bound check.
6474 (Output_section::Input_section::print_to_mapfile): Handle
6475 RELAXED_INPUT_SECTION_CODE.
6476 (Output_section::Output_section): Initialize data member checkpoint_.
6477 (Output_section::~Output_section): Delete checkpoint object pointed
6478 by checkpoint_.
6479 (Output_section::add_input_section): Always add an Input_section if
6480 relaxing.
6481 (Output_section::add_merge_input_section): Add assert.
6482 (Output_section::relax_input_section): New method definition.
6483 (Output_section::set_final_data_size): Set load address to zero for
6484 an unallocated section.
6485 (Output_section::do_address_and_file_offset_have_reset_values):
6486 New method definition.
6487 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
6488 Handle relaxed input section.
6489 (Output_section::sort_attached_input_sections): Checkpoint input
6490 section list lazily.
6491 (Output_section::get_input_sections): Change type of input_sections to
6492 list of Simple_input_section pointers. Checkpoint input section list
6493 lazily. Also handle relaxed input sections.
6494 (Output_section::add_input_section_for_script): Take a reference to
6495 a Simple_input_section object instead of Relobj pointer and section
6496 index as parameter. Handle relaxed input sections.
6497 (Output_section::save_states, Output_section::restore_states): New
6498 method definitions.
6499 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
6500 (Output_data::is_data_size_fixed): New method definition.
6501 (Output_data::reset_addresss_and_file_offset): Do not reset data size
6502 if it is fixed.
6503 (Output_data::address_and_file_offset_have_reset_values): New method
6504 definition.
6505 (Output_data::do_address_and_file_offset_have_reset_values): New method
6506 definition.
6507 (Output_data::set_data_size): Check that data size is not fixed.
6508 (Output_data::fix_data_size): New method definition.
6509 (Output_data::is_data_size_fixed_): New data member.
6510 (Output_section_headers::set_final_data_size): New method definition.
6511 (Output_section_headers::do_size): New method declaration.
6512 (Output_segment_headers::set_final_data_size): New method definition.
6513 (Output_segment_headers::do_size): New method declaration.
6514 (Output_file_header::set_final_data_size)::New method definition.
6515 (Output_file_header::do_size)::New method declaration.
6516 (Output_section_data::Output_section_data): Add new parameter
6517 is_data_size_fixed and use it to fix data size.
6518 (Output_data_const::Output_data_const): Adjust call to base class
6519 constructor and fix data size.
6520 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
6521 base class constructor and fix data size.
6522 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
6523 base class constructor and fix data size.
6524 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
6525 class constructor and fix data size.
6526 (Output_data_group::set_final_data_size): New method definition.
6527 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
6528 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
6529 class constructor and fix data size.
6530 (Output_relaxed_input_section): New class definition.
6531 (Output_section::Simple_input_section): New class definition.
6532 (Output_section::get_input_sections): Adjust parameter list.
6533 (Output_section::add_input_section_for_script): Same.
6534 (Output_section::save_states, Output_section::restore_states,
6535 Output_section::do_address_and_file_offset_have_reset_values,
6536 (Output_section::Input_section::Input_section): Handle
6537 RELAXED_INPUT_SECTION_CODE. Add new overload for
6538 Output_relaxed_input_section.
6539 (Output_section::Input_section::is_input_section,
6540 Output_section::Input_section::set_output_section): Handle relaxed
6541 input section.
6542 (Output_section::Input_section::is_relaxed_input_section,
6543 Output_section::Input_section::output_section_data,
6544 Output_section::Input_section::relaxed_input_section): New method
6545 definitions.
6546 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
6547 value.
6548 (Output_section::Input_section::u1_): Update comments.
6549 (Output_section::Input_section::u2_): Add new union member poris.
6550 (Output_section::Checkpoint_output_section): New classs definition.
6551 (Output_section::relax_input_section): New method declaration.
6552 (Output_section::checkpoint_): New data member.
6553 (Output_segment): Update comments.
6554 (Output_segment::Output_segment): Un-privatize copy constructor.
6555 (Output_segment::operator=): Un-privatize.
6556 * script-sections.cc (Output_section_element::Input_section_list):
6557 Change element type to Output_section::Simple_input_section.
6558 (Output_section_element_dot_assignment::set_section_addresses):
6559 Register output section data for relaxation clean up.
6560 (Output_data_exression::Output_data_expression): Adjust call to base
6561 constructor to fix data size.
6562 (Output_section_element_data::set_section_addresses): Register
6563 Output_data_expression object for relaxation clean up.
6564 (struct Input_section_info): Replace Relobj pointer and section index
6565 pair with Output_section::Simple_input_section and Convert struct to a
6566 class.
6567 (Input_section_sorter::operator()): Adjust access to
e1df38aa 6568 Input_section_info data member to use accessors.
20e6d0d6
DK
6569 (Output_section_element_input::set_section_addresses): Use layout
6570 parameter. Adjust code to use Output_section::Simple_input_section
6571 and Input_secction_info classes. Register filler for relaxation
6572 clean up.
6573 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
6574 and section index pair with Output_section::Simple_input_section
6575 class. Adjust code accordingly.
6576 (Phdrs_element::release_segment): New method definition.
6577 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
6578 segment list.
6579 (Script_sections::release_segments): New method definition.
6580 * gold/script-sections.h (Script_sections::release_segments): New
6581 method declaration.
6582 * gold/target.h (Target::may_relax, Target::relax,
6583 Target::do_may_relax, Target::do_relax): New method definitions.
6584
5e445df6
ILT
65852009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6586
6587 * arm.cc (has_signed_unsigned_overflow): New function.
6588 (Arm_relocate_functions::abs8): New function.
6589 (Target_arm::Scan::local): Handle R_ARM_ABS8.
6590 (Target_arm::Scan::global): Likewise.
6591 (Target_arm::relocate::relocate): Likewise.
6592 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6593 Likewise.
6594
8c604651 65952009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
6596
6597 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
6598 * testsuite/Makefile.in: Regenerate.
6599
1e9cc1c2
NC
66002009-09-11 Nick Clifton <nickc@redhat.com>
6601
6602 * po/gold.pot: Updated by the Translation project.
6603
6a89f575
CC
66042009-09-08 Cary Coutant <ccoutant@google.com>
6605
6606 * output.cc (Output_file::open): Add execute permission to empty file.
6607 * testsuite/Makefile.am (permission_test): New test.
6608 * testsuite/Makefile.in: Regenerate.
6609
fdcac5af
ILT
66102009-09-02 Ian Lance Taylor <iant@google.com>
6611
6612 * output.cc (Output_file::resize): Call map_no_anonymous rather
6613 than map.
6614
44453f85
ILT
66152009-09-01 Mikolaj Zalewski <mikolajz@google.com>
6616
6617 * gold.cc: Include "incremental.h".
6618 (queue_initial_tasks): Call Incremental_checker methods.
6619 * incremental.cc: Include "output.h".
6620 (Incremental_checker::can_incrementally_link_output_file): New
6621 method.
6622 * incremental.h (Incremental_checker): New class.
6623
6624 * output.cc (Output_file::open_for_modification): New method.
6625 (Output_file::map_anonymous): Changed return type to bool. Record
6626 map in base_ field.
6627 (Output_file::map_no_anonymous): New method, broken out of map.
6628 (Output_file::map): Use map_no_anonymous and map_anonymous.
6629 * output.h (class Output_file): Update declarations.
6630
293c1386
CC
66312009-08-24 Cary Coutant <ccoutant@google.com>
6632
6633 * options.h (Command_line::Pre_options): New class.
6634 (Command_line::pre_options): New member.
6635 * options.cc (gold::options::ready_to_register): New variable.
6636 (One_option::register_option): Do nothing if not registering options.
6637 Assert if same short option registered twice.
6638 (General_options::General_options): Turn off option registration when
6639 done constructing.
6640 (Command_line::Pre_options::Pre_options): New constructor.
6641
f773f3d2
CC
66422009-08-24 Cary Coutant <ccoutant@google.com>
6643
06a73cfe
CC
6644 * options.h (General_options::no_keep_memory): Remove incorrect
6645 short option.
f773f3d2 6646
a15af8e2
RW
66472009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6648
6649 * Makefile.am (am__skiplex, am__skipyacc): New.
6650 * Makefile.in: Regenerate.
6651
c462b41b
RW
66522009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6653
14ec8efd
RW
6654 * Makefile.am (AM_CPPFLAGS): Renamed from ...
6655 (INCLUDES): ... this.
6656 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
6657 (AM_CPPFLAGS): Renamed from ...
6658 (INCLUDE): ... this.
6659 * Makefile.in, testsuite/Makefile.in: Regenerate.
6660
81ecdfbb
RW
6661 * Makefile.in: Regenerate.
6662 * aclocal.m4: Likewise.
6663 * config.in: Likewise.
6664 * configure: Likewise.
6665 * testsuite/Makefile.in: Likewise.
6666
c462b41b
RW
6667 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
6668 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
6669 * Makefile.in: Regenerate.
6670 * testsuite/Makefile.in: Regenerate.
6671
2da73f13
CC
66722009-08-19 Cary Coutant <ccoutant@google.com>
6673
6674 * resolve.cc (Symbol_table::resolve): Don't complain about defined
6675 symbols in shared libraries overridden by hidden or internal symbols
6676 in the main program.
6677
2db70501
CD
66782009-08-19 Chris Demetriou <cgd@google.com>
6679
6680 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
6681 checking source file names in error messages.
6682
f733487b
DK
66832009-08-18 Doug Kwan <dougkwan@google.com>
6684
6685 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
6686 an elcpp::Ehdr as parameter. Adjust call to set_target.
6687 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
6688 an elfcpp::Ehdr as parameter.
6689 * object.cc (Object::set_target): Remove the version that looks up
6690 a target and sets it.
6691 (Sized_relobj::setup): Take a Target object instead of
6692 an elfcpp::Ehdr as parameter. Adjust call to set_target.
6693 (make_elf_sized_object): Find target and ask target to
6694 make an ELF object.
6695 * object.h: (Object::set_target): Remove the version that looks up
6696 a target and sets it.
6697 (Sized_relobj::setup): Take a Target object instead of
6698 an elfcpp:Ehdr as parameter.
6699 * target.cc: Include dynobj.h.
6700 (Target::do_make_elf_object_implementation): New.
6701 (Target::do_make_elf_object): New.
6702 * target.h (Target::make_elf_object): New template declaration.
6703 (Target::do_make_elf_object): New method declarations.
6704 (Target::do_make_elf_object_implementation): New template declaration.
6705
cc70f101
ILT
67062009-08-14 Ian Lance Taylor <iant@google.com>
6707
6708 * gold.h (FUNCTION_NAME): Define.
6709 (gold_unreachable): Use FUNCTION_NAME.
6710
ef5e0cb1
ST
67112009-08-12 Sriraman Tallam <tmsriram@google.com>
6712
6713 * icf.cc (Icf::find_identical_sections): Issue a warning when a
6714 symbol in the --keep-unique list is not found.
6715
48c187ce
ST
67162009-08-12 Sriraman Tallam <tmsriram@google.com>
6717
6718 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
6719 been maked as --keep-unique.
6720 (Icf::unfold_section): New function.
6721 * icf.h (Icf::unfold_section): New function.
6722 * options.h (General_options::keep_unique): New option.
6723 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
6724 * testsuite/Makefile.in: Regenerate.
6725 * testsuite/icf_keep_unique_test.sh: New file.
6726 * testsuite/icf_keep_unique_test.cc: New file.
6727
645afe0c
CC
67282009-08-12 Cary Coutant <ccoutant@google.com>
6729
6730 PR 10471
6731 * resolve.cc (Symbol_table::resolve): Check for references from
6732 dynamic objects to hidden and internal symbols.
6733 * testsuite/Makefile.am (hidden_test.sh): New test.
6734 * testsuite/Makefile.in: Regenerate.
6735 * testsuite/hidden_test.sh: New script.
6736 * testsuite/hidden_test_1.c: New test source.
6737 * testsuite/hidden_test_main.c: New test source.
6738
11af873f
DK
67392009-08-11 Doug Kwan <dougkwan@google.com>
6740
6741 * arm.cc: Update comments.
6742 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
6743 segment to locate the .ARM.exidx section if present.
6744
b9f7d72d
DK
67452009-08-09 Doug Kwan <dougkwan@google.com>
6746
6747 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
6748 patch.
6749
ddd3c53c
ST
67502009-08-07 Sriraman Tallam <tmsriram@google.com>
6751 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
6752 compiler warnings.
6753
27721062
ST
67542009-08-06 Sriraman Tallam <tmsriram@google.com>
6755
6756 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
6757 valid tls_segment only for non-debug-section relocations.
6758 * testsuite/Makefile.am: Add gc_tls_test.
6759 * testsuite/Makefile.in: Regenerate.
6760 * testsuite/gc_tls_test.cc: New file.
6761 * testsuite/gc_tls_test.sh: New file.
6762
ef15dade 67632009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 6764
ef15dade
ST
6765 * icf.cc: New file.
6766 * icf.h: New file.
6767 * Makefile.am (CCFILES): Add icf.cc.
6768 (HFILES): Add icf.h
6769 * Makefile.in: Regenerate.
6770 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
6771 * gc.h (gc_process_relocs): Populate lists used by icf to contain
6772 section, symbol and addend information for the relocs.
6773 * gold.cc (queue_middle_tasks): Call identical code folding.
6774 * gold.h: Add defines for multimap.
6775 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
6776 to the call of finalize_local_symbols.
6777 * main.cc (main): Create object of class Icf.
6778 * object.cc (Sized_relobj::do_layout): Allow this function to be
6779 called twice during icf.
6780 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
6781 to sections marked as identical by icf.
6782 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
6783 when available.
6784 (Sized_relobj::do_section_entsize): New function.
6785 * object.h (Object::section_entsize): New function.
6786 (Object::do_section_entsize): New pure virtual function.
6787 (Relobj::finalize_local_symbols): Add new parameter.
6788 (Relobj::do_section_entsize): New function.
6789 * options.h (General_options::icf): New option.
6790 (General_options::icf_iterations): New option.
6791 (General_options::print_icf_sections): New option.
6792 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
6793 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
6794 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
6795 icf.
6796 * symtab.cc (Symbol_table::is_section_folded): New function.
6797 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
6798 to sections marked as identical by icf.
6799 * symtab.h (Symbol_table::set_icf): New function.
6800 (Symbol_table::icf): New function.
6801 (Symbol_table::is_section_folded): New function.
6802 (Symbol_table::icf_): New data member.
6803 * target-reloc.h (relocate_section): Ignore sections folded by icf.
6804 * testsuite/Makefile.am: Add commands to build icf_test.
6805 * testsuite/Makefile.in: Regenerate.
6806 * testsuite/icf_test.sh: New file.
6807 * testsuite/icf_test.cc: New file.
6808
c3b65ac4
CD
68092009-07-24 Chris Demetriou <cgd@google.com>
6810
6811 * layout.cc (is_compressible_debug_section): Fix incorrect
6812 comment about compressed section names.
6813
1caf2c51
ILT
68142009-07-20 Ian Lance Taylor <ian@airs.com>
6815
6816 PR 10419
6817 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
6818
1ef4d87f
ILT
68192009-07-16 Ian Lance Taylor <iant@google.com>
6820
6821 PR 10400
6822 * layout.h: #include <map>.
6823 (class Kept_section): Change from struct to class. Add accessors
6824 and setters. Add section size to Comdat_group mapping. Change
6825 Comdat_group to std::map. Add is_comdat_ field. Add
6826 linkonce_size field in union.
6827 (class Layout): Update declaration of find_or_add_kept_section.
6828 Don't declare find_kept_object.
6829 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
6830 parameter. Add object, shndx, is_comdat, and is_group_name
6831 parameters. Change all callers. Adjust for new Kept_section.
6832 (Layout::find_kept_object): Remove.
6833 * object.cc (Sized_relobj::include_section_group): Update use of
6834 Kept_section. Rename secnum to shndx. Only record
6835 Kept_comdat_section if sections are the same size.
6836 (Sized_relobj::include_linkonce_section): Update use of
6837 Kept_section. Only record Kept_comdat_section if sections are the
6838 same size. Set size of linkonce section.
6839 (Sized_relobj::map_to_kept_section): Update call to
6840 get_kept_comdat_section.
6841 * object.h (class Sized_relobj): Rename fields in
6842 Kept_comdat_section to drop trailing underscores; change object
6843 field to Relobj*. Change Kept_comdat_section_table to store
6844 struct rather than pointer.
6845 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
6846 Add kept_object and kept_shndx parameters. Change all callers.
6847 (Sized_relobj::get_kept_comdat_section): Change return type to
6848 bool. Add kept_object and kept_shndx parameters. Change all
6849 callers.
6850 * plugin.cc (Pluginobj::include_comdat_group): Update call to
6851 Layout::find_or_add_kept_section.
6852
37c3b7b0
ILT
68532009-07-09 Ian Lance Taylor <iant@google.com>
6854
6855 * merge.cc (Object_merge_map::initialize_input_to_output_map):
6856 Reserve space in the hash table.
6857
98fa85cb
ILT
68582009-07-06 Mikolaj Zalewski <mikolajz@google.com>
6859
6860 * fileread.cc (File_read::get_mtime): New method.
6861 * fileread.h (Timespec): New structure.
6862 (File_read::get_mtime): New method.
6863 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
6864 Renamed from timestamp_nsec.
6865 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
6866 Elf_Xword.
e1df38aa 6867 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 6868 timestamp_nsec.
e1df38aa 6869 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
6870 (Incremental_inputs::report_obejct): Save mtime; style fix.
6871 (Incremental_inputs::report_script): Save mtime; style fix.
6872 (Incremental_inputs::finalize_inputs): Style fix.
6873 (Incremental_inputs::finalize): Style fix.
6874 (Incremental_inputs::create_input_section_data): Store inputs
6875 mtime.
6876 * incremental.h (Incremental_inputs::report_script): Add mtime
6877 argument.
6878 (Incremental_inputs::Input_info::Input_info): Intialize only one
6879 union member.
6880 (Incremental_inputs::Input_info::archive): Move to nameless
6881 union.
6882 (Incremental_inputs::Input_info::obejct): Move to nameless union.
6883 (Incremental_inputs::Input_info::script): Move to nameless union.
6884 (Incremental_inputs::mtime): New field.
6885 * script.cc (read_input_script): Pass file mtime to
6886 Incremental_input.
6887 * script.h (Script_info::inputs): Style fix.
6888
c9d70757
ILT
68892009-07-01 Ian Lance Taylor <ian@airs.com>
6890
6891 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
6892 instead of 32.
6893
9c547ec3
ILT
68942009-06-24 Ian Lance Taylor <iant@google.com>
6895
6896 PR 10156
6897 * layout.cc (Layout::choose_output_section): If we find an
6898 existing section, update the flags.
6899 (Layout::create_notes): New function, broken out of
6900 Layout::finalize.
6901 (Layout::finalize): Don't create note sections.
6902 (Layout::create_note): Don't crash if linker script discards
6903 section.
6904 (Layout::create_gold_note): Likewise.
6905 (Layout::create_build_id): Likewise. Don't set
6906 after_input_sections on the section.
6907 (Layout::create_executable_stack_info): Remove target parameter.
6908 Change caller.
6909 * layout.h (class Layout): Declare create_notes. Update
6910 declaration of create_executable_stack_info.
6911 * gold.cc (queue_middle_tasks): Call create_notes.
6912 * output.cc (Output_section::update_flags_for_input_section): Move
6913 here from output.h. If SHF_ALLOC flag is newly set, mark address
6914 invalid.
6915 * output.h (Output_data::mark_address_invalid): New function.
6916 (class Output_section): Only declare, not define,
6917 update_flags_for_input_section. Remove set_flags.
6918
55458500
ILT
69192009-06-24 Ian Lance Taylor <iant@google.com>
6920
6921 * script-sections.cc (Output_section_definition::
6922 set_section_addresses): Rename shadowing local load_address to
6923 laddr.
6924
1307d6cd
ILT
69252009-06-24 Ian Lance Taylor <iant@google.com>
6926
6927 PR 10244
6928 * reloc.cc (relocate_sections): Skip empty relocation sections.
6929
ec3f783e
ILT
69302009-06-23 Ian Lance Taylor <iant@google.com>
6931
6932 PR 10156
6933 * layout.cc (Layout::create_note): Use choose_output_section
6934 rather than make_output_section.
6935
459c9f1c
ILT
69362009-06-23 Ian Lance Taylor <iant@google.com>
6937
6938 PR 10237
6939 * options.cc (General_options::parse_V): Set printed_version_.
6940 (General_options::General_options): Initialize printed_version_.
6941 * options.h (class General_options): Add printed_version_ field.
6942 * gold.cc (queue_initial_tasks): If there are no input files,
6943 don't give a fatal error if we printed the version information.
6944 (queue_middle_tasks): If using -r with a shared object, give a
6945 fatal error rather than an ordinary error.
6946
1518dc8f
ILT
69472009-06-23 Ian Lance Taylor <iant@google.com>
6948
6949 PR 10219
6950 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
6951 (Layout::make_output_section): Set have_stabstr_section_ if we see
6952 a .stab*str section.
6953 (Layout::finalize): Call link_stabs_sections.
6954 (Layout::link_stabs_sections): New file.
6955 * layout.h (class Layout): Add have_stabstr_section_ field.
6956 Declare link_stabs_sections.
6957
3d857b98
DK
69582009-06-23 Doug Kwan <dougkwan@google.com>
6959
6960 * Makefile.am (libgold_a_LIBADD): New.
6961 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
6962 * Makefile.in: Regenerate.
6963 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
6964 * configure: Regenerate.
6965 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
6966 * fileread.cc: Include sys/state.h
6967 * gold.h: Declare memmem and strndup if found missing.
6968 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
6969
0639a6f6
ILT
69702009-06-23 Ian Lance Taylor <iant@google.com>
6971
6972 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
6973 * configure: Rebuild.
6974
8d63875c
ILT
69752009-06-23 Ian Lance Taylor <iant@google.com>
6976
6977 PR 10147
6978 * object.cc (Object::section_contents): Don't try to get a view if
6979 the section has length zero.
6980 (Object::handle_gnu_warning_section): If the section is empty, use
6981 the name of the section as the warning.
6982
f7c8a183
ILT
69832009-06-23 Ian Lance Taylor <iant@google.com>
6984
6985 PR 10133
6986 * stringpool.h (class Stringpool_template): Add optimize_ field.
6987 (Stringpool_template::set_optimize): New function.
6988 * stringpool.cc (Stringpool_template::Stringpool_template):
6989 Initialize optimize_ field.
6990 (Stringpool_template::set_string_offsets): Test local optimize
6991 fild rather than parameter.
6992 * layout.cc (Layout::Layout): Call set_optimize on the section
6993 name stringpool.
6994
e6a307ba
ILT
69952009-06-22 Ian Lance Taylor <iant@google.com>
6996
6997 PR 10030
6998 * yyscript.y: Parse TARGET.
6999 * script.cc (script_set_target): New function.
7000 * script-c.h (script_set_target): Declare.
7001 * options.cc (General_options::string_to_object_format): Rename
7002 from string_to_object_format in anonymous namespace. Change
7003 callers.
7004 * options.h (class General_options): Declare
7005 string_to_object_format.
7006
3ee173de
ILT
70072009-06-22 Ian Lance Taylor <iant@google.com>
7008
7009 * script-sections.cc (Script_sections::create_segments): Don't put
7010 program headers in a PT_LOAD segment if -n or -N.
7011
70122009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7013
7014 PR 10141
7015 * options.h (class General_options): Add -z lazy and -z now. Sort
7016 -z options into alphabetical order.
7017 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7018
cd6739a1 70192009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7020
7021 * layout.cc (Layout::make_output_section): Call
7022 Target::new_output_section.
7023 (Layout::attach_allocated_section_to_segment): Put large section
7024 sections in a separate load segment with the large segment flag
7025 set.
7026 (Layout::segment_precedes): Sort large data segments after other
7027 load segments.
7028 (align_file_offset): New static function.
7029 (Layout::set_segment_offsets): Use align_file_offset.
7030 * output.h (class Output_section): Add is_small_section_ and
7031 is_large_section_ fields.
7032 (Output_section::is_small_section): New function.
7033 (Output_section::set_is_small_section): New function.
7034 (Output_section::is_large_section): New function.
7035 (Output_section::set_is_large_section): New function.
7036 (Output_section::is_large_data_section): New function.
7037 (class Output_segment): Add is_large_data_segment_ field.
7038 (Output_segment::is_large_data_segment): New function.
7039 (Output_segment::set_is_large_data_segment): New function.
7040 * output.cc (Output_section::Output_section): Initialize new
7041 fields.
7042 (Output_segment::Output_segment): Likewise.
7043 (Output_segment::add_output_section): Add assertion that large
7044 data sections always go in large data segments. Force small data
7045 sections to the end of the list of data sections. Force small BSS
7046 sections to the start of the list of BSS sections. For large BSS
7047 sections to the end of the list of BSS sections.
7048 * symtab.h (class Symbol): Declare is_common_shndx.
7049 (Symbol::is_defined): Check Symbol::is_common_shndx.
7050 (Symbol::is_common): Likewise.
7051 (class Symbol_table): Define enum Commons_section_type. Update
7052 declarations. Add small_commons_ and large_commons_ fields.
7053 * symtab.cc (Symbol::is_common_shndx): New function.
7054 (Symbol_table::Symbol_table): Initialize new fields.
7055 (Symbol_table::add_from_object): Put small and large common
7056 symbols in the right list.
7057 (Symbol_table::sized_finalized_symbol): Check
7058 Symbol::is_common_shndx.
7059 (Symbol_table::sized_write_globals): Likewise.
7060 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7061 common symbol lists. Don't call do_allocate_commons_list if the
7062 list is empty.
7063 (Symbol_table::do_allocate_commons_list): Remove is_tls
7064 parameter. Add comons_section_type parameter. Change all
7065 callers. Handle small and large common symbols.
7066 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7067 Symbol::is_common_shndx.
7068 * resolve.cc (symbol_to_bits): Likewise.
7069 * target.h (Target::small_common_shndx): New function.
7070 (Target::small_common_section_flags): New function.
7071 (Target::large_common_shndx): New function.
7072 (Target::large_common_section_flags): New function.
7073 (Target::new_output_section): New function.
7074 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7075 small_common_section_flags, and large_common_section_flags
7076 fields.
7077 (Target::do_new_output_section): New virtual function.
7078 * arm.cc (Target_arm::arm_info): Initialize new fields.
7079 * i386.cc (Target_i386::i386_info): Likewise.
7080 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7081 Likewise.
7082 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7083 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7084 (Target_x86_64::do_new_output_section): New function.
7085 * configure.ac: Define conditional MCMODEL_MEDIUM.
7086 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7087 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7088 (large_LDFLAGS): Define.
7089 * testsuite/large.c: New file.
7090 * testsuite/testfile.cc (Target_test::test_target_info):
7091 Initialize new fields.
7092 * configure, testsuite/Makefile.in: Rebuild.
7093
bb04269c
DK
70942009-06-05 Doug Kwan <dougkwan@google.com>
7095
7096 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7097 * Makefile.in: Regenerate.
bb04269c
DK
7098 * i386.cc (class Target_i386): Define new virtual method to
7099 override do_is_local_label_name in parent.
7100 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7101 local symbols if --discard-locals or -X is given.
7102 * options.h (class General_options): Declare new options
7103 '--discard-locals' and '-X' for discarding locals.
7104 * target.h (class Target): Define new methods is_local_label_name.
7105 Declare new virtual method do_is_local_label_name.
7106 * target.cc: New file.
7107 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7108 (check_SCRIPTS): Add discard_locals_test.sh.
7109 (check_DATA): Add discard_local_tests.syms.
7110 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7111 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7112 * testsuite/Makefile.in: Regenerate.
7113 * testsuite/discard_locals_test.c: New file.
7114 * testsuite/discard_locals_test.sh: Same.
7115
805bb01c
DK
71162009-06-05 Doug Kwan <dougkwan@google.com>
7117
7118 * object.cc (Sized_relobj::Sized_relobj): Initialize
7119 discarded_eh_frame_shndx_ to -1U.
7120 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7121 section.
7122 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7123 a discarded .eh_frame section.
7124 (Sized_relobj::do_finalize_local_symbols): Ditto.
7125 * object.h (class Sized_relobj): Declare new member
7126 discarded_eh_frame_shndx_.
7127 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7128 (local_labels_test.o, local_labels_test): New rules.
7129 * testsuite/Makefile.in: Regenerate.
7130
1dcd334d
DK
71312009-06-04 Doug Kwan <dougkwan@google.com>
7132
7133 * layout.cc (Layout::section_name_mapping): Add mapping for
7134 special ARM sections.
7135
96d49306
DK
71362009-06-03 Doug Kwan <dougkwan@google.com>
7137
7138 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7139 (utils::has_overflow): Same.
7140
dff16297
ILT
71412009-06-03 Ian Lance Taylor <iant@google.com>
7142
7143 * layout.cc (Layout::section_name_mapping): New array, replacing
7144 Layout::linkonce_mapping.
7145 (Layout::section_name_mapping_count): New variable, replacing
7146 Layout::linkonce_mapping_count.
7147 (Layout::linkonce_output_name): Remove.
7148 (Layout::output_section_name): Rewrite.
7149 * layout.h (class Layout): Rename Linkonce_mapping to
7150 Section_name_mapping, linkonce_mapping to section_name_mapping,
7151 linkonce_mapping_count to section_name_mapping_count. Don't
7152 declare linkonce_output_name.
7153
c121c671
DK
71542009-06-03 Doug Kwan <dougkwan@google.com>
7155
7156 * gold/arm.cc (namespace utils): New.
7157 (Target_arm::reloc_is_non_pic): Define new method.
7158 (class Arm_relocate_functions): New.
7159 (Target_arm::Relocate::relocate): Handle relocation types used by
7160 Android.
7161
07800fab
ILT
71622009-06-03 Ian Lance Taylor <iant@google.com>
7163
7164 * arm.cc (Target_arm::scan::global): Use || instead of |.
7165
c121c671
DK
71662009-06-02 Doug Kwan <dougkwan@google.com>
7167
7168 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7169 issued_non_pic_error_.
7170 (class Target_arm::Scan): Declare new method check_non_pic.
7171 Define new method symbol_needs_plt_entry.
7172 Declare new data member issued_non_pic_error_.
7173 (class Target_arm::Relocate): Declare new method
7174 should_apply_static_reloc.
7175 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7176 (Target_arm::Scan::check_non_pic): Define new method.
7177 (Target_arm::Scan::local): Handle a small subset of reloc types used
7178 by Android.
7179 (Target_arm::Scan::local): Same.
7180 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7181
b19b0c6d
ILT
71822009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7183
7184 * incremental.cc (Incremental_inputs::report_command_line): Filter
7185 out --incremental-* options.
7186
94cdfcff
DK
71872009-05-29 Doug Kwan <dougkwan@google.com>
7188
7189 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7190 template class.
7191 (class Target_arm): Update comment.
7192 (Target_arm::Target_arm): Initialize new data members GOT_,
7193 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7194 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7195 and Target_arm::rel_dyn_section.
7196 Declare new_enum Target_arm::Got_type.
7197 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7198 and DYNBSS_.
7199 Update commments for member do_dynsym_value.
7200 (Target_arm::got_size, Target_arm::plt_section,
7201 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7202 new methods inside class defintion.
7203 (Target_arm::got_section): Define new method.
7204 (Target_arm::rel_dyn_section): Same.
7205 (Output_data_plt_arm): New template class.
7206 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7207 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7208 (Output_data_plt_arm::add_entry): Same.
7209 (Output_data_plt_arm::first_plt_entry): Define new
7210 static data member for PLT instruction template.
7211 (Output_data_plt_arm::plt_entry): Same.
7212 (Output_data_plt_arm::do_write): Define new method.
7213 (Target_arm::make_plt_entry): Same.
7214 (Target_arm::do_finalize_sections): Same.
7215 (Target_arm::do_dynsym_value): Same.
7216
4a657b0d
DK
72172009-05-28 Doug Kwan <dougkwan@google.com>
7218
7219 * Makefile.am (TARGETSOURCES): Add arm.cc.
7220 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7221 * Makefile.in: Regenerate.
7222 * arm.cc: New file.
7223 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7224
e7ae8c36
DK
72252009-05-26 Doug Kwan <dougkwan@google.com>
7226
7227 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7228 (General_options::check_excluded_libs): Strip off directories in
7229 archive name before matching like GNU ld does.
7230 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7231 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7232 (exclude_libs_test_LDFLAGS): Add linker option
7233 -Wl,--exclude-libs,libexclude_libs_test_3
7234 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7235 an explicit archive without using -l.
7236 (alt/libexclude_libs_test_3.a): New make rule.
7237 * testsuite/Makefile.in: Regenerate.
7238 * testsuite/exclude_libs_test.c : Declare lib3_default().
7239 (main): Call it.
7240 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
7241 * exclude_libs_test_3.c: New file.
7242
f12e7348
NC
72432009-05-26 Nick Clifton <nickc@redhat.com>
7244
7245 * po/id.po: New Indonesian translation.
7246 * po/gold.pot: Updated template file.
7247
4daadc0d
ST
72482009-05-22 Sriraman Tallam <tmsriram@google.com>
7249
e1df38aa 7250 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
7251 gc_comdat_test files. Add -Wl,--gc-sections to build
7252 gc_comdat_test.
7253 * testsuite/Makefile.in: Regenerate.
7254 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
7255
531813ad
ST
72562009-05-21 Sriraman Tallam <tmsriram@google.com>
7257
7258 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
7259 kept comdat section was garbage collected.
7260 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
7261 * testsuite/Makefile.in: Regenerate.
7262 * testsuite/gc_comdat_test.sh: New file.
7263 * testsuite/gc_comdat_test_1.cc: New file.
7264 * testsuite/gc_comdat_test_2.cc: New file.
7265
65514900
CC
72662009-05-19 Doug Kwan <dougkwan@google.com>
7267
7268 * archive.cc (Archive::Archive): Move constructor from archive.h
7269 to here. Initialize no_export_.
7270 (Archive::get_elf_object_for_member): Set no_export flag of object.
7271 * archive.h (Archive::Archive): Move constructor body to
7272 archive.cc.
7273 (Archive::no_export): New method.
7274 (Archive::no_export_): New field.
7275 * object.h (Object::Object): Initialize no_export_ to false.
7276 (Object::no_export, Object::set_no_export): New methods.
7277 (Object::no_export_): New field.
7278 * options.cc (General_options::parse_exclude_libs): New method.
7279 (General_options::check_excluded_libs) Same.
7280 * options.h (exclude_libs): New option.
7281 (General_options::check_excluded_libs): New method declaration.
7282 (General_options::excluded_libs_): New field.
7283 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
7284 default or protected visibility if an object has no-export flag set.
7285 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
7286 (check_SCRIPTS): Add exclude_libs_test.sh.
7287 (check_DATA): Add exclude_libs_test.syms.
7288 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
7289 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
7290 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
7291 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
7292 (exclude_libs_test.syms, libexclude_libs_test_1.a,
7293 libexclude_libs_test_2.a): New rules.
7294 * testsuite/Makefile.in: Regenerate.
7295 * testsuite/exclude_libs_test.c: New file.
7296 * testsuite/exclude_libs_test.sh: Ditto.
7297 * testsuite/exclude_libs_test_1.c: Ditto.
7298 * testsuite/exclude_libs_test_2.c: Ditto.
7299
1b77ea50
ILT
73002009-05-15 Ian Lance Taylor <iant@google.com>
7301
7302 * configure.ac: Check for declarations for cases where libiberty.h
7303 checks HAVE_DECL_xxx.
7304 * configure, config.in: Rebuild.
7305
072fe7ce
ILT
73062009-05-15 Mikolaj Zalewski <mikolajz@google.com>
7307
7308 * gold.h (Incremental_argument_list): Remove (invalid) forward
7309 declaration.
7310 * incremental.cc (Incremental_inputs::report_achive): New method.
7311 (Incremental_inputs::report_object): New method.
7312 (Incremental_inputs::report_script): New method.
7313 (Incremental_inputs::finalize_inputs): New method.
7314 (Incremental_inputs::finalize): Call finalize_inputs().
7315 (Incremental_inputs::sized_create_incremental_inputs_section_data):
7316 Create inputs entries.
7317 * incremental.h (Incremental_input_type): New enum.
7318 (Incremental_inputs::Incremental_input): Initialize new fields.
7319 (Incremental_inputs::report_inputs): New method.
7320 (Incremental_inputs::report_achive): New method.
7321 (Incremental_inputs::report_object): New method.
7322 (Incremental_inputs::report_script): New method.
7323 (Incremental_inputs::finalize_inputs): New method.
7324 (Incremental_inputs::Input_info): New struct.
7325 (Incremental_inputs::Input_info_map): New typedef.
7326 (Incremental_inputs::lock_): New field.
7327 (Incremental_inputs::Inputs_): New field.
7328 (Incremental_inputs::Inputs_map): New field.
7329 * main.cc (main): Call Incremental_input::report_inputs.
7330 * options.h (Input_argument_list): Typedef moved from
7331 Input_arguments.
7332 (Input_file_group::Files): Remove, use ::Input_argument_list.
7333 (Input_file_group::Input_argument_list): Remove, use
7334 ::Input_argument_list.
7335 * plugin.cc (Plugin_manager::add_input_file): Add error in
7336 incremental build.
7337 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
7338 functions.
7339 * script.cc (read_input_script): Call
7340 Incremental_input::report_script.
7341 * script.h (Script_info): New class.
7342
b0481b0b
ILT
73432009-04-27 Ian Lance Taylor <iant@google.com>
7344
7345 * x86_64.cc (do_adjust_output_section): Set entsize to
7346 plt_entry_size.
7347
b22a5a41 73482009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
7349
7350 * output.cc (Output_file::close): After short writes, continue
7351 writing from the correct offset in the buffer being written.
7352
40fde488
CD
73532009-04-23 Chris Demetriou <cgd@google.com>
7354
7355 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
7356 * configure: Regenerate.
7357 * config.in: Regenerate.
7358 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
7359 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
7360
3ce2c28e
ILT
73612009-04-21 Mikolaj Zalewski <mikolajz@google.com>
7362
7363 * incremental.cc (Incremental_inputs_header_data): Renamed from
7364 Incremental_input_header_data.
7365 (Incremental_inputs_header_data::data_size): New field.
7366 (Incremental_inputs_header_data::put_input_file_count): Renamed
7367 from input_file_count.
7368 (Incremental_inputs_header_data::put_command_line_offset): Renamed
7369 from command_line_offset.
7370 (Incremental_inputs_header_data::put_reserved): Renamed from
7371 put_reserved.
7372 (Incremental_inputs_entry_data): Renamed from
7373 Incremental_input_entry_data.
7374 (Incremental_inputs_entry_data::data_size): New field.
7375 (Incremental_inputs::report_command_line): New method.
7376 (Incremental_inputs::finalize): New method.
7377 (Incremental_inputs::create_incremental_inputs_data): New method.
7378 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
7379 * incremental.h: New file.
7380 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
7381 (Layout::finalize): Create incremental inputs section in
7382 incremental builds.
7383 (Layout::create_incremental_info_sections): New method.
7384 * layout.h (Layout::incremental_inputs): New method.
7385 (Layout::create_incremental_info_sections): New method.
7386 (Layout::incremental_inputs_): New field.
7387 * main.cc (main): Notify Incremental_input of the command line.
7388
e55bde5e
ILT
73892009-04-01 Ian Lance Taylor <iant@google.com>
7390 Mikolaj Zalewski <mikolajz@google.com>
7391
7392 * gold.h (reserve_unordered_map): Define, three versions, one for
7393 each version of Unordered_map.
7394 * layout.cc (Layout::Layout): Remove options parameter. Add
7395 number_of_input_files parameter. Don't initialize options_.
7396 Initialize number_of_input_files_ and resized_signatures_. Move
7397 sections_are_attached_.
7398 (Layout::layout_group): Reserve space for group_signatures_.
7399 (Layout::find_or_add_kept_section): Change name parameter to be a
7400 reference. Resize signatures_ map when it gets large enough.
7401 (Layout::layout_eh_frame): Use parameters->options() instead of
7402 this->options_.
7403 (Layout::make_output_section): Likewise.
7404 (Layout::attach_allocated_section_to_segment): Likewise.
7405 (Layout::finalize, Layout::create_executable_stack): Likewise.
7406 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
7407 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
7408 * layout.h (class Layout): Update declarations. Remove options_
7409 field. Add number_of_input_files_ and resized_signatures_
7410 fields. Move sections_are_attached_ field.
7411 * main.cc (main): Pass number of input files to Layout
7412 constructor. Don't pass options.
7413
154b857c
ILT
74142009-03-30 Ian Lance Taylor <iant@google.com>
7415
7416 * ffsll.c (ffsll): Correct implementation.
7417
2f35ab9b
ILT
74182009-03-27 Ian Lance Taylor <iant@google.com>
7419
fd03461a
ILT
7420 * ffsll.c: New file.
7421 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
7422 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
7423 * ftruncate.c (ftruncate): Declare before definition.
7424 * mremap.c (mremap): Likewise.
7425 * pread.c (pread): Likewise.
7426 * configure, Makefile.in, config.in: Rebuild.
7427
2f35ab9b
ILT
7428 * mremap.c: New file.
7429 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
7430 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
7431 (mremap): Declare if HAVE_MREMAP is not defined.
7432 * configure, Makefile.in, config.in: Rebuild.
7433
33aea2fd
CC
74342009-03-27 Cary Coutant <ccoutant@google.com>
7435
7436 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
7437 position independent.
7438 * sparc.cc (Target_sparc::check_non_pic): Likewise.
7439 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
7440
6d479619
CC
74412009-03-24 Cary Coutant <ccoutant@google.com>
7442
7443 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
7444 an executable.
7445 (needs_dynamic_reloc): Likewise.
7446
afc06bb8
ILT
74472009-03-24 Ian Lance Taylor <iant@google.com>
7448
7449 * yyscript.y (file_cmd): Recognize EXTERN.
7450 (extern_name_list, extern_name_list_body): New nonterminals.
7451 * script.cc (script_add_extern): Define.
7452 * script-c.h (script_add_extern): Declare.
7453
f6060a4d
ILT
74542009-03-24 Rafael Avila de Espindola <espindola@google.com>
7455
7456 * object.cc (is_elf_object): Define.
7457 * object.h (is_elf_object): Declare.
7458 * archive.cc (Archive::get_elf_object_for_member): Call
7459 is_elf_object.
33aea2fd 7460 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 7461
26736d8e
ILT
74622009-03-24 Elliott Hughes <enh@google.com>
7463
7464 * output.cc (Output_file::map_anonymous): Define.
7465 (Output_file::map): Use map_anonymous. If the regular mmap fails,
7466 try an anonymous one. Report the size if the mmap fails.
7467 * output.h (class Output_file): Declare map_anonymous.
7468
22fd9730
ILT
74692009-03-24 Ian Lance Taylor <iant@google.com>
7470
7471 * target-select.cc (instantiate_target): Don't acquire the lock if
7472 the instantiated_target_ field has already been set.
7473
cb010894
ILT
74742009-03-23 Ian Lance Taylor <iant@google.com>
7475
7f055c20
ILT
7476 * gold-threads.h (class Initialize_lock): Define.
7477 * gold-threads.cc (class Initialize_lock_once): Define.
7478 (initialize_lock_control): New static variable.
7479 (initialize_lock_pointer): New static variable.
7480 (initialize_lock_once): New static function.
7481 (Initialize_lock::Initialize_lock): Define.
7482 (Initialize_lock::initialize): Define.
7483 * target-select.h: Include "gold-threads.h".
7484 (class Target_selector): Add lock_ and initialize_lock_ fields.
7485 Don't define instantiate_target, just declare it.
7486 * target-select.cc (Target_selector::Target_selector): Initialize
7487 new fields.
7488 (Target_selector::instantiate_target): Define.
7489 * descriptors.h: Include "gold-threads.h".
7490 (class Descriptors): Add initialize_lock_ field.
7491 * descriptors.cc (Descriptors::Descriptors): Initialize new
7492 field.
7493 (Descriptors::open): Use initialize_lock_ field
7494 * errors.h (class Errors): Add initialize_lock_ field.
7495 * errors.cc (Errors::Errors): Initialize new field.
7496 (Errors::initialize_lock): Use initialize_lock_ field.
7497 * powerpc.cc (class Target_selector_powerpc): Remove
7498 instantiated_target_ field. In do_recognize call
7499 instantiate_target rather than do_instantiate_target. In
7500 do_instantiate_target just allocate a new target.
7501 * sparc.cc (class Target_selector_sparc): Likewise.
7502
36959681
ILT
7503 * freebsd.h: New file.
7504 * i386.cc: Include "freebsd.h".
7505 (Target_i386): Derive from Target_freebsd rather than
7506 Sized_target.
7507 (Target_selector_i386): Derive from Target_selector_freebsd rather
7508 than Target_selector.
7509 * x86_64.cc: Include "freebsd.h".
7510 (Target_x86_64): Derive from Target_freebsd rather than
7511 Sized_target.
7512 (Target_selector_x86_64): Derive from Target_selector_freebsd
7513 rather than Target_selector.
7514 * target.h (class Target): Add adjust_elf_header and
7515 do_adjust_elf_header.
7516 * output.cc (Output_file_header:: do_sized_write): Call target
7517 adjust_elf_header routine.
7518 * configure.tgt: Set targ_osabi.
7519 * configure.ac: Define GOLD_DEFAULT_OSABI.
7520 * parameters.cc (Parameters::default_target): Pass
7521 GOLD_DEFAULT_OSABI to select_target.
7522 * target-select.h (class Target_selector): Make instantiate_target
7523 protected rather than private.
7524 * Makefile.am (HFILES): Add freebsd.h.
7525 * configure, Makefile.in, config.in: Rebuild.
7526
cb010894
ILT
7527 * merge.cc (do_add_input_section): Correct pend value. Change
7528 message about last entry not being null terminated from error to
7529 warning.
7530
0e879927
ILT
75312009-03-20 Mikolaj Zalewski <mikolajz@google.com>
7532
7533 * incremental.cc: New file.
7534 * Makefile.am (CCFILES): Add incremental.cc.
7535 * Makefile.in: Rebuild.
7536
41105937
PP
75372009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
7538
7539 * layout.cc (Layout::output_section_name): Preserve names
7540 of '.note.' sections.
e1df38aa 7541
60439920
ILT
75422009-03-19 Ian Lance Taylor <iant@google.com>
7543
7544 * descriptors.cc (Descriptors::open): Check that the options are
7545 valid before using them.
7546
0d371ad3
ILT
75472009-03-18 Ian Lance Taylor <iant@google.com>
7548
7549 * script-sections.h: Include <list>.
7550 (class Script_sections): Change Sections_elements from std::vector
7551 to std::list. Typedef public Elements_iterator. Add
7552 orphan_section_placement_, data_segment_align_start_, and
7553 saw_data_segment_align_ fields. Remove data_segment_align_index_
7554 field.
7555 * script-sections.cc (class Orphan_section_placement): New class.
7556 (class Sections_element): Add virtual functions is_relro and
7557 orphan_section_init. Remove virtual function place_orphan_here.
7558 (class Output_section_definition): Add is_relro and
7559 orphan_section_init. Remove place_orphan_here.
7560 (class Orphan_output_section): Likewise.
7561 (Script_sections::Script_sections): Update for field changes.
7562 (Script_sections::data_segment_align): Set saw_data_segment_align_
7563 and data_segment_align_start_, not data_segment_align_index.
7564 (Script_sections::data_segment_relro_end): Check
7565 saw_data_segment_align_. Use data_segment_align_start_ rather
7566 than data_segment_align_index_.
7567 (Script_sections::place_orphan): Rewrite to use
7568 Orphan_section_placement.
7569
9201d894
ILT
75702009-03-17 Ian Lance Taylor <iant@google.com>
7571
9c5b8369
ILT
7572 * archive.cc (Archive::add_symbols): Check for a version attached
7573 to the symbol name in the archive map.
7574 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
7575 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
7576 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
7577 (ver_test_11.a): New target.
7578 * testsuite/Makefile.in: Rebuild.
7579
9201d894
ILT
7580 * configure.ac: Check for chsize and posix_fallocate. Replace
7581 ftruncate.
7582 * ftruncate.c: New file, from gnulib.
7583 * output.cc (posix_fallocate): Define dummy version if not
7584 HAVE_POSIX_FALLOCATE.
7585 (Output_file::map): Call posix_fallocate rather than lseek and
7586 write.
7587 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
7588 * configure, Makefile.in, config.in: Rebuild.
7589
ef4ab7a8 75902009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 7591
ef4ab7a8
PP
7592 * layout.h (Layout::create_note): Add section_name parameter.
7593 * layout.cc (Layout::create_note): Likewise.
7594 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 7595
8c500701
ILT
75962009-03-17 Ian Lance Taylor <iant@google.com>
7597
e85b18e1
ILT
7598 * descriptors.cc: Include "options.h".
7599 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
7600 (Descriptors::open): Always use O_CLOEXEC when opening a new
7601 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
7602 then set FD_CLOEXEC.
7603
9efe6174
ILT
7604 * sparc.cc (class Target_sparc): Add has_got_section.
7605 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
7606 make sure we have a GOT section.
7607
7608 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
7609 (Target_sparc::Scan::local): Likewise.
7610 (Target_sparc::Scan::global): Likewise.
7611 (Target_sparc::Relocate::relocate): Likewise.
7612 (Target_sparc::Relocate::relocate_tls): Likewise.
7613
8c500701
ILT
7614 * symtab.cc (Symbol_table::define_default_version): New function,
7615 broken out of add_from_object.
7616 (Symbol_table::add_from_object): Call define_default_version.
7617 (Symbol_table::define_special_symbol): Add resolve_oldsym
7618 parameter. Change all callers. If the version for a symbol comes
7619 from a version script, resolve it with the symbol with the same
7620 name with no version. Also add the symbol without a version if
7621 appropriate.
7622 (do_define_in_output_data): If resolving with oldsym, don't delete
7623 sym.
7624 (do_define_in_output_segment): Likewise.
7625 (do_define_as_constant): Likewise.
7626 * symtab.h (class Symbol_table): Update declarations.
7627
f1ed28fb
ILT
76282009-03-13 Ian Lance Taylor <iant@google.com>
7629
15f8229b
ILT
7630 * readsyms.cc (Read_symbols::incompatible_warning): New function.
7631 (Read_symbols::requeue): New function.
7632 (Read_symbols::do_read_symbols): If make_elf_object fails because
7633 the target type is not configured, and the file was searched for,
7634 issue a warning and retry with the next directory.
7635 (Add_symbols::run): If the file has an incompatible format, and
7636 it was searched for, requeue the Read_symbols task. On error,
7637 release the object.
7638 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
7639 dirindex parameter to constructor. Change all callers. Declare
7640 incompatible_warning and requeue.
7641 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
7642 input_argument_ and input_group_ fields. Add them to
7643 constructor. Change all callers.
7644 (class Read_script): Add dirindex_ field. Add it to constructor.
7645 Change all callers.
7646 * archive.cc (Archive::setup): Remove input_objects parameter.
7647 Change all callers.
7648 (Archive::get_file_and_offset): Likewise.
7649 (Archive::read_all_symbols): Likewise.
7650 (Archive::read_symbols): Likewise.
7651 (Archive::get_elf_object_for_member): Remove input_objects
7652 parameter. Add punconfigured parameter. Change all callers.
7653 (Archive::add_symbols): Change return type to bool. Check return
7654 value of include_member.
7655 (Archive::include_all_members): Likewise.
7656 (Archive::include_member): Change return type to bool. Return
7657 false if first included object has incompatible target. Set
7658 included_member_ field.
7659 (Add_archive_symbols::run): If add_symbols returns false, requeue
7660 Read_symbols task.
7661 * archive.h (class Archive): Add included_member_ field.
7662 Initialize it in constructor. Add input_file and searched_for
7663 methods. Update declarations.
7664 (class Add_archive_symbols): Add dirpath_, dirindex_, and
7665 input_argument_ fields. Add them to constructor. Change all
7666 callers.
7667 * script.cc: Include "target-select.h".
7668 (class Parser_closure): Add skip_on_incompatible_target_ and
7669 found_incompatible_target_ fields. Add
7670 skip_on_incompatible_target parameter to constructor. Change all
7671 callers. Add methods skip_on_incompatible_target,
7672 clear_skip_on_incompatible_target, found_incompatible_target, and
7673 set_found_incompatible_target.
7674 (read_input_script): Add dirindex parameter. Change all callers.
7675 If parser finds an incompatible target, requeue Read_symbols
7676 task.
7677 (script_set_symbol): Clear skip_on_incompatible_target in
7678 closure.
7679 (script_add_assertion, script_parse_option): Likewise.
7680 (script_start_sections, script_add_phdr): Likewise.
7681 (script_check_output_format): New function.
7682 * script.h (read_input_script): Update declaration.
7683 * script-c.h (script_check_output_format): Declare.
7684 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
7685 (ignore_cmd): Remove OUTPUT_FORMAT.
7686 * fileread.cc (Input_file::Input_file): Add explicit this.
7687 (Input_file::will_search_for): New function.
7688 (Input_file::open): Add pindex parameter. Change all callers.
7689 * fileread.h (class Input_file): Add input_file_argument method.
7690 Declare will_search_for. Update declarations.
7691 * object.cc (make_elf_object): Add punconfigured parameter.
7692 Change all callers.
7693 * object.h (class Object): Make input_file public. Add
7694 searched_for method.
7695 (make_elf_object): Update declaration.
7696 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
7697 restart search.
7698 * dirsearch.h (class Dirsearch): Update declaration.
7699 * options.h (class General_options): Add --warn-search-mismatch.
7700 * parameters.cc (Parameters::is_compatible_target): New function.
7701 * parameters.h (class Parameters): Declare is_compatible_target.
7702 * workqueue.cc (Workqueue::add_blocker): New function.
7703 * workqueue.h (class Workqueue): Declare add_blocker.
7704
f1ed28fb
ILT
7705 * fileread.cc (Input_file::open): Remove options parameter.
7706 Change all callers.
7707 (Input_file::open_binary): Likewise.
7708 * script.cc (read_input_script): Likewise.
7709 * readsyms.h (class Read_symbols): Remove options_ field. Remove
7710 options parameter from constructor. Change all callers.
7711 (class Read_script): Likewise.
7712 * fileread.h (class Input_file): Update declarations.
7713 * script.h (read_input_script): Update declaration.
7714
34dd024a
NC
77152009-03-10 Nick Clifton <nickc@redhat.com>
7716
7717 * po/es.po: New Spanish translation.
7718
6d71b17c
CC
77192009-03-06 Cary Coutant <ccoutant@google.com>
7720
7721 * options.cc (parse_short_option): Keep dash_z from registering itself.
7722
031cdbed
ILT
77232009-03-03 Ian Lance Taylor <iant@google.com>
7724
7725 PR 9918
7726 * target-reloc.h (relocate_section): Pass output_section to
7727 relocate.
7728 * i386.cc (Target_i386::should_apply_static_reloc): Add
7729 output_section parameter. Change all callers.
7730 (Target_i386::Relocate::relocate): Add output_section parameter.
7731 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7732 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
7733 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
7734 * testsuite/two_file_shared.sh: New script.
7735 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
7736 (check_DATA): Add two_file_shared.dbg.
7737 (two_file_shared.dbg): New target.
7738 * testsuite/Makefile.in: Rebuild.
7739
15d5fa16
ILT
77402009-03-01 Ian Lance Taylor <iant@google.com>
7741
7742 * configure.ac: Check for byteswap.h.
7743 * configure: Rebuild.
7744 * config.in: Rebuild.
7745
8a4c0b0d
ILT
77462009-03-01 Mikolaj Zalewski <mikolajz@google.com>
7747
7748 * layout.cc (Layout::find_or_add_kept_section): New function.
7749 (Layout::add_comdat): Removed.
7750 * layout.h (struct Kept_section): Move out of class Layout.
7751 Remove trailing underscores from field names. Add group_sections
7752 field. Rename group_ field to is_group. Change all uses.
7753 (class Layout): Declare find_or_add_kept_section, not add_comdat.
7754 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
7755 comdat_groups_ field.
7756 (Sized_relobj::include_section_group): Use
7757 find_or_add_kept_section and Kept_section::group_sections.
7758 (Sized_relobj::include_linkonce_section): Likewise.
7759 * object.cc (class Sized_relobj): Don't define Comdat_group or
7760 Comdat_group_table. Remove find_comdat_group and
7761 add_comdat_group. Remove comdat_groups_ field.
7762 * plugin.cc (include_comdat_group): Use
7763 Layout::find_or_add_kept_section.
7764
b4ecf66b
ILT
77652009-02-28 Ian Lance Taylor <iant@google.com>
7766
14359ca0
ILT
7767 * README: --gc-sections and map files are now supported. Document
7768 some build requirements.
7769
b4ecf66b
ILT
7770 PR 6992
7771 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
7772 relocatable link set the value of the section symbol to zero.
7773 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
7774 relocatable link don't include the section address in the local
7775 symbol value.
7776
0602e05a
ILT
77772009-02-27 Ian Lance Taylor <iant@google.com>
7778
fd9d194f
ILT
7779 PR 6811
7780 * options.h (class Search_directory): Add is_system_directory.
7781 (class General_options): Declare is_in_system_directory.
7782 * options.cc (get_relative_sysroot): Make static.
7783 (get_default_sysroot): Make static.
7784 (General_optoins::is_in_system_directory): New function.
7785 * fileread.cc (Input_file::is_in_system_directory): New function.
7786 * fileread.h (class Input_file): Declare is_in_system_directory.
7787 * object.h (class Object): Add is_in_system_directory.
7788 (class Input_objects): Remove system_library_directory_ field.
7789 * object.cc (Input_objects::add_object): Don't set
7790 system_library_directory_.
7791 (input_objects::found_in_system_library_directory): Remove.
7792 * symtab.cc (Symbol_table::write_globals): Remove input_objects
7793 parameter. Change all callers.
7794 (Symbol_table::sized_write_globals): Likewise.
7795 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
7796 Call Object::is_in_system_directory.
7797 * symtab.h (class Symbol_table): Update declarations.
7798
61edd21f
ILT
7799 PR 5990
7800 * descriptors.h (Open_descriptor): Add is_on_stack field.
7801 * descriptors.cc (Descriptors::open): If the descriptor is on the
7802 top of the stack, remove it. Initialize is_on_stack field.
7803 (Descriptors::release): Only add pod to stack if it is not on the
7804 stack already.
7805 (Descriptors::close_some_descriptor): Clear stack_next and
7806 is_on_stack fields.
7807
e29e076a
ILT
7808 PR 7091
7809 * output.cc (Output_section::find_starting_output_address): Rename
7810 from starting_output_address; add PADDR parameter; change return
7811 type.
7812 * output.h (class Output_section): Declare
7813 find_starting_output_address instead of starting_output_address.
7814 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
7815 section symbol for which we can't find a merge section.
7816
0602e05a
ILT
7817 PR 9836
7818 * symtab.cc (Symbol_table::add_from_object): If the visibility is
7819 hidden or internal, force the symbol to be local.
7820 * resolve.cc (Symbol::override_visibility): Define.
7821 (Symbol::override_base): Use override_visibility.
7822 (Symbol_table::resolve): Likewise.
7823 (Symbol::override_base_with_special): Likewise.
7824 (Symbol_table::override_with_special): If the visibility is hidden
7825 or internal, force the symbol to be local.
7826 * symtab.h (class Symbol): Add set_visibility and
7827 override_visibility.
7828 * testsuite/ver_test_1.sh: New file.
7829 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
7830 (check_DATA): Add ver_test_1.syms.
7831 (ver_test_1.syms): New target.
7832 * testsuite/Makefile.in: Rebuild.
7833
401a9a73
CC
78342009-02-25 Cary Coutant <ccoutant@google.com>
7835
7836 * layout.cc (Layout::choose_output_section): Don't rename sections
7837 when using a linker script that has a SECTIONS clause.
7838 * Makefile.in: Regenerate.
7839
7840 * testsuite/Makefile.am (script_test_5.sh): New test case.
7841 * testsuite/Makefile.in: Regenerate.
7842 * testsuite/script_test_5.cc: New file.
7843 * testsuite/script_test_5.sh: New file.
7844 * testsuite/script_test_5.t: New file.
7845
f488e4b0
CC
78462009-02-13 Rafael Avila de Espindola <espindola@google.com>
7847
7848 * archive.cc (Archive::include_member): Update calls to add_symbols.
7849 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
7850 the Layout argument.
7851 * dynobj.h (do_add_symbols): Add the Layout argument.
7852 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
7853 Layout argument.
7854 * object.h (Object::add_symbols): Add the Layout argument.
7855 (Object::do_add_symbols): Add the Layout argument.
7856 (Sized_relobj::do_add_symbols): Add the Layout argument.
7857 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
7858 Unify the two versions.
7859 (Add_plugin_symbols): Remove.
7860 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
7861 (Sized_pluginobj::do_add_symbols): Unify the two versions.
7862 (Add_plugin_symbols): Remove.
7863 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
7864 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
7865 (Add_symbols::run): Make it work with Pulginobj.
7866
89dd1680
ILT
78672009-02-06 Ian Lance Taylor <iant@google.com>
7868
7869 * object.cc (Sized_relobj::do_layout): Make info message start
7870 with lower case letter.
7871
266d0a74
ILT
78722009-02-06 Mikolaj Zalewski <mikolajz@google.com>
7873
602b464e
ILT
7874 * binary.cc: Fix file comment.
7875
266d0a74
ILT
7876 * options.h (enum Incremental_disposition): Define.
7877 (class General_options): Add new options: --incremental,
7878 --incremental_changed, --incremental_unchanged,
7879 --incremental_unknown. Add incremental_disposition_ and
7880 implicit_incremental_ fields.
7881 (General_options::incremental_disposition): New function.
7882 (class Position_dependent_options): Add incremental_disposition
7883 option.
7884 (Position_dependent_options::copy_from_options): Set incremental
7885 dispositions.
7886 * options.cc (General_options::parse_incremental_changed): New
7887 function.
7888 (General_options::parse_incremental_unchanged): New function.
7889 (General_options::parse_incremental_unknown): New function.
7890 (General_options::General_options): Initialize new fields
7891 incremental_disposition_ and implicit_incremental_.
7892 (General_options::finalize): Check for uasge of --incremental-*
7893 without --incremental.
7894
f073bbf7
CD
78952009-02-06 Chris Demetriou <cgd@google.com>
7896
7897 * gold.h (gold_undefined_symbol): Change to take only a Symbol
7898 pointer and to report location as the file name associated with
7899 the symbol.
7900 (gold_undefined_symbol_at_location): New function to replace the
7901 old gold_undefined_symbol functionality.
7902 * target-reloc.h (relocate_section): Update to use
7903 gold_undefined_symbol_at_location.
7904 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
7905 Call gold_undefined_symbol function rather than gold_error.
7906 * errors.h (Errors::undefined_symbol): Take location as a
7907 string, rather than calculating it from a relocation.
7908 * errors.cc (Errors::fatal): Print "fatal error:" before the
7909 formatted message.
7910 (Errors::error, Errors::error_at_location): Print "error: "
7911 before the formatted message.
7912 (Errors::undefined_symbol): Take location as a string, rather
7913 than calculating it from a relocation.
7914 (gold_undefined_symbol_at_location): New function akin to
7915 old gold_undefined_symbol, calculates location from relocation.
7916 (gold_undefined_symbol): Change to take only a Symbol pointer
7917 and to report location as the file name associated with the symbol.
7918 * testsuite/debug_msg.sh: Update for changed error messages.
7919 * testsuite/undef_symbol.sh: Likewise.
7920
8e94a90c
ILT
79212009-02-04 Duncan Sands <baldrick@free.fr>
7922
7923 PR 9812
7924 * reduced_debug_output.h
7925 (Output_reduced_debug_abbrev_section::failed): Use format for
7926 gold_warning.
7927 (Output_reduced_debug_info_section::faild): Likewise.
7928
88a0e15b
ILT
79292009-01-31 Mikolaj Zalewski <mikolajz@google.com>
7930
7931 * script.cc (Lazy_demangler): New class.
7932 (Version_script_info::get_symbol_version_helper): Demangle a
7933 symbol only once.
7934
5efc7cd2
CC
79352009-01-29 Cary Coutant <ccoutant@google.com>
7936
7937 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
7938 to __tls_get_addr.
7939 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7940
e0ebcf42
ILT
79412009-01-28 Ian Lance Taylor <iant@google.com>
7942
5efc7cd2 7943 * version.cc (version_string): Bump to 1.9.
75fe7426 7944
e0ebcf42
ILT
7945 * gold.h: Include <cstring> and <stdint.h>.
7946 * version.cc: Include <cstdio>.
7947 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
7948 warning.
7949 * reduced_debug_output.cc (insert_into_vector): Rename from
7950 Insert_into_vector; change all callers. Use Swap_unaligned to
7951 avoid aliasing issue; remove union since it is unnecessary.
7952
8e2813be 79532009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
7954
7955 * Makefile.am (CCFILES): Add gc.cc.
7956 (HFILES): Add gc.h.
7957 * Makefile.in: Regenerate.
7958 * gold.cc (Gc_runner): New class.
7959 (queue_initial_tasks): Call garbage collection related tasks
7960 when corresponding options are invoked.
7961 (queue_middle_gc_tasks): New function.
7962 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
7963 processed early before laying out sections during garbage collection.
7964 * gold.h (queue_middle_gc_tasks): New function.
7965 (is_prefix_of): Move from "layout.cc".
7966 * i386.cc (Target_i386::gc_process_relocs): New function.
7967 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
7968 * main.cc (main): Create object of class "Garbage_collection".
7969 * object.cc (Relobj::copy_symbols_data): New function.
7970 (Relobj::is_section_name_included): New function.
e1df38aa
NC
7971 (Sized_relobj::do_layout): Allow this function to be called twice
7972 during garbage collection and defer layout of section during the
6d03d481
ST
7973 first call.
7974 * object.h (Relobj::get_symbols_data): New function.
7975 (Relobj::is_section_name_included): New function.
7976 (Relobj::copy_symbols_data): New function.
7977 (Relobj::set_symbols_data): New function.
7978 (Relobj::get_relocs_data): New function.
7979 (Relobj::set_relocs_data): New function.
7980 (Relobj::is_output_section_offset_invalid): New pure virtual function.
7981 (Relobj::gc_process_relocs): New function.
7982 (Relobj::do_gc_process_relocs): New pure virtual function.
7983 (Relobj::sd_): New data member.
7984 (Sized_relobj::is_output_section_offset_invalid): New function.
7985 (Sized_relobj::do_gc_process_relocs): New function.
7986 * options.h (General_options::gc_sections): Modify to not be a no-op.
7987 (General_options::print_gc_sections): New option.
7988 * plugin.cc (Plugin_finish::run): Remove function call to
7989 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
7990 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
7991 * reloc.cc (Read_relocs::run): Add task to process relocs and
7992 determine unreferenced sections when doing garbage collection.
7993 (Gc_process_relocs): New class.
7994 (Sized_relobj::do_gc_process_relocs): New function.
7995 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
7996 sections that are garbage collected.
7997 * reloc.h (Gc_process_relocs): New class.
7998 * sparc.cc (Target_sparc::gc_process_relocs): New function.
7999 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8000 symbols whose corresponding sections are garbage collected.
8001 (Symbol_table::Symbol_table): Add new parameter for the garbage
8002 collection object.
8003 (Symbol_table::gc_mark_undef_symbols): New function.
8004 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8005 (Symbol_table::gc_mark_dyn_syms): New function.
8006 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8007 as garbage.
8008 (Symbol_table::add_from_object): Likewise.
8009 (Symbol_table::add_from_relobj): When building shared objects, do not
8010 treat externally visible symbols as garbage.
8011 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8012 table information for static and relocatable links.
8013 * symtab.h (Symbol_table::set_gc): New function.
8014 (Symbol_table::gc): New function.
8015 (Symbol_table::gc_mark_undef_symbols): New function.
8016 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8017 (Symbol_table::gc_mark_dyn_syms): New function.
8018 (Symbol_table::gc_): New data member.
e1df38aa 8019 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8020 function.
8021 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8022 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8023
3b293544
CF
80242009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8025
8026 * options.h (General_options::gc_sections): Define as a no-op for now.
8027 (General_options::no_keep_memory): Ditto.
8028 (General_options::Bshareable): Define.
8029 * options.cc (General_options::finalize): Honor -Bshareable.
8030
83d22aa8
AS
80312009-01-20 Andreas Schwab <schwab@suse.de>
8032
8033 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8034 read the value in the contents, since we don't use it. Use the
8035 template endianness when writing.
8036 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8037
cd536b21
AS
80382009-01-19 Andreas Schwab <schwab@suse.de>
8039
8040 * configure.tgt (powerpc64-*): Fix targ_obj.
8041
99e9a495
ILT
80422009-01-15 Ian Lance Taylor <iant@google.com>
8043
8044 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8045 local symbols when stripping all symbols.
8046
bbbfea06
CC
80472009-01-14 Cary Coutant <ccoutant@google.com>
8048
99e9a495 8049 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8050
0f7c0701
CC
80512009-01-14 Cary Coutant <ccoutant@google.com>
8052
8053 * archive.cc (Archive::get_elf_object_for_member): Remove call
8054 to File_read::claim_for_plugin.
8055 * descriptors.cc (Descriptors::open): Remove reference to
8056 is_claimed.
8057 (Descriptors::claim_for_plugin): Remove.
8058 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8059 (Descriptors::is_claimed): Remove.
8060 (claim_descriptor_for_plugin): Remove.
8061 * fileread.cc (File_read::claim_for_plugin): Remove.
8062 * fileread.h (File_read::claim_for_plugin): Remove.
8063 (File_read::descriptor): Reopen descriptor if necessary.
8064 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8065 (Plugin_manager::all_symbols_read): Add task parameter. Change
8066 all callers.
8067 (Plugin_manager::get_input_file): New function.
8068 (Plugin_manager::release_input_file): New function.
8069 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8070 corresponding data member.
8071 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8072 and pass to base constructor. Change all callers.
8073 (get_input_file, release_input_file): New functions.
8074 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8075 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8076 (Plugin_manager::all_symbols_read): Add task parameter.
8077 (Plugin_manager::get_input_file): New function.
8078 (Plugin_manager::release_input_file): New function.
8079 (Plugin_manager::task_): New data member.
8080 (Pluginobj::Pluginobj): Add filesize parameter.
8081 (Pluginobj::filename): New function.
8082 (Pluginobj::descriptor): New function.
8083 (Pluginobj::filesize): New function.
8084 (Pluginobj::filesize_): New data member.
8085 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8086 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8087 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8088
8089 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8090 with archive libraries.
8091 * testsuite/Makefile.in: Regenerate.
8092 * testsuite/plugin_test.c (struct sym_info): New type.
8093 (get_input_file, release_input_file): New static variables.
8094 (onload): Capture new transfer vector entries.
8095 (claim_file_hook): Stop reading at end of file according to filesize.
8096 Factor out parsing of readelf output into separate function.
8097 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8098 APIs and get the source file name from the symbol table. Convert
8099 source file name to corresponding object file name. Print info
8100 message when adding new input files.
8101 (parse_readelf_line): New function.
8102 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8103 * testsuite/plugin_test_2.sh: Likewise.
8104 * testsuite/plugin_test_3.sh: Likewise.
8105 * testsuite/plugin_test_4.sh: New test case.
8106
62a6d109
ILT
81072009-01-07 Ian Lance Taylor <iant@google.com>
8108
8109 * version.cc (version_string): Bump to 1.8.
8110
483620e8
CC
81112008-12-23 Cary Coutant <ccoutant@google.com>
8112
8113 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8114 * plugin.cc (Plugin_manager::finish): Rename as
8115 layout_deferred_objects. Move cleanup to separate function.
8116 (Plugin_manager::cleanup): New function.
8117 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8118 separately.
8119 * plugin.h (Plugin_manager::finish): Rename as
8120 layout_deferred_objects.
8121 (Plugin_manager::cleanup): New function.
8122 (Plugin_manager::cleanup_done): New field.
8123
d66a9eb3
CC
81242008-12-23 Cary Coutant <ccoutant@google.com>
8125
8126 * plugin.cc (is_visible_from_outside): New function.
8127 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8128 so we don't return "IR only" status for exported symbols or -r links.
8129
8130 * testsuite/Makefile.am (plugin_test_3): New test case.
8131 * testsuite/Makefile.in: Regenerate.
8132 * testsuite/plugin_test_3.sh: New file.
8133
5995b570
CC
81342008-12-22 Cary Coutant <ccoutant@google.com>
8135
8136 * object.cc (Sized_relobj::layout_section): New function.
8137 (Sized_relobj::do_layout): Defer layout of input sections until after
8138 plugin has provided replacement files.
8139 (Sized_relobj::do_layout_deferred_sections): New function.
8140 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8141 (Relobj::layout_deferred_sections): New function.
8142 (Relobj::do_layout_deferred_sections): New function.
8143 (Sized_relobj::do_layout_deferred_sections): New function.
8144 (Sized_relobj::layout_section): New function.
8145 (Sized_relobj::Deferred_layout): New structure.
8146 (Sized_relobj::deferred_layout_): New field.
8147 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8148 Change all callers. Layout deferred sections.
8149 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8150 references.
8151 (Plugin_hook::run): Move code from do_plugin_hook inline.
8152 (Plugin_hook::do_plugin_hook): Remove.
8153 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8154 (Plugin_manager::finish): Renamed, was cleanup.
8155 (Plugin_manager::should_defer_layout): New function.
8156 (Plugin_manager::add_deferred_layout_object): New function.
8157 (Plugin_manager::Deferred_layout_list): New type.
8158 (Plugin_manager::deferred_layout_objects_): New field.
8159 (Plugin_hook::do_plugin_hook): Remove.
8160
ee769c88
ILT
81612008-12-17 Ian Lance Taylor <iant@google.com>
8162
8163 * options.h (class General_options): Add --no case for
8164 --export-dynamic.
8165
abc8dcba
CC
81662008-12-16 Cary Coutant <ccoutant@google.com>
8167
8168 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8169 vector.
8170 (Plugin_manager::claim_file): Create plugin object even if
8171 plugin did not call the add_symbols callback.
8172 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8173 asking for more symbols than were added.
8174 * testsuite/Makefile.am (plugin_test_1): Add test case with
8175 no global symbols.
8176 (empty.syms): New target.
8177 * testsuite/Makefile.in: Regenerate.
8178 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8179 message. Don't call add_symbols if no globals.
8180 (all_symbols_read_hook): Don't provide replacement for empty
8181 claimed file.
8182
b0074644
ILT
81832008-12-12 Ian Lance Taylor <iant@google.com>
8184
68943102
ILT
8185 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8186 r_type == 0 for a local symbol with r_sym == 0.
8187 (scan_relocatable_relocs): Pass r_sym to
8188 local_non_section_strategy.
8189 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8190 r_sym parameter.
8191
b0074644
ILT
8192 * configure.ac: Update test for TLS descriptors: they are
8193 supported as of glibc 2.9.
8194 * configure: Rebuild.
8195
c2508178
ILT
81962008-12-11 Ian Lance Taylor <iant@google.com>
8197
8198 PR 7091
8199 * target-reloc.h (Default_scan_relocatable_relocs): For each
8200 function, map r_type == 0 to RELOC_DISCARD.
8201
2756a258
CC
82022008-12-10 Cary Coutant <ccoutant@google.com>
8203
8204 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8205 object to override a kept COMDAT group from a plugin object.
8206
bb6f53d3
ILT
82072008-12-09 Ian Lance Taylor <iant@google.com>
8208
fbc558e1
ILT
8209 PR 7088
8210 * yyscript.y (file_cmd): Handle INPUT.
8211
bb6f53d3
ILT
8212 * testsuite/initpri1.c: Change all declarations to be full
8213 prototypes by adding void, to avoid compiler warnings.
8214
4674ecfc
CC
82152008-12-05 Rafael Avila de Espindola <espindola@google.com>
8216
8217 * options.cc (General_options::parse_plugin_opt): New.
8218 (General_options::add_plugin): The argument now is just the filename.
8219 (General_options::add_plugin_option): New.
8220 * options.h (plugin_opt): New.
8221 (add_plugin): Change argument name.
8222 (add_plugin_option): New.
8223 * plugin.cc (Plugin::load): Don't parse the plugin option.
8224 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8225 (Plugin::add_option): New.
8226 (Plugin::args_): Change type.
8227 (Plugin::filename_): New.
8228 (Plugin_manager::add_plugin_option): New.
8229 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8230 * testsuite/Makefile.in: Regenerate.
8231
fd06b4aa
CC
82322008-12-05 Cary Coutant <ccoutant@google.com>
8233
8234 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8235 Handle --strip-lto-sections option.
8236 * options.h (strip_lto_sections): New option.
8237
6c52134c
CC
82382008-12-01 Cary Coutant <ccoutant@google.com>
8239
8240 * plugin.cc (ld_plugin_message): Change format parameter to const.
8241 Fix mismatch between new[] and delete.
8242
a45248e0
CC
82432008-11-14 Cary Coutant <ccoutant@google.com>
8244
8245 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
8246 instead of -1U.
8247
c82fbeee
CS
82482008-11-05 Craig Silverstein <csilvers@google.com>
8249
8250 * options.cc (General_options::parse_dynamic_list): New function.
8251 * options.h (General_options): New flags dynamic_list,
8252 dynamic_list_data, dynamic_list_cpp_new, and
8253 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
8254 (General_options::in_dynamic_list): New function.
8255 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
8256 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
8257 (Lex::can_continue_name): Likewise.
8258 (yylex): Likewise.
8259 (read_script_file): New parameter script_options.
8260 (read_dynamic_list): New function.
8261 (Script_options::define_dynamic_list): New function.
8262 (dynamic_list_keyword_parsecodes): New variable.
8263 (dynamic_list_keywords): New variable.
8264 * script.h (Script_options::define_dynamic_list): New function
8265 prototype.
8266 (read_dynamic_list): New function prototype.
8267 * symtab.cc (strprefix): New macro.
8268 (Symbol::should_add_dynsym_entry): Support dynamic_list,
8269 dynamic_list_data, dynamic_list_cpp_new, and
8270 dynamic_list_cpp_typeinfo.
8271 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
8272 (dynamic_list_expr): New rule.
8273 (dynamic_list_nodes): Likewise.
8274 (dynamic_list_node): Likewise.
8275 * testsuite/Makefile.am (dynamic_list): New test.
8276 * testsuite/Makefile.in: Regenerated.
8277 * testsuite/dynamic_list.t: New file.
8278 * testsuite/dynamic_list.sh: New file.
8279
e0bb29a5
CS
82802008-11-05 Craig Silverstein <csilvers@google.com>
8281
8282 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
8283 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
8284 (t11_last): Likewise.
8285 * testsuite/ver_test_6.c (main): Likewise.
8286
4e1e25e0
CC
82872008-10-07 Cary Coutant <ccoutant@google.com>
8288
8289 * options.c (General_options::finalize): Add check for -static and
8290 -shared.
8291 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
8292 is not empty.
8293
92f03fcb
CC
82942008-10-02 Cary Coutant <ccoutant@google.com>
8295
8296 * plugin.cc (make_sized_plugin_object): Fix conditional
8297 compilation to work when not all targets are enabled.
8298
fbd8a257
CC
82992008-09-29 Cary Coutant <ccoutant@google.com>
8300
8301 * archive.cc (Archive::get_file_and_offset): Use filename instead
8302 of name to get library path.
8303 (Archive::include_member): Unlock external member of a thin archive.
8304
8305 * testsuite/Makefile.am (TEST_AR): New variable.
8306 (thin_archive_test_1): New test.
8307 (thin_archive_test_2): New test.
81636b3f
CC
8308 * testsuite/Makefile.in: Regenerate.
8309 * testsuite/thin_archive_main.cc: New file.
8310 * testsuite/thin_archive_test_1.cc: New file.
8311 * testsuite/thin_archive_test_2.cc: New file.
8312 * testsuite/thin_archive_test_3.cc: New file.
8313 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 8314
eff45813
CC
83152008-09-29 Cary Coutant <ccoutant@google.com>
8316
8317 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
8318 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
8319 instead of -1U.
8320 (Sized_relobj::do_finalize_local_symbols): Likewise.
8321 (Sized_relobj::map_to_kept_section): Likewise.
8322 * object.h (Sized_relobj::invalid_address): New constant.
8323 (Sized_relobj::do_output_section_offset): Check for invalid_address
8324 and return -1ULL.
8325 * output.cc (Output_reloc::local_section_offset): Use constant
8326 invalid_address instead of -1U.
8327 (Output_reloc::get_address): Likewise.
8328 (Output_section::output_address): Change -1U to -1ULL.
8329 * output.h (Output_reloc::invalid_address): New constant.
8330 * reloc.cc (Sized_relobj::write_sections): Use constant
8331 invalid_address instead of -1U.
8332 (Sized_relobj::relocate_sections): Likewise.
8333 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
8334 values for merge sections.
8335 * target-reloc.h (relocate_for_relocatable): Use constant
8336 invalid_address instead of -1U.
8337
89fc3421
CC
83382008-09-19 Cary Coutant <ccoutant@google.com>
8339
8340 Add plugin functionality for link-time optimization (LTO).
8341 * configure.ac (plugins): Add --enable-plugins option.
8342 * configure: Regenerate.
8343 * config.in: Regenerate.
8344 * Makefile.am (LIBDL): New variable.
8345 (CCFILES): Add plugin.cc.
8346 (HFILES): Add plugin.h.
8347 (ldadd_var): Add LIBDL.
8348 * Makefile.in: Regenerate.
8349
8350 * archive.cc: Include "plugin.h".
8351 (Archive::setup): Don't preread archive symbols when using a plugin.
8352 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
8353 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
8354 files.
8355 (Archive::include_member): Add symbols from plugin objects.
8356 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
8357 * descriptors.cc (Descriptors::open): Check for file descriptors
8358 abandoned by plugins.
8359 (Descriptors::claim_for_plugin): New function.
8360 * descriptors.h (Descriptors::claim_for_plugin): New function.
8361 (Open_descriptor::is_claimed): New field.
8362 (claim_descriptor_for_plugin): New function.
8363 * fileread.cc (File_read::claim_for_plugin): New function.
8364 * fileread.h (File_read::claim_for_plugin): New function.
8365 (File_read::descriptor): New function.
8366 * gold.cc: Include "plugin.h".
8367 (queue_initial_tasks): Add task to call plugin hooks for generating
8368 new object files.
8369 * main.cc: Include "plugin.h".
8370 (main): Load plugin libraries.
8371 * object.h (Pluginobj): Declare.
8372 (Object::pluginobj): New function.
8373 (Object::do_pluginobj): New function.
8374 (Object::set_target): New function.
8375 * options.cc: Include "plugin.h".
8376 (General_options::parse_plugin): New function.
8377 (General_options::General_options): Initialize plugins_ field.
8378 (General_options::add_plugin): New function.
8379 * options.h (Plugin_manager): Declare.
8380 (General_options): Add --plugin option.
8381 (General_options::has_plugins): New function.
8382 (General_options::plugins): New function.
8383 (General_options::add_plugin): New function.
8384 (General_options::plugins_): New field.
8385 * plugin.cc: New file.
8386 * plugin.h: New file.
8387 * readsyms.cc: Include "plugin.h".
8388 (Read_symbols::do_read_symbols): Check for archive before checking
8389 for ELF file. Call plugin hooks to claim files.
8390 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
8391 from a real object file; force override when processing replacement
8392 files.
8393 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
8394 (Symbol::init_base_object): Likewise.
8395 (Symbol::init_base_output_data): Likewise.
8396 (Symbol::init_base_output_segment): Likewise.
8397 (Symbol::init_base_constant): Likewise.
8398 (Symbol::init_base_undefined): Likewise.
8399 (Symbol::output_section): Assert that object is not a plugin.
8400 (Symbol_table::add_from_pluginobj): New function.
8401 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
8402 undefined.
8403 (Symbol_table::sized_write_globals): Likewise.
8404 (Symbol_table::add_from_pluginobj): Instantiate template.
8405 * symtab.h (Sized_pluginobj): Declare.
8406 (Symbol::in_real_elf): New function.
8407 (Symbol::set_in_real_elf): New function.
8408 (Symbol::in_real_elf_): New field.
8409 (Symbol_table::add_from_pluginobj): New function.
8410
8411 * testsuite/Makefile.am (AM_CFLAGS): New variable.
8412 (LIBDL): New variable.
8413 (LDADD): Add LIBDL.
8414 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
8415 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
8416 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
8417 (MOSTLYCLEANFILES): Likewise.
8418 * testsuite/Makefile.in: Regenerate.
8419 * testsuite/plugin_test.c: New file.
8420 * testsuite/plugin_test_1.sh: New file.
8421 * testsuite/plugin_test_2.sh: New file.
8422
de31bda5
ILT
84232008-09-16 Ian Lance Taylor <iant@google.com>
8424
9c2d0ef9
ILT
8425 * target-reloc.h (relocate_section): Check whether a symbol is
8426 defined by the ABI before reporting an undefined symbol error.
8427 * target.h (Target::is_defined_by_abi): Make parameter const.
8428 (Target::do_is_defined_by_abi): Likewise.
8429 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
8430 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
8431 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
8432 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
8433 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
8434 * testsuite/Makefile.in: Rebuild.
8435
de31bda5
ILT
8436 * fileread.cc (make_view): Add casts to avoid warning.
8437
9fa33bee
AO
84382008-09-16 Alexandre Oliva <aoliva@redhat.com>
8439
8440 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
8441 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8442
183fd0e3
AO
84432008-09-16 Alexandre Oliva <aoliva@redhat.com>
8444
8445 * options.h (General_options::output_is_executable): New.
8446 (General_options::output_is_pie): New.
8447 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
8448 for shared libraries.
8449 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8450
7be8330a
CD
84512008-09-11 Chris Demetriou <cgd@google.com>
8452
8453 * options.h (origin): New -z option.
8454 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
8455 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
8456 in DT_FLAGS_1.
8457
a9caad02
CC
84582008-09-05 Cary Coutant <ccoutant@google.com>
8459
8460 * fileread.cc (File_read::make_view): Add check for attempt to map
8461 beyond end of file.
8462
ae6dce4d
CC
84632008-09-05 Cary Coutant <ccoutant@google.com>
8464
8465 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
8466 explicit instantiations.
8467
d7ab2a47
KVH
84682008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
8469
8470 PR gold/6858
8471 * options.cc (General_options::finalize): Allow undefined symbols
8472 in shlibs if linking -shared.
8473
8474 PR gold/6859
8475 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
8476 symbols as not needing a dynsym entry.
8477
1e52a9c1
CS
84782008-08-20 Craig Silverstein <csilvers@google.com>
8479
8480 * fileread.cc (File_read::open): Do not lock the file unless it
8481 was successfully opened.
8482
d85c80a3
CC
84832008-08-14 Cary Coutant <ccoutant@google.com>
8484
8485 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
8486 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
8487 * testsuite/tls_test.cc (struct int128): 128-bit struct
8488 for testing TLS relocs with non-zero addend.
8489 (v12): New TLS variable.
8490 (t12): New test.
8491 (t_last): Add check for v12.
8492 * testsuite/tls_test.h (t12): New function.
8493 * testsuite/tls_test_main.cc (thread_routine): Call new test.
8494
2d924fd9
ILT
84952008-08-13 Ian Lance Taylor <iant@google.com>
8496
8497 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
8498 set tls_segment_ or relro_segment_.
8499 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
8500 when appropriate.
8501 * output.h (Output_section::clear_is_relro): New function.
8502 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
8503 sections specially even when output_data_ is empty.
8504 (Output_segment::maximum_alignment): When first section is relro,
8505 only force alignment for PT_LOAD segments.
8506 * script.cc (script_data_segment_align): New function.
8507 (script_data_segment_relro_end): New function.
8508 * script-c.h (script_data_segment_align): Declare.
8509 (script_data_segment_relro_end): Declare.
8510 * script-sections.h (class Script_sections): Declare
8511 data_segment_align and data_segment_relro_end. Add fields
8512 segment_align_index_ and saw_relro_end_.
8513 * script-sections.cc (class Sections_element): Add set_is_relro
8514 virtual function. Add new bool* parameter to place_orphan_here.
8515 Add get_output_section virtual function.
8516 (class Output_section_definition): Add set_is_relro. Add new
8517 bool* parameter to place_orphan_here. Add get_output_section.
8518 Add is_relro_ field.
8519 (Output_section_definition::Output_section_definition): Initialize
8520 evaluated_address_, evaluated_load_address, evaluated_addralign_,
8521 and is_relro_ fields.
8522 (Output_section_definition::place_orphan_here): Add is_relro
8523 parameter.
8524 (Output_section_definition::set_section_addresses): Set relro for
8525 output section.
8526 (Output_section_definition::alternate_constraint): Likewise.
8527 (class Orphan_output_section): Add new bool* parameter to
8528 place_orphan_here. Add get_output_section.
8529 (Orphan_output_section::place_orphan_here): Add is_relro
8530 parameter.
8531 (Script_sections::Script_sections): Initialize
8532 data_segment_align_index_ and saw_relro_end_.
8533 (Script_sections::data_segment_align): New function.
8534 (Script_sections::data_segment_relro_end): New function.
8535 (Script_sections::place_orphan): Set or clear is_relro.
8536 (Script_sections::set_section_addresses): Force alignment of first
8537 TLS section.
8538 * yyscript.y (exp): Call script_data_segment_align and
8539 script_data_segment_relro_end.
8540 * testsuite/relro_script_test.t: New file.
8541 * testsuite/relro_test.cc (using_script): Declare.
8542 (t1, t2): Test using_script.
8543 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
8544 (relro_script_test_SOURCES): Define.
8545 (relro_script_test_DEPENDENCIES): Define.
8546 (relro_script_test_LDFLAGS): Define.
8547 (relro_script_test_LDADD): Define.
8548 (relro_script_test.so): New target.
8549 * testsuite/Makefile.in: Rebuild.
8550
f827c9a9
CC
85512008-08-06 Cary Coutant <ccoutant@google.com>
8552
8553 * archive.cc (Archive::total_archives, Archive::total_members)
8554 (Archive::total_members_loaded): New variables.
8555 (Archive::setup): Add parameter. Add option to preread
8556 archive symbols.
8557 (Archive::read_armap): Add counter.
8558 (Archive::get_file_and_offset): New function.
8559 (Archive::get_elf_object_for_member): New function.
8560 (Archive::read_all_symbols): New function.
8561 (Archive::read_symbols): New function.
8562 (Archive::add_symbols): Add counters.
8563 (Archive::include_all_members): Use armap to find members if it's
8564 already built.
8565 (Archive::include_member): Skip reading symbols if already read.
8566 Factored code into Archive::get_file_and_offset and
8567 Archive::get_elf_object_for_member. Changed call to
8568 Mapfile::report_include_archive_member.
8569 (Archive::print_stats): New function.
8570 * archive.h: Declare Object and Read_symbols_data classes.
8571 (Archive::Archive): Add initializers for new members.
8572 (Archive::setup): Add parameter.
8573 (Archive::print_stats): New function.
8574 (Archive::total_archives, Archive::total_members)
8575 (Archive::total_members_loaded): New variables.
8576 (Archive::get_file_and_offset): New function.
8577 (Archive::get_elf_object_for_member): New function.
8578 (Archive::read_all_symbols): New function.
8579 (Archive::read_symbols): New function.
8580 (Archive::Archive_member): New class.
8581 (Archive::members_): New member.
8582 (Archive::num_members_): New member.
8583 * main.cc: Include archive.h.
8584 (main): Call Archive::print_stats.
8585 * mapfile.cc (Mapfile::report_include_archive_member): Delete
8586 archive parameter; member_name is now the fully-decorated name.
8587 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
8588 * options.h: (General_options): Add --preread-archive-symbols option.
8589 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
8590 Archive::setup.
8591
de4c45bd
ILT
85922008-08-04 Ian Lance Taylor <iant@google.com>
8593
8594 * symtab.h (Symbol::use_plt_offset): New function.
8595 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
8596 * powerpc.cc (Relocate::relocate): Likewise.
8597 * sparc.cc (Relocate::relocate): Likewise.
8598 * x86_64.cc (Relocate::relocate): Likewise.
8599 * testsuite/weak_plt.sh: New test.
8600 * testsuite/weak_plt_main.cc: New test.
8601 * testsuite/weak_plt_shared.cc: New test.
8602 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
8603 (check_PROGRAMS): Add weak_plt.
8604 (check_DATA): Add weak_plt_shared.so.
8605 (weak_plt_main_pic.o, weak_plt): New targets.
8606 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
8607 * testsuite/Makefile.in: Rebuild.
8608
8609 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
8610 gcctestdir/ld.
8611 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
8612 * testsuite/Makefile.in: Rebuild.
8613
323ee3f4
AM
86142008-08-04 Alan Modra <amodra@bigpond.net.au>
8615
8616 * Makefile.am (POTFILES.in): Set LC_ALL=C.
8617 * Makefile.in: Regenerate.
8618 * po/POTFILES.in: Regenerate.
8619
7c07ecec
ILT
86202008-07-29 Ian Lance Taylor <iant@google.com>
8621
8622 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
8623 symbols before other symbols.
8624 * testsuite/script_test_2.cc (test_addr): Declare.
8625 (test_addr_alias): Declare.
8626 (main): Check that test_addr and test_addr_alias have the right
cd536b21 8627 values.
7c07ecec
ILT
8628 * testsuite/script_test_2.t: Define test_addr_alias and
8629 test_addr.
8630
5778530e
ILT
86312008-07-24 Ian Lance Taylor <iant@google.com>
8632
2a00e4fb
ILT
8633 PR 5990
8634 * descriptors.cc: New file.
8635 * descriptors.h: New file.
8636 * gold-threads.h (class Hold_optional_lock): New class.
8637 * fileread.cc: Include "descriptors.h".
8638 (File_read::~File_read): Release descriptor rather than closing
8639 it.
8640 (File_read::open) [file]: Call open_descriptor rather than open.
8641 Set is_descriptor_opened_.
8642 (File_read::open) [memory]: Assert that descriptor is not open.
8643 (File_read::reopen_descriptor): New function.
8644 (File_read::release): Release descriptor.
8645 (File_read::do_read): Make non-const. Reopen descriptor.
8646 (File_read::read): Make non-const.
8647 (File_read::make_view): Reopen descriptor.
8648 (File_read::do_readv): Likewise.
8649 * fileread.h (class File_read): Add is_descriptor_opened_ field.
8650 Update declarations.
8651 * layout.cc: Include "descriptors.h".
8652 (Layout::create_build_id): Use open_descriptor rather than open.
8653 * output.cc: Include "descriptors.h".
8654 (Output_file::open): Use open_descriptor rather than open.
8655 * archive.cc (Archive::const_iterator): Change Archive to be
8656 non-const.
8657 (Archive::begin, Archive::end): Make non-const.
8658 (Archive::count_members): Likewise.
8659 * archive.h (class Archive): Update declarations.
8660 * object.h (Object::read): Make non-const.
8661 * Makefile.am (CCFILES): Add descriptors.cc.
8662 (HFILES): Add descriptors.h.
8663 * Makefile.in: Rebuild.
8664
801647d1
ILT
8665 PR 6716
8666 * gold.h: Always include <clocale>. Add Solaris workarounds
8667 following code in binutils/sysdep.h.
8668
5edd166e
ILT
8669 PR 6048
8670 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
8671 this->eh_frame_hdr_ is NULL before using it.
8672
c89ad728
ILT
8673 * dynobj.cc (Versions::Versions): Update comment.
8674
aa86f06b
ILT
8675 * dynobj.cc (Versions::Versions): If there is an soname, use it as
8676 the base version name.
8677
5778530e
ILT
8678 * stringpool.cc (Stringpool_template::add_with_length): Set key to
8679 array size plus one.
8680 (Stringpool_template::set_string_offsets): Subtract one from key
8681 before using it as an array index.
8682 (Stringpool_template::get_offset_with_length): Likewise.
8683 (Stringpool_template::write_to_buffer): Likewise.
8684 * stringpool.h (Stringpool_template::get_offset_from_key):
8685 Likewise.
8686
057ead22
ILT
86872008-07-23 Ian Lance Taylor <iant@google.com>
8688
7f649c59
ILT
8689 PR 6658
8690 * object.h (Merged_symbol_value::value): Do our best to handle a
8691 negative addend.
8692
057ead22
ILT
8693 PR 6647
8694 * script.cc (Version_script_info::get_versions): Don't add empty
8695 version tag to return value.
8696 (Version_script_info::get_symbol_version_helper): Change return
8697 type to bool. Add pversion parameter. Change all callers.
8698 (script_register_vers_node): Don't require a non-NULL tag.
8699 * script.h (class Version_script_info): Update declarations.
8700 (Version_script_info::get_symbol_version): Change return type to
8701 bool. Add version parameter. Change all callers.
8702 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
8703 handling. Handle an empty version from a version script.
8704 (Symbol_table::define_special_symbol): Likewise.
8705 * testsuite/ver_test_10.script: New file.
8706 * testsuite/ver_test_10.sh: New file.
8707 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
8708 (check_DATA): Add ver_test_10.syms.
8709 (ver_test_10.syms, ver_test_10.so): New target.
8710 * testsuite/Makefile.in: Rebuild.
8711
58e54ac2
CD
87122008-07-23 Simon Baldwin <simonb@google.com>
8713
8714 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
8715 to zero for undefined symbols from dynamic libraries.
8716
95d14cd3
ILT
87172008-07-23 Ian Lance Taylor <iant@google.com>
8718
8719 * symtab.cc (Symbol_table::resolve): Remove version parameter.
8720 Change all callers.
8721 * symtab.h (class Symbol_table): Update declaration.
8722 * testsuite/ver_test_9.cc: New file.
8723 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
8724 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
8725 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
8726 (ver_test_9.so, ver_test_9.o): New targets.
8727 * testsuite/Makefile.in: Rebuild.
8728
92de84a6
ILT
87292008-07-22 Ian Lance Taylor <iant@google.com>
8730
34810851
ILT
8731 * options.h (class General_options): Define --check-sections.
8732 * layout.cc (Layout::set_segment_offsets): Handle
8733 --check-sections.
8734
af6156ef
ILT
8735 * options.h (class General_options): Define -n/--nmagic and
8736 -N/--omagic.
8737 * options.cc (General_options::finalize): For -n/--nmagic or
8738 -N/--omagic, set -static.
8739 * layout.cc (Layout::attach_allocated_section_to_segment): If
8740 -N/--omagic, don't put read-only and read-write sections in
8741 different segments.
8742 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
8743 finding a read-only segment.
8744 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
8745 don't set the minimum segment alignment to the common page size,
8746 and don't set the file offset to the address modulo the page size.
8747 * script-sections.cc (Script_sections::create_segments): If
8748 -n/--omagic, don't put read-only and read-write sections in
8749 different segments.
8750
92de84a6
ILT
8751 * cref.cc: New file.
8752 * cref.h: New file.
8753 * options.h (class General_options): Add --print-symbol-counts.
8754 * main.cc (main): Issue defined symbol report if requested.
8755 * archive.cc (Archive::interpret_header): Make into a const member
8756 function.
8757 (Archive::add_symbols): Call Input_objects::archive_start and
8758 archive_stop.
8759 (Archive::const_iterator): Define new class.
8760 (Archive::begin, Archive::end): New functions.
8761 (Archive::include_all_members): Rewrite to use iterator.
8762 (Archive::count_members): New function.
8763 * archive.h (class Archive): Update declarations.
8764 (Archive::filename): New function.
8765 * object.cc: Include "cref.h".
8766 (Sized_relobj::Sized_relobj): Initialize defined_count_.
8767 (Sized_relobj::do_get_global_symbol_counts): New function.
8768 (Input_objects::add_object): Add object to cross-referencer.
8769 (Input_objects::archive_start): New function.
8770 (Input_objects::archive_stop): New function.
8771 (Input_objects::print_symbol_counts): New function.
8772 * object.h: Declare Cref and Archive.
8773 (Object::get_global_symbol_counts): New function.
8774 (Object::do_get_global_symbol_counts): New pure virtual function.
8775 (class Sized_relobj): Add defined_count_ field. Update
8776 declarations.
8777 (class Input_objects): Add cref_ field. Update constructor.
8778 Update declarations.
8779 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
8780 defined_count_.
8781 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
8782 symbol counts.
8783 (Sized_dynobj::do_get_global_symbol_counts): New function.
8784 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
8785 defined_count_. Update declarations. Define Symbols typedef.
8786 * symtab.cc (Symbol_table::add_from_relobj): Add defined
8787 parameter. Change all callers.
8788 (Symbol_table::add_from_dynobj): Add sympointers and defined
8789 parameters. Change all callers.
8790 * symtab.h (class Symbol_table): Update declarations.
8791 * Makefile.am (CCFILES): Add cref.cc.
8792 (HFILES): Add cref.h.
8793 * Makefile.in: Rebuild.
8794
3f7c5e1d
CD
87952008-07-22 Simon Baldwin <simonb@google.com>
8796
8797 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
8798 to zero when writing undefined symbols.
8799
e0b64032
ILT
88002008-07-22 Ian Lance Taylor <iant@google.com>
8801
8802 * output.cc (Output_section::add_input_section): Don't try to
8803 merge empty merge sections.
8804
096b02cf
CS
88052008-07-21 Craig Silverstein <csilvers@google.com>
8806
8807 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8808 Include symbol version in error message.
cd536b21 8809
1d1f116d
CD
88102008-07-20 Chris Demetriou <cgd@google.com>
8811
cd536b21 8812 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
8813 (RANDOM_SEED_CFLAGS): New substituted variable.
8814 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
8815 * configure: Rebuild.
8816 * Makefile.in: Likewise.
8817 * testsuite/Makefile.in: Likewise.
8818
a18f591e
ILT
88192008-07-18 Ian Lance Taylor <iant@google.com>
8820
8821 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
8822 where we see NAME/NULL and NAME/VERSION as separate symbols.
8823 * testsuite/ver_test_main.cc (main): Call t4.
8824 (t4, t4_2a): Define.
8825 * testsuite/ver_test_2.cc (t4_2): Define.
8826 * testsuite/ver_test_2.script: Put t4_2a in VER2.
8827 * testsuite/ver_test_4.cc (t4_2a): Define.
8828 * testsuite/ver_test_4.script: Put t4_2a in VER2.
8829 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
8830
c6e3f6ed
ILT
88312008-07-17 Ian Lance Taylor <iant@google.com>
8832
8833 * dynobj.cc (Versions::add_def): If we give an error about a
8834 missing version, go ahead and create the version anyhow.
8835
ef9beddf
ILT
88362008-07-10 Ian Lance Taylor <iant@google.com>
8837
8838 Handle output sections with more than 0x7fffffff bytes.
8839 * object.h (class Relobj): Change map_to_output_ to
8840 output_sections_, and just keep a section pointer. Change all
8841 uses. Move comdat group support to Sized_relobj.
8842 (Relobj::is_section_specially_mapped): Remove.
8843 (Relobj::output_section): Remove poff parameter. Change all
8844 callers.
8845 (Relobj::output_section_offset): New function.
8846 (Relobj::set_section_offset): Rewrite.
8847 (Relobj::map_to_output): Remove.
8848 (Relobj::output_sections): New function.
8849 (Relobj::do_output_section_offset): New pure virtual function.
8850 (Relobj::do_set_section_offset): Likewise.
8851 (class Sized_relobj): Add section_offsets_ field. Add comdat
8852 group support from Relobj. Update declarations.
8853 (Sized_relobj::get_output_section_offset): New function.
8854 (Sized_relobj::do_output_section_offset): New function.
8855 (Sized_relobj::do_set_section_offset): New function.
8856 * object.cc (Relobj::output_section_address): Remove.
8857 (Sized_relobj::Sized_relobj): Initialize new fields.
8858 (Sized_relobj::include_section_group): Cast find_kept_object to
8859 Sized_relobj.
8860 (Sized_relobj::include_linkonce_section): Likewise.
8861 (Sized_relobj::do_layout): Use separate arrays for output section
8862 and output offset.
8863 (Sized_relobj::do_count_local_symbols): Change map_to_output to
8864 output_sections.
8865 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
8866 output_sections and section_offsets.
8867 (Sized_relobj::write_local_symbols): Likewise.
8868 (map_to_kept_section): Compute output address directly.
8869 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
8870 output_sections and section_offsets.
8871 (Sized_relobj::write_sections): Likewise.
8872 (Sized_relobj::relocate_sections): Likewise.
8873 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
8874 * output.h (class Output_reloc): Update declarations. Change
8875 u2_.relobj to Sized_relobj*.
8876 (class Output_data_reloc): Change add functions to use
8877 Sized_relobj*.
8878 * output.cc (Output_reloc::Output_reloc): Change relobj to
8879 Sized_relobj*.
8880 (Output_reloc::local_section_offset): Change return type to
8881 Elf_Addr. Use get_output_section_offset.
8882 (Output_reloc::get_address): Likewise.
8883 (Output_section::is_input_address_mapped): Don't call
8884 is_section_specially_mapped.
8885 (Output_section::output_offset): Likewise.
8886 (Output_section::output_address): Likewise.
8887 (Output_section::starting_output_address): Likewise.
8888 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
8889 parameter to Sized_relobj*.
8890 (Copy_relocs::need_copy_reloc): Likewise.
8891 (Copy_relocs::save): Likewise.
8892 * copy-relocs.h (class Copy_relocs): Update declarations.
8893 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
8894 Sized_relobj*. Change relobj_ field to Sized_relobj*.
8895 * target-reloc.h (relocate_for_relocatable): Change
8896 offset_in_output_section type to Elf_Addr. Change code that uses
8897 it as well.
8898 * layout.cc (Layout::layout): Always set *off.
8899 * mapfile.cc (Mapfile::print_input_section): Use
8900 output_section_offset.
8901 * i386.cc (Target_i386::copy_reloc): Change object parameter to
8902 Sized_relobj*.
8903 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
8904 * sparc.cc (Target_sparc::copy_reloc): Likewise.
8905 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
8906
5cb66f97
ILT
89072008-07-03 Ian Lance Taylor <iant@google.com>
8908
8909 * layout.cc (Layout::include_section): Do not discard unrecognized
8910 SHT_STRTAB sections.
8911
afe47622
CS
89122008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
8913
8914 * script.cc (Lex::can_continue_name): Make '?' allowable in
8915 version-script names.
8916 * testsuite/version_script.map: Change glob pattern to use '?'
8917
5adf9721
ILT
89182008-06-30 Manish Singh <yosh@gimp.org>
8919
8920 PR 6585
8921 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
8922 Correct typo.
8923
e6fde208
ILT
89242008-06-30 Ian Lance Taylor <iant@google.com>
8925
8926 PR 6660
8927 PR 6682
8928 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
8929 versions]: Don't try to read the value in the contents, since we
8930 don't use it. Use the template endianness when writing.
8931
3f2e6a2d
CC
89322008-06-25 Cary Coutant <ccoutant@google.com>
8933
8934 * fileread.cc (File_read::make_view): Assert on zero-length view.
8935 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
8936 symbol table when there are no symbols to read.
8937
c43d3a48
CS
89382008-06-23 Craig Silverstein <csilvers@google.com>
8939
8940 * version.cc (version_string): Bump to 1.7
8941
5f494ea0
CS
89422008-06-18 Craig Silverstein <csilvers@google.com>
8943
8944 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
8945 constant 0xFFFF to type Valtype.
8946 (Powerpc_relocate_functions::rel16_ha): Likewise.
8947
c42e122e
ILT
89482008-06-17 Ian Lance Taylor <iant@google.com>
8949
f34787f8
ILT
8950 * output.h (Output_section::Input_section): Initialize p2align_ to
8951 zero for Output_section_data constructors.
8952 (Output_section::Input_section::addralign): If not an input
8953 section, return the alignment of the Output_section_data.
8954 * testsuite/copy_test.cc: New file.
8955 * testsuite/copy_test_1.cc: New file.
8956 * testsuite/copy_test_2.cc: New file.
8957 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
8958 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
8959 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
8960 (copy_test_1_pic.o, copy_test_1.so): New targets.
8961 (copy_test_2_pic.o, copy_test_2.so): New targets.
8962 * testsuite/Makefile.in: Rebuild.
8963
c42e122e
ILT
8964 * script-sections.cc (Script_sections::place_orphan): Initialize
8965 local variable exact.
8966
ce3ac18a
DE
89672008-06-13 David Edelsohn <edelsohn@gnu.org>
8968
8969 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
8970
42cacb20
DE
89712008-06-12 David Edelsohn <edelsohn@gnu.org>
8972 David S. Miller <davem@davemloft.net>
8973
8974 * powerpc.cc: New file.
8975 * Makefile.am (TARGETSOURCES): Add powerpc.cc
8976 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
8977 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
8978 * Makefile.in: Rebuild.
8979
7b308235
ILT
89802008-06-09 Ian Lance Taylor <iant@google.com>
8981
8982 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
8983 <exception>.
8984 (throwing, orig_terminate): New static variables.
8985 (terminate_handler): New static function.
8986 (t2): Set terminate handler.
8987
f0b886e3
ILT
89882008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
8989
8990 PR 6584
cd536b21 8991 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
8992 alignment.
8993
3e90f135
CC
89942008-05-30 Cary Coutant <ccoutant@google.com>
8995
8996 * archive.cc (Archive::include_all_members) Correct to step
8997 over symbol table and extended name table in thin archives.
8998
e09ad04a
ILT
89992008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9000
9001 PR 6407
9002 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9003 calculation.
9004
62b01cb5
ILT
90052008-05-28 Caleb Howe <cshowe@google.com>
9006
9007 * reduced_debug_output.cc: New file.
9008 * reduced_debug_output.h: New file.
92de84a6 9009 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9010 * options.cc (General_options::finalize): Add strip_debug_non_line
9011 to the strip heirarchy.
9012 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9013 fields.
9014 * layout.cc: Include "reduced_debug_output.h".
9015 (Layout::Layout): Initialize new fields.
9016 (line_only_debug_sections): New static array.
9017 (is_lines_only_debug_sections): New static inline function.
9018 (Layout::include_section): Handle --strip-debug-non-line.
9019 (Layout::make_output_section): If --strip-debug-non-line, build
9020 new output sections for .debug_abbrev and .debug_info.
9021 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9022 gold. Warn about possible overflow.
9023 (read_signed_LEB_128): Likewise.
9024 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9025 (read_signed_LEB_128): Declare.
9026 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9027 (HFILES): Add reduced_debug_output.h.
9028 * Makefile.in: Rebuild.
9029
7d9e3d98
ILT
90302008-05-21 Ian Lance Taylor <iant@google.com>
9031
9032 * mapfile.cc: New file.
9033 * mapfile.h: New file.
9034 * options.h (class General_options): Add -M/--print-map and -Map.
9035 * options.cc (General_options::finalize): Make -M equivalent to
9036 -Map -.
9037 * main.cc: Include <cstdio> and "mapfile.h".
9038 (main): Open mapfile if requested.
9039 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9040 constructor. Change caller.
9041 (queue_initial_tasks): Add mapfile parameter. Change caller.
9042 (queue_middle_tasks): Likewise.
9043 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9044 declarations.
9045 * archive.cc: Include "mapfile.h".
9046 (Archive::add_symbols): Add mapfile parameter. Change all
9047 callers. Pass mapfile, symbol, and reason to include_member.
9048 (Archive::include_all_members): Add mapfile parameter. Change all
9049 callers.
9050 (Archive::include_member): Add mapfile, sym, and why parameters.
9051 Change all callers. Report inclusion to map file.
9052 * archive.h: Include "fileread.h".
9053 (class Archive): Update declarations.
9054 (Archive::file): New const method.
9055 (class Add_archive_symbols): Add mapfile_ field. Update
9056 constructor. Change all callers.
9057 * readsyms.h (class Read_symbols): Likewise.
9058 (class Finish_group): Likewise.
9059 (class Read_script): Likewise.
9060 * common.cc: Include "mapfile.h".
9061 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9062 all callers.
9063 (Symbol_table::do_allocate_commons): Likewise.
9064 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9065 symbol allocation to mapfile.
9066 * common.h (class Allocate_commons_task): Add mapfile_ field.
9067 Update constructor. Change all callers.
9068 * symtab.h (class Symbol_table): Update declarations.
9069 * layout.cc: Include "mapfile.h".
9070 (Layout_task_runner::run): Print information to mapfile.
9071 (Layout::create_gold_note): Change Output_data_fixed_space to
9072 Output_data_zero_fill.
9073 (Layout::create_build_id): Likewise.
9074 (Layout::print_to_mapfile): New function.
9075 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9076 constructor. Change caller.
9077 (class Layout): Declare print_to_mapfile.
9078 * output.cc (Output_section::Input_section::print_to_mapfile): New
9079 function.
9080 (Output_section::add_input_section): If producing a map, always
9081 add to input_sections_ list.
9082 (Output_section::do_print_to_mapfile): New function.
9083 (Output_segment::print_sections_to_mapfile): New function.
9084 (Output_segment::print_section_list_to_mapfile): New function.
9085 * output.h: Include "mapfile.h".
9086 (Output_data::print_to_mapfile): New function.
9087 (Output_data::do_print_to_mapfile): New virtual function.
9088 (Output_segment_headers::do_print_to_mapfile): New function.
9089 (Output_file_header::do_print_to_mapfile): New function.
9090 (Output_data_const::do_print_to_mapfile): New function.
9091 (class Output_data_const_buffer): Add map_name_ field. Update
9092 constructor. Change all callers. Add do_print_to_mapfile
9093 function.
9094 (class Output_data_fixed_space): Likewise.
9095 (class Output_data_space): Likewise.
9096 (class Output_data_zero_fill): New class.
9097 (Output_data_strtab::do_print_to_mapfile): New function.
9098 (Output_data_reloc_base::do_print_to_mapfile): New function.
9099 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9100 (Output_data_group::do_print_to_mapfile): New function.
9101 (Output_data_got::do_print_to_mapfile): New function.
9102 (Output_data_dynamic::do_print_to_mapfile): New function.
9103 (Output_symtab_xindex::do_print_to_mapfile): New function.
9104 (class Output_section): Declare do_print_to_mapflie. Declare
9105 print_to_mapfile in Input_section.
9106 (class Output_segment): Declare new functions.
9107 * object.h (Sized_relobj::symbol_count): New function.
9108 * script-sections.cc
9109 (Output_section_element_dot_assignment::set_section_addresses):
9110 Change Output_data_fixed_space to Output_data_zero_fill.
9111 (Output_data_expression::do_print_to_mapfile): New function.
9112 * script.cc (read_input_script): Add mapfile parameter. Change
9113 all callers.
9114 * script.h (read_input_script): Update declaration.
9115 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9116 (Eh_frame::do_print_to_mapfile): New function.
9117 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9118 (Output_merge_string::do_print_to_mapfile): New function.
9119 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9120 function.
9121 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9122 function.
9123 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9124 function.
9125 * Makefile.am (CCFILES): Add mapfile.cc.
9126 (HFILES): Add mapfile.h.
9127 * Makefile.in: Rebuild.
9128
9f1d377b
ILT
91292008-05-19 Ian Lance Taylor <iant@google.com>
9130
9131 * options.h (class General_options): Add -z relro.
9132 * layout.cc (Layout::Layout): Initialize relro_segment_.
9133 (Layout::add_output_section_data): Return the output section.
9134 (Layout::make_output_section): Rcognize relro sections and mark
9135 them appropriately.
9136 (Layout::attach_allocated_section_to_segment): Put relro sections
9137 in a PT_GNU_RELRO segment.
9138 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9139 section as relro.
9140 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9141 PT_TLS segments.
9142 (Layout::linkonce_mapping): Map d.rel.ro.local to
9143 .data.rel.ro.local.
9144 (Layout::output_section_name): Us .data.rel.ro.local for any
9145 section which begins with that.
9146 * layout.h (class Layout): Update add_output_section_data
9147 declaration. Add relro_segment_ field.
9148 * output.cc (Output_section::Output_section): Initialize is_relro_
9149 and is_relro_local_ fields.
9150 (Output_segment::add_output_section): Group relro sections.
9151 (Output_segment::is_first_section_relro): New function.
9152 (Output_segment::maximum_alignment): If there is a relro section,
9153 align the segment to the common page size.
9154 (Output_segment::set_section_addresses): Track whether we are
9155 looking at relro sections. If the last section is a relro
9156 section, align to the common page size.
9157 (Output_segment::set_section_list_addresses): Add in_relro
9158 parameter. Change all callers. Align to the page size when
9159 moving from relro to non-relro section.
9160 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9161 segment.
9162 * output.h (class Output_section): Add is_relro_ and
9163 is_relro_local_ fields.
9164 (Output_section::is_relro): New function.
9165 (Output_section::set_is_relro): New function.
9166 (Output_section::is_relro_local): New function.
9167 (Output_section::set_is_relro_local): New function.
9168 (class Output_segment): Update declarations.
9169 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9170 * sparc.cc (Target_sparc::got_section): Likewise.
9171 * x86_64.cc (Target_x86_64::got_section): Likewise.
9172 * testsuite/relro_test_main.cc: New file.
9173 * testsuite/relro_test.cc: New file.
9174 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9175 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9176 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9177 (relro_test.so, relro_test_pic.o): New targets.
9178 * testsuite/Makefile.in: Rebuild.
9179
a984ee1d
ILT
91802008-05-16 Ian Lance Taylor <iant@google.com>
9181
01676dcd
ILT
9182 * output.cc (Output_segment::add_output_section): Remove front
9183 parameter.
9184 * output.h (class Output_segment): Remove
9185 add_initial_output_section and overloaded add_output_section.
9186 Update declaration of remaining add_output_section.
9187 * layout.cc (Layout::create_interp): Call add_output_section
9188 rather than add_initial_output_section.
9189 (Layout::finish_dynamic_section): Likewise.
9190
497897f9
ILT
9191 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9192 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9193 know the dynamic type.
9194 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9195 field. Initialize it in constructor.
9196 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9197 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9198 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9199 reloc.
9200
a984ee1d
ILT
9201 * output.cc (Output_reloc::get_address): Change return type to
9202 Elf_Addr.
9203 * output.h (class Output_reloc): Update get_address declaration.
9204 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9205 for section addresses.
9206
55ba0940
ILT
92072008-05-09 Ian Lance Taylor <iant@google.com>
9208
9209 PR 6493
9210 * gold.cc (gold_nomem): Use return value of write.
9211
75517b77
ILT
92122008-05-08 Ian Lance Taylor <iant@google.com>
9213
9214 * symtab.c (Symbol::init_base_output_data): Add version
9215 parameter. Change all callers.
9216 (Symbol::init_base_output_segment): Likewise.
9217 (Symbol::init_base_constant): Likewise.
9218 (Symbol::init_base_undefined): Likewise.
9219 (Sized_symbol::init_output_data): Likewise.
9220 (Sized_symbol::init_output_segment): Likewise.
9221 (Sized_symbol::init_constant): Likewise.
9222 (Sized_symbol::init_undefined): Likewise.
9223 (Symbol_table::do_define_in_output_data): If the new symbol has a
9224 version, mark it as the default.
9225 (Symbol_table::do_define_in_output_segment): Likewise.
9226 (Symbol_table::do_define_as_constant): Likewise.
9227 * symtab.h (class Symbol): Update declarations.
9228 (class Sized_symbol): Likewise.
9229 * resolve.cc (Symbol::override_version): New function.
c42e122e 9230 (Symbol::override_base): Call override_version.
75517b77
ILT
9231 (Symbol::override_base_with_special): Likewise.
9232 * testsuite/ver_script_8.script: New file.
9233 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9234 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9235 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9236 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9237
f1f70eae
ILT
92382008-05-06 Ian Lance Taylor <iant@google.com>
9239
f3e9c5c5
ILT
9240 PR 6049
9241 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
9242 functions.
9243 (class General_options): Remove existing --undefined, and add
9244 --no-undefined instead. Add new --undefined as synonym for -u.
9245 * archive.cc (Archive::add_symbols): Check whether symbol was
9246 named with -u.
9247 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
9248 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
9249 all uses. Add IS_UNDEFINED. Update declarations to split
9250 different versions of init_base. Declare init_base_undefined.
9251 (Symbol::is_defined): Handle IS_UNDEFINED.
9252 (Symbol::is_undefined): Likewise.
9253 (Symbol::is_weak_undefined): Call is_undefined.
9254 (Symbol::is_absolute): Handle IS_CONSTANT.
9255 (class Sized_symbol): Update declarations to split different
9256 versions of init. Declare init_undefined.
9257 (class Symbol_table): Declare new functions.
9258 * symtab.cc (Symbol::init_base_object): Rename from init_base.
9259 Change all callers.
9260 (Symbol::init_base_output_data): Likewise.
9261 (Symbol::init_base_output_segment): Likewise.
9262 (Symbol::init_base_constant): Likewise.
9263 (Symbol::init_base_undefined): New function.
9264 (Sized_symbol::init_object): Rename from init. Change all
9265 callers.
9266 (Sized_symbol::init_output_data): Likewise.
9267 (Sized_symbol::init_output_segment): Likewise.
9268 (Sized_symbol::init_constant): Likewise.
9269 (Sized_symbol::init_undefined): New function.
9270 (Symbol_table::add_undefined_symbols_from_command_line): New
9271 function.
9272 (Symbol_table::do_add_undefined_symbols_from_command_line): New
9273 function.
9274 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
9275 (Symbol::output_section): Likewise.
9276 (Symbol::set_output_section): Likewise.
9277 (Symbol_table::sized_finalize_symbol): Likewise.
9278 (Symbol_table::sized_write_globals): Likewise.
9279 * resolve.cc (Symbol_table::should_override): Likewise.
9280 (Symbol::override_base_with_special): Likewise.
9281
8bdcdf2c
ILT
9282 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
9283 symbol, change it to have default visibility.
9284 * testsuite/protected_1.cc: New file.
9285 * testsuite/protected_2.cc: New file.
9286 * testsuite/protected_3.cc: New file.
9287 * testsuite/protected_main_1.cc: New file.
9288 * testsuite/protected_main_2.cc: New file.
9289 * testsuite/protected_main_3.cc: New file.
9290 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
9291 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
9292 (protected_1_LDFLAGS, protected_1_LDADD): Define.
9293 (protected_1.so): New target.
9294 (protected_1_pic.o, protected_2_pic.o): New targets.
9295 (protected_3_pic.o): New target.
9296 (check_PROGRAMS): Add protected_2.
9297 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
9298 (protected_2_LDFLAGS, protected_2_LDADD): Define.
9299 * testsuite/Makefile.in: Rebuild.
9300
2b706932
ILT
9301 * options.h (DEFINE_var): Add set_user_set_##varname__.
9302 (DEFINE_bool_alias): New macro.
9303 (class General_options): Define -Bstatic using DEFINE_bool_alias
9304 rather than DEFINE_special. Add --undefined as an alias for -z
9305 defs.
9306 * options.cc (General_options::parse_Bstatic): Remove.
9307
d82a5bcc
ILT
9308 * options.h (class General_options): Add --fatal-warnings.
9309 * main.cc (main): Implement --fatal-warnings.
9310 * errors.h (Errors::warning_count): New function.
9311
f1f70eae
ILT
9312 * options.h (class General_options): Add -Bsymbolic-functions.
9313 * symtab.h (Symbol::is_preemptible): Check for
9314 -Bsymbolic-functions.
9315
8825ac63
ILT
93162008-05-05 Ian Lance Taylor <iant@google.com>
9317
d98bc257
ILT
9318 * options.h (DEFINE_bool): For DASH_Z, create the negative option
9319 as noVARNAME rather than no-VARNAME.
9320 (class General_options): Add option -z combreloc.
9321 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
9322 get_address.
9323 (Output_reloc::sort_before) [SHT_REL]: New function.
9324 (Output_reloc::sort_before) [SHT_RELA]: New function.
9325 (class Output_data_reloc_base): Add sort_relocs_ field. Define
9326 Sort_relocs_comparison.
9327 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
9328 parameter. Change all callers.
9329 (Output_data_reloc::Output_data_reloc) [both versions]: Add
9330 sort_relocs parameter. Change all callers.
9331 * output.cc (Output_reloc::get_address): New function, broken out
9332 of write_rel.
9333 (Output_reloc::write_rel): Call it.
9334 (Output_reloc::compare): New function.
9335 (Output_data_reloc_base::do_write): Optionally sort relocs.
9336
60b2b4e7
ILT
9337 * configure.ac: If targ_extra_obj is set, link it in.
9338 * configure.tgt: Initialize all variables.
9339 (x86_64*): Set targ_extra_obj and targ_extra_size.
9340 * configure: Rebuild.
9341
8825ac63
ILT
9342 * object.cc (Sized_relobj::include_section_group): Adjust section
9343 indexes read from group data. Build vector to pass to
9344 layout_group.
9345 * layout.cc (Layout::layout_group): Add flags and shndxes
9346 parameters. Remove contents parameter. Change caller. Update
9347 explicit instantiations.
9348 * layout.h (class Layout): Update layout_group declaration.
9349 * output.cc (Output_data_group::Output_data_group): Add flags and
9350 input_shndxes parameters. Remove contents parameter. Change
9351 caller.
9352 (Output_data_group::do_write): Change input_sections_ to
9353 input_shndxes_.
9354 * output.h (class Output_data_group): Update constructor
9355 declaration. Rename input_sections_ to input_shndxes_.
9356 * testsuite/many_sections_test.cc: Add template.
9357
e94cf127
CC
93582008-04-30 Cary Coutant <ccoutant@google.com>
9359
4418b2d5
CC
9360 * target-reloc.h (relocate_section): Fix dead-pointer bug.
9361
e94cf127
CC
9362 * layout.cc (Layout::include_section): Refactored check for debug
9363 info section.
9364 (Layout::add_comdat): Add new parameters. Change type
9365 of signature parameter. Add object and shndx to signatures table.
9366 (Layout::find_kept_object): New function.
9367 * layout.h: Include <cstring>.
9368 (Layout::is_debug_info_section): New function.
9369 (Layout::add_comdat): Add new parameters.
9370 (Layout::find_kept_object): New function.
9371 (Layout::Kept_section): New struct.
9372 (Layout::Signatures): Change type of map range.
9373 * object.cc (Relobj::output_section_address): New function.
9374 (Sized_relobj::include_section_group): Add new parameters. Change
9375 calls to Layout::add_comdat. Change to build table of kept comdat
9376 groups and table mapping discarded sections to kept sections.
9377 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
9378 (Sized_relobj::do_layout): Change calls to include_section_group and
9379 include_linkonce_section.
9380 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
9381 value to zero when section is discarded.
9382 (Sized_relobj::map_to_kept_section): New function.
9383 * object.h (Relobj::output_section_address): New function.
9384 (Relobj::Comdat_group): New type.
9385 (Relobj::find_comdat_group): New function.
9386 (Relobj::Comdat_group_table): New type.
9387 (Relobj::Kept_comdat_section): New type.
9388 (Relobj::Kept_comdat_section_table): New type.
9389 (Relobj::add_comdat_group): New function.
9390 (Relobj::set_kept_comdat_section): New function.
9391 (Relobj::get_kept_comdat_section): New function.
9392 (Relobj::comdat_groups_): New field.
9393 (Relobj::kept_comdat_sections_): New field.
9394 (Symbol_value::input_value): Update comment.
9395 (Sized_relobj::map_to_kept_section) New function.
9396 (Sized_relobj::include_linkonce_section): Add new parameter.
9397 * target-reloc.h (Comdat_behavior): New type.
9398 (get_comdat_behavior): New function.
9399 (relocate_section): Add code to map a discarded section to the
9400 corresponding kept section when applying a relocation.
9401
e4e5049b
CS
94022008-04-30 Craig Silverstein <csilvers@google.com>
9403
9404 * dwarf_reader.cc (next_generation_count): New static var.
9405 (Addr2line_cache_entry): New struct.
9406 (addr2line_cache): New static var.
9407 (Dwarf_line_info::one_addr2line): Added caching.
9408 (Dwarf_line_info::clear_addr2line_cache): New function.
9409 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
9410 cache-size parameter.
9411 (Dwarf_line_info::one_addr2line_cache): New function.
9412 * symtab.cc (Symbol_table::detect_odr_violations): Pass
9413 new cache-size argument to one_addr2line(), and clear cache.
9414
d09e9154
CC
94152008-04-28 Cary Coutant <ccoutant@google.com>
9416
9417 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
9418 R_386_PC8 relocations.
9419
7ef73768
ILT
94202008-04-23 Ian Lance Taylor <iant@google.com>
9421
55438702
ILT
9422 * object.cc (Sized_relobj::include_section_group): Check for
9423 invalid section group.
9424
c165fb93
ILT
9425 * object.cc (make_elf_object): Correct test for 64-bit ELF file
9426 header size.
9427
7ef73768
ILT
9428 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
9429 than read for file header.
9430 * archive.cc (Archive::include_member): Likewise.
9431
6194aaab
L
94322008-04-23 Paolo Bonzini <bonzini@gnu.org>
9433
9434 * aclocal.m4: Regenerate.
9435 * configure: Regenerate.
9436
d491d34e
ILT
94372008-04-19 Ian Lance Taylor <iant@google.com>
9438
5ea2bac6
ILT
9439 * version.cc (version_string): Bump to 1.6.
9440
7bc3e21a
ILT
9441 * testsuite/Makefile.am (many_sections_r_test): New target.
9442 (many_sections_r_test_SOURCES): Remove.
9443 (many_sections_r_test_DEPENDENCIES): Remove.
9444 (many_sections_r_test_LDFLAGS): Remove.
9445 (many_sections_r_test_LDADD): Remove.
9446
7fcd3aa9
ILT
9447 * object.cc (Sized_relobj::do_add_symbols): Always pass
9448 local_symbol_count_ to add_from_relobj.
9449
4c94d6ae
ILT
9450 * testsuite/Makefile.am (many_sections_check.h): Only check one in
9451 every thousand variables.
9452 * testsuite/Makefile.in: Rebuild.
9453
d491d34e
ILT
9454 * object.cc (Xindex::initialize_symtab_xindex): New function.
9455 (Xindex::read_symtab_xindex): New function.
9456 (Xindex::sym_xindex_to_shndx): New function.
9457 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
9458 available.
9459 (Sized_relobj::do_initialize_xindex): New function.
9460 (Sized_relobj::do_read_symbols): Adjust section links.
9461 (Sized_relobj::symbol_section_and_value): Add is_ordinary
9462 parameter. Change all callers.
9463 (Sized_relobj::include_section_group): Adjust section links and
9464 symbol section indexes.
9465 (Sized_relobj::do_layout): Adjust section links.
9466 (Sized_relobj::do_count_local_symbols): Adjust section links and
9467 symbol section indexes.
9468 (Sized_relobj::do_finalize_local_symbols): Distinguish between
9469 ordinary and special symbols.
9470 (Sized_relobj::write_local_symbols): Add symtab_xindex and
9471 dynsym_xindex parameters. Change all callers. Adjust section
9472 links. Use SHN_XINDEX when needed.
9473 (Sized_relobj::get_symbol_location_info): Adjust section links.
9474 Don't get fooled by special symbols.
9475 * object.h (class Xindex): Define.
9476 (class Object): Add xindex_ parameter. Declare virtual functoin
9477 do_initialize_xindex.
9478 (Object::adjust_sym_shndx): New function.
9479 (Object::set_xindex): New protected function.
9480 (class Symbol_value): Add is_ordinary_shndx_ field.
9481 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
9482 (Symbol_value::value): Assert ordinary section.
9483 (Symbol_value::initialize_input_to_output_map): Likewise.
9484 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
9485 Change all callers.
9486 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
9487 all callers.
9488 (class Sized_relobj): Update declarations.
9489 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
9490 parameter. Change all callers.
9491 (Sized_relobj::adjust_shndx): New function.
9492 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
9493 field.
9494 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
9495 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
9496 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
9497 (Sized_dynobj::read_dynsym_section): Adjust section links.
9498 (Sized_dynobj::read_dynamic): Likewise.
9499 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
9500 section links.
9501 (Sized_dynobj::do_initialize_xindex): New function.
9502 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
9503 do_initialize_xindex.
9504 (Sized_dynobj::adjust_shndx): New function.
9505 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
9506 dynsym_xindex_ fields.
9507 (Layout::finalize): Add a call to set_section_indexes before
9508 creating the symtab sections.
9509 (Layout::set_section_indexes): Don't do anything if the section
9510 already has a section index.
9511 (Layout::create_symtab_sections): Add shnum parameter. Change
9512 caller. Create .symtab_shndx section if needed.
9513 (Layout::create_shdrs): Add shstrtab_section parameter. Change
9514 caller.
9515 (Layout::allocated_output_section_count): New function.
9516 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
9517 needed.
9518 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
9519 fields. Update declarations.
9520 (Layout::symtab_xindex): New function.
9521 (Layout::dynsym_xindex): New function.
9522 (class Write_symbols_task): Add layout_ field.
9523 (Write_symbols_task::Write_symbols_task): Add layout parameter.
9524 Change caller.
9525 * output.cc (Output_section_headers::Output_section_headers): Add
9526 shstrtab_section parameter. Change all callers.
9527 (Output_section_headers::do_sized_write): Store overflow values
9528 for section count and section string table section index in
9529 section header zero.
9530 (Output_file_header::do_sized_write): Check for overflow of
9531 section count and section string table section index.
9532 (Output_symtab_xindex::do_write): New function.
9533 (Output_symtab_xindex::endian_do_write): New function.
9534 * output.h (class Output_section_headers): Add shstrtab_section_.
9535 Update declarations.
9536 (class Output_symtab_xindex): Define.
9537 (Output_section::has_out_shndx): New function.
9538 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
9539 field.
9540 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
9541 Change all callers.
9542 (Sized_symbol::init): Likewise.
9543 (Symbol::output_section): Check for ordinary symbol.
9544 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
9545 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
9546 callers.
9547 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
9548 Change all callers. Simplify handling of symbols from sections
9549 not included in the link.
9550 (Symbol_table::add_from_dynobj): Handle ordinary symbol
9551 distinction.
9552 (Weak_alias_sorter::operator()): Assert that symbols are
9553 ordinary.
9554 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
9555 distinction.
9556 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
9557 parameters. Change all callers.
9558 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
9559 symbol distinction. Use SHN_XINDEX when needed.
9560 (Symbol_table::write_section_symbol): Add symtab_xindex
9561 parameter. Change all callers.
9562 (Symbol_table::sized_write_section_symbol): Likewise. Use
9563 SHN_XINDEX when needed.
9564 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
9565 declarations.
9566 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
9567 (Symbol::is_defined): Check is_ordinary.
9568 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
9569 (Symbol::is_absolute, Symbol::is_common): Likewise.
9570 (class Sized_symbol): Update declarations.
9571 (class Symbol_table): Update declarations.
9572 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
9573 parameters. Change all callers.
9574 (Sized_symbol::override): Likewise.
9575 (Symbol_table::override): Likewise.
9576 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
9577 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
9578 is_ordinary, and orig_st_shndx parameters. Change all callers.
9579 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
9580 to be in an ordinary section.
9581 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
9582 object and is_ordinary parameters. Change all callers.
9583 (Sized_dwarf_line_info::read_relocs): Add object parameter.
9584 Change all callers. Don't add undefined or non-ordinary symbols
9585 to reloc_map_.
9586 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
9587 Change all callers.
9588 * dwarf_reader.h (class Sized_dwarf_line_info): Update
9589 declarations.
9590 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
9591 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
9592 (Sized_relobj::relocate_sections): Likewise.
9593 * target-reloc.h (scan_relocs): Adjust section symbol index.
9594 (scan_relocatable_relocs): Likewise.
9595 * i386.cc (Scan::local): Check for ordinary symbols.
9596 * sparc.cc (Scan::local): Likewise.
9597 * x86_64.cc (Scan::local): Likewise.
9598 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
9599 to symbol_section_and_value.
9600 * testsuite/many_sections_test.cc: New file.
9601 * testsuite/Makefile.am (BUILT_SOURCES): Define.
9602 (check_PROGRAMS): Add many_sections_test.
9603 (many_sections_test_SOURCES): Define.
9604 (many_sections_test_DEPENDENCIES): Define.
9605 (many_sections_test_LDFLAGS): Define.
9606 (BUILT_SOURCES): Add many_sections_define.h.
9607 (many_sections_define.h): New target.
9608 (BUILT_SOURCES): Add many_sections_check.h.
9609 (many_sections_check.h): New target.
9610 (check_PROGRAMS): Add many_sections_r_test.
9611 (many_sections_r_test_SOURCES): Define.
9612 (many_sections_r_test_DEPENDENCIES): Define.
9613 (many_sections_r_test_LDFLAGS): Define.
9614 (many_sections_r_test_LDADD): Define.
9615 (many_sections_r_test.o): New target.
9616 * testsuite/Makefile.in: Rebuild.
9617
c5818ff1
CC
96182008-04-17 Cary Coutant <ccoutant@google.com>
9619
9620 * errors.cc (Errors::info): New function.
9621 (gold_info): New function.
9622 * errors.h (Errors::info): New function.
9623 * gold.h (gold_info): New function.
9624 * object.cc (Input_objects::add_object): Print trace output.
9625 * options.cc (options::parse_set): New function.
9626 (General_options::parse_wrap): Deleted.
9627 (General_options::General_options): Deleted initializer.
9628 * options.h (options::String_set): New typedef.
9629 (options::parse_set): New function.
9630 (DEFINE_set): New macro.
9631 (General_options::wrap): Changed to use DEFINE_set. Changed
9632 callers of any_wrap_symbols and is_wrap_symbol.
9633 (General_options::trace, General_options::trace_symbol):
9634 New options.
9635 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
9636 (General_options::wrap_symbols_): Deleted.
9637 * symtab.cc (Symbol_table::add_from_object): Print trace output.
9638
b5be4a7c
DM
96392008-04-17 David S. Miller <davem@davemloft.net>
9640
9641 * options.cc (General_options::parse_V): New function.
9642 * options.h: Add entries for -V and -Qy.
9643
155a0dd7
ILT
96442008-04-17 Ian Lance Taylor <iant@google.com>
9645
9646 * common.cc (Symbol_table::allocate_commons): Remove options
9647 parameter. Change caller.
9648 (Symbol_table::do_allocate_commons): Remove options parameter.
9649 Change caller. Just call do_allocate_commons_list twice.
9650 (Symbol_table::do_allocate_commons_list): New function, broken out
9651 of do_allocate_commons.
9652 * common.h (class Allocate_commons_task): Remove options_ field.
9653 Update constructor.
9654 * symtab.cc (Symbol_table::Symbol_table): Initialize
9655 tls_commons_.
9656 (Symbol_table::add_from_object): Put TLS common symbols on
9657 tls_commons_ list.
9658 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
9659 which are IN_OUTPUT_DATA.
9660 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
9661 allocate_commons and do_allocate_commons declarations. Declare
9662 do_allocate_commons_list.
9663 * gold.cc (queue_middle_tasks): Update creation of
9664 Allocate_commons_task to not pass options.
9665 * testsuite/Makefile.am (INCLUDES): Add -I.. .
9666 (TLS_TEST_C_FLAGS): New variable.
9667 (tls_test_c_pic.o): New target.
9668 (tls_test_shared.so): Link in tls_test_c_pic.o.
9669 (tls_test_c_pic_ie.o): New target.
9670 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
9671 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
9672 (tls_test_c.o): New target.
9673 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
9674 (tls_pic_test_LDADD): Likewise.
9675 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
9676 (tls_shared_gd_to_ie_test_LDADD): Likewise.
9677 (tls_test_c_gnu2.o): New target.
9678 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
9679 tls_test_c_gnu2.o.
9680 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
9681 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
9682 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
9683 * testsuite/tls_test.cc: Include "config.h".
9684 (t_last): Call t11_last.
9685 * testsuite/tls_test.h (t11, t11_last): Declare.
9686 * testsuite/tls_test_c.c: New file.
9687 * testsuite/tls_test_main.cc (thread_routine): Call t11.
9688 * configure.ac: Check for OpenMP support.
9689 * configure, config.in, Makefile.in: Rebuild.
9690 * testsuite/Makefile.in: Rebuild.
9691
edfbb029
CC
96922008-04-16 Cary Coutant <ccoutant@google.com>
9693
9694 * i386.cc (Target_i386::define_tls_base_symbol): New function.
9695 (Target_i386::tls_base_symbol_defined_): New field.
9696 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9697 (Target_i386::Scan::global): Likewise.
9698 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
9699 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
9700 (Target_x86_64::tls_base_symbol_defined_): New field.
9701 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9702 (Target_x86_64::Scan::global): Likewise.
9703
f3c69fca
CC
97042008-04-16 Cary Coutant <ccoutant@google.com>
9705
9706 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
9707 (Symbol::needs_plt_entry): Allow weak undefined symbols.
9708 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
9709 building shared libraries.
9710 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
9711 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
9712 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
9713 * testsuite/Makefile.in: Rebuild.
9714 * testsuite/weak_undef.h: New file.
9715 * testsuite/weak_undef_file1.cc: Add extra test cases.
9716 * testsuite/weak_undef_file2.cc: Likewise.
9717 * testsuite/weak_undef_test.cc: Likewise.
9718
7c414435
DM
97192008-04-16 David S. Miller <davem@davemloft.net>
9720
32b769e1
DM
9721 * sparc.cc (Target_sparc::Scan): Change from struct to class.
9722 Add issued_non_pic_error_ field. Declare check_non_pic.
9723 (Target_sparc::Scan::check_non_pic): New function.
9724 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
9725 (Target_sparc::Scan::global): Likewise.
9726
11936fb1
DM
9727 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
9728 * configure: Rebuild.
9729
7c414435
DM
9730 * options.h (DEFINE_enable): New macro.
9731 (new_dtags): New enable option.
9732 (initfirst, interpose, loadfltr, nodefaultlib,
9733 nodelete, nodlopen, nodump): New -z options.
9734 * layout.cc (Layout:finish_dynamic_section): If new
9735 dtags enabled, emit DT_RUNPATH. Also, emit a
9736 DT_FLAGS_1 containing any specified -z flags.
9737
85c7bf8b
ILT
97382008-04-16 Ian Lance Taylor <iant@google.com>
9739
12c0daef
ILT
9740 * copy-relocs.cc: New file.
9741 * copy-relocs.h: New file.
9742 * reloc.cc: Remove Copy_relocs code.
9743 * reloc.h: Likewise.
9744 * reloc-types.h (struct Reloc_types) [both versions]: Add
9745 get_reloc_addend_noerror.
9746 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
9747 variants of add_global which take an addend which must be zero.
9748 * i386.cc: Include "copy-relocs.h".
9749 (class Target_i386): Change type of copy_relocs_ to variable,
9750 update initializer.
9751 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
9752 Change all callers.
9753 (Target_i386::do_finalize_sections): Change handling of
9754 copy_relocs_.
9755 * sparc.cc: Include "copy-relocs.h".
9756 (class Target_sparc): Change type of copy_relocs_ to variable,
9757 update initializer.
9758 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
9759 Change all callers.
9760 (Target_sparc::do_finalize_sections): Change handling of
9761 copy_relocs_.
9762 * x86_64.cc: Include "copy-relocs.h".
9763 (class Target_x86_64): Change type of copy_relocs_ to variable,
9764 update initializer.
9765 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
9766 class. Change all callers.
9767 (Target_x86_64::do_finalize_sections): Change handling of
9768 copy_relocs_.
9769 * Makefile.am (CCFILES): Add copy-relocs.cc.
9770 (HFILES): Add copy-relocs.h.
9771
4f4995b6
ILT
9772 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
9773
85c7bf8b
ILT
9774 * testsuite/script_test_4.sh: Permit leading zeroes.
9775
4f2a9edd
ILT
97762008-04-15 Ian Lance Taylor <iant@google.com>
9777
e6188289
ILT
9778 * script-sections.cc (Script_sections::create_segments): Use
9779 header_size_adjustment even when there is enough room for the
9780 headers.
9781 * testsuite/script_test_4.sh: New file.
9782 * testsuite/script_test_4.t: New file.
9783 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
9784 (check_DATA): Add script_test_4.stdout.
9785 (MOSTLYCLEANFILES): Likewise.
9786 (script_test_4): New target.
9787 (script_test_4.stdout): New target.
9788 * testsuite/Makefile.in: Rebuild.
9789
4f2a9edd
ILT
9790 * sparc.cc: Add definitions for Output_data_plt_sparc class
9791 constants.
9792
f5314dd5
DM
97932008-04-14 David S. Miller <davem@davemloft.net>
9794
9795 * sparc.cc: New file.
9796 * Makefile.am (TARGETSOURCES): Add sparc.cc
9797 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
9798 * configure.tgt: Document targ_extra_size and
9799 targ_extra_big_endian. Add entries for sparc-* and
9800 sparc64-*.
9801 * configure.ac: Handle targ_extra_size and
9802 targ_extra_big_endian.
9803 * Makefile.in: Rebuild.
9804 * configure: Likewise.
9805 * po/POTFILES.in: Likewise.
9806 * po/gold.pot: Likewise.
9807
154e0e9a
ILT
98082008-04-14 Ian Lance Taylor <iant@google.com>
9809
9810 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
9811 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
9812 in the name/type/flags to section mapping. Don't call
9813 allocate_output_section.
9814 (Layout::choose_output_section): Change parameter from adjust_name
9815 to is_input_section. Don't permit input sections after sections
9816 are attached to segments. Don't call allocate_output_section.
9817 (Layout::layout_eh_frame): Call update_flags_for_input_section,
9818 not write_enable_output_section.
9819 (Layout::make_output_section): Don't push to
9820 unattached_section_list_ nor call attach_to_segment. Call
9821 attach_section_to_segment if sections are attached.
9822 (Layout::attach_sections_to_segments): New function.
9823 (Layout::attach_section_to_segment): New function.
9824 (Layout::attach_allocated_section_to_segment): Rename from
9825 attach_to_segment. Remove flags parameter.
9826 (Layout::allocate_output_section): Remove function.
9827 (Layout::write_enable_output_section): Remove function.
9828 * layout.h (class Layout): Update for above changes. Add new
9829 field sections_are_attached_.
9830 * output.h (Output_section::update_flags_for_input_section): New
9831 function.
9832 * output.cc (Output_section::add_input_section): Call
9833 update_flags_for_input_section.
9834 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
9835
009a67a2
CC
98362008-04-11 Cary Coutant <ccoutant@google.com>
9837
9838 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
9839 thought unnecessary.
9840 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
9841
759b1a24
ILT
98422008-04-11 Ian Lance Taylor <iant@google.com>
9843
9844 * output.h (class Output_section_data): Remove inline definition
9845 of set_addralign.
9846 * output.cc (Output_section_data::set_addralign): New function.
9847
c2b45e22
CC
98482008-04-11 Cary Coutant <ccoutant@google.com>
9849
9850 Add support for TLS descriptors for i386 and x86_64.
9851 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
9852 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
9853 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
9854 GOT_TYPE_TLS_DESC.
9855 (Target_i386::got_mod_index_entry): Remove unnecessary code.
9856 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
9857 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
9858 relocations.
9859 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
9860 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
9861 Fix problem with initial-exec relocations.
9862 (Target_i386::Relocate::relocate_tls): Likewise.
9863 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
9864 relaxation.
9865 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
9866 support for section-plus-offset dynamic table entries.
9867 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
9868 (Output_data_dynamic::Dynamic_entry): Add support for
9869 section-plus-offset dynamic table entries.
9870 (Output_data_dynamic::Classification): Likewise.
9871 (Output_data_dynamic::classification_): Renamed offset_.
9872 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
9873 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
9874 (Target_x86_64::make_plt_section): New function.
9875 (Target_x86_64::reserve_tlsdesc_entries): New function.
9876 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
9877 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
9878 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
9879 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
9880 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
9881 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
9882 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
9883 add extra PLT entry for TLS descriptors.
9884 (Output_data_plt_x86_64::got_): New field.
9885 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
9886 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
9887 fields.
9888 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
9889 descriptors.
9890 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
9891 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
9892 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
9893 R_386_TLS_DESC_CALL relocations.
9894 (Target_x86_64::Scan::global): Likewise.
9895 (Target_x86_64::do_finalize_sections): Add dynamic table entries
9896 for TLS descriptors.
9897 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
9898 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
9899 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
9900 GD-to-IE relaxation.
9901 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
9902 and TLS_DESCRIPTORS.
9903 * Makefile.in: Rebuild.
9904 * configure: Rebuild.
9905 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
9906 (tls_test_shared2.so): New target.
9907 (tls_shared_gd_to_ie_test_SOURCES): New variable.
9908 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
9909 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
9910 (tls_shared_gd_to_ie_test_LDADD): New variable.
9911 (tls_shared_gnu2_gd_to_ie_test): New target.
9912 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
9913 New targets.
9914 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
9915 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
9916 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
9917 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
9918 (tls_shared_gnu2_test): New target.
9919 (tls_test_gnu2_shared.so): New target.
9920 (tls_shared_gnu2_test_SOURCES): New variable.
9921 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
9922 (tls_shared_gnu2_test_LDFLAGS): New variable.
9923 (tls_shared_gnu2_test_LDADD): New variable.
9924 * testsuite/Makefile.in: Rebuild.
9925 * testsuite/Makefile.
9926
83bfb6b7
ILT
99272008-04-11 Ian Lance Taylor <iant@google.com>
9928
9929 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
9930 justsyms.t.
9931 * testsuite/Makefile.in: Rebuild.
9932
9933 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
9934 long.
9935 * testsuite/script_test_2.cc (main): Adjust test.
9936
706e1f5e
ILT
99372008-04-11 David S. Miller <davem@davemloft.net>
9938 Ian Lance Taylor <iant@google.com>
9939
9940 * options.h (General_options): Add entries for '-Y' and
9941 '-relax'.
9942 * options.cc (General_options:finalize): If -Y was used, add those
9943 entries to the library path instead of the default "/lib" and
9944 "/usr/lib".
9945
7c98e6bb
DM
99462008-04-11 David S. Miller <davem@davemloft.net>
9947
9948 * testsuite/justsyms.t: Start at 0x100.
9949 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
9950 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
9951 long.
9952 * testsuite/script_test_2.cc: Adjust string and section length
9953 checks.
7c98e6bb 9954
99a37bfd
ILT
99552008-04-09 Ian Lance Taylor <iant@google.com>
9956
2cefc357
ILT
9957 PR gold/5996
9958 * script-sections.cc (Sections_element::allocate_to_segment): Add
9959 orphan parameter.
9960 (Output_section_definition::allocate_to_segment): Likewise.
9961 (Orphan_output_section::allocate_to_segment): Likewise.
9962 (Script_sections::attach_sections_using_phdrs_clause): Don't
9963 propagate non-PT_LOAD segments to orphan sections.
9964 * testsuite/Makefile.am (script_test_3.stdout): Generate using
9965 readelf rather than objdump.
9966 * testsuite/script_test_3.sh: Adjust accordingly. Test that
9967 .interp section and PT_INTERP segment are the same size.
9968 * testsuite/Makefile.in: Rebuild.
9969
99a37bfd
ILT
9970 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
9971 aliases for symbols defined in the same object.
9972 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
9973 (weak_alias_test_SOURCES): New variable.
9974 (weak_alias_test_DEPENDENCIES): New variable.
9975 (weak_alias_test_LDFLAGS): New variable.
9976 (weak_alias_test_LDADD): New variable.
9977 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
9978 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
9979 (weak_alias_test_3.o): New target.
9980 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
9981 * testsuite/weak_alias_test_main.cc: New file.
9982 * testsuite/weak_alias_test_1.cc: New file.
9983 * testsuite/weak_alias_test_2.cc: New file.
9984 * testsuite/weak_alias_test_3.cc: New file.
9985
780e49c5
ILT
99862008-04-08 Ian Lance Taylor <iant@google.com>
9987
cdb0b8f5
ILT
9988 * options.h (class General_options): Add --noinhibit-exec option.
9989 * main.cc (main): Check --noinhibit-exec.
9990
0864d551
ILT
9991 * options.h (class General_options): Define --wrap as a special
9992 option. Add wrap_symbols_ field.
9993 (General_options::any_wrap_symbols): New function.
9994 (General_options::is_wrap_symbol): New function.
9995 * options.cc (General_options::parse_wrap): New function.
9996 (General_options::General_options): Initialize wrap_symbols_.
9997 * symtab.cc (Symbol_table::wrap_symbol): New function.
9998 (Symbol_table::add_from_object): Handle --wrap.
9999 * symtab.h (class Symbol_table): Declare wrap_symbol.
10000 * target.h (Target::wrap_char): New function.
10001 (Target::Target_info): Add wrap_char field.
10002 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10003 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10004 * testsuite/testfile.cc (Target_test::test_target_info):
10005 Likewise.
10006
789aa6de
ILT
10007 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10008 there is one.
10009
2c38906f
ILT
10010 * layout.h (class Layout): Add added_eh_frame_data_ field.
10011 * layout.cc (Layout::Layout): Initialize new field.
10012 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10013 output section until we find a section we merged successfully.
10014 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10015 that the size be non-zero.
10016
780e49c5
ILT
10017 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10018 qualifier.
10019
7fcd0256
ILT
100202008-04-08 Craig Silverstein <csilvers@google.com>
10021
10022 * configure.ac: Export new conditional variable HAVE_ZLIB.
10023 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10024 on HAVE_ZLIB.
10025 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10026 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10027
6835af53
ILT
100282008-04-07 Ian Lance Taylor <iant@google.com>
10029
e24f324c
ILT
10030 * version.cc (version_string): Set to "1.5".
10031
a036edd8
ILT
10032 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10033 Add issued_non_pic_error_ field. Declare check_non_pic.
10034 (Target_x86_64::Scan::check_non_pic): New function.
10035 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10036 (Target_x86_64::Scan::global): Likewise.
10037
624f8810
ILT
10038 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10039 addend parameter. Change caller. Handle merge sections.
10040 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10041 Address to Addend. Don't add in the result of
10042 local_section_offset, pass down the addend and use the returned
10043 value.
10044 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10045 Update declarations of local_section_offset and symbol_value.
10046 * testsuite/two_file_test_1.cc (t18): New function.
10047 * testsuite/two_file_test_2.cc (f18): New function.
10048 * testsuite/two_file_test_main.cc (main): Call t18.
10049 * testsuite/two_file_test.h (t18, f18): Declare.
10050
6835af53
ILT
10051 * configure.ac: Don't test for objdump, c++filt, or readelf.
10052 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10053 conditionals.
10054 (TEST_READELF): New variable.
10055 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10056 (check_PROGRAMS): Add two_file_strip_test.
10057 (two_file_strip_test): New target.
10058 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10059 (two_file_same_shared_strip_test_SOURCES): New variable.
10060 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10061 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10062 (two_file_same_shared_strip_test_LDADD): New variable.
10063 (two_file_shared_strip.so): New target.
10064 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10065 (ver_test_5.syms, ver_test_7.syms): Likewise.
10066 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10067 (strip_test_3.stdout): Use TEST_OBJDUMP.
10068 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10069
86925eef
CC
100702008-04-04 Cary Coutant <ccoutant@google.com>
10071
10072 * symtab.h (Symbol::is_weak_undefined): New function.
10073 (Symbol::is_strong_undefined): New function.
10074 (Symbol::is_absolute): New function.
10075 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10076 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10077 absolute symbols.
10078 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10079 (weak_undef_test): New target.
10080 * testsuite/Makefile.in: Rebuild.
10081 * testsuite/weak_undef_file1.cc: New file.
10082 * testsuite/weak_undef_file2.cc: New file.
10083 * testsuite/weak_undef_test.cc: New file.
10084
126f3ece
ILT
100852008-04-03 Craig Silverstein <csilvers@google.com>
10086
10087 * compressed_output.h (class Output_compressed_section): Use
10088 unsigned buffer.
10089 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10090 add zlib header.
10091 (zlib_compressed_suffix): Removed.
10092 (Output_compressed_section::set_final_data_size): Use unsigned
10093 buffers.
10094 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10095 Fix linker invocation.
10096 (flagstest_o_specialfile_and_compress_debug_sections):
10097 Likewise.
10098 * testsuite/Makefile.in: Regenerated.
10099
deae2a14
DM
101002008-04-02 David S. Miller <davem@davemloft.net>
10101
10102 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10103 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10104
70752818
ILT
101052008-04-02 Craig Silverstein <csilvers@google.com>
10106
10107 * TODO: New file.
10108
39d0cb0e
ILT
101092008-04-02 Ian Lance Taylor <iant@google.com>
10110
10111 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10112 parameters. Update for new key type to views_. Change all
10113 callers.
10114 (File_read::read): Adjust for byteshift in returned view.
10115 (File_read::add_view): New function, broken out of
10116 find_and_make_view.
10117 (File_read::make_view): New function, broken out of
10118 find_and_make_view.
10119 (File_read::find_or_make_view): Add offset and aligned
10120 parameters. Rewrite accordingly. Change all callers.
10121 (File_read::get_view): Add offset and aligned parameters. Adjust
10122 for byteshift in return value.
10123 (File_read::get_lasting_view): Likewise.
10124 * fileread.h (class File_read): Update declarations.
10125 (class File_read::View): Add byteshift_ field. Add byteshift to
10126 constructor. Add byteshift method.
10127 * archive.h (Archive::clear_uncached_views): New function.
10128 (Archive::get_view): Add aligned parameter. Change all callers.
10129 * object.h (Object::get_view): Add aligned parameter. Change all
10130 callers.
10131 (Object::get_lasting_view): Likewise.
10132
10133 * fileread.cc (File_read::release): Don't call clear_views if
10134 there are multiple objects.
10135 * fileread.h (File_read::clear_uncached_views): New function.
10136 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10137 on the archive.
10138
a1207466
CC
101392008-03-31 Cary Coutant <ccoutant@google.com>
10140
10141 Add thin archive support.
10142 * archive.cc (Archive::armagt): New const.
10143 (Archive::setup): Remove task parameter and calls to unlock.
10144 (Archive::unlock_nested_archives): New function.
10145 (Archive::read_header): Add nested_off parameter. Change
10146 all callers.
10147 (Archive::interpret_header): Likewise.
10148 (Archive::include_all_members): Change to handle thin
10149 archives.
10150 (Archive::include_member): Likewise.
10151 * archive.h (Archive::Archive): Add new parameters and
10152 initializers.
10153 (Archive::armagt): New const.
10154 (Archive::setup): Remove task parameter.
10155 (Archive::unlock_nested_archives): New function.
10156 (Archive::read_header): Add nested_off parameter.
10157 (Archive::interpret_header): Likewise.
10158 (Archive::Nested_archive_table): New typedef.
10159 (Archive::is_thin_archive_): New field.
10160 (Archive::nested_archives_): New field.
10161 (Archive::options_): New field.
10162 (Archive::dirpath_): New field.
10163 (Archive::task_): New field.
10164 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10165 for thin archives. Pass additional parameters to
10166 Archive::Archive. Unlock the archive file after calling
10167 Archive::setup.
cd536b21 10168
479f6503
ILT
101692008-03-29 Ian Lance Taylor <iant@google.com>
10170
686c8caf
ILT
10171 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10172 version symbol to be local.
10173 * testsuite/ver_test_4.sh: New file.
10174 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10175 (check_DATA): Add ver_test_4.syms.
10176 (ver_test_4.syms): New target.
10177 * testsuite/Makefile.in: Rebuild.
10178
ab794b6b
ILT
10179 * output.cc
10180 (Output_section::Input_section_sort_entry::has_priority): New
10181 function.
10182 (Output_section::Input_section_sort_entry::match_file_name): New
10183 function.
10184 (Output_section::Input_section_sort_entry::match_section_name):
10185 Remove.
10186 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10187 Remove.
10188 (Output_section::Input_section_sort_entry::match_section_file):
10189 Remove.
10190 (Output_section::Input_section_sort_compare::operator()): Rewrite
10191 using new Input_section_sort_entry functions. Sort crtbegin and
10192 crtend first. Sort sections with no priority before sections with
10193 a priority.
10194 * testsuite/initpri1.c (d3): Check j != 4.
10195 (cd5): New constructor/destructor function.
10196 (main): Check j != 2.
10197
479f6503
ILT
10198 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10199 new symbol when resolving, don't call set_is_default.
10200 * testsuite/ver_test_7.cc: New file.
10201 * testsuite/ver_test_7.sh: New file.
10202 * testsuite/Makefile.am (ver_test_7.so): New target.
10203 (ver_test_7.o): New target.
10204 (check_SCRIPTS): Add ver_test_7.sh.
10205 (check_DATA): Add ver_test_7.syms.
10206 (ver_test_7.syms): New target.
10207
2fd32231
ILT
102082008-03-28 Ian Lance Taylor <iant@google.com>
10209
10210 * layout.cc (Layout::layout): If we see an input section with a
10211 name that needs sorting, set the must_sort flag for the output
10212 section.
10213 (Layout::make_output_section): If the name of the output section
10214 indicates that it might require sorting, set the may_sort flag.
10215 * output.h (Output_section::may_sort_attached_input_sections): New
10216 function.
10217 (Output_section::set_may_sort_attached_input_sections): New
10218 function.
10219 (Output_section::must_sort_attached_input_sections): New
10220 function.
10221 (Output_section::set_must_sort_attached_input_sections): New
10222 function.
10223 (class Output_section): Declare Input_section_sort_entry. Define
10224 Input_section_sort_compare. Declare
10225 sort_attached_input_sections. Add new fields:
10226 may_sort_attached_input_sections_,
10227 must_sort_attached_input_sections_,
10228 attached_input_sections_are_sorted_.
10229 * output.cc (Output_section::Output_section): Initialize new
10230 fields.
10231 (Output_section::add_input_section): Add an entry to
10232 input_sections_ if may_sort or must_sort are true.
10233 (Output_section::set_final_data_size): Call
10234 sort_attached_input_sections if necessary.
10235 (Output_section::Input_section_sort_entry): Define new class.
10236 (Output_section::Input_section_sort_compare::operator()): New
10237 function.
10238 (Output_section::sort_attached_input_sections): New function.
10239 * configure.ac: Check whether the compiler supports constructor
10240 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
10241 * testsuite/initpri1.c: New file.
10242 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
10243 CONSTRUCTOR_PRIORITY.
10244 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
10245 (initpri1_LDFLAGS): New variable.
10246 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10247
18e6b24e
ILT
102482008-03-27 Ian Lance Taylor <iant@google.com>
10249
49bdd526
ILT
10250 * common.cc (Sort_commons::operator): Correct sorting algorithm.
10251 * testsuite/common_test_1.c: New file.
10252 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
10253 (common_test_1_SOURCES): New variable.
10254 (common_test_1_DEPENDENCIES): New variable.
10255 (common_test_1_LDFLAGS): New variable.
10256
18e6b24e
ILT
10257 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
10258 and commons_ correctly when NAME/VERSION does not override
10259 NAME/NULL.
10260 * testsuite/ver_test_6.c: New file.
10261 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
10262 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
10263 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
10264
04bf7072
ILT
102652008-03-26 Ian Lance Taylor <iant@google.com>
10266
5871526f
ILT
10267 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
10268 of an undefined symbol from a version script.
10269 * testsuite/Makefile.am (ver_test_5.so): New target.
10270 (ver_test_5.o): New target.
10271 (check_SCRIPTS): Add ver_test_5.sh.
10272 (check_DATA): Add ver_test_5.syms.
10273 (ver_test_5.syms): New target.
10274 * testsuite/ver_test_5.cc: New file.
10275 * testsuite/ver_test_5.script: New file.
10276 * testsuite/ver_test_5.sh: New file.
10277 * Makefile.in, testsuite/Makefile.in: Rebuild.
10278
04bf7072
ILT
10279 PR gold/5986
10280 Fix problems building gold with gcc 4.3.0.
10281 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
10282 (gold_error_at_location, gold_warning_at_location): Use it.
10283 * configure.ac: Check whether we can compile and use a template
10284 function with a printf attribute.
10285 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
10286 when jumping over bytes.
10287 * object.cc: Instantiate Object::read_section_data.
10288 * debug.h: Include <cstring>
10289 * dwarf_reader.cc: Include <algorithm>
10290 * main.cc: Include <cstring>.
10291 * options.cc: Include <cstring>.
10292 * output.cc: Include <cstring>.
10293 * script.cc: Include <cstring>.
10294 * script.h: Include <string>.
10295 * symtab.cc: Include <cstring> and <algorithm>.
10296 * target-select.cc: Include <cstring>.
10297 * version.cc: Include <string>.
10298 * testsuite/testmain.cc: Include <cstdlib>.
10299 * configure, config.in: Rebuild.
10300
874c5b28
ILT
103012008-03-25 Ian Lance Taylor <iant@google.com>
10302
819d6c3a
ILT
10303 * options.cc: Include "../bfd/bfdver.h".
10304 (options::help): Print bug reporting address.
10305
f4b2c6f5
ILT
10306 * version.cc (print_version): Adjust output for current value of
10307 BFD_VERSION_STRING.
10308
10309 * NEWS: New file.
10310
e96caa79
ILT
10311 * options.cc (options::help): Print list of supported targets.
10312 * target-select.h: Include <vector>.
10313 (class Target_selector): Make machine_, size_, and is_big_endian_
10314 fields const. Add bfd_name_ and instantiated_target_ fields.
10315 (Target_selector::Target_selector): Add bfd_name parameter.
10316 (Target_selector::recognize): Make non-virtual, call
10317 do_recognize.
10318 (Target_selector::recognize_by_name): Make non-virtual, call
10319 do_recognize_by_name.
10320 (Target_selector::supported_names): New function.
10321 (Target_selector::bfd_name): New function.
10322 (Target_selector::do_instantiate_target): New pure virtual
10323 function.
10324 (Target_selector::do_recognize): New virtual function.
10325 (Target_selector::do_recognize_by_name): New virtual function.
10326 (Target_selector::instantiate_target): New private function.
10327 (supported_target_names): Declare.
10328 * target-select.cc (Target_selector::Target_selector): Update for
10329 new parameter and fields.
10330 (select_target_by_name): Check that the name matches before
10331 calling recognize_by_name.
10332 (supported_target_names): New function.
10333 * i386.cc (class Target_selector_i386): Update Target_selector
10334 constructor call. Remove recognize and recognize_by_name. Add
10335 do_instantiate_target.
10336 * x86_64.cc (class Target_selector_x86_64): Likewise.
10337 * testsuite/testfile.cc (class Target_selector_test): Update for
10338 changes to Target_selector.
10339
874c5b28
ILT
10340 * README: Rewrite, with some notes on unsupported features.
10341
0a65a3a7
CC
103422008-03-24 Cary Coutant <ccoutant@google.com>
10343
10344 * i386.cc (Target_i386::Got_type): New enum declaration.
10345 (Target_i386::Scan::local): Updated callers of Output_data_got
10346 member functions.
10347 (Target_i386::Scan::global): Likewise.
10348 (Target_i386::Relocate::relocate): Likewise.
10349 (Target_i386::Relocate::relocate_tls): Likewise.
10350 * object.h (Got_offset_list): New class.
10351 (Sized_relobj::local_has_got_offset): Added got_type parameter.
10352 (Sized_relobj::local_got_offset): Likewise.
10353 (Sized_relobj::set_local_got_offset): Likewise.
10354 (Sized_relobj::local_has_tls_got_offset): Removed.
10355 (Sized_relobj::local_tls_got_offset): Removed.
10356 (Sized_relobj::set_local_tls_got_offset): Removed.
10357 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
10358 * output.cc (Output_data_got::add_global): Added got_type parameter.
10359 (Output_data_got::add_global_with_rel): Likewise.
10360 (Output_data_got::add_global_with_rela): Likewise.
10361 (Output_data_got::add_global_pair_with_rel): New function.
10362 (Output_data_got::add_global_pair_with_rela): New function.
10363 (Output_data_got::add_local): Added got_type parameter.
10364 (Output_data_got::add_local_with_rel): Likewise.
10365 (Output_data_got::add_local_with_rela): Likewise.
10366 (Output_data_got::add_local_pair_with_rel): New function.
10367 (Output_data_got::add_local_pair_with_rela): New function.
10368 (Output_data_got::add_global_tls): Removed.
10369 (Output_data_got::add_global_tls_with_rel): Removed.
10370 (Output_data_got::add_global_tls_with_rela): Removed.
10371 (Output_data_got::add_local_tls): Removed.
10372 (Output_data_got::add_local_tls_with_rel): Removed.
10373 (Output_data_got::add_local_tls_with_rela): Removed.
10374 * output.h (Output_data_got::add_global): Added got_type parameter.
10375 (Output_data_got::add_global_with_rel): Likewise.
10376 (Output_data_got::add_global_with_rela): Likewise.
10377 (Output_data_got::add_global_pair_with_rel): New function.
10378 (Output_data_got::add_global_pair_with_rela): New function.
10379 (Output_data_got::add_local): Added got_type parameter.
10380 (Output_data_got::add_local_with_rel): Likewise.
10381 (Output_data_got::add_local_with_rela): Likewise.
10382 (Output_data_got::add_local_pair_with_rel): New function.
10383 (Output_data_got::add_local_pair_with_rela): New function.
10384 (Output_data_got::add_global_tls): Removed.
10385 (Output_data_got::add_global_tls_with_rel): Removed.
10386 (Output_data_got::add_global_tls_with_rela): Removed.
10387 (Output_data_got::add_local_tls): Removed.
10388 (Output_data_got::add_local_tls_with_rel): Removed.
10389 (Output_data_got::add_local_tls_with_rela): Removed.
10390 * resolve.cc (Symbol::override_base_with_special): Removed
10391 reference to has_got_offset_ field.
10392 * symtab.cc (Symbol::init_fields): Replaced initialization
10393 of got_offset_ with got_offsets_. Removed initialization
10394 of has_got_offset_
53fcba31 10395 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
10396 (Symbol::got_offset): Likewise.
10397 (Symbol::set_got_offset): Likewise.
10398 (Symbol::has_tls_got_offset): Removed.
10399 (Symbol::tls_got_offset): Removed.
10400 (Symbol::set_tls_got_offset): Removed.
10401 (Symbol::got_offset_): Removed.
10402 (Symbol::tls_mod_got_offset_): Removed.
10403 (Symbol::tls_pair_got_offset_): Removed.
10404 (Symbol::got_offsets_): New field.
10405 (Symbol::has_got_offset): Removed.
10406 (Symbol::has_tls_mod_got_offset): Removed.
10407 (Symbol::has_tls_pair_got_offset): Removed.
10408 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
10409 (Target_x86_64::Scan::local): Updated callers of Output_data_got
10410 member functions.
10411 (Target_x86_64::Scan::global): Likewise.
10412 (Target_x86_64::Relocate::relocate): Likewise.
10413 (Target_x86_64::Relocate::relocate_tls): Likewise.
10414
bd52eafb
BE
104152008-03-25 Ben Elliston <bje@au.ibm.com>
10416
10417 * yyscript.y: Fix spelling error in comment.
10418
8b105e34
ILT
104192008-03-24 Ian Lance Taylor <iant@google.com>
10420
8ed814a9
ILT
10421 * options.h (class General_options): Define build_id option.
10422 * layout.h (class Layout): Declare write_build_id, create_note,
10423 create_build_id. Add build_id_note_ member.
10424 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
10425 "libiberty.h", "md5.h", "sha1.h".
10426 (Layout::Layout): Initialize eh_frame_data_,
10427 eh_frame_hdr_section_, and build_id_note_.
10428 (Layout::finalize): Call create_build_id.
10429 (Layout::create_note): New function, broken out of
10430 Layout::create_gold_note.
10431 (Layout::create_gold_note): Call create_note.
10432 (Layout::create_build_id): New function.
10433 (Layout::write_build_id): New function.
10434 (Close_task_runner::run): Call write_build_id.
10435
8b105e34
ILT
10436 * x86_64.cc: Correct license to GPLv3.
10437
086a1841
ILT
104382008-03-23 Ian Lance Taylor <iant@google.com>
10439
10440 * options.cc: Include "demangle.h".
10441 (parse_optional_string): New function.
10442 (parse_long_option): Handle takes_optional_argument.
10443 (parse_short_option): Update dash_z initializer. Handle
10444 takes_optional_argument.
10445 (General_options::General_options): Initialize do_demangle_.
10446 (General_options::finalize): Set do_demangle_. Handle demangling
10447 style.
10448 * options.h (parse_optional_string): Declare.
10449 (struct One_option): Add optional_arg field. Update constructor.
10450 Update call constructor calls. Add takes_optional_argument
10451 function.
10452 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
10453 (DEFINE_optional_string): Define.
10454 (General_options::demangle): Change from DEFINE_bool to
10455 DEFINE_optional_string.
10456 (General_options::no_demangle): New function.
10457 (General_options::do_demangle): New function.
10458 (General_options::set_do_demangle): New function.
10459 (General_options::execstack_status_): Move definition to end of
10460 class definition.
10461 (General_options::static_): Likewise.
10462 (General_options::do_demangle_): New field.
10463 * object.cc (big_endian>::get_symbol_location_info): Call
10464 Options::do_demangle, not Options::demangle.
10465 * symtab.cc (demangle): Likewise.
10466
cbb93e63
ILT
104672008-03-22 Ian Lance Taylor <iant@google.com>
10468
10469 * gold.h: Include <cstddef> and <sys/types.h>
10470 * options.h: Include <cstring>.
10471
ec531623
ILT
104722008-03-21 Ian Lance Taylor <iant@google.com>
10473
10474 * Added source code to GNU binutils.
This page took 0.647862 seconds and 4 git commands to generate.