* incremental.cc (Sized_incremental_binary::setup_readers): Allocate
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
94a3fc8b
CC
12011-04-22 Cary Coutant <ccoutant@google.com>
2
3 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
4 global symbol map.
5 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
6 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
7 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
8 relocations.
9 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
10 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
11 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
12 * incremental.h
13 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
14 function.
15 (Incremental_binary::apply_incremental_relocs): New function.
16 (Incremental_binary::do_apply_incremental_relocs): New function.
17 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
18 data member.
19 (Sized_incremental_binary::add_global_symbol): New function.
20 (Sized_incremental_binary::global_symbol): New function.
21 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
22 (Sized_incremental_binary::symbol_map_): New data member.
23 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
24 * target.h (Sized_target::apply_relocation): New function.
25 * target-reloc.h (apply_relocation): New function.
26 * x86_64.cc (Target_x86_64::apply_relocation): New function.
27
c87e4302
DK
282011-04-22 Doug Kwan <dougkwan@google.com>
29
30 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
31 flag of a SHT_ARM_EXIDX section.
32 * testsuite/Makefile.am (arm_exidx_test): New test rules.
33 * testsuite/Makefile.in: Regenerate.
34 * testsuite/arm_exidx_test.s: New file.
35 * testsuite/arm_exidx_test.sh: Same.
36
e7782cf6
CC
372011-04-20 Cary Coutant <ccoutant@google.com>
38
39 PR gold/12689
40 * archive.h (Incremental_archive_entry::Archive_member):
41 Initialize arg_serial_ (second constructor).
42
308ecdc7
ILT
432011-04-17 Ian Lance Taylor <iant@google.com>
44
45 * object.cc (Relocate_info::location): Simplify location string.
46 * errors.cc (Errors::error_at_location): Don't print program
47 name.
48 (Errors::warning_at_location): Likewise.
49 (Errors::undefined_symbol): Likewise.
50 * testsuite/debug_msg.sh: Update accordingly.
51
bec5b579
CC
522011-04-14 Cary Coutant <ccoutant@google.com>
53
54 * gold/layout.cc (Layout::symtab_section_offset): New function.
55 * gold/layout.h (Layout::symtab_section_offset): New function.
56 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
57
88597d34
ILT
582011-04-12 Ian Lance Taylor <iant@google.com>
59
60 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
61 with MREMAP_MAYMOVE.
62 * output.h (class Output_file): Add map_is_allocated_ field.
63 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
64 not available, provide stubs. If mremap is not available, #define
65 it to gold_mremap.
66 (MREMAP_MAYMOVE): Define if not defined.
67 (Output_file::Output_file): Initialize map_is_allocated_.
68 (Output_file::resize): Check map_is_allocated_.
69 (Output_file::map_anonymous): If mmap fails, use malloc.
70 (Output_file::unmap): Don't do anything for an anonymous map.
71 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
72 is not available, provide stubs.
73 (File_read::View::~View): Use free rather than delete[].
74 (File_read::make_view): Use malloc rather than new[]. If mmap
75 fails, use malloc.
76 (File_read::find_or_make_view): Use malloc rather than new[].
77 * gold.h: Remove HAVE_REMAP code.
78 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
79 exists. Rename mremap to gold_mremap. If mmap is not available
80 don't do anything.
81 * configure, config.in: Rebuild.
82
11e361bc
ILT
832011-04-11 Ian Lance Taylor <iant@google.com>
84
85 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
86 initialize local variable v.
87
cdc29364
CC
882011-04-11 Cary Coutant <ccoutant@google.com>
89
90 * archive.cc (Archive::include_member): Adjust call to
91 report_object.
92 (Add_archive_symbols::run): Track argument serial numbers.
93 (Lib_group::include_member): Likewise.
94 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
95 * archive.h (Incremental_archive_entry::Archive_member):
96 Initialize arg_serial_.
97 (Archive_member::arg_serial_): New data member.
98 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
99 (Sized_dynobj::do_add_symbols): Track symbols when doing an
100 incremental link.
101 (Sized_dynobj::do_for_all_local_got_entries): New function.
102 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
103 function.
104 * fileread.cc (get_mtime): New function.
105 * fileread.h (get_mtime): New function.
106 * gold.cc (queue_initial_tasks): Check for incremental update.
107 (process_incremental_input): New function.
108 (queue_middle_tasks): Don't force valid target for incremental
109 update.
110 * incremental-dump.cc (find_input_containing_global): Adjust
111 size of symbol info entry.
112 (dump_incremental_inputs): Dump argument serial number and
113 in_system_directory flag; bias shndx by 1; print symbol names
114 when dumping per-file symbol lists; use new symbol info readers.
115 * incremental.cc
116 (Output_section_incremental_inputs:update_data_size): New function.
117 (Sized_incremental_binary::setup_readers): Setup input readers
118 for each input file; build maps for files added from libraries
119 and scripts.
120 (Sized_incremental_binary::check_input_args): New function.
121 (Sized_incremental_binary::do_check_inputs): Build map of argument
122 serial numbers to input arguments.
123 (Sized_incremental_binary::do_file_has_changed): Rename
124 do_file_is_unchanged to this; compare file modification times.
125 (Sized_incremental_binary::do_init_layout): New function.
126 (Sized_incremental_binary::do_reserve_layout): New function.
127 (Sized_incremental_binary::do_get_input_reader): Remove.
128 (Sized_incremental_binary::get_symtab_view): New function.
129 (Incremental_checker::can_incrementally_link_output_file): Remove.
130 (Incremental_inputs::report_command_line): Exclude --debug options.
131 (Incremental_inputs::report_archive_begin): Add parameter; track
132 argument serial numbers; don't put input file entry for archive
133 before archive members.
134 (Incremental_inputs::report_archive_end): Put input file entry
135 for archive after archive members.
136 (Incremental_inputs::report_object): Add parameter; track argument
137 serial numbers and in_system_directory flag.
138 (Incremental_inputs::report_script): Add parameter; track argument
139 serial numbers.
140 (Output_section_incremental_inputs::set_final_data_size): Adjust
141 size of symbol info entry; check for forwarding symbols.
142 (Output_section_incremental_inputs::write_input_files): Write
143 in_system_directory flag and argument serial number.
144 (Output_section_incremental_inputs::write_info_blocks): Map section
145 indices between incremental info and original input file; store
146 input section index for each symbol.
147 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
148 change operator() to visit().
149 (class Global_got_offset_visitor): Likewise.
150 (class Global_symbol_visitor_got_plt):
151 (Output_section_incremental_inputs::write_got_plt): Use new visitor
152 classes.
153 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
154 (Sized_incr_relobj::do_read_symbols): New function.
155 (Sized_incr_relobj::do_layout): New function.
156 (Sized_incr_relobj::do_layout_deferred_sections): New function.
157 (Sized_incr_relobj::do_add_symbols): New function.
158 (Sized_incr_relobj::do_should_include_member): New function.
159 (Sized_incr_relobj::do_for_all_global_symbols): New function.
160 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
161 (Sized_incr_relobj::do_section_size): New function.
162 (Sized_incr_relobj::do_section_name): New function.
163 (Sized_incr_relobj::do_section_contents): New function.
164 (Sized_incr_relobj::do_section_flags): New function.
165 (Sized_incr_relobj::do_section_entsize): New function.
166 (Sized_incr_relobj::do_section_address): New function.
167 (Sized_incr_relobj::do_section_type): New function.
168 (Sized_incr_relobj::do_section_link): New function.
169 (Sized_incr_relobj::do_section_info): New function.
170 (Sized_incr_relobj::do_section_addralign): New function.
171 (Sized_incr_relobj::do_initialize_xindex): New function.
172 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
173 (Sized_incr_relobj::do_read_relocs): New function.
174 (Sized_incr_relobj::do_gc_process_relocs): New function.
175 (Sized_incr_relobj::do_scan_relocs): New function.
176 (Sized_incr_relobj::do_count_local_symbols): New function.
177 (Sized_incr_relobj::do_finalize_local_symbols): New function.
178 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
179 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
180 (Sized_incr_relobj::do_relocate): New function.
181 (Sized_incr_relobj::do_set_section_offset): New function.
182 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
183 (Sized_incr_dynobj::do_read_symbols): New function.
184 (Sized_incr_dynobj::do_layout): New function.
185 (Sized_incr_dynobj::do_add_symbols): New function.
186 (Sized_incr_dynobj::do_should_include_member): New function.
187 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
188 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
189 (Sized_incr_dynobj::do_section_size): New function.
190 (Sized_incr_dynobj::do_section_name): New function.
191 (Sized_incr_dynobj::do_section_contents): New function.
192 (Sized_incr_dynobj::do_section_flags): New function.
193 (Sized_incr_dynobj::do_section_entsize): New function.
194 (Sized_incr_dynobj::do_section_address): New function.
195 (Sized_incr_dynobj::do_section_type): New function.
196 (Sized_incr_dynobj::do_section_link): New function.
197 (Sized_incr_dynobj::do_section_info): New function.
198 (Sized_incr_dynobj::do_section_addralign): New function.
199 (Sized_incr_dynobj::do_initialize_xindex): New function.
200 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
201 (make_sized_incremental_object): New function.
202 (Incremental_library::copy_unused_symbols): New function.
203 (Incremental_library::do_for_all_unused_symbols): New function.
204 * incremental.h (enum Incremental_input_flags): New type.
205 (class Incremental_checker): Remove.
206 (Incremental_input_entry::Incremental_input_entry): Add argument
207 serial number.
208 (Incremental_input_entry::arg_serial): New function.
209 (Incremental_input_entry::set_is_in_system_directory): New function.
210 (Incremental_input_entry::is_in_system_directory): New function.
211 (Incremental_input_entry::arg_serial_): New data member.
212 (Incremental_input_entry::is_in_system_directory_): New data member.
213 (class Script_info): Move here from script.h.
214 (Script_info::Script_info): Add filename parameter.
215 (Script_info::filename): New function.
216 (Script_info::filename_): New data member.
217 (Incremental_script_entry::Incremental_script_entry): Add argument
218 serial number.
219 (Incremental_object_entry::Incremental_object_entry): Likewise.
220 (Incremental_object_entry::add_input_section): Build list of input
221 sections with map to original shndx.
222 (Incremental_object_entry::get_input_section_index): New function.
223 (Incremental_object_entry::shndx_): New data member.
224 (Incremental_object_entry::name_key_): Rename; adjust all refs.
225 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
226 (Incremental_archive_entry::Incremental_archive_entry): Add argument
227 serial number.
228 (Incremental_inputs::report_archive_begin): Likewise.
229 (Incremental_inputs::report_object): Likewise.
230 (Incremental_inputs::report_script): Likewise.
231 (class Incremental_global_symbol_reader): New class.
232 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
233 and store flags and input file type.
234 (Incremental_input_entry_reader::arg_serial): New function.
235 (Incremental_input_entry_reader::type): Extract type from flags.
236 (Incremental_input_entry_reader::is_in_system_directory): New function.
237 (Incremental_input_entry_reader::get_input_section_count): Call
238 accessor function for type.
239 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
240 function for type; adjust size of global symbol entry.
241 (Incremental_input_entry_reader::get_global_symbol_count): Call
242 accessor function for type.
243 (Incremental_input_entry_reader::get_object_count): Likewise.
244 (Incremental_input_entry_reader::get_object_offset): Likewise.
245 (Incremental_input_entry_reader::get_member_count): Likewise.
246 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
247 (Incremental_input_entry_reader::get_member_offset): Likewise.
248 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
249 (Incremental_input_entry_reader::Global_symbol_info): Remove.
250 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
251 (Incremental_input_entry_reader::get_global_symbol_reader): New
252 function.
253 (Incremental_input_entry_reader::get_output_symbol_index): New
254 function.
255 (Incremental_input_entry_reader::type_): Remove.
256 (Incremental_input_entry_reader::flags_): New data member.
257 (Incremental_inputs_reader::input_file_offset): New function.
258 (Incremental_inputs_reader::input_file_index): New function.
259 (Incremental_inputs_reader::input_file): Call input_file_offset.
260 (Incremental_inputs_reader::input_file_at_offset): New function.
261 (Incremental_relocs_reader::get_r_type): Reformat.
262 (Incremental_relocs_reader::get_r_shndx): Reformat.
263 (Incremental_relocs_reader::get_r_offset): Reformat.
264 (Incremental_relocs_reader::data): New function.
265 (Incremental_binary::Incremental_binary): Initialize new data members.
266 (Incremental_binary::check_inputs): Add cmdline parameter.
267 (Incremental_binary::file_is_unchanged): Remove.
268 (Input_reader::arg_serial): New function.
269 (Input_reader::get_unused_symbol_count): New function.
270 (Input_reader::get_unused_symbol): New function.
271 (Input_reader::do_arg_serial): New function.
272 (Input_reader::do_get_unused_symbol_count): New function.
273 (Input_reader::do_get_unused_symbol): New function.
274 (Incremental_binary::input_file_count): New function.
275 (Incremental_binary::get_input_reader): Change signature to use
276 index instead of filename.
277 (Incremental_binary::file_has_changed): New function.
278 (Incremental_binary::get_input_argument): New function.
279 (Incremental_binary::get_library): New function.
280 (Incremental_binary::get_script_info): New function.
281 (Incremental_binary::init_layout): New function.
282 (Incremental_binary::reserve_layout): New function.
283 (Incremental_binary::output_file): New function.
284 (Incremental_binary::do_check_inputs): New function.
285 (Incremental_binary::do_file_is_unchanged): Remove.
286 (Incremental_binary::do_file_has_changed): New function.
287 (Incremental_binary::do_init_layout): New function.
288 (Incremental_binary::do_reserve_layout): New function.
289 (Incremental_binary::do_input_file_count): New function.
290 (Incremental_binary::do_get_input_reader): Change signature.
291 (Incremental_binary::input_args_map_): New data member.
292 (Incremental_binary::library_map_): New data member.
293 (Incremental_binary::script_map_): New data member.
294 (Sized_incremental_binary::Sized_incremental_binary): Initialize
295 new data members.
296 (Sized_incremental_binary::output_section): New function.
297 (Sized_incremental_binary::inputs_reader): Add const.
298 (Sized_incremental_binary::symtab_reader): Add const.
299 (Sized_incremental_binary::relocs_reader): Add const.
300 (Sized_incremental_binary::got_plt_reader): Add const.
301 (Sized_incremental_binary::get_symtab_view): New function.
302 (Sized_incremental_binary::Inputs_reader): New typedef.
303 (Sized_incremental_binary::Input_entry_reader): New typedef.
304 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
305 (Sized_incremental_binary::do_file_is_unchanged): Remove.
306 (Sized_incremental_binary::do_file_has_changed): New function.
307 (Sized_incremental_binary::do_init_layout): New function.
308 (Sized_incremental_binary::do_reserve_layout): New function.
309 (Sized_input_reader::Inputs_reader): Remove.
310 (Sized_input_reader::Input_entry_reader): Remove.
311 (Sized_input_reader::do_arg_serial): New function.
312 (Sized_input_reader::do_get_unused_symbol_count): New function.
313 (Sized_input_reader::do_get_unused_symbol): New function.
314 (Sized_incremental_binary::do_input_file_count): New function.
315 (Sized_incremental_binary::do_get_input_reader): Change signature;
316 use index instead of filename.
317 (Sized_incremental_binary::section_map_): New data member.
318 (Sized_incremental_binary::input_entry_readers_): New data member.
319 (class Sized_incr_relobj): New class.
320 (class Sized_incr_dynobj): New class.
321 (make_sized_incremental_object): New function.
322 (class Incremental_library): New class.
323 * layout.cc (Free_list::num_lists): New static data member.
324 (Free_list::num_nodes): New static data member.
325 (Free_list::num_removes): New static data member.
326 (Free_list::num_remove_visits): New static data member.
327 (Free_list::num_allocates): New static data member.
328 (Free_list::num_allocate_visits): New static data member.
329 (Free_list::init): New function.
330 (Free_list::remove): New function.
331 (Free_list::allocate): New function.
332 (Free_list::dump): New function.
333 (Free_list::print_stats): New function.
334 (Layout_task_runner::run): Resize output file for incremental updates.
335 (Layout::Layout): Initialize new data members.
336 (Layout::set_incremental_base): New function.
337 (Layout::init_fixed_output_section): New function.
338 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
339 incremental updates.
340 (Layout::create_gold_note): Do not create gold note section for
341 incremental updates.
342 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
343 for incremental updates.
344 (Layout::set_section_offsets): For incremental updates, allocate space
345 from free list.
346 (Layout::create_symtab_sections): Layout with offsets relative to
347 start of section; for incremental updates, allocate space from free
348 list.
349 (Layout::create_shdrs): For incremental updates, allocate space from
350 free list.
351 (Layout::finish_dynamic_section): For incremental updates, do not
352 check --as-needed (fixed in subsequent patch).
353 * layout.h (class Free_list): New class.
354 (Layout::set_incremental_base): New function.
355 (Layout::incremental_base): New function.
356 (Layout::init_fixed_output_section): New function.
357 (Layout::allocate): New function.
358 (Layout::incremental_base_): New data member.
359 (Layout::free_list_): New data member.
360 * main.cc (main): Print Free_list statistics.
361 * object.cc (Relobj::finalize_incremental_relocs): Add
362 clear_counts parameter; clear counts only when clear_counts is set.
363 (Sized_relobj::Sized_relobj): Initialize new base class.
364 (Sized_relobj::do_layout): Don't report special sections.
365 (Sized_relobj::do_for_all_local_got_entries): New function.
366 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
367 symtab_off to all symbol table offsets.
368 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
369 * object.h (class Got_offset_list): Move to top of file.
370 (Object::Object): Allow case where input_file == NULL.
371 (Object::~Object): Likewise.
372 (Object::input_file): Assert that input_file != NULL.
373 (Object::lock): Allow case where input_file == NULL.
374 (Object::unlock): Likewise.
375 (Object::is_locked): Likewise.
376 (Object::token): Likewise.
377 (Object::release): Likewise.
378 (Object::is_incremental): New function.
379 (Object::get_mtime): New function.
380 (Object::for_all_local_got_entries): New function.
381 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
382 (Object::set_is_in_system_directory): New function.
383 (Object::is_in_system_directory): New function.
384 (Object::do_is_incremental): New function.
385 (Object::do_get_mtime): New function.
386 (Object::do_for_all_local_got_entries): New function.
387 (Object::is_in_system_directory_): New data member.
388 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
389 (class Sized_relobj_base): New class.
390 (class Sized_relobj): Derive from Sized_relobj_base.
391 (class Sized_relobj::Symbols): Redeclare from base class.
392 (class Sized_relobj::local_got_offset_list): Remove.
393 (class Sized_relobj::Output_sections): Redeclare from base class.
394 (class Sized_relobj::do_for_all_local_got_entries): New function.
395 (class Sized_relobj::write_local_symbols): Add offset parameter.
396 (class Sized_relobj::local_symbol_offset_): Update comment.
397 (class Sized_relobj::local_dynsym_offset_): Update comment.
398 * options.cc (Input_arguments::add_file): Remove const.
399 * options.h (Input_file_argument::Input_file_argument):
400 Initialize arg_serial_ (all constructors).
401 (Input_file_argument::set_arg_serial): New function.
402 (Input_file_argument::arg_serial): New function.
403 (Input_file_argument::arg_serial_): New data member.
404 (Input_arguments::Input_arguments): Initialize file_count_.
405 (Input_arguments::add_file): Remove const.
406 (Input_arguments::number_of_input_files): New function.
407 (Input_arguments::file_count_): New data member.
408 (Command_line::number_of_input_files): Call
409 Input_arguments::number_of_input_files.
410 * output.cc (Output_segment_headers::Output_segment_headers):
411 Set current size.
412 (Output_section::Input_section::current_data_size): New function.
413 (Output_section::Output_section): Initialize new data members.
414 (Output_section::add_input_section): Don't do merge sections for
415 an incremental link; allocate space from free list for an
416 incremental update.
417 (Output_section::add_output_section_data): Allocate space from
418 free list for an incremental update.
419 (Output_section::update_data_size): New function.
420 (Output_section::set_fixed_layout): New function.
421 (Output_section::reserve): New function.
422 (Output_segment::set_section_addresses): Remove const.
423 (Output_segment::set_section_list_addresses): Remove const; allocate
424 space from free list for an incremental update.
425 (Output_segment::set_offset): Adjust size of RELRO segment for an
426 incremental update.
427 * output.h (Output_data::current_data_size): Move here from
428 child classes.
429 (Output_data::pre_finalize_data_size): New function.
430 (Output_data::update_data_size): New function.
431 (Output_section_headers::update_data_size): new function.
432 (Output_section_data_build::current_data_size): Move to Output_data.
433 (Output_data_strtab::update_data_size): New function.
434 (Output_section::current_data_size): Move to Output_data.
435 (Output_section::set_fixed_layout): New function.
436 (Output_section::has_fixed_layout): New function.
437 (Output_section::reserve): New function.
438 (Output_section::update_data_size): New function.
439 (Output_section::has_fixed_layout_): New data member.
440 (Output_section::free_list_): New data member.
441 (Output_segment::set_section_addresses): Remove const.
442 (Output_segment::set_section_list_addresses): Remove const.
443 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
444 New function.
445 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
446 New function.
447 * readsyms.cc (Read_symbols::do_read_symbols): Add library
448 parameter when calling Add_symbols constructor; store argument
449 serial number for members of a lib group.
450 (Add_symbols::locks): Allow case where token == NULL.
451 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
452 (Read_member::~Read_member): New function.
453 (Read_member::is_runnable): New function.
454 (Read_member::locks): New function.
455 (Read_member::run): New function.
456 (Check_script::~Check_script): New function.
457 (Check_script::is_runnable): New function.
458 (Check_script::locks): New function.
459 (Check_script::run): New function.
460 (Check_library::~Check_library): New function.
461 (Check_library::is_runnable): New function.
462 (Check_library::locks): New function.
463 (Check_library::run): New function.
464 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
465 (Add_symbols::library_): New data member.
466 (class Read_member): New class.
467 (class Check_script): New class.
468 (class Check_library): New class.
469 * reloc.cc (Read_relocs::is_runnable): Allow case where
470 token == NULL.
471 (Read_relocs::locks): Likewise.
472 (Scan_relocs::locks): Likewise.
473 (Relocate_task::locks): Likewise.
474 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
475 to clear counters.
476 (Sized_relobj::incremental_relocs_scan): Fix comment.
477 (Sized_relobj::do_relocate): Pass output file offset to
478 write_local_symbols.
479 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
480 from class declaration.
481 * script.cc (read_input_script): Allocate Script_info; pass
482 argument serial number to report_script.
483 * script.h (class Script_info): Move to incremental.h.
484 * symtab.cc (Symbol_table::add_from_incrobj): New function.
485 * symtab.h (Symbol_table::add_from_incrobj): New function.
486 (Symbol_table::set_file_offset): New function.
487
b961d0d7
CC
4882011-04-05 Cary Coutant <ccoutant@google.com>
489
490 * incremental-dump.cc (dump_incremental_inputs): Change signature
491 to take a Sized_incremental_binary; change caller. Use readers
492 in Sized_incremental_binary.
493 * incremental.cc
494 (Sized_incremental_binary::find_incremental_inputs_sections):
495 Rename do_find_incremental_inputs_sections to this.
496 (Sized_incremental_binary::setup_readers): New function.
497 (Sized_incremental_binary::do_check_inputs): Check
498 has_incremental_info_ flag; move setup code to setup_readers;
499 use input readers.
500 (Sized_incremental_binary::do_file_is_unchanged): New function.
501 (Sized_incremental_binary::do_get_input_reader): New function.
502 * incremental.h (class Incremental_binary): Move to end of file.
503 (Incremental_binary::file_is_unchanged): New function.
504 (Incremental_binary::do_file_is_unchanged): New function.
505 (Incremental_binary::Input_reader): New class.
506 (Incremental_binary::get_input_reader): New function.
507 (class Sized_incremental_binary): Move to end of file.
508 (Sized_incremental_binary::Sized_incremental_binary): Setup the
509 input section reader classes.
510 (Sized_incremental_binary::has_incremental_info): New function.
511 (Sized_incremental_binary::inputs_reader): New function.
512 (Sized_incremental_binary::symtab_reader): New function.
513 (Sized_incremental_binary::relocs_reader): New function.
514 (Sized_incremental_binary::got_plt_reader): New function.
515 (Sized_incremental_binary::do_file_is_unchanged): New function.
516 (Sized_incremental_binary::Sized_input_reader): New class.
517 (Sized_incremental_binary::get_input_reader): New function.
518 (Sized_incremental_binary::find_incremental_inputs_sections):
519 Rename do_find_incremental_inputs_sections to this.
520 (Sized_incremental_binary::setup_readers): New function.
521 (Sized_incremental_binary::has_incremental_info_): New data member.
522 (Sized_incremental_binary::inputs_reader_): New data member.
523 (Sized_incremental_binary::symtab_reader_): New data member.
524 (Sized_incremental_binary::relocs_reader_): New data member.
525 (Sized_incremental_binary::got_plt_reader_): New data member.
526 (Sized_incremental_binary::current_input_file_): New data member.
527
a869183f
PP
5282011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
529
530 PR gold/12640
531 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
532 violation.
533
5342011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
535
536 * archive.cc (Archive::include_member): Adjust call to report_object.
537 (Add_archive_symbols::run): Add script_info to call to
538 report_archive_begin.
539 (Lib_group::include_member): Adjust call to report_object.
540 (Add_lib_group_symbols::run): Adjust call to report_object.
541 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
542 blocks. Add object count for script input files.
543 * incremental.cc (Incremental_inputs::report_archive_begin): Add
544 script_info parameter; change all callers.
545 (Incremental_inputs::report_object): Add script_info parameter;
546 change all callers.
547 (Incremental_inputs::report_script): Store backpointer to
548 incremental info entry.
549 (Output_section_incremental_inputs::set_final_data_size): Record
550 additional information for scripts.
551 (Output_section_incremental_inputs::write_info_blocks): Likewise.
552 * incremental.h (Incremental_script_entry::add_object): New function.
553 (Incremental_script_entry::get_object_count): New function.
554 (Incremental_script_entry::get_object): New function.
555 (Incremental_script_entry::objects_): New data member; adjust
556 constructor.
557 (Incremental_inputs::report_archive_begin): Add script_info parameter.
558 (Incremental_inputs::report_object): Add script_info parameter.
559 (Incremental_inputs_reader::get_object_count): New function.
560 (Incremental_inputs_reader::get_object_offset): New function.
561 * options.cc (Input_arguments::add_file): Return reference to
562 new input argument.
563 * options.h (Input_argument::set_script_info): New function.
564 (Input_argument::script_info): New function.
565 (Input_argument::script_info_): New data member; adjust all
566 constructors.
567 (Input_file_group::add_file): Return reference to new input argument.
568 (Input_file_lib::add_file): Likewise.
569 (Input_arguments::add_file): Likewise.
570 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
571 * script.cc (Parser_closure::Parser_closure): Add script_info
572 parameter; adjust all callers.
573 (Parser_closure::script_info): New function.
574 (Parser_closure::script_info_): New data member.
575 (read_input_script): Report scripts earlier to incremental info.
576 (script_add_file): Set script_info in Input_argument.
577 (script_add_library): Likewise.
578 * script.h (Script_options::Script_info): Rewrite class.
579
a869183f 5802011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
581
582 * archive.cc (Library_base::should_include_member): Move
583 method here from class Archive.
584 (Archive::Archive): Initialize base class.
585 (Archive::should_include_member): Move to base class.
586 (Archive::do_for_all_unused_symbols): New function.
587 (Add_archive_symbols::run): Remove redundant access to
588 incremental_inputs.
589 (Lib_group::Lib_group): Initialize base class.
590 (Lib_group::do_filename): New function.
591 (Lib_group::include_member): Pass pointer to Lib_group to
592 report_object.
593 (Lib_group::do_for_all_unused_symbols): New function.
594 (Add_lib_group_symbols::run): Report archive information for
595 incremental links.
596 * archive.h (class Library_base): New base class.
597 (class Archive): Derive from Library_base.
598 (Archive::filename): Move to base class.
599 (Archive::set_incremental_info): Likewise.
600 (Archive::incremental_info): Likewise.
601 (Archive::Should_include): Likewise.
602 (Archive::should_include_member): Likewise.
603 (Archive::Armap_entry): Remove.
604 (Archive::Unused_symbol_iterator): Remove.
605 (Archive::unused_symbols_begin): Remove.
606 (Archive::unused_symbols_end): Remove.
607 (Archive::do_filename): New function.
608 (Archive::do_get_mtime): New function.
609 (Archive::do_for_all_unused_symbols): New function.
610 (Archive::task_): Move to base class.
611 (Archive::incremental_info_): Likewise.
612 (class Lib_group): Derive from Library_base.
613 (Lib_group::do_filename): New function.
614 (Lib_group::do_get_mtime): New function.
615 (Lib_group::do_for_all_unused_symbols): New function.
616 (Lib_group::task_): Move to base class.
617 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
618 function.
619 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
620 function.
621 * incremental.cc (Incremental_inputs::report_archive_begin):
622 Use Library_base; call library's get_mtime; add incremental inputs
623 entry before members.
624 (class Unused_symbol_visitor): New class.
625 (Incremental_inputs::report_archive_end): Use Library_base; use
626 visitor class to record unused symbols; don't add incremental inputs
627 entry after members.
628 (Incremental_inputs::report_object): Use Library_base.
629 * incremental.h
630 (Incremental_archive_entry::Incremental_archive_entry): Remove
631 unused Archive parameter.
632 (Incremental_inputs::report_archive_begin): Use Library_base.
633 (Incremental_inputs::report_archive_end): Likewise.
634 (Incremental_inputs::report_object): Likewise.
635 * object.cc (Sized_relobj::do_for_all_global_symbols): New
636 function.
637 * object.h (Object::for_all_global_symbols): New function.
638 (Object::do_for_all_global_symbols): New function.
639 (Sized_relobj::do_for_all_global_symbols): New function.
640 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
641 function.
642 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
643 function.
644
61ab3e40
ILT
6452011-03-27 Ian Lance Taylor <iant@google.com>
646
647 * archive.cc (Archive::interpret_header): Return -1 if something
648 goes wrong. Change callers accordingly.
649
30e1f9e6
CC
6502011-03-25 Cary Coutant <ccoutant@google.com>
651
652 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
653 * testsuite/Makefile.in: Regenerate.
654
9c793f14
RÁE
6552010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
656
657 * plugin.cc (get_view): New.
658 (Plugin::load): Pass get_view to the plugin.
659 (Plugin_manager::get_view): New.
660
9312bb0a
ILT
6612011-03-21 Ian Lance Taylor <iant@google.com>
662
663 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 664 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 665
7e12ba9e
ST
6662011-03-21 Sriraman Tallam <tmsriram@google.com>
667
668 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
669 Change == to -eq.
670 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
671 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
672 Change == to -eq.
673 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
674 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
675
fd7a005d
ILT
6762011-03-14 Ian Lance Taylor <iant@google.com>
677
678 * script-sections.cc (Sort_output_sections::script_compare):
679 Rename from is_before, change return type.
680 (Sort_output_sections::operator()): Adjust accordingly.
681
ed16fd1b
ILT
6822011-03-11 Jeffrey Yasskin <jyasskin@google.com>
683
684 PR gold/12572
685 * testsuite/odr_violation2.cc: Add comment to make all error line
686 numbers double digits.
687 * testsuite/debug_msg.sh: Adjust expected errors.
688
71ff8986
ILT
6892011-03-09 Jeffrey Yasskin <jyasskin@google.com>
690
691 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
692 but mark earlier ones as non-canonical
693 (offset_to_iterator): Update search target and example
694 (do_addr2line): Return extra lines in a vector*
695 (format_file_lineno): Extract from do_addr2line
696 (one_addr2line): Add vector* out-param
697 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
698 when a lineno entry appeared last for its instruction
699 (Dwarf_line_info): Add vector* out-param
700 * object.cc (Relocate_info): Pass NULL for the vector* out-param
701 * symtab.cc (Odr_violation_compare): Include the lineno in the
702 comparison again.
703 (linenos_from_loc): New. Combine the canonical line for an
704 address with its other lines.
705 (True_if_intersect): New. Helper functor to make
706 std::set_intersection a query.
707 (detect_odr_violations): Compare sets of lines instead of just
708 one line for each function. This became less deterministic, but
709 has fewer false positives.
710 * symtab.h: Declarations.
711 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
712 mix an optimized and non-optimized object in the same binary
713 (odr_violation2.so): Same.
714 * testsuite/Makefile.in: Regenerate from Makefile.am.
715 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
716 * testsuite/debug_msg.sh: Update line numbers and add
717 assertions.
718 * testsuite/odr_violation1.cc: Use OdrDerived, in a
719 non-optimized context.
720 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
721 isn't inlined, and use OdrDerived in an optimized context.
722 * testsuite/odr_header1.h: Defines OdrDerived, where
723 optimization will change the
724 first-instruction-in-the-destructor's file and line number.
725 * testsuite/odr_header2.h: Defines OdrBase.
726
a19fefdc
ILT
7272011-03-09 Ian Lance Taylor <iant@google.com>
728
729 * fileread.cc (File_read::clear_views): Don't delete the whole
730 file view.
731
ecb351e9
ILT
7322011-03-08 Ian Lance Taylor <iant@google.com>
733
734 PR gold/12525
735 * fileread.cc: #include <climits>.
736 (GOLD_IOV_MAX): Define.
737 (File_read::read_multiple): Limit number of entries by iov_max.
738 * fileread.h (class File_read): Always set max_readv_entries to
739 128.
740
b821d13c
ILT
7412011-03-07 Ian Lance Taylor <iant@google.com>
742
743 PR gold/12525
744 * options.h (class General_options): Add -dy and -dn.
745
89243142
CC
7462011-03-02 Cary Coutant <ccoutant@google.com>
747
748 * testsuite/script_test_9.t: Add TLS segment.
749
d0773f31
ILT
7502011-03-02 Simon Baldwin <simonb@google.com>
751
752 * configure.ac: Add check for gnu_indirect_function support in
753 the toolchain building binutils.
754 * configure: Rebuild.
755
badc8139
RÁE
7562010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
757
758 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
759 plugin only symbols.
760 (Symbol_table::sized_finalize_symbol) Mark symbol only present
761 in plugin files as not needed in the symbol table.
762
4cf7a849
ST
7632011-02-11 Sriraman Tallam <tmsriram@google.com>
764
765 * output.cc (Output_section::add_input_section): Delay fill
766 generation for section ordering.
767
b578bd7d
ILT
7682011-02-09 Ian Lance Taylor <iant@google.com>
769
770 PR gold/12316
771 * object.h (class Sized_relobj): Remove clear_local_symbols.
772 * reloc.cc (Sized_relobj::do_relocate): Don't call
773 clear_local_symbols.
774
84ced98a
RÁE
7752010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
776
777 * plugin.cc (is_visible_from_outside): Return true for symbols
778 in the -u option.
779
55382fb7
ILT
7802011-02-04 Jeffrey Yasskin <jyasskin@google.com>
781
782 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
783 filename.
784
4e271fff
ST
7852011-02-02 Sriraman Tallam <tmsriram@google.com>
786
787 * icf.h (is_section_foldable_candidate): Change type of parameter
788 to std::string.
789 * icf.cc (Icf::find_identical_sections): Change type of local variable
790 section_name to be std::string.
791 (is_function_ctor_or_dtor): Change type of parameter to std::string.
792
d433c3ac
ILT
7932011-01-25 Ian Lance Taylor <iant@google.com>
794
795 * script.cc (script_add_extern): Rewrite to use
796 add_symbol_reference.
797
880473a6
DK
7982011-01-25 Doug Kwan <dougkwan@google.com>
799
d433c3ac 800 * icf.cc (get_section_contents): Always lock section's object.
880473a6 801
f30f86fa
ILT
8022011-01-24 Ian Lance Taylor <iant@google.com>
803
804 * options.h (class General_options): Accept
805 --no-detect-odr-violations.
806
8e51a0b9
ILT
8072011-01-24 Ian Lance Taylor <iant@google.com>
808
809 * version.cc (version_string): Bump to 1.11.
810
0f3b89d8
ILT
8112011-01-24 Ian Lance Taylor <iant@google.com>
812
813 * plugin.cc (class Plugin_rescan): Define new class.
814 (Plugin_manager::claim_file): Set any_claimed_.
815 (Plugin_manager::save_archive): New function.
816 (Plugin_manager::save_input_group): New function.
817 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
818 necessary.
819 (Plugin_manager::new_undefined_symbol): New function.
820 (Plugin_manager::rescan): New function.
821 (Plugin_manager::rescannable_defines): New function.
822 (Plugin_manager::add_input_file): Set any_added_.
823 * plugin.h (class Plugin_manager): define new fields rescannable_,
824 undefined_symbols_, any_claimed_, and any_added_. Declare
825 Plugin_rescan as friend. Declare new functions.
826 (Plugin_manager::Rescannable): Define type.
827 (Plugin_manager::Rescannable_list): Define type.
828 (Plugin_manager::Undefined_symbol_list): Define type.
829 (Plugin_manager::Plugin_manager): Initialize new fields.
830 * archive.cc (Archive::defines_symbol): New function.
831 (Add_archive_symbols::run): Pass archive to plugins if any.
832 * archive.h (class Archive): Declare defines_symbol.
833 * readsyms.cc (Input_group::~Input_group): New function.
834 (Finish_group::run): Pass input_group to plugins if any.
835 * readsyms.h (class Input_group): Declare destructor.
836 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
837 any.
838
3bb951e5
ILT
8392011-01-10 Ian Lance Taylor <iant@google.com>
840
841 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
842 section as relro.
843 (Layout::set_segment_offsets): Reset increase_relro before calling
844 set_section_addresses a second time.
845
0aa45fac
CC
8462011-01-04 Cary Coutant <ccoutant@google.com>
847
848 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
849 sections before NOBITS sections.
850
0db46eb4
L
8512011-01-01 H.J. Lu <hongjiu.lu@intel.com>
852
853 * version.cc (print_version): Update copyright to 2011.
854
829c9745
CC
8552010-12-23 Cary Coutant <ccoutant@google.com>
856
857 * output.h (Output_data_reloc::add_output_section): Pass OD instead
858 of OS to this->add. Add OD parameter to second form of the function.
859
7500420b
ILT
8602010-12-20 Ian Lance Taylor <iant@google.com>
861
862 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
863 second of two consecutive entries with same offset.
864
f8e9a930
RW
8652010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
866
867 * testsuite/Makefile.am (ifuncmain2static_LDADD)
868 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
869 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
870 to avoid unneeded links against $(LDADD).
871 * testsuite/Makefile.in: Regenerate.
872
2fbb4320
ILT
8732010-12-15 Ian Lance Taylor <iant@google.com>
874
875 PR gold/12324
876 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
877 for R_X86_64_32 and R_X86_64_PC32.
878 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
879 ver_matching_def_pic.o.
880 (ver_matching_def_pic.o): New target.
881
fedb228d
RW
8822010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
883
884 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
885 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
886 Move definition before File_read::View member definitions.
887 (File_read::View::~View): Initialize and hold lock before
888 updating current_mapped_bytes.
889
9b547ce6
RW
8902010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
891
892 * dwarf_reader.cc: Remove outdated comment.
893 * gold-threads.cc: Fix typo in error message.
894 * archive.cc: Fix typos in comments.
895 * archive.h: Likewise.
896 * arm-reloc-property.cc: Likewise.
897 * arm-reloc-property.h: Likewise.
898 * arm-reloc.def: Likewise.
899 * arm.cc: Likewise.
900 * attributes.h: Likewise.
901 * cref.cc: Likewise.
902 * ehframe.cc: Likewise.
903 * fileread.h: Likewise.
904 * gold.h: Likewise.
905 * i386.cc: Likewise.
906 * icf.cc: Likewise.
907 * incremental.h: Likewise.
908 * int_encoding.cc: Likewise.
909 * layout.h: Likewise.
910 * main.cc: Likewise.
911 * merge.h: Likewise.
912 * object.cc: Likewise.
913 * object.h: Likewise.
914 * options.cc: Likewise.
915 * readsyms.cc: Likewise.
916 * reduced_debug_output.cc: Likewise.
917 * reloc.cc: Likewise.
918 * script-sections.cc: Likewise.
919 * sparc.cc: Likewise.
920 * symtab.h: Likewise.
921 * target-reloc.h: Likewise.
922 * target.cc: Likewise.
923 * target.h: Likewise.
924 * timer.cc: Likewise.
925 * timer.h: Likewise.
926 * x86_64.cc: Likewise.
927
83e17bd5
CC
9282010-12-09 Cary Coutant <ccoutant@google.com>
929
930 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
931 stack.
932 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
933 parameter; change all callers.
934 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
935 * options.h (warn_execstack): New option.
936
017257f8
DK
9372010-12-07 Doug Kwan <dougkwan@google.com>
938
939 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
940 like function call relocations.
941
c20cbc06
ILT
9422010-12-07 Ian Lance Taylor <iant@google.com>
943
944 * archive.cc (Archive::get_elf_object_for_member): Permit
945 punconfigured to be NULL.
946 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
947 (Archive::include_member): Pass NULL to get_elf_object_for_member
948 if we searched for the archive and this is the first included
949 object.
950
4dbfafcc
ILT
9512010-12-01 Ian Lance Taylor <iant@google.com>
952
953 * dwarf_reader.h (class Sized_dwarf_line_info): Add
954 track_relocs_type_ field.
955 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
956 Set track_relocs_type_.
957 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
958 contents when using RELA relocs.
959 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
960 reloc_map_.
961 * reloc.cc (Track_relocs::next_addend): New function.
962 * reloc.h (class Track_relocs): Declare next_addend.
963
e5e19edd
ILT
9642010-12-01 Ian Lance Taylor <iant@google.com>
965
966 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
967 virtual destructor.
968
9a5ce24c
ILT
9692010-12-01 Ian Lance Taylor <iant@google.com>
970
971 * README: Update compilers known to work and fail.
972
c7791212
NC
9732010-11-23 Matthias Klose <doko@ubuntu.com>
974
975 * configure.in: For --enable-gold, handle value `default' instead of
976 `both*'. Always install ld as ld.bfd, install as ld if gold is
977 not the default.
978 * configure: Regenerate.
979
0ad220c9
DK
9802010-11-18 Doug Kwan <dougkwan@google.com>
981
982 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
983 and right_alignment to be zero. Store result alignment only if it is
984 greater than existing alignment.
985
ab8056e0
CC
9862010-11-16 Cary Coutant <ccoutant@google.com>
987
988 PR gold/12220
989 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
990 Check for ".zdebug_line".
991
fd064a5b
CC
9922010-11-16 Doug Kwan <dougkwan@google.com>
993 Cary Coutant <ccoutant@google.com>
994
995 * output.h (Output_segment::set_section_addresses): Pass increase_relro
996 by reference; adjust all callers.
997 * output.cc (Output_segment::set_section_addresses): Adjust references
998 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
999 list is empty.
1000 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1001 end at page boundary.
1002
6fc6ea19
CC
10032010-11-16 Cary Coutant <ccoutant@google.com>
1004
1005 PR gold/12220
1006 * layout.cc (Layout::choose_output_section): Transform names of
1007 compressed sections even when using a script with a SECTIONS clause.
1008 (Layout::output_section_name): Remove code to transform
1009 compressed debug section names.
1010 * output.cc (Output_section::add_input_section): Use uncompressed
1011 section size when tracking input sections.
1012
95a2c8d6
RS
10132010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1014
1015 * symtab.h (Symbol::NON_PIC_REF): Remove.
1016 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1017 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1018 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1019 (Symbol::use_plt_offset): Take a flags argument and pass it
1020 directly to needs_dynamic_reloc. Restrict check for undefined
1021 weak symbols to function calls.
1022 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1023 (Target_arm::Scan::global): Use it.
1024 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1025 (Target_arm::Relocate::relocate): Likewise.
1026 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1027 parameter with an r_type parameter. Use get_reference_flags
1028 to get the flags.
1029 (Target_arm::Relocate::relocate): Update accordingly.
1030 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1031 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1032 (Target_i386::Scan::global): Likewise.
1033 (Target_i386::Relocate::relocate): Likewise.
1034 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1035 parameter with an r_type parameter. Use get_reference_flags
1036 to get the flags.
1037 (Target_i386::Relocate::relocate): Update accordingly.
1038 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1039 (Target_powerpc::Scan::global): Use it.
1040 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1041 (Target_powerpc::Relocate::relocate): Likewise.
1042 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1043 (Target_sparc::Scan::global): Use it.
1044 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1045 (Target_sparc::Relocate::relocate): Likewise.
1046 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1047 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1048 (Target_x86_64::Scan::global): Likewise.
1049 (Target_x86_64::Relocate::relocate): Likewise.
1050
f625ae50
DK
10512010-11-08 Doug Kwan <dougkwan@google.com>
1052 Cary Coutant <ccoutant@google.com>
1053
1054 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1055 (Arm_exidx_merge_section::section_contents_): New data member.
1056 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1057 (Arm_input_section::~Arm_input_section): De-allocate memory.
1058 (Arm_input_section::original_contents_): New data member.
1059 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1060 in parameters instead of calling Object::section_contents without
1061 locking.
1062 (Arm_output_section::group_section): New parameter TASK. Pass it
1063 to callees that need locking objects.
1064 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1065 to lock EXIDX input sections. Fix a formatting issue. Call
1066 Arm_exidx_merged_section::build_contents to create merged section
1067 contents.
1068 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1069 to lock object of stub table owner.
1070 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1071 TEXT_SIZE to initialize data member TEXT_SIZE_.
1072 (Arm_exidx_input_section::addralign): Fix typo in comment.
1073 (Arm_exidx_input_section::text_size): New method.
1074 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1075 that require locking objects. Lock objects before scanning for stubs
1076 and updating local symbols.
1077 (Arm_input_section<big_endian>::init): Copy contents of original
1078 input section.
1079 (Arm_input_section<big_endian>::do_write): Use saved contents of
1080 original input section instead of calling Object::section_contents
1081 without locking.
1082 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1083 size without calling Object::section_size().
1084 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1085 for size. Allocate a buffer for merged EXIDX entries.
1086 (Arm_exidx_merged_section::build_contents): New method.
1087 (Arm_exidx_merged_section::do_write): Move merge section contents
1088 building code to Arm_exidx_merged_section::build_contetns. Write
1089 out contetns in buffer instead of building it on the fly.
1090 (Arm_relobj::make_exidx_input_section): Also pass text section size
1091 to Arm_exidx_input_section constructor.
1092 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1093 (Arm_dynobj::do_read_symbols): Fix memory leak.
1094 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1095 * target.h: (class Task): Add forward declaration.
1096 (Target::relax): Add new parameter TASK and pass it to
1097 Target::do_relax().
1098 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1099
5f9bcf58
CC
11002010-11-05 Cary Coutant <ccoutant@google.com>
1101
1102 PR gold/10708
1103 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1104 object when reading from the file.
1105 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1106 second layout pass.
1107 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1108 when reading section contents.
1109 (get_section_contents): Likewise.
1110 (icf::find_identical_sections): Likewise.
1111 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1112 object when reading from the file.
1113 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1114 the object when doing deferred section layout.
1115
e597fa08
NC
11162010-11-03 Nick Clifton <nickc@redhat.com>
1117
1118 PR gold/12001
1119 * script.h (class Symbol_assignment: name): New member. Returns
1120 the name of the symbol.
1121 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1122 Returns true if the given symbol name is on the list of
1123 assignments wating to be processed.
1124 * archive.cc (should_incldue_member): If the symbol is undefined,
1125 check to see if it is on the list of symbols pending assignment.
1126
3f9a3278
ILT
11272010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1128
1129 * script-sections.cc (Script_sections::find_memory_region): Check
1130 for a NULL output section pointer.
1131
d06fb4d1
DK
11322010-10-29 Doug Kwan <dougkwan@google.com>
1133
1134 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1135 Output_section::add_relaxed_input_section.
1136 * output.cc (Output_section::add_relaxed_input_section): Add new
1137 arguments LAYOUT and NAME. Set section order index.
1138 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1139 Copy section order index.
1140 * output.h (Output_section::add_relaxed_input_section): Add new
1141 arguments LAYOUT and NAME.
1142
90e24de5
ILT
11432010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1144
1145 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1146 NATIVE_OR_CROSS_LINKER.
1147 * testsuite/Makefile.in: Regenerate.
1148
c9484ea5
DK
11492010-10-20 Doug Kwan <dougkwan@google.com>
1150
1151 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1152 without SHF_LINK_ORDER flags.
1153 * layout.cc (Layout::choose_output_section): Do not filter
1154 SHF_LINK_ORDER flag in a relocatable link.
1155
5bc2f5be
CC
11562010-10-17 Cary Coutant <ccoutant@google.com>
1157
1158 * output.h (Output_segment::set_section_addresses): Change function
1159 signature. Update all callers.
1160 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1161 sections.
1162 (Output_segment::set_section_addresses): Align after last TLS
1163 section. Add padding before last relro section instead of after.
1164
0c91cf04
DK
11652010-10-17 Doug Kwan <dougkwan@google.com>
1166
1167 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1168 GOT output section to be writable.
1169
8c21d9d3
CC
11702010-10-14 Cary Coutant <ccoutant@google.com>
1171
1172 * debug.h (DEBUG_INCREMENTAL): New flag.
1173 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1174 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1175 mode.
1176 * incremental.cc (report_command_line): Ignore all forms of
1177 --incremental.
1178 * layout.cc (Layout::Layout): Check parameters for incremental link
1179 mode.
1180 * options.cc (General_options::parse_incremental): New function.
1181 (General_options::parse_no_incremental): New function.
1182 (General_options::parse_incremental_full): New function.
1183 (General_options::parse_incremental_update): New function.
1184 (General_options::incremental_mode_): New data member.
1185 (General_options::finalize): Check incremental_mode_.
1186 * options.h (General_options): Update help text for --incremental.
1187 Add --no-incremental, --incremental-full, --incremental-update.
1188 (General_options::Incremental_mode): New enum type.
1189 (General_options::incremental_mode): New function.
1190 (General_options::incremental_mode_): New data member.
1191 * parameters.cc (Parameters::incremental_mode_): New data member.
1192 (Parameters::set_options): Set incremental_mode_.
1193 (Parameters::set_incremental_full): New function.
1194 (Parameters::incremental): New function.
1195 (Parameters::incremental_update): New function.
1196 (set_parameters_incremental_full): New function.
1197 * parameters.h (Parameters::set_incremental_full): New function.
1198 (Parameters::incremental): New function.
1199 (Parameters::incremental_update): New function.
1200 (Parameters::incremental_mode_): New data member.
1201 (set_parameters_incremental_full): New function.
1202 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1203 incremental link mode.
1204 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1205 (Sized_relobj::do_relocate_sections): Likewise.
1206 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1207 option.
1208 * testsuite/Makefile.in: Regenerate.
1209 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1210
bb32aa18 12112010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1212
1213 * script-sections.h (class Script_sections): Make
1214 Sections_elements typedef public.
1215 * script-sections.cc (class Sort_output_sections): Add elements_
1216 field. Add constructor which sets it; change all callers.
1217 (Sort_output_sections::is_before): New function.
1218 (Sort_output_sections::operator()): Call is_before.
1219 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1220 conditional.
1221 * testsuite/script_test_10.sh: New test. Test script section
1222 order.
1223 * testsuite/script_test_10.t: Likewise.
1224 * testsuite/script_test_10.s: Likewise.
1225 * testsuite/Makefile.am: Wrap the cross linker tests and the
1226 common tests into NATIVE_OR_CROSS_LINKER.
1227 (check_SCRIPTS): Add script_test_10.sh.
1228 (check_DATA): Add script_test_10.stdout.
1229 (script_test_10.o, script_test_10): New targets.
1230 (script_test_10.stdout): New target.
1231 * configure, testsuite/Makefile.in: Regenerate.
1232
3cef7179
ILT
12332010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1234
1235 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
1236 error for the deprecated relocations.
1237 (Target_arm::Scan::global): Likewise.
1238 (Target_arm::Relocate::relocate): Likewise.
1239
7411e9a8
RS
12402010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
1241
1242 * fileread.cc (Input_file::find_file): Initialize *found_name
1243 and *namep when using the fallback search for case 4.
1244
6a9da32a
CC
12452010-10-11 Cary Coutant <ccoutant@google.com>
1246
1247 * options.h (class General_options): Redefine -z lazy as an alias for
1248 the negation of -z now.
1249
ac897c20
ILT
12502010-10-11 Ian Lance Taylor <iant@google.com>
1251
1252 * resolve.cc (symbol_to_bits): Report the value of the unsupported
1253 binding.
1254
ea5cae92
NC
12552010-10-06 Nick Clifton <nickc@redhat.com>
1256
1257 * script-sections.cc(class Memory_region): Remove
1258 current_lma_offset_ field. Rename current_vma_offset_ to
1259 current_offset_. Add last_section_ field.
1260 (Memory_region::get_current_vma_address): Rename to
1261 get_current_address.
1262 (Memory_region::get_current_lma_address): Delete.
1263 (Memory_region::increment_vma_offset): Rename to
1264 increment_offset.
1265 (Memory_region::increment_lma_offset): Delete.
1266 (Memory_region::attributes_compatible): New method. Returns
1267 true if the provided section is compatible with the region.
1268 (Memory_region::get_last_section): New method. Returns the last
1269 section to use the region.
1270 (Memory_region::set_last_section): New method. Stores the last
1271 section to use the region.
1272 (Script_sections::block_in_region): New method. Returns true if
1273 a block of memory is contained within a region.
1274 (Script_sections::find_memory_region): New method. Locates a
1275 memory region to be used to set a VMA or LMA address.
1276 (Output_section_definition::set_section_addresses): Add code to
1277 check for addresses set by memory regions.
1278 (Output_segment::set_section_addresses): Remove memory region
1279 walking code.
1280 (Script_sections::create_segment): Add a warning if a header
1281 segment is created outside of any region.
1282 * script-sections.h (class Script_sections): Add prototypes for
1283 find_memory_region and block_in_region methods.
1284 * testsuite/memory_test.s: Use .long instead of .word.
1285 * testsuite/memory_test.t: Add some more output sections.
1286 * testsuite/memory_test.sh: Update expected output.
1287
a9bfd952
DK
12882010-10-02 Doug Kwan <dougkwan@google.com>
1289
1290 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
1291 defintion to symtab.h
1292 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
1293 declaration to defintion.
1294
bacff3ab
NC
12952010-10-01 Nick Clifton <nickc@redhat.com>
1296
1297 * expression.cc (eval): Replace dummy argument with NULL.
1298 (eval_maybe_dot): Check for a NULL result section pointer.
1299 (Symbol_expression::value): Likewise.
1300 (Dot_expression::value): Likewise.
1301 (BINARY_EXPRESSION): Likewise.
1302 (Max_expression::value): Likewise.
1303 (Min_expression::value): Likewise.
1304 (Absolute_expression::value): Likewise.
1305 (Addr_expression::value_from_output_section): Likewise.
1306 (Loaddddr_expression::value_from_output_section): Likewise.
1307 (Segment_start_expression::value): Likewise.
1308 * script-sections.cc
1309 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
1310 argument with NULL.
1311 (Sections_elememt_dot_assignment::set_section_addresses):
1312 Likewise.
1313 (Output_data_expression::do_write_to_buffer): Likewise.
1314 (Output_section_definition::finalize_symbols): Likewise.
1315 (Output_section_definition::set_section_addresses): Likewise.
1316
f81bc8b5
DK
13172010-09-30 Doug Kwan <dougkwan@google.com>
1318
1319 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
1320
c95e9f27
ST
13212010-09-28 Sriraman Tallam <tmsriram@google.com>
1322
1323 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 1324 function.
c95e9f27
ST
1325 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
1326 virtual function.
1327 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
1328 virtual function.
1329 * icf.cc (get_section_contents): Inline merge sections only when
1330 target allows it.
1331
3cac54d2
RW
13322010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1333
1334 * configure: Regenerate.
1335
2904037a
ILT
13362010-09-17 Ian Lance Taylor <iant@google.com>
1337
1338 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
1339 * testsuite/Makefile.am (memory_test.o): New target.
1340 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
1341 memory_test.t.
1342 * testsuite/Makefile.in: Rebuild.
2904037a 1343
bca7fb63
DK
13442010-09-17 Doug Kwan <dougkwan@google.com>
1345
1346 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
1347 defintion if relocation uses GOT entries of the symbol.
1348 * testsuite/icf_safe_test.sh: Fix test.
1349 * testsuite/icf_safe_so_test.sh: Fix test.
1350
4ef28648
CC
13512010-09-16 Cary Coutant <ccoutant@google.com>
1352
1353 * script_sections.cc (class Memory_region): Remove "NULL" from
1354 vector initializations.
1355
793990de
CC
13562010-09-15 Cary Coutant <ccoutant@google.com>
1357
1358 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
1359 Resolve forwarding symbols.
1360
81e015e2
DK
13612010-09-15 Doug Kwan <dougkwan@google.com>
1362
1363 * gold/testsuite/script_test_3.t: Add ARM special sections.
1364 * gold/testsuite/script_test_4.t: Same.
1365 * gold/testsuite/script_test_5.t: Same.
1366 * gold/testsuite/script_test_6.t: Same.
1367 * gold/testsuite/script_test_7.t: Same.
1368 * gold/testsuite/script_test_7.t: Same.
1369 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
1370
36171d64
CC
13712010-09-14 Cary Coutant <ccoutant@google.com>
1372
1373 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
1374 (Target_x86_64::Relocate::relocate_tls): Replace check for
1375 saw_tls_block_reloc_ with test for executable section.
1376
d89051bd
CC
13772010-09-12 Cary Coutant <ccoutant@google.com>
1378
1379 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
1380 position-independent executables to shared libraries need dynamic
1381 relocations.
1382 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
1383 position-independent executables.
1384 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
1385 * testsuite/Makefile.in: Regenerate.
1386
fca41f0f
NC
13872010-09-10 Nick Clifton <nickc@redhat.com>
1388
1389 PR gold/11997
1390 * testsuite/memory_test.t: Discard any sections that are not
1391 needed.
1392
6695e4b3
L
13932010-09-09 H.J. Lu <hongjiu.lu@intel.com>
1394
1395 PR gold/11996
1396 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
1397 "This::" to work around a bug in gcc 4.2.
1398
1399 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
1400
0f72bf6f
RÁE
14012010-09-09 Rafael Espindola <espindola@google.com>
1402
1403 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
1404 sections with different PF_X flags in the same segment.
1405 (Layout::find_first_load_seg): Search all segments to find the first
1406 one.
1407 * options.h (rosegment): New.
1408
14092010-09-08 Rafael Espindola <espindola@google.com>
a6577478 1410
05a79166 1411 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 1412
aa98ff75
DK
14132010-09-08 Doug Kwan <dougkwan@google.com>
1414
1415 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
1416 (Arm_relobj::do_relocate_sections): Add new parameter for output
1417 file to match the parent.
1418 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
1419 of local symbols instead of input values. Update code to track
1420 changes in gold::relocate_section.
1421 * object.cc (Sized_relobj::compute_final_local_value): New methods.
1422 (Sized_relobj::compute_final_local_value_internal): New methods.
1423 (Sized_relobj::do_finalize_local_symbols): Move code from loop
1424 body into private version of Sized_relobj::compute_final_local_value.
1425 Call the inline method.
1426 * object.h (Symbol_value::Symbol_value): Define destructor. Free
1427 merged symbol value if there is one.
1428 (Symbol_value::has_output_value): New method defintiion.
1429 (Sized_relobj::Compute_final_local_value_status): New enum type.
1430 (Sized_relobj::compute_final_local_value): New methods.
1431 (Sized_relobj::compute_final_local_value_internal): New methods.
1432 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
1433 and arm_cortex_a8.sh.
1434 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
1435 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
1436 New tests.
1437 * Makefile.in: Regenerate.
1438 * testsuite/arm_bl_out_of_range.s: Update test.
1439 * testsuite/thumb_bl_out_of_range.s: Ditto.
1440 * testsuite/thumb_blx_out_of_range.s: Ditto.
1441 * testsuite/arm_branch_out_of_range.sh: New file.
1442 * testsuite/arm_cortex_a8.sh: Ditto.
1443 * testsuite/arm_cortex_a8_b.s: Ditto.
1444 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
1445 * testsuite/arm_cortex_a8_b_local.s: Ditto.
1446 * testsuite/arm_cortex_a8_bl.s: Ditto.
1447 * testsuite/arm_cortex_a8_blx.s: Ditto.
1448 * testsuite/arm_cortex_a8_local.s: Ditto.
1449 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
1450 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
1451
05a79166
L
14522010-09-08 Rafael Espindola <espindola@google.com>
1453
1454 * Makefile.am (memory_test.stdout): Run readelf with -W.
1455 * Makefile.in: Regenerate.
1456 * testsuite/memory_test.sh: Make the regexps accept both 32 and
1457 64 bit output.
1458
33dbc701
RÁE
14592010-09-08 Rafael Espindola <espindola@google.com>
1460
1461 * script-sections.cc (Script_sections::add_memory_region): Convert
1462 field precision to int.
1463 * script.cc (script_set_section_region, script_set_section_region):
1464 Convert field precision to int.
1465
731ca54a
RÁE
14662010-09-08 Rafael Espindola <espindola@google.com>
1467
1468 * arm.cc (do_finalize_sections): Create the __exidx_start and
1469 __exdix_end symbols even when the section is missing.
1470
7f8cd844
NC
14712010-09-08 Nick Clifton <nickc@redhat.com>
1472
1473 * README: Remove claim that MEMORY is not supported.
1474 * expression.cc (script_exp_function_origin)
1475 (script_exp_function_length): Move from here to ...
1476 * script.cc: ... here.
1477 (script_set_section_region, script_add_memory)
1478 (script_parse_memory_attr, script_include_directive): New
1479 functions.
1480 * script-sections.cc
1481 (class Memory_region): New class.
1482 (class Output_section_definition): Add set_memory_region,
1483 set_section_vma, set_section_lma and get_section_name methods.
1484 (class Script_Sections): Add add_memory_region,
1485 find_memory_region, find_memory_region_origin,
1486 find_memory_region_length and set_memory_region methods.
1487 Have set_section_addresses method walk the list of set memory
1488 regions.
1489 Extend the print methos to display memory regions.
1490 * script-sections.h: Add prototypes for new methods.
1491 Add enum for MEMORY region attributes.
1492 * yyscript.y: Add support for parsing MEMORY regions.
1493 * script-c.h: Add prototypes for new functions.
1494 * testsuite/Makefile.am: Add test of MEMORY region functionality.
1495 * testsuite/Makefile.in: Regenerate.
1496 * testsuite/memory_test.sh: New script.
1497 * testsuite/memory_test.s: New assembler source file.
1498 * testsuite/memory_test.t: New linker script.
1499
a4649286
DK
15002010-08-27 Doug Kwan <dougkwan@google.com>
1501
1502 * gold/resolve.cc (Symbol_table::should_override): Let a weak
1503 reference override an existing dynamic weak reference.
1504 * testsuite/Makefile.am: Add new test dyn_weak_ref.
1505 * testsuite/Makefile.in: Regenerate.
1506 * testsuite/dyn_weak_ref.sh: New file.
1507 * testsuite/dyn_weak_ref_1.c: Ditto.
1508 * testsuite/dyn_weak_ref_2.c: Ditto.
1509
b56648ad
ILT
15102010-08-27 Ian Lance Taylor <iant@google.com>
1511
1512 * incremental.h (class Incremental_input_entry): Add virtual
1513 destructor.
1514
809313cb
ILT
15152010-08-27 Ian Lance Taylor <iant@google.com>
1516
1517 * testsuite/start_lib_test_3.c: Mark t3 as used.
1518
11e32464
NC
15192010-08-27 Nick Clifton <nickc@redhat.com>
1520
1521 * options.cc (version_script): Fix small typo in previous
1522 whitespace tidyup.
1523
ca09d69a
NC
15242010-08-25 Nick Clifton <nickc@redhat.com>
1525
1526 * archive.cc: Formatting fixes: Remove whitespace between
1527 typename and following asterisk. Remove whitespace between
1528 function name and opening parenthesis.
1529 * archive.h: Likewise.
1530 * arm.cc: Likewise.
1531 * attributes.cc: Likewise.
1532 * attributes.h: Likewise.
1533 * common.cc: Likewise.
1534 * copy-relocs.cc: Likewise.
1535 * dirsearch.h: Likewise.
1536 * dynobj.cc: Likewise.
1537 * ehframe.cc: Likewise.
1538 * ehframe.h: Likewise.
1539 * expression.cc: Likewise.
1540 * fileread.cc: Likewise.
1541 * fileread.h: Likewise.
1542 * gc.h: Likewise.
1543 * gold-threads.cc: Likewise.
1544 * gold.cc: Likewise.
1545 * i386.cc: Likewise.
1546 * icf.h: Likewise.
1547 * incremental-dump.cc: Likewise.
1548 * incremental.cc: Likewise.
1549 * layout.cc: Likewise.
1550 * layout.h: Likewise.
1551 * main.cc: Likewise.
1552 * merge.cc: Likewise.
1553 * merge.h: Likewise.
1554 * object.cc: Likewise.
1555 * object.h: Likewise.
1556 * options.cc: Likewise.
1557 * options.h: Likewise.
1558 * output.cc: Likewise.
1559 * output.h: Likewise.
1560 * plugin.cc: Likewise.
1561 * plugin.h: Likewise.
1562 * powerpc.cc: Likewise.
1563 * reloc.cc: Likewise.
1564 * script-c.h: Likewise.
1565 * script-sections.cc: Likewise.
1566 * script.cc: Likewise.
1567 * stringpool.cc: Likewise.
1568 * symtab.cc: Likewise.
1569 * symtab.h: Likewise.
1570 * target.cc: Likewise.
1571 * timer.cc: Likewise.
1572 * timer.h: Likewise.
1573 * version.cc: Likewise.
1574 * x86_64.cc: Likewise.
1575
b8fa8750
NC
15762010-08-24 Nick Clifton <nickc@redhat.com>
1577
1578 PR 11899
1579 * layout.cc (segment_precedes): Sort segments by their physical
1580 addresses, if they have been set.
1581
9919d93b
CC
15822010-08-23 Cary Coutant <ccoutant@google.com>
1583
1584 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
1585 symbols data.
1586 (Lib_group::include_member): Unlock object after deleting its
1587 symbols data.
1588 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
1589 the bug fixed here.
1590
97b4be1c
CC
15912010-08-19 Neil Vachharajani <nvachhar@google.com>
1592 Cary Coutant <ccoutant@google.com>
1593
1594 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
1595 constructor, and set_blocker.
1596 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
1597 readsyms_blocker_.
1598 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
1599 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
1600 * testsuite/Makefile.am (start_lib_test): New test case.
1601 * testsuite/Makefile.in: Regenerate.
1602 * testsuite/start_lib_test_main.c: New file.
1603 * testsuite/start_lib_test_1.c: New file.
1604 * testsuite/start_lib_test_2.c: New file.
1605 * testsuite/start_lib_test_3.c: New file.
1606
dd0b1884
ILT
16072010-08-19 Ian Lance Taylor <iant@google.com>
1608
1609 * Makefile.in: Rebuild with automake 1.11.1.
1610 * aclocal.m4: Likewise.
1611 * testsuite/Makefile.in: Likewise.
1612
7223e9ca
ILT
16132010-08-19 Ian Lance Taylor <iant@google.com>
1614
1615 PR 10893
1616 * i386.cc (class Output_data_plt_i386): Update declarations.
1617 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
1618 local_ifuncs_ fields.
1619 (Target_i386::do_plt_section_for_global): New function.
1620 (Target_i386::do_plt_section_for_local): New function.
1621 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
1622 parameter; change all callers. Initialize global_ifuncs_ and
1623 local_ifuncs_. If doing a static link define __rel_iplt_start and
1624 __rel_iplt_end.
1625 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
1626 (Output_data_plt_i386::add_local_ifunc_entry): New function.
1627 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
1628 symbols.
1629 (Target_i386::make_plt_section): New function, broken out of
1630 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
1631 (Target_i386::make_plt_entry): Call make_plt_section.
1632 (Target_i386::make_local_ifunc_plt_entry): New function.
1633 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
1634 (Target_i386::Scan::local): Handle IFUNC symbols. Add
1635 R_386_IRELATIVE to switch.
1636 (Target_i386::Scan::global): Likewise.
1637 (Target_i386::Relocate::relocate): Likewise.
1638 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
1639 switch.
1640 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
1641 (Target_x86_64::do_plt_section_for_global): New function.
1642 (Target_x86_64::do_plt_section_for_local): New function.
1643 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
1644 parameter; change all callers. If doing a static link define
1645 __rela_iplt_start and __rela_iplt_end.
1646 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
1647 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
1648 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
1649 to point to .plt.
1650 (Target_x86_64::make_local_ifunc_plt_entry): New function.
1651 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
1652 switch.
1653 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
1654 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
1655 R_X86_64_IRELATIVE to switch.
1656 (Target_x86_64::Scan::global): Likewise.
1657 (Target_x86_64::Relocate::relocate): Likewise.
1658 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
1659 switch.
1660 * target.h (class Target): Add plt_section_for_global and
1661 plt_section_for_local functions. Add do_plt_section_for_global
1662 and do_plt_section_for_local virtual functions.
1663 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
1664 clarifying comments.
1665 (Symbol::use_plt_offset): Handle IFUNC symbol.
1666 * object.cc (Sized_relobj::Sized_relobj): Initialize
1667 local_plt_offsets_.
1668 (Sized_relobj::local_has_plt_offset): New function.
1669 (Sized_relobj::local_plt_offset): New function.
1670 (Sized_relobj::set_local_plt_offset): New function.
1671 (Sized_relobj::do_count): Handle IFUNC symbol.
1672 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
1673 a bit away from input_shndx_ field. Add set_is_func_symbol and
1674 is_ifunc_symbol functions.
1675 (class Sized_relobj): Update declarations. Remove Tls_got_entry
1676 and Local_tls_got_offsets. Define Local_plt_offsets. Add
1677 local_plt_offsets_ field.
1678 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
1679 * output.h (class Output_section_data): Add non-const
1680 output_section function.
1681 (class Output_data_got): Update declarations.
1682 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
1683 Add use_plt_offset parameter to global and local constructors.
1684 Change all callers. Change local_sym_index_ field to 31 bits.
1685 Change GSYM_CODE and CONSTANT_CODE accordingly.
1686 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
1687 doing a static link don't set sh_link field.
1688 (Output_data_got::Got_entry::write): Use PLT offset if
1689 appropriate.
1690 (Output_data_got::add_global_plt): New function.
1691 (Output_data_got::add_local_plt): New function.
1692 * target-reloc.h (relocate_section): Handle IFUNC symbol.
1693 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
1694 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
1695 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
1696 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
1697 IFUNC conditional.
1698 * testsuite/ifunc-sel.h: New file.
1699 * testsuite/ifuncmain1.c: New file.
1700 * testsuite/ifuncmain1vis.c: New file.
1701 * testsuite/ifuncmod1.c: New file.
1702 * testsuite/ifuncdep2.c: New file.
1703 * testsuite/ifuncmain2.c: New file.
1704 * testsuite/ifuncmain3.c: New file.
1705 * testsuite/ifuncmod3.c: New file.
1706 * testsuite/ifuncmain4.c: New file.
1707 * testsuite/ifuncmain5.c: New file.
1708 * testsuite/ifuncmod5.c: New file.
1709 * testsuite/ifuncmain6pie.c: New file.
1710 * testsuite/ifuncmod6.c: New file.
1711 * testsuite/ifuncmain7.c: New file.
1712 * configure, testsuite/Makefile.in: Rebuild.
1713
56f75c03
ILT
17142010-08-18 Ian Lance Taylor <iant@google.com>
1715
1716 * incremental.cc
1717 (Output_section_incremental_inputs::write_input_files): Add cast
1718 to avoid signed/unsigned comparison warning.
1719 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1720
55455f89
CC
17212010-08-12 Cary Coutant <ccoutant@google.com>
1722
1723 * common.cc (Sort_commons::operator()): Remove unnecessary code.
1724
e2054bcb
ILT
17252010-08-13 Ian Lance Taylor <iant@google.com>
1726
1727 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
1728
74f67560
DK
17292010-08-12 Cary Coutant <ccoutant@google.com>
1730 Doug Kwan <dougkwan@google.com>
1731
1732 * resolve.cc (Symbol_table::should_override): When a weak dynamic
1733 defintion overrides non-weak undef, remember that the original undef
1734 is not weak.
1735 * symtab.cc (Symbol_table::sized_write_global): For undef without
1736 an original weak binding, set binding to global in output.
1737 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
1738 * testsuite/Makefile.in: Regenerate.
1739 * testsuite/strong_ref_weak_def.sh: New file.
1740 * testsuite/strong_ref_weak_def_1.c: Ditto.
1741 * testsuite/strong_ref_weak_def_2.c: Ditto.
1742
d1238d12
CC
17432010-08-12 Cary Coutant <ccoutant@google.com>
1744
1745 * testsuite/incremental_test.sh: Rewrite.
1746 * testsuite/incremental_test_1.c: Rewrite.
1747 * testsuite/incremental_test_2.c: Rewrite.
1748
0e70b911
CC
17492010-08-12 Cary Coutant <ccoutant@google.com>
1750
1751 * arm.cc (Target_arm::got_size): Add const.
1752 (Target_arm::got_entry_count): New function.
1753 (Target_arm::plt_entry_count): New function.
1754 (Target_arm::first_plt_entry_offset): New function.
1755 (Target_arm::plt_entry_size): New function.
1756 (Output_data_plt_arm::entry_count): New function.
1757 (Output_data_plt_arm::first_plt_entry_offset): New function.
1758 (Output_data_plt_arm::get_plt_entry_size): New function.
1759 * i386.cc (Target_i386::got_size): Add const.
1760 (Target_i386::got_entry_count): New function.
1761 (Target_i386::plt_entry_count): New function.
1762 (Target_i386::first_plt_entry_offset): New function.
1763 (Target_i386::plt_entry_size): New function.
1764 (Output_data_plt_i386::entry_count): New function.
1765 (Output_data_plt_i386::first_plt_entry_offset): New function.
1766 (Output_data_plt_i386::get_plt_entry_size): New function.
1767 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
1768 find_incremental_inputs_sections. Dump incremental_got_plt section.
1769 * incremental.cc: Include target.h.
1770 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
1771 parameter. Adjust all callers. Find incremental_got_plt section.
1772 (Incremental_inputs::create_data_sections): Create incremental_got_plt
1773 section.
1774 (Output_section_incremental_inputs::set_final_data_size): Calculate
1775 size of incremental_got_plt section.
1776 (Output_section_incremental_inputs::do_write): Write the
1777 incremental_got_plt section.
1778 (Got_plt_view_info): New struct.
1779 (Local_got_offset_visitor): New class.
1780 (Global_got_offset_visitor): New class.
1781 (Global_symbol_visitor_got_plt): New class.
1782 (Output_section_incremental_inputs::write_got_plt): New function.
1783 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
1784 Add parameter. Adjust all callers.
1785 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1786 (Incremental_inputs::got_plt_section): New function.
1787 (Incremental_inputs::got_plt_section_): New data member.
1788 (Incremental_got_plt_reader): New class.
1789 * layout.cc (Layout::create_incremental_info_sections): Add the
1790 incremental_got_plt section.
1791 * object.h (Got_offset_list::get_list): New function.
1792 (Got offset_list::for_all_got_offsets): New function.
1793 (Sized_relobj::local_got_offset_list): New function.
1794 * powerpc.cc (Target_powerpc::got_size): Add const.
1795 (Target_powerpc::got_entry_count): New function.
1796 (Target_powerpc::plt_entry_count): New function.
1797 (Target_powerpc::first_plt_entry_offset): New function.
1798 (Target_powerpc::plt_entry_size): New function.
1799 (Output_data_plt_powerpc::entry_count): New function.
1800 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
1801 (Output_data_plt_powerpc::get_plt_entry_size): New function.
1802 * sparc.cc (Target_sparc::got_size): Add const.
1803 (Target_sparc::got_entry_count): New function.
1804 (Target_sparc::plt_entry_count): New function.
1805 (Target_sparc::first_plt_entry_offset): New function.
1806 (Target_sparc::plt_entry_size): New function.
1807 (Output_data_plt_sparc::entry_count): New function.
1808 (Output_data_plt_sparc::first_plt_entry_offset): New function.
1809 (Output_data_plt_sparc::get_plt_entry_size): New function.
1810 * symtab.h (Symbol::got_offset_list): New function.
1811 (Symbol_table::for_all_symbols): New function.
1812 * target.h (Sized_target::got_entry_count): New function.
1813 (Sized_target::plt_entry_count): New function.
1814 (Sized_target::plt_entry_size): New function.
1815 * x86_64.cc (Target_x86_64::got_size): Add const.
1816 (Target_x86_64::got_entry_count): New function.
1817 (Target_x86_64::plt_entry_count): New function.
1818 (Target_x86_64::first_plt_entry_offset): New function.
1819 (Target_x86_64::plt_entry_size): New function.
1820 (Output_data_plt_x86_64::entry_count): New function.
1821 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
1822 (Output_data_plt_x86_64::get_plt_entry_size): New function.
1823
09ec0418
CC
18242010-08-12 Cary Coutant <ccoutant@google.com>
1825
1826 * archive.cc: Include incremental.h.
1827 (Archive::Archive): Initialize incremental_info_.
1828 (Archive::include_member): Record archive members in incremental info.
1829 (Add_archive_symbols::run): Record begin and end of an archive in
1830 incremental info.
1831 (Lib_group::include_member): Record objects in incremental info.
1832 * archive.h (Incremental_archive_entry): Forward declaration.
1833 (Archive::set_incremental_info): New member function.
1834 (Archive::incremental_info): New member function.
1835 (Archive::Unused_symbol_iterator): New class.
1836 (Archive::unused_symbols_begin): New member function.
1837 (Archive::unused_symbols_end): New member function.
1838 (Archive::incremental_info_): New data member.
1839 * incremental-dump.cc (find_input_containing_global): New function.
1840 (dump_incremental_inputs): Dump new incremental info sections.
1841 * incremental.cc: Include symtab.h.
1842 (Output_section_incremental_inputs): New class.
1843 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
1844 new incremental info sections.
1845 (Sized_incremental_binary::do_check_inputs): Likewise.
1846 (Incremental_inputs::report_archive): Remove.
1847 (Incremental_inputs::report_archive_begin): New function.
1848 (Incremental_inputs::report_archive_end): New function.
1849 (Incremental_inputs::report_object): New function.
1850 (Incremental_inputs::finalize_inputs): Remove.
1851 (Incremental_inputs::report_input_section): New function.
1852 (Incremental_inputs::report_script): Rewrite.
1853 (Incremental_inputs::finalize): Do nothing but finalize string table.
1854 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1855 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1856 (Incremental_inputs::create_data_sections): New function.
1857 (Incremental_inputs::relocs_entsize): New function.
1858 (Output_section_incremental_inputs::set_final_data_size): New function.
1859 (Output_section_incremental_inputs::do_write): New function.
1860 (Output_section_incremental_inputs::write_header): New function.
1861 (Output_section_incremental_inputs::write_input_files): New function.
1862 (Output_section_incremental_inputs::write_info_blocks): New function.
1863 (Output_section_incremental_inputs::write_symtab): New function.
1864 * incremental.h (Incremental_script_entry): Forward declaration.
1865 (Incremental_object_entry): Forward declaration.
1866 (Incremental_archive_entry): Forward declaration.
1867 (Incremental_inputs): Forward declaration.
1868 (Incremental_inputs_header_data): Remove.
1869 (Incremental_inputs_header): Remove.
1870 (Incremental_inputs_header_write): Remove.
1871 (Incremental_inputs_entry_data): Remove.
1872 (Incremental_inputs_entry): Remove.
1873 (Incremental_inputs_entry_write): Remove.
1874 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
1875 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
1876 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1877 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
1878 Likewise.
1879 (Incremental_input_entry): New class.
1880 (Incremental_script_entry): New class.
1881 (Incremental_object_entry): New class.
1882 (Incremental_archive_entry): New class.
1883 (Incremental_inputs::Incremental_inputs): Initialize new data members.
1884 (Incremental_inputs::report_inputs): Remove.
1885 (Incremental_inputs::report_archive): Remove.
1886 (Incremental_inputs::report_archive_begin): New function.
1887 (Incremental_inputs::report_archive_end): New function.
1888 (Incremental_inputs::report_object): Change prototype.
1889 (Incremental_inputs::report_input_section): New function.
1890 (Incremental_inputs::report_script): Change prototype.
1891 (Incremental_inputs::get_reloc_count): New function.
1892 (Incremental_inputs::set_reloc_count): New function.
1893 (Incremental_inputs::create_data_sections): New function.
1894 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1895 (Incremental_inputs::inputs_section): New function.
1896 (Incremental_inputs::symtab_section): New function.
1897 (Incremental_inputs::relocs_section): New function.
1898 (Incremental_inputs::get_stringpool): Add const.
1899 (Incremental_inputs::command_line): Add const.
1900 (Incremental_inputs::inputs): Remove.
1901 (Incremental_inputs::command_line_key): New function.
1902 (Incremental_inputs::input_file_count): New function.
1903 (Incremental_inputs::input_files): New function.
1904 (Incremental_inputs::relocs_entsize): New function.
1905 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1906 (Incremental_inputs::finalize_inputs): Remove.
1907 (Incremental_inputs::Input_info): Remove.
1908 (Incremental_inputs::lock_): Remove.
1909 (Incremental_inputs::inputs_): Change type.
1910 (Incremental_inputs::inputs_map_): Remove.
1911 (Incremental_inputs::current_object_entry_): New data member.
1912 (Incremental_inputs::inputs_section_): New data member.
1913 (Incremental_inputs::symtab_section_): New data member.
1914 (Incremental_inputs::relocs_section_): New data member.
1915 (Incremental_inputs::reloc_count_): New data member.
1916 (Incremental_inputs_reader): New class.
1917 (Incremental_symtab_reader): New class.
1918 (Incremental_relocs_reader): New class.
1919 * layout.cc (Layout::finalize): Move finalization of incremental info
1920 and creation of incremental info sections to follow finalization of
1921 symbol table. Set offsets for postprocessing sections.
1922 (Layout::create_incremental_info_sections): Call
1923 Incremental_inputs::create_data_sections. Add incremental symtab
1924 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
1925 sections to layout after input sections.
1926 * layout.h (struct Timespec): Forward declaration.
1927 (Layout::incremental_inputs): Add const.
1928 (Layout::create_incremental_info_sections): Add parameter.
1929 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
1930 * object.cc: Include incremental.h.
1931 (Relobj::finalize_incremental_relocs): New function.
1932 (Sized_relobj::do_layout): Record input sections in incremental info.
1933 * object.h (Object::output_section): New function.
1934 (Object::output_section_offset): Moved from Relobj.
1935 (Object::get_incremental_reloc_base): New function.
1936 (Object::get_incremental_reloc_count): New function.
1937 (Object::do_output_section): New function.
1938 (Object::do_output_section_offset): Moved from Relobj.
1939 (Object::do_get_incremental_reloc_base): New function.
1940 (Object::do_get_incremental_reloc_count): New function.
1941 (Object::Object): Initialize new data members.
1942 (Relobj::output_section): Renamed do_output_section and moved to
1943 protected.
1944 (Relobj::output_section_offset): Moved to Object.
1945 (Relobj::do_get_incremental_reloc_base): New function.
1946 (Relobj::do_get_incremental_reloc_count): New function.
1947 (Relobj::allocate_incremental_reloc_counts): New function.
1948 (Relobj::count_incremental_reloc): New function.
1949 (Relobj::finalize_incremental_relocs): New function.
1950 (Relobj::next_incremental_reloc_index): New function.
1951 (Relobj::reloc_counts_): New data member.
1952 (Relobj::reloc_bases_): New data member.
1953 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
1954 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
1955 (Sized_relobj::incremental_relocs_scan): New function.
1956 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1957 (Sized_relobj::incremental_relocs_write): New function.
1958 (Sized_relobj::incremental_relocs_write_reltype): New function.
1959 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
1960 incremental link.
1961 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
1962 archives and object files elsewhere.
1963 (Add_symbols::run): Report object files here.
1964 (Finish_group::run): Report end of archive at end of group.
1965 * reloc.cc: Include layout.h, incremental.h.
1966 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
1967 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
1968 (Sized_relobj::incremental_relocs_scan): New function.
1969 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1970 (Sized_relobj::do_relocate_sections): Write incremental relocations.
1971 (Sized_relobj::incremental_relocs_write): New function.
1972 (Sized_relobj::incremental_relocs_write_reltype): New function.
1973 * script.cc (read_input_script): Rewrite test for incremental link.
1974 Change call to Incremental_inputs::report_script.
1975 * symtab.h (Symbol_table::first_global_index): New function.
1976 (Symbol_table::output_count): New function.
1977
ce0d1972
DK
19782010-08-12 Doug Kwan <dougkwan@google.com>
1979
1980 * arm.cc (Target_arm::merge_object_attributes): Check command line
1981 options --no-wchar-size-warning and --no-enum-size-warning.
1982 * options.h (General_options): Add ld-compatible options
1983 --no-enum-size-warning and --no-wchar-size-warning.
1984
6e5710ce
ILT
19852010-08-04 Ian Lance Taylor <iant@google.com>
1986
1987 * x86_64.cc (Target_x86_64::Scan::local): Use
1988 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
1989 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
1990 (Target_x86_64::Scan::global): Likewise.
1991 (Target_x86_64::Relocate::relocate): Likewise.
1992 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1993 Likewise.
1994
fef830db
CC
19952010-08-03 Cary Coutant <ccoutant@google.com>
1996
1997 * merge.cc (Output_merge_string::do_add_input_section): Count strings
1998 to reserve space in merged_strings vector. Keep total input size
1999 for stats.
2000 (Output_merge_string::do_print_merge_stats): Print total input size.
2001 * merge.h (Output_merge_string): Add input_size_ field.
2002 * stringpool.cc (Stringpool_template::string_length): Move
2003 implementations out of Stringpool_template class and place in
2004 stringpool.h.
2005 * stringpool.h (string_length): Move out of Stringpool_template.
2006
1e3811b0
ILT
20072010-08-03 Ian Lance Taylor <iant@google.com>
2008
2009 PR 11712
2010 * layout.cc (relaxation_loop_body): If address of load segment is
2011 set, adjust address to include headers if possible.
2012
7af0c620
ILT
20132010-08-03 Ian Lance Taylor <iant@google.com>
2014
2015 * version.cc (version_string): Bump to 1.10.
2016
22f0da72
ILT
20172010-08-03 Ian Lance Taylor <iant@google.com>
2018
2019 PR 11805
2020 * layout.h (enum Output_section_order): Define.
2021 (class Layout): Update declarations.
2022 * layout.cc (Layout::get_output_section): Add order parameter.
2023 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2024 is_first_non_relro parameters. Change all callers.
2025 (Layout::choose_output_section): Likewise.
2026 (Layout::add_output_section_data): Likewise.
2027 (Layout::make_output_section): Likewise. Set order.
2028 (Layout::default_section_order): New function.
2029 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2030 * output.cc (Output_section::Output_section): Initialize order_.
2031 Don't initialize deleted fields.
2032 (Output_segment::Output_segment): Don't initialize deleted
2033 fields.
2034 (Output_segment::add_output_section_to_load): New function
2035 replacing add_output_section. Change all callers to call this or
2036 add_output_section_to_nonload.
2037 (Output_segment::add_output_section_to_nonload): New function.
2038 (Output_segment::remove_output_section): Rewrite.
2039 (Output_segment::add_initial_output_data): Likewise.
2040 (Output_segment::has_any_data_sections): Likewise.
2041 (Output_segment::is_first_section_relro): Likewise.
2042 (Output_segment::maximum_alignment): Likewise.
2043 (Output_segment::has_dynamic_reloc): New function replacing
2044 dynamic_reloc_count. Change all callers.
2045 (Output_segment::has_dynamic_reloc_list): New function replacing
2046 dynamic_reloc_count_list. Change all callers.
2047 (Output_segment::set_section_addresses): Rewrite.
2048 (Output_segment::set_offset): Rewrite.
2049 (Output_segment::find_first_and_last_list): Remove.
2050 (Output_segment::set_tls_offsets): Rewrite.
2051 (Output_segment::first_section_load_address): Likewise.
2052 (Output_segment::output_section_count): Likewise.
2053 (Output_segment::section_with_lowest_load_address): Likewise.
2054 (Output_segment::write_section_headers): Likewise.
2055 (Output_segment::print_sections_to_map): Likewise.
2056 * output.h (class Output_data): Remove dynamic_reloc_count_
2057 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2058 (Output_data::add_dynamic_reloc): Rewrite.
2059 (Output_data::has_dynamic_reloc): New function.
2060 (Output_data::dynamic_reloc_count): Remove.
2061 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2062 is_last_relro_, is_first_non_relro_, is_interp_,
2063 is_dynamic_linker_section_ fields. Add order and set_order
2064 functions. Remove is_relro_local, set_is_relro_local,
2065 is_last_relro, set_is_last_relro, is_first_non_relro,
2066 set_is_first_non_relro functions, is_interp, set_is_interp,
2067 is_dynamic_linker_section, and set_is_dynamic_linker_section
2068 functions.
2069 (class Output_segment): Change Output_data_list from std::list to
2070 std:;vector. Add output_lists_ field. Remove output_data_ and
2071 output_bss_ fields. Update declarations.
2072
3ff2ccb0
ILT
20732010-08-02 Ian Lance Taylor <iant@google.com>
2074
2075 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2076 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2077 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2078
88a4108b
ILT
20792010-08-02 Ian Lance Taylor <iant@google.com>
2080
2081 PR 11855
2082 * script.cc (Script_options::Script_options): Initialize
2083 symbol_definitions_ and symbol_references_.
2084 (Script_options::add_symbol_assignment): Update
2085 symbol_definitions_ and symbol_references_.
2086 (Script_options::add_symbol_reference): New function.
2087 (script_symbol): New function.
2088 * script.h (class Script_options): Add symbol_definitions_ and
2089 symbol_references_ fields.
2090 (Script_options::referenced_const_iterator): New type.
2091 (Script_options::referenced_begin): New function.
2092 (Script_options::referenced_end): New function.
2093 (Script_options::is_referenced): New function.
2094 (Script_options::any_unreferenced): New function.
2095 * script-c.h (script_symbol): Declare.
2096 * yyscript.y (exp): Call script_symbol.
2097 * symtab.cc: Include "script.h".
2098 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2099 Change all callers. Check symbols referenced by scripts.
2100 (Symbol_table::add_undefined_symbols_from_command_line): Add
2101 layout parameter. Change all callers.
2102 (Symbol_table::do_add_undefined_symbols_from_command_line):
2103 Likewise. Break out loop body. Check symbols referenced by
2104 scripts.
2105 (Symbol_table::add_undefined_symbol_from_command_line): New
2106 function broken out of
2107 do_add_undefined_symbols_from_command_line.
2108 * symtab.h (class Symbol_table): Update declarations.
2109 * archive.cc: Include "layout.h".
2110 (Archive::should_include_member): Add layout parameter. Change
2111 all callers. Check for symbol mentioned in expression.
2112 * archive.h (class Archive): Update declaration.
2113 * object.cc (Sized_relobj::do_should_include_member): Add layout
2114 parameter.
2115 * object.h (Object::should_include_member): Add layout parameter.
2116 Change all callers.
2117 (Object::do_should_include_member): Add layout parameter.
2118 (class Sized_relobj): Update declaration.
2119 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2120 parameter.
2121 * dynobj.h (class Sized_dynobj): Update declaration.
2122 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2123 layout parameter.
2124 * plugin.h (class Sized_pluginobj): Update declaration.
2125
5f1ab67a
ILT
21262010-08-02 Ian Lance Taylor <iant@google.com>
2127
2128 PR 11866
2129 * output.cc (Output_segment::set_offset): Search for the first and
2130 last sections rather than assuming that the list is in order.
2131 (Output_segment::find_first_and_last_list): New function.
2132 * output.h (class Output_segment): Update declarations.
2133 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2134 (relro_strip_test_SOURCES): New variable.
2135 (relro_strip_test_DEPENDENCIES): New variable.
2136 (relro_strip_test_LDFLAGS): New variable.
2137 (relro_strip_test_LDADD): New variable.
2138 (relro_strip_test.so): New target.
2139
a8df5856
ILT
21402010-08-02 Ian Lance Taylor <iant@google.com>
2141
2142 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2143 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2144 (Target_i386::got_tlsdesc_section): New function.
2145 (Target_i386::got_section): Create space for GOT entries for
2146 TLSDESC relocations.
2147 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2148 R_386_TLS_GOTDESC.
2149 (Target_i386::Scan::global): Likewise.
2150 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2151 using TLSDESC GOT.
2152 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2153 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2154 (Target_x86_64::got_tlsdesc_section): New function.
2155 (Target_x86_64::got_section): Create space for GOT entries for
2156 TLSDESC relocations.
2157 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2158 R_386_TLS_GOTDESC.
2159 (Target_x86_64::Scan::global): Likewise.
2160 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2161 using TLSDESC GOT.
2162
0c10a0a6
ILT
21632010-08-02 Ian Lance Taylor <iant@google.com>
2164
2165 * testsuite/final_layout.sh: Use dc to convert from hex to
2166 decimal.
2167
41cbeecc
ST
21682010-07-29 Sriraman Tallam <tmsriram@google.com>
2169
2170 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2171 paramter to the call to gold::gc_process_relocs.
2172 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2173 paramter to the call to gold::gc_process_relocs.
2174 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2175 parameter to the call to gold::gc_process_relocs.
2176 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2177 template parameter to the call to gold::gc_process_relocs.
2178 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2179 paramter to the call to gold::gc_process_relocs.
2180 * gc.h (get_embedded_addend_size): New function.
2181 (gc_process_relocs): Save the size of the reloc for use by ICF.
2182 * icf.cc (get_section_contents): Get the addend from the text section
2183 for SHT_REL relocation sections.
2184 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2185 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2186 * int_encoding.h (read_from_pointer): New overloaded function.
2187 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2188 * testsuite/icf_sht_rel_addend_test.sh: New file.
2189 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2190 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2191
6ea55b82
RW
21922010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2193
2194 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2195 * Makefile.in: Regenerate.
2196 * testsuite/Makefile.in: Regenerate.
2197
9691462b
ILT
21982010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2199
2200 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2201 * gold/testsuite/debug_msg.cc: Likewise.
2202 * gold/testsuite/odr_violation1.cc
2203 * gold/testsuite/odr_violation2.cc
2204
76897331
CC
22052010-07-21 Cary Coutant <ccoutant@google.com>
2206
2207 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2208 string, and length fields.
2209 (Output_merge_string::Merged_strings_list): New type.
2210 (Output_merge_string::Merged_strings_lists): New typedef.
2211 (Output_merge_string): Replace merged_strings_ with
2212 merged_strings_lists_.
2213 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2214 Merged_strings_list per input object and section. Don't store pointer
2215 to the string. Don't store length with each merged string entry.
2216 (Output_merge_string::finalize_merged_data): Loop over list of merged
2217 strings lists. Recompute length of each merged string.
2218
78384e8f
CC
22192010-07-15 Cary Coutant <ccoutant@google.com>
2220
2221 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2222 here.
2223
783659f9
ILT
22242010-07-14 Ian Lance Taylor <iant@google.com>
2225
2226 * descriptors.cc (Descriptors::open): Report correct name in error
2227 message.
2228
131687b4
DK
22292010-07-13 Doug Kwan <dougkwan@google.com>
2230
2231 * arm.cc (Arm_input_section::Arm_input_section): For a
2232 SHT_ARM_EXIDX section, always keeps the input sections.
2233 (Arm_input_section::set_exidx_section_link): New method.
2234 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
2235 has_errors_ to false.
2236 (Arm_exidx_input_section::has_errors,
2237 Arm_exidx_input_section::set_has_errors): New methods.
2238 (Arm_exidx_input_section::has_errors_): New data member.
2239 (Arm_relobj::get_exidx_shndx_list): New method.
2240 (Arm_output_section::append_text_sections_to_list): Do not skip
2241 section without SHF_EXECINSTR.
2242 (Arm_output_section::fix_exidx_coverage): Skip input sections with
2243 errors.
2244 (Arm_relobj::make_exidx_input_section): Add new parameter for text
2245 section header. Make error messages more verbose. Check for
2246 a non-executable section linked to an EXIDX section.
2247 (Arm_relobj::do_read_symbols): Remove error checking, which has been
2248 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
2249 check that there is no deferred EXIDX section if we exit early.
2250 Instead of not making an EXIDX section in case of an error, make one
2251 and set the has_errors flag of it.
2252 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
2253 in a relocatable link.
2254 (Target_arm::do_relax): Look for the EXIDX output section instead of
2255 assuming that it is called .ARM.exidx.
2256 (Target_arm::fix_exidx_coverage): Add a new parameter for input
2257 section list. Do not check for SHF_EXECINSTR section flags but
2258 skip any input section with errors.
2259 * output.cc (Output_section::Output_section): Initialize
2260 always_keeps_input_sections_ to false.
2261 (Output_section::add_input_section): Check for
2262 always_keeps_input_sections_.
2263 * output.h (Output_section::always_keeps_input_sections,
2264 Output_section::set_always_keeps_input_sections): New methods.
2265 (Output_section::always_keeps_input_sections): New data member.
2266
69517287
RÁE
22672010-07-13 Rafael Espindola <espindola@google.com>
2268
2269 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
2270 * fileread.h (Input_file): Add try_extra_search_path and find_file.
2271
82742395
ILT
22722010-07-13 Philip Herron <herron.philip@googlemail.com>
2273 Ian Lance Taylor <iant@google.com>
2274
2275 * output.h (Output_section_lookup_maps::add_merge_section):
2276 Correct check of whether value was inserted.
2277 (Output_section_lookup_maps::add_merge_input_section): Likewise.
2278 (Output_section_lookup_maps::add_relaxed_input_section):
2279 Likewise.
2280 * arm.cc (Target_arm::got_section): Remove used local os.
2281 * i386.cc (Target_i386::got_section): Likewise.
2282 * x86_64.cc (Target_x86_64::got_section): Likewise.
2283 * sparc.cc (Target_sparc::got_section): Likewise.
2284 (Target_sparc::relocate): Remove unused local have_got_offset.
2285 * powerpc.cc (Target_powerpc::relocate): Likewise.
2286
f2d707b5
ILT
22872010-07-13 Ian Lance Taylor <iant@google.com>
2288
241531d6
ILT
2289 * compressed_output.cc (zlib_decompress): Fix signature in
2290 !HAVE_ZLIB_H case.
2291
f2d707b5
ILT
2292 * archive.cc (Archive::include_member): Unlock an external member
2293 of a thin archive. Don't bother to delete an object we know is
2294 NULL.
2295
a2e47362
CC
22962010-07-12 Cary Coutant <ccoutant@google.com>
2297
2298 * compressed_output.cc (zlib_decompress): New function.
2299 (get_uncompressed_size): New function.
2300 (decompress_input_section): New function.
2301 * compressed_output.h (get_uncompressed_size): New function.
2302 (decompress_input_section): New function.
2303 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
2304 Handle compressed debug sections.
2305 * layout.cc (is_compressed_debug_section): New function.
2306 (Layout::output_section_name): Map compressed section names to
2307 canonical names.
2308 * layout.h (is_compressed_debug_section): New function.
2309 (is_debug_info_section): Recognize compressed debug sections.
2310 * merge.cc: Include compressed_output.h.
2311 (Output_merge_data::do_add_input_section): Handle compressed
2312 debug sections.
2313 (Output_merge_string::do_add_input_section): Handle compressed
2314 debug sections.
2315 * object.cc: Include compressed_output.h.
2316 (Sized_relobj::Sized_relobj): Initialize new data members.
2317 (build_compressed_section_map): New function.
2318 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
2319 * object.h (Object::section_is_compressed): New method.
2320 (Object::do_section_is_compressed): New method.
2321 (Sized_relobj::Compressed_section_map): New type.
2322 (Sized_relobj::do_section_is_compressed): New method.
2323 (Sized_relobj::compressed_sections_): New data member.
2324 * output.cc (Output_section::add_input_section): Handle compressed
2325 debug sections.
2326 * reloc.cc: Include compressed_output.h.
2327 (Sized_relobj::write_sections): Handle compressed debug sections.
2328
ce279a62
CC
23292010-07-08 Cary Coutant <ccoutant@google.com>
2330
2331 * resolve.cc (Symbol_table::resolve): Remember whether undef was
2332 weak when resolving to a dynamic def.
2333 (Symbol_table::should_override): Add adjust_dyndef flag; set it
2334 for weak undef/dynamic def cases. Adjust callers.
2335 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
2336 undef_binding_weak_.
2337 (Symbol_table::sized_write_globals): Adjust symbol binding.
2338 (Symbol_table::sized_write_symbol): Add binding parameter.
2339 * symtab.h (Symbol::set_undef_binding): New method.
2340 (Symbol::is_undef_binding_weak): New method.
2341 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
2342 (Symbol_table::should_override): Add new parameter.
2343 (Symbol_table::sized_write_symbol): Add new parameter.
2344
2345 * testsuite/weak_undef_file1.cc: Add new test case.
2346 * testsuite/weak_undef_file2.cc: Fix header comment.
2347 * testsuite/weak_undef_test.cc: Add new test case.
2348
b2286c10
DK
23492010-06-29 Doug Kwan <dougkwan@google.com>
2350
2351 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
2352 Initialize USE_SYMBOL_.
2353 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
2354 definition.
2355 (Arm_reloc_property::uses_symbol_): New data member declaration.
2356 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
2357 uses symbol value and symbol is undefined but not weakly undefined.
2358
4802450a
RÁE
23592010-06-28 Rafael Espindola <espindola@google.com>
2360
2361 * plugin.cc (Plugin::load): Use dlerror.
2362
e5ca47ba
ILT
23632010-06-26 Jeffrey Yaskin <jyasskin@google.com>
2364
2365 * symtab.cc (detect_odr_violations): When reporting an ODR
2366 violation, report an object where the symbol is defined.
2367
8a75a161
DK
23682010-06-25 Doug Kwan <dougkwan@google.com>
2369
2370 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
2371 (Target_arm::section_may_have_icf_unsafe_pointers): New method
2372 definition.
2373 (Target_arm::Scan::local_reloc_may_be_function_pointer,
2374 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
2375 target hook to detect function points.
2376 (Target_arm::Scan::possible_function_pointer_reloc): New method.
2377 * icf.h (Icf::check_section_for_function_pointers): Change type of
2378 parameter SECTION_NAME to const reference to std::string. Use
2379 target hook to determine if section may have unsafe pointers.
2380 * target.h (Target::section_may_have_icf_unsafe_pointers): New
2381 method definition.
2382
42218b9f
RÁE
23832010-06-21 Rafael Espindola <espindola@google.com>
2384
2385 * fileread.cc (Input_file::find_fie): New
2386 (Input_file::open): Use Input_file::find_fie.
2387 * fileread.h (Input_file::find_fie): New
2388 * plugin.cc (set_extra_library_path): New.
2389 (Plugin::load): Add set_extra_library_path to the transfer vector.
2390 (Plugin_manager::set_extra_library_path): New.
2391 (Plugin_manager::add_input_file): Use the extra search path if set.
2392 (set_extra_library_path(): New.
2393 * plugin.h (Plugin_manager): Add set_extra_library_path and
2394 extra_search_path_.
2395
a0506cca
CC
23962010-06-19 Cary Coutant <ccoutant@google.com>
2397
2398 * layout.cc (gdb_sections): Add .debug_types.
2399 (lines_only_debug_sections): Likewise.
2400
6508b958
RÁE
24012010-06-18 Rafael Espindola <espindola@google.com>
2402
2403 * plugin.cc (add_input_file,add_input_library)
2404 (Plugin_manager::add_input_file): Make filename arguments const.
2405 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
2406 const.
2407
3e235302
DK
24082010-06-16 Doug Kwan <dougkwan@google.com>
2409
2410 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
2411 .ARM.attributes section if we have not merged any input
2412 attributes sections.
2413
106e8a6c
DK
24142010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2415
2416 * arm.cc: Allow combining objects with no EABI version
2417 information.
2418
91ff43fe
RÁE
24192010-06-15 Rafael Espindola <espindola@google.com>
2420
2421 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
2422
68ed838c
ILT
24232010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2424
2425 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
2426 (struct iovec): Correct !HAVE_READV definition.
2427
f3a2388f
CC
24282010-06-10 Cary Coutant <ccoutant@google.com>
2429
2430 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
2431 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
2432 reloc sections.
2433 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
2434
2435 PR 11683
2436 * symtab.h (Symbol::is_placeholder): New member function.
2437 * target-reloc.h (relocate_section): Check for placeholder symbols.
2438
2439 * testsuite/Makefile.am (plugin_test_8): New test.
2440 (plugin_test_9): New test.
2441 * testsuite/Makefile.in: Regenerate.
2442
e1df38aa
NC
24432010-06-09 Nick Clifton <nickc@redhat.com>
2444
2445 * yyscript.y (input_list_element): Allow strings prefixed with
2446 the '-' character. Treat these as libraries.
2447 * script.cc (script_add_library): New function. Adds a library
2448 specified by "-l<name>" found in an input script.
2449 * script-c.h: Add prototype for script_add_library.
2450
25bbe950
DK
24512010-06-07 Doug Kwan <dougkwan@google.com>
2452
2453 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
2454 Restrict stub-group size to be within long conditional branch
2455 range when working around cortex-A8 erratum.
2456
0f32ea4c
ILT
24572010-06-07 Damien Diederen <dd@crosstwine.com>
2458
2459 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
2460 #ifdef typo.
2461
8fe2a369
ST
24622010-06-03 Sriraman Tallam <tmsriram@google.com>
2463
2464 PR gold/11658
2465 * output.cc
2466 (Output_section::Input_section_sort_entry::compare_section_ordering):
2467 Change to return non-zero correctly.
2468 (Output_section::Input_section_sort_section_order_index_compare
2469 ::operator()): Change to fix ambiguity in comparisons.
2470
6e9ba2ca
ST
24712010-06-01 Sriraman Tallam <tmsriram@google.com>
2472
2473 * gold.h (is_wildcard_string): New function.
2474 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
2475 (Layout::layout_eh_frame): Ditto.
2476 (Layout::find_section_order_index): New method.
2477 (Layout::read_layout_from_file): New method.
2478 * layout.h (Layout::find_section_order_index): New method.
2479 (Layout::read_layout_from_file): New method.
2480 (Layout::input_section_position_): New private member.
2481 (Layout::input_section_glob_): New private member.
2482 * main.cc (main): Call read_layout_from_file here.
2483 * options.h (--section-ordering-file): New option.
2484 * output.cc (Output_section::input_section_order_specified_): New
2485 member.
2486 (Output_section::Output_section): Initialize new member.
2487 (Output_section::add_input_section): Add new parameter.
2488 Keep input sections when --section-ordering-file is used.
2489 (Output_section::set_final_data_size): Sort input sections when
2490 section ordering file is specified.
2491 (Output_section::Input_section_sort_entry): Add new parameter.
2492 Check sorting type.
2493 (Output_section::Input_section_sort_entry::compare_section_ordering):
2494 New method.
2495 (Output_section::Input_section_sort_compare::operator()): Change to
2496 consider section_order_index.
2497 (Output_section::Input_section_sort_init_fini_compare::operator()):
2498 Change to consider section_order_index.
2499 (Output_section::Input_section_sort_section_order_index_compare
2500 ::operator()): New method.
2501 (Output_section::sort_attached_input_sections): Change to sort
2502 according to section order when specified.
e1df38aa
NC
2503 (Output_section::add_input_section<32, true>): Add new parameter.
2504 (Output_section::add_input_section<64, true>): Add new parameter.
2505 (Output_section::add_input_section<32, false>): Add new parameter.
2506 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
2507 * output.h (Output_section::add_input_section): Add new parameter.
2508 (Output_section::input_section_order_specified): New
2509 method.
2510 (Output_section::set_input_section_order_specified): New method.
2511 (Input_section::Input_section): Initialize section_order_index_.
2512 (Input_section::section_order_index): New method.
2513 (Input_section::set_section_order_index): New method.
2514 (Input_section::section_order_index_): New member.
2515 (Input_section::Input_section_sort_section_order_index_compare): New
2516 struct.
2517 (Output_section::input_section_order_specified_): New member.
2518 * script-sections.cc (is_wildcard_string): Delete and move modified
2519 method to gold.h.
2520 (Output_section_element_input::Output_section_element_input): Modify
2521 call to is_wildcard_string.
2522 (Output_section_element_input::Input_section_pattern
2523 ::Input_section_pattern): Ditto.
2524 (Output_section_element_input::Output_section_element_input): Ditto.
2525 * testsuite/Makefile.am (final_layout): New test case.
2526 * testsuite/Makefile.in: Regenerate.
2527 * testsuite/final_layout.cc: New file.
2528 * testsuite/final_layout.sh: New file.
2529
3537c84b
RÁE
25302010-06-01 Rafael Espindola <espindola@google.com>
2531
2532 * plugin.cc (Plugin::load): Pass the output name to the plugin.
2533
105b6afd
RÁE
25342010-06-01 Rafael Espindola <espindola@google.com>
2535
2536 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
2537 visibility of symbols.
2538
29e11421
DK
25392010-05-27 Doug Kwan <dougkwan@google.com>
2540
2541 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
2542 from start of output section instead of address for a local symbol
2543 in a merged or relaxed section when doing a relocatable link.
2544
5e0f337e
RÁE
25452010-05-26 Rafael Espindola <espindola@google.com>
2546
2547 PR 11604
2548 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
2549 adding sections the garbage collector removed.
2550 * gold/testsuite/Makefile.am: Add test.
2551 * gold/testsuite/Makefile.in: Regenerate.
2552 * gold/testsuite/plugin_test_7.sh: New.
2553 * gold/testsuite/plugin_test_7_1.c: New.
2554 * gold/testsuite/plugin_test_7_2.c: New.
2555
f4187277
RÁE
25562010-05-26 Rafael Espindola <espindola@google.com>
2557
2558 * script-sections.cc (Output_section_definition::set_section_addresses):
2559 Check for --section-start.
2560
5c388529
DK
25612010-05-26 Doug Kwan <dougkwan@google.com>
2562
2563 * arm.cc (Arm_scan_relocatable_relocs): New class.
2564 (Target_arm::relocate_special_relocatable): New method.
2565 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
2566 (Arm_relocate_functions::thumb_branch_common): Same.
2567 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
2568 instead of Default_scan_relocatable_relocs.
2569 * target-reloc.h (relocate_for_relocatable): Let target handle
2570 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
2571 * target.h (Sized_target::relocate_special_relocatable): New method.
2572
bca1c3ae
ILT
25732010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2574
2575 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
2576
0439c796
DK
25772010-05-23 Doug Kwan <dougkwan@google.com>
2578
2579 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
2580 instead of a cast.
2581 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
2582 with a direct branch, not a conditional branch, to a stub.
2583 * merge.cc (Output_merge_base::record_input_section): New method
2584 defintion.
2585 (Output_merge_data::do_add_input_section): Record input section if
2586 keeps-input-sections flag is set.
2587 (Output_merge_string::do_add_input_section): Ditto.
2588 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
2589 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
2590 INPUT_SECTIONS_.
2591 (Output_merge_base::keeps_input_sections,
2592 Output_merge_base::set_keeps_input_sections,
2593 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
2594 method definitions.
2595 (Output_merge_base::Input_sections): New type declaration.
2596 (Output_merge_base::input_sections_begin,
2597 Output_merge_base::input_sections_end,
2598 Output_merge_base::do_set_keeps_input_sections): New method definitions.
2599 (Output_merge_base::bool keeps_input_sections_,
2600 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
2601 Output_merge_base::input_sections_): New data members.
2602 (Output_merge_data::do_set_keeps_input_sections): New method
2603 defintion.
2604 (Output_merge_string::do_set_keeps_input_sections): Ditto.
2605 * output.cc (Output_section::Input_section::relobj): Move method
2606 defintion from class declaration to here and handle merge sections.
2607 (Output_section::Input_section::shndx): Ditto.
2608 (Output_section::Output_section): Remove initializations of removed
2609 data members and initialize new data member LOOKUP_MAPS_.
2610 (Output_section::add_input_section): Set keeps-input-sections flag
2611 for a newly created merge output section as appropriate. Adjust code
2612 to use Output_section_lookup_maps class.
2613 (Output_section::add_relaxed_input_section): Adjst code for lookup
2614 maps code refactoring.
2615 (Output_section::add_merge_input_section): Add a new parameter
2616 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
2617 class. If adding input section to a newly created merge output
2618 section fails, remove the new merge section.
2619 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 2620 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
2621 (Output_section::find_merge_section): Ditto.
2622 (Output_section::build_lookup_maps): New method defintion.
2623 (Output_section::find_relaxed_input_section): Adjust code to use
2624 Output_section_lookup_maps class.
2625 (Output_section::get_input_sections): Export merge sections. Adjust
2626 code to use Output_section_lookup_maps class.
2627 (Output_section:::add_script_input_section): Adjust code to use
2628 Output_section_lookup_maps class. Update lookup maps for merge
2629 sections also.
2630 (Output_section::discard_states): Use Output_section_lookup_maps.
2631 (Output_section::restore_states): Same.
2632 * output.h (Merge_section_properties): Move class defintion out of
2633 Output_section.
2634 (Output_section_lookup_maps): New class.
2635 (Output_section::Input_section::is_merge_section): New method
2636 defintion.
2637 (Output_section::Input_section::relobj): Move defintion out of class
2638 defintion. Declare method only.
2639 (Output_section::Input_section::shndx): Ditto.
2640 (Output_section::Input_section::output_merge_base): New method defintion.
2641 (Output_section::Input_section::u2_.pomb): New union field.
2642 (Output_section::Merge_section_by_properties_map,
2643 Output_section::Output_section_data_by_input_section_map,
2644 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
2645 Remove types.
2646 (Output_section::add_merge_input_section): Add new parameter
2647 KEEPS_INPUT_SECTIONS.
2648 (Output_section::build_lookup_maps): New method declaration.
2649 (Output_section::merge_section_map_,
2650 Output_section::merge_section_by_properties_map_,
2651 Output_section::relaxed_input_section_map_,
2652 Output_section::is_relaxed_input_section_map_valid_): Remove data
2653 members.
2654 (Output_section::lookup_maps_): New data member.
2655
76295588
L
26562010-05-21 Doug Kwan <dougkwan@google.com>
2657
2658 PR gold/11619
2659 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
2660 avoid a compilation error.
2661
d103a984
RÁE
26622010-05-19 Rafael Espindola <espindola@google.com>
2663
2664 * script-sections.cc (Output_section_definition::allocate_to_segment):
2665 Update the phdrs_list even when the output section is NULL.
2666 * testsuite/Makefile.am: Add test.
2667 * testsuite/Makefile.in: Regenerate.
2668 * testsuite/script_test_9.cc: New.
2669 * testsuite/script_test_9.sh: New.
2670 * testsuite/script_test_9.t: New.
2671
6625d24e
DK
26722010-05-19 Doug Kwan <dougkwan@google.com>
2673
2674 * arm.cc (Arm_input_section::original_size): New method.
2675 (Arm_input_section::do_addralign): Add a cast.
2676 (Arm_input_section::do_output_offset): Remove static cast.
2677 (Arm_input_section::original_addralign,
2678 Arm_input_section::original_size_): Change type to uint32_t.
2679 (Arm_input_section::init): Add safe casts for section alignment
2680 and size.
2681 (Arm_input_section::set_final_data_size): Do not set address and
2682 offset of stub table.
2683 (Arm_output_section::fix_exidx_coverage): Change use of of
2684 Output_section::Simple_input_section to that of
2685 Output_section::Input_section.
2686 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
2687 except for the first pass.
2688 * output.cc (Output_section::get_input_sections): Change type of
2689 input_sections to std::list<Input_section>.
2690 (Output_section::add_script_input_section): Rename from
2691 Output_section::add_simple_input_section. Change type of SIS
2692 parameter from Simple_input_section to Input_section.
2693 * output.h (Output_section::Simple_input_section): Remove class.
2694 (Output_section::Input_section): Change class visibility to public.
2695 (Output_section::Input_section::addralign): Use stored alignments
2696 for special input sections if set.
2697 (Output_section::Input_section::set_addralign): New method.
2698 (Output_section::get_input_sections): Change parameter type from
2699 list of Simple_input_section to list of Input_section.
2700 (Output_section::add_script_input_section): Rename from
2701 Output_section::add_simple_input_section. Change first parameter's
2702 type from Simple_input_section to Input_section and remove the
2703 second and third parameters.
2704 * script-sections.cc (Input_section::Input_section_list): Change
2705 type to list of Output_section::Input_section/
2706 (Input_section_info::Input_section_info): Change parameter type of
2707 INPUT_SECTION to Output_section::Input_section.
2708 (Input_section_info::input_section): Change return type.
2709 (Input_section_info::input_section_): Change type to
2710 Output_section::Input_section.
2711 (Output_section_element_input::set_section_addresses): Adjust code
2712 to use Output_section::Input_section instead of
2713 Output_section::Simple_input_section. Adjust code for renaming
2714 of Output_section::add_simple_input_section.
2715 (Orphan_output_section::set_section_addresses): Ditto.
2716
e1e82ea4
RW
27172010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2718
2719 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
2720 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
2721
91e75c8a
RÁE
27222010-05-18 Rafael Espindola <espindola@google.com>
2723
2724 * options.cc (General_options::finalize): Handle -nostdlib.
2725 * options.h (nostdlib): New option.
2726 * script.cc (script_add_search_dir): Handle -nostdlib.
2727
da59ad79
DK
27282010-05-12 Doug Kwan <dougkwan@google.com>
2729
2730 * arm.cc (Target_arm::do_finalize_sections): Create an empty
2731 attributes section only if there no attributes section after merging.
2732 (Target_arm::merge_object_attributes): Move value of
e1df38aa 2733 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
2734 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
2735 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
2736 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
2737 and arm_attr_merge_7.stdout.
2738 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
2739 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
2740 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
2741 arm_attr_merge_7b.o): New rules.
2742 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
2743 arm_attr_merge_7
2744 * testsuite/Makefile.in: Regenerate.
2745 * testsuite/arm_attr_merge.sh: New file.
2746 * testsuite/arm_attr_merge_[67][ab].s: Same.
2747
3e01a7fd
NC
27482010-05-05 Nick Clifton <nickc@redhat.com>
2749
2750 * po/es.po: Updated Spanish translation.
2751
7ad2014a
L
27522010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2753
2754 * Makefile.am (install-exec-local): Properly install gold as
2755 default cross linker.
2756 * Makefile.in: Regenerated.
2757
4fda8867
NC
27582010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2759 Nick Clifton <nickc@redhat.com>
2760
2761 * configure.ac (install_as_default): Define and set to false
2762 unless --enable-gold or --enable-gold=both/gold has been
2763 specified.
2764 * configure: Regenerate.
2765
2766 * Makefile.am (install-exec-local): Install the executable as
2767 'ld.gold'. If install_as_default is true then also install it as
2768 'ld'.
2769 * Makefile.in: Regenerated.
2770
bd288ea2
ILT
27712010-04-24 Ian Lance Taylor <iant@google.com>
2772
2773 * layout.cc (Layout::layout_reloc): In relocatable link don't
2774 combine reloc sections for grouped sections.
2775
ef38fd8a
ST
27762010-04-23 Sriraman Tallam <tmsriram@google.com>
2777
2778 * gc.h (gc_process_relocs): Pass information on relocs pointing to
2779 sections that are not ordinary to icf.
2780 * icf.cc (get_section_contents): Handle relocation pointing to section
2781 with no object or shndx information.
2782 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
2783 * testsuite/Makefile.in: Regenerate.
2784 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
2785 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
2786
f6973bdc
ILT
27872010-04-22 Ian Lance Taylor <iant@google.com>
2788
2789 * expression.cc (Expression::Expression_eval_info): Add
2790 result_alignment_pointer field.
2791 (Expression::eval_with_dot): Add result_alignment_pointer
2792 parameter. Change all callers.
2793 (Expression::eval_maybe_dot): Likewise.
2794 (class Binary_expression): Add alignment_pointer parameter to
2795 left_value and right_value. Change all callers.
2796 (BINARY_EXPRESSION): Set result alignment.
2797 (class Trinary_expression): Add alignment_pointer parameter to
2798 arg2_value and arg3_value. Change all callers.
2799 (Trinary_cond::value): Set result alignment.
2800 (Max_expression::value, Min_expression::value): Likewise.
2801 (Align_expression::value): Likewise.
2802 * script-sections.cc (class Sections_element): Add dot_alignment
2803 parameter to set_section_addresses virtual function. Update
2804 instantiations.
2805 (class Output_section_element): Likewise.
2806 (Script_sections::create_segments): Add dot_alignment parameter.
2807 Change all callers.
2808 (Script_sections::create_segments_from_phdrs_clause): Likewise.
2809 (Script_sections::set_phdrs_clause_addresses): Likewise.
2810 * script-sections.h: Update declarations.
2811 * script.h: Update declarations.
2812 * output.h (Output_segment::set_minimum_p_align): Don't decrease
2813 min_p_align.
2814 * testsuite/script_test_3.t: Set large alignment.
2815 * testsuite/script_test_3.sh: Make sure that at least one LOAD
2816 segment has expected alignment.
2817
9c9c98a5
NC
28182010-04-22 Nick Clifton <nickc@redhat.com>
2819
2820 * po/gold.pot: Updated by the Translation project.
2821 * po/vi.po: Updated Vietnamese translation.
2822
2253bfba
L
28232010-04-22 H.J. Lu <hongjiu.lu@intel.com>
2824
2825 * testsuite/Makefile.am (check_PROGRAMS): Add
2826 icf_virtual_function_folding_test.
2827 * testsuite/Makefile.in: Regenerated.
2828
85fdf906
AH
28292010-04-15 Andrew Haley <aph@redhat.com>
2830
2831 * options.h (merge_exidx_entries): New option.
2832 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
2833 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
2834 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
2835 (Target_arm::merge_exidx_entries): New function.
2836 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
2837 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
2838 to Arm_exidx_fixup constructor.
2839 Add new arg, merge_exidx_entries.
2840 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
2841 Arm_output_section::fix_exidx_coverage.
2842
ce97fa81
ST
28432010-04-18 Sriraman Tallam <tmsriram@google.com>
2844
2845 * icf.cc (get_section_contents): Check for preemptible functions.
2846 Ignore addend when appropriate.
2847 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
2848 section folded.
2849 (add_from_relobj): Check for section folded.
2850 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
2851 * symtab.h (should_add_dynsym_entry): Add new parameter.
2852 * target-reloc.h (scan_relocs): Check for section folded.
2853 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
2854 Check reloc types for function pointers in shared objects.
2855 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
2856 case.
2857 (icf_preemptible_functions_test): New test case.
2858 (icf_string_merge_test): New test case.
2859 * testsuite.Makefile.in: Regenerate.
2860 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
2861 bar_glob. Refactor code.
2862 * testsuite/icf_preemptible_functions_test.cc: New file.
2863 * testsuite/icf_preemptible_functions_test.sh: New file.
2864 * testsuite/icf_string_merge_test.cc: New file.
2865 * testsuite/icf_string_merge_test.sh: New file.
2866 * testsuite/icf_virtual_function_folding_test.cc: New file.
2867 * testsuite/icf_virtual_function_folding_test.sh: New file.
2868
04ceb17c
DK
28692010-04-14 Doug Kwan <dougkwan@google.com>
2870
2871 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
2872 for local symbol recounting if we remove a section due to ICF.
2873 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
2874 there are no regular objects in input.
2875
153e7da4
DK
28762010-04-13 Doug Kwan <dougkwan@google.com>
2877
2878 * arm.cc (Arm_input_section::set_final_data_size): Compute
2879 accurate final data size instead of using current data size.
2880
4dbd9faf
DK
28812010-04-09 Doug Kwan <dougkwan@google.com>
2882
2883 * layout.cc (Layout::choose_output_section): Handle script section
2884 types.
2885 (Layout::make_output_section_for_script): Add section type parameter.
2886 Handle script section types.
2887 * layout.h (Layout::make_output_section_for_script): Add section
2888 type parameter.
2889 * output.cc (Output_section::Output_section): Initialize data member
2890 is_noload_.
2891 (Output_section::do_reset_address_and_file_offset): Do not set address
2892 to 0 if section is a NOLOAD section.
2893 * output.h (Output_section::is_noload): New method.
2894 (Output_section::set_is_noload): Ditto.
2895 (Output_section::is_noload_): New data member.
2896 * script-c.h (Script_section_type): New enum type.
2897 (struct Parser_output_section_header): Add new file section_type.
2898 * script-sections.cc (Sections_element::output_section_name): Add
2899 parameter for returning script section type.
2900 (Output_section_definition::output_section_name): Ditto.
2901 (Output_section_definition::section_type)P; New method.
2902 (Output_section_definiton::script_section_type_name): Ditto.
2903 (Output_section_definition::script_section_type_): New data member.
2904 (Output_section_definition::Output_section_definition): Initialize
2905 data member Output_section_definition::script_section_type_.
2906 (Output_section_definition::create_sections): Pass script section type
2907 to Layout::make_output_section_for_script.
2908 (Output_section_definition::output_section_name): Return script
2909 section type to caller.
2910 (Output_section_definition::set_section_address): Do not advance
2911 dot value and load address if section type is NOLOAD. Set address
2912 of NOLOAD sections regardless of section flags.
2913 (Output_section_definition::print): Print section type if it is
2914 not SCRIPT_SECTION_TYPE_NONE.
2915 (Output_section_definition::section_type): New method.
2916 (Output_section_definition::script_section_type_name): Ditto.
2917 (Script_sections::output_section_name): Add new parameter
2918 PSECTION_TYPE for returning script section type. Pass it to
2919 section elements. Handle discard sections.
2920 (Sort_output_sections::operator()): Handle NOLOAD sections.
2921 * script-sections.h (Script_sections::Section_type): New enum type.
2922 (Script_sections::output_section_name): Add a new parameter for
2923 returning script section type.
2924 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
2925 INFO and NOLOAD.
2926 * yyscript.y (union): Add new field SECTION_TYPE.
2927 (COPY, DSECT, INFO, NOLOAD): New tokens.
2928 (opt_address_and_section_type): Change type to output_section_header.
2929 (section_type): New non-terminal
2930 (section_header): Handle section type.
2253bfba 2931 (opt_address_and_section_type): Return section type value.
4dbd9faf 2932
721ea635
L
29332010-04-09 H.J. Lu <hongjiu.lu@intel.com>
2934
2935 * testsuite/plugin_common_test_1.c (foo): Add prototype.
2936 * testsuite/plugin_common_test_2.c (foo): Likewise.
2937
6bf924b0
DK
29382010-04-08 Doug Kwan <dougkwan@google.com>
2939
2940 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
2941 Output_merge_data.
2942 * output.cc (Output_section::add_merge_input_section): Simplify
2943 code and return status of Output_merge_base::add_input_section.
e1df38aa 2944 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
2945 returns true.
2946
24af6f92
DK
29472010-04-07 Doug Kwan <dougkwan@google.com>
2948
2949 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
2950 if section is marked as containing instructions but has no mapping
2951 symbols.
2952 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
2953 correct section index.
2954 (Arm_relobj::find_linked_text_section): Ditto.
2955
00698fc5
CC
29562010-04-07 Cary Coutant <ccoutant@google.com>
2957
2958 * archive.cc (include_member): Destroy Read_symbols_data object before
2959 releasing file.
2960 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
2961 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
2962 (Read_symbols_data::~Read_symbols_data) New destructor.
2963 (Section_relocs::Section_relocs) New constructor.
2964 (Section_relocs::~Section_relocs) New destructor.
2965 (Read_relocs_data::Read_relocs_data) New constructor.
2966 (Read_relocs_data::~Read_relocs_data) New destructor.
2967 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
2968 pointers to NULL after deleting.
2969
7296d933
DK
29702010-04-07 Doug Kwan <dougkwan@google.com>
2971
2972 * arm.cc: Replace "endianity" with "endianness" in comments.
2973 (Arm_exidx_cantunwind): Ditto.
2974 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
2975 (Arm_relobj::merge_flags_and_attributes): New method.
2976 (Arm_relobj::merge_flags_and_attributes_): New data member.
2977 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
2978 (Arm_relobj::scan_sections_for_stubs): Ditto.
2979 (Arm_relobj::do_read_symbols): Check to see if we really want to
2980 merge processor-specific flags and attributes. Exit early if
2981 an object is empty except for section names and the undefined symbol.
2982 (Target_arm::do_finalize_sections): Move check for ELF format to
2983 Arm_relobj::do_read_symbols. Merge processor specific flags and
2984 attributes from a regular object only when we have determined that
2985 it is aapropriate. Do not create an .ARM.attributes section in
2986 output if there is no regular input object.
2987 (Target_arm::merge_processor_specific_flags): Check
2988 --warn-mismatch before printing any error.
2989 (Target_arm::merge_object_attributes): Ditto.
2990 * gold.cc (queue_middle_tasks): Handle the case in which there is
2991 no regular object in input.
2992 * options.cc (General_options::parse_EB): New method.
2993 (General_options::parse_EL): Same.
2994 (General_options::General_options): Initialize endianness_.
2995 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
2996 New options.
2997 (General_options::Endianness): New enum.
2998 (General_options::endianness): New method.
2999 (General_options::endianness_): New data member.
3000 * parameters.cc (Parameters::set_options): Check target endianness.
3001 (Parameters::set_target_once): Ditto.
3002 (Parameters::check_target_endianness): New method.
3003 (parameters_force_valid_target): If either -EL or -EB is specified,
3004 use it to define endianness of default target.
3005 * parameters.h (Parameters::check_target_endianness): New method
3006 declaration.
3007 * target.h (class Target): Change "endianity" to "endianness"
3008 in comments.
3009
efc8d4f2
RW
30102010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3011
3012 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3013 * configure: Regenerate.
3014 * Makefile.in: Regenerate.
3015 * testsuite/Makefile.in: Regenerate.
3016
be234d88
CC
30172010-04-06 Cary Coutant <ccoutant@google.com>
3018
3019 gcc PR lto/42757
3020 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3021 prevailing definitions of common symbols.
3022 * testsuite/plugin_test_6.sh: New test case.
3023 * testsuite/plugin_common_test_1.c: New test case.
3024 * testsuite/plugin_common_test_2.c: New test case.
3025 * testsuite/Makefile.am (plugin_test_6): New test case.
3026 * testsuite/Makefile.in: Regenerate.
3027
bd32c6bd
NC
30282010-04-06 Nick Clifton <nickc@redhat.com>
3029
3030 * po/vi.po: New Vietnamese translation.
3031
323c532f
DK
30322010-03-30 Doug Kwan <dougkwan@google.com>
3033
3034 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3035
4fcd97eb
DK
30362010-03-25 Doug Kwan <dougkwan@google.com>
3037
3038 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3039 to avoid a conversion warning on a 32-bit host.
3040
4ebf39db
ILT
30412010-03-24 Ian Lance Taylor <iant@google.com>
3042
3043 * testsuite/script_test_3.t: Add a TLS segment.
3044 * testsuite/Makefile.am (check_PROGRAMS): Add
3045 tls_phdrs_script_test.
3046 (tls_phdrs_script_test_SOURCES): Define.
3047 (tls_phdrs_script_test_DEPENDENCIES): Define.
3048 (tls_phdrs_script_test_LDFLAGS): Define.
3049 (tls_phdrs_script_test_LDADD): Define.
3050 * testsuite/Makefile.in: Rebuild.
3051
4a599bdd
CC
30522010-03-23 Cary Coutant <ccoutant@google.com>
3053
3054 * fileread.cc (find_or_make_view): Fix comment.
3055
6c93b22c
ILT
30562010-03-23 Ian Lance Taylor <iant@google.com>
3057
3058 * script-sections.cc (class Orphan_section_placement): Define
3059 PLACE_TLS and PLACE_TLS_BSS.
3060 (Orphan_section_placement::Orphan_section_placement): Initialize
3061 new places.
3062 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3063 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3064 (tls_script_test_SOURCES): Define.
3065 (tls_script_test_DEPENDENCIES): Define.
3066 (tls_script_test_LDFLAGS): Define.
3067 (tls_script_test_LDADD): Define.
3068 * testsuite/Makefile.in: Rebuild.
3069
a2c7281b
DK
30702010-03-22 Doug Kwan <dougkwan@google.com>
3071
3072 * arm.cc (Arm_relocate_functions::abs8,
3073 Arm_relocate_functions::abs16): Use correct check for overflow
3074 specified in the ARM ELF specs.
3075 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3076 target of a BLX instruction specially.
3077 (Reloc_stub::stub_type_for_reloc): Ditto.
3078 (Relocate::relocate): Use symbolic names instead of numeric relocation
3079 codes to report error.
3080 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3081 workaround.
3082 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3083 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3084 thumb2_blx_out_of_range.stdout
3085 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3086 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3087 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3088 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3089 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3090 thumb2_blx_in_range, thumb2_blx_in_range.o,
3091 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3092 thumb2_blx_out_of_range.o): New rules.
3093 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3094 thumb2_blx_in_range and thumb2_blx_out_of_range.
3095 * testsuite/Makefile.in: Regenerate.
3096 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3097 * testsuite/thumb_blx_in_range.s: New file.
3098 * testsuite/thumb_blx_out_of_range.s: New file.
3099
b0193076
RÁE
31002010-03-22 Rafael Espindola <espindola@google.com>
3101
3102 * archive.cc (Should_include): Move to archive.h.
3103 (should_include_member): Make it a member of Archive.
3104 (Lib_group): New.
3105 (Add_lib_group_symbols): New.
3106 * archive.h: Include options.h.
3107 (Archive_member): Moved from Archive.
3108 (Should_include): Moved from archive.cc.
3109 (Lib_group): New.
3110 (Add_lib_group_symbols): New.
3111 * dynobj.cc (do_should_include_member): New.
3112 * dynobj.h (do_should_include_member): New.
3113 * gold.cc (queue_initial_tasks): Update call to queue.
3114 * main.cc (main): Print lib group stats.
3115 * object.cc (do_should_include_member): New.
3116 * object.h: Include archive.h.
3117 (Object::should_include_member): New.
3118 (Object::do_should_include_member): New.
3119 (Sized_relobj::do_should_include_member): New.
3120 * options.cc (General_options::parse_start_lib): New.
3121 (General_options::parse_end_lib): New.
3122 (Input_arguments::add_file): Handle lib groups.
3123 (Input_arguments::start_group): Check we are not in a lib.
3124 (Input_arguments::start_lib): New.
3125 (Input_arguments::end_lib): New.
3126 * options.h (General_options): Add start_lib and end_lib.
3127 (Input_argument::lib_): New.
3128 (Input_argument::lib): New.
3129 (Input_argument::is_lib): New.
3130 (Input_file_lib): New.
3131 (Input_arguments::in_lib_): New.
3132 (Input_arguments::in_lib): New.
3133 (Input_arguments::start_lib): New.
3134 (Input_arguments::end_lib_): New.
3135 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3136 in unused members as preempted.
3137 (Sized_pluginobj::do_should_include_member): New.
3138 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3139 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3140 return the blocker.
3141 (Read_symbols::do_whole_lib_group): New.
3142 (Read_symbols::do_lib_group): New.
3143 (Read_symbols::do_read_symbols): Handle lib groups.
3144 (Read_symbols::get_name): Handle lib groups.
3145 * readsyms.h (Read_symbols): Add an archive member pointer.
3146 (Read_symbols::do_whole_lib_group): New.
3147 (Read_symbols::do_lib_group): New.
3148 (Read_symbols::member_): New.
3149 * script.cc (read_input_script): Update call to queue_soon.
3150
d099120c
DK
31512010-03-19 Doug Kwan <dougkwan@google.com>
3152
3153 * arm.cc (Stub_table::Stub_table): Initialize new data members
3154 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3155 (Stub_table::add_reloc_stub): Assign stub offset and update
3156 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3157 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3158 New data members.
3159 (Stub_table::update_data_size_and_addralign): Use
3160 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3161 instead of going over all reloc stubs.
3162 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3163 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3164 Stringpool_template::offset_ to size of Stringpool_char.
3165 (Stringpool_template::new_key_offset): Remove code to initialize
3166 Stringpool_template::offset_.
3167 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3168 Stringpool_template::offset_ to zero.
3169
1aa37384
DK
31702010-03-15 Doug Kwan <dougkwan@google.com>
3171
3172 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3173 offset_.
3174 (Stringpool_template::new_key_offset): New method.
3175 (Stringpool_template::add_string): Assign offsets when adding new
3176 strings.
3177 (Stringpool_template::set_string_offsets): Do not set string offsets
3178 when not optimizing.
3179 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3180 member size_.
3181 (Chunked_vector::clear): Clear size_.
3182 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3183 (Chunked_vector::size): Return size_.
3184 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3185 (Chunked_vector::size_): New data member.
1aa37384
DK
3186 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3187 (Stringpool_template::new_key_offset): New method declaration.
3188 (Stringpool_template::offset_): New data member.
3189
b672b057
RÁE
31902010-03-15 Rafael Espindola <espindola@google.com>
3191
3192 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3193 Add_symbols' constructor.
3194 * readsyms.h (Add_symbols): Remove the input_group member.
3195
b6848d3c
ILT
31962010-03-10 Ian Lance Taylor <iant@google.com>
3197
3198 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3199 target to ask whether a reference to a symbol requires a stack
3200 split.
3201 * target.h (Target::is_call_to_non_split): New function.
3202 (Target::do_is_call_to_non_split): Declare virtual function.
3203 * target.cc: Include "symtab.h".
3204 (Target::do_is_call_to_non_split): New function.
3205 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3206
a2a5469e
CC
32072010-03-10 Cary Coutant <ccoutant@google.com>
3208
3209 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3210 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3211 (File_read::open[2]): Add whole_file_view_ to list of views.
3212 (File_read::make_view): Remove test of whole_file_view_.
3213 (File_read::find_or_make_view): Create whole_file_view_ if
3214 necessary.
3215 (File_read::clear_views): Replace bool parameter with enum;
3216 adjust all callers. Don't delete views with permanent data;
3217 do delete cached views and views from archives if
3218 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3219 if clearing the corresponding view.
3220 * fileread.h (File_read::Clear_views_mode): New enum.
3221 (File_read::View::is_permanent_view): New method.
3222 (File_read::clear_views): Replace bool parameter
3223 with enum; adjust all callers.
3224 * options.h (General_options): Change keep_files_mapped option;
3225 add map_whole_files.
3226 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3227 releasing the file.
3228 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3229 the file.
3230
8861f32b
DM
32312010-03-10 David S. Miller <davem@davemloft.net>
3232
3233 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
3234
d62d0f5f
ST
32352010-03-09 Sriraman Tallam <tmsriram@google.com>
3236
3237 * icf.cc (get_section_contents): Add '@' marker after processing the
3238 merge reloc.
3239
9177756d
DK
32402010-03-08 Doug Kwan <dougkwan@google.com>
3241
3242 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
3243 due to a conversion warning.
3244 (Arm_relobj::update_output_local_symbol_count): Check for local
3245 symbol with unset output index.
3246
9e9e071b
ILT
32472010-03-05 Ian Lance Taylor <iant@google.com>
3248
3249 * options.h (class General_options): Add --spare-dynamic-tags.
3250 * output.cc (Output_data_dynamic::set_final_data_size): Implement
3251 --spare-dynamic-tags.
3252
a81ee015
ILT
32532010-03-05 Ian Lance Taylor <iant@google.com>
3254
3255 * incremental.cc: Include "libiberty.h".
3256
44ec90b9
RO
32572010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3258
3259 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
3260 function, is_info_ member.
3261 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
3262 (Versions::Versions): Update caller.
3263 (Versions::define_base_version): Likewise.
3264 (Versions::add_def): Likewise.
3265
0897ed3b
ST
32662010-03-03 Sriraman Tallam <tmsriram@google.com>
3267
3268 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
3269 (Scan::possible_function_pointer_reloc): New function.
3270 (Scan::local_reloc_may_be_function_pointer): Change to call
3271 possible_function_pointer_reloc.
3272 (Scan::global_reloc_may_be_function_pointer): Ditto.
3273 * icf.h (Icf::check_section_for_function_pointers): Change to reject
3274 relocations in ".data.rel.ro._ZTV" section.
3275 * testsuite/icf_safe_so_test.sh: Change to pass i386.
3276 * testsuite/icf_safe_so_test.cc: Ditto.
3277 * testsuite/icf_safe_test.cc: Ditto.
3278 * testsuite/icf_safe_test.sh: Ditto.
3279
d3bbad62
ILT
32802010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3281 Ian Lance Taylor <iant@google.com>
3282
3283 * target-reloc.h (relocate_section): Check the symbol table index
3284 for -1U before setting the local symbol index.
3285 (scan_relocatable_relocs): If copying the relocation, record that
3286 the local symbol is required.
3287 * object.h (Symbol_value::is_output_symtab_index_set): New
3288 function.
3289 (Symbol_value::may_be_discarded_from_output_symtab): New
3290 function.
3291 (Symbol_value::has_output_symtab_entry): New function.
3292 (Symbol_value::needs_output_symtab_entry): Remove.
3293 (Symbol_value::output_symtab_index): Make sure the symbol index is
3294 set.
3295 (Symbol_value::set_output_symtab_index): Make sure the symbol
3296 index is not set. Make sure the new index is valid.
3297 (Symbol_value::set_must_have_output_symtab_entry): New function.
3298 (Symbol_value::has_output_dynsym_entry): New function.
3299 (Symbol_value::set_output_dynsym_index): Make sure the new index
3300 is valid.
3301 (Sized_relobj::set_must_have_output_symtab_entry): New function.
3302 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
3303 local symbol if permitted.
3304 (Sized_relobj::do_finalize_local_symbols): Call
3305 is_output_symtab_index_set rather than needs_output_symtab_entry.
3306 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
3307 rather than needs_output_symtab_entry. Call
3308 has_output_dynsym_entry rather than needs_output_dynsym_entry.
3309 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
3310 is_output_symtab_index_set rather than needs_output_symtab_entry.
3311 * testsuite/discard_locals_relocatable_test.c: New file.
3312 * testsuite/discard_locals_test.sh: Test -r.
3313 * testsuite/Makefile.am (check_DATA): Add
3314 discard_locals_relocatable_test1.syms,
3315 discard_local_relocatable_test2.syms.
3316 (MOSTLYCLEANFILES): Likewise. Also add
3317 discard_locals_relocatable_test1.lout and
3318 discard_locals_relocatable_test2.out.
3319 (discard_locals_relocatable_test1.syms): New target.
3320 (discard_locals_relocatable_test.o): New target.
3321 (discard_locals_relocatable_test1.out): New target.
3322 (discard_locals_relocatable_test2.syms): New target.
3323 (discard_locals_relocatable_test2.out): New target.
3324 (various): Add missing ../ld-new dependencies.
3325 * testsuite/Makefile.in: Rebuild.
3326
7e8ccf26
NC
33272010-03-03 Nick Clifton <nickc@redhat.com>
3328
3329 * po/fi.po: New Finnish translation.
3330
2a0ff005
DK
33312010-03-01 Doug Kwan <dougkwan@google.com>
3332
3333 * layout.cc (Layout::Layout): Force section types of .init_array*,
3334 .preinit_array* and .fini_array* sections.
3335 * output.cc (Output_section::Input_section_sort_entry::has_priority):
3336 Fix check of return value of std::string::find.().
3337 (Output_section::Input_section_sort_compare::operator()): Remove
3338 comment about .init_array.
3339 (Output_section::Input_section_sort_init_fini_compare::operator()):
3340 New method.
3341 (Output_section::sort_attached_input_sections): Handle .init_array
3342 and .fini_array specially.
3343 * output.h (Output_section::Inut_section_sort_compare): Update
3344 comment.
3345 (Output_section::Input_section_sort_init_fini_compare): New struct.
3346
c3e4ae29
DK
33472010-02-26 Doug Kwan <dougkwan@google.com>
3348
3349 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
3350 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
3351 * testsuite/debug_msg.sh: Avoid matching source line number for
3352 use of global variable undef_int.
3353
2fd9ae7a
DK
33542010-02-26 Doug Kwan <dougkwan@google.com>
3355
3356 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
3357 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
3358 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
3359 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
3360 * options.cc (General_options::General_options): Initialize member
3361 fix_v4bx_.
3362 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
3363 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
3364 and rm_no_fix_v4bx.stdout
3365 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
3366 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
3367 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
3368 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
3369 and arm_no_fix_v4bx.
3370 * Makefile.in: Regenerate.
3371 * testsuite/arm_fix_v4bx.s: New file.
3372 * testsuite/arm_fix_v4bx.sh: Ditto.
3373
67ec7d0b
DK
33742010-02-24 Doug Kwan <dougkwan@google.com>
3375
3376 * arm.cc (Target_arm::got_section): Make the .got section the first
3377 non RELRO section in the data segment.
3378 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
3379 suffixes of section names.
3380
10165461
DK
33812010-02-24 Doug Kwan <dougkwan@google.com>
3382
3383 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
3384 flags and attributes merging if an input file is a binary file.
3385 * fileread.cc (Input_file::open): Record format of original file.
3386 * fileread.h (Input_file::Format): New enum type.
3387 (Input_file::Input_file): Initialize data member format_.
3388 (Input_file::format): New method definition.
3389 (Input_file::format_):: New data member.
3390
4a54abbb
DK
33912010-02-24 Doug Kwan <dougkwan@google.com>
3392
3393 * arm.cc (Arm_output_data_got): New class.
3394 (ARM_TCB_SIZE): New constant
3395 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
3396 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
3397 If user uses a script with a SECTIONS clause, issue only a warning
3398 for a misplaced EXIDX input section. Otherwise, issue an error.
3399 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
3400 garbage collection.
3401 (Target_arm::got_mode_index_entry): Handle static linking.
3402 (Target_arm::Scan::local): Ditto.
3403 (Target_arm::Scan::global): Ditto.
3404 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
3405 all incorrectly implemented relocations.
e1df38aa 3406 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
3407 Arm_output_section::fix_exidx_coverage.
3408 * layout.cc (Layout::section_name_mapping): Remove trailing dots
3409 from ".ARM.exidx." and ".ARM.extab.".
3410
ca419a6f
ILT
34112010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3412
3413 * arm.cc (Target_arm::do_finalize_sections): Create attribute
3414 section if it does not already exist.
3415 * attributes.cc (Attributes_section_data::Attributes_section_data):
3416 Don't crash if size is zero.
3417
135b9c78
ILT
34182010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3419 Ian Lance Taylor <iant@google.com>
3420
3421 * gold.cc (queue_middle_tasks): If no input files were opened,
3422 exit.
3423 * workqueue.h (Task_function::Task_function): Assert that there is
3424 a blocker.
3425
bb0bfe4f
DK
34262010-02-22 Doug Kwan <dougkwan@google.com>
3427
3428 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
3429 * icf.cc (get_section_contents): Cast snprintf arguments to long long
3430 types to avoid warnings due to different uint64_t implementations
3431 on different hosts.
3432
2a2b6d42
DK
34332010-02-21 Doug Kwan <dougkwan@google.com>
3434
3435 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
3436 handling of the maximum backward branch offset.
3437 (Arm_relocate_functions::thumb_branch_common): Ditto.
3438 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
3439 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 3440 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
3441 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
3442 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
3443 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
3444 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
3445 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
3446 thumb_bl_out_of_range thumb_bl_out_of_range.o,
3447 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
3448 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
3449 thumb2_bl_out_of_range.o): New rules.
3450 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
3451 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
3452 thumb2_bl_out_of_range
3453 * testsuite/Makefile.in: Regenerate.
3454 * testsuite/arm_bl_in_range.s: New file.
3455 * testsuite/arm_bl_out_of_range.s: Ditto.
3456 * testsuite/arm_branch_in_range.sh: Ditto.
3457 * testsuite/arm_branch_range.t: Ditto.
3458 * testsuite/thumb2_branch_range.t: Ditto.
3459 * testsuite/thumb_bl_in_range.s: Ditto.
3460 * testsuite/thumb_bl_out_of_range.s: Ditto.
3461 * testsuite/thumb_branch_range.t: Ditto.
3462
b487ad64
ST
34632010-02-20 Sriraman Tallam <tmsriram@google.com>
3464
3465 * gc.h (gc_process_relocs): Change vectors to point to the new list.
3466 Add reloc offset information.
3467 * icf.cc (get_section_contents): Change iterators to point to the new
3468 vectors. Add reloc offset information to the contents.
3469 * icf.h (Icf::Sections_reachable_info): New typedef.
3470 (Icf::Sections_reachable_list): New typedef.
3471 (Icf::Offset_info): New typedef.
3472 (Icf::Reloc_info): New struct typedef.
3473 (Icf::Reloc_info_list): New typedef.
3474 (Icf::symbol_reloc_list): Delete method.
3475 (Icf::addend_reloc_list): Delete method.
3476 (Icf::section_reloc_list): Delete method.
3477 (Icf::reloc_info_list): New method.
3478 (Icf::reloc_info_list_): New member.
3479
f96accdf
DK
34802010-02-19 Doug Kwan <dougkwan@google.com>
3481
3482 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
3483 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
3484 * arm.cc (Arm_relocation_functions): New forward declaration.
3485 (Target_arm::Target_arm): Initialize new data members
3486 got_mod_index_offset_ and tls_base_symbol_defined_.
3487 (Target_arm::Relocate::relocate_tls): New method.
3488 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
3489 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
3490 New methods.
3491 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
3492 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
3493 (Target_arm::got_mod_index_offset_,
3494 Target_arm::tls_base_symbol_defined_): New data members.
3495 (Target_arm::Scan::local, Target::Scan::global,
3496 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
3497 relocations.
3498
c8761b9a
DK
34992010-02-18 Doug Kwan <dougkwan@google.com>
3500
3501 * arm.cc (Arm_relobj::find_linked_text_section): New method.
3502 (Arm_relobj::make_exidx_input_section): Pass section index of linked
3503 text section as a parameter becuase some broken tools may not set
3504 the link in section header.
3505 (Target_arm::has_got_section): New method.
3506 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
3507 without any mapping symbol as data only. Remove warning.
3508 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
3509 link in its section header, try to discover the link by inspecting the
3510 REL31 relocation at the beginning of the section.
3511 (Target_arm::Scan::check_non_pic): Report name of offending relocation
3512 in error message.
3513 (Target_arm::Scan::global): Treat any reference to the symbol
3514 _GLOBAL_OFFSET_TABLE_ as a GOT access.
3515
21bb3914
ST
35162010-02-12 Sriraman Tallam <tmsriram@google.com>
3517
3518 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
3519 (Scan::global_reloc_may_be_function_pointer): New function.
3520 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3521 (Scan::global_reloc_may_be_function_pointer): New function.
3522 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3523 (Scan::global_reloc_may_be_function_pointer): New function.
3524 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
3525 (Scan::global_reloc_may_be_function_pointer): New function.
3526 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
3527 (Scan::global_reloc_may_be_function_pointer): New function.
3528 (Scan::possible_function_pointer_reloc): New function.
3529 (Target_x86_64::can_check_for_function_pointers): New function.
3530 * gc.h (gc_process_relocs): Scan relocation types to determine if
3531 function pointers were taken for targets that support it.
3532 * icf.cc (Icf::find_identical_sections): Include functions for
3533 folding in safe ICF whose pointer is not taken.
3534 * icf.h (Secn_fptr_taken_set): New typedef.
3535 (fptr_section_id_): New member.
3536 (section_has_function_pointers): New function.
3537 (set_section_has_function_pointers): New function.
3538 (check_section_for_function_pointers): New function.
3539 * options.h: Fix comment for safe ICF option.
3540 * target.h (can_check_for_function_pointers): New function.
3541 * testsuite/Makefile.am: Add icf_safe_so_test test case.
3542 Modify icf_safe_test for X86-64.
3543 * testsuite/Makefile.in: Regenerate.
3544 * testsuite/icf_safe_so_test.cc: New file.
3545 * testsuite/icf_safe_so_test.sh: New file.
3546 * testsuite/icf_safe_test.cc (kept_func_3): New function.
3547 (main): Change to take pointer to function kept_func_3.
3548 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
3549 folding is done correctly for X86-64.
3550
0da6fa6c
DM
35512010-02-12 David S. Miller <davem@davemloft.net>
3552
3553 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
3554 is_symbolless parameter.
3555 (Output_reloc<SHT_REL>::is_symbolless): New.
3556 (Output_reloc<SHT_REL>::is_symbolless_): New.
3557 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
3558 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
3559 (Output_reloc<SHT_RELA>::is_symbolless): New.
3560 (Output_data_reloc::add_global): Handle is_symbolless.
3561 (Output_data_reloc::add_global_relative): Likewise.
3562 (Output_data_reloc::add_local): Likewise.
3563 (Output_data_reloc::add_local_relative): Likewise.
3564 (Output_data_reloc::add_symbolless_global_addend): New.
3565 (Output_data_reloc::add_symbolless_local_addend): New.
3566 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
3567 is_symbolless.
3568 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
3569 instead of ->is_relative_
3570 (Output_reloc::write): Likewise.
3571 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
3572 (Output_reloc::write_rel): Simplify.
3573
3574 * sparc.cc (Target_sparc::Scan::local): Use
3575 ->add_symbolless_local_addend as needed.
3576 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
3577 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
3578 based upon relocation offset.
3579
e4782e83
DK
35802010-02-11 Doug Kwan <dougkwan@google.com>
3581
3582 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
3583 (Target_arm::Scan::global): Ditto. Also remove a comment before the
3584 beginning of function.
3585 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
3586 and MOVT_ABS relocations. Those are non issued in scanning. Fix
3587 parameter is_32bit in calls to should_apply_static_reloc.
3588 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
3589 (check_DATA): Add arm_abs_global.stdout.
3590 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
3591 arm_abs_global.stdout): New rules.
3592 (MOSTLLYCLEANFILES): Add arm_abs_global
3593 * Makefile.in: Regenerate.
3594 * testsuite/arm_abs_global.s: New file.
3595 * testsuite/arm_abs_global.sh: Ditto.
3596 * testsuite/arm_abs_lib.s: Ditto.
3597
93ceb764
ILT
35982010-02-11 Ian Lance Taylor <iant@google.com>
3599
3600 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
3601 Read_relocs task.
3602 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
3603 Allocate_commons_task first.
3604 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
3605 task, rather than symtab_lock_.
3606 (Gc_process_relocs::~Gc_process_relocs): New function.
3607 (Gc_process_relocs::is_runnable): Check this_blocker_.
3608 (Gc_process_relocs::locks): Use next_blocker_ rather than
3609 blocker_.
3610 (Scan_relocs::~Scan_relocs): New function.
3611 (Scan_relocs::is_runnable): Check this_blocker_ rather than
3612 symtab_lock_.
3613 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
3614 next_blocker_.
3615 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
3616 fields. Add this_blocker_ and next_blocker_ fields. Adjust
3617 constructor accordingly.
3618 (class Gc_process_relocs): Likewise.
3619 (class Scan_relocs): Likewise.
3620 * common.h (class Allocate_commons_task): Remove symtab_lock_
3621 field, and corresponding constructor parameter.
3622 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
3623 symtab_lock_.
3624 (Allocate_commons_task::locks): Likewise.
3625
114dfbe1
ILT
36262010-02-11 Ian Lance Taylor <iant@google.com>
3627
3628 * gold-threads.h (class Once): Define.
3629 (class Initialize_lock): Rewrite as child of Once.
3630 * gold-threads.cc (class Once_initialize): Define.
3631 (once_pointer_control): New static variable.
3632 (once_pointer, once_arg): New static variables.
3633 (c_run_once): New static function.
3634 (Once::Once, Once::run_once, Once::internal_run): New functions.
3635 (class Initialize_lock_once): Remove.
3636 (initialize_lock_control): Remove.
3637 (initialize_lock_pointer): Remove.
3638 (initialize_lock_once): Remove.
3639 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
3640 (Initialize_lock::initialize): Rewrite.
3641 (Initialize_lock::do_run_once): New function.
3642 * archive.cc (Archive::interpret_header): Only clear name if it is
3643 not already empty.
3644 * fileread.cc: Include "gold-threads.h"
3645 (file_counts_lock): New static variable.
3646 (file_counts_initialize_lock): Likewise.
3647 (File_read::release): Only increment counts when using --stats.
3648 Use a lock around the increment.
3649 * parameters.cc (class Set_parameters_target_once): Define.
3650 (set_parameters_target_once): New static variable.
3651 (Parameters::Parameters): Move here from parameters.h.
3652 (Parameters::set_target): Rewrite.
3653 (Parameters::set_target_once): New function.
3654 (Parameters::clear_target): Move here and rewrite.
3655 * parameters.h (class Parameters): Update declarations. Add
3656 set_parameters_target_once_ field.
3657 (Parameters::Parameters): Move to parameters.cc.
3658 (Parameters::clear_target): Likewise.
3659 * readsyms.cc (Read_symbols::do_group): Create a Start_group
3660 task.
3661 (Start_group::~Start_group): New function.
3662 (Start_group::is_runnable): New function.
3663 (Start_group::locks, Start_group::run): New functions.
3664 (Finish_group::run): Change saw_undefined to size_t.
3665 * readsyms.h (class Start_group): Define.
3666 (class Finish_group): Change saw_undefined_ field to size_t.
3667 (Finish_group::Finish_group): Remove saw_undefined and
3668 this_blocker parameters. Change all callers.
3669 (Finish_group::set_saw_undefined): New function.
3670 (Finish_group::set_blocker): New function.
3671 * symtab.h (class Symbol_table): Change saw_undefined to return
3672 size_t. Change saw_undefined_ field to size_t.
3673 * target-select.cc (Set_target_once::do_run_once): New function.
3674 (Target_selector::Target_selector): Initialize set_target_once_
3675 field. Don't initialize lock_ and initialize_lock_ fields.
3676 (Target_selector::instantiate_target): Rewrite.
3677 (Target_selector::set_target): New function.
3678 * target-select.h (class Set_target_once): Define.
3679 (class Target_selector): Update declarations. Make
3680 Set_target_once a friend. Remove lock_ and initialize_lock_
3681 fields. Add set_target_once_ field.
3682
fa17a3f4
ILT
36832010-02-10 Ian Lance Taylor <iant@google.com>
3684
3685 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
3686 queueing any tasks.
3687 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
3688 (queue_middle_tasks): Add all blockers before queueing any tasks.
3689 (queue_final_tasks): Likewise.
3690 * token.h (Task_token::add_blockers): New function.
3691 * object.h (Input_objects::number_of_relobjs): New function.
3692
c7177d31
ILT
36932010-02-10 Ian Lance Taylor <iant@google.com>
3694
5de0e392
ILT
3695 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
3696 shared, not if not position independent.
3697 * x86_64.cc (Relocate::relocate_tls): Likewise.
3698 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
3699 (tls_pie_pic_test): New target.
3700 * testsuite/Makefile.in: Rebuild.
3701
c7177d31
ILT
3702 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
3703 (tls_test_main_pie.o, tls_test_pie.o): New targets.
3704 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
3705 * testsuite/Makefile.in: Rebuild.
3706
684b268a
DM
37072010-02-09 David S. Miller <davem@davemloft.net>
3708
3709 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
3710 R_SPARC_RELATIVE using ->add_local_relative().
3711 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
3712
612a8d3d
DM
3713 * output.h (Output_data_dynamic::add_section_size): New method
3714 that takes two Output_data objects.
3715 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
3716 entry param. Handle it in initializers.
3717 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
3718 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
3719 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
3720 arg.
3721 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
3722 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
3723 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
3724 for dynrel_includes_plt.
3725 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3726 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3727 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
3728 before .rela.plt
3729 (Target_sparc::do_finalize_sections): Update to pass true for
3730 dynrel_includes_plt.
3731 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
3732 output before .rela.plt
3733 (Target_powerpc::do_finalize_sections): Update to pass true for
3734 dynrel_includes_plt when 32-bit.
3735
cb1be87e
DK
37362010-02-08 Doug Kwan <dougkwan@google.com>
3737
3738 * arm.cc (Arm_relobj::simple_input_section_output_address): New
3739 method.
3740 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
3741 Arm_relobj::scan_section_for_cortex_a8_stubs,
3742 Arm_relobj::do_relocation_section): Instead of calling
3743 Output_section::output_address, use faster
3744 Arm_relobj::simple_input_section_output_address.
3745
705b5121
DM
37462010-02-08 David S. Miller <davem@davemloft.net>
3747
3748 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
3749 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
3750 relocation helper function.
3751
024c4466
DM
3752 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
3753 just like R_SPARC_GOT{10,13,22}.
3754 (Target_sparc::Scan::local): Likewise.
3755 (Target_sparc::Relocate:relocate): Likewise.
3756
9109c078
ILT
37572010-02-06 Ian Lance Taylor <iant@google.com>
3758
3759 * configure.ac: Rewrite targetobjs duplicate removal code to use
3760 only shell constructs.
3761 * configure: Rebuild.
3762
cf846138
DK
37632010-02-05 Doug Kwan <dougkwan@google.com>
3764
3765 PR 11247
3766 * arm.cc (Arm_relobj::section_is_scannable): New method.
3767 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
3768 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
3769
6cfaf60b
DK
37702010-02-04 Doug Kwan <dougkwan@google.com>
3771
3772 PR 11247
3773 * arm-reloc-property.cc (cstdio): Include.
3774 * configure.ac (targetobjs): Remove duplicates.
3775 * configure: Regenerate.
3776 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
3777 big and little endian version for a given address size.
3778
5c57f1be
DK
37792010-02-03 Doug Kwan <dougkwan@google.com>
3780
3781 * arm-reloc-property.cc
3782 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3783 definition.
3784 * arm-reloc-property.h
3785 (Arm_reloc_property_table::get_implemented_static_reloc_property):
3786 New method definition.
3787 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3788 declaration.
3789 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
3790 overflow to N.
3791 (GOT_PREL): Change implemented to Y.
3792 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
3793 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
3794 (Arm_relocate_functions::movw_abs_nc): Remove method.
3795 (Arm_relocate_functions::movt_abs): Ditto.
3796 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
3797 (Arm_relocate_functions::thm_movt_abs): Ditto.
3798 (Arm_relocate_functions::movw_rel_nc): Ditto.
3799 (Arm_relocate_functions::movw_rel): Ditto.
3800 (Arm_relocate_functions::movt_rel): Ditto.
3801 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
3802 (Arm_relocate_functions:thm_movw_rel): Ditto.
3803 (Arm_relocate_functions:thm_movt_rel): Ditto.
3804 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
3805 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
3806 New method definitions.
3807 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
3808 (Arm_relocation_functions::arm_grp_ldr): Ditto.
3809 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
3810 (Arm_relocation_functions::arm_grp_ldc): Ditto.
3811 (Target_arm::Relocate::relocate): Check for non-static or
3812 unimplemented relocation code and exit early. Change calls to
3813 Target_arm::reloc_uses_thumb_bit and
3814 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
3815 instead. Refactor code to handle similar relocations to increase
3816 code sharing. Remove check for unsupported relocation code in switch
3817 statement.
3818 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
3819 relocation property table to find out size. Change error message to
3820 print out the name of a relocation code instead of the numeric value.
3821 (Target_arm::scan_reloc_for_stub): Use relocation property table
3822 instead of calling Target_arm::reloc_uses_thumb_bit().
3823
218c5831
DK
38242010-02-02 Doug Kwan <dougkwan@google.com>
3825
3826 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
3827 types of relaxed input section.
3828
0d31c79d
DK
38292010-02-02 Doug Kwan <dougkwan@google.com>
3830
3831 * Makefile.am (HFILES): Add arm-reloc-property.h.
3832 (DEFFILES): New.
3833 (TARGETSOURCES): Add arm-reloc-property.cc
3834 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
3835 (libgold_a_SOURCES): $(DEFFILES)
3836 * Makefile.in: Regenerate.
3837 * arm-reloc-property.cc: New file.
3838 * arm-reloc-property.h: New file.
3839 * arm-reloc.def: New file.
3840 * arm.cc: Update comments.
3841 (arm-reloc-property.h): New included header.
3842 (arm_reloc_property_table): New global variable.
3843 (Target_arm::do_select_as_default_target): New method definition.
3844 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
3845 arm-reloc-property to targ_extra_obj.
3846 * parameters.cc (set_parameters_target): Call
3847 Target::select_as_default_target().
3848 * target.h (Target::select_as_default_target): New method definition.
3849 (Target::do_select_as_default_target): Same.
3850
546c7457
DK
38512010-02-01 Doug Kwan <dougkwan@google.com>
3852
3853 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
3854 first_output_text_section_.
3855 (Arm_exidx_fixup::first_output_text_section): New method definition.
3856 (Arm_exidx_fixup::first_output_text_section_): New data member.
3857 (Arm_exidx_fixup::process_exidx_section): Record the first text
3858 output section seen.
3859 (Arm_output_section::fix_exidx_coverage): Set correct linked section
3860 and entsize in output section header.
3861
11b861d5
DK
38622010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3863
3864 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
3865 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
3866 (Arm_relocate_functions::thm_alu11): New Method.
3867 (Arm_relocate_functions::thm_pc8): New Method.
3868 (Arm_relocate_functions::thm_pc12): New Method.
3869 (Target_arm::Scan::local): Handle the relocations.
3870 (Target_arm::Scan::global): Likewise.
3871 (Target_arm::Relocate::relocate): Likewise.
3872 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
3873
c9a2c125
DK
38742010-01-29 Doug Kwan <dougkwan@google.com>
3875
3876 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
3877 of relocation types as ld.
3878
1521477a
DK
38792010-01-29 Doug Kwan <dougkwan@google.com>
3880
3881 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
3882 to public.
3883 (Arm_relocate_functions::thumb_branch_common): Ditto.
3884 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
3885 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
3886 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
3887 Arm_relocate_functions::jump24): Remove.
3888 (Target_arm::Relocate::relocate): Adjust code to call
3889 Arm_relocation_functions::arm_branch_common and
3890 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 3891 wrappers. Merge switch-cases together to reduce source code size.
1521477a 3892
e7eca48c
DK
38932010-01-29 Doug Kwan <dougkwan@google.com>
3894
3895 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
3896 output_local_symbol_count_needs_update_.
3897 (Arm_relobj::output_local_symbol_count_needs_update,
3898 Arm_relobj::set_output_local_symbol_count_needs_update,
3899 Arm_relobj::update_output_local_symbol_count): New methods.
3900 (Arm_relobj::output_local_symbol_count_needs_update_): New data
3901 member.
3902 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
3903 of pointed function as in a R_ARM_PREL31 relocation.
3904 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
3905 for output local symbol count updating.
3906 (Target_arm::do_relax): Update output local symbol counts in objects
3907 if necessary.
3908 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
3909
02961d7e
ILT
39102010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3911
3912 * arm.cc: Added support for the ARM relocations:
3913 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
3914 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
3915 (Arm_relocate_functions::movw_rel_nc): Renamed (was
3916 movw_prel_nc).
3917 (Arm_relocate_functions::movw_rel): New method.
3918 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
3919 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
3920 thm_movw_prel_nc).
3921 (Arm_relocate_functions::thm_movw_rel): New method.
3922 (Arm_relocate_functions::thm_movt_rel): Renamed (was
3923 thm_movt_prel).
3924 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
3925 relocations.
3926 (Target_arm::Scan::global): Likewise.
3927 (Target_arm::Relocate::relocate): Likewise.
3928 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3929 Likewise.
3930
b10d2873
ILT
39312010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3932
3933 * arm.cc: Added support for ARM group relocations.
3934 (Target_arm::reloc_needs_sym_origin): New method.
3935 (Arm_relocate_functions::calc_grp_kn): New method.
3936 (Arm_relocate_functions::calc_grp_residual): New method.
3937 (Arm_relocate_functions::calc_grp_gn): New method.
3938 (Arm_relocate_functions::arm_grp_alu): New Method.
3939 (Arm_relocate_functions::arm_grp_ldr): New Method.
3940 (Arm_relocate_functions::arm_grp_ldrs): New Method.
3941 (Arm_relocate_functions::arm_grp_ldc): New Method.
3942 (Target_arm::Scan::local): Handle the ARM group relocations.
3943 (Target_arm::Scan::global): Likewise.
3944 (Target_arm::Relocate::relocate): Likewise.
3945 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3946 Likewise.
3947
2b328d4e
DK
39482010-01-26 Doug Kwan <dougkwan@google.com>
3949
3950 * arm.cc (set): Include.
3951 (class Arm_exidx_fixup): Change type of last_input_section_ to const
3952 pointer type.
3953 (Arm_output_section::Text_section_list): New type.
3954 (Arm_output_section::append_text_sections_to_list): New method.
3955 (Arm_output_section::fix_exidx_coverage): Ditto.
3956 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
3957 (Arm_relobj::convert_input_section_to_relaxed_section): Use
3958 Relobj::set_section_offset() instead of
3959 Sized_relobj::invalidate_section_offset().
3960 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
3961 parameter for section headers. Ignore relocation sections for
3962 unallocated sections and EXIDX sections.
3963 (Target_arm::fix_exidx_coverage): New method.
3964 (Target_arm::output_section_address_less_than): New type.
3965 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
3966 linked text section instead of the EXIDX section.
3967 (Arm_output_section::create_stub_group): Add an assertion to check
3968 that this is not an EXIDX output section.
3969 (Arm_output_section::append_text_sections_to_list): New method.
3970 (Arm_output_section::fix_exidx_coverage): Ditto.
3971 (Arm_relobj::scan_sections_for_stubs): Adjust call to
3972 Arm_relobj::section_needs_reloc_stub_scanning.
3973 (Target_arm::do_relax): Fix EXIDX output section coverage in the
3974 first pass.
3975 (Target_arm::fix_exidx_coverage): New method.
3976 * object.h (Relobj::set_output_section): New method.
3977 (Sized_relobj::invalidate_section_offset): Remove method.
3978 (Sized_relobj::do_invalidate_section_offset): Remove method.
3979 (Sized_relobj::do_set_section_offset): Handle offset value -1.
3980
c7f3c371
DK
39812010-01-25 Doug Kwan <dougkwan@google.com>
3982
3983 * arm.cc (Arm_exidx_merged_section::do_output_offset):
3984 Fix warning due to signed and unsigned comparison on a 32-bit host.
3985
8923b24c
DK
39862010-01-22 Doug Kwan <dougkwan@google.com>
3987
3988 * arm.cc (Target_arm::do_relax): Record an output section for section
3989 offset adjustment it contains any stub table that has changed.
3990 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
3991 offsets in an output section if necessary.
3992 * output.cc (Output_section::Output_section): Initialize
3993 section_offsets_need_adjustments_.
3994 (Output_section::add_input_section_for_script): Renamed to
3995 Output_section::add_simple_input_section.
3996 (Output_section::save_states): Add a comment.
3997 (Output_section::discard_states): New method defintion.
3998 (Output_section::adjust_section_offsets): Same.
3999 * output.h (Output_section::add_input_section_for_script): Renamed to
4000 Output_section::add_simple_input_section.
4001 (Output_section::discard_states): New method declaration.
4002 (Output_section::adjust_section_offsets): Same.
4003 (Output_section::section_offsets_need_adjustment,
4004 Output_section::set_section_offsets_need_adjustment): New method
4005 definitions.
4006 (Output_section::section_offsets_need_adjustment_): New data member.
4007 * script-sections.cc
4008 (Output_section_element_input::set_section_address): Adjust code for
4009 renaming of Output_section::add_input_section_for_script.
4010 (Orphan_output_section::set_section_address): Same.
4011
9b2fd367
DK
40122010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4013
4014 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4015 Fix_v4bx enum values .
4016 * gold/options.h (General_options): New option definitions.
4017 (General_options::fix_v4bx): New method.
4018 (General_options::Fix_v4bx): New enum.
4019 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4020 (General_options::parse_fix_v4bx_interworking): New method.
4021
80d0d023
DK
40222010-01-22 Doug Kwan <dougkwan@google.com>
4023
4024 * arm.cc (Arm_exidx_fixup): New class.
4025
af2cdeae
DK
40262010-01-21 Doug Kwan <dougkwan@google.com>
4027
4028 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4029 classes.
4030 (Arm_exidx_section_offset_map): New type.
4031
993d07c1
DK
40322010-01-21 Doug Kwan <dougkwan@google.com>
4033
4034 * arm.cc (Arm_exidx_input_section): New class.
4035 (Arm_relobj::exidx_input_section_by_link,
4036 Arm_relobj::exidx_input_section_by_shndx,
4037 Arm_relobj::make_exidx_input_section): New methods.
4038 (read_arm_attributes_section): Remove.
4039 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4040 information about them.
4041 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4042 to here.
4043
5ac169d4
DK
40442010-01-20 Doug Kwan <dougkwan@google.com>
4045
4046 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4047 Input_section_specifier to Section_id.
4048 (Target_arm::new_arm_input_section: Adjust code for change of key
4049 type.
4050 (Target_arm::find_arm_input_section): Ditto.
4051 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4052 (Section_id): Remove.
4053 (Garbage_collection::Section_id_hash): Remove.
4054 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4055 (Section_id): Remove.
4056 (Icf::Section_id_hash): Remove.
4057 * object.h (Section_id, Const_section_id, Section_id_hash,
4058 Const_section_id_hash): New type definitions.
4059 * output.cc (Output_section::add_relaxed_input_section): Change to
4060 use Const_section_id instead of Input_section_specifier as key type.
4061 (Output_section::add_merge_input_section): Ditto.
4062 (Output_section::build_relaxation_map): Change to use Section_id
4063 instead of Input_section_specifier as key type.
4064 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4065 Ditto.
4066 (Output_section::convert_input_sections_to_relaxed_sections): Change
4067 to use Const_section_id instead of Input_section_specifier as key type.
4068 (Output_section::find_merge_section): Ditto.
4069 (Output_section::find_relaxed_input_section): Ditto.
4070 * output.h (Input_section_specifier): Remove class.
4071 (Output_section::Output_section_data_by_input_section_map): Change
4072 key type to Const_section_id.
4073 (Output_section::Output_relaxed_input_section_by_input_section_map):
4074 Ditto.
4075 (Output_section::Relaxation_map): Change key type to Section_id.
4076
a2162063
ILT
40772010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4078
4079 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4080 (class Arm_v4bx_stub): New class.
4081 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4082 (Stub_factory::make_arm_v4bx_stub): New method.
4083 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4084 (Stub_table::empty): Handle v4bx stubs.
4085 (Stub_table::add_arm_v4bx_stub): New method.
4086 (Stub_table::find_arm_v4bx_stub): New method.
4087 (Arm_relocate_functions::v4bx): New method.
4088 (Target_arm::fix_v4bx): New method.
4089 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4090 (Stub_table::relocate_stubs): Likewise.
4091 (Stub_table::do_write): Likewise.
4092 (Stub_table::update_data_size_and_addralign): Likewise.
4093 (Stub_table::finalize_stubs): Likewise.
4094 (Target_arm::Scan::local): Likewise.
4095 (Target_arm::Scan::global): Likewise.
4096 (Target_arm::do_finalize_sections): Likewise.
4097 (Target_arm::Relocate::relocate): Likewise.
4098 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4099 Likewise.
4100 (Target_arm::scan_reloc_for_stub): Likewise.
4101 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4102
5696ab0b
ILT
41032010-01-19 Ian Lance Taylor <iant@google.com>
4104
4105 * output.cc (Output_section_headers::do_sized_write): Write large
4106 segment count to sh_info field.
4107 (Output_file_header::do_sized_write): For large segment count,
4108 write PN_XNUM to e_phnum field.
4109
800d0f56
ILT
41102010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4111
4112 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4113 (Arm_relocate_functions::thm_jump8): New function.
4114 (Arm_relocate_functions::thm_jump11): New function.
4115 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4116 R_ARM_THM_JUMP11.
4117 (Target_arm::Scan::global): Likewise.
4118 (Target_arm::Relocate::relocate): Likewise.
4119 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4120 Likewise.
4121
41263c05
DK
41222010-01-14 Doug Kwan <dougkwan@google.com>
4123
4124 * arm.cc (map, utility): Include headers.
4125 (Target_arm::apply_cortex_a8_workaround): New method.
4126 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4127 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4128 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4129 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4130 the --[no-]fix-cortex-a8 command line options.
4131 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4132 (Target_arm::relocate_stub): Use addend in instruction template.
4133 * options.h (DEFINE_bool): Set the user-set flag.
4134 (General_options): Add --[no-]-fix-cortex options.
4135 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4136 : Update fast look-up map after conversion.
41263c05 4137
459e9b03
ST
41382010-01-14 Sriraman Tallam <tmsriram@google.com>
4139
4140 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4141 in the first pass of do_layout.
4142
b521dfe4
DK
41432010-01-13 Doug Kwan <dougkwan@google.com>
4144
4145 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4146 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4147 apparent compiler problem of not folding static constant integral
4148 data members of elfcpp::Elf_sizes<32>.
4149
44272192
DK
41502010-01-13 Doug Kwan <dougkwan@google.com>
4151
4152 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4153 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4154 Arm_relobj::scan_section_for_cortex_a8_erratum,
4155 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4156 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4157 sections to scan for relocation stubs into a new method
4158 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4159 relocation and Cortex-A8 stub scanning.
4160 (Target_arm::do_relax): Force stubs to be after stubbed sections
4161 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4162 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4163 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4164
44b71ece
ILT
41652010-01-12 Ian Lance Taylor <iant@google.com>
4166
4167 * target-reloc.h (visibility_error): New inline function.
4168 (relocate_section): Call visibility_error.
4169 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4170 (MOSTLYCLEANFILES): Likewise.
4171 (protected_4_pic.o, protected_3.err): New targets.
4172 * testsuite/protected_4.cc: New file.
4173
a120bc7f
DK
41742010-01-12 Doug Kwan <dougkwan@google.com>
4175
4176 * arm.cc (Cortex_a8_reloc): New class.
4177 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4178 and cortex_a8_relocs_info_.
4179 (Target_arm::fix_cortex_a8): New method definition.
4180 (Target_arm::Cortex_a8_relocs_info): New type.
4181 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4182 New data member declarations.
4183 (Target_arm::scan_reloc_for_stub): Record information about
4184 relocations for THUMB branches that might be exempted from the
4185 Cortex-A8 workaround.
4186 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4187 at the beginning of a relaxation pass.
4188
20138696
DK
41892010-01-12 Doug Kwan <dougkwan@google.com>
4190
4191 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4192 (Arm_relobj::Mapping_symbol_position,
4193 Arm_reloj::Mapping_symbol_position_less,
4194 Arm_relobj::Mapping_symbols_info): New types.
4195 (Target_arm::is_mapping_symbol_name): New method definition.
4196 (Arm_relobj::do_count_local_symbols): Save information about mapping
4197 symbols.
4198
089d69dc
DK
41992010-01-11 Doug Kwan <dougkwan@google.com>
4200
4201 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4202 Arm_relocate_functions::thumb32_branch_upper,
4203 Arm_relocate_functions::thumb32_branch_lower,
4204 Arm_relocate_functions::thumb32_cond_branch_offset,
4205 Arm_relocate_functions::thumb32_cond_branch_upper,
4206 Arm_relocate_functions::thumb32_cond_branch_lower,
4207 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4208 branch offset encoding.
4209 (Arm_relocate_functions::thumb_branch_common): Use new branch
4210 offset encoding methods to avoid code duplication.
4211 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4212 (Stub_addend_reader::operator()): Use new branch encoding method
4213 to avoid code duplication.
4214
99e5bff2
DK
42152010-01-11 Doug Kwan <dougkwan@google.com>
4216
4217 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4218 (Target_arm::do_finalize_sections): Define special EXIDX section
4219 symbols only if referenced.
4220 * gc.h (Garbage_collection::add_reference): New method.
4221 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4222 code duplication.
4223
98e090bd
ILT
42242010-01-11 Ian Lance Taylor <iant@google.com>
4225
d0a91bd8
ILT
4226 * script.cc (Version_script_info::build_expression_list_lookup):
4227 Change complaing about duplicate wildcard match from error to
4228 warning.
4229
98e090bd
ILT
4230 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4231 of 2009-12-30.
4232 (Version_script_info::Version_script_info): Initialize globs_,
4233 default_version_, default_is_global_, and exact_. Don't
4234 initialize globals_ or locals_.
4235 (Version_script_info::build_lookup_tables): Build local symbols
4236 first.
4237 (Version_script_info::unquote): New function.
4238 (Version_script_info::add_exact_match): New function.
4239 (Version_script_info::build_expression_list_lookup): Remove lookup
4240 parameter. Add is_global parameter. Change all callers. Handle
4241 wildcard pattern specially. Unquote pattern. Call
4242 add_exact_match.
4243 (Version_script_info::get_name_to_match): New function.
4244 (Version_script_info::get_symbol_version): New function.
4245 (Version_script_info::get_symbol_version_helper): Remove.
4246 (Version_script_info::check_unmatched_names): Call unquote.
4247 * script.h (class Version_script_info): Change get_symbol_version
4248 to be non-inline and add is_global parameter; change all callers.
4249 Rewrite symbol_is_local. Update declarations. Define struct
4250 Version_tree_match, Exact, Globs. Don't define struct Lookup.
4251 Remove globals_ and locals_ members. Add exact_, globs_,
4252 default_version_, is_global_.
4253 (Version_script_info::Glob): Remove pattern, add expression and
4254 is_global. Update constructor. Change all callers.
4255 * dynobj.cc (Versions::finalize): Mark the version symbol as the
4256 default version.
4257 (Versions::symbol_section_contents): If a symbol is undefined, or
4258 defined in a dynamic object, set the version index to
4259 VER_NDX_LOCAL.
4260 * symtab.cc (Symbol_table::add_from_relobj): Don't call
4261 symbol_is_local.
4262 (Symbol_table::add_from_pluginobj): Likewise.
4263 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
4264
d56962d3
DK
42652010-01-11 Doug Kwan <dougkwan@google.com>
4266
4267 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
4268 (incremental_dump_LDADD): Add linking option for libintl.
4269 * Makefile.in: Regenerate.
4270
94e6ee91
L
42712010-01-11 H.J. Lu <hongjiu.lu@intel.com>
4272
4273 PR gold/11144
4274 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
4275 instead of -Ds.
4276 * testsuite/Makefile.in: Regenerated.
4277
e96c574b
DK
42782010-01-10 Doug Kwan <dougkwan@google.com>
4279
4280 * options.h (DEFINE_var): Use parentheses around argument varname__
4281 in macro body to avoid any unintended subsequent substitutions.
4282
7198066b
ILT
42832010-01-10 Ian Lance Taylor <iant@google.com>
4284
ba4d53bf
ILT
4285 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
4286 candidates before doing symbol resolution.
4287
7198066b
ILT
4288 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
4289 ODR candidates if only one is weak.
4290
a2beed37
ILT
42912010-01-08 Ian Lance Taylor <iant@google.com>
4292
4293 * script.cc (Version_script_info::build_expression_list_lookup):
4294 Don't warn about ambiguous version, just record the ambiguity.
4295 (Version_script_info::get_symbol_version_helper): Give error if
4296 version is ambiguous.
4297
2fb7225c
DK
42982010-01-08 Doug Kwan <dougkwan@google.com>
4299
4300 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
4301 prev_data_size_ and prev_addralign_. Remove initializer for
4302 deleted data member has_been_changed_.
4303 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
4304 to determine if the table is empty.
4305 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
4306 Remove.
4307 (Stub_table::add_reloc_stub): Define method in class definition
4308 instead of just declaring it there.
4309 (Stub_table::add_cortex_a8_stub): New method definition.
4310 (Stub_table::update_data_size_and_addralign): Ditto.
4311 (Stub_table::finalize_stubs): Ditto.
4312 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
4313 (Stub_table::do_addralign_): Return address alignment in the
4314 (Stub_table::do_reset_address_and_file_offset): Define method in
4315 class definition instead of declaring it there. Set current data
4316 size to be the data size of the previous pass.
4317 (Stub_table::set_final_data_size): Use current data size as the
4318 final data size.
4319 (Stub_table::relocate_stub): Change parameter type of stub from
4320 Reloc_stub pointer to Stub pointer.
4321 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
4322 (Stub_table::Cortex_a8_stub_list): New typedef.
4323 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
4324 Stub_table::prev_addralign_): New data member.
4325 (Arm_relobj::Arm_relobj): Initialize data member
4326 section_has_cortex_a8_workaround_.
4327 (Arm_relobj::section_has_cortex_a8_workaround,
4328 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
4329 definitions.
4330 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
4331 declarations.
4332 (Target_arm::relocate_stub): Change parameter type of stub from
4333 Reloc_stub pointer to Stub pointer.
4334 (Insn_template::size, Insn_template::alignment): Handle
4335 THUMB16_SPECIAL_TYPE.
4336 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
4337 Stub_table::update_data_size_and_addralign,
4338 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
4339 definitions.
4340 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
4341 (Stub_table::do_write): Ditto.
4342 (Target_arm::do_relax): Adjust code for changes in Stub_table.
4343
880cd20d
ILT
43442010-01-08 Ian Lance Taylor <iant@google.com>
4345
4346 PR 11108
4347 * symtab.h (class Symbol): Remove fields is_target_special_ and
4348 has_plt_offset_. Add field is_defined_in_discarded_section_.
4349 (Symbol::is_defined_in_discarded_section): New function.
4350 (Symbol::set_is_defined_in_discarded_section): New function.
4351 (Symbol::has_plt_offset): Rewrite.
4352 (Symbol::set_plt_offset): Verify that new offset is not -1U.
4353 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
4354 Don't initialize is_target_special_ or has_plt_offset_.
4355 Initialize is_defined_in_discarded_section_.
4356 (Symbol_table::add_from_relobj): If appropriate, set
4357 is_defined_in_discarded_section.
4358 * resolve.cc (Symbol::override_base_with_special): Don't test
4359 is_target_special_. Change has_plt_offset_ to has_plt_offset().
4360 * target-reloc.h (relocate_section): Do special handling for
4361 symbols defined in discarded sections for global symbols as well
4362 as local symbols.
4363
2703e3eb
ILT
43642010-01-08 Ian Lance Taylor <iant@google.com>
4365
4366 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
4367 the SHT_SYMTAB case.
4368
339d40a3
ILT
43692010-01-08 Ian Lance Taylor <iant@google.com>
4370
4371 * object.cc (Sized_relobj::do_layout): Don't get confused if
4372 layout_eh_frame returns NULL.
4373
abecea76
ILT
43742010-01-08 Ian Lance Taylor <iant@google.com>
4375
4376 PR 11084
4377 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
4378 dynamic symbol table, use the normal symbol table.
4379 (Sized_dynobj::do_read_symbols): Remove assertion about type of
4380 symbol table.
4381
6b7dd3f3
ILT
43822010-01-08 Ian Lance Taylor <iant@google.com>
4383
4384 PR 11072
4385 * layout.cc (Layout::include_section): Remove .gnu_debuglink
4386 sections.
4387
36c50e63
L
43882010-01-08 H.J. Lu <hongjiu.lu@intel.com>
4389
4390 * version.cc (print_version): Change to "Copyright 2010".
4391
e291e7b9
ILT
43922010-01-08 Ian Lance Taylor <iant@google.com>
4393
4394 PR 10287
4395 PR 11063
4396 * i386.cc (class Target_i386): Change return type of plt_section
4397 to be non-const.
4398 (class Output_data_plt_i386): Add tls_desc_rel_ field.
4399 (Output_data_plt_i386::Output_data_plt_i386): Initialize
4400 tls_desc_rel_ field.
4401 (Output_data_plt_i386::rel_tls_desc): New function.
4402 (Target_i386::rel_tls_desc_section): New function.
4403 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
4404 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
4405 R_386_TLS_DESC reloc in rel_tls_desc_section.
4406 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
4407 Define struct Tlsdesc_info.
4408 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
4409 (Target_x86_64::do_reloc_symbol_index): New function.
4410 (Target_x86_64::add_tlsdesc_info): New function.
4411 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
4412 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
4413 tlsdesc_rel_ field.
4414 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
4415 all callers.
4416 (Output_data_plt_x86_64::rela_tlsdesc): New function.
4417 (Target_x86_64::rela_tlsdesc_section): New function.
4418 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
4419 handling.
4420 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
4421 (Target_x86_64::do_reloc_addend): New function.
4422 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
4423 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
4424 declarations. Define TARGET_CODE. Add arg field to u1_ union.
4425 (Output_reloc::type): New function.
4426 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
4427 (Output_reloc::is_target_specific): New function.
4428 (Output_reloc::target_arg): New function.
4429 (class Output_reloc) [SHT_RELA]: Add four new constructors for
4430 absolute relocs and target specific relocs.
4431 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
4432 add_target_specific.
4433 (class Output_data_reloc) [SHT_RELA]: Likewise.
4434 * output.cc (Output_reloc::Output_reloc): Add four new versions
4435 for absolute relocs and target specific relocs.
4436 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
4437 (Output_reloc::get_symbol_index): Likewise.
4438 (Output_reloc::local_section_offset): Check that local_sym_index_
4439 is not TARGET_CODE or 0.
4440 (Output_reloc::symbol_value): Likewise.
4441 (Output_reloc::write) [SHT_RELA]: Call target for target specific
4442 reloc.
4443 * target.h (class Target): Add reloc_symbol_index and reloc_addend
4444 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
4445 functions.
4446 * layout.cc (add_target_dynamic_tags): Use output section for
4447 DT_PLTRELSZ and DT_JMPREL.
4448
3a44184e
ILT
44492010-01-07 Ian Lance Taylor <iant@google.com>
4450
4451 PR 11061
4452 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
4453 function.
4454 (class Output_data_reloc_generic): Define.
4455 (class Output_data_reloc_base): Change base class to
4456 Output_data_reloc_generic. Change add() method to call
4457 bump_relative_reloc_count for a relative reloc. Remove
4458 sort_relocs_ field.
4459 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
4460 to sort_relocs().
4461 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
4462 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
4463 appropriate.
4464 * layout.h (class Layout): Update declaration.
4465
ea715a34
ILT
44662010-01-07 Ian Lance Taylor <iant@google.com>
4467
4468 * output.h (class Output_data): Add const version of
4469 output_section and do_output_section.
4470 (class Output_section_data): Add const version of
4471 do_output_section.
4472 (class Output_section): Likewise.
4473 * layout.cc (Layout::add_target_dynamic_tags): New function.
4474 * layout.h (class Layout): Update declarations.
4475 * arm.cc (Target_arm::do_finalize_sections): Use
4476 add_target_dynamic_tags.
4477 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4478 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4479 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4480 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4481
659948a4
ILT
44822010-01-07 Ian Lance Taylor <iant@google.com>
4483
4484 PR 11042
4485 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
4486 object as needed.
4487
9d3b86f6
ILT
44882010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
4489 Ian Lance Taylor <iant@google.com>
4490
4491 PR 11019
4492 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
4493 Xindex::read_symtab_xindex.
4494
bb0d3eb0
DK
44952010-01-07 Doug Kwan <dougkwan@google.com>
4496
4497 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
4498 (Insn_template::thumb16_bcond_insn): New method declaration.
4499 (Insn_template): Fix spelling.
4500 (Stub::thumb16_special): New method declaration.
4501 (Stub::do_write): Define virtual method which was previously pure
4502 virtual.
4503 (Stub::do_thumb16_special): New method declaration.
4504 (Stub::do_fixed_endian_write): New template member.
4505 (Reloc_stub::do_write): Remove.
4506 (Reloc_stub::do_fixed_endian_write): Remove.
4507 (Cortex_a8_stub): New class definition.
4508 (Stub_factory::make_cortex_a8_stub): New method definition.
4509 (Stub_factory::Stub_factory): Add missing static storage class
4510 qualifier for elf32_arm_stub_a8_veneer_blx.
4511
ffeef7df
ILT
45122010-01-07 Ian Lance Taylor <iant@google.com>
4513
dc3f80fe
ILT
4514 PR 10980
4515 * options.h (class General_options): Add --warn-unresolved-symbols
4516 and --error-unresolved-symbols.
4517 * errors.cc (Errors::undefined_symbol): Implement
4518 --warn-unresolved-symbols.
4519
ffeef7df
ILT
4520 * options.h (class General_options): Add -z text and -z textoff.
4521 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
4522
f1ec9ded
ST
45232010-01-06 Sriraman Tallam <tmsriram@google.com>
4524
4525 * gc.h (Garbage_collection::Cident_section_map): New typedef.
4526 (Garbage_collection::cident_sections): New function.
4527 (Garbage_collection::add_cident_section): New function.
4528 (Garbage_collection::cident_sections_): New member.
4529 (gc_process_relocs): Add references to sections whose names are C
4530 identifiers.
4531 * gold.h (cident_section_start_prefix): New constant.
4532 (cident_section_stop_prefix): New constant.
4533 (is_cident): New function.
4534 * layout.cc (Layout::define_section_symbols): Replace string constants
4535 with the newly defined constants.
4536 * object.cc (Sized_relobj::do_layout): Track sections whose names are
4537 C identifiers.
4538 * testsuite/Makefile.am: Add gc_orphan_section_test.
4539 * testsuite/Makefile.in: Regenerate.
4540 * testsuite/gc_orphan_section_test.cc: New file.
4541 * testsuite/gc_orphan_section_test.sh: New file.
4542
6eda8c29
ILT
45432010-01-06 Ian Lance Taylor <iant@google.com>
4544
b9674e17
ILT
4545 PR 10980
4546 * options.h (class General_options): Add --warn-shared-textrel.
4547 * layout.cc (Layout::finish_dynamic_section): Implement
4548 --warn-shared-textrel.
4549
6eda8c29
ILT
4550 PR 10980
4551 * options.h (class General_options): Add --warn-multiple-gp.
4552
32dcd44e
ILT
45532010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4554
4555 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
4556 $(THREADSLIB) and $(LIBDL).
4557 * Makefile.in: Rebuild.
4558
a192ba05
ILT
45592010-01-06 Ian Lance Taylor <iant@google.com>
4560
4561 PR 10980
4562 * options.cc (General_options::parse_section_start): New function.
4563 (General_options::section_start): New function.
4564 (General_options::General_options): Initialize all members.
4565 * options.h: Include <map>
4566 (class General_options): Add --section-start. Add section_starts_
4567 member.
4568 * layout.cc (Layout::attach_allocated_section_to_segment): If
4569 --section-start was used, set the address of the segment. Remove
4570 local sort_sections.
4571 (Layout::relaxation_loop_body): If the address of the load segment
4572 has been set by --section-start, don't use it.
4573 * output.h (Output_segment::update_flags_for_output_section): New
4574 function.
4575 * output.cc (Output_segment::add_output_section): Call
4576 update_flags_for_output_section.
4577
dde3f402
ILT
45782010-01-05 Ian Lance Taylor <iant@google.com>
4579
62dfdd4d
ILT
4580 PR 10980
4581 * options.h (class General_options): Add --undefined-version.
4582 * script.cc (struct Version_expression): Add was_matched_by_symbol
4583 field.
4584 (Version_script_info::matched_symbol): New function.
4585 (Version_script_info::get_symbol_version_helper): Call
4586 matched_symbol.
4587 (Version_script_info::check_unmatched_names): New function.
4588 * script.h (class Version_script_info): Update declarations.
4589 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
4590
9c4ae156
ILT
4591 * options.h (class General_options): Use DEFINE_bool_alias for
4592 allow_multiple_definition.
4593 * resolve.cc (Symbol_table::should_override): Don't test
4594 allow_multiple_definition.
4595
dde3f402
ILT
4596 PR 10980
4597 * options.h (class General_options): Add --cref.
4598 * main.cc (main): Print cref table if --cref. Don't close mapfile
4599 until after printing cref table.
4600 * cref.cc: Include "symtab.h".
4601 (class Cref_inputs): Define Cref_table_compare and Cref_table.
4602 (Cref_table_compare::operator()): New function.
4603 (Cref_inputs::gather_cref): New function.
4604 (filecol): New static const.
4605 (Cref_inputs::print_cref): New function.
4606 (Cref::print_cref): New function.
4607 * cref.h: Include <cstdio>.
4608 (class Cref): Update declarations.
4609 * mapfile.h (Mapfile::file): New function.
4610 * object.h (class Object): Define Symbols. Declare virtual
4611 do_get_global_symbols.
4612 (Object::get_global_symbols): New function.
4613 * object.cc (Input_objects::add_object): Pass object to cref_ if
4614 --cref.
4615 (Input_objects::archive_start): Likewise.
4616 (Input_objects::archive_stop): Likewise.
4617 (Input_objects::print_cref): New function.
4618 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
4619 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
4620 --cref.
4621 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
4622 function.
4623 * plugin.h (class Sized_pluginobj): Update declarations.
4624
8781f709
ILT
46252010-01-05 Ian Lance Taylor <iant@google.com>
4626
4627 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
4628 to is_default_version. Rename insdef to insdefault.
4629 (Symbol_table::add_from_relobj): Rename def to is_default_version
4630 and local to is_forced_local.
4631 (Symbol_table::add_from_pluginobj): Likewise.
4632 (Symbol_table::add_from_dynobj): Likewise.
4633 (Symbol_table::define_special_symbol): Rename insdef to
4634 insdefault.
4635
fe35d28d
ILT
46362010-01-04 Ian Lance Taylor <iant@google.com>
4637
30bc8c46
ILT
4638 PR 10980
4639 * options.h (class General_options): Add
4640 --allow-multiple-definition and -z muldefs.
4641 * resolve.cc (Symbol_table::should_override): Don't warn about a
4642 multiple symbol definition if --allow-multiple-definition or -z
4643 muldefs.
4644
7eaea549
ILT
4645 PR 10980
4646 * options.h (class General_options): Add --add-needed and
4647 --copy-dt-needed-entries. Tweak --as-needed help entry.
4648 * object.cc (Input_objects::check_dynamic_dependencies): Give an
4649 error if --copy-dt-needed-entries aka --add-needed is used and
4650 would cause a change in behaviour.
4651
fe35d28d
ILT
4652 PR 10980
4653 * options.h (class General_options): Add -G as a short version of
4654 --shared. Add no-op options -assert, -g, and -i.
4655
55a2bb35
ST
46562010-01-04 Sriraman Tallam <tmsriram@google.com>
4657
4658 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
4659 check for .text or .gnu.linkonce.t sections.
4660 * icf.cc (Icf::find_identical_sections): Ditto.
4661 Change the detection for mangled function name within the section
4662 name.
4663 * icf.h (is_section_foldable_candidate): New function.
4664
719328e1
ILT
46652009-12-30 Ian Lance Taylor <iant@google.com>
4666
4667 PR 10980
4668 * options.h (class General_options): Permit two dashes with
4669 --retain-symbols-file.
4670
d7bb5745
ILT
46712009-12-30 Ian Lance Taylor <iant@google.com>
4672
403a15dd
ILT
4673 PR 10979
4674 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
4675 don't put the file header and segment headers in the text
4676 segment.
4677
eda294df
ILT
4678 PR 10979
4679 * common.cc (Sort_commons::operator()): Stabilize sort when both
4680 entries are NULL.
4681 (Symbol_table::do_allocate_commons_list): When allocating common
4682 symbols, skip a symbol which is no longer common.
4683 * symtab.h (Symbol::is_common): Test whether the symbol comes from
4684 an object before checking its type.
4685 * testsuite/common_test_2.c: New file.
4686 * testsuite/common_test_3.c: New file.
4687 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
4688 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
4689 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
4690 (common_test_2_pic.o, common_test_2.so): New targets.
4691 (common_test_3_pic.o, common_test_3.so): New targets.
4692 * testsuite/Makefile.in: Rebuild.
4693
d7bb5745
ILT
4694 PR 10979
4695 * script.cc (read_input_script): If we see a new SECTIONS clause,
4696 and we have added an input section, give an error.
4697 * layout.h (class Layout): Add have_added_input_section function.
4698 Add have_added_input_section_ field.
4699 * layout.cc (Layout::Layout): Initialize
4700 have_added_input_section_.
4701 (Layout::layout): Set have_added_input_section_.
4702 (Layout::layout_eh_frame): Likewise.
4703
fc59c572
ILT
47042009-12-30 Ian Lance Taylor <iant@google.com>
4705
4706 PR 10931
4707 * options.h (class General_options): Add --sort-common option.
4708 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
4709 * common.cc (Sort_common): Add sort_order parameter to
4710 constructor. Add sort_order_ field.
4711 (Sort_commons::operator): Check sort_order_.
4712 (Symbol_table::allocate_commons): Determine the sort order.
4713 (Symbol_table::do_allocate_commons): Add sort_order parameter.
4714 Change all callers.
4715 (Symbol_table::do_allocate_commons_list): Likewise.
4716
1c74fab0
ILT
47172009-12-30 Ian Lance Taylor <iant@google.com>
4718
4719 PR 10916
4720 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
4721 symbols from this object, don't change the visibility of an
4722 undefined symbol.
4723 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
4724
6affe781
ILT
47252009-12-30 Ian Lance Taylor <iant@google.com>
4726
4727 PR 10861
4728 * script.h (class Version_script_info): Define Language enum.
4729 Update declarations. Define Glob, Exact, and Lookup types. Add
4730 new fields globals_, locals_, and is_finalized_.
4731 * script.cc: Various formatting fixes.
4732 (class Parser_closure): Change language_stack_ from a vector of
4733 std::string to one of Version_script_info::Language. Adjust all
4734 uses accordingly.
4735 (class Lazy_demangler): Remove.
4736 (struct Version_expression): Change language from std::string to
4737 Version_script_info::Language.
4738 (Version_script_info::Version_script_info): New function.
4739 (Version_script_info::~Version_script_info): Don't call clear.
4740 (Version_script_info::finalize): New function.
4741 (Version_script_info::build_lookup_tables): New function.
4742 (Version_script_info::build_expression_list_lookup): New
4743 function.
4744 (Version_script_info::get_symbol_version_helper): Rewrite to use
4745 lookup tables.
4746 (Version_script_info::print_expression_list): Adjust to use
4747 Version_script_info::Language.
4748 (script_push_lex_into_version_mode): Check that the version script
4749 has not been finalized.
4750 (version_script_push_lang): Change language string to
4751 Version_script_info::Language.
4752 * options.cc (Command_line::version_script): New function.
4753 * options.h (class General_options): Add finalize_dynamic_list
4754 function. Change version_script from declaration to definition.
4755 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
4756 * testsuite/version_script.map: Remove duplicate def of foo.
4757 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
4758 version_script.map.
4759 * testsuite/Makefile.in: Rebuild.
4760
818bf354
ILT
47612009-12-30 Ian Lance Taylor <iant@google.com>
4762
4763 PR 10843
4764 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
4765 if the input symbol index is 0, make the output symbol index 0.
4766
ebcc8304
ILT
47672009-12-30 Ian Lance Taylor <iant@google.com>
4768
4769 PR 10670
4770 * options.h (class General_options): Add -x/--discard-all.
4771 * object.cc (Sized_relobj::do_count_local_symbols): Handle
4772 --discard-all. If the local symbol needs a dynamic entry, check
4773 that before handling --discard-locals.
4774
176fe33f
ILT
47752009-12-30 Ian Lance Taylor <iant@google.com>
4776
bb321bb1
ILT
4777 PR 10450
4778 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
4779 flags to PF_R.
4780 (Output_segment::add_output_section): Don't change the flags if
4781 the type is PT_TLS.
4782
176fe33f
ILT
4783 PR 10450
4784 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
4785 GNU hash table if they need a dynamic value. Otherwise, don't add
4786 them if they are defined in a dynamic object or are forced local.
4787
e8cd95c7
ILT
47882009-12-29 Ian Lance Taylor <iant@google.com>
4789
1b81fb71
ILT
4790 PR 10450
4791 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
4792 .gnu.hash table for a 32-bit target.
4793
8d6d383d
ILT
4794 PR 10450
4795 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
4796 regular and a dynamic object only needs a dynamic symbol table
4797 entry if it is externally visible.
4798
e785ec03
ILT
4799 PR 10450
4800 * i386.cc (class Target_i386): Initialize global_offset_table_ in
4801 constructor. Add global_offset_table_ field.
4802 (Target_i386::got_section): Set global_offset_table_.
4803 (Target_i386::do_finalize_sections): Set global_offset_table_
4804 size.
4805 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
4806 in constructor. Add global_offset_table_ field.
4807 (Target_x86_64::got_section): Set global_offset_table_.
4808 (Target_x86_64::do_finalize_sections): Set global_offset_table_
4809 size.
4810
1a2dff53
ILT
4811 * layout.cc (Layout::Layout): Initialize increase_relro_.
4812 (Layout::get_output_section): Add is_relro, is_last_relro, and
4813 is_first_non_relro parameters. Change all callers.
4814 (Layout::choose_output_section): Likewise.
4815 (Layout::add_output_section_data): Likewise.
4816 (Layout::make_output_section): Likewise.
4817 (Layout::set_segment_offsets): Clear increase_relro when using a
4818 linker script.
4819 * layout.h (class Layout): Add increase_relro method. Add
4820 increase_relro_ field. Update declarations.
4821 * output.cc (Output_section::Output_section): Initialize
4822 is_last_relro_ and is_first_non_relro_.
4823 (Output_segment::add_output_section): Group relro sections is
4824 do_sort is true. Handle is_last_relro and is_first_non_relro.
4825 (Output_segment::maximum_alignment): Remove relro handling.
4826 (Output_segment::set_section_addresses): Add increase_relro
4827 parameter. Change all callers. Add initial alignment to align
4828 relro sections on separate page. Remove old relro handling.
4829 (Output_segment::set_section_list_addresses): Remove in_relro
4830 parameter. Change all callers.
4831 (Output_segment::set_offset): Add increase parameter. Change all
4832 callers. Remove old relro handling.
4833 * output.h (class Output_section): Add new methods: is_last_relro,
4834 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
4835 Add is_last_relro_ and is_first_non_relro_ fields.
4836 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
4837 Create separate .got.plt section. Call increase_relro.
4838 * x86_64.cc (Target_x86_64::got_section): Likewise.
4839 * testsuite/relro_script_test.t: Add .got.plt.
4840
f0ba79e2
ILT
4841 PR 10450
4842 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
4843 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
4844 (Layout::finalize): Call set_dynamic_symbol_size.
4845 (Layout::set_dynamic_symbol_size): New function.
4846 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
4847 set_dynamic_symbol_size.
4848
e8cd95c7
ILT
4849 PR 10450
4850 * output.h (class Output_section): Add is_entsize_zero_ field.
4851 * output.cc (Output_section::Output_section): Initialize
4852 is_entsize_zero_.
4853 (Output_section::set_entsize): If two different entsizes are
4854 requested, force it to zero.
4855 (Output_section::add_input_section): Set flags for .debug_str
4856 before updating section flags. Set entsize.
4857 (Output_section::update_flags_for_input_section): Set SHF_MERGE
4858 and SHF_STRING if all input sections have those flags.
4859
3e1b9a8a
RÁE
48602009-12-29 Rafael Espindola <espindola@google.com>
4861
4862 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
4863 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
4864 reporting.
3e1b9a8a 4865
3dcad376
ST
48662009-12-29 Sriraman Tallam <tmsriram@google.com>
4867
4868 * options.cc (General_options::parse_version): Allow -v to exit
4869 without an error if there is nothing to link.
4870
084e2665
ILT
48712009-12-29 Ian Lance Taylor <iant@google.com>
4872
4873 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
4874 using a version of gcc before 4.1.
4875 * configure: Rebuild.
4876
250acde3
CD
48772009-12-28 Chris Demetriou <cgd@google.com>
4878
4879 * attributes.cc (Output_attributes_section_data::do_write): Use
4880 std::vector::front rather than std::vector::data.
4881
99fff23b
ILT
48822009-12-28 Ian Lance Taylor <iant@google.com>
4883
4884 * symtab.h (class Symbol_table): Add enum Defined.
4885 * resolve.cc (Symbol_table::should_override): Add defined
4886 parameter. Change all callers. Test whether object is NULL
4887 before calling a method on it.
4888 (Symbol_table::report_resolve_problem): Add defined parameter.
4889 Change all callers.
4890 (Symbol_table::should_override_with_special): Likewise.
4891 * symtab.cc (Symbol_table::define_in_output_data): Add defined
4892 parameter. Change all callers.
4893 (Symbol_table::do_define_in_output_data): Likewise.
4894 (Symbol_table::define_in_output_segment): Likewise.
4895 (Symbol_table::do_define_in_output_segment): Likewise.
4896 (Symbol_table::define_as_constant): Likewise.
4897 (Symbol_table::do_define_as_constant): Likewise.
4898 * script.h (class Symbol_assignment): Add is_defsym parameter to
4899 constructor; change all callers.
4900 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
4901 parameter. Change all callers. Add is_defsym_ field.
4902 (class Parser_closure): Add parsing_defsym parameter to
4903 constructor; change all callers. Add parsing_defsym accessor
4904 function. Add parsing_defsym_ field.
4905
556bd683
ILT
49062009-12-28 Ian Lance Taylor <iant@google.com>
4907
4908 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 4909 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 4910
1782c879
ILT
49112009-12-23 Ian Lance Taylor <iant@google.com>
4912
4913 * i386.cc (Target_i386::do_calls_non_split): Recognize
4914 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
4915 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
4916 -fsplit-stack prologue when using %r11.
1782c879 4917
329ca2b1
ST
49182009-12-21 Sriraman Tallam <tmsriram@google.com>
4919
4920 * options.cc (General_options::parse_version): Make -v continue and do
4921 the link like GNU ld does.
4922
d675ff46
RÁE
49232009-12-17 Rafael Avila de Espindola <espindola@google.com>
4924
4925 * Makefile.am (CCFILES): Add timer.cc.
4926 (HFILES): Add timer.h.
4927 * configure.ac: Check for sysconf and times.
4928 * main.cc: include timer.h.
4929 (main): Use Timer instead of get_run_time.
4930 * timer.cc: New.
4931 * timer.h: New.
4932 * workqueue.cc: include timer.h.
4933 (Workqueue::find_and_run_task):
4934 Report user, sys and wall time.
4935 * Makefile.in: Regenerate.
4936 * config.in: Regenerate.
4937 * configure: Regenerate.
4938
d6344fb5
DK
49392009-12-16 Doug Kwan <dougkwan@google.com>
4940
4941 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
4942 sections.
4943 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
4944 relaxed input sections.
4945 * output.cc (Output_section::find_relaxed_input_section): Change
4946 return type to Output_relaxed_input_section pointer. Adjust code
4947 for new type of relaxed_input_section_map_.
4948 * output.h (Output_section::find_relaxed_input_section): Change
4949 return type to Output_relaxed_input_section pointer.
4950 (Output_section::Output_relaxed_input_section_by_input_section_map):
4951 New type.
4952 (Output_section::relaxed_input_section_map_): Change type to
4953 Output_section::Output_relaxed_input_section_by_input_section_map.
4954 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
4955 input section.
4956
0e0d5469
ILT
49572009-12-15 Ian Lance Taylor <iant@google.com>
4958
4959 * layout.cc (Layout::create_shstrtab): Only write out after input
4960 sections if we are compressing debug sections.
4961
0649a889
ILT
49622009-12-15 Ian Lance Taylor <iant@google.com>
4963
4964 * archive.cc (Archive::add_symbols): Only look up a symbol without
4965 a version if there is, in fact, a version.
4966
2ea97941
ILT
49672009-12-14 Ian Lance Taylor <iant@google.com>
4968
4969 Revert -Wshadow changes, all changes from:
4970 2009-12-11 Doug Kwan <dougkwan@google.com>
4971 2009-12-11 Nick Clifton <nickc@redhat.com>
4972 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
4973
b0eec2cc
DK
49742009-12-11 Doug Kwan <dougkwan@google.com>
4975
4976 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
4977 due to -Wshadow.
4978 * attributes.cc (Object_attribute::size): Ditto.
4979 (Attributes_section_data::size): Ditto.
4980 (Attributes_section_data::Attributes_section_data): Ditto.
4981 (Output_attributes_section_data::do_write): Ditto.
4982 * attributes.h (Object_attribute::set_type): Ditto.
4983 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
4984
91d6fa6a
NC
49852009-12-11 Nick Clifton <nickc@redhat.com>
4986
4987 * archive.cc: Fix shadowed variable warnings.
4988 * arm.cc: Likewise.
4989 * compressed_output.cc: Likewise.
4990 * compressed_output.h: Likewise.
4991 * configure: Likewise.
4992 * dwarf_reader.cc: Likewise.
4993 * dynobj.cc: Likewise.
4994 * dynobj.h: Likewise.
4995 * ehframe.cc: Likewise.
4996 * ehframe.h: Likewise.
4997 * errors.cc: Likewise.
4998 * expression.cc: Likewise.
4999 * fileread.cc: Likewise.
5000 * fileread.h: Likewise.
5001 * freebsd.h: Likewise.
5002 * i386.cc: Likewise.
5003 * icf.cc: Likewise.
5004 * incremental.h: Likewise.
5005 * layout.cc: Likewise.
5006 * layout.h: Likewise.
5007 * mapfile.cc: Likewise.
5008 * merge.cc: Likewise.
5009 * merge.h: Likewise.
5010 * object.cc: Likewise.
5011 * object.h: Likewise.
5012 * options.h: Likewise.
5013 * output.cc: Likewise.
5014 * output.h: Likewise.
5015 * parameters.cc: Likewise.
5016 * plugin.cc: Likewise.
5017 * powerpc.cc: Likewise.
5018 * reduced_debug_output.cc: Likewise.
5019 * reduced_debug_output.h: Likewise.
5020 * reloc.cc: Likewise.
5021 * reloc.h: Likewise.
5022 * resolve.cc: Likewise.
5023 * script-sections.cc: Likewise.
5024 * script.cc: Likewise.
5025 * script.h: Likewise.
5026 * sparc.cc: Likewise.
5027 * symtab.cc: Likewise.
5028 * symtab.h: Likewise.
5029 * target-select.cc: Likewise.
5030 * target-select.h: Likewise.
5031 * token.h: Likewise.
5032 * workqueue.cc: Likewise.
5033 * workqueue.h: Likewise.
5034 * x86_64.cc: Likewise.
5035
a0351a69
DK
50362009-12-10 Doug Kwan <dougkwan@google.com>
5037
5038 * arm.cc (attributes.h): New include.
5039 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5040 (Arm_relobj::~Arm_relobj): Delete object pointed by
5041 attributes_section_data_.
5042 (Arm_relobj::attributes_section_data): New method definition.
5043 (Arm_relobj::attributes_section_data_): New data member declaration.
5044 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5045 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5046 attributes_section_data_.
5047 (Arm_dynobj::attributes_section_data): New method definition.
5048 (Arm_dynobj::attributes_section_data_): New data member declaration.
5049 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5050 initialization value of may_use_blx_ to false.
5051 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5052 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5053 object attributes to compute results instead of hard-coding.
5054 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5055 Target_arm::get_secondary_compatible_arch,
5056 Target_arm::set_secondary_compatible_arch
5057 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5058 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5059 New method declarations.
5060 (Target_arm::get_aeabi_object_attribute): New method definition.
5061 (Target_arm::attributes_section_data_): New data member declaration.
5062 (read_arm_attributes_section): New template definition.
5063 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5064 (Arm_dynobj::do_read_symbols): Ditto.
5065 (Target_arm::do_finalize_sections): Merge attributes sections from
5066 input. Check for BLX use after attributes section merging.
5067 Fix __exidx_start and __exidx_end visibility. Create an
5068 .ARM.attributes section if necessary.
5069 (Target_arm::get_secondary_compatible_arch,
5070 Target_arm::set_secondary_compatible_arch,
5071 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5072 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5073 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5074 New method definitions.
5075
b59befec
ILT
50762009-12-09 Ian Lance Taylor <iant@google.com>
5077
5078 * plugin.cc (Plugin::load): Don't cast from void* to a function
5079 pointer.
5080
1276bc89
ILT
50812009-12-09 Ian Lance Taylor <iant@google.com>
5082
5083 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5084 information fields.
5085
2f2de248
L
50862009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5087
5088 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5089 Replace two_file_shared_1.so with two_file_shared_2.so.
5090 * testsuite/Makefile.in: Regenerated.
5091
4f787271
DK
50922009-12-08 Doug Kwan <dougkwan@google.com>
5093
5094 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5095 (HFILES): Add attributes.h and int_encoding.h.
5096 * Makefile.in: Regenerate.
5097 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5098 function definitions to int_encoding.cc
5099 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5100 prototypes to int_encoding.h
5101 * reduced_debug_output.cc (int_encoding.h): New include.
5102 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5103 function definitions to int_encoding.cc
5104 (insert_into_vector, read_from_pointer): Move template definitions to
5105 int_encoding.h
5106 * attributes.cc: New file.
5107 * attributes.h: New file.
5108 * int_encoding.cc: New file.
5109 * int_encoding.h: New file.
5110
20b52f1a
RÁE
51112009-12-07 Rafael Avila de Espindola <espindola@google.com>
5112
5113 PR gold/11055
5114 * incremental-dump.cc (dump_incremental_inputs): New.
5115 (main): Use dump_incremental_inputs.
5116
53d7974c
L
51172009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5118
5119 PR gold/10893
5120 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5121 checking elfcpp::STT_FUNC.
5122 (Target_i386::Relocate::relocate): Likewise.
5123 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5124
5125 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5126 symbols from shared libraries into normal FUNC symbols.
5127
5128 * symtab.h (Symbol): Add is_func and use it.
5129
05a352e6
DK
51302009-12-05 Doug Kwan <dougkwan@google.com>
5131
5132 * arm.cc (Target_arm::arm_info): Initialize new fields
5133 attributes_section and attributes_vendor.
5134 * i386.cc (Target_i386::i386_info): Same.
5135 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5136 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5137 fields attributes_section and attributes_vendor.
53d7974c 5138 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5139 * target.h (Target::attributes_section, Target::attributes_vendor,
5140 Target::is_attributes_section, Target::attribute_arg_type,
5141 Target::attributes_order): New method definitions.
5142 (Target::Target_info::attributes_section,
5143 Target::Target_info::attributes_vendor): New fields.
5144 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5145 virtual method definitions.
5146 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5147 attributes_section and attributes_vendor.
5148 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5149
f4e5969c
DK
51502009-12-05 Doug Kwan <dougkwan@google.com>
5151
5152 * arm.cc: Update comments about interworking and stub generation.
5153 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5154 considered as non-PIC.
5155 (Arm_relocate_functions::base_abs): Fix formatting.
5156 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5157 of function to use GOT entry address instead of offset.
5158 (Target_arm::Scan::global): Issue an error if a symbol would need a
5159 PLT does not get one because it is untyped. Remove code to create
5160 dynamic symbols for relative branches.
5161 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5162 takes unsigned integer instead of boolean.
5163
1abce4a6
L
51642009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5165
5166 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5167 (two_file_test_LDADD): Likewise.
5168 (common_test_1_LDADD): Likewise.
5169 (exception_test_LDADD) Likewise.
5170 (weak_test_LDADD): Likewise.
5171 (many_sections_test_LDADD): Likewise.
5172 (initpri1_LDADD): Likewise.
5173 (script_test_1_LDADD): Likewise.
5174 (script_test_2_LDADD): Likewise.
5175 (justsyms_LDADD): Likewise.
5176 (binary_test_LDADD): Likewise.
5177 (large_LDADD): Likewise.
5178 * testsuite/Makefile.in: Regenerated.
5179
adcf2816 51802009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5181
adcf2816
L
5182 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5183 (Symbol_table::override_with_special): Likewise.
5184 (Symbol_table::add_from_object): Likewise.
5185
28e67f5d
RÁE
51862009-12-04 Rafael Avila de Espindola <espindola@google.com>
5187
5188 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5189 Don't set the data_offset twice.
5190
ae10a101
RÁE
51912009-12-04 Rafael Avila de Espindola <espindola@google.com>
5192
5193 * testsuite/Makefile.in: Regenerate.
5194
f59f41f3
DK
51952009-12-03 Doug Kwan <dougkwan@google.com>
5196
5197 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5198 (Target_arm::do_finalize_sections): Add parameter for symbol table
5199 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5200 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5201 parameter for symbol table pointer.
5202 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5203 an additional parameter for a pointer to symbol table.
5204 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5205 parameter for a symbol table pointer.
5206 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5207 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5208 Ditto.
5209 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5210 parameter for a symbol table pointer.
5211
ca55d848
RÁE
52122009-12-03 Rafael Avila de Espindola <espindola@google.com>
5213
5214 * incremental.cc (Incremental_inputs_header)
5215 (Incremental_inputs_header_write, Incremental_inputs_entry)
5216 (Incremental_inputs_entry_write): Move ...
5217 * incremental.h (Incremental_inputs_header)
5218 (Incremental_inputs_header_write, Incremental_inputs_entry)
5219 (Incremental_inputs_entry_write): here.
5220
3aec4f9c
RÁE
52212009-12-02 Rafael Avila de Espindola <espindola@google.com>
5222
5223 * incremental.cc (make_sized_incremental_binary): Set the target.
5224 Error if it is incompatible.
5225 * output.h (Output_file): Add filename method.
5226
9c0ae74d
RÁE
52272009-12-02 Rafael Avila de Espindola <espindola@google.com>
5228
5229 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5230 from the get_* methods.
5231
a45500ae
RÁE
52322009-12-02 Rafael Avila de Espindola <espindola@google.com>
5233
5234 * incremental-dump.cc (main): Check that the offeset of a script is 0.
5235 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5236 Write 0 for the data_offset of scripts.
5237
325e6408
RÁE
52382009-12-02 Rafael Avila de Espindola <espindola@google.com>
5239
5240 * testsuite/Makefile.am: Add the incremental_test.sh test.
5241 * testsuite/incremental_test.sh: New.
5242 * testsuite/incremental_test_1.c: New.
5243 * testsuite/incremental_test_2.c: New.
5244
954c3e2e
RÁE
52452009-12-01 Rafael Avila de Espindola <espindola@google.com>
5246
5247 * incremental-dump.cc (main): Fix typos.
5248
f8086623
RÁE
52492009-11-27 Rafael Avila de Espindola <espindola@google.com>
5250
5251 PR gold/11025
5252 * incremental-dump.cc (main): Use llu to print 64 bit values.
5253
3b0dd6ac
L
52542009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
5255 H.J. Lu <hongjiu.lu@intel.com>
5256
5257 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
5258 $(LIBDL).
5259 (incremental_dump_LDADD): Likewise.
5260 * Makefile.in: Regenerated.
5261
a6d1ef57 52622009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 5263
a6d1ef57
DK
5264 Revert:
5265
5266 2009-11-25 Doug Kwan <dougkwan@google.com>
5267
5268 * arm.cc (Target_arm::Target_arm): Move method definition
5269 outside of class definition. Add code to handle
5270 --target1-rel, --target1-abs and --target2= options.
5271 (Target_arm::get_reloc_reloc_type): Change method to be
5272 non-static and const.
5273 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
5274 New data member declaration.
5275 (Target_arm::Scan::local, Target_arm::Scan::global,
5276 Target_arm::Relocate::relocate,
5277 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5278 Adjust call to Target_arm::get_real_reloc_type.
5279 (Target_arm::get_real_reloc_type): Use command line options
5280 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5281 * options.h (--target1-rel, --target1-abs, --target2): New
5282 ARM-only options.
5283
50aeb7d4
DK
52842009-11-25 Doug Kwan <dougkwan@google.com>
5285
5286 * arm.cc (Target_arm::Target_arm): Move method definition outside of
5287 class definition. Add code to handle --target1-rel, --target1-abs
5288 and --target2= options.
5289 (Target_arm::get_reloc_reloc_type): Change method to be non-static
5290 and const.
5291 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
5292 member declaration.
5293 (Target_arm::Scan::local, Target_arm::Scan::global,
5294 Target_arm::Relocate::relocate,
5295 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
5296 call to Target_arm::get_real_reloc_type.
5297 (Target_arm::get_real_reloc_type): Use command line options to
5298 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5299 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
5300 options.
5301
51938283
DK
53022009-11-25 Doug Kwan <dougkwan@google.com>
5303
5304 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
5305 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
5306 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
5307 formatting.
5308 (Arm_relocate_functions::thm_call): Replace body with a call to
5309 Arm_relocate_functions::thumb_branch_common.
5310 (Arm_relocate_functions::thm_jump24,
5311 Arm_relocate_functions::thm_xpc22): New method definitions.
5312 (Arm_relocate_functions::thumb_branch_common): New method definition.
5313 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
5314 operator.
5315 (Target_arm::Relocate::relocate): Adjust call to thm_call.
5316 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
5317
e2b8f3c4
RÁE
53182009-11-24 Rafael Avila de Espindola <espindola@google.com>
5319
5320 * Makefile.am: Build incremental-dump
5321 * Makefile.in: Regenerate.
5322 * incremental-dump.cc: New.
5323 * incremental.cc (Incremental_inputs_header_data,
5324 Incremental_inputs_entry_data): Move to incremental.h
5325 * incremental.h: (Incremental_inputs_header_data,
5326 Incremental_inputs_entry_data): Move from incremental.cc
5327
bcba9aec
RÁE
53282009-11-24 Rafael Avila de Espindola <espindola@google.com>
5329
5330 * incremental.cc (Incremental_inputs_header,
5331 Incremental_inputs_header_write, Incremental_inputs_entry,
5332 Incremental_inputs_entry_write): Add a typedef with the data type.
5333
7c3afe08
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): Update comment about which
5339 type has the filed descriptions.
5340
d204b6e9
DK
53412009-11-15 Doug Kwan <dougkwan@google.com>
5342
5343 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
5344 (Arm_relocate_functions::arm_branch_common): Change method defintion
5345 in class definition to a method declaration and update list of formal
5346 parameters.
5347 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
5348 Arm_relocation_functions::jump24): Adjust call to
5349 Arm_relocate_functions::arm_branch_common. Update list of formal
5350 parameters.
5351 (Arm_relocate_functions::xpc25): New method definition.
5352 (Arm_relocate_functions::arm_branch_common): Move method defintion
5353 out from class definition. Use stubs for mode-switching and extending
5354 branch ranges.
5355 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
5356 specially. Change code to enable use of stubs in ARM branches.
5357
43d12afe
DK
53582009-11-10 Doug Kwan <dougkwan@google.com>
5359
5360 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
5361 in method declaration.
5362 (Target_arm::relocate_stub): New method declaration.
5363 (Target_arm::default_target): Change to return a pointer instead of
5364 a const reference.
5365 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
5366 Target_arm::default_target.
5367 (Arm_Relobj::do_relocate_sections): Remove options paramater in
5368 method definition.
5369 (Target_arm::relocate_section): Adjust view.
5370 (Target_arm::relocate_stub): New method definition.
5371
ac33a407
DK
53722009-11-10 Doug Kwan <dougkwan@google.com>
5373
5374 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
5375 a format warning.
5376 * incremental.cc (open_incremental_binary): Initialized local
5377 variables to avoid warnings.
5378 * object.cc (make_elf_object): Ditto.
5379 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
5380 a format warning.
e1df38aa 5381
88ee28e9
L
5382009-11-09 H.J. Lu <hongjiu.lu@intel.com>
5383
5384 PR gold/10930
5385 * testsuite/plugin_test.c: Include "config.h".
5386
2daedcd6
DK
53872009-11-09 Doug Kwan <dougkwan@google.com>
5388
5389 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
5390 (arm_symbol_value): Remove.
5391 (Arm_relocate_functions::arm_branch_common,
5392 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
5393 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
5394 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
5395 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
5396 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
5397 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
5398 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
5399 Arm_relocate_functions::thm_mobw_abs_nc,
5400 Arm_relocate_functions::thm_mov_abs,
5401 Arm_relocate_functions::movw_prel_nc,
5402 Arm_relocate_functions::thm_movt_abs,
5403 Arm_relocate_functions::movt_prel,
5404 Arm_relocate_functions::thm_movw_prel_nc,
5405 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
5406 (Target_arm::Relocate::relocate): Only decompose address into two
5407 parts if relocation type uses the thumb-bit and pass the actual
5408 bit instead of a flag indicating that the thumb-bit is used. Adjust
5409 calls to methods in Arm_relocate_functions for this change.
5410
1276bc89 54112009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
5412
5413 PR 10925
5414 * reloc.cc: Instantiate
5415 Sized_relobj::initialize_input_to_output_maps and
5416 Sized_relobj:free_input_to_output_maps.
5417
e53ad1b5
ILT
54182009-11-06 Ian Lance Taylor <iant@google.com>
5419
5420 PR 10876
5421 * defstd.cc (in_segment): Set only_if_ref true for "end".
5422
eb44217c
DK
54232009-11-06 Doug Kwan <dougkwan@google.com>
5424
5425 * arm.cc (class Reloc_stub): Correct a comment.
5426 (Target_arm::Target_arm): Initialize arm_input_section_map_.
5427 (Target_arm::scan_section_for_stubs): New method declaration.
5428 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
5429 Change methods from private to protected.
5430 (Target_arm::do_may_relax): New method definition.
5431 (Target_arm::do_relax, Target_arm::group_sections,
5432 Target_arm::scan_reloc_for_stub,
5433 Target_arm::scan_reloc_section_for_stubs): New method declarations.
5434 (Target_arm::arm_input_section_map_): New data member declaration.
5435 (Target_arm::scan_reloc_for_stub,
5436 Target_arm::scan_reloc_section_for_stubs,
5437 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
5438 Target_arm::do_relax): New method definitions.
5439
5d329b7d
ILT
54402009-11-06 Mikolaj Zalewski <mikolaj@google.com>
5441
5442 * configure.ac: Check for (struct stat)::st_mtim
5443 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
5444 * config.in: Regenerate.
5445 * configure: Regenerate.
5446
96a0d71b
ILT
54472009-11-05 Ian Lance Taylor <iant@google.com>
5448
5449 PR 10910
5450 * output.cc (Output_segment::add_output_section): Add missing
5451 return statement.
5452
594c8e5e
ILT
54532009-11-04 Ian Lance Taylor <iant@google.com>
5454
5455 PR 10880
5456 * object.h (class Object): Add is_needed and set_is_needed
5457 methods. Add is_needed_ field. Make bool fields into bitfields.
5458 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
5459 defined in a dynamic object and referenced by a regular object,
5460 set is_needed for the dynamic object.
5461 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
5462 if the file is marked with as_needed and it is not needed.
5463
22b127cc
ILT
54642009-11-04 Ian Lance Taylor <iant@google.com>
5465
5466 PR 10887
5467 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
5468 tags if data is discarded by linker script.
5469 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5470 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5471 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5472 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5473
f5c870d2
ILT
54742009-11-04 Ian Lance Taylor <iant@google.com>
5475
5476 * layout.cc (Layout::get_output_section): Add is_interp and
5477 is_dynamic_linker_section parameters. Change all callers.
5478 (Layout::choose_output_section): Likewise.
5479 (Layout::make_output_section): Likewise.
5480 (Layout::add_output_section_data): Add is_dynamic_linker_section
5481 parameter. Change all callers.
5482 * layout.h (class Layout): Update declarations.
5483 * output.h (class Output_section): Add is_interp, set_is_interp,
5484 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
5485 Add is_interp_, is_dynamic_linker_section_ fields. Change
5486 generate_code_fills_at_write_ to a bitfield.
5487 * output.cc (Output_section::Output_sections): Initialize new
5488 fields.
5489 (Output_segment::add_output_section): Add do_sort parameter.
5490 Change all callers.
5491
1ae4d23b
ILT
54922009-11-03 Ian Lance Taylor <iant@google.com>
5493
5494 PR 10860
5495 * options.h (class General_options): Add --warn-common.
5496 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
5497 merging two common symbols.
5498 (Symbol_table::should_override): Handle --warn-common when merging
5499 a common symbol with a defined symbol. Use report_resolve_problem
5500 for multiple definitions.
5501 (Symbol_table::report_resolve_problem): New function.
5502 * symtab.h (class Symbol_table): Declare report_resolve_problem.
5503
55da9579
DK
55042009-11-03 Doug Kwan <dougkwan@google.com>
5505
5506 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
5507 stub_factory_.
5508 (Target_arm::stub_factory): New method definition.
5509 (Target_arm::new_arm_input_section,
5510 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
5511 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 5512 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
5513 New type definitions.
5514 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
5515 member declarations.
5516 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
5517 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
5518 New method definitions.
5519
37a9ac43
ILT
55202009-11-03 Ian Lance Taylor <iant@google.com>
5521
5522 * options.h (class General_options): Add --warn_constructors.
5523
b3d6a3d4
ILT
55242009-11-03 Ian Lance Taylor <iant@google.com>
5525
5526 PR 10893
5527 * defstd.cc (in_section): Add entries for __rel_iplt_start,
5528 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
5529
934b01dd
ILT
55302009-11-03 Ian Lance Taylor <iant@google.com>
5531
5532 PR 10895
5533 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
5534 --msgid-bugs-address.
5535 (install-pdf): New target.
5536 (install-data_yes): Look up one directory to find mkinstalldirs.
5537
03c1939b
L
55382009-11-03 H.J. Lu <hongjiu.lu@intel.com>
5539
5540 * po/Make-in (.po.gmo): Don't generate .gmo files in source
5541 tree.
5542
ebd95253
DK
55432009-10-30 Doug Kwan <dougkwan@google.com>
5544
5545 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
5546
e9bbb538
DK
55472009-10-30 Doug Kwan <dougkwan@google.com>
5548
5549 * arm.cc (Stub_addend_reader): New struct template definition
5550 and partial specializations.
5551 (Stub_addend_reader::operator()): New method definition for a
5552 partially specialized template.
5553
d5b40221
DK
55542009-10-30 Doug Kwan <dougkwan@google.com>
5555
5556 * arm.cc (Arm_relobj::processor_specific_flags): New method
5557 definition.
5558 (Arm_relobj::do_read_symbols): New method declaration.
5559 (Arm_relobj::processor_specific_flags_): New data member declaration.
5560 (Arm_dynobj): New class definition.
5561 (Target_arm::do_finalize_sections): Add input_objects parameter.
5562 (Target_arm::do_adjust_elf_header): New method declaration.
5563 (Target_arm::are_eabi_versions_compatible,
5564 (Target_arm::merge_processor_specific_flags): New method declaration.
5565 (Target_arm::do_make_elf_object): New overloaded method definitions
5566 and declaration.
5567 (Arm_relobj::do_read_symbols): New method definition.
5568 (Arm_dynobj::do_read_symbols): Ditto.
5569 (Target_arm::do_finalize_sections): Add input_objects parameters.
5570 Merge processor-specific flags from all input objects.
5571 (Target_arm::are_eabi_versions_compatible,
5572 Target_arm::merge_processor_specific_flags,
5573 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
5574 New method definitions.
5575 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
5576 Input_objects pointer type parameter.
5577 * layout.cc (Layout::finalize): Pass input objects to target's.
5578 finalize_sections function.
5579 * output.cc (Output_file_header::do_sized_write): Set ELF file
5580 header's processor-specific flags.
5581 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
5582 Input_objects pointer type parameter.
5583 * sparc.cc (Target_sparc::do_finalize_sections): Same.
5584 * target.h (Input_objects): New forward class declaration.
5585 (Target::processor_specific_flags,
5586 Target::are_processor_specific_flags_sect): New method definitions.
5587 (Target::finalize_sections): Add input_objects parameter.
5588 (Target::Target): Initialize processor_specific_flags_ and
5589 are_processor_specific_flags_set_.
5590 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
5591 parameter.
5592 (Target::set_processor_specific_flags): New method definition.
5593 (Target::processor_specific_flags_,
5594 Target::are_processor_specific_flags_set_): New data member
5595 declarations.
5596 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
5597 Input_objects pointer type parameter.
5598
ebabffbd
DK
55992009-10-30 Doug Kwan <dougkwan@google.com>
5600
5601 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
5602
ad0f2072
ILT
56032009-10-28 Ian Lance Taylor <iant@google.com>
5604
5605 * object.h (class Relobj): Drop options parameter from
5606 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
5607 do_scan_relocs, do_relocate. Change all callers.
5608 (class Sized_relobj): Drop options parameters from
5609 do_gc_process_relocs, do_scan_relocs, do_relocate,
5610 do_relocate_sections, relocate_sections, emit_relocs_scan,
5611 emit_relocs_scan_reltype. Change all callers.
5612 (struct Relocate_info): Remove options field and all references to
5613 it.
5614 * reloc.h (class Read_relocs): Remove options constructor
5615 parameter and options_ field. Change all callers.
5616 (class Gc_process_relocs, class Scan_relocs): Likewise.
5617 (class Relocate_task): Likewise.
5618 * target-reloc.h (scan_relocs): Remove options parameter. Change
5619 all callers.
5620 (scan_relocatable_relocs): Likewise.
5621 * target.h (class Sized_target): Remove options parameter from
5622 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
5623 all callers.
5624 * gc.h (gc_process_relocs): Remove options parameter. Change all
5625 callers.
5626 * arm.cc: Update functions to remove options parameters.
5627 * i386.cc: Likewise.
5628 * powerpc.cc: Likewise.
5629 * sparc.cc: Likewise.
5630 * x86_64.cc: Likewise.
5631 * testsuite/testfile.cc: Likewise.
5632
8ffa3667
DK
56332009-10-28 Doug Kwan <dougkwan@google.com>
5634
5635 * arm.cc (Arm_relobj): New class definition.
e1df38aa 5636 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
5637 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
5638 New method definitions.
5639
40f36857
CC
56402009-10-28 Cary Coutant <ccoutant@google.com>
5641
5642 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
5643 (Plugin::cleanup_done_): New member.
5644 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
5645 (Plugin_manager::cleanup_done_): Remove.
5646 (Plugin_manager::add_input_file): Edit error message.
5647 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
5648 (Plugin_manager::cleanup): Remove use of cleanup_done_.
5649
2c849493
ILT
56502009-10-27 Mikolaj Zalewski <mikolajz@google.com>
5651
5652 * fileread.cc: (File_read::View::~View): Use the new
5653 data_ownership_ filed.
5654 (File_read::~File_read): Dispose the new whole_file_view_.
5655 (File_read::open): Mmap the whole file if needed.
5656 (File_read::open): Use whole_file_view_ instead of contents_.
5657 (File_read::find_view): Use whole_file_view_ if applicable.
5658 (File_read::do_read): Use whole_file_view_ instead of contents_.
5659 (File_read::make_view): Use whole_file_view_ instead of contents_,
5660 update File_read::View::View call.
5661 (File_read::find_or_make_view): Update File_read::View::View
5662 call.
5663 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
5664 remove contents_
5665 (File_read::View::Data_ownership): New enum.
5666 (File_read::View::View): Replace bool mapped_ with Data_ownership
5667 argument.
5668 (File_read::View::mapped_): Remove (replaced by data_ownership_).
5669 (File_read::View::data_ownership_): New field.
5670 (File_read::contents_): Remove (replaced by whole_file_view_).
5671 (File_read::whole_file_view_): New field.
5672 * options.h (class General_options): Add --keep-files-mapped.
5673
24998053
CC
56742009-10-27 Cary Coutant <ccoutant@google.com>
5675
5676 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
5677 * testsuite/Makefile.am (plugin_test_5): New test case.
5678 * testsuite/Makefile.in: Regenerate.
5679
72adc4fa
DK
56802009-10-25 Doug Kwan <dougkwan@google.com>
5681
5682 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
5683 from private to protected to allow access by child class.
5684 (Sized_relobj::do_relocate_sections): New method declaration.
5685 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 5686 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
5687 Sized_relobj::relocate_sections. Instantiate template explicitly
5688 for different target sizes and endianity.
5689
07f508a2
DK
56902009-10-24 Doug Kwan <dougkwan@google.com>
5691
5692 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
5693 (Arm_input_section::as_arm_input_section): New method.
5694 (Arm_output_section): New class definition.
5695 (Arm_output_section::create_stub_group,
5696 Arm_output_section::group_sections): New method definitions.
5697
10ad9fe5
DK
56982009-10-22 Doug Kwan <dougkwan@google.com>
5699
5700 * arm.cc (Arm_input_section): New class definition.
5701 (Arm_input_section::init, Arm_input_section:do_write,
5702 Arm_input_section::set_final_data_size,
5703 Arm_input_section::do_reset_address_and_file_offset): New method
5704 definitions.
5705
56ee5e00
DK
57062009-10-21 Doug Kwan <dougkwan@google.com>
5707
5708 * arm.cc (Stub_table, Arm_input_section): New forward class
5709 declarations.
5710 (Stub_table): New class defintion.
5711 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
5712 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
5713 New method definition.
5714
b569affa
DK
57152009-10-21 Doug Kwan <dougkwan@google.com>
5716
5717 * arm.cc: Update copyright comments.
5718 (Target_arm): New forward class template declaration.
5719 (Arm_address): New type.
5720 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
5721 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
5722 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
5723 constants.
5724 (Insn_template): Same.
5725 (DEF_STUBS): New macro.
5726 (Stub_type): New enum type.
5727 (Stub_template): New class definition.
5728 (Stub): Same.
5729 (Reloc_stub): Same.
5730 (Stub_factory): Same.
5731 (Target_arm::Target_arm): Initialize may_use_blx_ and
5732 should_force_pic_veneer_.
5733 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
5734 Target_arm::should_force_pic_veneer,
5735 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
5736 Target_arm::using_thumb_only, Target_arm:;default_target): New
5737 method defintions.
5738 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
5739 New data member declarations.
5740 (Insn_template::size, Insn_template::alignment): New method defintions.
5741 (Stub_template::Stub_template): New method definition.
5742 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
5743 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
5744 (Stub_factory::Stub_factory): New method definition.
5745 * gold.h (string_hash): New template.
5746 * output.h (Input_section_specifier::hash_value): Use
5747 gold::string_hash.
5748 (Input_section_specifier::string_hash): Remove.
5749 * stringpool.cc (Stringpool_template::string_hash): Use
5750 gold::string_hash.
5751
6c172549
DK
57522009-10-20 Doug Kwan <dougkwan@google.com>
5753
5754 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
5755 symbols of relaxed input sections.
5756 * output.h (Output_section::find_relaxed_input_section): Make
5757 method public.
5758
c5617f2f
DK
57592009-10-16 Doug Kwan <dougkwan@google.com>
5760
5761 * dynobj.cc (Versions::Versions): Initialize version_script_.
5762 Only insert base version symbol definition for a shared object
5763 if version script defines any version versions.
5764 (Versions::define_base_version): New method definition.
5765 (Versions::add_def): Check that base version is not needed.
5766 (Versions::add_need): Define base version lazily.
5767 * dynobj.h (Versions::define_base_version): New method declaration.
5768 (Versions::needs_base_version_): New data member declaration.
5769 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
5770 (check_DATA): Add no_version_test.stdout.
5771 (libno_version_test.so, no_version_test.o no_version_test.stdout):
5772 New make rules.
5773 * testsuite/Makefile.in: Regenerate.
5774 * testsuite/no_version_test.c: New file.
5775 * testsuite/no_version_test.sh: Ditto.
5776
3c12dcdb
DK
57772009-10-16 Doug Kwan <dougkwan@google.com>
5778
5779 * expression.cc (class Segment_start_expression): New class definition.
5780 (Segment_start_expression::value): New method definition.
5781 (script_exp_function_segment_start): Return a new
5782 Segment_start_expression.
5783 * gold/script-c.h (script_saw_segment_start_expression): New function
5784 prototype.
5785 * script-sections.cc (Script_sections::Script_sections): Initialize
5786 SAW_SEGMENT_START_EXPRESSION_ to false.
5787 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
5788 and -Tbbs options to specify section addresses if given in
5789 command line and no SEGMENT_START expression is seen in a script.
5790 * script-sections.h (Script_sections::saw_segment_start_expression,
5791 Script_sections::set_saw_segment_start_expression): New method
5792 definition.
5793 (Script_sections::saw_segment_start_expression_): New data member
5794 declaration.
5795 * script.cc (script_saw_segment_start_expression): New function.
5796 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
5797 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
5798 script_test_7.sh and script_test_8.sh.
5799 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
5800 script_test_8.stdout.
5801 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
5802 (script_test_6, script_test_6.stdout, script_test_7,
5803 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
5804 * Makefile.in: Regenerate.
5805 * testsuite/script_test_6.sh: New file.
5806 * testsuite/script_test_6.t: Same.
5807 * testsuite/script_test_7.sh: Same.
5808 * testsuite/script_test_7.t: Same.
5809 * testsuite/script_test_8.sh: Same.
5810
64b1ae37
DK
58112009-10-16 Doug Kwan <dougkwan@google.com>
5812
5813 * output.cc (Output_segment::set_section_list_address): Cast
5814 expressions to unsigned long long type to avoid format warnings.
5815
661be1e2
ILT
58162009-10-15 Ian Lance Taylor <iant@google.com>
5817
12edd763 5818 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 5819 dot assignment to script_sections_.
12edd763
ILT
5820 * script-sections.cc (Script_sections::add_dot_assignment):
5821 Initialize if necessary.
5822
68b6574b
ILT
5823 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
5824 program headers with no load segment if there is a linker script.
5825
661be1e2
ILT
5826 * layout.cc (Layout::set_segment_offsets): Align the file offset
5827 to the segment aligment for -N or -n with no load segment.
5828 * output.cc (Output_segment::add_output_section): Don't crash if
5829 the first section is a TLS section.
5830 (Output_segment::set_section_list_addresses): Print an error
5831 message if the address moves backward in a linker script.
5832 * script-sections.cc
5833 (Output_section_element_input::set_section_addresses): Don't
5834 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
5835 (Orphan_output_section::set_section_addresses): Likewise.
5836
f15f61a7
DK
58372009-10-15 Doug Kwan <dougkwan@google.com>
5838
5839 * layout.cc (Layout::finish_dynamic_section): Generate tags
5840 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
5841 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
5842 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
5843
82bb573a
ILT
58442009-10-14 Ian Lance Taylor <iant@google.com>
5845
5846 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
5847 fields.
5848 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
5849 data_shdr fields of relinfo.
5850 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
5851 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
5852 R_386_TLS_LDO_32, adjust based on section flags.
5853 (Target_i386::Relocate::fix_up_ldo): Remove.
5854
374ad285
ILT
58552009-10-13 Ian Lance Taylor <iant@google.com>
5856
5857 Add support for -pie.
5858 * options.h (class General_options): Add -pie and
5859 --pic-executable.
5860 (General_options::output_is_position_independent): Test -pie.
5861 (General_options::output_is_executable): Return true if not shared
5862 and not relocatable.
5863 (General_options::output_is_pie): Remove.
5864 * options.cc (General_options::finalize): Reject incompatible uses
5865 of -pie.
5866 * gold.cc (queue_middle_tasks): A -pie link is not static.
5867 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
5868 * symtab.cc (Symbol::final_value_is_known): Return false if
5869 output_is_position_independent.
5870 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
5871 output_is_position_independent.
5872 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
5873 output_is_position_independent.
5874 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
5875 output_is_position_independent.
5876 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
5877 two_file_pie_test.
5878 (basic_pie_test.o, basic_pie_test): New targets.
5879 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
5880 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
5881 (two_file_pie_test): New target.
5882 * testsuite/Makefile.in: Rebuild.
5883 * README: Remove note saying that -pie is not supported.
5884
c6585162
ILT
58852009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
5886
5887 * options.h (class General_options): Add -init and -fini.
5888 * layout.cc (Layout::finish_dynamic_section): Emit
5889 given init and fini functions.
5890
032ce4e9
ST
58912009-10-13 Sriraman Tallam <tmsriram@google.com>
5892
5893 * gc.h (gc_process_relocs): Check if icf is enabled using new
5894 function.
5895 * gold.cc (queue_initial_tasks): Likewise.
5896 (queue_middle_tasks): Likewise.
5897 * object.cc (do_layout): Likewise.
5898 * symtab.cc (is_section_folded): Likewise.
5899 * main.cc (main): Likewise.
5900 * reloc.cc (Read_relocs::run): Likewise.
5901 (Sized_relobj::do_scan_relocs): Likewise.
5902 * icf.cc (is_function_ctor_or_dtor): New function.
5903 (Icf::find_identical_sections): Check if function is ctor or dtor when
5904 safe icf is chosen.
5905 * options.h (General_options::icf): Change option to be an enum.
5906 (Icf_status): New enum.
5907 (icf_enabled): New method.
5908 (icf_safe_folding): New method.
5909 (set_icf_status): New method.
5910 (icf_status_): New variable.
5911 * (options.cc) (General_options::finalize): Set icf_status_.
5912 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
5913 icf_test and icf_keep_unique_test to use the --icf enum flag.
5914 * testsuite/icf_safe_test.sh: New file.
e1df38aa 5915 * testsuite/icf_safe_test.cc: New file.
032ce4e9 5916
f345227a
ST
59172009-10-12 Sriraman Tallam <tmsriram@google.com>
5918
5919 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
5920 includes to gc.h and icf.h.
5921 * arm.cc: Include gc.h.
5922 * gold.cc: Likewise.
5923 * i386.cc: Likewise.
5924 * powerpc.cc: Likewise.
5925 * sparc.cc: Likewise.
5926 * x86_64.cc: Likewise.
5927 * gc.h: Include icf.h.
5928
1c7814ed
ILT
59292009-10-11 Ian Lance Taylor <iant@google.com>
5930
5931 * plugin.cc: Include "gold.h" before other header files.
5932
ae3b5189
CD
59332009-10-10 Chris Demetriou <cgd@google.com>
5934
5935 * options.h (Input_file_argument::Input_file_type): New enum.
5936 (Input_file_argument::is_lib_): Replace with...
5937 (Input_file_argument::type_): New member.
5938 (Input_file_argument::Input_file_argument): Take Input_file_type
5939 'type' rather than boolean 'is_lib' as second argument.
5940 (Input_file_argument::is_lib): Use type_.
5941 (Input_file_argument::is_searched_file): New function.
5942 (Input_file_argument::may_need_search): Handle is_searched_file.
5943 * options.cc (General_options::parse_library): Support -l:filename.
5944 (General_options::parse_just_symbols): Update for Input_file_argument
5945 changes.
5946 (Command_line::process): Likewise.
5947 * archive.cc (Archive::get_file_and_offset): Likewise.
5948 * plugin.cc (Plugin_manager::release_input_file): Likewise.
5949 * script.cc (read_script_file, script_add_file): Likewise.
5950 * fileread.cc (Input_file::Input_file): Likewise.
5951 (Input_file::will_search_for): Handle is_searched_file.
5952 (Input_file::open): Likewise.
5953 * readsyms.cc (Read_symbols::get_name): Likewise.
5954 * testsuite/Makefile.am (searched_file_test): New test.
5955 * testsuite/Makefile.in: Regenerate.
5956 * testsuite/searched_file_test.cc: New file.
5957 * testsuite/searched_file_test_lib.cc: New file.
5958
f3048a1d
ILT
59592009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5960 Ian Lance Taylor <iant@google.com>
5961
5962 * descriptor.cc: Include <cstdio> and "binary-io.h".
5963 (Descriptors::open): Open the files in binary mode always.
5964 * script.cc (Lex::get_token): Treat \r as whitespace.
5965
d4780e57
ILT
59662009-10-09 Ian Lance Taylor <iant@google.com>
5967
5968 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
5969
d9a893b8
ILT
59702009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5971 Ian Lance Taylor <iant@google.com>
5972
5973 * configure.ac: Check for readv function also.
5974 * fileread.cc (readv): Define if not HAVE_READV.
5975 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
5976 does not exist.
5977 * config.in: Regenerate.
5978 * configure: Regenerate.
5979
c0a62865
DK
59802009-10-09 Doug Kwan <dougkwan@google.com>
5981
5982 * layout.cc (Layout::make_output_section): Call target hook to make
5983 ordinary output section.
5984 (Layout::finalize): Adjust parameter list of call the
5985 Target::may_relax().
5986 * layout.h (class Layout::section_list): New method.
5987 * merge.h (Output_merge_base::entsize): Change visibility to public.
5988 (Output_merge_base::is_string, Output_merge_base::do_is_string):
5989 New methods.
5990 (Output_merge_string::do_is_string): New method.
5991 * object.cc (Sized_relobj::do_setup): renamed from
5992 Sized_relobj::set_up.
5993 * object.h (Sized_relobj::adjust_shndx,
5994 Sized_relobj::initializ_input_to_output_maps,
5995 Sized_relobj::free_input_to_output_maps): Change visibilities to
5996 protected.
5997 (Sized_relobj::setup): Virtualize.
5998 (Sized_relobj::do_setup): New method declaration.
5999 (Sized_relobj::invalidate_section_offset,
6000 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6001 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6002 * options.cc (parse_int): New function.
6003 * options.h (parse_int): New declaration.
6004 (DEFINE_int): New macro.
6005 (stub_group_size): New option.
6006 * output.cc (Output_section::Output_section): Initialize memebers
6007 merge_section_map_, merge_section_by_properties_map_,
6008 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6009 (Output_section::add_input_section): Handled deferred code-fill
6010 generation and remove an old comment.
6011 (Output_section::add_relaxed_input_section): New method definition.
6012 (Output_section::add_merge_input_section): Use merge section by
6013 properties map to speed to search. Update merge section maps
6014 as appropriate.
6015 (Output_section::build_relaxation_map): New method definition.
6016 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6017 Same.
6018 (Output_section::relax_input_section): Renamed to
6019 Output_section::convert_input_sections_to_relaxed_sections and change
6020 interface to take a vector of pointers to relaxed sections.
6021 (Output_section::find_merge_section,
6022 Output_section::find_relaxed_input_section): New method definitions.
6023 (Output_section::is_input_address_mapped,
6024 Output_section::output_offset, Output_section::output_address):
6025 Use output section data maps to speed up searching.
6026 (Output_section::find_starting_output_address): Add comments.
6027 (Output_section::do_write,
6028 Output_section::write_to_postprocessing_buffer): Do code-fill
6029 generation as appropriate.
6030 (Output_section::get_input_sections): Invalidate relaxed input section
6031 map.
6032 (Output_section::restore_states): Adjust type of checkpoint .
6033 Invalidate relaxed input section map.
6034 * output.h (Output_merge_base): New class declaration.
6035 (Input_section_specifier): New class defintion.
6036 (class Output_relaxed_input_section) Change base class to
6037 Output_section_data_build.
6038 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6039 base class initializer.
6040 (Output_section::add_relaxed_input_section): New method declaration.
6041 (Output_section::Input_section): Change visibility to protected.
6042 (Output_section::Input_section::relobj,
6043 Output_section::Input_section::shndx): Handle relaxed input sections.
6044 Output_section::input_sections) Change visibility to protected. Also
6045 define overload to return a non-const pointer.
6046 (Output_section::Merge_section_properties): New class defintion.
6047 (Output_section::Merge_section_by_properties_map,
6048 Output_section::Output_section_data_by_input_section_map,
6049 Output_section::Relaxation_map): New types.
6050 (Output_section::relax_input_section): Rename method to
6051 Output_section::convert_input_sections_to_relaxed_sections and change
6052 interface to take a vector of relaxed section pointers.
6053 (Output_section::find_merge_section,
6054 Output_section::find_relaxed_input_section,
6055 Output_section::build_relaxation_map,
6056 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6057 New method declarations.
6058 (Output_section::merge_section_map_
6059 Output_section::merge_section_by_properties_map_,
6060 Output_section::relaxed_input_section_map_,
6061 Output_section::is_relaxed_input_section_map_valid_,
6062 Output_section::generate_code_fills_at_write_): New data members.
6063 * script-sections.cc
6064 (Output_section_element_input::set_section_addresses): Call
6065 current_data_size and addralign methods of relaxed input sections.
6066 (Orphan_output_section::set_section_addresses): Call current_data_size
6067 and addralign methods of relaxed input sections.
6068 * symtab.cc (Symbol_table::compute_final_value): Extract template
6069 from the body of Symbol_table::sized_finalize_symbol.
6070 (Symbol_table::sized_finalized_symbol): Call
6071 Symbol_table::compute_final_value.
6072 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6073 (Symbol_table::compute_final_value): New templated method declaration.
6074 * target.cc (Target::do_make_output_section): New method defintion.
6075 * target.h (Target::make_output_section): New method declaration.
6076 (Target::relax): Add more parameters for input objects, symbol table
6077 and layout. Adjust call to do_relax.
6078 (Target::do_make_output_section): New method declaration.
6079 (Target::do_relax): Add parameters for input objects, symbol table
6080 and layout.
6081
d446d6c4
ILT
60822009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6083
6084 * pread.c: Include stdio.h.
6085
bc06c745
ILT
60862009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6087
6088 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6089 defined.
6090
75aea3d0
ILT
60912009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6092
6093 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6094 Change read_shndx type to unsigned int.
6095 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6096 int.
6097 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6098 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6099 Change read_shndx type to unsigned int.
6100 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6101 int.
6102 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6103 * layout.cc (Layout::create_symtab_sections): Cast the result of
6104 local_symcount * symsize to off_t in the gold_assert.
6105
be8fcb75
ILT
61062009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6107
6108 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6109 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6110 R_ARM_BASE_ABS.
6111 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6112 (Arm_relocate_functions::thm_abs5): New function.
6113 (Arm_relocate_functions::abs12): New function.
6114 (Arm_relocate_functions::abs16): New function.
6115 (Arm_relocate_functions::base_abs): New function.
6116 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6117 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6118 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6119 R_ARM_BASE_ABS.
6120 (Scan::global): Likewise.
6121 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6122 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6123 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6124 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6125 R_ARM_BASE_ABS.
6126
c2a122b6
ILT
61272009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6128
6129 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6130 (Arm_relocate_functions::movt_prel): New function.
6131 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6132 (Arm_relocate_functions::thm_movt_prel): New function.
6133 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6134 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6135 (Scan::global, Relocate::relocate): Likewise.
6136 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6137
c4aa1e2d
ILT
61382009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6139
6140 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6141 Incremental_checker.
6142 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6143 unsigned int.
6144 (class Incremental_inputs_header): New class.
6145 (Incremental_inputs_header_writer): Edit comment.
6146 (Incremental_inputs_entry): New class.
6147 (Incremental_inputs_entry_writer): Edit comment.
6148 (Sized_incremental_binary::do_find_incremental_inputs_section):
6149 Add *strtab_shndx parameter, fill it.
6150 (Sized_incremental_binary::do_check_inputs): New method.
6151 (Incremental_checker::can_incrementally_link_output_file): Use
6152 Sized_incremental_binary::check_inputs.
6153 (Incremental_inputs::report_command_line): Save command line in
6154 command_line_.
6155 * incremental.h:
6156 (Incremental_binary::find_incremental_inputs_section): New
6157 method.
6158 (Incremental_binary::do_find_incremental_inputs_section): Add
6159 strtab_shndx parameter.
6160 (Incremental_binary::do_check_inputs): New pure virtual method.
6161 (Sized_incremental_binary::do_check_inputs): Declare.
6162 (Incremental_checker::Incremental_checker): Add incremental_inputs
6163 parameter, use it to initialize incremental_inputs_.
6164 (Incremental_checker::incremental_inputs_): New field.
6165 (Incremental_checker::command_line): New method.
6166 (Incremental_checker::inputs): New method.
6167 (Incremental_checker::command_line_): New field.
6168
c549a694
ILT
61692009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6170
6171 * incremental.cc: Include <cstdarg> and "target-select.h".
6172 (vexplain_no_incremental): New function.
6173 (explain_no_incremental): New function.
6174 (Incremental_binary::error): New method.
6175 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6176 method.
6177 (make_sized_incremental_binary): New function.
6178 (open_incremental_binary): New function.
6179 (can_incrementally_link_file): Add checks if output is ELF and has
6180 inputs section.
6181 * incremental.h: Include "elfcpp_file.h" and "output.h".
6182 (Incremental_binary): New class.
6183 (Sized_incremental_binary): New class.
6184 (open_incremental_binary): Declare.
6185 * object.cc (is_elf_object): Use
6186 elfcpp::Elf_recognizer::is_elf_file.
6187 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6188 * output.h (Output_file::filesize): New method.
6189
fd3c5f0b
ILT
61902009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6191
6192 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6193 New function.
6194 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6195 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6196 function.
6197 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6198 function.
6199 (Arm_relocate_functions::movw_abs_nc): New function.
6200 (Arm_relocate_functions::movt_abs): New function.
6201 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6202 (Arm_relocate_functions::thm_movt_abs): New function.
6203 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6204 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6205 (Scan::global): Likewise.
6206 (Relocate::relocate): Likewise.
6207 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6208
7f5309a5
ILT
62092009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6210
6211 * arm.cc (Arm_relocate_functions::got_prel) New function.
6212 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6213 (Relocate::relocate): Likewise.
6214 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6215
364c7fa5
ILT
62162009-10-06 Ian Lance Taylor <iant@google.com>
6217
6218 * options.h (class General_options): Define
6219 split_stack_adjust_size parameter.
6220 * object.h (class Object): Add uses_split_stack_ and
6221 has_no_split_stack_ fields. Add uses_split_stack and
6222 has_no_split_stack accessor functions. Declare
6223 handle_split_stack_section.
6224 (class Reloc_symbol_changes): Define.
6225 (class Sized_relobj): Define Function_offsets. Declare
6226 split_stack_adjust, split_stack_adjust_reltype, and
6227 find_functions.
6228 * object.cc (Object::handle_split_stack_section): New function.
6229 (Sized_relobj::do_layout): Call handle_split_stack_section.
6230 * dynobj.cc (Sized_dynobj::do_layout): Call
6231 handle_split_stack_section.
6232 * reloc.cc (Sized_relobj::relocate_sections): Call
6233 split_stack_adjust for executable sections in split_stack
6234 objects. Pass reloc_map to relocate_section.
6235 (Sized_relobj::split_stack_adjust): New function.
6236 (Sized_relobj::split_stack_adjust_reltype): New function.
6237 (Sized_relobj::find_functions): New function.
6238 * target-reloc.h: Include "object.h".
6239 (relocate_section): Add reloc_symbol_changes parameter. Change
6240 all callers.
6241 * target.h (class Target): Add calls_non_split method. Declare
6242 do_calls_non_split virtual method. Declare match_view and
6243 set_view_to_nop.
6244 * target.cc: Include "elfcpp.h".
6245 (Target::do_calls_non_split): New function.
6246 (Target::match_view): New function.
6247 (Target::set_view_to_nop): New function.
6248 * gold.cc (queue_middle_tasks): Give an error if mixing
6249 split-stack and non-split-stack objects with -r.
6250 * i386.cc (Target_i386::relocate_section): Add
6251 reloc_symbol_changes parameter.
6252 (Target_i386::do_calls_non_split): New function.
6253 * x86_64.cc (Target_x86_64::relocate_section): Add
6254 reloc_symbol_changes parameter.
6255 (Target_x86_64::do_calls_non_split): New function.
6256 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
6257 parameter.
6258 * powerpc.cc (Target_powerpc::relocate_section): Add
6259 reloc_symbol_changes parameter.
6260 * sparc.cc (Target_sparc::relocate_section): Add
6261 reloc_symbol_changes parameter.
6262 * configure.ac: Call AM_CONDITIONAL for the default target.
6263 * configure: Rebuild.
6264 * testsuite/Makefile.am (TEST_AS): New variable.
6265 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
6266 (check_DATA): Add split_i386 and split_x86_64 files.
6267 (SPLIT_DEFSYMS): Define.
6268 (split_i386_[1234n].o): New targets.
6269 (split_i386_[124]): New targets.
6270 (split_i386_[1234r].stdout): New targets.
6271 (split_x86_64_[1234n].o): New targets.
6272 (split_x86_64_[124]): New targets.
6273 (split_x86_64_[1234r].stdout): New targets.
6274 (MOSTLYCLEANFILES): Add new executables.
6275 * testsuite/split_i386.sh: New file.
6276 * testsuite/split_x86_64.sh: New file.
6277 * testsuite/split_i386_1.s: New file.
6278 * testsuite/split_i386_2.s: New file.
6279 * testsuite/split_i386_3.s: New file.
6280 * testsuite/split_i386_4.s: New file.
6281 * testsuite/split_i386_n.s: New file.
6282 * testsuite/split_x86_64_1.s: New file.
6283 * testsuite/split_x86_64_2.s: New file.
6284 * testsuite/split_x86_64_3.s: New file.
6285 * testsuite/split_x86_64_4.s: New file.
6286 * testsuite/split_x86_64_n.s: New file.
6287 * testsuite/testfile.cc (Target_test): Update relocation_section
6288 function.
6289 * testsuite/Makefile.in: Rebuild.
6290
e8a9fcda
ILT
62912009-10-06 Ian Lance Taylor <iant@google.com>
6292
6293 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
6294 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
6295 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
6296 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
6297 the address on ldo_addrs_.
6298 (Target_i386::Relocate::fix_up_ldo): New function.
6299
e99daf92
ILT
63002009-10-06 Rafael Espindola <espindola@google.com>
6301
6302 * plugin.cc (add_input_library): New.
6303 (Plugin::load): Add add_input_library to tv.
6304 (Plugin_manager::add_input_file): Add the is_lib argument.
6305 (add_input_file): Update call to Plugin_manager::add_input_file.
6306 (add_input_library): New.
6307 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
6308
966d4097
DK
63092009-09-30 Doug Kwan <dougkwan@google.com>
6310
6311 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
6312 symbol and call Symbol::may_need_copy_reloc to determine if
6313 a copy reloc is needed.
6314 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
6315 nocopyreloc is given in command line.
6316 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
6317 given in command line.
6318 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
6319 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
6320 of the removed Target_i386::may_need_copy_reloc.
6321 * options.h (copyreloc): New option with default value false.
6322 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6323 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
6324 instead of the removed Target_powerpc::may_need_copy_reloc.
6325 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6326 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
6327 instead of the removed Target_sparc::may_need_copy_reloc.
6328 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
6329 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
6330 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
6331 instead of the removed Target_x86_64::may_need_copy_reloc.
6332
029ba973
ILT
63332009-09-30 Ian Lance Taylor <iant@google.com>
6334
6335 * object.h (class Object): Remove target_ field, and target,
6336 sized_target, and set_target methods.
6337 (Object::sized_target): Remove.
6338 (class Sized_relobj): Update declarations. Remove sized_target.
6339 * object.cc (Sized_relobj::setup): Remove target parameter.
6340 Change all callers.
6341 (Input_objects::add_object): Don't do anything with the target.
6342 (make_elf_sized_object): Add punconfigured parameter. Change all
6343 callers. Set or test parameter target.
6344 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
6345 Change all callers.
6346 * parameters.cc (Parameters::set_target): Change parameter type to
6347 be non-const.
6348 (Parameters::default_target): Remove.
6349 (set_parameters_target): Change parameter type to be non-const.
6350 (parameters_force_valid_target): New function.
6351 (parameters_clear_target): New function.
6352 * parameters.h (class Parameters): Update declarations. Remove
6353 default_target method. Add sized_target and clear_target
6354 methods. Change target_ to be non-const.
6355 (set_parameters_target): Update declaration.
6356 (parameters_force_valid_target): Declare.
6357 (parameters_clear_target): Declare.
6358 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
6359 as NULL if we aren't searching.
6360 (Add_symbols::run): Don't check for compatible target.
6361 * fileread.cc (Input_file::open_binary): Call
6362 parameters_force_valid_target.
6363 * gold.cc (queue_middle_tasks): Likewise.
6364 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
6365 set_target on object.
6366 * dynobj.h (class Sized_dynobj): Update declarations.
6367 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
6368 make_elf_object returns NULL.
6369 (Archive::include_member): Don't check whether object target is
6370 compatible.
6371 * output.cc (Output_section::add_input_section): Get target from
6372 parameters.
6373 (Output_section::relax_input_section): Likewise.
6374 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
6375 parameters.
6376 (Sized_relobj::do_scan_relocs): Likewise.
6377 (Sized_relobj::relocate_sections): Likewise.
6378 * resolve.cc (Symbol_table::resolve): Likewise.
6379 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
6380 parameter. Change all callers.
6381 (Symbol_table::add_from_object): Get target from parameters.
6382 (Symbol_table::add_from_relobj): Don't check object target.
6383 (Symbol_table::add_from_dynobj): Likewise.
6384 (Symbol_table::define_special_symbol): Get target from
6385 parameters.
6386 * symtab.h (class Symbol_table): Update declaration.
6387 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
6388 parameter. Change all callers. Clear parameter target.
6389 (Binary_test): Test target here.
6390 * testsuite/object_unittest.cc (gold_testsuite): Remove
6391 target_test_pointer parameter. Change all callers.
6392 (Object_test): Test target here.
6393
a6a22b83
ILT
63942009-09-26 Ian Lance Taylor <iant@google.com>
6395
6396 * testsuite/initpri1.c: Don't try to use constructor priorities if
6397 compiling with gcc before 4.3.
6398
6a8f49fe
ILT
63992009-09-22 Mikolaj Zalewski <mikolajz@google.com>
6400
6401 * testsuite/retain_symbols_file_test.sh (check_present): Change
6402 output file name to retain_symbols_file_test.stdout.
6403 (check_absent): Likewise.
6404
8c604651
CS
64052009-09-18 Craig Silverstein <csilvers@google.com>
6406
6407 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
6408 * options.cc: Include <cerrno> and <fstream>.
6409 (General_options::finalize): Parse -retain-symbols-file tag.
6410 * options.h: New flag.
6411 (General_options): New method should_retain_symbol, new
6412 variable symbols_to_retain.
6413 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
6414 should_retain_symbol map.
6415 * testsuite/Makefile.am (retain_symbols_file_test): New test.
6416 * testsuite/Makefile.in: Regenerate.
6417 * testsuite/retain_symbols_file_test.sh: New file.
6418
ca58b19f
NC
64192009-09-18 Nick Clifton <nickc@redhat.com>
6420
6421 * po/es.po: Updated Spanish translation.
6422
20e6d0d6
DK
64232009-09-17 Doug Kwan <dougkwan@google.com>
6424
6425 * debug.h (DEBUG_RELAXATION): New constant.
6426 (DEBUG_ALL): Add DEBUG_RELAXATION.
6427 (debug_string_to_enum): Add relaxation debug option.
6428 * layout.cc
6429 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
6430 Layout::Relaxation_debug_check::read_sections,
6431 Layout::Relaxation_debug_check::read_sections): New method definitions.
6432 (Layout::Layout): Initialize data members
6433 record_output_section_data_from_scrips_,
6434 script_output_section_data_list_ and relaxation_debug_check_.
6435 (Layout::save_segments, Layout::restore_segments,
6436 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6437 Layout::relaxation_loop_body): New method definitions.
6438 (Layout::finalize): Support relaxation. Move section layout code to
6439 Layout::relaxation_loop_body.
6440 (Layout::set_asection_address_from_script): Move code for orphan
6441 section placement out.
6442 (Layout::place_orphan_sections_in_script): New method definition.
6443 * layout.h (Output_segment_headers, Output_file_header):
6444 New forward class declarations.
6445 (Layout::~Layout): Define.
6446 (Layout::new_output_section_data_from_script): New method definition.
6447 (Layout::place_orphan_sections_in_script): New method declaration.
6448 (Layout::Segment_states): New type declaration.
6449 (Layout::save_segments, Layout::restore_segments,
6450 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6451 Layout::relaxation_loop_body): New method declarations.
6452 (Layout::Output_section_data_list): New type declaration.
6453 (Layout::Relaxation_debug_check): New class definition.
6454 (Layout::record_output_section_data_from_script_,
6455 Layout::script_output_section_data_list_, Layout::segment_states_,
6456 Layout::relaxation_debug_check_): New data members.
6457 * output.cc: (Output_section_headers::do_size): New method definition.
6458 (Output_section_headers::Output_section_headers): Move size
6459 computation to Output_section_headers::do_size.
6460 (Output_segment_headers::do_size): New method definition.
e1df38aa 6461 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
6462 Output_file_header::do_size and call it.
6463 (Output_file_header::do_size): New method definition.
6464 (Output_data_group::Output_data_group): Adjust call to
6465 Output_section_data.
6466 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
6467 (Output_symtab_xindex::do_write): Add array bound check.
6468 (Output_section::Input_section::print_to_mapfile): Handle
6469 RELAXED_INPUT_SECTION_CODE.
6470 (Output_section::Output_section): Initialize data member checkpoint_.
6471 (Output_section::~Output_section): Delete checkpoint object pointed
6472 by checkpoint_.
6473 (Output_section::add_input_section): Always add an Input_section if
6474 relaxing.
6475 (Output_section::add_merge_input_section): Add assert.
6476 (Output_section::relax_input_section): New method definition.
6477 (Output_section::set_final_data_size): Set load address to zero for
6478 an unallocated section.
6479 (Output_section::do_address_and_file_offset_have_reset_values):
6480 New method definition.
6481 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
6482 Handle relaxed input section.
6483 (Output_section::sort_attached_input_sections): Checkpoint input
6484 section list lazily.
6485 (Output_section::get_input_sections): Change type of input_sections to
6486 list of Simple_input_section pointers. Checkpoint input section list
6487 lazily. Also handle relaxed input sections.
6488 (Output_section::add_input_section_for_script): Take a reference to
6489 a Simple_input_section object instead of Relobj pointer and section
6490 index as parameter. Handle relaxed input sections.
6491 (Output_section::save_states, Output_section::restore_states): New
6492 method definitions.
6493 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
6494 (Output_data::is_data_size_fixed): New method definition.
6495 (Output_data::reset_addresss_and_file_offset): Do not reset data size
6496 if it is fixed.
6497 (Output_data::address_and_file_offset_have_reset_values): New method
6498 definition.
6499 (Output_data::do_address_and_file_offset_have_reset_values): New method
6500 definition.
6501 (Output_data::set_data_size): Check that data size is not fixed.
6502 (Output_data::fix_data_size): New method definition.
6503 (Output_data::is_data_size_fixed_): New data member.
6504 (Output_section_headers::set_final_data_size): New method definition.
6505 (Output_section_headers::do_size): New method declaration.
6506 (Output_segment_headers::set_final_data_size): New method definition.
6507 (Output_segment_headers::do_size): New method declaration.
6508 (Output_file_header::set_final_data_size)::New method definition.
6509 (Output_file_header::do_size)::New method declaration.
6510 (Output_section_data::Output_section_data): Add new parameter
6511 is_data_size_fixed and use it to fix data size.
6512 (Output_data_const::Output_data_const): Adjust call to base class
6513 constructor and fix data size.
6514 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
6515 base class constructor and fix data size.
6516 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
6517 base class constructor and fix data size.
6518 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
6519 class constructor and fix data size.
6520 (Output_data_group::set_final_data_size): New method definition.
6521 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
6522 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
6523 class constructor and fix data size.
6524 (Output_relaxed_input_section): New class definition.
6525 (Output_section::Simple_input_section): New class definition.
6526 (Output_section::get_input_sections): Adjust parameter list.
6527 (Output_section::add_input_section_for_script): Same.
6528 (Output_section::save_states, Output_section::restore_states,
6529 Output_section::do_address_and_file_offset_have_reset_values,
6530 (Output_section::Input_section::Input_section): Handle
6531 RELAXED_INPUT_SECTION_CODE. Add new overload for
6532 Output_relaxed_input_section.
6533 (Output_section::Input_section::is_input_section,
6534 Output_section::Input_section::set_output_section): Handle relaxed
6535 input section.
6536 (Output_section::Input_section::is_relaxed_input_section,
6537 Output_section::Input_section::output_section_data,
6538 Output_section::Input_section::relaxed_input_section): New method
6539 definitions.
6540 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
6541 value.
6542 (Output_section::Input_section::u1_): Update comments.
6543 (Output_section::Input_section::u2_): Add new union member poris.
6544 (Output_section::Checkpoint_output_section): New classs definition.
6545 (Output_section::relax_input_section): New method declaration.
6546 (Output_section::checkpoint_): New data member.
6547 (Output_segment): Update comments.
6548 (Output_segment::Output_segment): Un-privatize copy constructor.
6549 (Output_segment::operator=): Un-privatize.
6550 * script-sections.cc (Output_section_element::Input_section_list):
6551 Change element type to Output_section::Simple_input_section.
6552 (Output_section_element_dot_assignment::set_section_addresses):
6553 Register output section data for relaxation clean up.
6554 (Output_data_exression::Output_data_expression): Adjust call to base
6555 constructor to fix data size.
6556 (Output_section_element_data::set_section_addresses): Register
6557 Output_data_expression object for relaxation clean up.
6558 (struct Input_section_info): Replace Relobj pointer and section index
6559 pair with Output_section::Simple_input_section and Convert struct to a
6560 class.
6561 (Input_section_sorter::operator()): Adjust access to
e1df38aa 6562 Input_section_info data member to use accessors.
20e6d0d6
DK
6563 (Output_section_element_input::set_section_addresses): Use layout
6564 parameter. Adjust code to use Output_section::Simple_input_section
6565 and Input_secction_info classes. Register filler for relaxation
6566 clean up.
6567 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
6568 and section index pair with Output_section::Simple_input_section
6569 class. Adjust code accordingly.
6570 (Phdrs_element::release_segment): New method definition.
6571 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
6572 segment list.
6573 (Script_sections::release_segments): New method definition.
6574 * gold/script-sections.h (Script_sections::release_segments): New
6575 method declaration.
6576 * gold/target.h (Target::may_relax, Target::relax,
6577 Target::do_may_relax, Target::do_relax): New method definitions.
6578
5e445df6
ILT
65792009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6580
6581 * arm.cc (has_signed_unsigned_overflow): New function.
6582 (Arm_relocate_functions::abs8): New function.
6583 (Target_arm::Scan::local): Handle R_ARM_ABS8.
6584 (Target_arm::Scan::global): Likewise.
6585 (Target_arm::relocate::relocate): Likewise.
6586 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6587 Likewise.
6588
8c604651 65892009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
6590
6591 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
6592 * testsuite/Makefile.in: Regenerate.
6593
1e9cc1c2
NC
65942009-09-11 Nick Clifton <nickc@redhat.com>
6595
6596 * po/gold.pot: Updated by the Translation project.
6597
6a89f575
CC
65982009-09-08 Cary Coutant <ccoutant@google.com>
6599
6600 * output.cc (Output_file::open): Add execute permission to empty file.
6601 * testsuite/Makefile.am (permission_test): New test.
6602 * testsuite/Makefile.in: Regenerate.
6603
fdcac5af
ILT
66042009-09-02 Ian Lance Taylor <iant@google.com>
6605
6606 * output.cc (Output_file::resize): Call map_no_anonymous rather
6607 than map.
6608
44453f85
ILT
66092009-09-01 Mikolaj Zalewski <mikolajz@google.com>
6610
6611 * gold.cc: Include "incremental.h".
6612 (queue_initial_tasks): Call Incremental_checker methods.
6613 * incremental.cc: Include "output.h".
6614 (Incremental_checker::can_incrementally_link_output_file): New
6615 method.
6616 * incremental.h (Incremental_checker): New class.
6617
6618 * output.cc (Output_file::open_for_modification): New method.
6619 (Output_file::map_anonymous): Changed return type to bool. Record
6620 map in base_ field.
6621 (Output_file::map_no_anonymous): New method, broken out of map.
6622 (Output_file::map): Use map_no_anonymous and map_anonymous.
6623 * output.h (class Output_file): Update declarations.
6624
293c1386
CC
66252009-08-24 Cary Coutant <ccoutant@google.com>
6626
6627 * options.h (Command_line::Pre_options): New class.
6628 (Command_line::pre_options): New member.
6629 * options.cc (gold::options::ready_to_register): New variable.
6630 (One_option::register_option): Do nothing if not registering options.
6631 Assert if same short option registered twice.
6632 (General_options::General_options): Turn off option registration when
6633 done constructing.
6634 (Command_line::Pre_options::Pre_options): New constructor.
6635
f773f3d2
CC
66362009-08-24 Cary Coutant <ccoutant@google.com>
6637
06a73cfe
CC
6638 * options.h (General_options::no_keep_memory): Remove incorrect
6639 short option.
f773f3d2 6640
a15af8e2
RW
66412009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6642
6643 * Makefile.am (am__skiplex, am__skipyacc): New.
6644 * Makefile.in: Regenerate.
6645
c462b41b
RW
66462009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6647
14ec8efd
RW
6648 * Makefile.am (AM_CPPFLAGS): Renamed from ...
6649 (INCLUDES): ... this.
6650 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
6651 (AM_CPPFLAGS): Renamed from ...
6652 (INCLUDE): ... this.
6653 * Makefile.in, testsuite/Makefile.in: Regenerate.
6654
81ecdfbb
RW
6655 * Makefile.in: Regenerate.
6656 * aclocal.m4: Likewise.
6657 * config.in: Likewise.
6658 * configure: Likewise.
6659 * testsuite/Makefile.in: Likewise.
6660
c462b41b
RW
6661 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
6662 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
6663 * Makefile.in: Regenerate.
6664 * testsuite/Makefile.in: Regenerate.
6665
2da73f13
CC
66662009-08-19 Cary Coutant <ccoutant@google.com>
6667
6668 * resolve.cc (Symbol_table::resolve): Don't complain about defined
6669 symbols in shared libraries overridden by hidden or internal symbols
6670 in the main program.
6671
2db70501
CD
66722009-08-19 Chris Demetriou <cgd@google.com>
6673
6674 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
6675 checking source file names in error messages.
6676
f733487b
DK
66772009-08-18 Doug Kwan <dougkwan@google.com>
6678
6679 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
6680 an elcpp::Ehdr as parameter. Adjust call to set_target.
6681 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
6682 an elfcpp::Ehdr as parameter.
6683 * object.cc (Object::set_target): Remove the version that looks up
6684 a target and sets it.
6685 (Sized_relobj::setup): Take a Target object instead of
6686 an elfcpp::Ehdr as parameter. Adjust call to set_target.
6687 (make_elf_sized_object): Find target and ask target to
6688 make an ELF object.
6689 * object.h: (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.
6693 * target.cc: Include dynobj.h.
6694 (Target::do_make_elf_object_implementation): New.
6695 (Target::do_make_elf_object): New.
6696 * target.h (Target::make_elf_object): New template declaration.
6697 (Target::do_make_elf_object): New method declarations.
6698 (Target::do_make_elf_object_implementation): New template declaration.
6699
cc70f101
ILT
67002009-08-14 Ian Lance Taylor <iant@google.com>
6701
6702 * gold.h (FUNCTION_NAME): Define.
6703 (gold_unreachable): Use FUNCTION_NAME.
6704
ef5e0cb1
ST
67052009-08-12 Sriraman Tallam <tmsriram@google.com>
6706
6707 * icf.cc (Icf::find_identical_sections): Issue a warning when a
6708 symbol in the --keep-unique list is not found.
6709
48c187ce
ST
67102009-08-12 Sriraman Tallam <tmsriram@google.com>
6711
6712 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
6713 been maked as --keep-unique.
6714 (Icf::unfold_section): New function.
6715 * icf.h (Icf::unfold_section): New function.
6716 * options.h (General_options::keep_unique): New option.
6717 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
6718 * testsuite/Makefile.in: Regenerate.
6719 * testsuite/icf_keep_unique_test.sh: New file.
6720 * testsuite/icf_keep_unique_test.cc: New file.
6721
645afe0c
CC
67222009-08-12 Cary Coutant <ccoutant@google.com>
6723
6724 PR 10471
6725 * resolve.cc (Symbol_table::resolve): Check for references from
6726 dynamic objects to hidden and internal symbols.
6727 * testsuite/Makefile.am (hidden_test.sh): New test.
6728 * testsuite/Makefile.in: Regenerate.
6729 * testsuite/hidden_test.sh: New script.
6730 * testsuite/hidden_test_1.c: New test source.
6731 * testsuite/hidden_test_main.c: New test source.
6732
11af873f
DK
67332009-08-11 Doug Kwan <dougkwan@google.com>
6734
6735 * arm.cc: Update comments.
6736 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
6737 segment to locate the .ARM.exidx section if present.
6738
b9f7d72d
DK
67392009-08-09 Doug Kwan <dougkwan@google.com>
6740
6741 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
6742 patch.
6743
ddd3c53c
ST
67442009-08-07 Sriraman Tallam <tmsriram@google.com>
6745 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
6746 compiler warnings.
6747
27721062
ST
67482009-08-06 Sriraman Tallam <tmsriram@google.com>
6749
6750 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
6751 valid tls_segment only for non-debug-section relocations.
6752 * testsuite/Makefile.am: Add gc_tls_test.
6753 * testsuite/Makefile.in: Regenerate.
6754 * testsuite/gc_tls_test.cc: New file.
6755 * testsuite/gc_tls_test.sh: New file.
6756
ef15dade 67572009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 6758
ef15dade
ST
6759 * icf.cc: New file.
6760 * icf.h: New file.
6761 * Makefile.am (CCFILES): Add icf.cc.
6762 (HFILES): Add icf.h
6763 * Makefile.in: Regenerate.
6764 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
6765 * gc.h (gc_process_relocs): Populate lists used by icf to contain
6766 section, symbol and addend information for the relocs.
6767 * gold.cc (queue_middle_tasks): Call identical code folding.
6768 * gold.h: Add defines for multimap.
6769 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
6770 to the call of finalize_local_symbols.
6771 * main.cc (main): Create object of class Icf.
6772 * object.cc (Sized_relobj::do_layout): Allow this function to be
6773 called twice during icf.
6774 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
6775 to sections marked as identical by icf.
6776 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
6777 when available.
6778 (Sized_relobj::do_section_entsize): New function.
6779 * object.h (Object::section_entsize): New function.
6780 (Object::do_section_entsize): New pure virtual function.
6781 (Relobj::finalize_local_symbols): Add new parameter.
6782 (Relobj::do_section_entsize): New function.
6783 * options.h (General_options::icf): New option.
6784 (General_options::icf_iterations): New option.
6785 (General_options::print_icf_sections): New option.
6786 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
6787 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
6788 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
6789 icf.
6790 * symtab.cc (Symbol_table::is_section_folded): New function.
6791 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
6792 to sections marked as identical by icf.
6793 * symtab.h (Symbol_table::set_icf): New function.
6794 (Symbol_table::icf): New function.
6795 (Symbol_table::is_section_folded): New function.
6796 (Symbol_table::icf_): New data member.
6797 * target-reloc.h (relocate_section): Ignore sections folded by icf.
6798 * testsuite/Makefile.am: Add commands to build icf_test.
6799 * testsuite/Makefile.in: Regenerate.
6800 * testsuite/icf_test.sh: New file.
6801 * testsuite/icf_test.cc: New file.
6802
c3b65ac4
CD
68032009-07-24 Chris Demetriou <cgd@google.com>
6804
6805 * layout.cc (is_compressible_debug_section): Fix incorrect
6806 comment about compressed section names.
6807
1caf2c51
ILT
68082009-07-20 Ian Lance Taylor <ian@airs.com>
6809
6810 PR 10419
6811 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
6812
1ef4d87f
ILT
68132009-07-16 Ian Lance Taylor <iant@google.com>
6814
6815 PR 10400
6816 * layout.h: #include <map>.
6817 (class Kept_section): Change from struct to class. Add accessors
6818 and setters. Add section size to Comdat_group mapping. Change
6819 Comdat_group to std::map. Add is_comdat_ field. Add
6820 linkonce_size field in union.
6821 (class Layout): Update declaration of find_or_add_kept_section.
6822 Don't declare find_kept_object.
6823 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
6824 parameter. Add object, shndx, is_comdat, and is_group_name
6825 parameters. Change all callers. Adjust for new Kept_section.
6826 (Layout::find_kept_object): Remove.
6827 * object.cc (Sized_relobj::include_section_group): Update use of
6828 Kept_section. Rename secnum to shndx. Only record
6829 Kept_comdat_section if sections are the same size.
6830 (Sized_relobj::include_linkonce_section): Update use of
6831 Kept_section. Only record Kept_comdat_section if sections are the
6832 same size. Set size of linkonce section.
6833 (Sized_relobj::map_to_kept_section): Update call to
6834 get_kept_comdat_section.
6835 * object.h (class Sized_relobj): Rename fields in
6836 Kept_comdat_section to drop trailing underscores; change object
6837 field to Relobj*. Change Kept_comdat_section_table to store
6838 struct rather than pointer.
6839 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
6840 Add kept_object and kept_shndx parameters. Change all callers.
6841 (Sized_relobj::get_kept_comdat_section): Change return type to
6842 bool. Add kept_object and kept_shndx parameters. Change all
6843 callers.
6844 * plugin.cc (Pluginobj::include_comdat_group): Update call to
6845 Layout::find_or_add_kept_section.
6846
37c3b7b0
ILT
68472009-07-09 Ian Lance Taylor <iant@google.com>
6848
6849 * merge.cc (Object_merge_map::initialize_input_to_output_map):
6850 Reserve space in the hash table.
6851
98fa85cb
ILT
68522009-07-06 Mikolaj Zalewski <mikolajz@google.com>
6853
6854 * fileread.cc (File_read::get_mtime): New method.
6855 * fileread.h (Timespec): New structure.
6856 (File_read::get_mtime): New method.
6857 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
6858 Renamed from timestamp_nsec.
6859 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
6860 Elf_Xword.
e1df38aa 6861 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 6862 timestamp_nsec.
e1df38aa 6863 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
6864 (Incremental_inputs::report_obejct): Save mtime; style fix.
6865 (Incremental_inputs::report_script): Save mtime; style fix.
6866 (Incremental_inputs::finalize_inputs): Style fix.
6867 (Incremental_inputs::finalize): Style fix.
6868 (Incremental_inputs::create_input_section_data): Store inputs
6869 mtime.
6870 * incremental.h (Incremental_inputs::report_script): Add mtime
6871 argument.
6872 (Incremental_inputs::Input_info::Input_info): Intialize only one
6873 union member.
6874 (Incremental_inputs::Input_info::archive): Move to nameless
6875 union.
6876 (Incremental_inputs::Input_info::obejct): Move to nameless union.
6877 (Incremental_inputs::Input_info::script): Move to nameless union.
6878 (Incremental_inputs::mtime): New field.
6879 * script.cc (read_input_script): Pass file mtime to
6880 Incremental_input.
6881 * script.h (Script_info::inputs): Style fix.
6882
c9d70757
ILT
68832009-07-01 Ian Lance Taylor <ian@airs.com>
6884
6885 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
6886 instead of 32.
6887
9c547ec3
ILT
68882009-06-24 Ian Lance Taylor <iant@google.com>
6889
6890 PR 10156
6891 * layout.cc (Layout::choose_output_section): If we find an
6892 existing section, update the flags.
6893 (Layout::create_notes): New function, broken out of
6894 Layout::finalize.
6895 (Layout::finalize): Don't create note sections.
6896 (Layout::create_note): Don't crash if linker script discards
6897 section.
6898 (Layout::create_gold_note): Likewise.
6899 (Layout::create_build_id): Likewise. Don't set
6900 after_input_sections on the section.
6901 (Layout::create_executable_stack_info): Remove target parameter.
6902 Change caller.
6903 * layout.h (class Layout): Declare create_notes. Update
6904 declaration of create_executable_stack_info.
6905 * gold.cc (queue_middle_tasks): Call create_notes.
6906 * output.cc (Output_section::update_flags_for_input_section): Move
6907 here from output.h. If SHF_ALLOC flag is newly set, mark address
6908 invalid.
6909 * output.h (Output_data::mark_address_invalid): New function.
6910 (class Output_section): Only declare, not define,
6911 update_flags_for_input_section. Remove set_flags.
6912
55458500
ILT
69132009-06-24 Ian Lance Taylor <iant@google.com>
6914
6915 * script-sections.cc (Output_section_definition::
6916 set_section_addresses): Rename shadowing local load_address to
6917 laddr.
6918
1307d6cd
ILT
69192009-06-24 Ian Lance Taylor <iant@google.com>
6920
6921 PR 10244
6922 * reloc.cc (relocate_sections): Skip empty relocation sections.
6923
ec3f783e
ILT
69242009-06-23 Ian Lance Taylor <iant@google.com>
6925
6926 PR 10156
6927 * layout.cc (Layout::create_note): Use choose_output_section
6928 rather than make_output_section.
6929
459c9f1c
ILT
69302009-06-23 Ian Lance Taylor <iant@google.com>
6931
6932 PR 10237
6933 * options.cc (General_options::parse_V): Set printed_version_.
6934 (General_options::General_options): Initialize printed_version_.
6935 * options.h (class General_options): Add printed_version_ field.
6936 * gold.cc (queue_initial_tasks): If there are no input files,
6937 don't give a fatal error if we printed the version information.
6938 (queue_middle_tasks): If using -r with a shared object, give a
6939 fatal error rather than an ordinary error.
6940
1518dc8f
ILT
69412009-06-23 Ian Lance Taylor <iant@google.com>
6942
6943 PR 10219
6944 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
6945 (Layout::make_output_section): Set have_stabstr_section_ if we see
6946 a .stab*str section.
6947 (Layout::finalize): Call link_stabs_sections.
6948 (Layout::link_stabs_sections): New file.
6949 * layout.h (class Layout): Add have_stabstr_section_ field.
6950 Declare link_stabs_sections.
6951
3d857b98
DK
69522009-06-23 Doug Kwan <dougkwan@google.com>
6953
6954 * Makefile.am (libgold_a_LIBADD): New.
6955 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
6956 * Makefile.in: Regenerate.
6957 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
6958 * configure: Regenerate.
6959 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
6960 * fileread.cc: Include sys/state.h
6961 * gold.h: Declare memmem and strndup if found missing.
6962 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
6963
0639a6f6
ILT
69642009-06-23 Ian Lance Taylor <iant@google.com>
6965
6966 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
6967 * configure: Rebuild.
6968
8d63875c
ILT
69692009-06-23 Ian Lance Taylor <iant@google.com>
6970
6971 PR 10147
6972 * object.cc (Object::section_contents): Don't try to get a view if
6973 the section has length zero.
6974 (Object::handle_gnu_warning_section): If the section is empty, use
6975 the name of the section as the warning.
6976
f7c8a183
ILT
69772009-06-23 Ian Lance Taylor <iant@google.com>
6978
6979 PR 10133
6980 * stringpool.h (class Stringpool_template): Add optimize_ field.
6981 (Stringpool_template::set_optimize): New function.
6982 * stringpool.cc (Stringpool_template::Stringpool_template):
6983 Initialize optimize_ field.
6984 (Stringpool_template::set_string_offsets): Test local optimize
6985 fild rather than parameter.
6986 * layout.cc (Layout::Layout): Call set_optimize on the section
6987 name stringpool.
6988
e6a307ba
ILT
69892009-06-22 Ian Lance Taylor <iant@google.com>
6990
6991 PR 10030
6992 * yyscript.y: Parse TARGET.
6993 * script.cc (script_set_target): New function.
6994 * script-c.h (script_set_target): Declare.
6995 * options.cc (General_options::string_to_object_format): Rename
6996 from string_to_object_format in anonymous namespace. Change
6997 callers.
6998 * options.h (class General_options): Declare
6999 string_to_object_format.
7000
3ee173de
ILT
70012009-06-22 Ian Lance Taylor <iant@google.com>
7002
7003 * script-sections.cc (Script_sections::create_segments): Don't put
7004 program headers in a PT_LOAD segment if -n or -N.
7005
70062009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7007
7008 PR 10141
7009 * options.h (class General_options): Add -z lazy and -z now. Sort
7010 -z options into alphabetical order.
7011 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7012
cd6739a1 70132009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7014
7015 * layout.cc (Layout::make_output_section): Call
7016 Target::new_output_section.
7017 (Layout::attach_allocated_section_to_segment): Put large section
7018 sections in a separate load segment with the large segment flag
7019 set.
7020 (Layout::segment_precedes): Sort large data segments after other
7021 load segments.
7022 (align_file_offset): New static function.
7023 (Layout::set_segment_offsets): Use align_file_offset.
7024 * output.h (class Output_section): Add is_small_section_ and
7025 is_large_section_ fields.
7026 (Output_section::is_small_section): New function.
7027 (Output_section::set_is_small_section): New function.
7028 (Output_section::is_large_section): New function.
7029 (Output_section::set_is_large_section): New function.
7030 (Output_section::is_large_data_section): New function.
7031 (class Output_segment): Add is_large_data_segment_ field.
7032 (Output_segment::is_large_data_segment): New function.
7033 (Output_segment::set_is_large_data_segment): New function.
7034 * output.cc (Output_section::Output_section): Initialize new
7035 fields.
7036 (Output_segment::Output_segment): Likewise.
7037 (Output_segment::add_output_section): Add assertion that large
7038 data sections always go in large data segments. Force small data
7039 sections to the end of the list of data sections. Force small BSS
7040 sections to the start of the list of BSS sections. For large BSS
7041 sections to the end of the list of BSS sections.
7042 * symtab.h (class Symbol): Declare is_common_shndx.
7043 (Symbol::is_defined): Check Symbol::is_common_shndx.
7044 (Symbol::is_common): Likewise.
7045 (class Symbol_table): Define enum Commons_section_type. Update
7046 declarations. Add small_commons_ and large_commons_ fields.
7047 * symtab.cc (Symbol::is_common_shndx): New function.
7048 (Symbol_table::Symbol_table): Initialize new fields.
7049 (Symbol_table::add_from_object): Put small and large common
7050 symbols in the right list.
7051 (Symbol_table::sized_finalized_symbol): Check
7052 Symbol::is_common_shndx.
7053 (Symbol_table::sized_write_globals): Likewise.
7054 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7055 common symbol lists. Don't call do_allocate_commons_list if the
7056 list is empty.
7057 (Symbol_table::do_allocate_commons_list): Remove is_tls
7058 parameter. Add comons_section_type parameter. Change all
7059 callers. Handle small and large common symbols.
7060 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7061 Symbol::is_common_shndx.
7062 * resolve.cc (symbol_to_bits): Likewise.
7063 * target.h (Target::small_common_shndx): New function.
7064 (Target::small_common_section_flags): New function.
7065 (Target::large_common_shndx): New function.
7066 (Target::large_common_section_flags): New function.
7067 (Target::new_output_section): New function.
7068 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7069 small_common_section_flags, and large_common_section_flags
7070 fields.
7071 (Target::do_new_output_section): New virtual function.
7072 * arm.cc (Target_arm::arm_info): Initialize new fields.
7073 * i386.cc (Target_i386::i386_info): Likewise.
7074 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7075 Likewise.
7076 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7077 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7078 (Target_x86_64::do_new_output_section): New function.
7079 * configure.ac: Define conditional MCMODEL_MEDIUM.
7080 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7081 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7082 (large_LDFLAGS): Define.
7083 * testsuite/large.c: New file.
7084 * testsuite/testfile.cc (Target_test::test_target_info):
7085 Initialize new fields.
7086 * configure, testsuite/Makefile.in: Rebuild.
7087
bb04269c
DK
70882009-06-05 Doug Kwan <dougkwan@google.com>
7089
7090 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7091 * Makefile.in: Regenerate.
bb04269c
DK
7092 * i386.cc (class Target_i386): Define new virtual method to
7093 override do_is_local_label_name in parent.
7094 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7095 local symbols if --discard-locals or -X is given.
7096 * options.h (class General_options): Declare new options
7097 '--discard-locals' and '-X' for discarding locals.
7098 * target.h (class Target): Define new methods is_local_label_name.
7099 Declare new virtual method do_is_local_label_name.
7100 * target.cc: New file.
7101 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7102 (check_SCRIPTS): Add discard_locals_test.sh.
7103 (check_DATA): Add discard_local_tests.syms.
7104 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7105 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7106 * testsuite/Makefile.in: Regenerate.
7107 * testsuite/discard_locals_test.c: New file.
7108 * testsuite/discard_locals_test.sh: Same.
7109
805bb01c
DK
71102009-06-05 Doug Kwan <dougkwan@google.com>
7111
7112 * object.cc (Sized_relobj::Sized_relobj): Initialize
7113 discarded_eh_frame_shndx_ to -1U.
7114 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7115 section.
7116 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7117 a discarded .eh_frame section.
7118 (Sized_relobj::do_finalize_local_symbols): Ditto.
7119 * object.h (class Sized_relobj): Declare new member
7120 discarded_eh_frame_shndx_.
7121 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7122 (local_labels_test.o, local_labels_test): New rules.
7123 * testsuite/Makefile.in: Regenerate.
7124
1dcd334d
DK
71252009-06-04 Doug Kwan <dougkwan@google.com>
7126
7127 * layout.cc (Layout::section_name_mapping): Add mapping for
7128 special ARM sections.
7129
96d49306
DK
71302009-06-03 Doug Kwan <dougkwan@google.com>
7131
7132 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7133 (utils::has_overflow): Same.
7134
dff16297
ILT
71352009-06-03 Ian Lance Taylor <iant@google.com>
7136
7137 * layout.cc (Layout::section_name_mapping): New array, replacing
7138 Layout::linkonce_mapping.
7139 (Layout::section_name_mapping_count): New variable, replacing
7140 Layout::linkonce_mapping_count.
7141 (Layout::linkonce_output_name): Remove.
7142 (Layout::output_section_name): Rewrite.
7143 * layout.h (class Layout): Rename Linkonce_mapping to
7144 Section_name_mapping, linkonce_mapping to section_name_mapping,
7145 linkonce_mapping_count to section_name_mapping_count. Don't
7146 declare linkonce_output_name.
7147
c121c671
DK
71482009-06-03 Doug Kwan <dougkwan@google.com>
7149
7150 * gold/arm.cc (namespace utils): New.
7151 (Target_arm::reloc_is_non_pic): Define new method.
7152 (class Arm_relocate_functions): New.
7153 (Target_arm::Relocate::relocate): Handle relocation types used by
7154 Android.
7155
07800fab
ILT
71562009-06-03 Ian Lance Taylor <iant@google.com>
7157
7158 * arm.cc (Target_arm::scan::global): Use || instead of |.
7159
c121c671
DK
71602009-06-02 Doug Kwan <dougkwan@google.com>
7161
7162 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7163 issued_non_pic_error_.
7164 (class Target_arm::Scan): Declare new method check_non_pic.
7165 Define new method symbol_needs_plt_entry.
7166 Declare new data member issued_non_pic_error_.
7167 (class Target_arm::Relocate): Declare new method
7168 should_apply_static_reloc.
7169 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7170 (Target_arm::Scan::check_non_pic): Define new method.
7171 (Target_arm::Scan::local): Handle a small subset of reloc types used
7172 by Android.
7173 (Target_arm::Scan::local): Same.
7174 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7175
b19b0c6d
ILT
71762009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7177
7178 * incremental.cc (Incremental_inputs::report_command_line): Filter
7179 out --incremental-* options.
7180
94cdfcff
DK
71812009-05-29 Doug Kwan <dougkwan@google.com>
7182
7183 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7184 template class.
7185 (class Target_arm): Update comment.
7186 (Target_arm::Target_arm): Initialize new data members GOT_,
7187 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7188 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7189 and Target_arm::rel_dyn_section.
7190 Declare new_enum Target_arm::Got_type.
7191 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7192 and DYNBSS_.
7193 Update commments for member do_dynsym_value.
7194 (Target_arm::got_size, Target_arm::plt_section,
7195 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7196 new methods inside class defintion.
7197 (Target_arm::got_section): Define new method.
7198 (Target_arm::rel_dyn_section): Same.
7199 (Output_data_plt_arm): New template class.
7200 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7201 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7202 (Output_data_plt_arm::add_entry): Same.
7203 (Output_data_plt_arm::first_plt_entry): Define new
7204 static data member for PLT instruction template.
7205 (Output_data_plt_arm::plt_entry): Same.
7206 (Output_data_plt_arm::do_write): Define new method.
7207 (Target_arm::make_plt_entry): Same.
7208 (Target_arm::do_finalize_sections): Same.
7209 (Target_arm::do_dynsym_value): Same.
7210
4a657b0d
DK
72112009-05-28 Doug Kwan <dougkwan@google.com>
7212
7213 * Makefile.am (TARGETSOURCES): Add arm.cc.
7214 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7215 * Makefile.in: Regenerate.
7216 * arm.cc: New file.
7217 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7218
e7ae8c36
DK
72192009-05-26 Doug Kwan <dougkwan@google.com>
7220
7221 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7222 (General_options::check_excluded_libs): Strip off directories in
7223 archive name before matching like GNU ld does.
7224 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7225 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7226 (exclude_libs_test_LDFLAGS): Add linker option
7227 -Wl,--exclude-libs,libexclude_libs_test_3
7228 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7229 an explicit archive without using -l.
7230 (alt/libexclude_libs_test_3.a): New make rule.
7231 * testsuite/Makefile.in: Regenerate.
7232 * testsuite/exclude_libs_test.c : Declare lib3_default().
7233 (main): Call it.
7234 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
7235 * exclude_libs_test_3.c: New file.
7236
f12e7348
NC
72372009-05-26 Nick Clifton <nickc@redhat.com>
7238
7239 * po/id.po: New Indonesian translation.
7240 * po/gold.pot: Updated template file.
7241
4daadc0d
ST
72422009-05-22 Sriraman Tallam <tmsriram@google.com>
7243
e1df38aa 7244 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
7245 gc_comdat_test files. Add -Wl,--gc-sections to build
7246 gc_comdat_test.
7247 * testsuite/Makefile.in: Regenerate.
7248 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
7249
531813ad
ST
72502009-05-21 Sriraman Tallam <tmsriram@google.com>
7251
7252 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
7253 kept comdat section was garbage collected.
7254 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
7255 * testsuite/Makefile.in: Regenerate.
7256 * testsuite/gc_comdat_test.sh: New file.
7257 * testsuite/gc_comdat_test_1.cc: New file.
7258 * testsuite/gc_comdat_test_2.cc: New file.
7259
65514900
CC
72602009-05-19 Doug Kwan <dougkwan@google.com>
7261
7262 * archive.cc (Archive::Archive): Move constructor from archive.h
7263 to here. Initialize no_export_.
7264 (Archive::get_elf_object_for_member): Set no_export flag of object.
7265 * archive.h (Archive::Archive): Move constructor body to
7266 archive.cc.
7267 (Archive::no_export): New method.
7268 (Archive::no_export_): New field.
7269 * object.h (Object::Object): Initialize no_export_ to false.
7270 (Object::no_export, Object::set_no_export): New methods.
7271 (Object::no_export_): New field.
7272 * options.cc (General_options::parse_exclude_libs): New method.
7273 (General_options::check_excluded_libs) Same.
7274 * options.h (exclude_libs): New option.
7275 (General_options::check_excluded_libs): New method declaration.
7276 (General_options::excluded_libs_): New field.
7277 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
7278 default or protected visibility if an object has no-export flag set.
7279 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
7280 (check_SCRIPTS): Add exclude_libs_test.sh.
7281 (check_DATA): Add exclude_libs_test.syms.
7282 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
7283 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
7284 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
7285 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
7286 (exclude_libs_test.syms, libexclude_libs_test_1.a,
7287 libexclude_libs_test_2.a): New rules.
7288 * testsuite/Makefile.in: Regenerate.
7289 * testsuite/exclude_libs_test.c: New file.
7290 * testsuite/exclude_libs_test.sh: Ditto.
7291 * testsuite/exclude_libs_test_1.c: Ditto.
7292 * testsuite/exclude_libs_test_2.c: Ditto.
7293
1b77ea50
ILT
72942009-05-15 Ian Lance Taylor <iant@google.com>
7295
7296 * configure.ac: Check for declarations for cases where libiberty.h
7297 checks HAVE_DECL_xxx.
7298 * configure, config.in: Rebuild.
7299
072fe7ce
ILT
73002009-05-15 Mikolaj Zalewski <mikolajz@google.com>
7301
7302 * gold.h (Incremental_argument_list): Remove (invalid) forward
7303 declaration.
7304 * incremental.cc (Incremental_inputs::report_achive): New method.
7305 (Incremental_inputs::report_object): New method.
7306 (Incremental_inputs::report_script): New method.
7307 (Incremental_inputs::finalize_inputs): New method.
7308 (Incremental_inputs::finalize): Call finalize_inputs().
7309 (Incremental_inputs::sized_create_incremental_inputs_section_data):
7310 Create inputs entries.
7311 * incremental.h (Incremental_input_type): New enum.
7312 (Incremental_inputs::Incremental_input): Initialize new fields.
7313 (Incremental_inputs::report_inputs): New method.
7314 (Incremental_inputs::report_achive): New method.
7315 (Incremental_inputs::report_object): New method.
7316 (Incremental_inputs::report_script): New method.
7317 (Incremental_inputs::finalize_inputs): New method.
7318 (Incremental_inputs::Input_info): New struct.
7319 (Incremental_inputs::Input_info_map): New typedef.
7320 (Incremental_inputs::lock_): New field.
7321 (Incremental_inputs::Inputs_): New field.
7322 (Incremental_inputs::Inputs_map): New field.
7323 * main.cc (main): Call Incremental_input::report_inputs.
7324 * options.h (Input_argument_list): Typedef moved from
7325 Input_arguments.
7326 (Input_file_group::Files): Remove, use ::Input_argument_list.
7327 (Input_file_group::Input_argument_list): Remove, use
7328 ::Input_argument_list.
7329 * plugin.cc (Plugin_manager::add_input_file): Add error in
7330 incremental build.
7331 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
7332 functions.
7333 * script.cc (read_input_script): Call
7334 Incremental_input::report_script.
7335 * script.h (Script_info): New class.
7336
b0481b0b
ILT
73372009-04-27 Ian Lance Taylor <iant@google.com>
7338
7339 * x86_64.cc (do_adjust_output_section): Set entsize to
7340 plt_entry_size.
7341
b22a5a41 73422009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
7343
7344 * output.cc (Output_file::close): After short writes, continue
7345 writing from the correct offset in the buffer being written.
7346
40fde488
CD
73472009-04-23 Chris Demetriou <cgd@google.com>
7348
7349 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
7350 * configure: Regenerate.
7351 * config.in: Regenerate.
7352 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
7353 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
7354
3ce2c28e
ILT
73552009-04-21 Mikolaj Zalewski <mikolajz@google.com>
7356
7357 * incremental.cc (Incremental_inputs_header_data): Renamed from
7358 Incremental_input_header_data.
7359 (Incremental_inputs_header_data::data_size): New field.
7360 (Incremental_inputs_header_data::put_input_file_count): Renamed
7361 from input_file_count.
7362 (Incremental_inputs_header_data::put_command_line_offset): Renamed
7363 from command_line_offset.
7364 (Incremental_inputs_header_data::put_reserved): Renamed from
7365 put_reserved.
7366 (Incremental_inputs_entry_data): Renamed from
7367 Incremental_input_entry_data.
7368 (Incremental_inputs_entry_data::data_size): New field.
7369 (Incremental_inputs::report_command_line): New method.
7370 (Incremental_inputs::finalize): New method.
7371 (Incremental_inputs::create_incremental_inputs_data): New method.
7372 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
7373 * incremental.h: New file.
7374 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
7375 (Layout::finalize): Create incremental inputs section in
7376 incremental builds.
7377 (Layout::create_incremental_info_sections): New method.
7378 * layout.h (Layout::incremental_inputs): New method.
7379 (Layout::create_incremental_info_sections): New method.
7380 (Layout::incremental_inputs_): New field.
7381 * main.cc (main): Notify Incremental_input of the command line.
7382
e55bde5e
ILT
73832009-04-01 Ian Lance Taylor <iant@google.com>
7384 Mikolaj Zalewski <mikolajz@google.com>
7385
7386 * gold.h (reserve_unordered_map): Define, three versions, one for
7387 each version of Unordered_map.
7388 * layout.cc (Layout::Layout): Remove options parameter. Add
7389 number_of_input_files parameter. Don't initialize options_.
7390 Initialize number_of_input_files_ and resized_signatures_. Move
7391 sections_are_attached_.
7392 (Layout::layout_group): Reserve space for group_signatures_.
7393 (Layout::find_or_add_kept_section): Change name parameter to be a
7394 reference. Resize signatures_ map when it gets large enough.
7395 (Layout::layout_eh_frame): Use parameters->options() instead of
7396 this->options_.
7397 (Layout::make_output_section): Likewise.
7398 (Layout::attach_allocated_section_to_segment): Likewise.
7399 (Layout::finalize, Layout::create_executable_stack): Likewise.
7400 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
7401 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
7402 * layout.h (class Layout): Update declarations. Remove options_
7403 field. Add number_of_input_files_ and resized_signatures_
7404 fields. Move sections_are_attached_ field.
7405 * main.cc (main): Pass number of input files to Layout
7406 constructor. Don't pass options.
7407
154b857c
ILT
74082009-03-30 Ian Lance Taylor <iant@google.com>
7409
7410 * ffsll.c (ffsll): Correct implementation.
7411
2f35ab9b
ILT
74122009-03-27 Ian Lance Taylor <iant@google.com>
7413
fd03461a
ILT
7414 * ffsll.c: New file.
7415 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
7416 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
7417 * ftruncate.c (ftruncate): Declare before definition.
7418 * mremap.c (mremap): Likewise.
7419 * pread.c (pread): Likewise.
7420 * configure, Makefile.in, config.in: Rebuild.
7421
2f35ab9b
ILT
7422 * mremap.c: New file.
7423 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
7424 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
7425 (mremap): Declare if HAVE_MREMAP is not defined.
7426 * configure, Makefile.in, config.in: Rebuild.
7427
33aea2fd
CC
74282009-03-27 Cary Coutant <ccoutant@google.com>
7429
7430 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
7431 position independent.
7432 * sparc.cc (Target_sparc::check_non_pic): Likewise.
7433 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
7434
6d479619
CC
74352009-03-24 Cary Coutant <ccoutant@google.com>
7436
7437 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
7438 an executable.
7439 (needs_dynamic_reloc): Likewise.
7440
afc06bb8
ILT
74412009-03-24 Ian Lance Taylor <iant@google.com>
7442
7443 * yyscript.y (file_cmd): Recognize EXTERN.
7444 (extern_name_list, extern_name_list_body): New nonterminals.
7445 * script.cc (script_add_extern): Define.
7446 * script-c.h (script_add_extern): Declare.
7447
f6060a4d
ILT
74482009-03-24 Rafael Avila de Espindola <espindola@google.com>
7449
7450 * object.cc (is_elf_object): Define.
7451 * object.h (is_elf_object): Declare.
7452 * archive.cc (Archive::get_elf_object_for_member): Call
7453 is_elf_object.
33aea2fd 7454 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 7455
26736d8e
ILT
74562009-03-24 Elliott Hughes <enh@google.com>
7457
7458 * output.cc (Output_file::map_anonymous): Define.
7459 (Output_file::map): Use map_anonymous. If the regular mmap fails,
7460 try an anonymous one. Report the size if the mmap fails.
7461 * output.h (class Output_file): Declare map_anonymous.
7462
22fd9730
ILT
74632009-03-24 Ian Lance Taylor <iant@google.com>
7464
7465 * target-select.cc (instantiate_target): Don't acquire the lock if
7466 the instantiated_target_ field has already been set.
7467
cb010894
ILT
74682009-03-23 Ian Lance Taylor <iant@google.com>
7469
7f055c20
ILT
7470 * gold-threads.h (class Initialize_lock): Define.
7471 * gold-threads.cc (class Initialize_lock_once): Define.
7472 (initialize_lock_control): New static variable.
7473 (initialize_lock_pointer): New static variable.
7474 (initialize_lock_once): New static function.
7475 (Initialize_lock::Initialize_lock): Define.
7476 (Initialize_lock::initialize): Define.
7477 * target-select.h: Include "gold-threads.h".
7478 (class Target_selector): Add lock_ and initialize_lock_ fields.
7479 Don't define instantiate_target, just declare it.
7480 * target-select.cc (Target_selector::Target_selector): Initialize
7481 new fields.
7482 (Target_selector::instantiate_target): Define.
7483 * descriptors.h: Include "gold-threads.h".
7484 (class Descriptors): Add initialize_lock_ field.
7485 * descriptors.cc (Descriptors::Descriptors): Initialize new
7486 field.
7487 (Descriptors::open): Use initialize_lock_ field
7488 * errors.h (class Errors): Add initialize_lock_ field.
7489 * errors.cc (Errors::Errors): Initialize new field.
7490 (Errors::initialize_lock): Use initialize_lock_ field.
7491 * powerpc.cc (class Target_selector_powerpc): Remove
7492 instantiated_target_ field. In do_recognize call
7493 instantiate_target rather than do_instantiate_target. In
7494 do_instantiate_target just allocate a new target.
7495 * sparc.cc (class Target_selector_sparc): Likewise.
7496
36959681
ILT
7497 * freebsd.h: New file.
7498 * i386.cc: Include "freebsd.h".
7499 (Target_i386): Derive from Target_freebsd rather than
7500 Sized_target.
7501 (Target_selector_i386): Derive from Target_selector_freebsd rather
7502 than Target_selector.
7503 * x86_64.cc: Include "freebsd.h".
7504 (Target_x86_64): Derive from Target_freebsd rather than
7505 Sized_target.
7506 (Target_selector_x86_64): Derive from Target_selector_freebsd
7507 rather than Target_selector.
7508 * target.h (class Target): Add adjust_elf_header and
7509 do_adjust_elf_header.
7510 * output.cc (Output_file_header:: do_sized_write): Call target
7511 adjust_elf_header routine.
7512 * configure.tgt: Set targ_osabi.
7513 * configure.ac: Define GOLD_DEFAULT_OSABI.
7514 * parameters.cc (Parameters::default_target): Pass
7515 GOLD_DEFAULT_OSABI to select_target.
7516 * target-select.h (class Target_selector): Make instantiate_target
7517 protected rather than private.
7518 * Makefile.am (HFILES): Add freebsd.h.
7519 * configure, Makefile.in, config.in: Rebuild.
7520
cb010894
ILT
7521 * merge.cc (do_add_input_section): Correct pend value. Change
7522 message about last entry not being null terminated from error to
7523 warning.
7524
0e879927
ILT
75252009-03-20 Mikolaj Zalewski <mikolajz@google.com>
7526
7527 * incremental.cc: New file.
7528 * Makefile.am (CCFILES): Add incremental.cc.
7529 * Makefile.in: Rebuild.
7530
41105937
PP
75312009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
7532
7533 * layout.cc (Layout::output_section_name): Preserve names
7534 of '.note.' sections.
e1df38aa 7535
60439920
ILT
75362009-03-19 Ian Lance Taylor <iant@google.com>
7537
7538 * descriptors.cc (Descriptors::open): Check that the options are
7539 valid before using them.
7540
0d371ad3
ILT
75412009-03-18 Ian Lance Taylor <iant@google.com>
7542
7543 * script-sections.h: Include <list>.
7544 (class Script_sections): Change Sections_elements from std::vector
7545 to std::list. Typedef public Elements_iterator. Add
7546 orphan_section_placement_, data_segment_align_start_, and
7547 saw_data_segment_align_ fields. Remove data_segment_align_index_
7548 field.
7549 * script-sections.cc (class Orphan_section_placement): New class.
7550 (class Sections_element): Add virtual functions is_relro and
7551 orphan_section_init. Remove virtual function place_orphan_here.
7552 (class Output_section_definition): Add is_relro and
7553 orphan_section_init. Remove place_orphan_here.
7554 (class Orphan_output_section): Likewise.
7555 (Script_sections::Script_sections): Update for field changes.
7556 (Script_sections::data_segment_align): Set saw_data_segment_align_
7557 and data_segment_align_start_, not data_segment_align_index.
7558 (Script_sections::data_segment_relro_end): Check
7559 saw_data_segment_align_. Use data_segment_align_start_ rather
7560 than data_segment_align_index_.
7561 (Script_sections::place_orphan): Rewrite to use
7562 Orphan_section_placement.
7563
9201d894
ILT
75642009-03-17 Ian Lance Taylor <iant@google.com>
7565
9c5b8369
ILT
7566 * archive.cc (Archive::add_symbols): Check for a version attached
7567 to the symbol name in the archive map.
7568 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
7569 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
7570 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
7571 (ver_test_11.a): New target.
7572 * testsuite/Makefile.in: Rebuild.
7573
9201d894
ILT
7574 * configure.ac: Check for chsize and posix_fallocate. Replace
7575 ftruncate.
7576 * ftruncate.c: New file, from gnulib.
7577 * output.cc (posix_fallocate): Define dummy version if not
7578 HAVE_POSIX_FALLOCATE.
7579 (Output_file::map): Call posix_fallocate rather than lseek and
7580 write.
7581 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
7582 * configure, Makefile.in, config.in: Rebuild.
7583
ef4ab7a8 75842009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 7585
ef4ab7a8
PP
7586 * layout.h (Layout::create_note): Add section_name parameter.
7587 * layout.cc (Layout::create_note): Likewise.
7588 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 7589
8c500701
ILT
75902009-03-17 Ian Lance Taylor <iant@google.com>
7591
e85b18e1
ILT
7592 * descriptors.cc: Include "options.h".
7593 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
7594 (Descriptors::open): Always use O_CLOEXEC when opening a new
7595 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
7596 then set FD_CLOEXEC.
7597
9efe6174
ILT
7598 * sparc.cc (class Target_sparc): Add has_got_section.
7599 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
7600 make sure we have a GOT section.
7601
7602 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
7603 (Target_sparc::Scan::local): Likewise.
7604 (Target_sparc::Scan::global): Likewise.
7605 (Target_sparc::Relocate::relocate): Likewise.
7606 (Target_sparc::Relocate::relocate_tls): Likewise.
7607
8c500701
ILT
7608 * symtab.cc (Symbol_table::define_default_version): New function,
7609 broken out of add_from_object.
7610 (Symbol_table::add_from_object): Call define_default_version.
7611 (Symbol_table::define_special_symbol): Add resolve_oldsym
7612 parameter. Change all callers. If the version for a symbol comes
7613 from a version script, resolve it with the symbol with the same
7614 name with no version. Also add the symbol without a version if
7615 appropriate.
7616 (do_define_in_output_data): If resolving with oldsym, don't delete
7617 sym.
7618 (do_define_in_output_segment): Likewise.
7619 (do_define_as_constant): Likewise.
7620 * symtab.h (class Symbol_table): Update declarations.
7621
f1ed28fb
ILT
76222009-03-13 Ian Lance Taylor <iant@google.com>
7623
15f8229b
ILT
7624 * readsyms.cc (Read_symbols::incompatible_warning): New function.
7625 (Read_symbols::requeue): New function.
7626 (Read_symbols::do_read_symbols): If make_elf_object fails because
7627 the target type is not configured, and the file was searched for,
7628 issue a warning and retry with the next directory.
7629 (Add_symbols::run): If the file has an incompatible format, and
7630 it was searched for, requeue the Read_symbols task. On error,
7631 release the object.
7632 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
7633 dirindex parameter to constructor. Change all callers. Declare
7634 incompatible_warning and requeue.
7635 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
7636 input_argument_ and input_group_ fields. Add them to
7637 constructor. Change all callers.
7638 (class Read_script): Add dirindex_ field. Add it to constructor.
7639 Change all callers.
7640 * archive.cc (Archive::setup): Remove input_objects parameter.
7641 Change all callers.
7642 (Archive::get_file_and_offset): Likewise.
7643 (Archive::read_all_symbols): Likewise.
7644 (Archive::read_symbols): Likewise.
7645 (Archive::get_elf_object_for_member): Remove input_objects
7646 parameter. Add punconfigured parameter. Change all callers.
7647 (Archive::add_symbols): Change return type to bool. Check return
7648 value of include_member.
7649 (Archive::include_all_members): Likewise.
7650 (Archive::include_member): Change return type to bool. Return
7651 false if first included object has incompatible target. Set
7652 included_member_ field.
7653 (Add_archive_symbols::run): If add_symbols returns false, requeue
7654 Read_symbols task.
7655 * archive.h (class Archive): Add included_member_ field.
7656 Initialize it in constructor. Add input_file and searched_for
7657 methods. Update declarations.
7658 (class Add_archive_symbols): Add dirpath_, dirindex_, and
7659 input_argument_ fields. Add them to constructor. Change all
7660 callers.
7661 * script.cc: Include "target-select.h".
7662 (class Parser_closure): Add skip_on_incompatible_target_ and
7663 found_incompatible_target_ fields. Add
7664 skip_on_incompatible_target parameter to constructor. Change all
7665 callers. Add methods skip_on_incompatible_target,
7666 clear_skip_on_incompatible_target, found_incompatible_target, and
7667 set_found_incompatible_target.
7668 (read_input_script): Add dirindex parameter. Change all callers.
7669 If parser finds an incompatible target, requeue Read_symbols
7670 task.
7671 (script_set_symbol): Clear skip_on_incompatible_target in
7672 closure.
7673 (script_add_assertion, script_parse_option): Likewise.
7674 (script_start_sections, script_add_phdr): Likewise.
7675 (script_check_output_format): New function.
7676 * script.h (read_input_script): Update declaration.
7677 * script-c.h (script_check_output_format): Declare.
7678 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
7679 (ignore_cmd): Remove OUTPUT_FORMAT.
7680 * fileread.cc (Input_file::Input_file): Add explicit this.
7681 (Input_file::will_search_for): New function.
7682 (Input_file::open): Add pindex parameter. Change all callers.
7683 * fileread.h (class Input_file): Add input_file_argument method.
7684 Declare will_search_for. Update declarations.
7685 * object.cc (make_elf_object): Add punconfigured parameter.
7686 Change all callers.
7687 * object.h (class Object): Make input_file public. Add
7688 searched_for method.
7689 (make_elf_object): Update declaration.
7690 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
7691 restart search.
7692 * dirsearch.h (class Dirsearch): Update declaration.
7693 * options.h (class General_options): Add --warn-search-mismatch.
7694 * parameters.cc (Parameters::is_compatible_target): New function.
7695 * parameters.h (class Parameters): Declare is_compatible_target.
7696 * workqueue.cc (Workqueue::add_blocker): New function.
7697 * workqueue.h (class Workqueue): Declare add_blocker.
7698
f1ed28fb
ILT
7699 * fileread.cc (Input_file::open): Remove options parameter.
7700 Change all callers.
7701 (Input_file::open_binary): Likewise.
7702 * script.cc (read_input_script): Likewise.
7703 * readsyms.h (class Read_symbols): Remove options_ field. Remove
7704 options parameter from constructor. Change all callers.
7705 (class Read_script): Likewise.
7706 * fileread.h (class Input_file): Update declarations.
7707 * script.h (read_input_script): Update declaration.
7708
34dd024a
NC
77092009-03-10 Nick Clifton <nickc@redhat.com>
7710
7711 * po/es.po: New Spanish translation.
7712
6d71b17c
CC
77132009-03-06 Cary Coutant <ccoutant@google.com>
7714
7715 * options.cc (parse_short_option): Keep dash_z from registering itself.
7716
031cdbed
ILT
77172009-03-03 Ian Lance Taylor <iant@google.com>
7718
7719 PR 9918
7720 * target-reloc.h (relocate_section): Pass output_section to
7721 relocate.
7722 * i386.cc (Target_i386::should_apply_static_reloc): Add
7723 output_section parameter. Change all callers.
7724 (Target_i386::Relocate::relocate): Add output_section parameter.
7725 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7726 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
7727 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
7728 * testsuite/two_file_shared.sh: New script.
7729 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
7730 (check_DATA): Add two_file_shared.dbg.
7731 (two_file_shared.dbg): New target.
7732 * testsuite/Makefile.in: Rebuild.
7733
15d5fa16
ILT
77342009-03-01 Ian Lance Taylor <iant@google.com>
7735
7736 * configure.ac: Check for byteswap.h.
7737 * configure: Rebuild.
7738 * config.in: Rebuild.
7739
8a4c0b0d
ILT
77402009-03-01 Mikolaj Zalewski <mikolajz@google.com>
7741
7742 * layout.cc (Layout::find_or_add_kept_section): New function.
7743 (Layout::add_comdat): Removed.
7744 * layout.h (struct Kept_section): Move out of class Layout.
7745 Remove trailing underscores from field names. Add group_sections
7746 field. Rename group_ field to is_group. Change all uses.
7747 (class Layout): Declare find_or_add_kept_section, not add_comdat.
7748 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
7749 comdat_groups_ field.
7750 (Sized_relobj::include_section_group): Use
7751 find_or_add_kept_section and Kept_section::group_sections.
7752 (Sized_relobj::include_linkonce_section): Likewise.
7753 * object.cc (class Sized_relobj): Don't define Comdat_group or
7754 Comdat_group_table. Remove find_comdat_group and
7755 add_comdat_group. Remove comdat_groups_ field.
7756 * plugin.cc (include_comdat_group): Use
7757 Layout::find_or_add_kept_section.
7758
b4ecf66b
ILT
77592009-02-28 Ian Lance Taylor <iant@google.com>
7760
14359ca0
ILT
7761 * README: --gc-sections and map files are now supported. Document
7762 some build requirements.
7763
b4ecf66b
ILT
7764 PR 6992
7765 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
7766 relocatable link set the value of the section symbol to zero.
7767 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
7768 relocatable link don't include the section address in the local
7769 symbol value.
7770
0602e05a
ILT
77712009-02-27 Ian Lance Taylor <iant@google.com>
7772
fd9d194f
ILT
7773 PR 6811
7774 * options.h (class Search_directory): Add is_system_directory.
7775 (class General_options): Declare is_in_system_directory.
7776 * options.cc (get_relative_sysroot): Make static.
7777 (get_default_sysroot): Make static.
7778 (General_optoins::is_in_system_directory): New function.
7779 * fileread.cc (Input_file::is_in_system_directory): New function.
7780 * fileread.h (class Input_file): Declare is_in_system_directory.
7781 * object.h (class Object): Add is_in_system_directory.
7782 (class Input_objects): Remove system_library_directory_ field.
7783 * object.cc (Input_objects::add_object): Don't set
7784 system_library_directory_.
7785 (input_objects::found_in_system_library_directory): Remove.
7786 * symtab.cc (Symbol_table::write_globals): Remove input_objects
7787 parameter. Change all callers.
7788 (Symbol_table::sized_write_globals): Likewise.
7789 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
7790 Call Object::is_in_system_directory.
7791 * symtab.h (class Symbol_table): Update declarations.
7792
61edd21f
ILT
7793 PR 5990
7794 * descriptors.h (Open_descriptor): Add is_on_stack field.
7795 * descriptors.cc (Descriptors::open): If the descriptor is on the
7796 top of the stack, remove it. Initialize is_on_stack field.
7797 (Descriptors::release): Only add pod to stack if it is not on the
7798 stack already.
7799 (Descriptors::close_some_descriptor): Clear stack_next and
7800 is_on_stack fields.
7801
e29e076a
ILT
7802 PR 7091
7803 * output.cc (Output_section::find_starting_output_address): Rename
7804 from starting_output_address; add PADDR parameter; change return
7805 type.
7806 * output.h (class Output_section): Declare
7807 find_starting_output_address instead of starting_output_address.
7808 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
7809 section symbol for which we can't find a merge section.
7810
0602e05a
ILT
7811 PR 9836
7812 * symtab.cc (Symbol_table::add_from_object): If the visibility is
7813 hidden or internal, force the symbol to be local.
7814 * resolve.cc (Symbol::override_visibility): Define.
7815 (Symbol::override_base): Use override_visibility.
7816 (Symbol_table::resolve): Likewise.
7817 (Symbol::override_base_with_special): Likewise.
7818 (Symbol_table::override_with_special): If the visibility is hidden
7819 or internal, force the symbol to be local.
7820 * symtab.h (class Symbol): Add set_visibility and
7821 override_visibility.
7822 * testsuite/ver_test_1.sh: New file.
7823 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
7824 (check_DATA): Add ver_test_1.syms.
7825 (ver_test_1.syms): New target.
7826 * testsuite/Makefile.in: Rebuild.
7827
401a9a73
CC
78282009-02-25 Cary Coutant <ccoutant@google.com>
7829
7830 * layout.cc (Layout::choose_output_section): Don't rename sections
7831 when using a linker script that has a SECTIONS clause.
7832 * Makefile.in: Regenerate.
7833
7834 * testsuite/Makefile.am (script_test_5.sh): New test case.
7835 * testsuite/Makefile.in: Regenerate.
7836 * testsuite/script_test_5.cc: New file.
7837 * testsuite/script_test_5.sh: New file.
7838 * testsuite/script_test_5.t: New file.
7839
f488e4b0
CC
78402009-02-13 Rafael Avila de Espindola <espindola@google.com>
7841
7842 * archive.cc (Archive::include_member): Update calls to add_symbols.
7843 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
7844 the Layout argument.
7845 * dynobj.h (do_add_symbols): Add the Layout argument.
7846 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
7847 Layout argument.
7848 * object.h (Object::add_symbols): Add the Layout argument.
7849 (Object::do_add_symbols): Add the Layout argument.
7850 (Sized_relobj::do_add_symbols): Add the Layout argument.
7851 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
7852 Unify the two versions.
7853 (Add_plugin_symbols): Remove.
7854 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
7855 (Sized_pluginobj::do_add_symbols): Unify the two versions.
7856 (Add_plugin_symbols): Remove.
7857 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
7858 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
7859 (Add_symbols::run): Make it work with Pulginobj.
7860
89dd1680
ILT
78612009-02-06 Ian Lance Taylor <iant@google.com>
7862
7863 * object.cc (Sized_relobj::do_layout): Make info message start
7864 with lower case letter.
7865
266d0a74
ILT
78662009-02-06 Mikolaj Zalewski <mikolajz@google.com>
7867
602b464e
ILT
7868 * binary.cc: Fix file comment.
7869
266d0a74
ILT
7870 * options.h (enum Incremental_disposition): Define.
7871 (class General_options): Add new options: --incremental,
7872 --incremental_changed, --incremental_unchanged,
7873 --incremental_unknown. Add incremental_disposition_ and
7874 implicit_incremental_ fields.
7875 (General_options::incremental_disposition): New function.
7876 (class Position_dependent_options): Add incremental_disposition
7877 option.
7878 (Position_dependent_options::copy_from_options): Set incremental
7879 dispositions.
7880 * options.cc (General_options::parse_incremental_changed): New
7881 function.
7882 (General_options::parse_incremental_unchanged): New function.
7883 (General_options::parse_incremental_unknown): New function.
7884 (General_options::General_options): Initialize new fields
7885 incremental_disposition_ and implicit_incremental_.
7886 (General_options::finalize): Check for uasge of --incremental-*
7887 without --incremental.
7888
f073bbf7
CD
78892009-02-06 Chris Demetriou <cgd@google.com>
7890
7891 * gold.h (gold_undefined_symbol): Change to take only a Symbol
7892 pointer and to report location as the file name associated with
7893 the symbol.
7894 (gold_undefined_symbol_at_location): New function to replace the
7895 old gold_undefined_symbol functionality.
7896 * target-reloc.h (relocate_section): Update to use
7897 gold_undefined_symbol_at_location.
7898 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
7899 Call gold_undefined_symbol function rather than gold_error.
7900 * errors.h (Errors::undefined_symbol): Take location as a
7901 string, rather than calculating it from a relocation.
7902 * errors.cc (Errors::fatal): Print "fatal error:" before the
7903 formatted message.
7904 (Errors::error, Errors::error_at_location): Print "error: "
7905 before the formatted message.
7906 (Errors::undefined_symbol): Take location as a string, rather
7907 than calculating it from a relocation.
7908 (gold_undefined_symbol_at_location): New function akin to
7909 old gold_undefined_symbol, calculates location from relocation.
7910 (gold_undefined_symbol): Change to take only a Symbol pointer
7911 and to report location as the file name associated with the symbol.
7912 * testsuite/debug_msg.sh: Update for changed error messages.
7913 * testsuite/undef_symbol.sh: Likewise.
7914
8e94a90c
ILT
79152009-02-04 Duncan Sands <baldrick@free.fr>
7916
7917 PR 9812
7918 * reduced_debug_output.h
7919 (Output_reduced_debug_abbrev_section::failed): Use format for
7920 gold_warning.
7921 (Output_reduced_debug_info_section::faild): Likewise.
7922
88a0e15b
ILT
79232009-01-31 Mikolaj Zalewski <mikolajz@google.com>
7924
7925 * script.cc (Lazy_demangler): New class.
7926 (Version_script_info::get_symbol_version_helper): Demangle a
7927 symbol only once.
7928
5efc7cd2
CC
79292009-01-29 Cary Coutant <ccoutant@google.com>
7930
7931 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
7932 to __tls_get_addr.
7933 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7934
e0ebcf42
ILT
79352009-01-28 Ian Lance Taylor <iant@google.com>
7936
5efc7cd2 7937 * version.cc (version_string): Bump to 1.9.
75fe7426 7938
e0ebcf42
ILT
7939 * gold.h: Include <cstring> and <stdint.h>.
7940 * version.cc: Include <cstdio>.
7941 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
7942 warning.
7943 * reduced_debug_output.cc (insert_into_vector): Rename from
7944 Insert_into_vector; change all callers. Use Swap_unaligned to
7945 avoid aliasing issue; remove union since it is unnecessary.
7946
8e2813be 79472009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
7948
7949 * Makefile.am (CCFILES): Add gc.cc.
7950 (HFILES): Add gc.h.
7951 * Makefile.in: Regenerate.
7952 * gold.cc (Gc_runner): New class.
7953 (queue_initial_tasks): Call garbage collection related tasks
7954 when corresponding options are invoked.
7955 (queue_middle_gc_tasks): New function.
7956 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
7957 processed early before laying out sections during garbage collection.
7958 * gold.h (queue_middle_gc_tasks): New function.
7959 (is_prefix_of): Move from "layout.cc".
7960 * i386.cc (Target_i386::gc_process_relocs): New function.
7961 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
7962 * main.cc (main): Create object of class "Garbage_collection".
7963 * object.cc (Relobj::copy_symbols_data): New function.
7964 (Relobj::is_section_name_included): New function.
e1df38aa
NC
7965 (Sized_relobj::do_layout): Allow this function to be called twice
7966 during garbage collection and defer layout of section during the
6d03d481
ST
7967 first call.
7968 * object.h (Relobj::get_symbols_data): New function.
7969 (Relobj::is_section_name_included): New function.
7970 (Relobj::copy_symbols_data): New function.
7971 (Relobj::set_symbols_data): New function.
7972 (Relobj::get_relocs_data): New function.
7973 (Relobj::set_relocs_data): New function.
7974 (Relobj::is_output_section_offset_invalid): New pure virtual function.
7975 (Relobj::gc_process_relocs): New function.
7976 (Relobj::do_gc_process_relocs): New pure virtual function.
7977 (Relobj::sd_): New data member.
7978 (Sized_relobj::is_output_section_offset_invalid): New function.
7979 (Sized_relobj::do_gc_process_relocs): New function.
7980 * options.h (General_options::gc_sections): Modify to not be a no-op.
7981 (General_options::print_gc_sections): New option.
7982 * plugin.cc (Plugin_finish::run): Remove function call to
7983 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
7984 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
7985 * reloc.cc (Read_relocs::run): Add task to process relocs and
7986 determine unreferenced sections when doing garbage collection.
7987 (Gc_process_relocs): New class.
7988 (Sized_relobj::do_gc_process_relocs): New function.
7989 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
7990 sections that are garbage collected.
7991 * reloc.h (Gc_process_relocs): New class.
7992 * sparc.cc (Target_sparc::gc_process_relocs): New function.
7993 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
7994 symbols whose corresponding sections are garbage collected.
7995 (Symbol_table::Symbol_table): Add new parameter for the garbage
7996 collection object.
7997 (Symbol_table::gc_mark_undef_symbols): New function.
7998 (Symbol_table::gc_mark_symbol_for_shlib): New function.
7999 (Symbol_table::gc_mark_dyn_syms): New function.
8000 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8001 as garbage.
8002 (Symbol_table::add_from_object): Likewise.
8003 (Symbol_table::add_from_relobj): When building shared objects, do not
8004 treat externally visible symbols as garbage.
8005 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8006 table information for static and relocatable links.
8007 * symtab.h (Symbol_table::set_gc): New function.
8008 (Symbol_table::gc): New function.
8009 (Symbol_table::gc_mark_undef_symbols): New function.
8010 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8011 (Symbol_table::gc_mark_dyn_syms): New function.
8012 (Symbol_table::gc_): New data member.
e1df38aa 8013 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8014 function.
8015 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8016 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8017
3b293544
CF
80182009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8019
8020 * options.h (General_options::gc_sections): Define as a no-op for now.
8021 (General_options::no_keep_memory): Ditto.
8022 (General_options::Bshareable): Define.
8023 * options.cc (General_options::finalize): Honor -Bshareable.
8024
83d22aa8
AS
80252009-01-20 Andreas Schwab <schwab@suse.de>
8026
8027 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8028 read the value in the contents, since we don't use it. Use the
8029 template endianness when writing.
8030 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8031
cd536b21
AS
80322009-01-19 Andreas Schwab <schwab@suse.de>
8033
8034 * configure.tgt (powerpc64-*): Fix targ_obj.
8035
99e9a495
ILT
80362009-01-15 Ian Lance Taylor <iant@google.com>
8037
8038 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8039 local symbols when stripping all symbols.
8040
bbbfea06
CC
80412009-01-14 Cary Coutant <ccoutant@google.com>
8042
99e9a495 8043 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8044
0f7c0701
CC
80452009-01-14 Cary Coutant <ccoutant@google.com>
8046
8047 * archive.cc (Archive::get_elf_object_for_member): Remove call
8048 to File_read::claim_for_plugin.
8049 * descriptors.cc (Descriptors::open): Remove reference to
8050 is_claimed.
8051 (Descriptors::claim_for_plugin): Remove.
8052 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8053 (Descriptors::is_claimed): Remove.
8054 (claim_descriptor_for_plugin): Remove.
8055 * fileread.cc (File_read::claim_for_plugin): Remove.
8056 * fileread.h (File_read::claim_for_plugin): Remove.
8057 (File_read::descriptor): Reopen descriptor if necessary.
8058 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8059 (Plugin_manager::all_symbols_read): Add task parameter. Change
8060 all callers.
8061 (Plugin_manager::get_input_file): New function.
8062 (Plugin_manager::release_input_file): New function.
8063 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8064 corresponding data member.
8065 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8066 and pass to base constructor. Change all callers.
8067 (get_input_file, release_input_file): New functions.
8068 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8069 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8070 (Plugin_manager::all_symbols_read): Add task parameter.
8071 (Plugin_manager::get_input_file): New function.
8072 (Plugin_manager::release_input_file): New function.
8073 (Plugin_manager::task_): New data member.
8074 (Pluginobj::Pluginobj): Add filesize parameter.
8075 (Pluginobj::filename): New function.
8076 (Pluginobj::descriptor): New function.
8077 (Pluginobj::filesize): New function.
8078 (Pluginobj::filesize_): New data member.
8079 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8080 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8081 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8082
8083 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8084 with archive libraries.
8085 * testsuite/Makefile.in: Regenerate.
8086 * testsuite/plugin_test.c (struct sym_info): New type.
8087 (get_input_file, release_input_file): New static variables.
8088 (onload): Capture new transfer vector entries.
8089 (claim_file_hook): Stop reading at end of file according to filesize.
8090 Factor out parsing of readelf output into separate function.
8091 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8092 APIs and get the source file name from the symbol table. Convert
8093 source file name to corresponding object file name. Print info
8094 message when adding new input files.
8095 (parse_readelf_line): New function.
8096 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8097 * testsuite/plugin_test_2.sh: Likewise.
8098 * testsuite/plugin_test_3.sh: Likewise.
8099 * testsuite/plugin_test_4.sh: New test case.
8100
62a6d109
ILT
81012009-01-07 Ian Lance Taylor <iant@google.com>
8102
8103 * version.cc (version_string): Bump to 1.8.
8104
483620e8
CC
81052008-12-23 Cary Coutant <ccoutant@google.com>
8106
8107 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8108 * plugin.cc (Plugin_manager::finish): Rename as
8109 layout_deferred_objects. Move cleanup to separate function.
8110 (Plugin_manager::cleanup): New function.
8111 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8112 separately.
8113 * plugin.h (Plugin_manager::finish): Rename as
8114 layout_deferred_objects.
8115 (Plugin_manager::cleanup): New function.
8116 (Plugin_manager::cleanup_done): New field.
8117
d66a9eb3
CC
81182008-12-23 Cary Coutant <ccoutant@google.com>
8119
8120 * plugin.cc (is_visible_from_outside): New function.
8121 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8122 so we don't return "IR only" status for exported symbols or -r links.
8123
8124 * testsuite/Makefile.am (plugin_test_3): New test case.
8125 * testsuite/Makefile.in: Regenerate.
8126 * testsuite/plugin_test_3.sh: New file.
8127
5995b570
CC
81282008-12-22 Cary Coutant <ccoutant@google.com>
8129
8130 * object.cc (Sized_relobj::layout_section): New function.
8131 (Sized_relobj::do_layout): Defer layout of input sections until after
8132 plugin has provided replacement files.
8133 (Sized_relobj::do_layout_deferred_sections): New function.
8134 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8135 (Relobj::layout_deferred_sections): New function.
8136 (Relobj::do_layout_deferred_sections): New function.
8137 (Sized_relobj::do_layout_deferred_sections): New function.
8138 (Sized_relobj::layout_section): New function.
8139 (Sized_relobj::Deferred_layout): New structure.
8140 (Sized_relobj::deferred_layout_): New field.
8141 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8142 Change all callers. Layout deferred sections.
8143 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8144 references.
8145 (Plugin_hook::run): Move code from do_plugin_hook inline.
8146 (Plugin_hook::do_plugin_hook): Remove.
8147 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8148 (Plugin_manager::finish): Renamed, was cleanup.
8149 (Plugin_manager::should_defer_layout): New function.
8150 (Plugin_manager::add_deferred_layout_object): New function.
8151 (Plugin_manager::Deferred_layout_list): New type.
8152 (Plugin_manager::deferred_layout_objects_): New field.
8153 (Plugin_hook::do_plugin_hook): Remove.
8154
ee769c88
ILT
81552008-12-17 Ian Lance Taylor <iant@google.com>
8156
8157 * options.h (class General_options): Add --no case for
8158 --export-dynamic.
8159
abc8dcba
CC
81602008-12-16 Cary Coutant <ccoutant@google.com>
8161
8162 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8163 vector.
8164 (Plugin_manager::claim_file): Create plugin object even if
8165 plugin did not call the add_symbols callback.
8166 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8167 asking for more symbols than were added.
8168 * testsuite/Makefile.am (plugin_test_1): Add test case with
8169 no global symbols.
8170 (empty.syms): New target.
8171 * testsuite/Makefile.in: Regenerate.
8172 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8173 message. Don't call add_symbols if no globals.
8174 (all_symbols_read_hook): Don't provide replacement for empty
8175 claimed file.
8176
b0074644
ILT
81772008-12-12 Ian Lance Taylor <iant@google.com>
8178
68943102
ILT
8179 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8180 r_type == 0 for a local symbol with r_sym == 0.
8181 (scan_relocatable_relocs): Pass r_sym to
8182 local_non_section_strategy.
8183 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8184 r_sym parameter.
8185
b0074644
ILT
8186 * configure.ac: Update test for TLS descriptors: they are
8187 supported as of glibc 2.9.
8188 * configure: Rebuild.
8189
c2508178
ILT
81902008-12-11 Ian Lance Taylor <iant@google.com>
8191
8192 PR 7091
8193 * target-reloc.h (Default_scan_relocatable_relocs): For each
8194 function, map r_type == 0 to RELOC_DISCARD.
8195
2756a258
CC
81962008-12-10 Cary Coutant <ccoutant@google.com>
8197
8198 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8199 object to override a kept COMDAT group from a plugin object.
8200
bb6f53d3
ILT
82012008-12-09 Ian Lance Taylor <iant@google.com>
8202
fbc558e1
ILT
8203 PR 7088
8204 * yyscript.y (file_cmd): Handle INPUT.
8205
bb6f53d3
ILT
8206 * testsuite/initpri1.c: Change all declarations to be full
8207 prototypes by adding void, to avoid compiler warnings.
8208
4674ecfc
CC
82092008-12-05 Rafael Avila de Espindola <espindola@google.com>
8210
8211 * options.cc (General_options::parse_plugin_opt): New.
8212 (General_options::add_plugin): The argument now is just the filename.
8213 (General_options::add_plugin_option): New.
8214 * options.h (plugin_opt): New.
8215 (add_plugin): Change argument name.
8216 (add_plugin_option): New.
8217 * plugin.cc (Plugin::load): Don't parse the plugin option.
8218 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8219 (Plugin::add_option): New.
8220 (Plugin::args_): Change type.
8221 (Plugin::filename_): New.
8222 (Plugin_manager::add_plugin_option): New.
8223 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8224 * testsuite/Makefile.in: Regenerate.
8225
fd06b4aa
CC
82262008-12-05 Cary Coutant <ccoutant@google.com>
8227
8228 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8229 Handle --strip-lto-sections option.
8230 * options.h (strip_lto_sections): New option.
8231
6c52134c
CC
82322008-12-01 Cary Coutant <ccoutant@google.com>
8233
8234 * plugin.cc (ld_plugin_message): Change format parameter to const.
8235 Fix mismatch between new[] and delete.
8236
a45248e0
CC
82372008-11-14 Cary Coutant <ccoutant@google.com>
8238
8239 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
8240 instead of -1U.
8241
c82fbeee
CS
82422008-11-05 Craig Silverstein <csilvers@google.com>
8243
8244 * options.cc (General_options::parse_dynamic_list): New function.
8245 * options.h (General_options): New flags dynamic_list,
8246 dynamic_list_data, dynamic_list_cpp_new, and
8247 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
8248 (General_options::in_dynamic_list): New function.
8249 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
8250 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
8251 (Lex::can_continue_name): Likewise.
8252 (yylex): Likewise.
8253 (read_script_file): New parameter script_options.
8254 (read_dynamic_list): New function.
8255 (Script_options::define_dynamic_list): New function.
8256 (dynamic_list_keyword_parsecodes): New variable.
8257 (dynamic_list_keywords): New variable.
8258 * script.h (Script_options::define_dynamic_list): New function
8259 prototype.
8260 (read_dynamic_list): New function prototype.
8261 * symtab.cc (strprefix): New macro.
8262 (Symbol::should_add_dynsym_entry): Support dynamic_list,
8263 dynamic_list_data, dynamic_list_cpp_new, and
8264 dynamic_list_cpp_typeinfo.
8265 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
8266 (dynamic_list_expr): New rule.
8267 (dynamic_list_nodes): Likewise.
8268 (dynamic_list_node): Likewise.
8269 * testsuite/Makefile.am (dynamic_list): New test.
8270 * testsuite/Makefile.in: Regenerated.
8271 * testsuite/dynamic_list.t: New file.
8272 * testsuite/dynamic_list.sh: New file.
8273
e0bb29a5
CS
82742008-11-05 Craig Silverstein <csilvers@google.com>
8275
8276 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
8277 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
8278 (t11_last): Likewise.
8279 * testsuite/ver_test_6.c (main): Likewise.
8280
4e1e25e0
CC
82812008-10-07 Cary Coutant <ccoutant@google.com>
8282
8283 * options.c (General_options::finalize): Add check for -static and
8284 -shared.
8285 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
8286 is not empty.
8287
92f03fcb
CC
82882008-10-02 Cary Coutant <ccoutant@google.com>
8289
8290 * plugin.cc (make_sized_plugin_object): Fix conditional
8291 compilation to work when not all targets are enabled.
8292
fbd8a257
CC
82932008-09-29 Cary Coutant <ccoutant@google.com>
8294
8295 * archive.cc (Archive::get_file_and_offset): Use filename instead
8296 of name to get library path.
8297 (Archive::include_member): Unlock external member of a thin archive.
8298
8299 * testsuite/Makefile.am (TEST_AR): New variable.
8300 (thin_archive_test_1): New test.
8301 (thin_archive_test_2): New test.
81636b3f
CC
8302 * testsuite/Makefile.in: Regenerate.
8303 * testsuite/thin_archive_main.cc: New file.
8304 * testsuite/thin_archive_test_1.cc: New file.
8305 * testsuite/thin_archive_test_2.cc: New file.
8306 * testsuite/thin_archive_test_3.cc: New file.
8307 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 8308
eff45813
CC
83092008-09-29 Cary Coutant <ccoutant@google.com>
8310
8311 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
8312 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
8313 instead of -1U.
8314 (Sized_relobj::do_finalize_local_symbols): Likewise.
8315 (Sized_relobj::map_to_kept_section): Likewise.
8316 * object.h (Sized_relobj::invalid_address): New constant.
8317 (Sized_relobj::do_output_section_offset): Check for invalid_address
8318 and return -1ULL.
8319 * output.cc (Output_reloc::local_section_offset): Use constant
8320 invalid_address instead of -1U.
8321 (Output_reloc::get_address): Likewise.
8322 (Output_section::output_address): Change -1U to -1ULL.
8323 * output.h (Output_reloc::invalid_address): New constant.
8324 * reloc.cc (Sized_relobj::write_sections): Use constant
8325 invalid_address instead of -1U.
8326 (Sized_relobj::relocate_sections): Likewise.
8327 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
8328 values for merge sections.
8329 * target-reloc.h (relocate_for_relocatable): Use constant
8330 invalid_address instead of -1U.
8331
89fc3421
CC
83322008-09-19 Cary Coutant <ccoutant@google.com>
8333
8334 Add plugin functionality for link-time optimization (LTO).
8335 * configure.ac (plugins): Add --enable-plugins option.
8336 * configure: Regenerate.
8337 * config.in: Regenerate.
8338 * Makefile.am (LIBDL): New variable.
8339 (CCFILES): Add plugin.cc.
8340 (HFILES): Add plugin.h.
8341 (ldadd_var): Add LIBDL.
8342 * Makefile.in: Regenerate.
8343
8344 * archive.cc: Include "plugin.h".
8345 (Archive::setup): Don't preread archive symbols when using a plugin.
8346 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
8347 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
8348 files.
8349 (Archive::include_member): Add symbols from plugin objects.
8350 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
8351 * descriptors.cc (Descriptors::open): Check for file descriptors
8352 abandoned by plugins.
8353 (Descriptors::claim_for_plugin): New function.
8354 * descriptors.h (Descriptors::claim_for_plugin): New function.
8355 (Open_descriptor::is_claimed): New field.
8356 (claim_descriptor_for_plugin): New function.
8357 * fileread.cc (File_read::claim_for_plugin): New function.
8358 * fileread.h (File_read::claim_for_plugin): New function.
8359 (File_read::descriptor): New function.
8360 * gold.cc: Include "plugin.h".
8361 (queue_initial_tasks): Add task to call plugin hooks for generating
8362 new object files.
8363 * main.cc: Include "plugin.h".
8364 (main): Load plugin libraries.
8365 * object.h (Pluginobj): Declare.
8366 (Object::pluginobj): New function.
8367 (Object::do_pluginobj): New function.
8368 (Object::set_target): New function.
8369 * options.cc: Include "plugin.h".
8370 (General_options::parse_plugin): New function.
8371 (General_options::General_options): Initialize plugins_ field.
8372 (General_options::add_plugin): New function.
8373 * options.h (Plugin_manager): Declare.
8374 (General_options): Add --plugin option.
8375 (General_options::has_plugins): New function.
8376 (General_options::plugins): New function.
8377 (General_options::add_plugin): New function.
8378 (General_options::plugins_): New field.
8379 * plugin.cc: New file.
8380 * plugin.h: New file.
8381 * readsyms.cc: Include "plugin.h".
8382 (Read_symbols::do_read_symbols): Check for archive before checking
8383 for ELF file. Call plugin hooks to claim files.
8384 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
8385 from a real object file; force override when processing replacement
8386 files.
8387 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
8388 (Symbol::init_base_object): Likewise.
8389 (Symbol::init_base_output_data): Likewise.
8390 (Symbol::init_base_output_segment): Likewise.
8391 (Symbol::init_base_constant): Likewise.
8392 (Symbol::init_base_undefined): Likewise.
8393 (Symbol::output_section): Assert that object is not a plugin.
8394 (Symbol_table::add_from_pluginobj): New function.
8395 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
8396 undefined.
8397 (Symbol_table::sized_write_globals): Likewise.
8398 (Symbol_table::add_from_pluginobj): Instantiate template.
8399 * symtab.h (Sized_pluginobj): Declare.
8400 (Symbol::in_real_elf): New function.
8401 (Symbol::set_in_real_elf): New function.
8402 (Symbol::in_real_elf_): New field.
8403 (Symbol_table::add_from_pluginobj): New function.
8404
8405 * testsuite/Makefile.am (AM_CFLAGS): New variable.
8406 (LIBDL): New variable.
8407 (LDADD): Add LIBDL.
8408 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
8409 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
8410 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
8411 (MOSTLYCLEANFILES): Likewise.
8412 * testsuite/Makefile.in: Regenerate.
8413 * testsuite/plugin_test.c: New file.
8414 * testsuite/plugin_test_1.sh: New file.
8415 * testsuite/plugin_test_2.sh: New file.
8416
de31bda5
ILT
84172008-09-16 Ian Lance Taylor <iant@google.com>
8418
9c2d0ef9
ILT
8419 * target-reloc.h (relocate_section): Check whether a symbol is
8420 defined by the ABI before reporting an undefined symbol error.
8421 * target.h (Target::is_defined_by_abi): Make parameter const.
8422 (Target::do_is_defined_by_abi): Likewise.
8423 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
8424 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
8425 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
8426 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
8427 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
8428 * testsuite/Makefile.in: Rebuild.
8429
de31bda5
ILT
8430 * fileread.cc (make_view): Add casts to avoid warning.
8431
9fa33bee
AO
84322008-09-16 Alexandre Oliva <aoliva@redhat.com>
8433
8434 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
8435 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8436
183fd0e3
AO
84372008-09-16 Alexandre Oliva <aoliva@redhat.com>
8438
8439 * options.h (General_options::output_is_executable): New.
8440 (General_options::output_is_pie): New.
8441 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
8442 for shared libraries.
8443 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8444
7be8330a
CD
84452008-09-11 Chris Demetriou <cgd@google.com>
8446
8447 * options.h (origin): New -z option.
8448 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
8449 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
8450 in DT_FLAGS_1.
8451
a9caad02
CC
84522008-09-05 Cary Coutant <ccoutant@google.com>
8453
8454 * fileread.cc (File_read::make_view): Add check for attempt to map
8455 beyond end of file.
8456
ae6dce4d
CC
84572008-09-05 Cary Coutant <ccoutant@google.com>
8458
8459 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
8460 explicit instantiations.
8461
d7ab2a47
KVH
84622008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
8463
8464 PR gold/6858
8465 * options.cc (General_options::finalize): Allow undefined symbols
8466 in shlibs if linking -shared.
8467
8468 PR gold/6859
8469 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
8470 symbols as not needing a dynsym entry.
8471
1e52a9c1
CS
84722008-08-20 Craig Silverstein <csilvers@google.com>
8473
8474 * fileread.cc (File_read::open): Do not lock the file unless it
8475 was successfully opened.
8476
d85c80a3
CC
84772008-08-14 Cary Coutant <ccoutant@google.com>
8478
8479 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
8480 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
8481 * testsuite/tls_test.cc (struct int128): 128-bit struct
8482 for testing TLS relocs with non-zero addend.
8483 (v12): New TLS variable.
8484 (t12): New test.
8485 (t_last): Add check for v12.
8486 * testsuite/tls_test.h (t12): New function.
8487 * testsuite/tls_test_main.cc (thread_routine): Call new test.
8488
2d924fd9
ILT
84892008-08-13 Ian Lance Taylor <iant@google.com>
8490
8491 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
8492 set tls_segment_ or relro_segment_.
8493 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
8494 when appropriate.
8495 * output.h (Output_section::clear_is_relro): New function.
8496 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
8497 sections specially even when output_data_ is empty.
8498 (Output_segment::maximum_alignment): When first section is relro,
8499 only force alignment for PT_LOAD segments.
8500 * script.cc (script_data_segment_align): New function.
8501 (script_data_segment_relro_end): New function.
8502 * script-c.h (script_data_segment_align): Declare.
8503 (script_data_segment_relro_end): Declare.
8504 * script-sections.h (class Script_sections): Declare
8505 data_segment_align and data_segment_relro_end. Add fields
8506 segment_align_index_ and saw_relro_end_.
8507 * script-sections.cc (class Sections_element): Add set_is_relro
8508 virtual function. Add new bool* parameter to place_orphan_here.
8509 Add get_output_section virtual function.
8510 (class Output_section_definition): Add set_is_relro. Add new
8511 bool* parameter to place_orphan_here. Add get_output_section.
8512 Add is_relro_ field.
8513 (Output_section_definition::Output_section_definition): Initialize
8514 evaluated_address_, evaluated_load_address, evaluated_addralign_,
8515 and is_relro_ fields.
8516 (Output_section_definition::place_orphan_here): Add is_relro
8517 parameter.
8518 (Output_section_definition::set_section_addresses): Set relro for
8519 output section.
8520 (Output_section_definition::alternate_constraint): Likewise.
8521 (class Orphan_output_section): Add new bool* parameter to
8522 place_orphan_here. Add get_output_section.
8523 (Orphan_output_section::place_orphan_here): Add is_relro
8524 parameter.
8525 (Script_sections::Script_sections): Initialize
8526 data_segment_align_index_ and saw_relro_end_.
8527 (Script_sections::data_segment_align): New function.
8528 (Script_sections::data_segment_relro_end): New function.
8529 (Script_sections::place_orphan): Set or clear is_relro.
8530 (Script_sections::set_section_addresses): Force alignment of first
8531 TLS section.
8532 * yyscript.y (exp): Call script_data_segment_align and
8533 script_data_segment_relro_end.
8534 * testsuite/relro_script_test.t: New file.
8535 * testsuite/relro_test.cc (using_script): Declare.
8536 (t1, t2): Test using_script.
8537 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
8538 (relro_script_test_SOURCES): Define.
8539 (relro_script_test_DEPENDENCIES): Define.
8540 (relro_script_test_LDFLAGS): Define.
8541 (relro_script_test_LDADD): Define.
8542 (relro_script_test.so): New target.
8543 * testsuite/Makefile.in: Rebuild.
8544
f827c9a9
CC
85452008-08-06 Cary Coutant <ccoutant@google.com>
8546
8547 * archive.cc (Archive::total_archives, Archive::total_members)
8548 (Archive::total_members_loaded): New variables.
8549 (Archive::setup): Add parameter. Add option to preread
8550 archive symbols.
8551 (Archive::read_armap): Add counter.
8552 (Archive::get_file_and_offset): New function.
8553 (Archive::get_elf_object_for_member): New function.
8554 (Archive::read_all_symbols): New function.
8555 (Archive::read_symbols): New function.
8556 (Archive::add_symbols): Add counters.
8557 (Archive::include_all_members): Use armap to find members if it's
8558 already built.
8559 (Archive::include_member): Skip reading symbols if already read.
8560 Factored code into Archive::get_file_and_offset and
8561 Archive::get_elf_object_for_member. Changed call to
8562 Mapfile::report_include_archive_member.
8563 (Archive::print_stats): New function.
8564 * archive.h: Declare Object and Read_symbols_data classes.
8565 (Archive::Archive): Add initializers for new members.
8566 (Archive::setup): Add parameter.
8567 (Archive::print_stats): New function.
8568 (Archive::total_archives, Archive::total_members)
8569 (Archive::total_members_loaded): New variables.
8570 (Archive::get_file_and_offset): New function.
8571 (Archive::get_elf_object_for_member): New function.
8572 (Archive::read_all_symbols): New function.
8573 (Archive::read_symbols): New function.
8574 (Archive::Archive_member): New class.
8575 (Archive::members_): New member.
8576 (Archive::num_members_): New member.
8577 * main.cc: Include archive.h.
8578 (main): Call Archive::print_stats.
8579 * mapfile.cc (Mapfile::report_include_archive_member): Delete
8580 archive parameter; member_name is now the fully-decorated name.
8581 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
8582 * options.h: (General_options): Add --preread-archive-symbols option.
8583 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
8584 Archive::setup.
8585
de4c45bd
ILT
85862008-08-04 Ian Lance Taylor <iant@google.com>
8587
8588 * symtab.h (Symbol::use_plt_offset): New function.
8589 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
8590 * powerpc.cc (Relocate::relocate): Likewise.
8591 * sparc.cc (Relocate::relocate): Likewise.
8592 * x86_64.cc (Relocate::relocate): Likewise.
8593 * testsuite/weak_plt.sh: New test.
8594 * testsuite/weak_plt_main.cc: New test.
8595 * testsuite/weak_plt_shared.cc: New test.
8596 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
8597 (check_PROGRAMS): Add weak_plt.
8598 (check_DATA): Add weak_plt_shared.so.
8599 (weak_plt_main_pic.o, weak_plt): New targets.
8600 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
8601 * testsuite/Makefile.in: Rebuild.
8602
8603 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
8604 gcctestdir/ld.
8605 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
8606 * testsuite/Makefile.in: Rebuild.
8607
323ee3f4
AM
86082008-08-04 Alan Modra <amodra@bigpond.net.au>
8609
8610 * Makefile.am (POTFILES.in): Set LC_ALL=C.
8611 * Makefile.in: Regenerate.
8612 * po/POTFILES.in: Regenerate.
8613
7c07ecec
ILT
86142008-07-29 Ian Lance Taylor <iant@google.com>
8615
8616 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
8617 symbols before other symbols.
8618 * testsuite/script_test_2.cc (test_addr): Declare.
8619 (test_addr_alias): Declare.
8620 (main): Check that test_addr and test_addr_alias have the right
cd536b21 8621 values.
7c07ecec
ILT
8622 * testsuite/script_test_2.t: Define test_addr_alias and
8623 test_addr.
8624
5778530e
ILT
86252008-07-24 Ian Lance Taylor <iant@google.com>
8626
2a00e4fb
ILT
8627 PR 5990
8628 * descriptors.cc: New file.
8629 * descriptors.h: New file.
8630 * gold-threads.h (class Hold_optional_lock): New class.
8631 * fileread.cc: Include "descriptors.h".
8632 (File_read::~File_read): Release descriptor rather than closing
8633 it.
8634 (File_read::open) [file]: Call open_descriptor rather than open.
8635 Set is_descriptor_opened_.
8636 (File_read::open) [memory]: Assert that descriptor is not open.
8637 (File_read::reopen_descriptor): New function.
8638 (File_read::release): Release descriptor.
8639 (File_read::do_read): Make non-const. Reopen descriptor.
8640 (File_read::read): Make non-const.
8641 (File_read::make_view): Reopen descriptor.
8642 (File_read::do_readv): Likewise.
8643 * fileread.h (class File_read): Add is_descriptor_opened_ field.
8644 Update declarations.
8645 * layout.cc: Include "descriptors.h".
8646 (Layout::create_build_id): Use open_descriptor rather than open.
8647 * output.cc: Include "descriptors.h".
8648 (Output_file::open): Use open_descriptor rather than open.
8649 * archive.cc (Archive::const_iterator): Change Archive to be
8650 non-const.
8651 (Archive::begin, Archive::end): Make non-const.
8652 (Archive::count_members): Likewise.
8653 * archive.h (class Archive): Update declarations.
8654 * object.h (Object::read): Make non-const.
8655 * Makefile.am (CCFILES): Add descriptors.cc.
8656 (HFILES): Add descriptors.h.
8657 * Makefile.in: Rebuild.
8658
801647d1
ILT
8659 PR 6716
8660 * gold.h: Always include <clocale>. Add Solaris workarounds
8661 following code in binutils/sysdep.h.
8662
5edd166e
ILT
8663 PR 6048
8664 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
8665 this->eh_frame_hdr_ is NULL before using it.
8666
c89ad728
ILT
8667 * dynobj.cc (Versions::Versions): Update comment.
8668
aa86f06b
ILT
8669 * dynobj.cc (Versions::Versions): If there is an soname, use it as
8670 the base version name.
8671
5778530e
ILT
8672 * stringpool.cc (Stringpool_template::add_with_length): Set key to
8673 array size plus one.
8674 (Stringpool_template::set_string_offsets): Subtract one from key
8675 before using it as an array index.
8676 (Stringpool_template::get_offset_with_length): Likewise.
8677 (Stringpool_template::write_to_buffer): Likewise.
8678 * stringpool.h (Stringpool_template::get_offset_from_key):
8679 Likewise.
8680
057ead22
ILT
86812008-07-23 Ian Lance Taylor <iant@google.com>
8682
7f649c59
ILT
8683 PR 6658
8684 * object.h (Merged_symbol_value::value): Do our best to handle a
8685 negative addend.
8686
057ead22
ILT
8687 PR 6647
8688 * script.cc (Version_script_info::get_versions): Don't add empty
8689 version tag to return value.
8690 (Version_script_info::get_symbol_version_helper): Change return
8691 type to bool. Add pversion parameter. Change all callers.
8692 (script_register_vers_node): Don't require a non-NULL tag.
8693 * script.h (class Version_script_info): Update declarations.
8694 (Version_script_info::get_symbol_version): Change return type to
8695 bool. Add version parameter. Change all callers.
8696 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
8697 handling. Handle an empty version from a version script.
8698 (Symbol_table::define_special_symbol): Likewise.
8699 * testsuite/ver_test_10.script: New file.
8700 * testsuite/ver_test_10.sh: New file.
8701 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
8702 (check_DATA): Add ver_test_10.syms.
8703 (ver_test_10.syms, ver_test_10.so): New target.
8704 * testsuite/Makefile.in: Rebuild.
8705
58e54ac2
CD
87062008-07-23 Simon Baldwin <simonb@google.com>
8707
8708 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
8709 to zero for undefined symbols from dynamic libraries.
8710
95d14cd3
ILT
87112008-07-23 Ian Lance Taylor <iant@google.com>
8712
8713 * symtab.cc (Symbol_table::resolve): Remove version parameter.
8714 Change all callers.
8715 * symtab.h (class Symbol_table): Update declaration.
8716 * testsuite/ver_test_9.cc: New file.
8717 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
8718 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
8719 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
8720 (ver_test_9.so, ver_test_9.o): New targets.
8721 * testsuite/Makefile.in: Rebuild.
8722
92de84a6
ILT
87232008-07-22 Ian Lance Taylor <iant@google.com>
8724
34810851
ILT
8725 * options.h (class General_options): Define --check-sections.
8726 * layout.cc (Layout::set_segment_offsets): Handle
8727 --check-sections.
8728
af6156ef
ILT
8729 * options.h (class General_options): Define -n/--nmagic and
8730 -N/--omagic.
8731 * options.cc (General_options::finalize): For -n/--nmagic or
8732 -N/--omagic, set -static.
8733 * layout.cc (Layout::attach_allocated_section_to_segment): If
8734 -N/--omagic, don't put read-only and read-write sections in
8735 different segments.
8736 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
8737 finding a read-only segment.
8738 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
8739 don't set the minimum segment alignment to the common page size,
8740 and don't set the file offset to the address modulo the page size.
8741 * script-sections.cc (Script_sections::create_segments): If
8742 -n/--omagic, don't put read-only and read-write sections in
8743 different segments.
8744
92de84a6
ILT
8745 * cref.cc: New file.
8746 * cref.h: New file.
8747 * options.h (class General_options): Add --print-symbol-counts.
8748 * main.cc (main): Issue defined symbol report if requested.
8749 * archive.cc (Archive::interpret_header): Make into a const member
8750 function.
8751 (Archive::add_symbols): Call Input_objects::archive_start and
8752 archive_stop.
8753 (Archive::const_iterator): Define new class.
8754 (Archive::begin, Archive::end): New functions.
8755 (Archive::include_all_members): Rewrite to use iterator.
8756 (Archive::count_members): New function.
8757 * archive.h (class Archive): Update declarations.
8758 (Archive::filename): New function.
8759 * object.cc: Include "cref.h".
8760 (Sized_relobj::Sized_relobj): Initialize defined_count_.
8761 (Sized_relobj::do_get_global_symbol_counts): New function.
8762 (Input_objects::add_object): Add object to cross-referencer.
8763 (Input_objects::archive_start): New function.
8764 (Input_objects::archive_stop): New function.
8765 (Input_objects::print_symbol_counts): New function.
8766 * object.h: Declare Cref and Archive.
8767 (Object::get_global_symbol_counts): New function.
8768 (Object::do_get_global_symbol_counts): New pure virtual function.
8769 (class Sized_relobj): Add defined_count_ field. Update
8770 declarations.
8771 (class Input_objects): Add cref_ field. Update constructor.
8772 Update declarations.
8773 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
8774 defined_count_.
8775 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
8776 symbol counts.
8777 (Sized_dynobj::do_get_global_symbol_counts): New function.
8778 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
8779 defined_count_. Update declarations. Define Symbols typedef.
8780 * symtab.cc (Symbol_table::add_from_relobj): Add defined
8781 parameter. Change all callers.
8782 (Symbol_table::add_from_dynobj): Add sympointers and defined
8783 parameters. Change all callers.
8784 * symtab.h (class Symbol_table): Update declarations.
8785 * Makefile.am (CCFILES): Add cref.cc.
8786 (HFILES): Add cref.h.
8787 * Makefile.in: Rebuild.
8788
3f7c5e1d
CD
87892008-07-22 Simon Baldwin <simonb@google.com>
8790
8791 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
8792 to zero when writing undefined symbols.
8793
e0b64032
ILT
87942008-07-22 Ian Lance Taylor <iant@google.com>
8795
8796 * output.cc (Output_section::add_input_section): Don't try to
8797 merge empty merge sections.
8798
096b02cf
CS
87992008-07-21 Craig Silverstein <csilvers@google.com>
8800
8801 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8802 Include symbol version in error message.
cd536b21 8803
1d1f116d
CD
88042008-07-20 Chris Demetriou <cgd@google.com>
8805
cd536b21 8806 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
8807 (RANDOM_SEED_CFLAGS): New substituted variable.
8808 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
8809 * configure: Rebuild.
8810 * Makefile.in: Likewise.
8811 * testsuite/Makefile.in: Likewise.
8812
a18f591e
ILT
88132008-07-18 Ian Lance Taylor <iant@google.com>
8814
8815 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
8816 where we see NAME/NULL and NAME/VERSION as separate symbols.
8817 * testsuite/ver_test_main.cc (main): Call t4.
8818 (t4, t4_2a): Define.
8819 * testsuite/ver_test_2.cc (t4_2): Define.
8820 * testsuite/ver_test_2.script: Put t4_2a in VER2.
8821 * testsuite/ver_test_4.cc (t4_2a): Define.
8822 * testsuite/ver_test_4.script: Put t4_2a in VER2.
8823 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
8824
c6e3f6ed
ILT
88252008-07-17 Ian Lance Taylor <iant@google.com>
8826
8827 * dynobj.cc (Versions::add_def): If we give an error about a
8828 missing version, go ahead and create the version anyhow.
8829
ef9beddf
ILT
88302008-07-10 Ian Lance Taylor <iant@google.com>
8831
8832 Handle output sections with more than 0x7fffffff bytes.
8833 * object.h (class Relobj): Change map_to_output_ to
8834 output_sections_, and just keep a section pointer. Change all
8835 uses. Move comdat group support to Sized_relobj.
8836 (Relobj::is_section_specially_mapped): Remove.
8837 (Relobj::output_section): Remove poff parameter. Change all
8838 callers.
8839 (Relobj::output_section_offset): New function.
8840 (Relobj::set_section_offset): Rewrite.
8841 (Relobj::map_to_output): Remove.
8842 (Relobj::output_sections): New function.
8843 (Relobj::do_output_section_offset): New pure virtual function.
8844 (Relobj::do_set_section_offset): Likewise.
8845 (class Sized_relobj): Add section_offsets_ field. Add comdat
8846 group support from Relobj. Update declarations.
8847 (Sized_relobj::get_output_section_offset): New function.
8848 (Sized_relobj::do_output_section_offset): New function.
8849 (Sized_relobj::do_set_section_offset): New function.
8850 * object.cc (Relobj::output_section_address): Remove.
8851 (Sized_relobj::Sized_relobj): Initialize new fields.
8852 (Sized_relobj::include_section_group): Cast find_kept_object to
8853 Sized_relobj.
8854 (Sized_relobj::include_linkonce_section): Likewise.
8855 (Sized_relobj::do_layout): Use separate arrays for output section
8856 and output offset.
8857 (Sized_relobj::do_count_local_symbols): Change map_to_output to
8858 output_sections.
8859 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
8860 output_sections and section_offsets.
8861 (Sized_relobj::write_local_symbols): Likewise.
8862 (map_to_kept_section): Compute output address directly.
8863 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
8864 output_sections and section_offsets.
8865 (Sized_relobj::write_sections): Likewise.
8866 (Sized_relobj::relocate_sections): Likewise.
8867 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
8868 * output.h (class Output_reloc): Update declarations. Change
8869 u2_.relobj to Sized_relobj*.
8870 (class Output_data_reloc): Change add functions to use
8871 Sized_relobj*.
8872 * output.cc (Output_reloc::Output_reloc): Change relobj to
8873 Sized_relobj*.
8874 (Output_reloc::local_section_offset): Change return type to
8875 Elf_Addr. Use get_output_section_offset.
8876 (Output_reloc::get_address): Likewise.
8877 (Output_section::is_input_address_mapped): Don't call
8878 is_section_specially_mapped.
8879 (Output_section::output_offset): Likewise.
8880 (Output_section::output_address): Likewise.
8881 (Output_section::starting_output_address): Likewise.
8882 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
8883 parameter to Sized_relobj*.
8884 (Copy_relocs::need_copy_reloc): Likewise.
8885 (Copy_relocs::save): Likewise.
8886 * copy-relocs.h (class Copy_relocs): Update declarations.
8887 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
8888 Sized_relobj*. Change relobj_ field to Sized_relobj*.
8889 * target-reloc.h (relocate_for_relocatable): Change
8890 offset_in_output_section type to Elf_Addr. Change code that uses
8891 it as well.
8892 * layout.cc (Layout::layout): Always set *off.
8893 * mapfile.cc (Mapfile::print_input_section): Use
8894 output_section_offset.
8895 * i386.cc (Target_i386::copy_reloc): Change object parameter to
8896 Sized_relobj*.
8897 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
8898 * sparc.cc (Target_sparc::copy_reloc): Likewise.
8899 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
8900
5cb66f97
ILT
89012008-07-03 Ian Lance Taylor <iant@google.com>
8902
8903 * layout.cc (Layout::include_section): Do not discard unrecognized
8904 SHT_STRTAB sections.
8905
afe47622
CS
89062008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
8907
8908 * script.cc (Lex::can_continue_name): Make '?' allowable in
8909 version-script names.
8910 * testsuite/version_script.map: Change glob pattern to use '?'
8911
5adf9721
ILT
89122008-06-30 Manish Singh <yosh@gimp.org>
8913
8914 PR 6585
8915 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
8916 Correct typo.
8917
e6fde208
ILT
89182008-06-30 Ian Lance Taylor <iant@google.com>
8919
8920 PR 6660
8921 PR 6682
8922 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
8923 versions]: Don't try to read the value in the contents, since we
8924 don't use it. Use the template endianness when writing.
8925
3f2e6a2d
CC
89262008-06-25 Cary Coutant <ccoutant@google.com>
8927
8928 * fileread.cc (File_read::make_view): Assert on zero-length view.
8929 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
8930 symbol table when there are no symbols to read.
8931
c43d3a48
CS
89322008-06-23 Craig Silverstein <csilvers@google.com>
8933
8934 * version.cc (version_string): Bump to 1.7
8935
5f494ea0
CS
89362008-06-18 Craig Silverstein <csilvers@google.com>
8937
8938 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
8939 constant 0xFFFF to type Valtype.
8940 (Powerpc_relocate_functions::rel16_ha): Likewise.
8941
c42e122e
ILT
89422008-06-17 Ian Lance Taylor <iant@google.com>
8943
f34787f8
ILT
8944 * output.h (Output_section::Input_section): Initialize p2align_ to
8945 zero for Output_section_data constructors.
8946 (Output_section::Input_section::addralign): If not an input
8947 section, return the alignment of the Output_section_data.
8948 * testsuite/copy_test.cc: New file.
8949 * testsuite/copy_test_1.cc: New file.
8950 * testsuite/copy_test_2.cc: New file.
8951 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
8952 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
8953 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
8954 (copy_test_1_pic.o, copy_test_1.so): New targets.
8955 (copy_test_2_pic.o, copy_test_2.so): New targets.
8956 * testsuite/Makefile.in: Rebuild.
8957
c42e122e
ILT
8958 * script-sections.cc (Script_sections::place_orphan): Initialize
8959 local variable exact.
8960
ce3ac18a
DE
89612008-06-13 David Edelsohn <edelsohn@gnu.org>
8962
8963 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
8964
42cacb20
DE
89652008-06-12 David Edelsohn <edelsohn@gnu.org>
8966 David S. Miller <davem@davemloft.net>
8967
8968 * powerpc.cc: New file.
8969 * Makefile.am (TARGETSOURCES): Add powerpc.cc
8970 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
8971 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
8972 * Makefile.in: Rebuild.
8973
7b308235
ILT
89742008-06-09 Ian Lance Taylor <iant@google.com>
8975
8976 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
8977 <exception>.
8978 (throwing, orig_terminate): New static variables.
8979 (terminate_handler): New static function.
8980 (t2): Set terminate handler.
8981
f0b886e3
ILT
89822008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
8983
8984 PR 6584
cd536b21 8985 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
8986 alignment.
8987
3e90f135
CC
89882008-05-30 Cary Coutant <ccoutant@google.com>
8989
8990 * archive.cc (Archive::include_all_members) Correct to step
8991 over symbol table and extended name table in thin archives.
8992
e09ad04a
ILT
89932008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
8994
8995 PR 6407
8996 * target-reloc.h (relocate_for_relocatable): Fix new_offset
8997 calculation.
8998
62b01cb5
ILT
89992008-05-28 Caleb Howe <cshowe@google.com>
9000
9001 * reduced_debug_output.cc: New file.
9002 * reduced_debug_output.h: New file.
92de84a6 9003 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9004 * options.cc (General_options::finalize): Add strip_debug_non_line
9005 to the strip heirarchy.
9006 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9007 fields.
9008 * layout.cc: Include "reduced_debug_output.h".
9009 (Layout::Layout): Initialize new fields.
9010 (line_only_debug_sections): New static array.
9011 (is_lines_only_debug_sections): New static inline function.
9012 (Layout::include_section): Handle --strip-debug-non-line.
9013 (Layout::make_output_section): If --strip-debug-non-line, build
9014 new output sections for .debug_abbrev and .debug_info.
9015 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9016 gold. Warn about possible overflow.
9017 (read_signed_LEB_128): Likewise.
9018 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9019 (read_signed_LEB_128): Declare.
9020 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9021 (HFILES): Add reduced_debug_output.h.
9022 * Makefile.in: Rebuild.
9023
7d9e3d98
ILT
90242008-05-21 Ian Lance Taylor <iant@google.com>
9025
9026 * mapfile.cc: New file.
9027 * mapfile.h: New file.
9028 * options.h (class General_options): Add -M/--print-map and -Map.
9029 * options.cc (General_options::finalize): Make -M equivalent to
9030 -Map -.
9031 * main.cc: Include <cstdio> and "mapfile.h".
9032 (main): Open mapfile if requested.
9033 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9034 constructor. Change caller.
9035 (queue_initial_tasks): Add mapfile parameter. Change caller.
9036 (queue_middle_tasks): Likewise.
9037 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9038 declarations.
9039 * archive.cc: Include "mapfile.h".
9040 (Archive::add_symbols): Add mapfile parameter. Change all
9041 callers. Pass mapfile, symbol, and reason to include_member.
9042 (Archive::include_all_members): Add mapfile parameter. Change all
9043 callers.
9044 (Archive::include_member): Add mapfile, sym, and why parameters.
9045 Change all callers. Report inclusion to map file.
9046 * archive.h: Include "fileread.h".
9047 (class Archive): Update declarations.
9048 (Archive::file): New const method.
9049 (class Add_archive_symbols): Add mapfile_ field. Update
9050 constructor. Change all callers.
9051 * readsyms.h (class Read_symbols): Likewise.
9052 (class Finish_group): Likewise.
9053 (class Read_script): Likewise.
9054 * common.cc: Include "mapfile.h".
9055 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9056 all callers.
9057 (Symbol_table::do_allocate_commons): Likewise.
9058 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9059 symbol allocation to mapfile.
9060 * common.h (class Allocate_commons_task): Add mapfile_ field.
9061 Update constructor. Change all callers.
9062 * symtab.h (class Symbol_table): Update declarations.
9063 * layout.cc: Include "mapfile.h".
9064 (Layout_task_runner::run): Print information to mapfile.
9065 (Layout::create_gold_note): Change Output_data_fixed_space to
9066 Output_data_zero_fill.
9067 (Layout::create_build_id): Likewise.
9068 (Layout::print_to_mapfile): New function.
9069 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9070 constructor. Change caller.
9071 (class Layout): Declare print_to_mapfile.
9072 * output.cc (Output_section::Input_section::print_to_mapfile): New
9073 function.
9074 (Output_section::add_input_section): If producing a map, always
9075 add to input_sections_ list.
9076 (Output_section::do_print_to_mapfile): New function.
9077 (Output_segment::print_sections_to_mapfile): New function.
9078 (Output_segment::print_section_list_to_mapfile): New function.
9079 * output.h: Include "mapfile.h".
9080 (Output_data::print_to_mapfile): New function.
9081 (Output_data::do_print_to_mapfile): New virtual function.
9082 (Output_segment_headers::do_print_to_mapfile): New function.
9083 (Output_file_header::do_print_to_mapfile): New function.
9084 (Output_data_const::do_print_to_mapfile): New function.
9085 (class Output_data_const_buffer): Add map_name_ field. Update
9086 constructor. Change all callers. Add do_print_to_mapfile
9087 function.
9088 (class Output_data_fixed_space): Likewise.
9089 (class Output_data_space): Likewise.
9090 (class Output_data_zero_fill): New class.
9091 (Output_data_strtab::do_print_to_mapfile): New function.
9092 (Output_data_reloc_base::do_print_to_mapfile): New function.
9093 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9094 (Output_data_group::do_print_to_mapfile): New function.
9095 (Output_data_got::do_print_to_mapfile): New function.
9096 (Output_data_dynamic::do_print_to_mapfile): New function.
9097 (Output_symtab_xindex::do_print_to_mapfile): New function.
9098 (class Output_section): Declare do_print_to_mapflie. Declare
9099 print_to_mapfile in Input_section.
9100 (class Output_segment): Declare new functions.
9101 * object.h (Sized_relobj::symbol_count): New function.
9102 * script-sections.cc
9103 (Output_section_element_dot_assignment::set_section_addresses):
9104 Change Output_data_fixed_space to Output_data_zero_fill.
9105 (Output_data_expression::do_print_to_mapfile): New function.
9106 * script.cc (read_input_script): Add mapfile parameter. Change
9107 all callers.
9108 * script.h (read_input_script): Update declaration.
9109 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9110 (Eh_frame::do_print_to_mapfile): New function.
9111 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9112 (Output_merge_string::do_print_to_mapfile): New function.
9113 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9114 function.
9115 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9116 function.
9117 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9118 function.
9119 * Makefile.am (CCFILES): Add mapfile.cc.
9120 (HFILES): Add mapfile.h.
9121 * Makefile.in: Rebuild.
9122
9f1d377b
ILT
91232008-05-19 Ian Lance Taylor <iant@google.com>
9124
9125 * options.h (class General_options): Add -z relro.
9126 * layout.cc (Layout::Layout): Initialize relro_segment_.
9127 (Layout::add_output_section_data): Return the output section.
9128 (Layout::make_output_section): Rcognize relro sections and mark
9129 them appropriately.
9130 (Layout::attach_allocated_section_to_segment): Put relro sections
9131 in a PT_GNU_RELRO segment.
9132 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9133 section as relro.
9134 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9135 PT_TLS segments.
9136 (Layout::linkonce_mapping): Map d.rel.ro.local to
9137 .data.rel.ro.local.
9138 (Layout::output_section_name): Us .data.rel.ro.local for any
9139 section which begins with that.
9140 * layout.h (class Layout): Update add_output_section_data
9141 declaration. Add relro_segment_ field.
9142 * output.cc (Output_section::Output_section): Initialize is_relro_
9143 and is_relro_local_ fields.
9144 (Output_segment::add_output_section): Group relro sections.
9145 (Output_segment::is_first_section_relro): New function.
9146 (Output_segment::maximum_alignment): If there is a relro section,
9147 align the segment to the common page size.
9148 (Output_segment::set_section_addresses): Track whether we are
9149 looking at relro sections. If the last section is a relro
9150 section, align to the common page size.
9151 (Output_segment::set_section_list_addresses): Add in_relro
9152 parameter. Change all callers. Align to the page size when
9153 moving from relro to non-relro section.
9154 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9155 segment.
9156 * output.h (class Output_section): Add is_relro_ and
9157 is_relro_local_ fields.
9158 (Output_section::is_relro): New function.
9159 (Output_section::set_is_relro): New function.
9160 (Output_section::is_relro_local): New function.
9161 (Output_section::set_is_relro_local): New function.
9162 (class Output_segment): Update declarations.
9163 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9164 * sparc.cc (Target_sparc::got_section): Likewise.
9165 * x86_64.cc (Target_x86_64::got_section): Likewise.
9166 * testsuite/relro_test_main.cc: New file.
9167 * testsuite/relro_test.cc: New file.
9168 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9169 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9170 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9171 (relro_test.so, relro_test_pic.o): New targets.
9172 * testsuite/Makefile.in: Rebuild.
9173
a984ee1d
ILT
91742008-05-16 Ian Lance Taylor <iant@google.com>
9175
01676dcd
ILT
9176 * output.cc (Output_segment::add_output_section): Remove front
9177 parameter.
9178 * output.h (class Output_segment): Remove
9179 add_initial_output_section and overloaded add_output_section.
9180 Update declaration of remaining add_output_section.
9181 * layout.cc (Layout::create_interp): Call add_output_section
9182 rather than add_initial_output_section.
9183 (Layout::finish_dynamic_section): Likewise.
9184
497897f9
ILT
9185 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9186 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9187 know the dynamic type.
9188 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9189 field. Initialize it in constructor.
9190 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9191 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9192 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9193 reloc.
9194
a984ee1d
ILT
9195 * output.cc (Output_reloc::get_address): Change return type to
9196 Elf_Addr.
9197 * output.h (class Output_reloc): Update get_address declaration.
9198 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9199 for section addresses.
9200
55ba0940
ILT
92012008-05-09 Ian Lance Taylor <iant@google.com>
9202
9203 PR 6493
9204 * gold.cc (gold_nomem): Use return value of write.
9205
75517b77
ILT
92062008-05-08 Ian Lance Taylor <iant@google.com>
9207
9208 * symtab.c (Symbol::init_base_output_data): Add version
9209 parameter. Change all callers.
9210 (Symbol::init_base_output_segment): Likewise.
9211 (Symbol::init_base_constant): Likewise.
9212 (Symbol::init_base_undefined): Likewise.
9213 (Sized_symbol::init_output_data): Likewise.
9214 (Sized_symbol::init_output_segment): Likewise.
9215 (Sized_symbol::init_constant): Likewise.
9216 (Sized_symbol::init_undefined): Likewise.
9217 (Symbol_table::do_define_in_output_data): If the new symbol has a
9218 version, mark it as the default.
9219 (Symbol_table::do_define_in_output_segment): Likewise.
9220 (Symbol_table::do_define_as_constant): Likewise.
9221 * symtab.h (class Symbol): Update declarations.
9222 (class Sized_symbol): Likewise.
9223 * resolve.cc (Symbol::override_version): New function.
c42e122e 9224 (Symbol::override_base): Call override_version.
75517b77
ILT
9225 (Symbol::override_base_with_special): Likewise.
9226 * testsuite/ver_script_8.script: New file.
9227 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9228 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9229 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9230 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9231
f1f70eae
ILT
92322008-05-06 Ian Lance Taylor <iant@google.com>
9233
f3e9c5c5
ILT
9234 PR 6049
9235 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
9236 functions.
9237 (class General_options): Remove existing --undefined, and add
9238 --no-undefined instead. Add new --undefined as synonym for -u.
9239 * archive.cc (Archive::add_symbols): Check whether symbol was
9240 named with -u.
9241 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
9242 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
9243 all uses. Add IS_UNDEFINED. Update declarations to split
9244 different versions of init_base. Declare init_base_undefined.
9245 (Symbol::is_defined): Handle IS_UNDEFINED.
9246 (Symbol::is_undefined): Likewise.
9247 (Symbol::is_weak_undefined): Call is_undefined.
9248 (Symbol::is_absolute): Handle IS_CONSTANT.
9249 (class Sized_symbol): Update declarations to split different
9250 versions of init. Declare init_undefined.
9251 (class Symbol_table): Declare new functions.
9252 * symtab.cc (Symbol::init_base_object): Rename from init_base.
9253 Change all callers.
9254 (Symbol::init_base_output_data): Likewise.
9255 (Symbol::init_base_output_segment): Likewise.
9256 (Symbol::init_base_constant): Likewise.
9257 (Symbol::init_base_undefined): New function.
9258 (Sized_symbol::init_object): Rename from init. Change all
9259 callers.
9260 (Sized_symbol::init_output_data): Likewise.
9261 (Sized_symbol::init_output_segment): Likewise.
9262 (Sized_symbol::init_constant): Likewise.
9263 (Sized_symbol::init_undefined): New function.
9264 (Symbol_table::add_undefined_symbols_from_command_line): New
9265 function.
9266 (Symbol_table::do_add_undefined_symbols_from_command_line): New
9267 function.
9268 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
9269 (Symbol::output_section): Likewise.
9270 (Symbol::set_output_section): Likewise.
9271 (Symbol_table::sized_finalize_symbol): Likewise.
9272 (Symbol_table::sized_write_globals): Likewise.
9273 * resolve.cc (Symbol_table::should_override): Likewise.
9274 (Symbol::override_base_with_special): Likewise.
9275
8bdcdf2c
ILT
9276 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
9277 symbol, change it to have default visibility.
9278 * testsuite/protected_1.cc: New file.
9279 * testsuite/protected_2.cc: New file.
9280 * testsuite/protected_3.cc: New file.
9281 * testsuite/protected_main_1.cc: New file.
9282 * testsuite/protected_main_2.cc: New file.
9283 * testsuite/protected_main_3.cc: New file.
9284 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
9285 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
9286 (protected_1_LDFLAGS, protected_1_LDADD): Define.
9287 (protected_1.so): New target.
9288 (protected_1_pic.o, protected_2_pic.o): New targets.
9289 (protected_3_pic.o): New target.
9290 (check_PROGRAMS): Add protected_2.
9291 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
9292 (protected_2_LDFLAGS, protected_2_LDADD): Define.
9293 * testsuite/Makefile.in: Rebuild.
9294
2b706932
ILT
9295 * options.h (DEFINE_var): Add set_user_set_##varname__.
9296 (DEFINE_bool_alias): New macro.
9297 (class General_options): Define -Bstatic using DEFINE_bool_alias
9298 rather than DEFINE_special. Add --undefined as an alias for -z
9299 defs.
9300 * options.cc (General_options::parse_Bstatic): Remove.
9301
d82a5bcc
ILT
9302 * options.h (class General_options): Add --fatal-warnings.
9303 * main.cc (main): Implement --fatal-warnings.
9304 * errors.h (Errors::warning_count): New function.
9305
f1f70eae
ILT
9306 * options.h (class General_options): Add -Bsymbolic-functions.
9307 * symtab.h (Symbol::is_preemptible): Check for
9308 -Bsymbolic-functions.
9309
8825ac63
ILT
93102008-05-05 Ian Lance Taylor <iant@google.com>
9311
d98bc257
ILT
9312 * options.h (DEFINE_bool): For DASH_Z, create the negative option
9313 as noVARNAME rather than no-VARNAME.
9314 (class General_options): Add option -z combreloc.
9315 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
9316 get_address.
9317 (Output_reloc::sort_before) [SHT_REL]: New function.
9318 (Output_reloc::sort_before) [SHT_RELA]: New function.
9319 (class Output_data_reloc_base): Add sort_relocs_ field. Define
9320 Sort_relocs_comparison.
9321 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
9322 parameter. Change all callers.
9323 (Output_data_reloc::Output_data_reloc) [both versions]: Add
9324 sort_relocs parameter. Change all callers.
9325 * output.cc (Output_reloc::get_address): New function, broken out
9326 of write_rel.
9327 (Output_reloc::write_rel): Call it.
9328 (Output_reloc::compare): New function.
9329 (Output_data_reloc_base::do_write): Optionally sort relocs.
9330
60b2b4e7
ILT
9331 * configure.ac: If targ_extra_obj is set, link it in.
9332 * configure.tgt: Initialize all variables.
9333 (x86_64*): Set targ_extra_obj and targ_extra_size.
9334 * configure: Rebuild.
9335
8825ac63
ILT
9336 * object.cc (Sized_relobj::include_section_group): Adjust section
9337 indexes read from group data. Build vector to pass to
9338 layout_group.
9339 * layout.cc (Layout::layout_group): Add flags and shndxes
9340 parameters. Remove contents parameter. Change caller. Update
9341 explicit instantiations.
9342 * layout.h (class Layout): Update layout_group declaration.
9343 * output.cc (Output_data_group::Output_data_group): Add flags and
9344 input_shndxes parameters. Remove contents parameter. Change
9345 caller.
9346 (Output_data_group::do_write): Change input_sections_ to
9347 input_shndxes_.
9348 * output.h (class Output_data_group): Update constructor
9349 declaration. Rename input_sections_ to input_shndxes_.
9350 * testsuite/many_sections_test.cc: Add template.
9351
e94cf127
CC
93522008-04-30 Cary Coutant <ccoutant@google.com>
9353
4418b2d5
CC
9354 * target-reloc.h (relocate_section): Fix dead-pointer bug.
9355
e94cf127
CC
9356 * layout.cc (Layout::include_section): Refactored check for debug
9357 info section.
9358 (Layout::add_comdat): Add new parameters. Change type
9359 of signature parameter. Add object and shndx to signatures table.
9360 (Layout::find_kept_object): New function.
9361 * layout.h: Include <cstring>.
9362 (Layout::is_debug_info_section): New function.
9363 (Layout::add_comdat): Add new parameters.
9364 (Layout::find_kept_object): New function.
9365 (Layout::Kept_section): New struct.
9366 (Layout::Signatures): Change type of map range.
9367 * object.cc (Relobj::output_section_address): New function.
9368 (Sized_relobj::include_section_group): Add new parameters. Change
9369 calls to Layout::add_comdat. Change to build table of kept comdat
9370 groups and table mapping discarded sections to kept sections.
9371 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
9372 (Sized_relobj::do_layout): Change calls to include_section_group and
9373 include_linkonce_section.
9374 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
9375 value to zero when section is discarded.
9376 (Sized_relobj::map_to_kept_section): New function.
9377 * object.h (Relobj::output_section_address): New function.
9378 (Relobj::Comdat_group): New type.
9379 (Relobj::find_comdat_group): New function.
9380 (Relobj::Comdat_group_table): New type.
9381 (Relobj::Kept_comdat_section): New type.
9382 (Relobj::Kept_comdat_section_table): New type.
9383 (Relobj::add_comdat_group): New function.
9384 (Relobj::set_kept_comdat_section): New function.
9385 (Relobj::get_kept_comdat_section): New function.
9386 (Relobj::comdat_groups_): New field.
9387 (Relobj::kept_comdat_sections_): New field.
9388 (Symbol_value::input_value): Update comment.
9389 (Sized_relobj::map_to_kept_section) New function.
9390 (Sized_relobj::include_linkonce_section): Add new parameter.
9391 * target-reloc.h (Comdat_behavior): New type.
9392 (get_comdat_behavior): New function.
9393 (relocate_section): Add code to map a discarded section to the
9394 corresponding kept section when applying a relocation.
9395
e4e5049b
CS
93962008-04-30 Craig Silverstein <csilvers@google.com>
9397
9398 * dwarf_reader.cc (next_generation_count): New static var.
9399 (Addr2line_cache_entry): New struct.
9400 (addr2line_cache): New static var.
9401 (Dwarf_line_info::one_addr2line): Added caching.
9402 (Dwarf_line_info::clear_addr2line_cache): New function.
9403 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
9404 cache-size parameter.
9405 (Dwarf_line_info::one_addr2line_cache): New function.
9406 * symtab.cc (Symbol_table::detect_odr_violations): Pass
9407 new cache-size argument to one_addr2line(), and clear cache.
9408
d09e9154
CC
94092008-04-28 Cary Coutant <ccoutant@google.com>
9410
9411 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
9412 R_386_PC8 relocations.
9413
7ef73768
ILT
94142008-04-23 Ian Lance Taylor <iant@google.com>
9415
55438702
ILT
9416 * object.cc (Sized_relobj::include_section_group): Check for
9417 invalid section group.
9418
c165fb93
ILT
9419 * object.cc (make_elf_object): Correct test for 64-bit ELF file
9420 header size.
9421
7ef73768
ILT
9422 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
9423 than read for file header.
9424 * archive.cc (Archive::include_member): Likewise.
9425
6194aaab
L
94262008-04-23 Paolo Bonzini <bonzini@gnu.org>
9427
9428 * aclocal.m4: Regenerate.
9429 * configure: Regenerate.
9430
d491d34e
ILT
94312008-04-19 Ian Lance Taylor <iant@google.com>
9432
5ea2bac6
ILT
9433 * version.cc (version_string): Bump to 1.6.
9434
7bc3e21a
ILT
9435 * testsuite/Makefile.am (many_sections_r_test): New target.
9436 (many_sections_r_test_SOURCES): Remove.
9437 (many_sections_r_test_DEPENDENCIES): Remove.
9438 (many_sections_r_test_LDFLAGS): Remove.
9439 (many_sections_r_test_LDADD): Remove.
9440
7fcd3aa9
ILT
9441 * object.cc (Sized_relobj::do_add_symbols): Always pass
9442 local_symbol_count_ to add_from_relobj.
9443
4c94d6ae
ILT
9444 * testsuite/Makefile.am (many_sections_check.h): Only check one in
9445 every thousand variables.
9446 * testsuite/Makefile.in: Rebuild.
9447
d491d34e
ILT
9448 * object.cc (Xindex::initialize_symtab_xindex): New function.
9449 (Xindex::read_symtab_xindex): New function.
9450 (Xindex::sym_xindex_to_shndx): New function.
9451 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
9452 available.
9453 (Sized_relobj::do_initialize_xindex): New function.
9454 (Sized_relobj::do_read_symbols): Adjust section links.
9455 (Sized_relobj::symbol_section_and_value): Add is_ordinary
9456 parameter. Change all callers.
9457 (Sized_relobj::include_section_group): Adjust section links and
9458 symbol section indexes.
9459 (Sized_relobj::do_layout): Adjust section links.
9460 (Sized_relobj::do_count_local_symbols): Adjust section links and
9461 symbol section indexes.
9462 (Sized_relobj::do_finalize_local_symbols): Distinguish between
9463 ordinary and special symbols.
9464 (Sized_relobj::write_local_symbols): Add symtab_xindex and
9465 dynsym_xindex parameters. Change all callers. Adjust section
9466 links. Use SHN_XINDEX when needed.
9467 (Sized_relobj::get_symbol_location_info): Adjust section links.
9468 Don't get fooled by special symbols.
9469 * object.h (class Xindex): Define.
9470 (class Object): Add xindex_ parameter. Declare virtual functoin
9471 do_initialize_xindex.
9472 (Object::adjust_sym_shndx): New function.
9473 (Object::set_xindex): New protected function.
9474 (class Symbol_value): Add is_ordinary_shndx_ field.
9475 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
9476 (Symbol_value::value): Assert ordinary section.
9477 (Symbol_value::initialize_input_to_output_map): Likewise.
9478 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
9479 Change all callers.
9480 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
9481 all callers.
9482 (class Sized_relobj): Update declarations.
9483 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
9484 parameter. Change all callers.
9485 (Sized_relobj::adjust_shndx): New function.
9486 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
9487 field.
9488 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
9489 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
9490 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
9491 (Sized_dynobj::read_dynsym_section): Adjust section links.
9492 (Sized_dynobj::read_dynamic): Likewise.
9493 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
9494 section links.
9495 (Sized_dynobj::do_initialize_xindex): New function.
9496 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
9497 do_initialize_xindex.
9498 (Sized_dynobj::adjust_shndx): New function.
9499 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
9500 dynsym_xindex_ fields.
9501 (Layout::finalize): Add a call to set_section_indexes before
9502 creating the symtab sections.
9503 (Layout::set_section_indexes): Don't do anything if the section
9504 already has a section index.
9505 (Layout::create_symtab_sections): Add shnum parameter. Change
9506 caller. Create .symtab_shndx section if needed.
9507 (Layout::create_shdrs): Add shstrtab_section parameter. Change
9508 caller.
9509 (Layout::allocated_output_section_count): New function.
9510 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
9511 needed.
9512 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
9513 fields. Update declarations.
9514 (Layout::symtab_xindex): New function.
9515 (Layout::dynsym_xindex): New function.
9516 (class Write_symbols_task): Add layout_ field.
9517 (Write_symbols_task::Write_symbols_task): Add layout parameter.
9518 Change caller.
9519 * output.cc (Output_section_headers::Output_section_headers): Add
9520 shstrtab_section parameter. Change all callers.
9521 (Output_section_headers::do_sized_write): Store overflow values
9522 for section count and section string table section index in
9523 section header zero.
9524 (Output_file_header::do_sized_write): Check for overflow of
9525 section count and section string table section index.
9526 (Output_symtab_xindex::do_write): New function.
9527 (Output_symtab_xindex::endian_do_write): New function.
9528 * output.h (class Output_section_headers): Add shstrtab_section_.
9529 Update declarations.
9530 (class Output_symtab_xindex): Define.
9531 (Output_section::has_out_shndx): New function.
9532 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
9533 field.
9534 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
9535 Change all callers.
9536 (Sized_symbol::init): Likewise.
9537 (Symbol::output_section): Check for ordinary symbol.
9538 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
9539 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
9540 callers.
9541 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
9542 Change all callers. Simplify handling of symbols from sections
9543 not included in the link.
9544 (Symbol_table::add_from_dynobj): Handle ordinary symbol
9545 distinction.
9546 (Weak_alias_sorter::operator()): Assert that symbols are
9547 ordinary.
9548 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
9549 distinction.
9550 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
9551 parameters. Change all callers.
9552 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
9553 symbol distinction. Use SHN_XINDEX when needed.
9554 (Symbol_table::write_section_symbol): Add symtab_xindex
9555 parameter. Change all callers.
9556 (Symbol_table::sized_write_section_symbol): Likewise. Use
9557 SHN_XINDEX when needed.
9558 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
9559 declarations.
9560 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
9561 (Symbol::is_defined): Check is_ordinary.
9562 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
9563 (Symbol::is_absolute, Symbol::is_common): Likewise.
9564 (class Sized_symbol): Update declarations.
9565 (class Symbol_table): Update declarations.
9566 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
9567 parameters. Change all callers.
9568 (Sized_symbol::override): Likewise.
9569 (Symbol_table::override): Likewise.
9570 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
9571 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
9572 is_ordinary, and orig_st_shndx parameters. Change all callers.
9573 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
9574 to be in an ordinary section.
9575 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
9576 object and is_ordinary parameters. Change all callers.
9577 (Sized_dwarf_line_info::read_relocs): Add object parameter.
9578 Change all callers. Don't add undefined or non-ordinary symbols
9579 to reloc_map_.
9580 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
9581 Change all callers.
9582 * dwarf_reader.h (class Sized_dwarf_line_info): Update
9583 declarations.
9584 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
9585 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
9586 (Sized_relobj::relocate_sections): Likewise.
9587 * target-reloc.h (scan_relocs): Adjust section symbol index.
9588 (scan_relocatable_relocs): Likewise.
9589 * i386.cc (Scan::local): Check for ordinary symbols.
9590 * sparc.cc (Scan::local): Likewise.
9591 * x86_64.cc (Scan::local): Likewise.
9592 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
9593 to symbol_section_and_value.
9594 * testsuite/many_sections_test.cc: New file.
9595 * testsuite/Makefile.am (BUILT_SOURCES): Define.
9596 (check_PROGRAMS): Add many_sections_test.
9597 (many_sections_test_SOURCES): Define.
9598 (many_sections_test_DEPENDENCIES): Define.
9599 (many_sections_test_LDFLAGS): Define.
9600 (BUILT_SOURCES): Add many_sections_define.h.
9601 (many_sections_define.h): New target.
9602 (BUILT_SOURCES): Add many_sections_check.h.
9603 (many_sections_check.h): New target.
9604 (check_PROGRAMS): Add many_sections_r_test.
9605 (many_sections_r_test_SOURCES): Define.
9606 (many_sections_r_test_DEPENDENCIES): Define.
9607 (many_sections_r_test_LDFLAGS): Define.
9608 (many_sections_r_test_LDADD): Define.
9609 (many_sections_r_test.o): New target.
9610 * testsuite/Makefile.in: Rebuild.
9611
c5818ff1
CC
96122008-04-17 Cary Coutant <ccoutant@google.com>
9613
9614 * errors.cc (Errors::info): New function.
9615 (gold_info): New function.
9616 * errors.h (Errors::info): New function.
9617 * gold.h (gold_info): New function.
9618 * object.cc (Input_objects::add_object): Print trace output.
9619 * options.cc (options::parse_set): New function.
9620 (General_options::parse_wrap): Deleted.
9621 (General_options::General_options): Deleted initializer.
9622 * options.h (options::String_set): New typedef.
9623 (options::parse_set): New function.
9624 (DEFINE_set): New macro.
9625 (General_options::wrap): Changed to use DEFINE_set. Changed
9626 callers of any_wrap_symbols and is_wrap_symbol.
9627 (General_options::trace, General_options::trace_symbol):
9628 New options.
9629 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
9630 (General_options::wrap_symbols_): Deleted.
9631 * symtab.cc (Symbol_table::add_from_object): Print trace output.
9632
b5be4a7c
DM
96332008-04-17 David S. Miller <davem@davemloft.net>
9634
9635 * options.cc (General_options::parse_V): New function.
9636 * options.h: Add entries for -V and -Qy.
9637
155a0dd7
ILT
96382008-04-17 Ian Lance Taylor <iant@google.com>
9639
9640 * common.cc (Symbol_table::allocate_commons): Remove options
9641 parameter. Change caller.
9642 (Symbol_table::do_allocate_commons): Remove options parameter.
9643 Change caller. Just call do_allocate_commons_list twice.
9644 (Symbol_table::do_allocate_commons_list): New function, broken out
9645 of do_allocate_commons.
9646 * common.h (class Allocate_commons_task): Remove options_ field.
9647 Update constructor.
9648 * symtab.cc (Symbol_table::Symbol_table): Initialize
9649 tls_commons_.
9650 (Symbol_table::add_from_object): Put TLS common symbols on
9651 tls_commons_ list.
9652 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
9653 which are IN_OUTPUT_DATA.
9654 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
9655 allocate_commons and do_allocate_commons declarations. Declare
9656 do_allocate_commons_list.
9657 * gold.cc (queue_middle_tasks): Update creation of
9658 Allocate_commons_task to not pass options.
9659 * testsuite/Makefile.am (INCLUDES): Add -I.. .
9660 (TLS_TEST_C_FLAGS): New variable.
9661 (tls_test_c_pic.o): New target.
9662 (tls_test_shared.so): Link in tls_test_c_pic.o.
9663 (tls_test_c_pic_ie.o): New target.
9664 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
9665 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
9666 (tls_test_c.o): New target.
9667 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
9668 (tls_pic_test_LDADD): Likewise.
9669 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
9670 (tls_shared_gd_to_ie_test_LDADD): Likewise.
9671 (tls_test_c_gnu2.o): New target.
9672 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
9673 tls_test_c_gnu2.o.
9674 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
9675 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
9676 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
9677 * testsuite/tls_test.cc: Include "config.h".
9678 (t_last): Call t11_last.
9679 * testsuite/tls_test.h (t11, t11_last): Declare.
9680 * testsuite/tls_test_c.c: New file.
9681 * testsuite/tls_test_main.cc (thread_routine): Call t11.
9682 * configure.ac: Check for OpenMP support.
9683 * configure, config.in, Makefile.in: Rebuild.
9684 * testsuite/Makefile.in: Rebuild.
9685
edfbb029
CC
96862008-04-16 Cary Coutant <ccoutant@google.com>
9687
9688 * i386.cc (Target_i386::define_tls_base_symbol): New function.
9689 (Target_i386::tls_base_symbol_defined_): New field.
9690 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9691 (Target_i386::Scan::global): Likewise.
9692 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
9693 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
9694 (Target_x86_64::tls_base_symbol_defined_): New field.
9695 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9696 (Target_x86_64::Scan::global): Likewise.
9697
f3c69fca
CC
96982008-04-16 Cary Coutant <ccoutant@google.com>
9699
9700 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
9701 (Symbol::needs_plt_entry): Allow weak undefined symbols.
9702 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
9703 building shared libraries.
9704 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
9705 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
9706 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
9707 * testsuite/Makefile.in: Rebuild.
9708 * testsuite/weak_undef.h: New file.
9709 * testsuite/weak_undef_file1.cc: Add extra test cases.
9710 * testsuite/weak_undef_file2.cc: Likewise.
9711 * testsuite/weak_undef_test.cc: Likewise.
9712
7c414435
DM
97132008-04-16 David S. Miller <davem@davemloft.net>
9714
32b769e1
DM
9715 * sparc.cc (Target_sparc::Scan): Change from struct to class.
9716 Add issued_non_pic_error_ field. Declare check_non_pic.
9717 (Target_sparc::Scan::check_non_pic): New function.
9718 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
9719 (Target_sparc::Scan::global): Likewise.
9720
11936fb1
DM
9721 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
9722 * configure: Rebuild.
9723
7c414435
DM
9724 * options.h (DEFINE_enable): New macro.
9725 (new_dtags): New enable option.
9726 (initfirst, interpose, loadfltr, nodefaultlib,
9727 nodelete, nodlopen, nodump): New -z options.
9728 * layout.cc (Layout:finish_dynamic_section): If new
9729 dtags enabled, emit DT_RUNPATH. Also, emit a
9730 DT_FLAGS_1 containing any specified -z flags.
9731
85c7bf8b
ILT
97322008-04-16 Ian Lance Taylor <iant@google.com>
9733
12c0daef
ILT
9734 * copy-relocs.cc: New file.
9735 * copy-relocs.h: New file.
9736 * reloc.cc: Remove Copy_relocs code.
9737 * reloc.h: Likewise.
9738 * reloc-types.h (struct Reloc_types) [both versions]: Add
9739 get_reloc_addend_noerror.
9740 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
9741 variants of add_global which take an addend which must be zero.
9742 * i386.cc: Include "copy-relocs.h".
9743 (class Target_i386): Change type of copy_relocs_ to variable,
9744 update initializer.
9745 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
9746 Change all callers.
9747 (Target_i386::do_finalize_sections): Change handling of
9748 copy_relocs_.
9749 * sparc.cc: Include "copy-relocs.h".
9750 (class Target_sparc): Change type of copy_relocs_ to variable,
9751 update initializer.
9752 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
9753 Change all callers.
9754 (Target_sparc::do_finalize_sections): Change handling of
9755 copy_relocs_.
9756 * x86_64.cc: Include "copy-relocs.h".
9757 (class Target_x86_64): Change type of copy_relocs_ to variable,
9758 update initializer.
9759 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
9760 class. Change all callers.
9761 (Target_x86_64::do_finalize_sections): Change handling of
9762 copy_relocs_.
9763 * Makefile.am (CCFILES): Add copy-relocs.cc.
9764 (HFILES): Add copy-relocs.h.
9765
4f4995b6
ILT
9766 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
9767
85c7bf8b
ILT
9768 * testsuite/script_test_4.sh: Permit leading zeroes.
9769
4f2a9edd
ILT
97702008-04-15 Ian Lance Taylor <iant@google.com>
9771
e6188289
ILT
9772 * script-sections.cc (Script_sections::create_segments): Use
9773 header_size_adjustment even when there is enough room for the
9774 headers.
9775 * testsuite/script_test_4.sh: New file.
9776 * testsuite/script_test_4.t: New file.
9777 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
9778 (check_DATA): Add script_test_4.stdout.
9779 (MOSTLYCLEANFILES): Likewise.
9780 (script_test_4): New target.
9781 (script_test_4.stdout): New target.
9782 * testsuite/Makefile.in: Rebuild.
9783
4f2a9edd
ILT
9784 * sparc.cc: Add definitions for Output_data_plt_sparc class
9785 constants.
9786
f5314dd5
DM
97872008-04-14 David S. Miller <davem@davemloft.net>
9788
9789 * sparc.cc: New file.
9790 * Makefile.am (TARGETSOURCES): Add sparc.cc
9791 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
9792 * configure.tgt: Document targ_extra_size and
9793 targ_extra_big_endian. Add entries for sparc-* and
9794 sparc64-*.
9795 * configure.ac: Handle targ_extra_size and
9796 targ_extra_big_endian.
9797 * Makefile.in: Rebuild.
9798 * configure: Likewise.
9799 * po/POTFILES.in: Likewise.
9800 * po/gold.pot: Likewise.
9801
154e0e9a
ILT
98022008-04-14 Ian Lance Taylor <iant@google.com>
9803
9804 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
9805 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
9806 in the name/type/flags to section mapping. Don't call
9807 allocate_output_section.
9808 (Layout::choose_output_section): Change parameter from adjust_name
9809 to is_input_section. Don't permit input sections after sections
9810 are attached to segments. Don't call allocate_output_section.
9811 (Layout::layout_eh_frame): Call update_flags_for_input_section,
9812 not write_enable_output_section.
9813 (Layout::make_output_section): Don't push to
9814 unattached_section_list_ nor call attach_to_segment. Call
9815 attach_section_to_segment if sections are attached.
9816 (Layout::attach_sections_to_segments): New function.
9817 (Layout::attach_section_to_segment): New function.
9818 (Layout::attach_allocated_section_to_segment): Rename from
9819 attach_to_segment. Remove flags parameter.
9820 (Layout::allocate_output_section): Remove function.
9821 (Layout::write_enable_output_section): Remove function.
9822 * layout.h (class Layout): Update for above changes. Add new
9823 field sections_are_attached_.
9824 * output.h (Output_section::update_flags_for_input_section): New
9825 function.
9826 * output.cc (Output_section::add_input_section): Call
9827 update_flags_for_input_section.
9828 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
9829
009a67a2
CC
98302008-04-11 Cary Coutant <ccoutant@google.com>
9831
9832 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
9833 thought unnecessary.
9834 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
9835
759b1a24
ILT
98362008-04-11 Ian Lance Taylor <iant@google.com>
9837
9838 * output.h (class Output_section_data): Remove inline definition
9839 of set_addralign.
9840 * output.cc (Output_section_data::set_addralign): New function.
9841
c2b45e22
CC
98422008-04-11 Cary Coutant <ccoutant@google.com>
9843
9844 Add support for TLS descriptors for i386 and x86_64.
9845 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
9846 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
9847 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
9848 GOT_TYPE_TLS_DESC.
9849 (Target_i386::got_mod_index_entry): Remove unnecessary code.
9850 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
9851 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
9852 relocations.
9853 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
9854 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
9855 Fix problem with initial-exec relocations.
9856 (Target_i386::Relocate::relocate_tls): Likewise.
9857 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
9858 relaxation.
9859 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
9860 support for section-plus-offset dynamic table entries.
9861 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
9862 (Output_data_dynamic::Dynamic_entry): Add support for
9863 section-plus-offset dynamic table entries.
9864 (Output_data_dynamic::Classification): Likewise.
9865 (Output_data_dynamic::classification_): Renamed offset_.
9866 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
9867 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
9868 (Target_x86_64::make_plt_section): New function.
9869 (Target_x86_64::reserve_tlsdesc_entries): New function.
9870 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
9871 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
9872 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
9873 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
9874 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
9875 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
9876 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
9877 add extra PLT entry for TLS descriptors.
9878 (Output_data_plt_x86_64::got_): New field.
9879 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
9880 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
9881 fields.
9882 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
9883 descriptors.
9884 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
9885 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
9886 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
9887 R_386_TLS_DESC_CALL relocations.
9888 (Target_x86_64::Scan::global): Likewise.
9889 (Target_x86_64::do_finalize_sections): Add dynamic table entries
9890 for TLS descriptors.
9891 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
9892 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
9893 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
9894 GD-to-IE relaxation.
9895 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
9896 and TLS_DESCRIPTORS.
9897 * Makefile.in: Rebuild.
9898 * configure: Rebuild.
9899 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
9900 (tls_test_shared2.so): New target.
9901 (tls_shared_gd_to_ie_test_SOURCES): New variable.
9902 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
9903 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
9904 (tls_shared_gd_to_ie_test_LDADD): New variable.
9905 (tls_shared_gnu2_gd_to_ie_test): New target.
9906 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
9907 New targets.
9908 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
9909 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
9910 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
9911 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
9912 (tls_shared_gnu2_test): New target.
9913 (tls_test_gnu2_shared.so): New target.
9914 (tls_shared_gnu2_test_SOURCES): New variable.
9915 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
9916 (tls_shared_gnu2_test_LDFLAGS): New variable.
9917 (tls_shared_gnu2_test_LDADD): New variable.
9918 * testsuite/Makefile.in: Rebuild.
9919 * testsuite/Makefile.
9920
83bfb6b7
ILT
99212008-04-11 Ian Lance Taylor <iant@google.com>
9922
9923 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
9924 justsyms.t.
9925 * testsuite/Makefile.in: Rebuild.
9926
9927 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
9928 long.
9929 * testsuite/script_test_2.cc (main): Adjust test.
9930
706e1f5e
ILT
99312008-04-11 David S. Miller <davem@davemloft.net>
9932 Ian Lance Taylor <iant@google.com>
9933
9934 * options.h (General_options): Add entries for '-Y' and
9935 '-relax'.
9936 * options.cc (General_options:finalize): If -Y was used, add those
9937 entries to the library path instead of the default "/lib" and
9938 "/usr/lib".
9939
7c98e6bb
DM
99402008-04-11 David S. Miller <davem@davemloft.net>
9941
9942 * testsuite/justsyms.t: Start at 0x100.
9943 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
9944 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
9945 long.
9946 * testsuite/script_test_2.cc: Adjust string and section length
9947 checks.
7c98e6bb 9948
99a37bfd
ILT
99492008-04-09 Ian Lance Taylor <iant@google.com>
9950
2cefc357
ILT
9951 PR gold/5996
9952 * script-sections.cc (Sections_element::allocate_to_segment): Add
9953 orphan parameter.
9954 (Output_section_definition::allocate_to_segment): Likewise.
9955 (Orphan_output_section::allocate_to_segment): Likewise.
9956 (Script_sections::attach_sections_using_phdrs_clause): Don't
9957 propagate non-PT_LOAD segments to orphan sections.
9958 * testsuite/Makefile.am (script_test_3.stdout): Generate using
9959 readelf rather than objdump.
9960 * testsuite/script_test_3.sh: Adjust accordingly. Test that
9961 .interp section and PT_INTERP segment are the same size.
9962 * testsuite/Makefile.in: Rebuild.
9963
99a37bfd
ILT
9964 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
9965 aliases for symbols defined in the same object.
9966 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
9967 (weak_alias_test_SOURCES): New variable.
9968 (weak_alias_test_DEPENDENCIES): New variable.
9969 (weak_alias_test_LDFLAGS): New variable.
9970 (weak_alias_test_LDADD): New variable.
9971 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
9972 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
9973 (weak_alias_test_3.o): New target.
9974 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
9975 * testsuite/weak_alias_test_main.cc: New file.
9976 * testsuite/weak_alias_test_1.cc: New file.
9977 * testsuite/weak_alias_test_2.cc: New file.
9978 * testsuite/weak_alias_test_3.cc: New file.
9979
780e49c5
ILT
99802008-04-08 Ian Lance Taylor <iant@google.com>
9981
cdb0b8f5
ILT
9982 * options.h (class General_options): Add --noinhibit-exec option.
9983 * main.cc (main): Check --noinhibit-exec.
9984
0864d551
ILT
9985 * options.h (class General_options): Define --wrap as a special
9986 option. Add wrap_symbols_ field.
9987 (General_options::any_wrap_symbols): New function.
9988 (General_options::is_wrap_symbol): New function.
9989 * options.cc (General_options::parse_wrap): New function.
9990 (General_options::General_options): Initialize wrap_symbols_.
9991 * symtab.cc (Symbol_table::wrap_symbol): New function.
9992 (Symbol_table::add_from_object): Handle --wrap.
9993 * symtab.h (class Symbol_table): Declare wrap_symbol.
9994 * target.h (Target::wrap_char): New function.
9995 (Target::Target_info): Add wrap_char field.
9996 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
9997 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9998 * testsuite/testfile.cc (Target_test::test_target_info):
9999 Likewise.
10000
789aa6de
ILT
10001 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10002 there is one.
10003
2c38906f
ILT
10004 * layout.h (class Layout): Add added_eh_frame_data_ field.
10005 * layout.cc (Layout::Layout): Initialize new field.
10006 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10007 output section until we find a section we merged successfully.
10008 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10009 that the size be non-zero.
10010
780e49c5
ILT
10011 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10012 qualifier.
10013
7fcd0256
ILT
100142008-04-08 Craig Silverstein <csilvers@google.com>
10015
10016 * configure.ac: Export new conditional variable HAVE_ZLIB.
10017 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10018 on HAVE_ZLIB.
10019 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10020 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10021
6835af53
ILT
100222008-04-07 Ian Lance Taylor <iant@google.com>
10023
e24f324c
ILT
10024 * version.cc (version_string): Set to "1.5".
10025
a036edd8
ILT
10026 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10027 Add issued_non_pic_error_ field. Declare check_non_pic.
10028 (Target_x86_64::Scan::check_non_pic): New function.
10029 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10030 (Target_x86_64::Scan::global): Likewise.
10031
624f8810
ILT
10032 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10033 addend parameter. Change caller. Handle merge sections.
10034 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10035 Address to Addend. Don't add in the result of
10036 local_section_offset, pass down the addend and use the returned
10037 value.
10038 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10039 Update declarations of local_section_offset and symbol_value.
10040 * testsuite/two_file_test_1.cc (t18): New function.
10041 * testsuite/two_file_test_2.cc (f18): New function.
10042 * testsuite/two_file_test_main.cc (main): Call t18.
10043 * testsuite/two_file_test.h (t18, f18): Declare.
10044
6835af53
ILT
10045 * configure.ac: Don't test for objdump, c++filt, or readelf.
10046 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10047 conditionals.
10048 (TEST_READELF): New variable.
10049 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10050 (check_PROGRAMS): Add two_file_strip_test.
10051 (two_file_strip_test): New target.
10052 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10053 (two_file_same_shared_strip_test_SOURCES): New variable.
10054 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10055 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10056 (two_file_same_shared_strip_test_LDADD): New variable.
10057 (two_file_shared_strip.so): New target.
10058 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10059 (ver_test_5.syms, ver_test_7.syms): Likewise.
10060 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10061 (strip_test_3.stdout): Use TEST_OBJDUMP.
10062 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10063
86925eef
CC
100642008-04-04 Cary Coutant <ccoutant@google.com>
10065
10066 * symtab.h (Symbol::is_weak_undefined): New function.
10067 (Symbol::is_strong_undefined): New function.
10068 (Symbol::is_absolute): New function.
10069 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10070 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10071 absolute symbols.
10072 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10073 (weak_undef_test): New target.
10074 * testsuite/Makefile.in: Rebuild.
10075 * testsuite/weak_undef_file1.cc: New file.
10076 * testsuite/weak_undef_file2.cc: New file.
10077 * testsuite/weak_undef_test.cc: New file.
10078
126f3ece
ILT
100792008-04-03 Craig Silverstein <csilvers@google.com>
10080
10081 * compressed_output.h (class Output_compressed_section): Use
10082 unsigned buffer.
10083 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10084 add zlib header.
10085 (zlib_compressed_suffix): Removed.
10086 (Output_compressed_section::set_final_data_size): Use unsigned
10087 buffers.
10088 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10089 Fix linker invocation.
10090 (flagstest_o_specialfile_and_compress_debug_sections):
10091 Likewise.
10092 * testsuite/Makefile.in: Regenerated.
10093
deae2a14
DM
100942008-04-02 David S. Miller <davem@davemloft.net>
10095
10096 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10097 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10098
70752818
ILT
100992008-04-02 Craig Silverstein <csilvers@google.com>
10100
10101 * TODO: New file.
10102
39d0cb0e
ILT
101032008-04-02 Ian Lance Taylor <iant@google.com>
10104
10105 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10106 parameters. Update for new key type to views_. Change all
10107 callers.
10108 (File_read::read): Adjust for byteshift in returned view.
10109 (File_read::add_view): New function, broken out of
10110 find_and_make_view.
10111 (File_read::make_view): New function, broken out of
10112 find_and_make_view.
10113 (File_read::find_or_make_view): Add offset and aligned
10114 parameters. Rewrite accordingly. Change all callers.
10115 (File_read::get_view): Add offset and aligned parameters. Adjust
10116 for byteshift in return value.
10117 (File_read::get_lasting_view): Likewise.
10118 * fileread.h (class File_read): Update declarations.
10119 (class File_read::View): Add byteshift_ field. Add byteshift to
10120 constructor. Add byteshift method.
10121 * archive.h (Archive::clear_uncached_views): New function.
10122 (Archive::get_view): Add aligned parameter. Change all callers.
10123 * object.h (Object::get_view): Add aligned parameter. Change all
10124 callers.
10125 (Object::get_lasting_view): Likewise.
10126
10127 * fileread.cc (File_read::release): Don't call clear_views if
10128 there are multiple objects.
10129 * fileread.h (File_read::clear_uncached_views): New function.
10130 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10131 on the archive.
10132
a1207466
CC
101332008-03-31 Cary Coutant <ccoutant@google.com>
10134
10135 Add thin archive support.
10136 * archive.cc (Archive::armagt): New const.
10137 (Archive::setup): Remove task parameter and calls to unlock.
10138 (Archive::unlock_nested_archives): New function.
10139 (Archive::read_header): Add nested_off parameter. Change
10140 all callers.
10141 (Archive::interpret_header): Likewise.
10142 (Archive::include_all_members): Change to handle thin
10143 archives.
10144 (Archive::include_member): Likewise.
10145 * archive.h (Archive::Archive): Add new parameters and
10146 initializers.
10147 (Archive::armagt): New const.
10148 (Archive::setup): Remove task parameter.
10149 (Archive::unlock_nested_archives): New function.
10150 (Archive::read_header): Add nested_off parameter.
10151 (Archive::interpret_header): Likewise.
10152 (Archive::Nested_archive_table): New typedef.
10153 (Archive::is_thin_archive_): New field.
10154 (Archive::nested_archives_): New field.
10155 (Archive::options_): New field.
10156 (Archive::dirpath_): New field.
10157 (Archive::task_): New field.
10158 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10159 for thin archives. Pass additional parameters to
10160 Archive::Archive. Unlock the archive file after calling
10161 Archive::setup.
cd536b21 10162
479f6503
ILT
101632008-03-29 Ian Lance Taylor <iant@google.com>
10164
686c8caf
ILT
10165 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10166 version symbol to be local.
10167 * testsuite/ver_test_4.sh: New file.
10168 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10169 (check_DATA): Add ver_test_4.syms.
10170 (ver_test_4.syms): New target.
10171 * testsuite/Makefile.in: Rebuild.
10172
ab794b6b
ILT
10173 * output.cc
10174 (Output_section::Input_section_sort_entry::has_priority): New
10175 function.
10176 (Output_section::Input_section_sort_entry::match_file_name): New
10177 function.
10178 (Output_section::Input_section_sort_entry::match_section_name):
10179 Remove.
10180 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10181 Remove.
10182 (Output_section::Input_section_sort_entry::match_section_file):
10183 Remove.
10184 (Output_section::Input_section_sort_compare::operator()): Rewrite
10185 using new Input_section_sort_entry functions. Sort crtbegin and
10186 crtend first. Sort sections with no priority before sections with
10187 a priority.
10188 * testsuite/initpri1.c (d3): Check j != 4.
10189 (cd5): New constructor/destructor function.
10190 (main): Check j != 2.
10191
479f6503
ILT
10192 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10193 new symbol when resolving, don't call set_is_default.
10194 * testsuite/ver_test_7.cc: New file.
10195 * testsuite/ver_test_7.sh: New file.
10196 * testsuite/Makefile.am (ver_test_7.so): New target.
10197 (ver_test_7.o): New target.
10198 (check_SCRIPTS): Add ver_test_7.sh.
10199 (check_DATA): Add ver_test_7.syms.
10200 (ver_test_7.syms): New target.
10201
2fd32231
ILT
102022008-03-28 Ian Lance Taylor <iant@google.com>
10203
10204 * layout.cc (Layout::layout): If we see an input section with a
10205 name that needs sorting, set the must_sort flag for the output
10206 section.
10207 (Layout::make_output_section): If the name of the output section
10208 indicates that it might require sorting, set the may_sort flag.
10209 * output.h (Output_section::may_sort_attached_input_sections): New
10210 function.
10211 (Output_section::set_may_sort_attached_input_sections): New
10212 function.
10213 (Output_section::must_sort_attached_input_sections): New
10214 function.
10215 (Output_section::set_must_sort_attached_input_sections): New
10216 function.
10217 (class Output_section): Declare Input_section_sort_entry. Define
10218 Input_section_sort_compare. Declare
10219 sort_attached_input_sections. Add new fields:
10220 may_sort_attached_input_sections_,
10221 must_sort_attached_input_sections_,
10222 attached_input_sections_are_sorted_.
10223 * output.cc (Output_section::Output_section): Initialize new
10224 fields.
10225 (Output_section::add_input_section): Add an entry to
10226 input_sections_ if may_sort or must_sort are true.
10227 (Output_section::set_final_data_size): Call
10228 sort_attached_input_sections if necessary.
10229 (Output_section::Input_section_sort_entry): Define new class.
10230 (Output_section::Input_section_sort_compare::operator()): New
10231 function.
10232 (Output_section::sort_attached_input_sections): New function.
10233 * configure.ac: Check whether the compiler supports constructor
10234 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
10235 * testsuite/initpri1.c: New file.
10236 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
10237 CONSTRUCTOR_PRIORITY.
10238 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
10239 (initpri1_LDFLAGS): New variable.
10240 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10241
18e6b24e
ILT
102422008-03-27 Ian Lance Taylor <iant@google.com>
10243
49bdd526
ILT
10244 * common.cc (Sort_commons::operator): Correct sorting algorithm.
10245 * testsuite/common_test_1.c: New file.
10246 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
10247 (common_test_1_SOURCES): New variable.
10248 (common_test_1_DEPENDENCIES): New variable.
10249 (common_test_1_LDFLAGS): New variable.
10250
18e6b24e
ILT
10251 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
10252 and commons_ correctly when NAME/VERSION does not override
10253 NAME/NULL.
10254 * testsuite/ver_test_6.c: New file.
10255 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
10256 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
10257 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
10258
04bf7072
ILT
102592008-03-26 Ian Lance Taylor <iant@google.com>
10260
5871526f
ILT
10261 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
10262 of an undefined symbol from a version script.
10263 * testsuite/Makefile.am (ver_test_5.so): New target.
10264 (ver_test_5.o): New target.
10265 (check_SCRIPTS): Add ver_test_5.sh.
10266 (check_DATA): Add ver_test_5.syms.
10267 (ver_test_5.syms): New target.
10268 * testsuite/ver_test_5.cc: New file.
10269 * testsuite/ver_test_5.script: New file.
10270 * testsuite/ver_test_5.sh: New file.
10271 * Makefile.in, testsuite/Makefile.in: Rebuild.
10272
04bf7072
ILT
10273 PR gold/5986
10274 Fix problems building gold with gcc 4.3.0.
10275 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
10276 (gold_error_at_location, gold_warning_at_location): Use it.
10277 * configure.ac: Check whether we can compile and use a template
10278 function with a printf attribute.
10279 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
10280 when jumping over bytes.
10281 * object.cc: Instantiate Object::read_section_data.
10282 * debug.h: Include <cstring>
10283 * dwarf_reader.cc: Include <algorithm>
10284 * main.cc: Include <cstring>.
10285 * options.cc: Include <cstring>.
10286 * output.cc: Include <cstring>.
10287 * script.cc: Include <cstring>.
10288 * script.h: Include <string>.
10289 * symtab.cc: Include <cstring> and <algorithm>.
10290 * target-select.cc: Include <cstring>.
10291 * version.cc: Include <string>.
10292 * testsuite/testmain.cc: Include <cstdlib>.
10293 * configure, config.in: Rebuild.
10294
874c5b28
ILT
102952008-03-25 Ian Lance Taylor <iant@google.com>
10296
819d6c3a
ILT
10297 * options.cc: Include "../bfd/bfdver.h".
10298 (options::help): Print bug reporting address.
10299
f4b2c6f5
ILT
10300 * version.cc (print_version): Adjust output for current value of
10301 BFD_VERSION_STRING.
10302
10303 * NEWS: New file.
10304
e96caa79
ILT
10305 * options.cc (options::help): Print list of supported targets.
10306 * target-select.h: Include <vector>.
10307 (class Target_selector): Make machine_, size_, and is_big_endian_
10308 fields const. Add bfd_name_ and instantiated_target_ fields.
10309 (Target_selector::Target_selector): Add bfd_name parameter.
10310 (Target_selector::recognize): Make non-virtual, call
10311 do_recognize.
10312 (Target_selector::recognize_by_name): Make non-virtual, call
10313 do_recognize_by_name.
10314 (Target_selector::supported_names): New function.
10315 (Target_selector::bfd_name): New function.
10316 (Target_selector::do_instantiate_target): New pure virtual
10317 function.
10318 (Target_selector::do_recognize): New virtual function.
10319 (Target_selector::do_recognize_by_name): New virtual function.
10320 (Target_selector::instantiate_target): New private function.
10321 (supported_target_names): Declare.
10322 * target-select.cc (Target_selector::Target_selector): Update for
10323 new parameter and fields.
10324 (select_target_by_name): Check that the name matches before
10325 calling recognize_by_name.
10326 (supported_target_names): New function.
10327 * i386.cc (class Target_selector_i386): Update Target_selector
10328 constructor call. Remove recognize and recognize_by_name. Add
10329 do_instantiate_target.
10330 * x86_64.cc (class Target_selector_x86_64): Likewise.
10331 * testsuite/testfile.cc (class Target_selector_test): Update for
10332 changes to Target_selector.
10333
874c5b28
ILT
10334 * README: Rewrite, with some notes on unsupported features.
10335
0a65a3a7
CC
103362008-03-24 Cary Coutant <ccoutant@google.com>
10337
10338 * i386.cc (Target_i386::Got_type): New enum declaration.
10339 (Target_i386::Scan::local): Updated callers of Output_data_got
10340 member functions.
10341 (Target_i386::Scan::global): Likewise.
10342 (Target_i386::Relocate::relocate): Likewise.
10343 (Target_i386::Relocate::relocate_tls): Likewise.
10344 * object.h (Got_offset_list): New class.
10345 (Sized_relobj::local_has_got_offset): Added got_type parameter.
10346 (Sized_relobj::local_got_offset): Likewise.
10347 (Sized_relobj::set_local_got_offset): Likewise.
10348 (Sized_relobj::local_has_tls_got_offset): Removed.
10349 (Sized_relobj::local_tls_got_offset): Removed.
10350 (Sized_relobj::set_local_tls_got_offset): Removed.
10351 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
10352 * output.cc (Output_data_got::add_global): Added got_type parameter.
10353 (Output_data_got::add_global_with_rel): Likewise.
10354 (Output_data_got::add_global_with_rela): Likewise.
10355 (Output_data_got::add_global_pair_with_rel): New function.
10356 (Output_data_got::add_global_pair_with_rela): New function.
10357 (Output_data_got::add_local): Added got_type parameter.
10358 (Output_data_got::add_local_with_rel): Likewise.
10359 (Output_data_got::add_local_with_rela): Likewise.
10360 (Output_data_got::add_local_pair_with_rel): New function.
10361 (Output_data_got::add_local_pair_with_rela): New function.
10362 (Output_data_got::add_global_tls): Removed.
10363 (Output_data_got::add_global_tls_with_rel): Removed.
10364 (Output_data_got::add_global_tls_with_rela): Removed.
10365 (Output_data_got::add_local_tls): Removed.
10366 (Output_data_got::add_local_tls_with_rel): Removed.
10367 (Output_data_got::add_local_tls_with_rela): Removed.
10368 * output.h (Output_data_got::add_global): Added got_type parameter.
10369 (Output_data_got::add_global_with_rel): Likewise.
10370 (Output_data_got::add_global_with_rela): Likewise.
10371 (Output_data_got::add_global_pair_with_rel): New function.
10372 (Output_data_got::add_global_pair_with_rela): New function.
10373 (Output_data_got::add_local): Added got_type parameter.
10374 (Output_data_got::add_local_with_rel): Likewise.
10375 (Output_data_got::add_local_with_rela): Likewise.
10376 (Output_data_got::add_local_pair_with_rel): New function.
10377 (Output_data_got::add_local_pair_with_rela): New function.
10378 (Output_data_got::add_global_tls): Removed.
10379 (Output_data_got::add_global_tls_with_rel): Removed.
10380 (Output_data_got::add_global_tls_with_rela): Removed.
10381 (Output_data_got::add_local_tls): Removed.
10382 (Output_data_got::add_local_tls_with_rel): Removed.
10383 (Output_data_got::add_local_tls_with_rela): Removed.
10384 * resolve.cc (Symbol::override_base_with_special): Removed
10385 reference to has_got_offset_ field.
10386 * symtab.cc (Symbol::init_fields): Replaced initialization
10387 of got_offset_ with got_offsets_. Removed initialization
10388 of has_got_offset_
53fcba31 10389 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
10390 (Symbol::got_offset): Likewise.
10391 (Symbol::set_got_offset): Likewise.
10392 (Symbol::has_tls_got_offset): Removed.
10393 (Symbol::tls_got_offset): Removed.
10394 (Symbol::set_tls_got_offset): Removed.
10395 (Symbol::got_offset_): Removed.
10396 (Symbol::tls_mod_got_offset_): Removed.
10397 (Symbol::tls_pair_got_offset_): Removed.
10398 (Symbol::got_offsets_): New field.
10399 (Symbol::has_got_offset): Removed.
10400 (Symbol::has_tls_mod_got_offset): Removed.
10401 (Symbol::has_tls_pair_got_offset): Removed.
10402 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
10403 (Target_x86_64::Scan::local): Updated callers of Output_data_got
10404 member functions.
10405 (Target_x86_64::Scan::global): Likewise.
10406 (Target_x86_64::Relocate::relocate): Likewise.
10407 (Target_x86_64::Relocate::relocate_tls): Likewise.
10408
bd52eafb
BE
104092008-03-25 Ben Elliston <bje@au.ibm.com>
10410
10411 * yyscript.y: Fix spelling error in comment.
10412
8b105e34
ILT
104132008-03-24 Ian Lance Taylor <iant@google.com>
10414
8ed814a9
ILT
10415 * options.h (class General_options): Define build_id option.
10416 * layout.h (class Layout): Declare write_build_id, create_note,
10417 create_build_id. Add build_id_note_ member.
10418 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
10419 "libiberty.h", "md5.h", "sha1.h".
10420 (Layout::Layout): Initialize eh_frame_data_,
10421 eh_frame_hdr_section_, and build_id_note_.
10422 (Layout::finalize): Call create_build_id.
10423 (Layout::create_note): New function, broken out of
10424 Layout::create_gold_note.
10425 (Layout::create_gold_note): Call create_note.
10426 (Layout::create_build_id): New function.
10427 (Layout::write_build_id): New function.
10428 (Close_task_runner::run): Call write_build_id.
10429
8b105e34
ILT
10430 * x86_64.cc: Correct license to GPLv3.
10431
086a1841
ILT
104322008-03-23 Ian Lance Taylor <iant@google.com>
10433
10434 * options.cc: Include "demangle.h".
10435 (parse_optional_string): New function.
10436 (parse_long_option): Handle takes_optional_argument.
10437 (parse_short_option): Update dash_z initializer. Handle
10438 takes_optional_argument.
10439 (General_options::General_options): Initialize do_demangle_.
10440 (General_options::finalize): Set do_demangle_. Handle demangling
10441 style.
10442 * options.h (parse_optional_string): Declare.
10443 (struct One_option): Add optional_arg field. Update constructor.
10444 Update call constructor calls. Add takes_optional_argument
10445 function.
10446 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
10447 (DEFINE_optional_string): Define.
10448 (General_options::demangle): Change from DEFINE_bool to
10449 DEFINE_optional_string.
10450 (General_options::no_demangle): New function.
10451 (General_options::do_demangle): New function.
10452 (General_options::set_do_demangle): New function.
10453 (General_options::execstack_status_): Move definition to end of
10454 class definition.
10455 (General_options::static_): Likewise.
10456 (General_options::do_demangle_): New field.
10457 * object.cc (big_endian>::get_symbol_location_info): Call
10458 Options::do_demangle, not Options::demangle.
10459 * symtab.cc (demangle): Likewise.
10460
cbb93e63
ILT
104612008-03-22 Ian Lance Taylor <iant@google.com>
10462
10463 * gold.h: Include <cstddef> and <sys/types.h>
10464 * options.h: Include <cstring>.
10465
ec531623
ILT
104662008-03-21 Ian Lance Taylor <iant@google.com>
10467
10468 * Added source code to GNU binutils.
This page took 0.619505 seconds and 4 git commands to generate.