sim: glue: allow bitwise devices to only glue ints
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
ec69d6da
ILT
12011-05-16 Ian Lance Taylor <iant@google.com>
2
3 * options.h (class General_options): Make -i a synonym for -r.
4
732e31de
ILT
52011-05-16 Ian Lance Taylor <iant@google.com>
6
7 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
8
403676b5
CC
92011-05-10 Cary Coutant <ccoutant@google.com>
10
11 * object.cc (Sized_relobj::do_count_local_symbols): Check for
12 strip_all (-s).
13
5b7b7d6e
ILT
142011-05-06 Ian Lance Taylor <iant@google.com>
15
16 * layout.cc (Layout::layout): If the output section flags change,
17 update the ordering.
18
f0f9babf
CC
192011-04-25 Cary Coutant <ccoutant@google.com>
20
21 * incremental-dump.cc (dump_incremental_inputs): Print local
22 symbol info for each input file.
23 * incremental.cc
24 (Output_section_incremental_inputs::set_final_data_size): Add local
25 symbol info to input file entries in incremental info.
26 (Output_section_incremental_inputs::write_info_blocks): Likewise.
27 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
28 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
29 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
30 implementation.
31 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
32 (Sized_incr_relobj::do_relocate): Write the local symbols.
33 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
34 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
35 Adjust size of input file header.
36 (Incremental_inputs_reader::get_local_symbol_offset): New function.
37 (Incremental_inputs_reader::get_local_symbol_count): New function.
38 (Incremental_inputs_reader::get_input_section): Adjust size of input
39 file header.
40 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
41 (Sized_incr_relobj::This): New typedef.
42 (Sized_incr_relobj::sym_size): New const data member.
43 (Sized_incr_relobj::Local_symbol): New struct.
44 (Sized_incr_relobj::do_output_local_symbol_count): New function.
45 (Sized_incr_relobj::do_local_symbol_offset): New function.
46 (Sized_incr_relobj::local_symbol_count_): New data member.
47 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
48 (Sized_incr_relobj::local_symbol_index_): New data member.
49 (Sized_incr_relobj::local_symbol_offset_): New data member.
50 (Sized_incr_relobj::local_dynsym_offset_): New data member.
51 (Sized_incr_relobj::local_symbols_): New data member.
52 * object.h (Relobj::output_local_symbol_count): New function.
53 (Relobj::local_symbol_offset): New function.
54 (Relobj::do_output_local_symbol_count): New function.
55 (Relobj::do_local_symbol_offset): New function.
56 (Sized_relobj::do_output_local_symbol_count): New function.
57 (Sized_relobj::do_local_symbol_offset): New function.
58
d0a9ace3
ILT
592011-04-22 Vladimir Simonov <sv@sw.ru>
60
61 * descriptors.cc (set_close_on_exec): New function.
62 (Descriptors::open): Use set_close_on_exec.
63 * output.cc (S_ISLNK): Define if not defined.
64
94a3fc8b
CC
652011-04-22 Cary Coutant <ccoutant@google.com>
66
67 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
68 global symbol map.
69 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
70 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
71 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
72 relocations.
73 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
74 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
75 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
76 * incremental.h
77 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
78 function.
79 (Incremental_binary::apply_incremental_relocs): New function.
80 (Incremental_binary::do_apply_incremental_relocs): New function.
81 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
82 data member.
83 (Sized_incremental_binary::add_global_symbol): New function.
84 (Sized_incremental_binary::global_symbol): New function.
85 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
86 (Sized_incremental_binary::symbol_map_): New data member.
87 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
88 * target.h (Sized_target::apply_relocation): New function.
89 * target-reloc.h (apply_relocation): New function.
90 * x86_64.cc (Target_x86_64::apply_relocation): New function.
91
c87e4302
DK
922011-04-22 Doug Kwan <dougkwan@google.com>
93
94 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
95 flag of a SHT_ARM_EXIDX section.
96 * testsuite/Makefile.am (arm_exidx_test): New test rules.
97 * testsuite/Makefile.in: Regenerate.
98 * testsuite/arm_exidx_test.s: New file.
99 * testsuite/arm_exidx_test.sh: Same.
100
e7782cf6
CC
1012011-04-20 Cary Coutant <ccoutant@google.com>
102
103 PR gold/12689
104 * archive.h (Incremental_archive_entry::Archive_member):
105 Initialize arg_serial_ (second constructor).
106
308ecdc7
ILT
1072011-04-17 Ian Lance Taylor <iant@google.com>
108
109 * object.cc (Relocate_info::location): Simplify location string.
110 * errors.cc (Errors::error_at_location): Don't print program
111 name.
112 (Errors::warning_at_location): Likewise.
113 (Errors::undefined_symbol): Likewise.
114 * testsuite/debug_msg.sh: Update accordingly.
115
bec5b579
CC
1162011-04-14 Cary Coutant <ccoutant@google.com>
117
118 * gold/layout.cc (Layout::symtab_section_offset): New function.
119 * gold/layout.h (Layout::symtab_section_offset): New function.
120 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
121
88597d34
ILT
1222011-04-12 Ian Lance Taylor <iant@google.com>
123
124 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
125 with MREMAP_MAYMOVE.
126 * output.h (class Output_file): Add map_is_allocated_ field.
127 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
128 not available, provide stubs. If mremap is not available, #define
129 it to gold_mremap.
130 (MREMAP_MAYMOVE): Define if not defined.
131 (Output_file::Output_file): Initialize map_is_allocated_.
132 (Output_file::resize): Check map_is_allocated_.
133 (Output_file::map_anonymous): If mmap fails, use malloc.
134 (Output_file::unmap): Don't do anything for an anonymous map.
135 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
136 is not available, provide stubs.
137 (File_read::View::~View): Use free rather than delete[].
138 (File_read::make_view): Use malloc rather than new[]. If mmap
139 fails, use malloc.
140 (File_read::find_or_make_view): Use malloc rather than new[].
141 * gold.h: Remove HAVE_REMAP code.
142 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
143 exists. Rename mremap to gold_mremap. If mmap is not available
144 don't do anything.
145 * configure, config.in: Rebuild.
146
11e361bc
ILT
1472011-04-11 Ian Lance Taylor <iant@google.com>
148
149 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
150 initialize local variable v.
151
cdc29364
CC
1522011-04-11 Cary Coutant <ccoutant@google.com>
153
154 * archive.cc (Archive::include_member): Adjust call to
155 report_object.
156 (Add_archive_symbols::run): Track argument serial numbers.
157 (Lib_group::include_member): Likewise.
158 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
159 * archive.h (Incremental_archive_entry::Archive_member):
160 Initialize arg_serial_.
161 (Archive_member::arg_serial_): New data member.
162 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
163 (Sized_dynobj::do_add_symbols): Track symbols when doing an
164 incremental link.
165 (Sized_dynobj::do_for_all_local_got_entries): New function.
166 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
167 function.
168 * fileread.cc (get_mtime): New function.
169 * fileread.h (get_mtime): New function.
170 * gold.cc (queue_initial_tasks): Check for incremental update.
171 (process_incremental_input): New function.
172 (queue_middle_tasks): Don't force valid target for incremental
173 update.
174 * incremental-dump.cc (find_input_containing_global): Adjust
175 size of symbol info entry.
176 (dump_incremental_inputs): Dump argument serial number and
177 in_system_directory flag; bias shndx by 1; print symbol names
178 when dumping per-file symbol lists; use new symbol info readers.
179 * incremental.cc
180 (Output_section_incremental_inputs:update_data_size): New function.
181 (Sized_incremental_binary::setup_readers): Setup input readers
182 for each input file; build maps for files added from libraries
183 and scripts.
184 (Sized_incremental_binary::check_input_args): New function.
185 (Sized_incremental_binary::do_check_inputs): Build map of argument
186 serial numbers to input arguments.
187 (Sized_incremental_binary::do_file_has_changed): Rename
188 do_file_is_unchanged to this; compare file modification times.
189 (Sized_incremental_binary::do_init_layout): New function.
190 (Sized_incremental_binary::do_reserve_layout): New function.
191 (Sized_incremental_binary::do_get_input_reader): Remove.
192 (Sized_incremental_binary::get_symtab_view): New function.
193 (Incremental_checker::can_incrementally_link_output_file): Remove.
194 (Incremental_inputs::report_command_line): Exclude --debug options.
195 (Incremental_inputs::report_archive_begin): Add parameter; track
196 argument serial numbers; don't put input file entry for archive
197 before archive members.
198 (Incremental_inputs::report_archive_end): Put input file entry
199 for archive after archive members.
200 (Incremental_inputs::report_object): Add parameter; track argument
201 serial numbers and in_system_directory flag.
202 (Incremental_inputs::report_script): Add parameter; track argument
203 serial numbers.
204 (Output_section_incremental_inputs::set_final_data_size): Adjust
205 size of symbol info entry; check for forwarding symbols.
206 (Output_section_incremental_inputs::write_input_files): Write
207 in_system_directory flag and argument serial number.
208 (Output_section_incremental_inputs::write_info_blocks): Map section
209 indices between incremental info and original input file; store
210 input section index for each symbol.
211 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
212 change operator() to visit().
213 (class Global_got_offset_visitor): Likewise.
214 (class Global_symbol_visitor_got_plt):
215 (Output_section_incremental_inputs::write_got_plt): Use new visitor
216 classes.
217 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
218 (Sized_incr_relobj::do_read_symbols): New function.
219 (Sized_incr_relobj::do_layout): New function.
220 (Sized_incr_relobj::do_layout_deferred_sections): New function.
221 (Sized_incr_relobj::do_add_symbols): New function.
222 (Sized_incr_relobj::do_should_include_member): New function.
223 (Sized_incr_relobj::do_for_all_global_symbols): New function.
224 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
225 (Sized_incr_relobj::do_section_size): New function.
226 (Sized_incr_relobj::do_section_name): New function.
227 (Sized_incr_relobj::do_section_contents): New function.
228 (Sized_incr_relobj::do_section_flags): New function.
229 (Sized_incr_relobj::do_section_entsize): New function.
230 (Sized_incr_relobj::do_section_address): New function.
231 (Sized_incr_relobj::do_section_type): New function.
232 (Sized_incr_relobj::do_section_link): New function.
233 (Sized_incr_relobj::do_section_info): New function.
234 (Sized_incr_relobj::do_section_addralign): New function.
235 (Sized_incr_relobj::do_initialize_xindex): New function.
236 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
237 (Sized_incr_relobj::do_read_relocs): New function.
238 (Sized_incr_relobj::do_gc_process_relocs): New function.
239 (Sized_incr_relobj::do_scan_relocs): New function.
240 (Sized_incr_relobj::do_count_local_symbols): New function.
241 (Sized_incr_relobj::do_finalize_local_symbols): New function.
242 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
243 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
244 (Sized_incr_relobj::do_relocate): New function.
245 (Sized_incr_relobj::do_set_section_offset): New function.
246 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
247 (Sized_incr_dynobj::do_read_symbols): New function.
248 (Sized_incr_dynobj::do_layout): New function.
249 (Sized_incr_dynobj::do_add_symbols): New function.
250 (Sized_incr_dynobj::do_should_include_member): New function.
251 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
252 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
253 (Sized_incr_dynobj::do_section_size): New function.
254 (Sized_incr_dynobj::do_section_name): New function.
255 (Sized_incr_dynobj::do_section_contents): New function.
256 (Sized_incr_dynobj::do_section_flags): New function.
257 (Sized_incr_dynobj::do_section_entsize): New function.
258 (Sized_incr_dynobj::do_section_address): New function.
259 (Sized_incr_dynobj::do_section_type): New function.
260 (Sized_incr_dynobj::do_section_link): New function.
261 (Sized_incr_dynobj::do_section_info): New function.
262 (Sized_incr_dynobj::do_section_addralign): New function.
263 (Sized_incr_dynobj::do_initialize_xindex): New function.
264 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
265 (make_sized_incremental_object): New function.
266 (Incremental_library::copy_unused_symbols): New function.
267 (Incremental_library::do_for_all_unused_symbols): New function.
268 * incremental.h (enum Incremental_input_flags): New type.
269 (class Incremental_checker): Remove.
270 (Incremental_input_entry::Incremental_input_entry): Add argument
271 serial number.
272 (Incremental_input_entry::arg_serial): New function.
273 (Incremental_input_entry::set_is_in_system_directory): New function.
274 (Incremental_input_entry::is_in_system_directory): New function.
275 (Incremental_input_entry::arg_serial_): New data member.
276 (Incremental_input_entry::is_in_system_directory_): New data member.
277 (class Script_info): Move here from script.h.
278 (Script_info::Script_info): Add filename parameter.
279 (Script_info::filename): New function.
280 (Script_info::filename_): New data member.
281 (Incremental_script_entry::Incremental_script_entry): Add argument
282 serial number.
283 (Incremental_object_entry::Incremental_object_entry): Likewise.
284 (Incremental_object_entry::add_input_section): Build list of input
285 sections with map to original shndx.
286 (Incremental_object_entry::get_input_section_index): New function.
287 (Incremental_object_entry::shndx_): New data member.
288 (Incremental_object_entry::name_key_): Rename; adjust all refs.
289 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
290 (Incremental_archive_entry::Incremental_archive_entry): Add argument
291 serial number.
292 (Incremental_inputs::report_archive_begin): Likewise.
293 (Incremental_inputs::report_object): Likewise.
294 (Incremental_inputs::report_script): Likewise.
295 (class Incremental_global_symbol_reader): New class.
296 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
297 and store flags and input file type.
298 (Incremental_input_entry_reader::arg_serial): New function.
299 (Incremental_input_entry_reader::type): Extract type from flags.
300 (Incremental_input_entry_reader::is_in_system_directory): New function.
301 (Incremental_input_entry_reader::get_input_section_count): Call
302 accessor function for type.
303 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
304 function for type; adjust size of global symbol entry.
305 (Incremental_input_entry_reader::get_global_symbol_count): Call
306 accessor function for type.
307 (Incremental_input_entry_reader::get_object_count): Likewise.
308 (Incremental_input_entry_reader::get_object_offset): Likewise.
309 (Incremental_input_entry_reader::get_member_count): Likewise.
310 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
311 (Incremental_input_entry_reader::get_member_offset): Likewise.
312 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
313 (Incremental_input_entry_reader::Global_symbol_info): Remove.
314 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
315 (Incremental_input_entry_reader::get_global_symbol_reader): New
316 function.
317 (Incremental_input_entry_reader::get_output_symbol_index): New
318 function.
319 (Incremental_input_entry_reader::type_): Remove.
320 (Incremental_input_entry_reader::flags_): New data member.
321 (Incremental_inputs_reader::input_file_offset): New function.
322 (Incremental_inputs_reader::input_file_index): New function.
323 (Incremental_inputs_reader::input_file): Call input_file_offset.
324 (Incremental_inputs_reader::input_file_at_offset): New function.
325 (Incremental_relocs_reader::get_r_type): Reformat.
326 (Incremental_relocs_reader::get_r_shndx): Reformat.
327 (Incremental_relocs_reader::get_r_offset): Reformat.
328 (Incremental_relocs_reader::data): New function.
329 (Incremental_binary::Incremental_binary): Initialize new data members.
330 (Incremental_binary::check_inputs): Add cmdline parameter.
331 (Incremental_binary::file_is_unchanged): Remove.
332 (Input_reader::arg_serial): New function.
333 (Input_reader::get_unused_symbol_count): New function.
334 (Input_reader::get_unused_symbol): New function.
335 (Input_reader::do_arg_serial): New function.
336 (Input_reader::do_get_unused_symbol_count): New function.
337 (Input_reader::do_get_unused_symbol): New function.
338 (Incremental_binary::input_file_count): New function.
339 (Incremental_binary::get_input_reader): Change signature to use
340 index instead of filename.
341 (Incremental_binary::file_has_changed): New function.
342 (Incremental_binary::get_input_argument): New function.
343 (Incremental_binary::get_library): New function.
344 (Incremental_binary::get_script_info): New function.
345 (Incremental_binary::init_layout): New function.
346 (Incremental_binary::reserve_layout): New function.
347 (Incremental_binary::output_file): New function.
348 (Incremental_binary::do_check_inputs): New function.
349 (Incremental_binary::do_file_is_unchanged): Remove.
350 (Incremental_binary::do_file_has_changed): New function.
351 (Incremental_binary::do_init_layout): New function.
352 (Incremental_binary::do_reserve_layout): New function.
353 (Incremental_binary::do_input_file_count): New function.
354 (Incremental_binary::do_get_input_reader): Change signature.
355 (Incremental_binary::input_args_map_): New data member.
356 (Incremental_binary::library_map_): New data member.
357 (Incremental_binary::script_map_): New data member.
358 (Sized_incremental_binary::Sized_incremental_binary): Initialize
359 new data members.
360 (Sized_incremental_binary::output_section): New function.
361 (Sized_incremental_binary::inputs_reader): Add const.
362 (Sized_incremental_binary::symtab_reader): Add const.
363 (Sized_incremental_binary::relocs_reader): Add const.
364 (Sized_incremental_binary::got_plt_reader): Add const.
365 (Sized_incremental_binary::get_symtab_view): New function.
366 (Sized_incremental_binary::Inputs_reader): New typedef.
367 (Sized_incremental_binary::Input_entry_reader): New typedef.
368 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
369 (Sized_incremental_binary::do_file_is_unchanged): Remove.
370 (Sized_incremental_binary::do_file_has_changed): New function.
371 (Sized_incremental_binary::do_init_layout): New function.
372 (Sized_incremental_binary::do_reserve_layout): New function.
373 (Sized_input_reader::Inputs_reader): Remove.
374 (Sized_input_reader::Input_entry_reader): Remove.
375 (Sized_input_reader::do_arg_serial): New function.
376 (Sized_input_reader::do_get_unused_symbol_count): New function.
377 (Sized_input_reader::do_get_unused_symbol): New function.
378 (Sized_incremental_binary::do_input_file_count): New function.
379 (Sized_incremental_binary::do_get_input_reader): Change signature;
380 use index instead of filename.
381 (Sized_incremental_binary::section_map_): New data member.
382 (Sized_incremental_binary::input_entry_readers_): New data member.
383 (class Sized_incr_relobj): New class.
384 (class Sized_incr_dynobj): New class.
385 (make_sized_incremental_object): New function.
386 (class Incremental_library): New class.
387 * layout.cc (Free_list::num_lists): New static data member.
388 (Free_list::num_nodes): New static data member.
389 (Free_list::num_removes): New static data member.
390 (Free_list::num_remove_visits): New static data member.
391 (Free_list::num_allocates): New static data member.
392 (Free_list::num_allocate_visits): New static data member.
393 (Free_list::init): New function.
394 (Free_list::remove): New function.
395 (Free_list::allocate): New function.
396 (Free_list::dump): New function.
397 (Free_list::print_stats): New function.
398 (Layout_task_runner::run): Resize output file for incremental updates.
399 (Layout::Layout): Initialize new data members.
400 (Layout::set_incremental_base): New function.
401 (Layout::init_fixed_output_section): New function.
402 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
403 incremental updates.
404 (Layout::create_gold_note): Do not create gold note section for
405 incremental updates.
406 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
407 for incremental updates.
408 (Layout::set_section_offsets): For incremental updates, allocate space
409 from free list.
410 (Layout::create_symtab_sections): Layout with offsets relative to
411 start of section; for incremental updates, allocate space from free
412 list.
413 (Layout::create_shdrs): For incremental updates, allocate space from
414 free list.
415 (Layout::finish_dynamic_section): For incremental updates, do not
416 check --as-needed (fixed in subsequent patch).
417 * layout.h (class Free_list): New class.
418 (Layout::set_incremental_base): New function.
419 (Layout::incremental_base): New function.
420 (Layout::init_fixed_output_section): New function.
421 (Layout::allocate): New function.
422 (Layout::incremental_base_): New data member.
423 (Layout::free_list_): New data member.
424 * main.cc (main): Print Free_list statistics.
425 * object.cc (Relobj::finalize_incremental_relocs): Add
426 clear_counts parameter; clear counts only when clear_counts is set.
427 (Sized_relobj::Sized_relobj): Initialize new base class.
428 (Sized_relobj::do_layout): Don't report special sections.
429 (Sized_relobj::do_for_all_local_got_entries): New function.
430 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
431 symtab_off to all symbol table offsets.
432 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
433 * object.h (class Got_offset_list): Move to top of file.
434 (Object::Object): Allow case where input_file == NULL.
435 (Object::~Object): Likewise.
436 (Object::input_file): Assert that input_file != NULL.
437 (Object::lock): Allow case where input_file == NULL.
438 (Object::unlock): Likewise.
439 (Object::is_locked): Likewise.
440 (Object::token): Likewise.
441 (Object::release): Likewise.
442 (Object::is_incremental): New function.
443 (Object::get_mtime): New function.
444 (Object::for_all_local_got_entries): New function.
445 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
446 (Object::set_is_in_system_directory): New function.
447 (Object::is_in_system_directory): New function.
448 (Object::do_is_incremental): New function.
449 (Object::do_get_mtime): New function.
450 (Object::do_for_all_local_got_entries): New function.
451 (Object::is_in_system_directory_): New data member.
452 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
453 (class Sized_relobj_base): New class.
454 (class Sized_relobj): Derive from Sized_relobj_base.
455 (class Sized_relobj::Symbols): Redeclare from base class.
456 (class Sized_relobj::local_got_offset_list): Remove.
457 (class Sized_relobj::Output_sections): Redeclare from base class.
458 (class Sized_relobj::do_for_all_local_got_entries): New function.
459 (class Sized_relobj::write_local_symbols): Add offset parameter.
460 (class Sized_relobj::local_symbol_offset_): Update comment.
461 (class Sized_relobj::local_dynsym_offset_): Update comment.
462 * options.cc (Input_arguments::add_file): Remove const.
463 * options.h (Input_file_argument::Input_file_argument):
464 Initialize arg_serial_ (all constructors).
465 (Input_file_argument::set_arg_serial): New function.
466 (Input_file_argument::arg_serial): New function.
467 (Input_file_argument::arg_serial_): New data member.
468 (Input_arguments::Input_arguments): Initialize file_count_.
469 (Input_arguments::add_file): Remove const.
470 (Input_arguments::number_of_input_files): New function.
471 (Input_arguments::file_count_): New data member.
472 (Command_line::number_of_input_files): Call
473 Input_arguments::number_of_input_files.
474 * output.cc (Output_segment_headers::Output_segment_headers):
475 Set current size.
476 (Output_section::Input_section::current_data_size): New function.
477 (Output_section::Output_section): Initialize new data members.
478 (Output_section::add_input_section): Don't do merge sections for
479 an incremental link; allocate space from free list for an
480 incremental update.
481 (Output_section::add_output_section_data): Allocate space from
482 free list for an incremental update.
483 (Output_section::update_data_size): New function.
484 (Output_section::set_fixed_layout): New function.
485 (Output_section::reserve): New function.
486 (Output_segment::set_section_addresses): Remove const.
487 (Output_segment::set_section_list_addresses): Remove const; allocate
488 space from free list for an incremental update.
489 (Output_segment::set_offset): Adjust size of RELRO segment for an
490 incremental update.
491 * output.h (Output_data::current_data_size): Move here from
492 child classes.
493 (Output_data::pre_finalize_data_size): New function.
494 (Output_data::update_data_size): New function.
495 (Output_section_headers::update_data_size): new function.
496 (Output_section_data_build::current_data_size): Move to Output_data.
497 (Output_data_strtab::update_data_size): New function.
498 (Output_section::current_data_size): Move to Output_data.
499 (Output_section::set_fixed_layout): New function.
500 (Output_section::has_fixed_layout): New function.
501 (Output_section::reserve): New function.
502 (Output_section::update_data_size): New function.
503 (Output_section::has_fixed_layout_): New data member.
504 (Output_section::free_list_): New data member.
505 (Output_segment::set_section_addresses): Remove const.
506 (Output_segment::set_section_list_addresses): Remove const.
507 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
508 New function.
509 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
510 New function.
511 * readsyms.cc (Read_symbols::do_read_symbols): Add library
512 parameter when calling Add_symbols constructor; store argument
513 serial number for members of a lib group.
514 (Add_symbols::locks): Allow case where token == NULL.
515 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
516 (Read_member::~Read_member): New function.
517 (Read_member::is_runnable): New function.
518 (Read_member::locks): New function.
519 (Read_member::run): New function.
520 (Check_script::~Check_script): New function.
521 (Check_script::is_runnable): New function.
522 (Check_script::locks): New function.
523 (Check_script::run): New function.
524 (Check_library::~Check_library): New function.
525 (Check_library::is_runnable): New function.
526 (Check_library::locks): New function.
527 (Check_library::run): New function.
528 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
529 (Add_symbols::library_): New data member.
530 (class Read_member): New class.
531 (class Check_script): New class.
532 (class Check_library): New class.
533 * reloc.cc (Read_relocs::is_runnable): Allow case where
534 token == NULL.
535 (Read_relocs::locks): Likewise.
536 (Scan_relocs::locks): Likewise.
537 (Relocate_task::locks): Likewise.
538 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
539 to clear counters.
540 (Sized_relobj::incremental_relocs_scan): Fix comment.
541 (Sized_relobj::do_relocate): Pass output file offset to
542 write_local_symbols.
543 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
544 from class declaration.
545 * script.cc (read_input_script): Allocate Script_info; pass
546 argument serial number to report_script.
547 * script.h (class Script_info): Move to incremental.h.
548 * symtab.cc (Symbol_table::add_from_incrobj): New function.
549 * symtab.h (Symbol_table::add_from_incrobj): New function.
550 (Symbol_table::set_file_offset): New function.
551
b961d0d7
CC
5522011-04-05 Cary Coutant <ccoutant@google.com>
553
554 * incremental-dump.cc (dump_incremental_inputs): Change signature
555 to take a Sized_incremental_binary; change caller. Use readers
556 in Sized_incremental_binary.
557 * incremental.cc
558 (Sized_incremental_binary::find_incremental_inputs_sections):
559 Rename do_find_incremental_inputs_sections to this.
560 (Sized_incremental_binary::setup_readers): New function.
561 (Sized_incremental_binary::do_check_inputs): Check
562 has_incremental_info_ flag; move setup code to setup_readers;
563 use input readers.
564 (Sized_incremental_binary::do_file_is_unchanged): New function.
565 (Sized_incremental_binary::do_get_input_reader): New function.
566 * incremental.h (class Incremental_binary): Move to end of file.
567 (Incremental_binary::file_is_unchanged): New function.
568 (Incremental_binary::do_file_is_unchanged): New function.
569 (Incremental_binary::Input_reader): New class.
570 (Incremental_binary::get_input_reader): New function.
571 (class Sized_incremental_binary): Move to end of file.
572 (Sized_incremental_binary::Sized_incremental_binary): Setup the
573 input section reader classes.
574 (Sized_incremental_binary::has_incremental_info): New function.
575 (Sized_incremental_binary::inputs_reader): New function.
576 (Sized_incremental_binary::symtab_reader): New function.
577 (Sized_incremental_binary::relocs_reader): New function.
578 (Sized_incremental_binary::got_plt_reader): New function.
579 (Sized_incremental_binary::do_file_is_unchanged): New function.
580 (Sized_incremental_binary::Sized_input_reader): New class.
581 (Sized_incremental_binary::get_input_reader): New function.
582 (Sized_incremental_binary::find_incremental_inputs_sections):
583 Rename do_find_incremental_inputs_sections to this.
584 (Sized_incremental_binary::setup_readers): New function.
585 (Sized_incremental_binary::has_incremental_info_): New data member.
586 (Sized_incremental_binary::inputs_reader_): New data member.
587 (Sized_incremental_binary::symtab_reader_): New data member.
588 (Sized_incremental_binary::relocs_reader_): New data member.
589 (Sized_incremental_binary::got_plt_reader_): New data member.
590 (Sized_incremental_binary::current_input_file_): New data member.
591
a869183f
PP
5922011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
593
594 PR gold/12640
595 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
596 violation.
597
5982011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
599
600 * archive.cc (Archive::include_member): Adjust call to report_object.
601 (Add_archive_symbols::run): Add script_info to call to
602 report_archive_begin.
603 (Lib_group::include_member): Adjust call to report_object.
604 (Add_lib_group_symbols::run): Adjust call to report_object.
605 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
606 blocks. Add object count for script input files.
607 * incremental.cc (Incremental_inputs::report_archive_begin): Add
608 script_info parameter; change all callers.
609 (Incremental_inputs::report_object): Add script_info parameter;
610 change all callers.
611 (Incremental_inputs::report_script): Store backpointer to
612 incremental info entry.
613 (Output_section_incremental_inputs::set_final_data_size): Record
614 additional information for scripts.
615 (Output_section_incremental_inputs::write_info_blocks): Likewise.
616 * incremental.h (Incremental_script_entry::add_object): New function.
617 (Incremental_script_entry::get_object_count): New function.
618 (Incremental_script_entry::get_object): New function.
619 (Incremental_script_entry::objects_): New data member; adjust
620 constructor.
621 (Incremental_inputs::report_archive_begin): Add script_info parameter.
622 (Incremental_inputs::report_object): Add script_info parameter.
623 (Incremental_inputs_reader::get_object_count): New function.
624 (Incremental_inputs_reader::get_object_offset): New function.
625 * options.cc (Input_arguments::add_file): Return reference to
626 new input argument.
627 * options.h (Input_argument::set_script_info): New function.
628 (Input_argument::script_info): New function.
629 (Input_argument::script_info_): New data member; adjust all
630 constructors.
631 (Input_file_group::add_file): Return reference to new input argument.
632 (Input_file_lib::add_file): Likewise.
633 (Input_arguments::add_file): Likewise.
634 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
635 * script.cc (Parser_closure::Parser_closure): Add script_info
636 parameter; adjust all callers.
637 (Parser_closure::script_info): New function.
638 (Parser_closure::script_info_): New data member.
639 (read_input_script): Report scripts earlier to incremental info.
640 (script_add_file): Set script_info in Input_argument.
641 (script_add_library): Likewise.
642 * script.h (Script_options::Script_info): Rewrite class.
643
a869183f 6442011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
645
646 * archive.cc (Library_base::should_include_member): Move
647 method here from class Archive.
648 (Archive::Archive): Initialize base class.
649 (Archive::should_include_member): Move to base class.
650 (Archive::do_for_all_unused_symbols): New function.
651 (Add_archive_symbols::run): Remove redundant access to
652 incremental_inputs.
653 (Lib_group::Lib_group): Initialize base class.
654 (Lib_group::do_filename): New function.
655 (Lib_group::include_member): Pass pointer to Lib_group to
656 report_object.
657 (Lib_group::do_for_all_unused_symbols): New function.
658 (Add_lib_group_symbols::run): Report archive information for
659 incremental links.
660 * archive.h (class Library_base): New base class.
661 (class Archive): Derive from Library_base.
662 (Archive::filename): Move to base class.
663 (Archive::set_incremental_info): Likewise.
664 (Archive::incremental_info): Likewise.
665 (Archive::Should_include): Likewise.
666 (Archive::should_include_member): Likewise.
667 (Archive::Armap_entry): Remove.
668 (Archive::Unused_symbol_iterator): Remove.
669 (Archive::unused_symbols_begin): Remove.
670 (Archive::unused_symbols_end): Remove.
671 (Archive::do_filename): New function.
672 (Archive::do_get_mtime): New function.
673 (Archive::do_for_all_unused_symbols): New function.
674 (Archive::task_): Move to base class.
675 (Archive::incremental_info_): Likewise.
676 (class Lib_group): Derive from Library_base.
677 (Lib_group::do_filename): New function.
678 (Lib_group::do_get_mtime): New function.
679 (Lib_group::do_for_all_unused_symbols): New function.
680 (Lib_group::task_): Move to base class.
681 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
682 function.
683 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
684 function.
685 * incremental.cc (Incremental_inputs::report_archive_begin):
686 Use Library_base; call library's get_mtime; add incremental inputs
687 entry before members.
688 (class Unused_symbol_visitor): New class.
689 (Incremental_inputs::report_archive_end): Use Library_base; use
690 visitor class to record unused symbols; don't add incremental inputs
691 entry after members.
692 (Incremental_inputs::report_object): Use Library_base.
693 * incremental.h
694 (Incremental_archive_entry::Incremental_archive_entry): Remove
695 unused Archive parameter.
696 (Incremental_inputs::report_archive_begin): Use Library_base.
697 (Incremental_inputs::report_archive_end): Likewise.
698 (Incremental_inputs::report_object): Likewise.
699 * object.cc (Sized_relobj::do_for_all_global_symbols): New
700 function.
701 * object.h (Object::for_all_global_symbols): New function.
702 (Object::do_for_all_global_symbols): New function.
703 (Sized_relobj::do_for_all_global_symbols): New function.
704 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
705 function.
706 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
707 function.
708
61ab3e40
ILT
7092011-03-27 Ian Lance Taylor <iant@google.com>
710
711 * archive.cc (Archive::interpret_header): Return -1 if something
712 goes wrong. Change callers accordingly.
713
30e1f9e6
CC
7142011-03-25 Cary Coutant <ccoutant@google.com>
715
716 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
717 * testsuite/Makefile.in: Regenerate.
718
9c793f14
RÁE
7192010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
720
721 * plugin.cc (get_view): New.
722 (Plugin::load): Pass get_view to the plugin.
723 (Plugin_manager::get_view): New.
724
9312bb0a
ILT
7252011-03-21 Ian Lance Taylor <iant@google.com>
726
727 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 728 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 729
7e12ba9e
ST
7302011-03-21 Sriraman Tallam <tmsriram@google.com>
731
732 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
733 Change == to -eq.
734 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
735 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
736 Change == to -eq.
737 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
738 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
739
fd7a005d
ILT
7402011-03-14 Ian Lance Taylor <iant@google.com>
741
742 * script-sections.cc (Sort_output_sections::script_compare):
743 Rename from is_before, change return type.
744 (Sort_output_sections::operator()): Adjust accordingly.
745
ed16fd1b
ILT
7462011-03-11 Jeffrey Yasskin <jyasskin@google.com>
747
748 PR gold/12572
749 * testsuite/odr_violation2.cc: Add comment to make all error line
750 numbers double digits.
751 * testsuite/debug_msg.sh: Adjust expected errors.
752
71ff8986
ILT
7532011-03-09 Jeffrey Yasskin <jyasskin@google.com>
754
755 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
756 but mark earlier ones as non-canonical
757 (offset_to_iterator): Update search target and example
758 (do_addr2line): Return extra lines in a vector*
759 (format_file_lineno): Extract from do_addr2line
760 (one_addr2line): Add vector* out-param
761 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
762 when a lineno entry appeared last for its instruction
763 (Dwarf_line_info): Add vector* out-param
764 * object.cc (Relocate_info): Pass NULL for the vector* out-param
765 * symtab.cc (Odr_violation_compare): Include the lineno in the
766 comparison again.
767 (linenos_from_loc): New. Combine the canonical line for an
768 address with its other lines.
769 (True_if_intersect): New. Helper functor to make
770 std::set_intersection a query.
771 (detect_odr_violations): Compare sets of lines instead of just
772 one line for each function. This became less deterministic, but
773 has fewer false positives.
774 * symtab.h: Declarations.
775 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
776 mix an optimized and non-optimized object in the same binary
777 (odr_violation2.so): Same.
778 * testsuite/Makefile.in: Regenerate from Makefile.am.
779 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
780 * testsuite/debug_msg.sh: Update line numbers and add
781 assertions.
782 * testsuite/odr_violation1.cc: Use OdrDerived, in a
783 non-optimized context.
784 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
785 isn't inlined, and use OdrDerived in an optimized context.
786 * testsuite/odr_header1.h: Defines OdrDerived, where
787 optimization will change the
788 first-instruction-in-the-destructor's file and line number.
789 * testsuite/odr_header2.h: Defines OdrBase.
790
a19fefdc
ILT
7912011-03-09 Ian Lance Taylor <iant@google.com>
792
793 * fileread.cc (File_read::clear_views): Don't delete the whole
794 file view.
795
ecb351e9
ILT
7962011-03-08 Ian Lance Taylor <iant@google.com>
797
798 PR gold/12525
799 * fileread.cc: #include <climits>.
800 (GOLD_IOV_MAX): Define.
801 (File_read::read_multiple): Limit number of entries by iov_max.
802 * fileread.h (class File_read): Always set max_readv_entries to
803 128.
804
b821d13c
ILT
8052011-03-07 Ian Lance Taylor <iant@google.com>
806
807 PR gold/12525
808 * options.h (class General_options): Add -dy and -dn.
809
89243142
CC
8102011-03-02 Cary Coutant <ccoutant@google.com>
811
812 * testsuite/script_test_9.t: Add TLS segment.
813
d0773f31
ILT
8142011-03-02 Simon Baldwin <simonb@google.com>
815
816 * configure.ac: Add check for gnu_indirect_function support in
817 the toolchain building binutils.
818 * configure: Rebuild.
819
badc8139
RÁE
8202010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
821
822 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
823 plugin only symbols.
824 (Symbol_table::sized_finalize_symbol) Mark symbol only present
825 in plugin files as not needed in the symbol table.
826
4cf7a849
ST
8272011-02-11 Sriraman Tallam <tmsriram@google.com>
828
829 * output.cc (Output_section::add_input_section): Delay fill
830 generation for section ordering.
831
b578bd7d
ILT
8322011-02-09 Ian Lance Taylor <iant@google.com>
833
834 PR gold/12316
835 * object.h (class Sized_relobj): Remove clear_local_symbols.
836 * reloc.cc (Sized_relobj::do_relocate): Don't call
837 clear_local_symbols.
838
84ced98a
RÁE
8392010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
840
841 * plugin.cc (is_visible_from_outside): Return true for symbols
842 in the -u option.
843
55382fb7
ILT
8442011-02-04 Jeffrey Yasskin <jyasskin@google.com>
845
846 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
847 filename.
848
4e271fff
ST
8492011-02-02 Sriraman Tallam <tmsriram@google.com>
850
851 * icf.h (is_section_foldable_candidate): Change type of parameter
852 to std::string.
853 * icf.cc (Icf::find_identical_sections): Change type of local variable
854 section_name to be std::string.
855 (is_function_ctor_or_dtor): Change type of parameter to std::string.
856
d433c3ac
ILT
8572011-01-25 Ian Lance Taylor <iant@google.com>
858
859 * script.cc (script_add_extern): Rewrite to use
860 add_symbol_reference.
861
880473a6
DK
8622011-01-25 Doug Kwan <dougkwan@google.com>
863
d433c3ac 864 * icf.cc (get_section_contents): Always lock section's object.
880473a6 865
f30f86fa
ILT
8662011-01-24 Ian Lance Taylor <iant@google.com>
867
868 * options.h (class General_options): Accept
869 --no-detect-odr-violations.
870
8e51a0b9
ILT
8712011-01-24 Ian Lance Taylor <iant@google.com>
872
873 * version.cc (version_string): Bump to 1.11.
874
0f3b89d8
ILT
8752011-01-24 Ian Lance Taylor <iant@google.com>
876
877 * plugin.cc (class Plugin_rescan): Define new class.
878 (Plugin_manager::claim_file): Set any_claimed_.
879 (Plugin_manager::save_archive): New function.
880 (Plugin_manager::save_input_group): New function.
881 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
882 necessary.
883 (Plugin_manager::new_undefined_symbol): New function.
884 (Plugin_manager::rescan): New function.
885 (Plugin_manager::rescannable_defines): New function.
886 (Plugin_manager::add_input_file): Set any_added_.
887 * plugin.h (class Plugin_manager): define new fields rescannable_,
888 undefined_symbols_, any_claimed_, and any_added_. Declare
889 Plugin_rescan as friend. Declare new functions.
890 (Plugin_manager::Rescannable): Define type.
891 (Plugin_manager::Rescannable_list): Define type.
892 (Plugin_manager::Undefined_symbol_list): Define type.
893 (Plugin_manager::Plugin_manager): Initialize new fields.
894 * archive.cc (Archive::defines_symbol): New function.
895 (Add_archive_symbols::run): Pass archive to plugins if any.
896 * archive.h (class Archive): Declare defines_symbol.
897 * readsyms.cc (Input_group::~Input_group): New function.
898 (Finish_group::run): Pass input_group to plugins if any.
899 * readsyms.h (class Input_group): Declare destructor.
900 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
901 any.
902
3bb951e5
ILT
9032011-01-10 Ian Lance Taylor <iant@google.com>
904
905 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
906 section as relro.
907 (Layout::set_segment_offsets): Reset increase_relro before calling
908 set_section_addresses a second time.
909
0aa45fac
CC
9102011-01-04 Cary Coutant <ccoutant@google.com>
911
912 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
913 sections before NOBITS sections.
914
0db46eb4
L
9152011-01-01 H.J. Lu <hongjiu.lu@intel.com>
916
917 * version.cc (print_version): Update copyright to 2011.
918
829c9745
CC
9192010-12-23 Cary Coutant <ccoutant@google.com>
920
921 * output.h (Output_data_reloc::add_output_section): Pass OD instead
922 of OS to this->add. Add OD parameter to second form of the function.
923
7500420b
ILT
9242010-12-20 Ian Lance Taylor <iant@google.com>
925
926 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
927 second of two consecutive entries with same offset.
928
f8e9a930
RW
9292010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
930
931 * testsuite/Makefile.am (ifuncmain2static_LDADD)
932 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
933 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
934 to avoid unneeded links against $(LDADD).
935 * testsuite/Makefile.in: Regenerate.
936
2fbb4320
ILT
9372010-12-15 Ian Lance Taylor <iant@google.com>
938
939 PR gold/12324
940 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
941 for R_X86_64_32 and R_X86_64_PC32.
942 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
943 ver_matching_def_pic.o.
944 (ver_matching_def_pic.o): New target.
945
fedb228d
RW
9462010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
947
948 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
949 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
950 Move definition before File_read::View member definitions.
951 (File_read::View::~View): Initialize and hold lock before
952 updating current_mapped_bytes.
953
9b547ce6
RW
9542010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
955
956 * dwarf_reader.cc: Remove outdated comment.
957 * gold-threads.cc: Fix typo in error message.
958 * archive.cc: Fix typos in comments.
959 * archive.h: Likewise.
960 * arm-reloc-property.cc: Likewise.
961 * arm-reloc-property.h: Likewise.
962 * arm-reloc.def: Likewise.
963 * arm.cc: Likewise.
964 * attributes.h: Likewise.
965 * cref.cc: Likewise.
966 * ehframe.cc: Likewise.
967 * fileread.h: Likewise.
968 * gold.h: Likewise.
969 * i386.cc: Likewise.
970 * icf.cc: Likewise.
971 * incremental.h: Likewise.
972 * int_encoding.cc: Likewise.
973 * layout.h: Likewise.
974 * main.cc: Likewise.
975 * merge.h: Likewise.
976 * object.cc: Likewise.
977 * object.h: Likewise.
978 * options.cc: Likewise.
979 * readsyms.cc: Likewise.
980 * reduced_debug_output.cc: Likewise.
981 * reloc.cc: Likewise.
982 * script-sections.cc: Likewise.
983 * sparc.cc: Likewise.
984 * symtab.h: Likewise.
985 * target-reloc.h: Likewise.
986 * target.cc: Likewise.
987 * target.h: Likewise.
988 * timer.cc: Likewise.
989 * timer.h: Likewise.
990 * x86_64.cc: Likewise.
991
83e17bd5
CC
9922010-12-09 Cary Coutant <ccoutant@google.com>
993
994 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
995 stack.
996 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
997 parameter; change all callers.
998 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
999 * options.h (warn_execstack): New option.
1000
017257f8
DK
10012010-12-07 Doug Kwan <dougkwan@google.com>
1002
1003 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1004 like function call relocations.
1005
c20cbc06
ILT
10062010-12-07 Ian Lance Taylor <iant@google.com>
1007
1008 * archive.cc (Archive::get_elf_object_for_member): Permit
1009 punconfigured to be NULL.
1010 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1011 (Archive::include_member): Pass NULL to get_elf_object_for_member
1012 if we searched for the archive and this is the first included
1013 object.
1014
4dbfafcc
ILT
10152010-12-01 Ian Lance Taylor <iant@google.com>
1016
1017 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1018 track_relocs_type_ field.
1019 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1020 Set track_relocs_type_.
1021 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1022 contents when using RELA relocs.
1023 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1024 reloc_map_.
1025 * reloc.cc (Track_relocs::next_addend): New function.
1026 * reloc.h (class Track_relocs): Declare next_addend.
1027
e5e19edd
ILT
10282010-12-01 Ian Lance Taylor <iant@google.com>
1029
1030 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1031 virtual destructor.
1032
9a5ce24c
ILT
10332010-12-01 Ian Lance Taylor <iant@google.com>
1034
1035 * README: Update compilers known to work and fail.
1036
c7791212
NC
10372010-11-23 Matthias Klose <doko@ubuntu.com>
1038
1039 * configure.in: For --enable-gold, handle value `default' instead of
1040 `both*'. Always install ld as ld.bfd, install as ld if gold is
1041 not the default.
1042 * configure: Regenerate.
1043
0ad220c9
DK
10442010-11-18 Doug Kwan <dougkwan@google.com>
1045
1046 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1047 and right_alignment to be zero. Store result alignment only if it is
1048 greater than existing alignment.
1049
ab8056e0
CC
10502010-11-16 Cary Coutant <ccoutant@google.com>
1051
1052 PR gold/12220
1053 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1054 Check for ".zdebug_line".
1055
fd064a5b
CC
10562010-11-16 Doug Kwan <dougkwan@google.com>
1057 Cary Coutant <ccoutant@google.com>
1058
1059 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1060 by reference; adjust all callers.
1061 * output.cc (Output_segment::set_section_addresses): Adjust references
1062 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1063 list is empty.
1064 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1065 end at page boundary.
1066
6fc6ea19
CC
10672010-11-16 Cary Coutant <ccoutant@google.com>
1068
1069 PR gold/12220
1070 * layout.cc (Layout::choose_output_section): Transform names of
1071 compressed sections even when using a script with a SECTIONS clause.
1072 (Layout::output_section_name): Remove code to transform
1073 compressed debug section names.
1074 * output.cc (Output_section::add_input_section): Use uncompressed
1075 section size when tracking input sections.
1076
95a2c8d6
RS
10772010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1078
1079 * symtab.h (Symbol::NON_PIC_REF): Remove.
1080 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1081 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1082 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1083 (Symbol::use_plt_offset): Take a flags argument and pass it
1084 directly to needs_dynamic_reloc. Restrict check for undefined
1085 weak symbols to function calls.
1086 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1087 (Target_arm::Scan::global): Use it.
1088 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1089 (Target_arm::Relocate::relocate): Likewise.
1090 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1091 parameter with an r_type parameter. Use get_reference_flags
1092 to get the flags.
1093 (Target_arm::Relocate::relocate): Update accordingly.
1094 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1095 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1096 (Target_i386::Scan::global): Likewise.
1097 (Target_i386::Relocate::relocate): Likewise.
1098 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1099 parameter with an r_type parameter. Use get_reference_flags
1100 to get the flags.
1101 (Target_i386::Relocate::relocate): Update accordingly.
1102 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1103 (Target_powerpc::Scan::global): Use it.
1104 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1105 (Target_powerpc::Relocate::relocate): Likewise.
1106 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1107 (Target_sparc::Scan::global): Use it.
1108 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1109 (Target_sparc::Relocate::relocate): Likewise.
1110 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1111 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1112 (Target_x86_64::Scan::global): Likewise.
1113 (Target_x86_64::Relocate::relocate): Likewise.
1114
f625ae50
DK
11152010-11-08 Doug Kwan <dougkwan@google.com>
1116 Cary Coutant <ccoutant@google.com>
1117
1118 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1119 (Arm_exidx_merge_section::section_contents_): New data member.
1120 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1121 (Arm_input_section::~Arm_input_section): De-allocate memory.
1122 (Arm_input_section::original_contents_): New data member.
1123 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1124 in parameters instead of calling Object::section_contents without
1125 locking.
1126 (Arm_output_section::group_section): New parameter TASK. Pass it
1127 to callees that need locking objects.
1128 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1129 to lock EXIDX input sections. Fix a formatting issue. Call
1130 Arm_exidx_merged_section::build_contents to create merged section
1131 contents.
1132 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1133 to lock object of stub table owner.
1134 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1135 TEXT_SIZE to initialize data member TEXT_SIZE_.
1136 (Arm_exidx_input_section::addralign): Fix typo in comment.
1137 (Arm_exidx_input_section::text_size): New method.
1138 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1139 that require locking objects. Lock objects before scanning for stubs
1140 and updating local symbols.
1141 (Arm_input_section<big_endian>::init): Copy contents of original
1142 input section.
1143 (Arm_input_section<big_endian>::do_write): Use saved contents of
1144 original input section instead of calling Object::section_contents
1145 without locking.
1146 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1147 size without calling Object::section_size().
1148 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1149 for size. Allocate a buffer for merged EXIDX entries.
1150 (Arm_exidx_merged_section::build_contents): New method.
1151 (Arm_exidx_merged_section::do_write): Move merge section contents
1152 building code to Arm_exidx_merged_section::build_contetns. Write
1153 out contetns in buffer instead of building it on the fly.
1154 (Arm_relobj::make_exidx_input_section): Also pass text section size
1155 to Arm_exidx_input_section constructor.
1156 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1157 (Arm_dynobj::do_read_symbols): Fix memory leak.
1158 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1159 * target.h: (class Task): Add forward declaration.
1160 (Target::relax): Add new parameter TASK and pass it to
1161 Target::do_relax().
1162 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1163
5f9bcf58
CC
11642010-11-05 Cary Coutant <ccoutant@google.com>
1165
1166 PR gold/10708
1167 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1168 object when reading from the file.
1169 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1170 second layout pass.
1171 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1172 when reading section contents.
1173 (get_section_contents): Likewise.
1174 (icf::find_identical_sections): Likewise.
1175 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1176 object when reading from the file.
1177 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1178 the object when doing deferred section layout.
1179
e597fa08
NC
11802010-11-03 Nick Clifton <nickc@redhat.com>
1181
1182 PR gold/12001
1183 * script.h (class Symbol_assignment: name): New member. Returns
1184 the name of the symbol.
1185 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1186 Returns true if the given symbol name is on the list of
1187 assignments wating to be processed.
1188 * archive.cc (should_incldue_member): If the symbol is undefined,
1189 check to see if it is on the list of symbols pending assignment.
1190
3f9a3278
ILT
11912010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1192
1193 * script-sections.cc (Script_sections::find_memory_region): Check
1194 for a NULL output section pointer.
1195
d06fb4d1
DK
11962010-10-29 Doug Kwan <dougkwan@google.com>
1197
1198 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1199 Output_section::add_relaxed_input_section.
1200 * output.cc (Output_section::add_relaxed_input_section): Add new
1201 arguments LAYOUT and NAME. Set section order index.
1202 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1203 Copy section order index.
1204 * output.h (Output_section::add_relaxed_input_section): Add new
1205 arguments LAYOUT and NAME.
1206
90e24de5
ILT
12072010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1208
1209 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1210 NATIVE_OR_CROSS_LINKER.
1211 * testsuite/Makefile.in: Regenerate.
1212
c9484ea5
DK
12132010-10-20 Doug Kwan <dougkwan@google.com>
1214
1215 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1216 without SHF_LINK_ORDER flags.
1217 * layout.cc (Layout::choose_output_section): Do not filter
1218 SHF_LINK_ORDER flag in a relocatable link.
1219
5bc2f5be
CC
12202010-10-17 Cary Coutant <ccoutant@google.com>
1221
1222 * output.h (Output_segment::set_section_addresses): Change function
1223 signature. Update all callers.
1224 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1225 sections.
1226 (Output_segment::set_section_addresses): Align after last TLS
1227 section. Add padding before last relro section instead of after.
1228
0c91cf04
DK
12292010-10-17 Doug Kwan <dougkwan@google.com>
1230
1231 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1232 GOT output section to be writable.
1233
8c21d9d3
CC
12342010-10-14 Cary Coutant <ccoutant@google.com>
1235
1236 * debug.h (DEBUG_INCREMENTAL): New flag.
1237 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1238 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1239 mode.
1240 * incremental.cc (report_command_line): Ignore all forms of
1241 --incremental.
1242 * layout.cc (Layout::Layout): Check parameters for incremental link
1243 mode.
1244 * options.cc (General_options::parse_incremental): New function.
1245 (General_options::parse_no_incremental): New function.
1246 (General_options::parse_incremental_full): New function.
1247 (General_options::parse_incremental_update): New function.
1248 (General_options::incremental_mode_): New data member.
1249 (General_options::finalize): Check incremental_mode_.
1250 * options.h (General_options): Update help text for --incremental.
1251 Add --no-incremental, --incremental-full, --incremental-update.
1252 (General_options::Incremental_mode): New enum type.
1253 (General_options::incremental_mode): New function.
1254 (General_options::incremental_mode_): New data member.
1255 * parameters.cc (Parameters::incremental_mode_): New data member.
1256 (Parameters::set_options): Set incremental_mode_.
1257 (Parameters::set_incremental_full): New function.
1258 (Parameters::incremental): New function.
1259 (Parameters::incremental_update): New function.
1260 (set_parameters_incremental_full): New function.
1261 * parameters.h (Parameters::set_incremental_full): New function.
1262 (Parameters::incremental): New function.
1263 (Parameters::incremental_update): New function.
1264 (Parameters::incremental_mode_): New data member.
1265 (set_parameters_incremental_full): New function.
1266 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1267 incremental link mode.
1268 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1269 (Sized_relobj::do_relocate_sections): Likewise.
1270 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1271 option.
1272 * testsuite/Makefile.in: Regenerate.
1273 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1274
bb32aa18 12752010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1276
1277 * script-sections.h (class Script_sections): Make
1278 Sections_elements typedef public.
1279 * script-sections.cc (class Sort_output_sections): Add elements_
1280 field. Add constructor which sets it; change all callers.
1281 (Sort_output_sections::is_before): New function.
1282 (Sort_output_sections::operator()): Call is_before.
1283 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1284 conditional.
1285 * testsuite/script_test_10.sh: New test. Test script section
1286 order.
1287 * testsuite/script_test_10.t: Likewise.
1288 * testsuite/script_test_10.s: Likewise.
1289 * testsuite/Makefile.am: Wrap the cross linker tests and the
1290 common tests into NATIVE_OR_CROSS_LINKER.
1291 (check_SCRIPTS): Add script_test_10.sh.
1292 (check_DATA): Add script_test_10.stdout.
1293 (script_test_10.o, script_test_10): New targets.
1294 (script_test_10.stdout): New target.
1295 * configure, testsuite/Makefile.in: Regenerate.
1296
3cef7179
ILT
12972010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1298
1299 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
1300 error for the deprecated relocations.
1301 (Target_arm::Scan::global): Likewise.
1302 (Target_arm::Relocate::relocate): Likewise.
1303
7411e9a8
RS
13042010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
1305
1306 * fileread.cc (Input_file::find_file): Initialize *found_name
1307 and *namep when using the fallback search for case 4.
1308
6a9da32a
CC
13092010-10-11 Cary Coutant <ccoutant@google.com>
1310
1311 * options.h (class General_options): Redefine -z lazy as an alias for
1312 the negation of -z now.
1313
ac897c20
ILT
13142010-10-11 Ian Lance Taylor <iant@google.com>
1315
1316 * resolve.cc (symbol_to_bits): Report the value of the unsupported
1317 binding.
1318
ea5cae92
NC
13192010-10-06 Nick Clifton <nickc@redhat.com>
1320
1321 * script-sections.cc(class Memory_region): Remove
1322 current_lma_offset_ field. Rename current_vma_offset_ to
1323 current_offset_. Add last_section_ field.
1324 (Memory_region::get_current_vma_address): Rename to
1325 get_current_address.
1326 (Memory_region::get_current_lma_address): Delete.
1327 (Memory_region::increment_vma_offset): Rename to
1328 increment_offset.
1329 (Memory_region::increment_lma_offset): Delete.
1330 (Memory_region::attributes_compatible): New method. Returns
1331 true if the provided section is compatible with the region.
1332 (Memory_region::get_last_section): New method. Returns the last
1333 section to use the region.
1334 (Memory_region::set_last_section): New method. Stores the last
1335 section to use the region.
1336 (Script_sections::block_in_region): New method. Returns true if
1337 a block of memory is contained within a region.
1338 (Script_sections::find_memory_region): New method. Locates a
1339 memory region to be used to set a VMA or LMA address.
1340 (Output_section_definition::set_section_addresses): Add code to
1341 check for addresses set by memory regions.
1342 (Output_segment::set_section_addresses): Remove memory region
1343 walking code.
1344 (Script_sections::create_segment): Add a warning if a header
1345 segment is created outside of any region.
1346 * script-sections.h (class Script_sections): Add prototypes for
1347 find_memory_region and block_in_region methods.
1348 * testsuite/memory_test.s: Use .long instead of .word.
1349 * testsuite/memory_test.t: Add some more output sections.
1350 * testsuite/memory_test.sh: Update expected output.
1351
a9bfd952
DK
13522010-10-02 Doug Kwan <dougkwan@google.com>
1353
1354 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
1355 defintion to symtab.h
1356 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
1357 declaration to defintion.
1358
bacff3ab
NC
13592010-10-01 Nick Clifton <nickc@redhat.com>
1360
1361 * expression.cc (eval): Replace dummy argument with NULL.
1362 (eval_maybe_dot): Check for a NULL result section pointer.
1363 (Symbol_expression::value): Likewise.
1364 (Dot_expression::value): Likewise.
1365 (BINARY_EXPRESSION): Likewise.
1366 (Max_expression::value): Likewise.
1367 (Min_expression::value): Likewise.
1368 (Absolute_expression::value): Likewise.
1369 (Addr_expression::value_from_output_section): Likewise.
1370 (Loaddddr_expression::value_from_output_section): Likewise.
1371 (Segment_start_expression::value): Likewise.
1372 * script-sections.cc
1373 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
1374 argument with NULL.
1375 (Sections_elememt_dot_assignment::set_section_addresses):
1376 Likewise.
1377 (Output_data_expression::do_write_to_buffer): Likewise.
1378 (Output_section_definition::finalize_symbols): Likewise.
1379 (Output_section_definition::set_section_addresses): Likewise.
1380
f81bc8b5
DK
13812010-09-30 Doug Kwan <dougkwan@google.com>
1382
1383 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
1384
c95e9f27
ST
13852010-09-28 Sriraman Tallam <tmsriram@google.com>
1386
1387 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 1388 function.
c95e9f27
ST
1389 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
1390 virtual function.
1391 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
1392 virtual function.
1393 * icf.cc (get_section_contents): Inline merge sections only when
1394 target allows it.
1395
3cac54d2
RW
13962010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1397
1398 * configure: Regenerate.
1399
2904037a
ILT
14002010-09-17 Ian Lance Taylor <iant@google.com>
1401
1402 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
1403 * testsuite/Makefile.am (memory_test.o): New target.
1404 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
1405 memory_test.t.
1406 * testsuite/Makefile.in: Rebuild.
2904037a 1407
bca7fb63
DK
14082010-09-17 Doug Kwan <dougkwan@google.com>
1409
1410 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
1411 defintion if relocation uses GOT entries of the symbol.
1412 * testsuite/icf_safe_test.sh: Fix test.
1413 * testsuite/icf_safe_so_test.sh: Fix test.
1414
4ef28648
CC
14152010-09-16 Cary Coutant <ccoutant@google.com>
1416
1417 * script_sections.cc (class Memory_region): Remove "NULL" from
1418 vector initializations.
1419
793990de
CC
14202010-09-15 Cary Coutant <ccoutant@google.com>
1421
1422 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
1423 Resolve forwarding symbols.
1424
81e015e2
DK
14252010-09-15 Doug Kwan <dougkwan@google.com>
1426
1427 * gold/testsuite/script_test_3.t: Add ARM special sections.
1428 * gold/testsuite/script_test_4.t: Same.
1429 * gold/testsuite/script_test_5.t: Same.
1430 * gold/testsuite/script_test_6.t: Same.
1431 * gold/testsuite/script_test_7.t: Same.
1432 * gold/testsuite/script_test_7.t: Same.
1433 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
1434
36171d64
CC
14352010-09-14 Cary Coutant <ccoutant@google.com>
1436
1437 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
1438 (Target_x86_64::Relocate::relocate_tls): Replace check for
1439 saw_tls_block_reloc_ with test for executable section.
1440
d89051bd
CC
14412010-09-12 Cary Coutant <ccoutant@google.com>
1442
1443 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
1444 position-independent executables to shared libraries need dynamic
1445 relocations.
1446 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
1447 position-independent executables.
1448 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
1449 * testsuite/Makefile.in: Regenerate.
1450
fca41f0f
NC
14512010-09-10 Nick Clifton <nickc@redhat.com>
1452
1453 PR gold/11997
1454 * testsuite/memory_test.t: Discard any sections that are not
1455 needed.
1456
6695e4b3
L
14572010-09-09 H.J. Lu <hongjiu.lu@intel.com>
1458
1459 PR gold/11996
1460 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
1461 "This::" to work around a bug in gcc 4.2.
1462
1463 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
1464
0f72bf6f
RÁE
14652010-09-09 Rafael Espindola <espindola@google.com>
1466
1467 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
1468 sections with different PF_X flags in the same segment.
1469 (Layout::find_first_load_seg): Search all segments to find the first
1470 one.
1471 * options.h (rosegment): New.
1472
14732010-09-08 Rafael Espindola <espindola@google.com>
a6577478 1474
05a79166 1475 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 1476
aa98ff75
DK
14772010-09-08 Doug Kwan <dougkwan@google.com>
1478
1479 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
1480 (Arm_relobj::do_relocate_sections): Add new parameter for output
1481 file to match the parent.
1482 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
1483 of local symbols instead of input values. Update code to track
1484 changes in gold::relocate_section.
1485 * object.cc (Sized_relobj::compute_final_local_value): New methods.
1486 (Sized_relobj::compute_final_local_value_internal): New methods.
1487 (Sized_relobj::do_finalize_local_symbols): Move code from loop
1488 body into private version of Sized_relobj::compute_final_local_value.
1489 Call the inline method.
1490 * object.h (Symbol_value::Symbol_value): Define destructor. Free
1491 merged symbol value if there is one.
1492 (Symbol_value::has_output_value): New method defintiion.
1493 (Sized_relobj::Compute_final_local_value_status): New enum type.
1494 (Sized_relobj::compute_final_local_value): New methods.
1495 (Sized_relobj::compute_final_local_value_internal): New methods.
1496 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
1497 and arm_cortex_a8.sh.
1498 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
1499 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
1500 New tests.
1501 * Makefile.in: Regenerate.
1502 * testsuite/arm_bl_out_of_range.s: Update test.
1503 * testsuite/thumb_bl_out_of_range.s: Ditto.
1504 * testsuite/thumb_blx_out_of_range.s: Ditto.
1505 * testsuite/arm_branch_out_of_range.sh: New file.
1506 * testsuite/arm_cortex_a8.sh: Ditto.
1507 * testsuite/arm_cortex_a8_b.s: Ditto.
1508 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
1509 * testsuite/arm_cortex_a8_b_local.s: Ditto.
1510 * testsuite/arm_cortex_a8_bl.s: Ditto.
1511 * testsuite/arm_cortex_a8_blx.s: Ditto.
1512 * testsuite/arm_cortex_a8_local.s: Ditto.
1513 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
1514 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
1515
05a79166
L
15162010-09-08 Rafael Espindola <espindola@google.com>
1517
1518 * Makefile.am (memory_test.stdout): Run readelf with -W.
1519 * Makefile.in: Regenerate.
1520 * testsuite/memory_test.sh: Make the regexps accept both 32 and
1521 64 bit output.
1522
33dbc701
RÁE
15232010-09-08 Rafael Espindola <espindola@google.com>
1524
1525 * script-sections.cc (Script_sections::add_memory_region): Convert
1526 field precision to int.
1527 * script.cc (script_set_section_region, script_set_section_region):
1528 Convert field precision to int.
1529
731ca54a
RÁE
15302010-09-08 Rafael Espindola <espindola@google.com>
1531
1532 * arm.cc (do_finalize_sections): Create the __exidx_start and
1533 __exdix_end symbols even when the section is missing.
1534
7f8cd844
NC
15352010-09-08 Nick Clifton <nickc@redhat.com>
1536
1537 * README: Remove claim that MEMORY is not supported.
1538 * expression.cc (script_exp_function_origin)
1539 (script_exp_function_length): Move from here to ...
1540 * script.cc: ... here.
1541 (script_set_section_region, script_add_memory)
1542 (script_parse_memory_attr, script_include_directive): New
1543 functions.
1544 * script-sections.cc
1545 (class Memory_region): New class.
1546 (class Output_section_definition): Add set_memory_region,
1547 set_section_vma, set_section_lma and get_section_name methods.
1548 (class Script_Sections): Add add_memory_region,
1549 find_memory_region, find_memory_region_origin,
1550 find_memory_region_length and set_memory_region methods.
1551 Have set_section_addresses method walk the list of set memory
1552 regions.
1553 Extend the print methos to display memory regions.
1554 * script-sections.h: Add prototypes for new methods.
1555 Add enum for MEMORY region attributes.
1556 * yyscript.y: Add support for parsing MEMORY regions.
1557 * script-c.h: Add prototypes for new functions.
1558 * testsuite/Makefile.am: Add test of MEMORY region functionality.
1559 * testsuite/Makefile.in: Regenerate.
1560 * testsuite/memory_test.sh: New script.
1561 * testsuite/memory_test.s: New assembler source file.
1562 * testsuite/memory_test.t: New linker script.
1563
a4649286
DK
15642010-08-27 Doug Kwan <dougkwan@google.com>
1565
1566 * gold/resolve.cc (Symbol_table::should_override): Let a weak
1567 reference override an existing dynamic weak reference.
1568 * testsuite/Makefile.am: Add new test dyn_weak_ref.
1569 * testsuite/Makefile.in: Regenerate.
1570 * testsuite/dyn_weak_ref.sh: New file.
1571 * testsuite/dyn_weak_ref_1.c: Ditto.
1572 * testsuite/dyn_weak_ref_2.c: Ditto.
1573
b56648ad
ILT
15742010-08-27 Ian Lance Taylor <iant@google.com>
1575
1576 * incremental.h (class Incremental_input_entry): Add virtual
1577 destructor.
1578
809313cb
ILT
15792010-08-27 Ian Lance Taylor <iant@google.com>
1580
1581 * testsuite/start_lib_test_3.c: Mark t3 as used.
1582
11e32464
NC
15832010-08-27 Nick Clifton <nickc@redhat.com>
1584
1585 * options.cc (version_script): Fix small typo in previous
1586 whitespace tidyup.
1587
ca09d69a
NC
15882010-08-25 Nick Clifton <nickc@redhat.com>
1589
1590 * archive.cc: Formatting fixes: Remove whitespace between
1591 typename and following asterisk. Remove whitespace between
1592 function name and opening parenthesis.
1593 * archive.h: Likewise.
1594 * arm.cc: Likewise.
1595 * attributes.cc: Likewise.
1596 * attributes.h: Likewise.
1597 * common.cc: Likewise.
1598 * copy-relocs.cc: Likewise.
1599 * dirsearch.h: Likewise.
1600 * dynobj.cc: Likewise.
1601 * ehframe.cc: Likewise.
1602 * ehframe.h: Likewise.
1603 * expression.cc: Likewise.
1604 * fileread.cc: Likewise.
1605 * fileread.h: Likewise.
1606 * gc.h: Likewise.
1607 * gold-threads.cc: Likewise.
1608 * gold.cc: Likewise.
1609 * i386.cc: Likewise.
1610 * icf.h: Likewise.
1611 * incremental-dump.cc: Likewise.
1612 * incremental.cc: Likewise.
1613 * layout.cc: Likewise.
1614 * layout.h: Likewise.
1615 * main.cc: Likewise.
1616 * merge.cc: Likewise.
1617 * merge.h: Likewise.
1618 * object.cc: Likewise.
1619 * object.h: Likewise.
1620 * options.cc: Likewise.
1621 * options.h: Likewise.
1622 * output.cc: Likewise.
1623 * output.h: Likewise.
1624 * plugin.cc: Likewise.
1625 * plugin.h: Likewise.
1626 * powerpc.cc: Likewise.
1627 * reloc.cc: Likewise.
1628 * script-c.h: Likewise.
1629 * script-sections.cc: Likewise.
1630 * script.cc: Likewise.
1631 * stringpool.cc: Likewise.
1632 * symtab.cc: Likewise.
1633 * symtab.h: Likewise.
1634 * target.cc: Likewise.
1635 * timer.cc: Likewise.
1636 * timer.h: Likewise.
1637 * version.cc: Likewise.
1638 * x86_64.cc: Likewise.
1639
b8fa8750
NC
16402010-08-24 Nick Clifton <nickc@redhat.com>
1641
1642 PR 11899
1643 * layout.cc (segment_precedes): Sort segments by their physical
1644 addresses, if they have been set.
1645
9919d93b
CC
16462010-08-23 Cary Coutant <ccoutant@google.com>
1647
1648 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
1649 symbols data.
1650 (Lib_group::include_member): Unlock object after deleting its
1651 symbols data.
1652 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
1653 the bug fixed here.
1654
97b4be1c
CC
16552010-08-19 Neil Vachharajani <nvachhar@google.com>
1656 Cary Coutant <ccoutant@google.com>
1657
1658 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
1659 constructor, and set_blocker.
1660 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
1661 readsyms_blocker_.
1662 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
1663 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
1664 * testsuite/Makefile.am (start_lib_test): New test case.
1665 * testsuite/Makefile.in: Regenerate.
1666 * testsuite/start_lib_test_main.c: New file.
1667 * testsuite/start_lib_test_1.c: New file.
1668 * testsuite/start_lib_test_2.c: New file.
1669 * testsuite/start_lib_test_3.c: New file.
1670
dd0b1884
ILT
16712010-08-19 Ian Lance Taylor <iant@google.com>
1672
1673 * Makefile.in: Rebuild with automake 1.11.1.
1674 * aclocal.m4: Likewise.
1675 * testsuite/Makefile.in: Likewise.
1676
7223e9ca
ILT
16772010-08-19 Ian Lance Taylor <iant@google.com>
1678
1679 PR 10893
1680 * i386.cc (class Output_data_plt_i386): Update declarations.
1681 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
1682 local_ifuncs_ fields.
1683 (Target_i386::do_plt_section_for_global): New function.
1684 (Target_i386::do_plt_section_for_local): New function.
1685 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
1686 parameter; change all callers. Initialize global_ifuncs_ and
1687 local_ifuncs_. If doing a static link define __rel_iplt_start and
1688 __rel_iplt_end.
1689 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
1690 (Output_data_plt_i386::add_local_ifunc_entry): New function.
1691 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
1692 symbols.
1693 (Target_i386::make_plt_section): New function, broken out of
1694 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
1695 (Target_i386::make_plt_entry): Call make_plt_section.
1696 (Target_i386::make_local_ifunc_plt_entry): New function.
1697 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
1698 (Target_i386::Scan::local): Handle IFUNC symbols. Add
1699 R_386_IRELATIVE to switch.
1700 (Target_i386::Scan::global): Likewise.
1701 (Target_i386::Relocate::relocate): Likewise.
1702 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
1703 switch.
1704 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
1705 (Target_x86_64::do_plt_section_for_global): New function.
1706 (Target_x86_64::do_plt_section_for_local): New function.
1707 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
1708 parameter; change all callers. If doing a static link define
1709 __rela_iplt_start and __rela_iplt_end.
1710 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
1711 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
1712 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
1713 to point to .plt.
1714 (Target_x86_64::make_local_ifunc_plt_entry): New function.
1715 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
1716 switch.
1717 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
1718 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
1719 R_X86_64_IRELATIVE to switch.
1720 (Target_x86_64::Scan::global): Likewise.
1721 (Target_x86_64::Relocate::relocate): Likewise.
1722 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
1723 switch.
1724 * target.h (class Target): Add plt_section_for_global and
1725 plt_section_for_local functions. Add do_plt_section_for_global
1726 and do_plt_section_for_local virtual functions.
1727 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
1728 clarifying comments.
1729 (Symbol::use_plt_offset): Handle IFUNC symbol.
1730 * object.cc (Sized_relobj::Sized_relobj): Initialize
1731 local_plt_offsets_.
1732 (Sized_relobj::local_has_plt_offset): New function.
1733 (Sized_relobj::local_plt_offset): New function.
1734 (Sized_relobj::set_local_plt_offset): New function.
1735 (Sized_relobj::do_count): Handle IFUNC symbol.
1736 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
1737 a bit away from input_shndx_ field. Add set_is_func_symbol and
1738 is_ifunc_symbol functions.
1739 (class Sized_relobj): Update declarations. Remove Tls_got_entry
1740 and Local_tls_got_offsets. Define Local_plt_offsets. Add
1741 local_plt_offsets_ field.
1742 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
1743 * output.h (class Output_section_data): Add non-const
1744 output_section function.
1745 (class Output_data_got): Update declarations.
1746 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
1747 Add use_plt_offset parameter to global and local constructors.
1748 Change all callers. Change local_sym_index_ field to 31 bits.
1749 Change GSYM_CODE and CONSTANT_CODE accordingly.
1750 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
1751 doing a static link don't set sh_link field.
1752 (Output_data_got::Got_entry::write): Use PLT offset if
1753 appropriate.
1754 (Output_data_got::add_global_plt): New function.
1755 (Output_data_got::add_local_plt): New function.
1756 * target-reloc.h (relocate_section): Handle IFUNC symbol.
1757 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
1758 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
1759 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
1760 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
1761 IFUNC conditional.
1762 * testsuite/ifunc-sel.h: New file.
1763 * testsuite/ifuncmain1.c: New file.
1764 * testsuite/ifuncmain1vis.c: New file.
1765 * testsuite/ifuncmod1.c: New file.
1766 * testsuite/ifuncdep2.c: New file.
1767 * testsuite/ifuncmain2.c: New file.
1768 * testsuite/ifuncmain3.c: New file.
1769 * testsuite/ifuncmod3.c: New file.
1770 * testsuite/ifuncmain4.c: New file.
1771 * testsuite/ifuncmain5.c: New file.
1772 * testsuite/ifuncmod5.c: New file.
1773 * testsuite/ifuncmain6pie.c: New file.
1774 * testsuite/ifuncmod6.c: New file.
1775 * testsuite/ifuncmain7.c: New file.
1776 * configure, testsuite/Makefile.in: Rebuild.
1777
56f75c03
ILT
17782010-08-18 Ian Lance Taylor <iant@google.com>
1779
1780 * incremental.cc
1781 (Output_section_incremental_inputs::write_input_files): Add cast
1782 to avoid signed/unsigned comparison warning.
1783 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1784
55455f89
CC
17852010-08-12 Cary Coutant <ccoutant@google.com>
1786
1787 * common.cc (Sort_commons::operator()): Remove unnecessary code.
1788
e2054bcb
ILT
17892010-08-13 Ian Lance Taylor <iant@google.com>
1790
1791 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
1792
74f67560
DK
17932010-08-12 Cary Coutant <ccoutant@google.com>
1794 Doug Kwan <dougkwan@google.com>
1795
1796 * resolve.cc (Symbol_table::should_override): When a weak dynamic
1797 defintion overrides non-weak undef, remember that the original undef
1798 is not weak.
1799 * symtab.cc (Symbol_table::sized_write_global): For undef without
1800 an original weak binding, set binding to global in output.
1801 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
1802 * testsuite/Makefile.in: Regenerate.
1803 * testsuite/strong_ref_weak_def.sh: New file.
1804 * testsuite/strong_ref_weak_def_1.c: Ditto.
1805 * testsuite/strong_ref_weak_def_2.c: Ditto.
1806
d1238d12
CC
18072010-08-12 Cary Coutant <ccoutant@google.com>
1808
1809 * testsuite/incremental_test.sh: Rewrite.
1810 * testsuite/incremental_test_1.c: Rewrite.
1811 * testsuite/incremental_test_2.c: Rewrite.
1812
0e70b911
CC
18132010-08-12 Cary Coutant <ccoutant@google.com>
1814
1815 * arm.cc (Target_arm::got_size): Add const.
1816 (Target_arm::got_entry_count): New function.
1817 (Target_arm::plt_entry_count): New function.
1818 (Target_arm::first_plt_entry_offset): New function.
1819 (Target_arm::plt_entry_size): New function.
1820 (Output_data_plt_arm::entry_count): New function.
1821 (Output_data_plt_arm::first_plt_entry_offset): New function.
1822 (Output_data_plt_arm::get_plt_entry_size): New function.
1823 * i386.cc (Target_i386::got_size): Add const.
1824 (Target_i386::got_entry_count): New function.
1825 (Target_i386::plt_entry_count): New function.
1826 (Target_i386::first_plt_entry_offset): New function.
1827 (Target_i386::plt_entry_size): New function.
1828 (Output_data_plt_i386::entry_count): New function.
1829 (Output_data_plt_i386::first_plt_entry_offset): New function.
1830 (Output_data_plt_i386::get_plt_entry_size): New function.
1831 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
1832 find_incremental_inputs_sections. Dump incremental_got_plt section.
1833 * incremental.cc: Include target.h.
1834 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
1835 parameter. Adjust all callers. Find incremental_got_plt section.
1836 (Incremental_inputs::create_data_sections): Create incremental_got_plt
1837 section.
1838 (Output_section_incremental_inputs::set_final_data_size): Calculate
1839 size of incremental_got_plt section.
1840 (Output_section_incremental_inputs::do_write): Write the
1841 incremental_got_plt section.
1842 (Got_plt_view_info): New struct.
1843 (Local_got_offset_visitor): New class.
1844 (Global_got_offset_visitor): New class.
1845 (Global_symbol_visitor_got_plt): New class.
1846 (Output_section_incremental_inputs::write_got_plt): New function.
1847 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
1848 Add parameter. Adjust all callers.
1849 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1850 (Incremental_inputs::got_plt_section): New function.
1851 (Incremental_inputs::got_plt_section_): New data member.
1852 (Incremental_got_plt_reader): New class.
1853 * layout.cc (Layout::create_incremental_info_sections): Add the
1854 incremental_got_plt section.
1855 * object.h (Got_offset_list::get_list): New function.
1856 (Got offset_list::for_all_got_offsets): New function.
1857 (Sized_relobj::local_got_offset_list): New function.
1858 * powerpc.cc (Target_powerpc::got_size): Add const.
1859 (Target_powerpc::got_entry_count): New function.
1860 (Target_powerpc::plt_entry_count): New function.
1861 (Target_powerpc::first_plt_entry_offset): New function.
1862 (Target_powerpc::plt_entry_size): New function.
1863 (Output_data_plt_powerpc::entry_count): New function.
1864 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
1865 (Output_data_plt_powerpc::get_plt_entry_size): New function.
1866 * sparc.cc (Target_sparc::got_size): Add const.
1867 (Target_sparc::got_entry_count): New function.
1868 (Target_sparc::plt_entry_count): New function.
1869 (Target_sparc::first_plt_entry_offset): New function.
1870 (Target_sparc::plt_entry_size): New function.
1871 (Output_data_plt_sparc::entry_count): New function.
1872 (Output_data_plt_sparc::first_plt_entry_offset): New function.
1873 (Output_data_plt_sparc::get_plt_entry_size): New function.
1874 * symtab.h (Symbol::got_offset_list): New function.
1875 (Symbol_table::for_all_symbols): New function.
1876 * target.h (Sized_target::got_entry_count): New function.
1877 (Sized_target::plt_entry_count): New function.
1878 (Sized_target::plt_entry_size): New function.
1879 * x86_64.cc (Target_x86_64::got_size): Add const.
1880 (Target_x86_64::got_entry_count): New function.
1881 (Target_x86_64::plt_entry_count): New function.
1882 (Target_x86_64::first_plt_entry_offset): New function.
1883 (Target_x86_64::plt_entry_size): New function.
1884 (Output_data_plt_x86_64::entry_count): New function.
1885 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
1886 (Output_data_plt_x86_64::get_plt_entry_size): New function.
1887
09ec0418
CC
18882010-08-12 Cary Coutant <ccoutant@google.com>
1889
1890 * archive.cc: Include incremental.h.
1891 (Archive::Archive): Initialize incremental_info_.
1892 (Archive::include_member): Record archive members in incremental info.
1893 (Add_archive_symbols::run): Record begin and end of an archive in
1894 incremental info.
1895 (Lib_group::include_member): Record objects in incremental info.
1896 * archive.h (Incremental_archive_entry): Forward declaration.
1897 (Archive::set_incremental_info): New member function.
1898 (Archive::incremental_info): New member function.
1899 (Archive::Unused_symbol_iterator): New class.
1900 (Archive::unused_symbols_begin): New member function.
1901 (Archive::unused_symbols_end): New member function.
1902 (Archive::incremental_info_): New data member.
1903 * incremental-dump.cc (find_input_containing_global): New function.
1904 (dump_incremental_inputs): Dump new incremental info sections.
1905 * incremental.cc: Include symtab.h.
1906 (Output_section_incremental_inputs): New class.
1907 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
1908 new incremental info sections.
1909 (Sized_incremental_binary::do_check_inputs): Likewise.
1910 (Incremental_inputs::report_archive): Remove.
1911 (Incremental_inputs::report_archive_begin): New function.
1912 (Incremental_inputs::report_archive_end): New function.
1913 (Incremental_inputs::report_object): New function.
1914 (Incremental_inputs::finalize_inputs): Remove.
1915 (Incremental_inputs::report_input_section): New function.
1916 (Incremental_inputs::report_script): Rewrite.
1917 (Incremental_inputs::finalize): Do nothing but finalize string table.
1918 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1919 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1920 (Incremental_inputs::create_data_sections): New function.
1921 (Incremental_inputs::relocs_entsize): New function.
1922 (Output_section_incremental_inputs::set_final_data_size): New function.
1923 (Output_section_incremental_inputs::do_write): New function.
1924 (Output_section_incremental_inputs::write_header): New function.
1925 (Output_section_incremental_inputs::write_input_files): New function.
1926 (Output_section_incremental_inputs::write_info_blocks): New function.
1927 (Output_section_incremental_inputs::write_symtab): New function.
1928 * incremental.h (Incremental_script_entry): Forward declaration.
1929 (Incremental_object_entry): Forward declaration.
1930 (Incremental_archive_entry): Forward declaration.
1931 (Incremental_inputs): Forward declaration.
1932 (Incremental_inputs_header_data): Remove.
1933 (Incremental_inputs_header): Remove.
1934 (Incremental_inputs_header_write): Remove.
1935 (Incremental_inputs_entry_data): Remove.
1936 (Incremental_inputs_entry): Remove.
1937 (Incremental_inputs_entry_write): Remove.
1938 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
1939 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
1940 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1941 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
1942 Likewise.
1943 (Incremental_input_entry): New class.
1944 (Incremental_script_entry): New class.
1945 (Incremental_object_entry): New class.
1946 (Incremental_archive_entry): New class.
1947 (Incremental_inputs::Incremental_inputs): Initialize new data members.
1948 (Incremental_inputs::report_inputs): Remove.
1949 (Incremental_inputs::report_archive): Remove.
1950 (Incremental_inputs::report_archive_begin): New function.
1951 (Incremental_inputs::report_archive_end): New function.
1952 (Incremental_inputs::report_object): Change prototype.
1953 (Incremental_inputs::report_input_section): New function.
1954 (Incremental_inputs::report_script): Change prototype.
1955 (Incremental_inputs::get_reloc_count): New function.
1956 (Incremental_inputs::set_reloc_count): New function.
1957 (Incremental_inputs::create_data_sections): New function.
1958 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1959 (Incremental_inputs::inputs_section): New function.
1960 (Incremental_inputs::symtab_section): New function.
1961 (Incremental_inputs::relocs_section): New function.
1962 (Incremental_inputs::get_stringpool): Add const.
1963 (Incremental_inputs::command_line): Add const.
1964 (Incremental_inputs::inputs): Remove.
1965 (Incremental_inputs::command_line_key): New function.
1966 (Incremental_inputs::input_file_count): New function.
1967 (Incremental_inputs::input_files): New function.
1968 (Incremental_inputs::relocs_entsize): New function.
1969 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1970 (Incremental_inputs::finalize_inputs): Remove.
1971 (Incremental_inputs::Input_info): Remove.
1972 (Incremental_inputs::lock_): Remove.
1973 (Incremental_inputs::inputs_): Change type.
1974 (Incremental_inputs::inputs_map_): Remove.
1975 (Incremental_inputs::current_object_entry_): New data member.
1976 (Incremental_inputs::inputs_section_): New data member.
1977 (Incremental_inputs::symtab_section_): New data member.
1978 (Incremental_inputs::relocs_section_): New data member.
1979 (Incremental_inputs::reloc_count_): New data member.
1980 (Incremental_inputs_reader): New class.
1981 (Incremental_symtab_reader): New class.
1982 (Incremental_relocs_reader): New class.
1983 * layout.cc (Layout::finalize): Move finalization of incremental info
1984 and creation of incremental info sections to follow finalization of
1985 symbol table. Set offsets for postprocessing sections.
1986 (Layout::create_incremental_info_sections): Call
1987 Incremental_inputs::create_data_sections. Add incremental symtab
1988 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
1989 sections to layout after input sections.
1990 * layout.h (struct Timespec): Forward declaration.
1991 (Layout::incremental_inputs): Add const.
1992 (Layout::create_incremental_info_sections): Add parameter.
1993 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
1994 * object.cc: Include incremental.h.
1995 (Relobj::finalize_incremental_relocs): New function.
1996 (Sized_relobj::do_layout): Record input sections in incremental info.
1997 * object.h (Object::output_section): New function.
1998 (Object::output_section_offset): Moved from Relobj.
1999 (Object::get_incremental_reloc_base): New function.
2000 (Object::get_incremental_reloc_count): New function.
2001 (Object::do_output_section): New function.
2002 (Object::do_output_section_offset): Moved from Relobj.
2003 (Object::do_get_incremental_reloc_base): New function.
2004 (Object::do_get_incremental_reloc_count): New function.
2005 (Object::Object): Initialize new data members.
2006 (Relobj::output_section): Renamed do_output_section and moved to
2007 protected.
2008 (Relobj::output_section_offset): Moved to Object.
2009 (Relobj::do_get_incremental_reloc_base): New function.
2010 (Relobj::do_get_incremental_reloc_count): New function.
2011 (Relobj::allocate_incremental_reloc_counts): New function.
2012 (Relobj::count_incremental_reloc): New function.
2013 (Relobj::finalize_incremental_relocs): New function.
2014 (Relobj::next_incremental_reloc_index): New function.
2015 (Relobj::reloc_counts_): New data member.
2016 (Relobj::reloc_bases_): New data member.
2017 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2018 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2019 (Sized_relobj::incremental_relocs_scan): New function.
2020 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2021 (Sized_relobj::incremental_relocs_write): New function.
2022 (Sized_relobj::incremental_relocs_write_reltype): New function.
2023 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2024 incremental link.
2025 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2026 archives and object files elsewhere.
2027 (Add_symbols::run): Report object files here.
2028 (Finish_group::run): Report end of archive at end of group.
2029 * reloc.cc: Include layout.h, incremental.h.
2030 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2031 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2032 (Sized_relobj::incremental_relocs_scan): New function.
2033 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2034 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2035 (Sized_relobj::incremental_relocs_write): New function.
2036 (Sized_relobj::incremental_relocs_write_reltype): New function.
2037 * script.cc (read_input_script): Rewrite test for incremental link.
2038 Change call to Incremental_inputs::report_script.
2039 * symtab.h (Symbol_table::first_global_index): New function.
2040 (Symbol_table::output_count): New function.
2041
ce0d1972
DK
20422010-08-12 Doug Kwan <dougkwan@google.com>
2043
2044 * arm.cc (Target_arm::merge_object_attributes): Check command line
2045 options --no-wchar-size-warning and --no-enum-size-warning.
2046 * options.h (General_options): Add ld-compatible options
2047 --no-enum-size-warning and --no-wchar-size-warning.
2048
6e5710ce
ILT
20492010-08-04 Ian Lance Taylor <iant@google.com>
2050
2051 * x86_64.cc (Target_x86_64::Scan::local): Use
2052 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2053 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2054 (Target_x86_64::Scan::global): Likewise.
2055 (Target_x86_64::Relocate::relocate): Likewise.
2056 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2057 Likewise.
2058
fef830db
CC
20592010-08-03 Cary Coutant <ccoutant@google.com>
2060
2061 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2062 to reserve space in merged_strings vector. Keep total input size
2063 for stats.
2064 (Output_merge_string::do_print_merge_stats): Print total input size.
2065 * merge.h (Output_merge_string): Add input_size_ field.
2066 * stringpool.cc (Stringpool_template::string_length): Move
2067 implementations out of Stringpool_template class and place in
2068 stringpool.h.
2069 * stringpool.h (string_length): Move out of Stringpool_template.
2070
1e3811b0
ILT
20712010-08-03 Ian Lance Taylor <iant@google.com>
2072
2073 PR 11712
2074 * layout.cc (relaxation_loop_body): If address of load segment is
2075 set, adjust address to include headers if possible.
2076
7af0c620
ILT
20772010-08-03 Ian Lance Taylor <iant@google.com>
2078
2079 * version.cc (version_string): Bump to 1.10.
2080
22f0da72
ILT
20812010-08-03 Ian Lance Taylor <iant@google.com>
2082
2083 PR 11805
2084 * layout.h (enum Output_section_order): Define.
2085 (class Layout): Update declarations.
2086 * layout.cc (Layout::get_output_section): Add order parameter.
2087 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2088 is_first_non_relro parameters. Change all callers.
2089 (Layout::choose_output_section): Likewise.
2090 (Layout::add_output_section_data): Likewise.
2091 (Layout::make_output_section): Likewise. Set order.
2092 (Layout::default_section_order): New function.
2093 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2094 * output.cc (Output_section::Output_section): Initialize order_.
2095 Don't initialize deleted fields.
2096 (Output_segment::Output_segment): Don't initialize deleted
2097 fields.
2098 (Output_segment::add_output_section_to_load): New function
2099 replacing add_output_section. Change all callers to call this or
2100 add_output_section_to_nonload.
2101 (Output_segment::add_output_section_to_nonload): New function.
2102 (Output_segment::remove_output_section): Rewrite.
2103 (Output_segment::add_initial_output_data): Likewise.
2104 (Output_segment::has_any_data_sections): Likewise.
2105 (Output_segment::is_first_section_relro): Likewise.
2106 (Output_segment::maximum_alignment): Likewise.
2107 (Output_segment::has_dynamic_reloc): New function replacing
2108 dynamic_reloc_count. Change all callers.
2109 (Output_segment::has_dynamic_reloc_list): New function replacing
2110 dynamic_reloc_count_list. Change all callers.
2111 (Output_segment::set_section_addresses): Rewrite.
2112 (Output_segment::set_offset): Rewrite.
2113 (Output_segment::find_first_and_last_list): Remove.
2114 (Output_segment::set_tls_offsets): Rewrite.
2115 (Output_segment::first_section_load_address): Likewise.
2116 (Output_segment::output_section_count): Likewise.
2117 (Output_segment::section_with_lowest_load_address): Likewise.
2118 (Output_segment::write_section_headers): Likewise.
2119 (Output_segment::print_sections_to_map): Likewise.
2120 * output.h (class Output_data): Remove dynamic_reloc_count_
2121 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2122 (Output_data::add_dynamic_reloc): Rewrite.
2123 (Output_data::has_dynamic_reloc): New function.
2124 (Output_data::dynamic_reloc_count): Remove.
2125 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2126 is_last_relro_, is_first_non_relro_, is_interp_,
2127 is_dynamic_linker_section_ fields. Add order and set_order
2128 functions. Remove is_relro_local, set_is_relro_local,
2129 is_last_relro, set_is_last_relro, is_first_non_relro,
2130 set_is_first_non_relro functions, is_interp, set_is_interp,
2131 is_dynamic_linker_section, and set_is_dynamic_linker_section
2132 functions.
2133 (class Output_segment): Change Output_data_list from std::list to
2134 std:;vector. Add output_lists_ field. Remove output_data_ and
2135 output_bss_ fields. Update declarations.
2136
3ff2ccb0
ILT
21372010-08-02 Ian Lance Taylor <iant@google.com>
2138
2139 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2140 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2141 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2142
88a4108b
ILT
21432010-08-02 Ian Lance Taylor <iant@google.com>
2144
2145 PR 11855
2146 * script.cc (Script_options::Script_options): Initialize
2147 symbol_definitions_ and symbol_references_.
2148 (Script_options::add_symbol_assignment): Update
2149 symbol_definitions_ and symbol_references_.
2150 (Script_options::add_symbol_reference): New function.
2151 (script_symbol): New function.
2152 * script.h (class Script_options): Add symbol_definitions_ and
2153 symbol_references_ fields.
2154 (Script_options::referenced_const_iterator): New type.
2155 (Script_options::referenced_begin): New function.
2156 (Script_options::referenced_end): New function.
2157 (Script_options::is_referenced): New function.
2158 (Script_options::any_unreferenced): New function.
2159 * script-c.h (script_symbol): Declare.
2160 * yyscript.y (exp): Call script_symbol.
2161 * symtab.cc: Include "script.h".
2162 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2163 Change all callers. Check symbols referenced by scripts.
2164 (Symbol_table::add_undefined_symbols_from_command_line): Add
2165 layout parameter. Change all callers.
2166 (Symbol_table::do_add_undefined_symbols_from_command_line):
2167 Likewise. Break out loop body. Check symbols referenced by
2168 scripts.
2169 (Symbol_table::add_undefined_symbol_from_command_line): New
2170 function broken out of
2171 do_add_undefined_symbols_from_command_line.
2172 * symtab.h (class Symbol_table): Update declarations.
2173 * archive.cc: Include "layout.h".
2174 (Archive::should_include_member): Add layout parameter. Change
2175 all callers. Check for symbol mentioned in expression.
2176 * archive.h (class Archive): Update declaration.
2177 * object.cc (Sized_relobj::do_should_include_member): Add layout
2178 parameter.
2179 * object.h (Object::should_include_member): Add layout parameter.
2180 Change all callers.
2181 (Object::do_should_include_member): Add layout parameter.
2182 (class Sized_relobj): Update declaration.
2183 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2184 parameter.
2185 * dynobj.h (class Sized_dynobj): Update declaration.
2186 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2187 layout parameter.
2188 * plugin.h (class Sized_pluginobj): Update declaration.
2189
5f1ab67a
ILT
21902010-08-02 Ian Lance Taylor <iant@google.com>
2191
2192 PR 11866
2193 * output.cc (Output_segment::set_offset): Search for the first and
2194 last sections rather than assuming that the list is in order.
2195 (Output_segment::find_first_and_last_list): New function.
2196 * output.h (class Output_segment): Update declarations.
2197 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2198 (relro_strip_test_SOURCES): New variable.
2199 (relro_strip_test_DEPENDENCIES): New variable.
2200 (relro_strip_test_LDFLAGS): New variable.
2201 (relro_strip_test_LDADD): New variable.
2202 (relro_strip_test.so): New target.
2203
a8df5856
ILT
22042010-08-02 Ian Lance Taylor <iant@google.com>
2205
2206 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2207 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2208 (Target_i386::got_tlsdesc_section): New function.
2209 (Target_i386::got_section): Create space for GOT entries for
2210 TLSDESC relocations.
2211 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2212 R_386_TLS_GOTDESC.
2213 (Target_i386::Scan::global): Likewise.
2214 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2215 using TLSDESC GOT.
2216 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2217 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2218 (Target_x86_64::got_tlsdesc_section): New function.
2219 (Target_x86_64::got_section): Create space for GOT entries for
2220 TLSDESC relocations.
2221 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2222 R_386_TLS_GOTDESC.
2223 (Target_x86_64::Scan::global): Likewise.
2224 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2225 using TLSDESC GOT.
2226
0c10a0a6
ILT
22272010-08-02 Ian Lance Taylor <iant@google.com>
2228
2229 * testsuite/final_layout.sh: Use dc to convert from hex to
2230 decimal.
2231
41cbeecc
ST
22322010-07-29 Sriraman Tallam <tmsriram@google.com>
2233
2234 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2235 paramter to the call to gold::gc_process_relocs.
2236 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2237 paramter to the call to gold::gc_process_relocs.
2238 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2239 parameter to the call to gold::gc_process_relocs.
2240 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2241 template parameter to the call to gold::gc_process_relocs.
2242 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2243 paramter to the call to gold::gc_process_relocs.
2244 * gc.h (get_embedded_addend_size): New function.
2245 (gc_process_relocs): Save the size of the reloc for use by ICF.
2246 * icf.cc (get_section_contents): Get the addend from the text section
2247 for SHT_REL relocation sections.
2248 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2249 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2250 * int_encoding.h (read_from_pointer): New overloaded function.
2251 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2252 * testsuite/icf_sht_rel_addend_test.sh: New file.
2253 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2254 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2255
6ea55b82
RW
22562010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2257
2258 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2259 * Makefile.in: Regenerate.
2260 * testsuite/Makefile.in: Regenerate.
2261
9691462b
ILT
22622010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2263
2264 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2265 * gold/testsuite/debug_msg.cc: Likewise.
2266 * gold/testsuite/odr_violation1.cc
2267 * gold/testsuite/odr_violation2.cc
2268
76897331
CC
22692010-07-21 Cary Coutant <ccoutant@google.com>
2270
2271 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2272 string, and length fields.
2273 (Output_merge_string::Merged_strings_list): New type.
2274 (Output_merge_string::Merged_strings_lists): New typedef.
2275 (Output_merge_string): Replace merged_strings_ with
2276 merged_strings_lists_.
2277 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2278 Merged_strings_list per input object and section. Don't store pointer
2279 to the string. Don't store length with each merged string entry.
2280 (Output_merge_string::finalize_merged_data): Loop over list of merged
2281 strings lists. Recompute length of each merged string.
2282
78384e8f
CC
22832010-07-15 Cary Coutant <ccoutant@google.com>
2284
2285 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2286 here.
2287
783659f9
ILT
22882010-07-14 Ian Lance Taylor <iant@google.com>
2289
2290 * descriptors.cc (Descriptors::open): Report correct name in error
2291 message.
2292
131687b4
DK
22932010-07-13 Doug Kwan <dougkwan@google.com>
2294
2295 * arm.cc (Arm_input_section::Arm_input_section): For a
2296 SHT_ARM_EXIDX section, always keeps the input sections.
2297 (Arm_input_section::set_exidx_section_link): New method.
2298 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
2299 has_errors_ to false.
2300 (Arm_exidx_input_section::has_errors,
2301 Arm_exidx_input_section::set_has_errors): New methods.
2302 (Arm_exidx_input_section::has_errors_): New data member.
2303 (Arm_relobj::get_exidx_shndx_list): New method.
2304 (Arm_output_section::append_text_sections_to_list): Do not skip
2305 section without SHF_EXECINSTR.
2306 (Arm_output_section::fix_exidx_coverage): Skip input sections with
2307 errors.
2308 (Arm_relobj::make_exidx_input_section): Add new parameter for text
2309 section header. Make error messages more verbose. Check for
2310 a non-executable section linked to an EXIDX section.
2311 (Arm_relobj::do_read_symbols): Remove error checking, which has been
2312 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
2313 check that there is no deferred EXIDX section if we exit early.
2314 Instead of not making an EXIDX section in case of an error, make one
2315 and set the has_errors flag of it.
2316 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
2317 in a relocatable link.
2318 (Target_arm::do_relax): Look for the EXIDX output section instead of
2319 assuming that it is called .ARM.exidx.
2320 (Target_arm::fix_exidx_coverage): Add a new parameter for input
2321 section list. Do not check for SHF_EXECINSTR section flags but
2322 skip any input section with errors.
2323 * output.cc (Output_section::Output_section): Initialize
2324 always_keeps_input_sections_ to false.
2325 (Output_section::add_input_section): Check for
2326 always_keeps_input_sections_.
2327 * output.h (Output_section::always_keeps_input_sections,
2328 Output_section::set_always_keeps_input_sections): New methods.
2329 (Output_section::always_keeps_input_sections): New data member.
2330
69517287
RÁE
23312010-07-13 Rafael Espindola <espindola@google.com>
2332
2333 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
2334 * fileread.h (Input_file): Add try_extra_search_path and find_file.
2335
82742395
ILT
23362010-07-13 Philip Herron <herron.philip@googlemail.com>
2337 Ian Lance Taylor <iant@google.com>
2338
2339 * output.h (Output_section_lookup_maps::add_merge_section):
2340 Correct check of whether value was inserted.
2341 (Output_section_lookup_maps::add_merge_input_section): Likewise.
2342 (Output_section_lookup_maps::add_relaxed_input_section):
2343 Likewise.
2344 * arm.cc (Target_arm::got_section): Remove used local os.
2345 * i386.cc (Target_i386::got_section): Likewise.
2346 * x86_64.cc (Target_x86_64::got_section): Likewise.
2347 * sparc.cc (Target_sparc::got_section): Likewise.
2348 (Target_sparc::relocate): Remove unused local have_got_offset.
2349 * powerpc.cc (Target_powerpc::relocate): Likewise.
2350
f2d707b5
ILT
23512010-07-13 Ian Lance Taylor <iant@google.com>
2352
241531d6
ILT
2353 * compressed_output.cc (zlib_decompress): Fix signature in
2354 !HAVE_ZLIB_H case.
2355
f2d707b5
ILT
2356 * archive.cc (Archive::include_member): Unlock an external member
2357 of a thin archive. Don't bother to delete an object we know is
2358 NULL.
2359
a2e47362
CC
23602010-07-12 Cary Coutant <ccoutant@google.com>
2361
2362 * compressed_output.cc (zlib_decompress): New function.
2363 (get_uncompressed_size): New function.
2364 (decompress_input_section): New function.
2365 * compressed_output.h (get_uncompressed_size): New function.
2366 (decompress_input_section): New function.
2367 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
2368 Handle compressed debug sections.
2369 * layout.cc (is_compressed_debug_section): New function.
2370 (Layout::output_section_name): Map compressed section names to
2371 canonical names.
2372 * layout.h (is_compressed_debug_section): New function.
2373 (is_debug_info_section): Recognize compressed debug sections.
2374 * merge.cc: Include compressed_output.h.
2375 (Output_merge_data::do_add_input_section): Handle compressed
2376 debug sections.
2377 (Output_merge_string::do_add_input_section): Handle compressed
2378 debug sections.
2379 * object.cc: Include compressed_output.h.
2380 (Sized_relobj::Sized_relobj): Initialize new data members.
2381 (build_compressed_section_map): New function.
2382 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
2383 * object.h (Object::section_is_compressed): New method.
2384 (Object::do_section_is_compressed): New method.
2385 (Sized_relobj::Compressed_section_map): New type.
2386 (Sized_relobj::do_section_is_compressed): New method.
2387 (Sized_relobj::compressed_sections_): New data member.
2388 * output.cc (Output_section::add_input_section): Handle compressed
2389 debug sections.
2390 * reloc.cc: Include compressed_output.h.
2391 (Sized_relobj::write_sections): Handle compressed debug sections.
2392
ce279a62
CC
23932010-07-08 Cary Coutant <ccoutant@google.com>
2394
2395 * resolve.cc (Symbol_table::resolve): Remember whether undef was
2396 weak when resolving to a dynamic def.
2397 (Symbol_table::should_override): Add adjust_dyndef flag; set it
2398 for weak undef/dynamic def cases. Adjust callers.
2399 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
2400 undef_binding_weak_.
2401 (Symbol_table::sized_write_globals): Adjust symbol binding.
2402 (Symbol_table::sized_write_symbol): Add binding parameter.
2403 * symtab.h (Symbol::set_undef_binding): New method.
2404 (Symbol::is_undef_binding_weak): New method.
2405 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
2406 (Symbol_table::should_override): Add new parameter.
2407 (Symbol_table::sized_write_symbol): Add new parameter.
2408
2409 * testsuite/weak_undef_file1.cc: Add new test case.
2410 * testsuite/weak_undef_file2.cc: Fix header comment.
2411 * testsuite/weak_undef_test.cc: Add new test case.
2412
b2286c10
DK
24132010-06-29 Doug Kwan <dougkwan@google.com>
2414
2415 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
2416 Initialize USE_SYMBOL_.
2417 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
2418 definition.
2419 (Arm_reloc_property::uses_symbol_): New data member declaration.
2420 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
2421 uses symbol value and symbol is undefined but not weakly undefined.
2422
4802450a
RÁE
24232010-06-28 Rafael Espindola <espindola@google.com>
2424
2425 * plugin.cc (Plugin::load): Use dlerror.
2426
e5ca47ba
ILT
24272010-06-26 Jeffrey Yaskin <jyasskin@google.com>
2428
2429 * symtab.cc (detect_odr_violations): When reporting an ODR
2430 violation, report an object where the symbol is defined.
2431
8a75a161
DK
24322010-06-25 Doug Kwan <dougkwan@google.com>
2433
2434 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
2435 (Target_arm::section_may_have_icf_unsafe_pointers): New method
2436 definition.
2437 (Target_arm::Scan::local_reloc_may_be_function_pointer,
2438 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
2439 target hook to detect function points.
2440 (Target_arm::Scan::possible_function_pointer_reloc): New method.
2441 * icf.h (Icf::check_section_for_function_pointers): Change type of
2442 parameter SECTION_NAME to const reference to std::string. Use
2443 target hook to determine if section may have unsafe pointers.
2444 * target.h (Target::section_may_have_icf_unsafe_pointers): New
2445 method definition.
2446
42218b9f
RÁE
24472010-06-21 Rafael Espindola <espindola@google.com>
2448
2449 * fileread.cc (Input_file::find_fie): New
2450 (Input_file::open): Use Input_file::find_fie.
2451 * fileread.h (Input_file::find_fie): New
2452 * plugin.cc (set_extra_library_path): New.
2453 (Plugin::load): Add set_extra_library_path to the transfer vector.
2454 (Plugin_manager::set_extra_library_path): New.
2455 (Plugin_manager::add_input_file): Use the extra search path if set.
2456 (set_extra_library_path(): New.
2457 * plugin.h (Plugin_manager): Add set_extra_library_path and
2458 extra_search_path_.
2459
a0506cca
CC
24602010-06-19 Cary Coutant <ccoutant@google.com>
2461
2462 * layout.cc (gdb_sections): Add .debug_types.
2463 (lines_only_debug_sections): Likewise.
2464
6508b958
RÁE
24652010-06-18 Rafael Espindola <espindola@google.com>
2466
2467 * plugin.cc (add_input_file,add_input_library)
2468 (Plugin_manager::add_input_file): Make filename arguments const.
2469 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
2470 const.
2471
3e235302
DK
24722010-06-16 Doug Kwan <dougkwan@google.com>
2473
2474 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
2475 .ARM.attributes section if we have not merged any input
2476 attributes sections.
2477
106e8a6c
DK
24782010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2479
2480 * arm.cc: Allow combining objects with no EABI version
2481 information.
2482
91ff43fe
RÁE
24832010-06-15 Rafael Espindola <espindola@google.com>
2484
2485 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
2486
68ed838c
ILT
24872010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2488
2489 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
2490 (struct iovec): Correct !HAVE_READV definition.
2491
f3a2388f
CC
24922010-06-10 Cary Coutant <ccoutant@google.com>
2493
2494 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
2495 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
2496 reloc sections.
2497 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
2498
2499 PR 11683
2500 * symtab.h (Symbol::is_placeholder): New member function.
2501 * target-reloc.h (relocate_section): Check for placeholder symbols.
2502
2503 * testsuite/Makefile.am (plugin_test_8): New test.
2504 (plugin_test_9): New test.
2505 * testsuite/Makefile.in: Regenerate.
2506
e1df38aa
NC
25072010-06-09 Nick Clifton <nickc@redhat.com>
2508
2509 * yyscript.y (input_list_element): Allow strings prefixed with
2510 the '-' character. Treat these as libraries.
2511 * script.cc (script_add_library): New function. Adds a library
2512 specified by "-l<name>" found in an input script.
2513 * script-c.h: Add prototype for script_add_library.
2514
25bbe950
DK
25152010-06-07 Doug Kwan <dougkwan@google.com>
2516
2517 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
2518 Restrict stub-group size to be within long conditional branch
2519 range when working around cortex-A8 erratum.
2520
0f32ea4c
ILT
25212010-06-07 Damien Diederen <dd@crosstwine.com>
2522
2523 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
2524 #ifdef typo.
2525
8fe2a369
ST
25262010-06-03 Sriraman Tallam <tmsriram@google.com>
2527
2528 PR gold/11658
2529 * output.cc
2530 (Output_section::Input_section_sort_entry::compare_section_ordering):
2531 Change to return non-zero correctly.
2532 (Output_section::Input_section_sort_section_order_index_compare
2533 ::operator()): Change to fix ambiguity in comparisons.
2534
6e9ba2ca
ST
25352010-06-01 Sriraman Tallam <tmsriram@google.com>
2536
2537 * gold.h (is_wildcard_string): New function.
2538 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
2539 (Layout::layout_eh_frame): Ditto.
2540 (Layout::find_section_order_index): New method.
2541 (Layout::read_layout_from_file): New method.
2542 * layout.h (Layout::find_section_order_index): New method.
2543 (Layout::read_layout_from_file): New method.
2544 (Layout::input_section_position_): New private member.
2545 (Layout::input_section_glob_): New private member.
2546 * main.cc (main): Call read_layout_from_file here.
2547 * options.h (--section-ordering-file): New option.
2548 * output.cc (Output_section::input_section_order_specified_): New
2549 member.
2550 (Output_section::Output_section): Initialize new member.
2551 (Output_section::add_input_section): Add new parameter.
2552 Keep input sections when --section-ordering-file is used.
2553 (Output_section::set_final_data_size): Sort input sections when
2554 section ordering file is specified.
2555 (Output_section::Input_section_sort_entry): Add new parameter.
2556 Check sorting type.
2557 (Output_section::Input_section_sort_entry::compare_section_ordering):
2558 New method.
2559 (Output_section::Input_section_sort_compare::operator()): Change to
2560 consider section_order_index.
2561 (Output_section::Input_section_sort_init_fini_compare::operator()):
2562 Change to consider section_order_index.
2563 (Output_section::Input_section_sort_section_order_index_compare
2564 ::operator()): New method.
2565 (Output_section::sort_attached_input_sections): Change to sort
2566 according to section order when specified.
e1df38aa
NC
2567 (Output_section::add_input_section<32, true>): Add new parameter.
2568 (Output_section::add_input_section<64, true>): Add new parameter.
2569 (Output_section::add_input_section<32, false>): Add new parameter.
2570 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
2571 * output.h (Output_section::add_input_section): Add new parameter.
2572 (Output_section::input_section_order_specified): New
2573 method.
2574 (Output_section::set_input_section_order_specified): New method.
2575 (Input_section::Input_section): Initialize section_order_index_.
2576 (Input_section::section_order_index): New method.
2577 (Input_section::set_section_order_index): New method.
2578 (Input_section::section_order_index_): New member.
2579 (Input_section::Input_section_sort_section_order_index_compare): New
2580 struct.
2581 (Output_section::input_section_order_specified_): New member.
2582 * script-sections.cc (is_wildcard_string): Delete and move modified
2583 method to gold.h.
2584 (Output_section_element_input::Output_section_element_input): Modify
2585 call to is_wildcard_string.
2586 (Output_section_element_input::Input_section_pattern
2587 ::Input_section_pattern): Ditto.
2588 (Output_section_element_input::Output_section_element_input): Ditto.
2589 * testsuite/Makefile.am (final_layout): New test case.
2590 * testsuite/Makefile.in: Regenerate.
2591 * testsuite/final_layout.cc: New file.
2592 * testsuite/final_layout.sh: New file.
2593
3537c84b
RÁE
25942010-06-01 Rafael Espindola <espindola@google.com>
2595
2596 * plugin.cc (Plugin::load): Pass the output name to the plugin.
2597
105b6afd
RÁE
25982010-06-01 Rafael Espindola <espindola@google.com>
2599
2600 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
2601 visibility of symbols.
2602
29e11421
DK
26032010-05-27 Doug Kwan <dougkwan@google.com>
2604
2605 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
2606 from start of output section instead of address for a local symbol
2607 in a merged or relaxed section when doing a relocatable link.
2608
5e0f337e
RÁE
26092010-05-26 Rafael Espindola <espindola@google.com>
2610
2611 PR 11604
2612 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
2613 adding sections the garbage collector removed.
2614 * gold/testsuite/Makefile.am: Add test.
2615 * gold/testsuite/Makefile.in: Regenerate.
2616 * gold/testsuite/plugin_test_7.sh: New.
2617 * gold/testsuite/plugin_test_7_1.c: New.
2618 * gold/testsuite/plugin_test_7_2.c: New.
2619
f4187277
RÁE
26202010-05-26 Rafael Espindola <espindola@google.com>
2621
2622 * script-sections.cc (Output_section_definition::set_section_addresses):
2623 Check for --section-start.
2624
5c388529
DK
26252010-05-26 Doug Kwan <dougkwan@google.com>
2626
2627 * arm.cc (Arm_scan_relocatable_relocs): New class.
2628 (Target_arm::relocate_special_relocatable): New method.
2629 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
2630 (Arm_relocate_functions::thumb_branch_common): Same.
2631 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
2632 instead of Default_scan_relocatable_relocs.
2633 * target-reloc.h (relocate_for_relocatable): Let target handle
2634 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
2635 * target.h (Sized_target::relocate_special_relocatable): New method.
2636
bca1c3ae
ILT
26372010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2638
2639 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
2640
0439c796
DK
26412010-05-23 Doug Kwan <dougkwan@google.com>
2642
2643 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
2644 instead of a cast.
2645 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
2646 with a direct branch, not a conditional branch, to a stub.
2647 * merge.cc (Output_merge_base::record_input_section): New method
2648 defintion.
2649 (Output_merge_data::do_add_input_section): Record input section if
2650 keeps-input-sections flag is set.
2651 (Output_merge_string::do_add_input_section): Ditto.
2652 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
2653 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
2654 INPUT_SECTIONS_.
2655 (Output_merge_base::keeps_input_sections,
2656 Output_merge_base::set_keeps_input_sections,
2657 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
2658 method definitions.
2659 (Output_merge_base::Input_sections): New type declaration.
2660 (Output_merge_base::input_sections_begin,
2661 Output_merge_base::input_sections_end,
2662 Output_merge_base::do_set_keeps_input_sections): New method definitions.
2663 (Output_merge_base::bool keeps_input_sections_,
2664 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
2665 Output_merge_base::input_sections_): New data members.
2666 (Output_merge_data::do_set_keeps_input_sections): New method
2667 defintion.
2668 (Output_merge_string::do_set_keeps_input_sections): Ditto.
2669 * output.cc (Output_section::Input_section::relobj): Move method
2670 defintion from class declaration to here and handle merge sections.
2671 (Output_section::Input_section::shndx): Ditto.
2672 (Output_section::Output_section): Remove initializations of removed
2673 data members and initialize new data member LOOKUP_MAPS_.
2674 (Output_section::add_input_section): Set keeps-input-sections flag
2675 for a newly created merge output section as appropriate. Adjust code
2676 to use Output_section_lookup_maps class.
2677 (Output_section::add_relaxed_input_section): Adjst code for lookup
2678 maps code refactoring.
2679 (Output_section::add_merge_input_section): Add a new parameter
2680 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
2681 class. If adding input section to a newly created merge output
2682 section fails, remove the new merge section.
2683 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 2684 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
2685 (Output_section::find_merge_section): Ditto.
2686 (Output_section::build_lookup_maps): New method defintion.
2687 (Output_section::find_relaxed_input_section): Adjust code to use
2688 Output_section_lookup_maps class.
2689 (Output_section::get_input_sections): Export merge sections. Adjust
2690 code to use Output_section_lookup_maps class.
2691 (Output_section:::add_script_input_section): Adjust code to use
2692 Output_section_lookup_maps class. Update lookup maps for merge
2693 sections also.
2694 (Output_section::discard_states): Use Output_section_lookup_maps.
2695 (Output_section::restore_states): Same.
2696 * output.h (Merge_section_properties): Move class defintion out of
2697 Output_section.
2698 (Output_section_lookup_maps): New class.
2699 (Output_section::Input_section::is_merge_section): New method
2700 defintion.
2701 (Output_section::Input_section::relobj): Move defintion out of class
2702 defintion. Declare method only.
2703 (Output_section::Input_section::shndx): Ditto.
2704 (Output_section::Input_section::output_merge_base): New method defintion.
2705 (Output_section::Input_section::u2_.pomb): New union field.
2706 (Output_section::Merge_section_by_properties_map,
2707 Output_section::Output_section_data_by_input_section_map,
2708 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
2709 Remove types.
2710 (Output_section::add_merge_input_section): Add new parameter
2711 KEEPS_INPUT_SECTIONS.
2712 (Output_section::build_lookup_maps): New method declaration.
2713 (Output_section::merge_section_map_,
2714 Output_section::merge_section_by_properties_map_,
2715 Output_section::relaxed_input_section_map_,
2716 Output_section::is_relaxed_input_section_map_valid_): Remove data
2717 members.
2718 (Output_section::lookup_maps_): New data member.
2719
76295588
L
27202010-05-21 Doug Kwan <dougkwan@google.com>
2721
2722 PR gold/11619
2723 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
2724 avoid a compilation error.
2725
d103a984
RÁE
27262010-05-19 Rafael Espindola <espindola@google.com>
2727
2728 * script-sections.cc (Output_section_definition::allocate_to_segment):
2729 Update the phdrs_list even when the output section is NULL.
2730 * testsuite/Makefile.am: Add test.
2731 * testsuite/Makefile.in: Regenerate.
2732 * testsuite/script_test_9.cc: New.
2733 * testsuite/script_test_9.sh: New.
2734 * testsuite/script_test_9.t: New.
2735
6625d24e
DK
27362010-05-19 Doug Kwan <dougkwan@google.com>
2737
2738 * arm.cc (Arm_input_section::original_size): New method.
2739 (Arm_input_section::do_addralign): Add a cast.
2740 (Arm_input_section::do_output_offset): Remove static cast.
2741 (Arm_input_section::original_addralign,
2742 Arm_input_section::original_size_): Change type to uint32_t.
2743 (Arm_input_section::init): Add safe casts for section alignment
2744 and size.
2745 (Arm_input_section::set_final_data_size): Do not set address and
2746 offset of stub table.
2747 (Arm_output_section::fix_exidx_coverage): Change use of of
2748 Output_section::Simple_input_section to that of
2749 Output_section::Input_section.
2750 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
2751 except for the first pass.
2752 * output.cc (Output_section::get_input_sections): Change type of
2753 input_sections to std::list<Input_section>.
2754 (Output_section::add_script_input_section): Rename from
2755 Output_section::add_simple_input_section. Change type of SIS
2756 parameter from Simple_input_section to Input_section.
2757 * output.h (Output_section::Simple_input_section): Remove class.
2758 (Output_section::Input_section): Change class visibility to public.
2759 (Output_section::Input_section::addralign): Use stored alignments
2760 for special input sections if set.
2761 (Output_section::Input_section::set_addralign): New method.
2762 (Output_section::get_input_sections): Change parameter type from
2763 list of Simple_input_section to list of Input_section.
2764 (Output_section::add_script_input_section): Rename from
2765 Output_section::add_simple_input_section. Change first parameter's
2766 type from Simple_input_section to Input_section and remove the
2767 second and third parameters.
2768 * script-sections.cc (Input_section::Input_section_list): Change
2769 type to list of Output_section::Input_section/
2770 (Input_section_info::Input_section_info): Change parameter type of
2771 INPUT_SECTION to Output_section::Input_section.
2772 (Input_section_info::input_section): Change return type.
2773 (Input_section_info::input_section_): Change type to
2774 Output_section::Input_section.
2775 (Output_section_element_input::set_section_addresses): Adjust code
2776 to use Output_section::Input_section instead of
2777 Output_section::Simple_input_section. Adjust code for renaming
2778 of Output_section::add_simple_input_section.
2779 (Orphan_output_section::set_section_addresses): Ditto.
2780
e1e82ea4
RW
27812010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2782
2783 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
2784 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
2785
91e75c8a
RÁE
27862010-05-18 Rafael Espindola <espindola@google.com>
2787
2788 * options.cc (General_options::finalize): Handle -nostdlib.
2789 * options.h (nostdlib): New option.
2790 * script.cc (script_add_search_dir): Handle -nostdlib.
2791
da59ad79
DK
27922010-05-12 Doug Kwan <dougkwan@google.com>
2793
2794 * arm.cc (Target_arm::do_finalize_sections): Create an empty
2795 attributes section only if there no attributes section after merging.
2796 (Target_arm::merge_object_attributes): Move value of
e1df38aa 2797 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
2798 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
2799 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
2800 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
2801 and arm_attr_merge_7.stdout.
2802 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
2803 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
2804 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
2805 arm_attr_merge_7b.o): New rules.
2806 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
2807 arm_attr_merge_7
2808 * testsuite/Makefile.in: Regenerate.
2809 * testsuite/arm_attr_merge.sh: New file.
2810 * testsuite/arm_attr_merge_[67][ab].s: Same.
2811
3e01a7fd
NC
28122010-05-05 Nick Clifton <nickc@redhat.com>
2813
2814 * po/es.po: Updated Spanish translation.
2815
7ad2014a
L
28162010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2817
2818 * Makefile.am (install-exec-local): Properly install gold as
2819 default cross linker.
2820 * Makefile.in: Regenerated.
2821
4fda8867
NC
28222010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2823 Nick Clifton <nickc@redhat.com>
2824
2825 * configure.ac (install_as_default): Define and set to false
2826 unless --enable-gold or --enable-gold=both/gold has been
2827 specified.
2828 * configure: Regenerate.
2829
2830 * Makefile.am (install-exec-local): Install the executable as
2831 'ld.gold'. If install_as_default is true then also install it as
2832 'ld'.
2833 * Makefile.in: Regenerated.
2834
bd288ea2
ILT
28352010-04-24 Ian Lance Taylor <iant@google.com>
2836
2837 * layout.cc (Layout::layout_reloc): In relocatable link don't
2838 combine reloc sections for grouped sections.
2839
ef38fd8a
ST
28402010-04-23 Sriraman Tallam <tmsriram@google.com>
2841
2842 * gc.h (gc_process_relocs): Pass information on relocs pointing to
2843 sections that are not ordinary to icf.
2844 * icf.cc (get_section_contents): Handle relocation pointing to section
2845 with no object or shndx information.
2846 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
2847 * testsuite/Makefile.in: Regenerate.
2848 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
2849 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
2850
f6973bdc
ILT
28512010-04-22 Ian Lance Taylor <iant@google.com>
2852
2853 * expression.cc (Expression::Expression_eval_info): Add
2854 result_alignment_pointer field.
2855 (Expression::eval_with_dot): Add result_alignment_pointer
2856 parameter. Change all callers.
2857 (Expression::eval_maybe_dot): Likewise.
2858 (class Binary_expression): Add alignment_pointer parameter to
2859 left_value and right_value. Change all callers.
2860 (BINARY_EXPRESSION): Set result alignment.
2861 (class Trinary_expression): Add alignment_pointer parameter to
2862 arg2_value and arg3_value. Change all callers.
2863 (Trinary_cond::value): Set result alignment.
2864 (Max_expression::value, Min_expression::value): Likewise.
2865 (Align_expression::value): Likewise.
2866 * script-sections.cc (class Sections_element): Add dot_alignment
2867 parameter to set_section_addresses virtual function. Update
2868 instantiations.
2869 (class Output_section_element): Likewise.
2870 (Script_sections::create_segments): Add dot_alignment parameter.
2871 Change all callers.
2872 (Script_sections::create_segments_from_phdrs_clause): Likewise.
2873 (Script_sections::set_phdrs_clause_addresses): Likewise.
2874 * script-sections.h: Update declarations.
2875 * script.h: Update declarations.
2876 * output.h (Output_segment::set_minimum_p_align): Don't decrease
2877 min_p_align.
2878 * testsuite/script_test_3.t: Set large alignment.
2879 * testsuite/script_test_3.sh: Make sure that at least one LOAD
2880 segment has expected alignment.
2881
9c9c98a5
NC
28822010-04-22 Nick Clifton <nickc@redhat.com>
2883
2884 * po/gold.pot: Updated by the Translation project.
2885 * po/vi.po: Updated Vietnamese translation.
2886
2253bfba
L
28872010-04-22 H.J. Lu <hongjiu.lu@intel.com>
2888
2889 * testsuite/Makefile.am (check_PROGRAMS): Add
2890 icf_virtual_function_folding_test.
2891 * testsuite/Makefile.in: Regenerated.
2892
85fdf906
AH
28932010-04-15 Andrew Haley <aph@redhat.com>
2894
2895 * options.h (merge_exidx_entries): New option.
2896 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
2897 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
2898 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
2899 (Target_arm::merge_exidx_entries): New function.
2900 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
2901 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
2902 to Arm_exidx_fixup constructor.
2903 Add new arg, merge_exidx_entries.
2904 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
2905 Arm_output_section::fix_exidx_coverage.
2906
ce97fa81
ST
29072010-04-18 Sriraman Tallam <tmsriram@google.com>
2908
2909 * icf.cc (get_section_contents): Check for preemptible functions.
2910 Ignore addend when appropriate.
2911 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
2912 section folded.
2913 (add_from_relobj): Check for section folded.
2914 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
2915 * symtab.h (should_add_dynsym_entry): Add new parameter.
2916 * target-reloc.h (scan_relocs): Check for section folded.
2917 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
2918 Check reloc types for function pointers in shared objects.
2919 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
2920 case.
2921 (icf_preemptible_functions_test): New test case.
2922 (icf_string_merge_test): New test case.
2923 * testsuite.Makefile.in: Regenerate.
2924 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
2925 bar_glob. Refactor code.
2926 * testsuite/icf_preemptible_functions_test.cc: New file.
2927 * testsuite/icf_preemptible_functions_test.sh: New file.
2928 * testsuite/icf_string_merge_test.cc: New file.
2929 * testsuite/icf_string_merge_test.sh: New file.
2930 * testsuite/icf_virtual_function_folding_test.cc: New file.
2931 * testsuite/icf_virtual_function_folding_test.sh: New file.
2932
04ceb17c
DK
29332010-04-14 Doug Kwan <dougkwan@google.com>
2934
2935 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
2936 for local symbol recounting if we remove a section due to ICF.
2937 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
2938 there are no regular objects in input.
2939
153e7da4
DK
29402010-04-13 Doug Kwan <dougkwan@google.com>
2941
2942 * arm.cc (Arm_input_section::set_final_data_size): Compute
2943 accurate final data size instead of using current data size.
2944
4dbd9faf
DK
29452010-04-09 Doug Kwan <dougkwan@google.com>
2946
2947 * layout.cc (Layout::choose_output_section): Handle script section
2948 types.
2949 (Layout::make_output_section_for_script): Add section type parameter.
2950 Handle script section types.
2951 * layout.h (Layout::make_output_section_for_script): Add section
2952 type parameter.
2953 * output.cc (Output_section::Output_section): Initialize data member
2954 is_noload_.
2955 (Output_section::do_reset_address_and_file_offset): Do not set address
2956 to 0 if section is a NOLOAD section.
2957 * output.h (Output_section::is_noload): New method.
2958 (Output_section::set_is_noload): Ditto.
2959 (Output_section::is_noload_): New data member.
2960 * script-c.h (Script_section_type): New enum type.
2961 (struct Parser_output_section_header): Add new file section_type.
2962 * script-sections.cc (Sections_element::output_section_name): Add
2963 parameter for returning script section type.
2964 (Output_section_definition::output_section_name): Ditto.
2965 (Output_section_definition::section_type)P; New method.
2966 (Output_section_definiton::script_section_type_name): Ditto.
2967 (Output_section_definition::script_section_type_): New data member.
2968 (Output_section_definition::Output_section_definition): Initialize
2969 data member Output_section_definition::script_section_type_.
2970 (Output_section_definition::create_sections): Pass script section type
2971 to Layout::make_output_section_for_script.
2972 (Output_section_definition::output_section_name): Return script
2973 section type to caller.
2974 (Output_section_definition::set_section_address): Do not advance
2975 dot value and load address if section type is NOLOAD. Set address
2976 of NOLOAD sections regardless of section flags.
2977 (Output_section_definition::print): Print section type if it is
2978 not SCRIPT_SECTION_TYPE_NONE.
2979 (Output_section_definition::section_type): New method.
2980 (Output_section_definition::script_section_type_name): Ditto.
2981 (Script_sections::output_section_name): Add new parameter
2982 PSECTION_TYPE for returning script section type. Pass it to
2983 section elements. Handle discard sections.
2984 (Sort_output_sections::operator()): Handle NOLOAD sections.
2985 * script-sections.h (Script_sections::Section_type): New enum type.
2986 (Script_sections::output_section_name): Add a new parameter for
2987 returning script section type.
2988 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
2989 INFO and NOLOAD.
2990 * yyscript.y (union): Add new field SECTION_TYPE.
2991 (COPY, DSECT, INFO, NOLOAD): New tokens.
2992 (opt_address_and_section_type): Change type to output_section_header.
2993 (section_type): New non-terminal
2994 (section_header): Handle section type.
2253bfba 2995 (opt_address_and_section_type): Return section type value.
4dbd9faf 2996
721ea635
L
29972010-04-09 H.J. Lu <hongjiu.lu@intel.com>
2998
2999 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3000 * testsuite/plugin_common_test_2.c (foo): Likewise.
3001
6bf924b0
DK
30022010-04-08 Doug Kwan <dougkwan@google.com>
3003
3004 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3005 Output_merge_data.
3006 * output.cc (Output_section::add_merge_input_section): Simplify
3007 code and return status of Output_merge_base::add_input_section.
e1df38aa 3008 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3009 returns true.
3010
24af6f92
DK
30112010-04-07 Doug Kwan <dougkwan@google.com>
3012
3013 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3014 if section is marked as containing instructions but has no mapping
3015 symbols.
3016 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3017 correct section index.
3018 (Arm_relobj::find_linked_text_section): Ditto.
3019
00698fc5
CC
30202010-04-07 Cary Coutant <ccoutant@google.com>
3021
3022 * archive.cc (include_member): Destroy Read_symbols_data object before
3023 releasing file.
3024 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3025 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3026 (Read_symbols_data::~Read_symbols_data) New destructor.
3027 (Section_relocs::Section_relocs) New constructor.
3028 (Section_relocs::~Section_relocs) New destructor.
3029 (Read_relocs_data::Read_relocs_data) New constructor.
3030 (Read_relocs_data::~Read_relocs_data) New destructor.
3031 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3032 pointers to NULL after deleting.
3033
7296d933
DK
30342010-04-07 Doug Kwan <dougkwan@google.com>
3035
3036 * arm.cc: Replace "endianity" with "endianness" in comments.
3037 (Arm_exidx_cantunwind): Ditto.
3038 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3039 (Arm_relobj::merge_flags_and_attributes): New method.
3040 (Arm_relobj::merge_flags_and_attributes_): New data member.
3041 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3042 (Arm_relobj::scan_sections_for_stubs): Ditto.
3043 (Arm_relobj::do_read_symbols): Check to see if we really want to
3044 merge processor-specific flags and attributes. Exit early if
3045 an object is empty except for section names and the undefined symbol.
3046 (Target_arm::do_finalize_sections): Move check for ELF format to
3047 Arm_relobj::do_read_symbols. Merge processor specific flags and
3048 attributes from a regular object only when we have determined that
3049 it is aapropriate. Do not create an .ARM.attributes section in
3050 output if there is no regular input object.
3051 (Target_arm::merge_processor_specific_flags): Check
3052 --warn-mismatch before printing any error.
3053 (Target_arm::merge_object_attributes): Ditto.
3054 * gold.cc (queue_middle_tasks): Handle the case in which there is
3055 no regular object in input.
3056 * options.cc (General_options::parse_EB): New method.
3057 (General_options::parse_EL): Same.
3058 (General_options::General_options): Initialize endianness_.
3059 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3060 New options.
3061 (General_options::Endianness): New enum.
3062 (General_options::endianness): New method.
3063 (General_options::endianness_): New data member.
3064 * parameters.cc (Parameters::set_options): Check target endianness.
3065 (Parameters::set_target_once): Ditto.
3066 (Parameters::check_target_endianness): New method.
3067 (parameters_force_valid_target): If either -EL or -EB is specified,
3068 use it to define endianness of default target.
3069 * parameters.h (Parameters::check_target_endianness): New method
3070 declaration.
3071 * target.h (class Target): Change "endianity" to "endianness"
3072 in comments.
3073
efc8d4f2
RW
30742010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3075
3076 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3077 * configure: Regenerate.
3078 * Makefile.in: Regenerate.
3079 * testsuite/Makefile.in: Regenerate.
3080
be234d88
CC
30812010-04-06 Cary Coutant <ccoutant@google.com>
3082
3083 gcc PR lto/42757
3084 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3085 prevailing definitions of common symbols.
3086 * testsuite/plugin_test_6.sh: New test case.
3087 * testsuite/plugin_common_test_1.c: New test case.
3088 * testsuite/plugin_common_test_2.c: New test case.
3089 * testsuite/Makefile.am (plugin_test_6): New test case.
3090 * testsuite/Makefile.in: Regenerate.
3091
bd32c6bd
NC
30922010-04-06 Nick Clifton <nickc@redhat.com>
3093
3094 * po/vi.po: New Vietnamese translation.
3095
323c532f
DK
30962010-03-30 Doug Kwan <dougkwan@google.com>
3097
3098 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3099
4fcd97eb
DK
31002010-03-25 Doug Kwan <dougkwan@google.com>
3101
3102 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3103 to avoid a conversion warning on a 32-bit host.
3104
4ebf39db
ILT
31052010-03-24 Ian Lance Taylor <iant@google.com>
3106
3107 * testsuite/script_test_3.t: Add a TLS segment.
3108 * testsuite/Makefile.am (check_PROGRAMS): Add
3109 tls_phdrs_script_test.
3110 (tls_phdrs_script_test_SOURCES): Define.
3111 (tls_phdrs_script_test_DEPENDENCIES): Define.
3112 (tls_phdrs_script_test_LDFLAGS): Define.
3113 (tls_phdrs_script_test_LDADD): Define.
3114 * testsuite/Makefile.in: Rebuild.
3115
4a599bdd
CC
31162010-03-23 Cary Coutant <ccoutant@google.com>
3117
3118 * fileread.cc (find_or_make_view): Fix comment.
3119
6c93b22c
ILT
31202010-03-23 Ian Lance Taylor <iant@google.com>
3121
3122 * script-sections.cc (class Orphan_section_placement): Define
3123 PLACE_TLS and PLACE_TLS_BSS.
3124 (Orphan_section_placement::Orphan_section_placement): Initialize
3125 new places.
3126 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3127 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3128 (tls_script_test_SOURCES): Define.
3129 (tls_script_test_DEPENDENCIES): Define.
3130 (tls_script_test_LDFLAGS): Define.
3131 (tls_script_test_LDADD): Define.
3132 * testsuite/Makefile.in: Rebuild.
3133
a2c7281b
DK
31342010-03-22 Doug Kwan <dougkwan@google.com>
3135
3136 * arm.cc (Arm_relocate_functions::abs8,
3137 Arm_relocate_functions::abs16): Use correct check for overflow
3138 specified in the ARM ELF specs.
3139 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3140 target of a BLX instruction specially.
3141 (Reloc_stub::stub_type_for_reloc): Ditto.
3142 (Relocate::relocate): Use symbolic names instead of numeric relocation
3143 codes to report error.
3144 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3145 workaround.
3146 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3147 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3148 thumb2_blx_out_of_range.stdout
3149 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3150 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3151 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3152 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3153 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3154 thumb2_blx_in_range, thumb2_blx_in_range.o,
3155 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3156 thumb2_blx_out_of_range.o): New rules.
3157 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3158 thumb2_blx_in_range and thumb2_blx_out_of_range.
3159 * testsuite/Makefile.in: Regenerate.
3160 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3161 * testsuite/thumb_blx_in_range.s: New file.
3162 * testsuite/thumb_blx_out_of_range.s: New file.
3163
b0193076
RÁE
31642010-03-22 Rafael Espindola <espindola@google.com>
3165
3166 * archive.cc (Should_include): Move to archive.h.
3167 (should_include_member): Make it a member of Archive.
3168 (Lib_group): New.
3169 (Add_lib_group_symbols): New.
3170 * archive.h: Include options.h.
3171 (Archive_member): Moved from Archive.
3172 (Should_include): Moved from archive.cc.
3173 (Lib_group): New.
3174 (Add_lib_group_symbols): New.
3175 * dynobj.cc (do_should_include_member): New.
3176 * dynobj.h (do_should_include_member): New.
3177 * gold.cc (queue_initial_tasks): Update call to queue.
3178 * main.cc (main): Print lib group stats.
3179 * object.cc (do_should_include_member): New.
3180 * object.h: Include archive.h.
3181 (Object::should_include_member): New.
3182 (Object::do_should_include_member): New.
3183 (Sized_relobj::do_should_include_member): New.
3184 * options.cc (General_options::parse_start_lib): New.
3185 (General_options::parse_end_lib): New.
3186 (Input_arguments::add_file): Handle lib groups.
3187 (Input_arguments::start_group): Check we are not in a lib.
3188 (Input_arguments::start_lib): New.
3189 (Input_arguments::end_lib): New.
3190 * options.h (General_options): Add start_lib and end_lib.
3191 (Input_argument::lib_): New.
3192 (Input_argument::lib): New.
3193 (Input_argument::is_lib): New.
3194 (Input_file_lib): New.
3195 (Input_arguments::in_lib_): New.
3196 (Input_arguments::in_lib): New.
3197 (Input_arguments::start_lib): New.
3198 (Input_arguments::end_lib_): New.
3199 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3200 in unused members as preempted.
3201 (Sized_pluginobj::do_should_include_member): New.
3202 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3203 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3204 return the blocker.
3205 (Read_symbols::do_whole_lib_group): New.
3206 (Read_symbols::do_lib_group): New.
3207 (Read_symbols::do_read_symbols): Handle lib groups.
3208 (Read_symbols::get_name): Handle lib groups.
3209 * readsyms.h (Read_symbols): Add an archive member pointer.
3210 (Read_symbols::do_whole_lib_group): New.
3211 (Read_symbols::do_lib_group): New.
3212 (Read_symbols::member_): New.
3213 * script.cc (read_input_script): Update call to queue_soon.
3214
d099120c
DK
32152010-03-19 Doug Kwan <dougkwan@google.com>
3216
3217 * arm.cc (Stub_table::Stub_table): Initialize new data members
3218 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3219 (Stub_table::add_reloc_stub): Assign stub offset and update
3220 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3221 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3222 New data members.
3223 (Stub_table::update_data_size_and_addralign): Use
3224 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3225 instead of going over all reloc stubs.
3226 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3227 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3228 Stringpool_template::offset_ to size of Stringpool_char.
3229 (Stringpool_template::new_key_offset): Remove code to initialize
3230 Stringpool_template::offset_.
3231 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3232 Stringpool_template::offset_ to zero.
3233
1aa37384
DK
32342010-03-15 Doug Kwan <dougkwan@google.com>
3235
3236 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3237 offset_.
3238 (Stringpool_template::new_key_offset): New method.
3239 (Stringpool_template::add_string): Assign offsets when adding new
3240 strings.
3241 (Stringpool_template::set_string_offsets): Do not set string offsets
3242 when not optimizing.
3243 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3244 member size_.
3245 (Chunked_vector::clear): Clear size_.
3246 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3247 (Chunked_vector::size): Return size_.
3248 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3249 (Chunked_vector::size_): New data member.
1aa37384
DK
3250 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3251 (Stringpool_template::new_key_offset): New method declaration.
3252 (Stringpool_template::offset_): New data member.
3253
b672b057
RÁE
32542010-03-15 Rafael Espindola <espindola@google.com>
3255
3256 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3257 Add_symbols' constructor.
3258 * readsyms.h (Add_symbols): Remove the input_group member.
3259
b6848d3c
ILT
32602010-03-10 Ian Lance Taylor <iant@google.com>
3261
3262 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3263 target to ask whether a reference to a symbol requires a stack
3264 split.
3265 * target.h (Target::is_call_to_non_split): New function.
3266 (Target::do_is_call_to_non_split): Declare virtual function.
3267 * target.cc: Include "symtab.h".
3268 (Target::do_is_call_to_non_split): New function.
3269 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3270
a2a5469e
CC
32712010-03-10 Cary Coutant <ccoutant@google.com>
3272
3273 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3274 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3275 (File_read::open[2]): Add whole_file_view_ to list of views.
3276 (File_read::make_view): Remove test of whole_file_view_.
3277 (File_read::find_or_make_view): Create whole_file_view_ if
3278 necessary.
3279 (File_read::clear_views): Replace bool parameter with enum;
3280 adjust all callers. Don't delete views with permanent data;
3281 do delete cached views and views from archives if
3282 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3283 if clearing the corresponding view.
3284 * fileread.h (File_read::Clear_views_mode): New enum.
3285 (File_read::View::is_permanent_view): New method.
3286 (File_read::clear_views): Replace bool parameter
3287 with enum; adjust all callers.
3288 * options.h (General_options): Change keep_files_mapped option;
3289 add map_whole_files.
3290 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3291 releasing the file.
3292 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3293 the file.
3294
8861f32b
DM
32952010-03-10 David S. Miller <davem@davemloft.net>
3296
3297 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
3298
d62d0f5f
ST
32992010-03-09 Sriraman Tallam <tmsriram@google.com>
3300
3301 * icf.cc (get_section_contents): Add '@' marker after processing the
3302 merge reloc.
3303
9177756d
DK
33042010-03-08 Doug Kwan <dougkwan@google.com>
3305
3306 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
3307 due to a conversion warning.
3308 (Arm_relobj::update_output_local_symbol_count): Check for local
3309 symbol with unset output index.
3310
9e9e071b
ILT
33112010-03-05 Ian Lance Taylor <iant@google.com>
3312
3313 * options.h (class General_options): Add --spare-dynamic-tags.
3314 * output.cc (Output_data_dynamic::set_final_data_size): Implement
3315 --spare-dynamic-tags.
3316
a81ee015
ILT
33172010-03-05 Ian Lance Taylor <iant@google.com>
3318
3319 * incremental.cc: Include "libiberty.h".
3320
44ec90b9
RO
33212010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3322
3323 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
3324 function, is_info_ member.
3325 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
3326 (Versions::Versions): Update caller.
3327 (Versions::define_base_version): Likewise.
3328 (Versions::add_def): Likewise.
3329
0897ed3b
ST
33302010-03-03 Sriraman Tallam <tmsriram@google.com>
3331
3332 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
3333 (Scan::possible_function_pointer_reloc): New function.
3334 (Scan::local_reloc_may_be_function_pointer): Change to call
3335 possible_function_pointer_reloc.
3336 (Scan::global_reloc_may_be_function_pointer): Ditto.
3337 * icf.h (Icf::check_section_for_function_pointers): Change to reject
3338 relocations in ".data.rel.ro._ZTV" section.
3339 * testsuite/icf_safe_so_test.sh: Change to pass i386.
3340 * testsuite/icf_safe_so_test.cc: Ditto.
3341 * testsuite/icf_safe_test.cc: Ditto.
3342 * testsuite/icf_safe_test.sh: Ditto.
3343
d3bbad62
ILT
33442010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3345 Ian Lance Taylor <iant@google.com>
3346
3347 * target-reloc.h (relocate_section): Check the symbol table index
3348 for -1U before setting the local symbol index.
3349 (scan_relocatable_relocs): If copying the relocation, record that
3350 the local symbol is required.
3351 * object.h (Symbol_value::is_output_symtab_index_set): New
3352 function.
3353 (Symbol_value::may_be_discarded_from_output_symtab): New
3354 function.
3355 (Symbol_value::has_output_symtab_entry): New function.
3356 (Symbol_value::needs_output_symtab_entry): Remove.
3357 (Symbol_value::output_symtab_index): Make sure the symbol index is
3358 set.
3359 (Symbol_value::set_output_symtab_index): Make sure the symbol
3360 index is not set. Make sure the new index is valid.
3361 (Symbol_value::set_must_have_output_symtab_entry): New function.
3362 (Symbol_value::has_output_dynsym_entry): New function.
3363 (Symbol_value::set_output_dynsym_index): Make sure the new index
3364 is valid.
3365 (Sized_relobj::set_must_have_output_symtab_entry): New function.
3366 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
3367 local symbol if permitted.
3368 (Sized_relobj::do_finalize_local_symbols): Call
3369 is_output_symtab_index_set rather than needs_output_symtab_entry.
3370 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
3371 rather than needs_output_symtab_entry. Call
3372 has_output_dynsym_entry rather than needs_output_dynsym_entry.
3373 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
3374 is_output_symtab_index_set rather than needs_output_symtab_entry.
3375 * testsuite/discard_locals_relocatable_test.c: New file.
3376 * testsuite/discard_locals_test.sh: Test -r.
3377 * testsuite/Makefile.am (check_DATA): Add
3378 discard_locals_relocatable_test1.syms,
3379 discard_local_relocatable_test2.syms.
3380 (MOSTLYCLEANFILES): Likewise. Also add
3381 discard_locals_relocatable_test1.lout and
3382 discard_locals_relocatable_test2.out.
3383 (discard_locals_relocatable_test1.syms): New target.
3384 (discard_locals_relocatable_test.o): New target.
3385 (discard_locals_relocatable_test1.out): New target.
3386 (discard_locals_relocatable_test2.syms): New target.
3387 (discard_locals_relocatable_test2.out): New target.
3388 (various): Add missing ../ld-new dependencies.
3389 * testsuite/Makefile.in: Rebuild.
3390
7e8ccf26
NC
33912010-03-03 Nick Clifton <nickc@redhat.com>
3392
3393 * po/fi.po: New Finnish translation.
3394
2a0ff005
DK
33952010-03-01 Doug Kwan <dougkwan@google.com>
3396
3397 * layout.cc (Layout::Layout): Force section types of .init_array*,
3398 .preinit_array* and .fini_array* sections.
3399 * output.cc (Output_section::Input_section_sort_entry::has_priority):
3400 Fix check of return value of std::string::find.().
3401 (Output_section::Input_section_sort_compare::operator()): Remove
3402 comment about .init_array.
3403 (Output_section::Input_section_sort_init_fini_compare::operator()):
3404 New method.
3405 (Output_section::sort_attached_input_sections): Handle .init_array
3406 and .fini_array specially.
3407 * output.h (Output_section::Inut_section_sort_compare): Update
3408 comment.
3409 (Output_section::Input_section_sort_init_fini_compare): New struct.
3410
c3e4ae29
DK
34112010-02-26 Doug Kwan <dougkwan@google.com>
3412
3413 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
3414 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
3415 * testsuite/debug_msg.sh: Avoid matching source line number for
3416 use of global variable undef_int.
3417
2fd9ae7a
DK
34182010-02-26 Doug Kwan <dougkwan@google.com>
3419
3420 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
3421 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
3422 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
3423 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
3424 * options.cc (General_options::General_options): Initialize member
3425 fix_v4bx_.
3426 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
3427 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
3428 and rm_no_fix_v4bx.stdout
3429 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
3430 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
3431 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
3432 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
3433 and arm_no_fix_v4bx.
3434 * Makefile.in: Regenerate.
3435 * testsuite/arm_fix_v4bx.s: New file.
3436 * testsuite/arm_fix_v4bx.sh: Ditto.
3437
67ec7d0b
DK
34382010-02-24 Doug Kwan <dougkwan@google.com>
3439
3440 * arm.cc (Target_arm::got_section): Make the .got section the first
3441 non RELRO section in the data segment.
3442 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
3443 suffixes of section names.
3444
10165461
DK
34452010-02-24 Doug Kwan <dougkwan@google.com>
3446
3447 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
3448 flags and attributes merging if an input file is a binary file.
3449 * fileread.cc (Input_file::open): Record format of original file.
3450 * fileread.h (Input_file::Format): New enum type.
3451 (Input_file::Input_file): Initialize data member format_.
3452 (Input_file::format): New method definition.
3453 (Input_file::format_):: New data member.
3454
4a54abbb
DK
34552010-02-24 Doug Kwan <dougkwan@google.com>
3456
3457 * arm.cc (Arm_output_data_got): New class.
3458 (ARM_TCB_SIZE): New constant
3459 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
3460 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
3461 If user uses a script with a SECTIONS clause, issue only a warning
3462 for a misplaced EXIDX input section. Otherwise, issue an error.
3463 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
3464 garbage collection.
3465 (Target_arm::got_mode_index_entry): Handle static linking.
3466 (Target_arm::Scan::local): Ditto.
3467 (Target_arm::Scan::global): Ditto.
3468 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
3469 all incorrectly implemented relocations.
e1df38aa 3470 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
3471 Arm_output_section::fix_exidx_coverage.
3472 * layout.cc (Layout::section_name_mapping): Remove trailing dots
3473 from ".ARM.exidx." and ".ARM.extab.".
3474
ca419a6f
ILT
34752010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3476
3477 * arm.cc (Target_arm::do_finalize_sections): Create attribute
3478 section if it does not already exist.
3479 * attributes.cc (Attributes_section_data::Attributes_section_data):
3480 Don't crash if size is zero.
3481
135b9c78
ILT
34822010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3483 Ian Lance Taylor <iant@google.com>
3484
3485 * gold.cc (queue_middle_tasks): If no input files were opened,
3486 exit.
3487 * workqueue.h (Task_function::Task_function): Assert that there is
3488 a blocker.
3489
bb0bfe4f
DK
34902010-02-22 Doug Kwan <dougkwan@google.com>
3491
3492 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
3493 * icf.cc (get_section_contents): Cast snprintf arguments to long long
3494 types to avoid warnings due to different uint64_t implementations
3495 on different hosts.
3496
2a2b6d42
DK
34972010-02-21 Doug Kwan <dougkwan@google.com>
3498
3499 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
3500 handling of the maximum backward branch offset.
3501 (Arm_relocate_functions::thumb_branch_common): Ditto.
3502 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
3503 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 3504 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
3505 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
3506 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
3507 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
3508 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
3509 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
3510 thumb_bl_out_of_range thumb_bl_out_of_range.o,
3511 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
3512 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
3513 thumb2_bl_out_of_range.o): New rules.
3514 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
3515 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
3516 thumb2_bl_out_of_range
3517 * testsuite/Makefile.in: Regenerate.
3518 * testsuite/arm_bl_in_range.s: New file.
3519 * testsuite/arm_bl_out_of_range.s: Ditto.
3520 * testsuite/arm_branch_in_range.sh: Ditto.
3521 * testsuite/arm_branch_range.t: Ditto.
3522 * testsuite/thumb2_branch_range.t: Ditto.
3523 * testsuite/thumb_bl_in_range.s: Ditto.
3524 * testsuite/thumb_bl_out_of_range.s: Ditto.
3525 * testsuite/thumb_branch_range.t: Ditto.
3526
b487ad64
ST
35272010-02-20 Sriraman Tallam <tmsriram@google.com>
3528
3529 * gc.h (gc_process_relocs): Change vectors to point to the new list.
3530 Add reloc offset information.
3531 * icf.cc (get_section_contents): Change iterators to point to the new
3532 vectors. Add reloc offset information to the contents.
3533 * icf.h (Icf::Sections_reachable_info): New typedef.
3534 (Icf::Sections_reachable_list): New typedef.
3535 (Icf::Offset_info): New typedef.
3536 (Icf::Reloc_info): New struct typedef.
3537 (Icf::Reloc_info_list): New typedef.
3538 (Icf::symbol_reloc_list): Delete method.
3539 (Icf::addend_reloc_list): Delete method.
3540 (Icf::section_reloc_list): Delete method.
3541 (Icf::reloc_info_list): New method.
3542 (Icf::reloc_info_list_): New member.
3543
f96accdf
DK
35442010-02-19 Doug Kwan <dougkwan@google.com>
3545
3546 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
3547 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
3548 * arm.cc (Arm_relocation_functions): New forward declaration.
3549 (Target_arm::Target_arm): Initialize new data members
3550 got_mod_index_offset_ and tls_base_symbol_defined_.
3551 (Target_arm::Relocate::relocate_tls): New method.
3552 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
3553 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
3554 New methods.
3555 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
3556 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
3557 (Target_arm::got_mod_index_offset_,
3558 Target_arm::tls_base_symbol_defined_): New data members.
3559 (Target_arm::Scan::local, Target::Scan::global,
3560 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
3561 relocations.
3562
c8761b9a
DK
35632010-02-18 Doug Kwan <dougkwan@google.com>
3564
3565 * arm.cc (Arm_relobj::find_linked_text_section): New method.
3566 (Arm_relobj::make_exidx_input_section): Pass section index of linked
3567 text section as a parameter becuase some broken tools may not set
3568 the link in section header.
3569 (Target_arm::has_got_section): New method.
3570 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
3571 without any mapping symbol as data only. Remove warning.
3572 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
3573 link in its section header, try to discover the link by inspecting the
3574 REL31 relocation at the beginning of the section.
3575 (Target_arm::Scan::check_non_pic): Report name of offending relocation
3576 in error message.
3577 (Target_arm::Scan::global): Treat any reference to the symbol
3578 _GLOBAL_OFFSET_TABLE_ as a GOT access.
3579
21bb3914
ST
35802010-02-12 Sriraman Tallam <tmsriram@google.com>
3581
3582 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
3583 (Scan::global_reloc_may_be_function_pointer): New function.
3584 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3585 (Scan::global_reloc_may_be_function_pointer): New function.
3586 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3587 (Scan::global_reloc_may_be_function_pointer): New function.
3588 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
3589 (Scan::global_reloc_may_be_function_pointer): New function.
3590 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
3591 (Scan::global_reloc_may_be_function_pointer): New function.
3592 (Scan::possible_function_pointer_reloc): New function.
3593 (Target_x86_64::can_check_for_function_pointers): New function.
3594 * gc.h (gc_process_relocs): Scan relocation types to determine if
3595 function pointers were taken for targets that support it.
3596 * icf.cc (Icf::find_identical_sections): Include functions for
3597 folding in safe ICF whose pointer is not taken.
3598 * icf.h (Secn_fptr_taken_set): New typedef.
3599 (fptr_section_id_): New member.
3600 (section_has_function_pointers): New function.
3601 (set_section_has_function_pointers): New function.
3602 (check_section_for_function_pointers): New function.
3603 * options.h: Fix comment for safe ICF option.
3604 * target.h (can_check_for_function_pointers): New function.
3605 * testsuite/Makefile.am: Add icf_safe_so_test test case.
3606 Modify icf_safe_test for X86-64.
3607 * testsuite/Makefile.in: Regenerate.
3608 * testsuite/icf_safe_so_test.cc: New file.
3609 * testsuite/icf_safe_so_test.sh: New file.
3610 * testsuite/icf_safe_test.cc (kept_func_3): New function.
3611 (main): Change to take pointer to function kept_func_3.
3612 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
3613 folding is done correctly for X86-64.
3614
0da6fa6c
DM
36152010-02-12 David S. Miller <davem@davemloft.net>
3616
3617 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
3618 is_symbolless parameter.
3619 (Output_reloc<SHT_REL>::is_symbolless): New.
3620 (Output_reloc<SHT_REL>::is_symbolless_): New.
3621 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
3622 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
3623 (Output_reloc<SHT_RELA>::is_symbolless): New.
3624 (Output_data_reloc::add_global): Handle is_symbolless.
3625 (Output_data_reloc::add_global_relative): Likewise.
3626 (Output_data_reloc::add_local): Likewise.
3627 (Output_data_reloc::add_local_relative): Likewise.
3628 (Output_data_reloc::add_symbolless_global_addend): New.
3629 (Output_data_reloc::add_symbolless_local_addend): New.
3630 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
3631 is_symbolless.
3632 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
3633 instead of ->is_relative_
3634 (Output_reloc::write): Likewise.
3635 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
3636 (Output_reloc::write_rel): Simplify.
3637
3638 * sparc.cc (Target_sparc::Scan::local): Use
3639 ->add_symbolless_local_addend as needed.
3640 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
3641 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
3642 based upon relocation offset.
3643
e4782e83
DK
36442010-02-11 Doug Kwan <dougkwan@google.com>
3645
3646 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
3647 (Target_arm::Scan::global): Ditto. Also remove a comment before the
3648 beginning of function.
3649 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
3650 and MOVT_ABS relocations. Those are non issued in scanning. Fix
3651 parameter is_32bit in calls to should_apply_static_reloc.
3652 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
3653 (check_DATA): Add arm_abs_global.stdout.
3654 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
3655 arm_abs_global.stdout): New rules.
3656 (MOSTLLYCLEANFILES): Add arm_abs_global
3657 * Makefile.in: Regenerate.
3658 * testsuite/arm_abs_global.s: New file.
3659 * testsuite/arm_abs_global.sh: Ditto.
3660 * testsuite/arm_abs_lib.s: Ditto.
3661
93ceb764
ILT
36622010-02-11 Ian Lance Taylor <iant@google.com>
3663
3664 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
3665 Read_relocs task.
3666 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
3667 Allocate_commons_task first.
3668 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
3669 task, rather than symtab_lock_.
3670 (Gc_process_relocs::~Gc_process_relocs): New function.
3671 (Gc_process_relocs::is_runnable): Check this_blocker_.
3672 (Gc_process_relocs::locks): Use next_blocker_ rather than
3673 blocker_.
3674 (Scan_relocs::~Scan_relocs): New function.
3675 (Scan_relocs::is_runnable): Check this_blocker_ rather than
3676 symtab_lock_.
3677 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
3678 next_blocker_.
3679 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
3680 fields. Add this_blocker_ and next_blocker_ fields. Adjust
3681 constructor accordingly.
3682 (class Gc_process_relocs): Likewise.
3683 (class Scan_relocs): Likewise.
3684 * common.h (class Allocate_commons_task): Remove symtab_lock_
3685 field, and corresponding constructor parameter.
3686 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
3687 symtab_lock_.
3688 (Allocate_commons_task::locks): Likewise.
3689
114dfbe1
ILT
36902010-02-11 Ian Lance Taylor <iant@google.com>
3691
3692 * gold-threads.h (class Once): Define.
3693 (class Initialize_lock): Rewrite as child of Once.
3694 * gold-threads.cc (class Once_initialize): Define.
3695 (once_pointer_control): New static variable.
3696 (once_pointer, once_arg): New static variables.
3697 (c_run_once): New static function.
3698 (Once::Once, Once::run_once, Once::internal_run): New functions.
3699 (class Initialize_lock_once): Remove.
3700 (initialize_lock_control): Remove.
3701 (initialize_lock_pointer): Remove.
3702 (initialize_lock_once): Remove.
3703 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
3704 (Initialize_lock::initialize): Rewrite.
3705 (Initialize_lock::do_run_once): New function.
3706 * archive.cc (Archive::interpret_header): Only clear name if it is
3707 not already empty.
3708 * fileread.cc: Include "gold-threads.h"
3709 (file_counts_lock): New static variable.
3710 (file_counts_initialize_lock): Likewise.
3711 (File_read::release): Only increment counts when using --stats.
3712 Use a lock around the increment.
3713 * parameters.cc (class Set_parameters_target_once): Define.
3714 (set_parameters_target_once): New static variable.
3715 (Parameters::Parameters): Move here from parameters.h.
3716 (Parameters::set_target): Rewrite.
3717 (Parameters::set_target_once): New function.
3718 (Parameters::clear_target): Move here and rewrite.
3719 * parameters.h (class Parameters): Update declarations. Add
3720 set_parameters_target_once_ field.
3721 (Parameters::Parameters): Move to parameters.cc.
3722 (Parameters::clear_target): Likewise.
3723 * readsyms.cc (Read_symbols::do_group): Create a Start_group
3724 task.
3725 (Start_group::~Start_group): New function.
3726 (Start_group::is_runnable): New function.
3727 (Start_group::locks, Start_group::run): New functions.
3728 (Finish_group::run): Change saw_undefined to size_t.
3729 * readsyms.h (class Start_group): Define.
3730 (class Finish_group): Change saw_undefined_ field to size_t.
3731 (Finish_group::Finish_group): Remove saw_undefined and
3732 this_blocker parameters. Change all callers.
3733 (Finish_group::set_saw_undefined): New function.
3734 (Finish_group::set_blocker): New function.
3735 * symtab.h (class Symbol_table): Change saw_undefined to return
3736 size_t. Change saw_undefined_ field to size_t.
3737 * target-select.cc (Set_target_once::do_run_once): New function.
3738 (Target_selector::Target_selector): Initialize set_target_once_
3739 field. Don't initialize lock_ and initialize_lock_ fields.
3740 (Target_selector::instantiate_target): Rewrite.
3741 (Target_selector::set_target): New function.
3742 * target-select.h (class Set_target_once): Define.
3743 (class Target_selector): Update declarations. Make
3744 Set_target_once a friend. Remove lock_ and initialize_lock_
3745 fields. Add set_target_once_ field.
3746
fa17a3f4
ILT
37472010-02-10 Ian Lance Taylor <iant@google.com>
3748
3749 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
3750 queueing any tasks.
3751 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
3752 (queue_middle_tasks): Add all blockers before queueing any tasks.
3753 (queue_final_tasks): Likewise.
3754 * token.h (Task_token::add_blockers): New function.
3755 * object.h (Input_objects::number_of_relobjs): New function.
3756
c7177d31
ILT
37572010-02-10 Ian Lance Taylor <iant@google.com>
3758
5de0e392
ILT
3759 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
3760 shared, not if not position independent.
3761 * x86_64.cc (Relocate::relocate_tls): Likewise.
3762 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
3763 (tls_pie_pic_test): New target.
3764 * testsuite/Makefile.in: Rebuild.
3765
c7177d31
ILT
3766 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
3767 (tls_test_main_pie.o, tls_test_pie.o): New targets.
3768 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
3769 * testsuite/Makefile.in: Rebuild.
3770
684b268a
DM
37712010-02-09 David S. Miller <davem@davemloft.net>
3772
3773 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
3774 R_SPARC_RELATIVE using ->add_local_relative().
3775 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
3776
612a8d3d
DM
3777 * output.h (Output_data_dynamic::add_section_size): New method
3778 that takes two Output_data objects.
3779 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
3780 entry param. Handle it in initializers.
3781 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
3782 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
3783 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
3784 arg.
3785 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
3786 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
3787 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
3788 for dynrel_includes_plt.
3789 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3790 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3791 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
3792 before .rela.plt
3793 (Target_sparc::do_finalize_sections): Update to pass true for
3794 dynrel_includes_plt.
3795 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
3796 output before .rela.plt
3797 (Target_powerpc::do_finalize_sections): Update to pass true for
3798 dynrel_includes_plt when 32-bit.
3799
cb1be87e
DK
38002010-02-08 Doug Kwan <dougkwan@google.com>
3801
3802 * arm.cc (Arm_relobj::simple_input_section_output_address): New
3803 method.
3804 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
3805 Arm_relobj::scan_section_for_cortex_a8_stubs,
3806 Arm_relobj::do_relocation_section): Instead of calling
3807 Output_section::output_address, use faster
3808 Arm_relobj::simple_input_section_output_address.
3809
705b5121
DM
38102010-02-08 David S. Miller <davem@davemloft.net>
3811
3812 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
3813 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
3814 relocation helper function.
3815
024c4466
DM
3816 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
3817 just like R_SPARC_GOT{10,13,22}.
3818 (Target_sparc::Scan::local): Likewise.
3819 (Target_sparc::Relocate:relocate): Likewise.
3820
9109c078
ILT
38212010-02-06 Ian Lance Taylor <iant@google.com>
3822
3823 * configure.ac: Rewrite targetobjs duplicate removal code to use
3824 only shell constructs.
3825 * configure: Rebuild.
3826
cf846138
DK
38272010-02-05 Doug Kwan <dougkwan@google.com>
3828
3829 PR 11247
3830 * arm.cc (Arm_relobj::section_is_scannable): New method.
3831 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
3832 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
3833
6cfaf60b
DK
38342010-02-04 Doug Kwan <dougkwan@google.com>
3835
3836 PR 11247
3837 * arm-reloc-property.cc (cstdio): Include.
3838 * configure.ac (targetobjs): Remove duplicates.
3839 * configure: Regenerate.
3840 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
3841 big and little endian version for a given address size.
3842
5c57f1be
DK
38432010-02-03 Doug Kwan <dougkwan@google.com>
3844
3845 * arm-reloc-property.cc
3846 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3847 definition.
3848 * arm-reloc-property.h
3849 (Arm_reloc_property_table::get_implemented_static_reloc_property):
3850 New method definition.
3851 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3852 declaration.
3853 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
3854 overflow to N.
3855 (GOT_PREL): Change implemented to Y.
3856 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
3857 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
3858 (Arm_relocate_functions::movw_abs_nc): Remove method.
3859 (Arm_relocate_functions::movt_abs): Ditto.
3860 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
3861 (Arm_relocate_functions::thm_movt_abs): Ditto.
3862 (Arm_relocate_functions::movw_rel_nc): Ditto.
3863 (Arm_relocate_functions::movw_rel): Ditto.
3864 (Arm_relocate_functions::movt_rel): Ditto.
3865 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
3866 (Arm_relocate_functions:thm_movw_rel): Ditto.
3867 (Arm_relocate_functions:thm_movt_rel): Ditto.
3868 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
3869 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
3870 New method definitions.
3871 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
3872 (Arm_relocation_functions::arm_grp_ldr): Ditto.
3873 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
3874 (Arm_relocation_functions::arm_grp_ldc): Ditto.
3875 (Target_arm::Relocate::relocate): Check for non-static or
3876 unimplemented relocation code and exit early. Change calls to
3877 Target_arm::reloc_uses_thumb_bit and
3878 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
3879 instead. Refactor code to handle similar relocations to increase
3880 code sharing. Remove check for unsupported relocation code in switch
3881 statement.
3882 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
3883 relocation property table to find out size. Change error message to
3884 print out the name of a relocation code instead of the numeric value.
3885 (Target_arm::scan_reloc_for_stub): Use relocation property table
3886 instead of calling Target_arm::reloc_uses_thumb_bit().
3887
218c5831
DK
38882010-02-02 Doug Kwan <dougkwan@google.com>
3889
3890 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
3891 types of relaxed input section.
3892
0d31c79d
DK
38932010-02-02 Doug Kwan <dougkwan@google.com>
3894
3895 * Makefile.am (HFILES): Add arm-reloc-property.h.
3896 (DEFFILES): New.
3897 (TARGETSOURCES): Add arm-reloc-property.cc
3898 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
3899 (libgold_a_SOURCES): $(DEFFILES)
3900 * Makefile.in: Regenerate.
3901 * arm-reloc-property.cc: New file.
3902 * arm-reloc-property.h: New file.
3903 * arm-reloc.def: New file.
3904 * arm.cc: Update comments.
3905 (arm-reloc-property.h): New included header.
3906 (arm_reloc_property_table): New global variable.
3907 (Target_arm::do_select_as_default_target): New method definition.
3908 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
3909 arm-reloc-property to targ_extra_obj.
3910 * parameters.cc (set_parameters_target): Call
3911 Target::select_as_default_target().
3912 * target.h (Target::select_as_default_target): New method definition.
3913 (Target::do_select_as_default_target): Same.
3914
546c7457
DK
39152010-02-01 Doug Kwan <dougkwan@google.com>
3916
3917 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
3918 first_output_text_section_.
3919 (Arm_exidx_fixup::first_output_text_section): New method definition.
3920 (Arm_exidx_fixup::first_output_text_section_): New data member.
3921 (Arm_exidx_fixup::process_exidx_section): Record the first text
3922 output section seen.
3923 (Arm_output_section::fix_exidx_coverage): Set correct linked section
3924 and entsize in output section header.
3925
11b861d5
DK
39262010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3927
3928 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
3929 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
3930 (Arm_relocate_functions::thm_alu11): New Method.
3931 (Arm_relocate_functions::thm_pc8): New Method.
3932 (Arm_relocate_functions::thm_pc12): New Method.
3933 (Target_arm::Scan::local): Handle the relocations.
3934 (Target_arm::Scan::global): Likewise.
3935 (Target_arm::Relocate::relocate): Likewise.
3936 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
3937
c9a2c125
DK
39382010-01-29 Doug Kwan <dougkwan@google.com>
3939
3940 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
3941 of relocation types as ld.
3942
1521477a
DK
39432010-01-29 Doug Kwan <dougkwan@google.com>
3944
3945 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
3946 to public.
3947 (Arm_relocate_functions::thumb_branch_common): Ditto.
3948 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
3949 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
3950 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
3951 Arm_relocate_functions::jump24): Remove.
3952 (Target_arm::Relocate::relocate): Adjust code to call
3953 Arm_relocation_functions::arm_branch_common and
3954 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 3955 wrappers. Merge switch-cases together to reduce source code size.
1521477a 3956
e7eca48c
DK
39572010-01-29 Doug Kwan <dougkwan@google.com>
3958
3959 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
3960 output_local_symbol_count_needs_update_.
3961 (Arm_relobj::output_local_symbol_count_needs_update,
3962 Arm_relobj::set_output_local_symbol_count_needs_update,
3963 Arm_relobj::update_output_local_symbol_count): New methods.
3964 (Arm_relobj::output_local_symbol_count_needs_update_): New data
3965 member.
3966 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
3967 of pointed function as in a R_ARM_PREL31 relocation.
3968 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
3969 for output local symbol count updating.
3970 (Target_arm::do_relax): Update output local symbol counts in objects
3971 if necessary.
3972 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
3973
02961d7e
ILT
39742010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3975
3976 * arm.cc: Added support for the ARM relocations:
3977 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
3978 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
3979 (Arm_relocate_functions::movw_rel_nc): Renamed (was
3980 movw_prel_nc).
3981 (Arm_relocate_functions::movw_rel): New method.
3982 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
3983 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
3984 thm_movw_prel_nc).
3985 (Arm_relocate_functions::thm_movw_rel): New method.
3986 (Arm_relocate_functions::thm_movt_rel): Renamed (was
3987 thm_movt_prel).
3988 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
3989 relocations.
3990 (Target_arm::Scan::global): Likewise.
3991 (Target_arm::Relocate::relocate): Likewise.
3992 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3993 Likewise.
3994
b10d2873
ILT
39952010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3996
3997 * arm.cc: Added support for ARM group relocations.
3998 (Target_arm::reloc_needs_sym_origin): New method.
3999 (Arm_relocate_functions::calc_grp_kn): New method.
4000 (Arm_relocate_functions::calc_grp_residual): New method.
4001 (Arm_relocate_functions::calc_grp_gn): New method.
4002 (Arm_relocate_functions::arm_grp_alu): New Method.
4003 (Arm_relocate_functions::arm_grp_ldr): New Method.
4004 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4005 (Arm_relocate_functions::arm_grp_ldc): New Method.
4006 (Target_arm::Scan::local): Handle the ARM group relocations.
4007 (Target_arm::Scan::global): Likewise.
4008 (Target_arm::Relocate::relocate): Likewise.
4009 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4010 Likewise.
4011
2b328d4e
DK
40122010-01-26 Doug Kwan <dougkwan@google.com>
4013
4014 * arm.cc (set): Include.
4015 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4016 pointer type.
4017 (Arm_output_section::Text_section_list): New type.
4018 (Arm_output_section::append_text_sections_to_list): New method.
4019 (Arm_output_section::fix_exidx_coverage): Ditto.
4020 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4021 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4022 Relobj::set_section_offset() instead of
4023 Sized_relobj::invalidate_section_offset().
4024 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4025 parameter for section headers. Ignore relocation sections for
4026 unallocated sections and EXIDX sections.
4027 (Target_arm::fix_exidx_coverage): New method.
4028 (Target_arm::output_section_address_less_than): New type.
4029 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4030 linked text section instead of the EXIDX section.
4031 (Arm_output_section::create_stub_group): Add an assertion to check
4032 that this is not an EXIDX output section.
4033 (Arm_output_section::append_text_sections_to_list): New method.
4034 (Arm_output_section::fix_exidx_coverage): Ditto.
4035 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4036 Arm_relobj::section_needs_reloc_stub_scanning.
4037 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4038 first pass.
4039 (Target_arm::fix_exidx_coverage): New method.
4040 * object.h (Relobj::set_output_section): New method.
4041 (Sized_relobj::invalidate_section_offset): Remove method.
4042 (Sized_relobj::do_invalidate_section_offset): Remove method.
4043 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4044
c7f3c371
DK
40452010-01-25 Doug Kwan <dougkwan@google.com>
4046
4047 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4048 Fix warning due to signed and unsigned comparison on a 32-bit host.
4049
8923b24c
DK
40502010-01-22 Doug Kwan <dougkwan@google.com>
4051
4052 * arm.cc (Target_arm::do_relax): Record an output section for section
4053 offset adjustment it contains any stub table that has changed.
4054 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4055 offsets in an output section if necessary.
4056 * output.cc (Output_section::Output_section): Initialize
4057 section_offsets_need_adjustments_.
4058 (Output_section::add_input_section_for_script): Renamed to
4059 Output_section::add_simple_input_section.
4060 (Output_section::save_states): Add a comment.
4061 (Output_section::discard_states): New method defintion.
4062 (Output_section::adjust_section_offsets): Same.
4063 * output.h (Output_section::add_input_section_for_script): Renamed to
4064 Output_section::add_simple_input_section.
4065 (Output_section::discard_states): New method declaration.
4066 (Output_section::adjust_section_offsets): Same.
4067 (Output_section::section_offsets_need_adjustment,
4068 Output_section::set_section_offsets_need_adjustment): New method
4069 definitions.
4070 (Output_section::section_offsets_need_adjustment_): New data member.
4071 * script-sections.cc
4072 (Output_section_element_input::set_section_address): Adjust code for
4073 renaming of Output_section::add_input_section_for_script.
4074 (Orphan_output_section::set_section_address): Same.
4075
9b2fd367
DK
40762010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4077
4078 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4079 Fix_v4bx enum values .
4080 * gold/options.h (General_options): New option definitions.
4081 (General_options::fix_v4bx): New method.
4082 (General_options::Fix_v4bx): New enum.
4083 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4084 (General_options::parse_fix_v4bx_interworking): New method.
4085
80d0d023
DK
40862010-01-22 Doug Kwan <dougkwan@google.com>
4087
4088 * arm.cc (Arm_exidx_fixup): New class.
4089
af2cdeae
DK
40902010-01-21 Doug Kwan <dougkwan@google.com>
4091
4092 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4093 classes.
4094 (Arm_exidx_section_offset_map): New type.
4095
993d07c1
DK
40962010-01-21 Doug Kwan <dougkwan@google.com>
4097
4098 * arm.cc (Arm_exidx_input_section): New class.
4099 (Arm_relobj::exidx_input_section_by_link,
4100 Arm_relobj::exidx_input_section_by_shndx,
4101 Arm_relobj::make_exidx_input_section): New methods.
4102 (read_arm_attributes_section): Remove.
4103 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4104 information about them.
4105 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4106 to here.
4107
5ac169d4
DK
41082010-01-20 Doug Kwan <dougkwan@google.com>
4109
4110 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4111 Input_section_specifier to Section_id.
4112 (Target_arm::new_arm_input_section: Adjust code for change of key
4113 type.
4114 (Target_arm::find_arm_input_section): Ditto.
4115 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4116 (Section_id): Remove.
4117 (Garbage_collection::Section_id_hash): Remove.
4118 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4119 (Section_id): Remove.
4120 (Icf::Section_id_hash): Remove.
4121 * object.h (Section_id, Const_section_id, Section_id_hash,
4122 Const_section_id_hash): New type definitions.
4123 * output.cc (Output_section::add_relaxed_input_section): Change to
4124 use Const_section_id instead of Input_section_specifier as key type.
4125 (Output_section::add_merge_input_section): Ditto.
4126 (Output_section::build_relaxation_map): Change to use Section_id
4127 instead of Input_section_specifier as key type.
4128 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4129 Ditto.
4130 (Output_section::convert_input_sections_to_relaxed_sections): Change
4131 to use Const_section_id instead of Input_section_specifier as key type.
4132 (Output_section::find_merge_section): Ditto.
4133 (Output_section::find_relaxed_input_section): Ditto.
4134 * output.h (Input_section_specifier): Remove class.
4135 (Output_section::Output_section_data_by_input_section_map): Change
4136 key type to Const_section_id.
4137 (Output_section::Output_relaxed_input_section_by_input_section_map):
4138 Ditto.
4139 (Output_section::Relaxation_map): Change key type to Section_id.
4140
a2162063
ILT
41412010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4142
4143 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4144 (class Arm_v4bx_stub): New class.
4145 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4146 (Stub_factory::make_arm_v4bx_stub): New method.
4147 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4148 (Stub_table::empty): Handle v4bx stubs.
4149 (Stub_table::add_arm_v4bx_stub): New method.
4150 (Stub_table::find_arm_v4bx_stub): New method.
4151 (Arm_relocate_functions::v4bx): New method.
4152 (Target_arm::fix_v4bx): New method.
4153 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4154 (Stub_table::relocate_stubs): Likewise.
4155 (Stub_table::do_write): Likewise.
4156 (Stub_table::update_data_size_and_addralign): Likewise.
4157 (Stub_table::finalize_stubs): Likewise.
4158 (Target_arm::Scan::local): Likewise.
4159 (Target_arm::Scan::global): Likewise.
4160 (Target_arm::do_finalize_sections): Likewise.
4161 (Target_arm::Relocate::relocate): Likewise.
4162 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4163 Likewise.
4164 (Target_arm::scan_reloc_for_stub): Likewise.
4165 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4166
5696ab0b
ILT
41672010-01-19 Ian Lance Taylor <iant@google.com>
4168
4169 * output.cc (Output_section_headers::do_sized_write): Write large
4170 segment count to sh_info field.
4171 (Output_file_header::do_sized_write): For large segment count,
4172 write PN_XNUM to e_phnum field.
4173
800d0f56
ILT
41742010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4175
4176 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4177 (Arm_relocate_functions::thm_jump8): New function.
4178 (Arm_relocate_functions::thm_jump11): New function.
4179 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4180 R_ARM_THM_JUMP11.
4181 (Target_arm::Scan::global): Likewise.
4182 (Target_arm::Relocate::relocate): Likewise.
4183 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4184 Likewise.
4185
41263c05
DK
41862010-01-14 Doug Kwan <dougkwan@google.com>
4187
4188 * arm.cc (map, utility): Include headers.
4189 (Target_arm::apply_cortex_a8_workaround): New method.
4190 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4191 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4192 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4193 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4194 the --[no-]fix-cortex-a8 command line options.
4195 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4196 (Target_arm::relocate_stub): Use addend in instruction template.
4197 * options.h (DEFINE_bool): Set the user-set flag.
4198 (General_options): Add --[no-]-fix-cortex options.
4199 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4200 : Update fast look-up map after conversion.
41263c05 4201
459e9b03
ST
42022010-01-14 Sriraman Tallam <tmsriram@google.com>
4203
4204 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4205 in the first pass of do_layout.
4206
b521dfe4
DK
42072010-01-13 Doug Kwan <dougkwan@google.com>
4208
4209 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4210 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4211 apparent compiler problem of not folding static constant integral
4212 data members of elfcpp::Elf_sizes<32>.
4213
44272192
DK
42142010-01-13 Doug Kwan <dougkwan@google.com>
4215
4216 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4217 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4218 Arm_relobj::scan_section_for_cortex_a8_erratum,
4219 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4220 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4221 sections to scan for relocation stubs into a new method
4222 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4223 relocation and Cortex-A8 stub scanning.
4224 (Target_arm::do_relax): Force stubs to be after stubbed sections
4225 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4226 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4227 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4228
44b71ece
ILT
42292010-01-12 Ian Lance Taylor <iant@google.com>
4230
4231 * target-reloc.h (visibility_error): New inline function.
4232 (relocate_section): Call visibility_error.
4233 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4234 (MOSTLYCLEANFILES): Likewise.
4235 (protected_4_pic.o, protected_3.err): New targets.
4236 * testsuite/protected_4.cc: New file.
4237
a120bc7f
DK
42382010-01-12 Doug Kwan <dougkwan@google.com>
4239
4240 * arm.cc (Cortex_a8_reloc): New class.
4241 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4242 and cortex_a8_relocs_info_.
4243 (Target_arm::fix_cortex_a8): New method definition.
4244 (Target_arm::Cortex_a8_relocs_info): New type.
4245 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4246 New data member declarations.
4247 (Target_arm::scan_reloc_for_stub): Record information about
4248 relocations for THUMB branches that might be exempted from the
4249 Cortex-A8 workaround.
4250 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4251 at the beginning of a relaxation pass.
4252
20138696
DK
42532010-01-12 Doug Kwan <dougkwan@google.com>
4254
4255 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4256 (Arm_relobj::Mapping_symbol_position,
4257 Arm_reloj::Mapping_symbol_position_less,
4258 Arm_relobj::Mapping_symbols_info): New types.
4259 (Target_arm::is_mapping_symbol_name): New method definition.
4260 (Arm_relobj::do_count_local_symbols): Save information about mapping
4261 symbols.
4262
089d69dc
DK
42632010-01-11 Doug Kwan <dougkwan@google.com>
4264
4265 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4266 Arm_relocate_functions::thumb32_branch_upper,
4267 Arm_relocate_functions::thumb32_branch_lower,
4268 Arm_relocate_functions::thumb32_cond_branch_offset,
4269 Arm_relocate_functions::thumb32_cond_branch_upper,
4270 Arm_relocate_functions::thumb32_cond_branch_lower,
4271 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4272 branch offset encoding.
4273 (Arm_relocate_functions::thumb_branch_common): Use new branch
4274 offset encoding methods to avoid code duplication.
4275 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4276 (Stub_addend_reader::operator()): Use new branch encoding method
4277 to avoid code duplication.
4278
99e5bff2
DK
42792010-01-11 Doug Kwan <dougkwan@google.com>
4280
4281 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4282 (Target_arm::do_finalize_sections): Define special EXIDX section
4283 symbols only if referenced.
4284 * gc.h (Garbage_collection::add_reference): New method.
4285 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4286 code duplication.
4287
98e090bd
ILT
42882010-01-11 Ian Lance Taylor <iant@google.com>
4289
d0a91bd8
ILT
4290 * script.cc (Version_script_info::build_expression_list_lookup):
4291 Change complaing about duplicate wildcard match from error to
4292 warning.
4293
98e090bd
ILT
4294 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4295 of 2009-12-30.
4296 (Version_script_info::Version_script_info): Initialize globs_,
4297 default_version_, default_is_global_, and exact_. Don't
4298 initialize globals_ or locals_.
4299 (Version_script_info::build_lookup_tables): Build local symbols
4300 first.
4301 (Version_script_info::unquote): New function.
4302 (Version_script_info::add_exact_match): New function.
4303 (Version_script_info::build_expression_list_lookup): Remove lookup
4304 parameter. Add is_global parameter. Change all callers. Handle
4305 wildcard pattern specially. Unquote pattern. Call
4306 add_exact_match.
4307 (Version_script_info::get_name_to_match): New function.
4308 (Version_script_info::get_symbol_version): New function.
4309 (Version_script_info::get_symbol_version_helper): Remove.
4310 (Version_script_info::check_unmatched_names): Call unquote.
4311 * script.h (class Version_script_info): Change get_symbol_version
4312 to be non-inline and add is_global parameter; change all callers.
4313 Rewrite symbol_is_local. Update declarations. Define struct
4314 Version_tree_match, Exact, Globs. Don't define struct Lookup.
4315 Remove globals_ and locals_ members. Add exact_, globs_,
4316 default_version_, is_global_.
4317 (Version_script_info::Glob): Remove pattern, add expression and
4318 is_global. Update constructor. Change all callers.
4319 * dynobj.cc (Versions::finalize): Mark the version symbol as the
4320 default version.
4321 (Versions::symbol_section_contents): If a symbol is undefined, or
4322 defined in a dynamic object, set the version index to
4323 VER_NDX_LOCAL.
4324 * symtab.cc (Symbol_table::add_from_relobj): Don't call
4325 symbol_is_local.
4326 (Symbol_table::add_from_pluginobj): Likewise.
4327 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
4328
d56962d3
DK
43292010-01-11 Doug Kwan <dougkwan@google.com>
4330
4331 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
4332 (incremental_dump_LDADD): Add linking option for libintl.
4333 * Makefile.in: Regenerate.
4334
94e6ee91
L
43352010-01-11 H.J. Lu <hongjiu.lu@intel.com>
4336
4337 PR gold/11144
4338 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
4339 instead of -Ds.
4340 * testsuite/Makefile.in: Regenerated.
4341
e96c574b
DK
43422010-01-10 Doug Kwan <dougkwan@google.com>
4343
4344 * options.h (DEFINE_var): Use parentheses around argument varname__
4345 in macro body to avoid any unintended subsequent substitutions.
4346
7198066b
ILT
43472010-01-10 Ian Lance Taylor <iant@google.com>
4348
ba4d53bf
ILT
4349 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
4350 candidates before doing symbol resolution.
4351
7198066b
ILT
4352 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
4353 ODR candidates if only one is weak.
4354
a2beed37
ILT
43552010-01-08 Ian Lance Taylor <iant@google.com>
4356
4357 * script.cc (Version_script_info::build_expression_list_lookup):
4358 Don't warn about ambiguous version, just record the ambiguity.
4359 (Version_script_info::get_symbol_version_helper): Give error if
4360 version is ambiguous.
4361
2fb7225c
DK
43622010-01-08 Doug Kwan <dougkwan@google.com>
4363
4364 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
4365 prev_data_size_ and prev_addralign_. Remove initializer for
4366 deleted data member has_been_changed_.
4367 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
4368 to determine if the table is empty.
4369 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
4370 Remove.
4371 (Stub_table::add_reloc_stub): Define method in class definition
4372 instead of just declaring it there.
4373 (Stub_table::add_cortex_a8_stub): New method definition.
4374 (Stub_table::update_data_size_and_addralign): Ditto.
4375 (Stub_table::finalize_stubs): Ditto.
4376 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
4377 (Stub_table::do_addralign_): Return address alignment in the
4378 (Stub_table::do_reset_address_and_file_offset): Define method in
4379 class definition instead of declaring it there. Set current data
4380 size to be the data size of the previous pass.
4381 (Stub_table::set_final_data_size): Use current data size as the
4382 final data size.
4383 (Stub_table::relocate_stub): Change parameter type of stub from
4384 Reloc_stub pointer to Stub pointer.
4385 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
4386 (Stub_table::Cortex_a8_stub_list): New typedef.
4387 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
4388 Stub_table::prev_addralign_): New data member.
4389 (Arm_relobj::Arm_relobj): Initialize data member
4390 section_has_cortex_a8_workaround_.
4391 (Arm_relobj::section_has_cortex_a8_workaround,
4392 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
4393 definitions.
4394 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
4395 declarations.
4396 (Target_arm::relocate_stub): Change parameter type of stub from
4397 Reloc_stub pointer to Stub pointer.
4398 (Insn_template::size, Insn_template::alignment): Handle
4399 THUMB16_SPECIAL_TYPE.
4400 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
4401 Stub_table::update_data_size_and_addralign,
4402 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
4403 definitions.
4404 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
4405 (Stub_table::do_write): Ditto.
4406 (Target_arm::do_relax): Adjust code for changes in Stub_table.
4407
880cd20d
ILT
44082010-01-08 Ian Lance Taylor <iant@google.com>
4409
4410 PR 11108
4411 * symtab.h (class Symbol): Remove fields is_target_special_ and
4412 has_plt_offset_. Add field is_defined_in_discarded_section_.
4413 (Symbol::is_defined_in_discarded_section): New function.
4414 (Symbol::set_is_defined_in_discarded_section): New function.
4415 (Symbol::has_plt_offset): Rewrite.
4416 (Symbol::set_plt_offset): Verify that new offset is not -1U.
4417 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
4418 Don't initialize is_target_special_ or has_plt_offset_.
4419 Initialize is_defined_in_discarded_section_.
4420 (Symbol_table::add_from_relobj): If appropriate, set
4421 is_defined_in_discarded_section.
4422 * resolve.cc (Symbol::override_base_with_special): Don't test
4423 is_target_special_. Change has_plt_offset_ to has_plt_offset().
4424 * target-reloc.h (relocate_section): Do special handling for
4425 symbols defined in discarded sections for global symbols as well
4426 as local symbols.
4427
2703e3eb
ILT
44282010-01-08 Ian Lance Taylor <iant@google.com>
4429
4430 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
4431 the SHT_SYMTAB case.
4432
339d40a3
ILT
44332010-01-08 Ian Lance Taylor <iant@google.com>
4434
4435 * object.cc (Sized_relobj::do_layout): Don't get confused if
4436 layout_eh_frame returns NULL.
4437
abecea76
ILT
44382010-01-08 Ian Lance Taylor <iant@google.com>
4439
4440 PR 11084
4441 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
4442 dynamic symbol table, use the normal symbol table.
4443 (Sized_dynobj::do_read_symbols): Remove assertion about type of
4444 symbol table.
4445
6b7dd3f3
ILT
44462010-01-08 Ian Lance Taylor <iant@google.com>
4447
4448 PR 11072
4449 * layout.cc (Layout::include_section): Remove .gnu_debuglink
4450 sections.
4451
36c50e63
L
44522010-01-08 H.J. Lu <hongjiu.lu@intel.com>
4453
4454 * version.cc (print_version): Change to "Copyright 2010".
4455
e291e7b9
ILT
44562010-01-08 Ian Lance Taylor <iant@google.com>
4457
4458 PR 10287
4459 PR 11063
4460 * i386.cc (class Target_i386): Change return type of plt_section
4461 to be non-const.
4462 (class Output_data_plt_i386): Add tls_desc_rel_ field.
4463 (Output_data_plt_i386::Output_data_plt_i386): Initialize
4464 tls_desc_rel_ field.
4465 (Output_data_plt_i386::rel_tls_desc): New function.
4466 (Target_i386::rel_tls_desc_section): New function.
4467 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
4468 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
4469 R_386_TLS_DESC reloc in rel_tls_desc_section.
4470 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
4471 Define struct Tlsdesc_info.
4472 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
4473 (Target_x86_64::do_reloc_symbol_index): New function.
4474 (Target_x86_64::add_tlsdesc_info): New function.
4475 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
4476 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
4477 tlsdesc_rel_ field.
4478 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
4479 all callers.
4480 (Output_data_plt_x86_64::rela_tlsdesc): New function.
4481 (Target_x86_64::rela_tlsdesc_section): New function.
4482 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
4483 handling.
4484 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
4485 (Target_x86_64::do_reloc_addend): New function.
4486 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
4487 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
4488 declarations. Define TARGET_CODE. Add arg field to u1_ union.
4489 (Output_reloc::type): New function.
4490 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
4491 (Output_reloc::is_target_specific): New function.
4492 (Output_reloc::target_arg): New function.
4493 (class Output_reloc) [SHT_RELA]: Add four new constructors for
4494 absolute relocs and target specific relocs.
4495 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
4496 add_target_specific.
4497 (class Output_data_reloc) [SHT_RELA]: Likewise.
4498 * output.cc (Output_reloc::Output_reloc): Add four new versions
4499 for absolute relocs and target specific relocs.
4500 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
4501 (Output_reloc::get_symbol_index): Likewise.
4502 (Output_reloc::local_section_offset): Check that local_sym_index_
4503 is not TARGET_CODE or 0.
4504 (Output_reloc::symbol_value): Likewise.
4505 (Output_reloc::write) [SHT_RELA]: Call target for target specific
4506 reloc.
4507 * target.h (class Target): Add reloc_symbol_index and reloc_addend
4508 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
4509 functions.
4510 * layout.cc (add_target_dynamic_tags): Use output section for
4511 DT_PLTRELSZ and DT_JMPREL.
4512
3a44184e
ILT
45132010-01-07 Ian Lance Taylor <iant@google.com>
4514
4515 PR 11061
4516 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
4517 function.
4518 (class Output_data_reloc_generic): Define.
4519 (class Output_data_reloc_base): Change base class to
4520 Output_data_reloc_generic. Change add() method to call
4521 bump_relative_reloc_count for a relative reloc. Remove
4522 sort_relocs_ field.
4523 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
4524 to sort_relocs().
4525 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
4526 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
4527 appropriate.
4528 * layout.h (class Layout): Update declaration.
4529
ea715a34
ILT
45302010-01-07 Ian Lance Taylor <iant@google.com>
4531
4532 * output.h (class Output_data): Add const version of
4533 output_section and do_output_section.
4534 (class Output_section_data): Add const version of
4535 do_output_section.
4536 (class Output_section): Likewise.
4537 * layout.cc (Layout::add_target_dynamic_tags): New function.
4538 * layout.h (class Layout): Update declarations.
4539 * arm.cc (Target_arm::do_finalize_sections): Use
4540 add_target_dynamic_tags.
4541 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4542 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4543 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4544 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4545
659948a4
ILT
45462010-01-07 Ian Lance Taylor <iant@google.com>
4547
4548 PR 11042
4549 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
4550 object as needed.
4551
9d3b86f6
ILT
45522010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
4553 Ian Lance Taylor <iant@google.com>
4554
4555 PR 11019
4556 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
4557 Xindex::read_symtab_xindex.
4558
bb0d3eb0
DK
45592010-01-07 Doug Kwan <dougkwan@google.com>
4560
4561 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
4562 (Insn_template::thumb16_bcond_insn): New method declaration.
4563 (Insn_template): Fix spelling.
4564 (Stub::thumb16_special): New method declaration.
4565 (Stub::do_write): Define virtual method which was previously pure
4566 virtual.
4567 (Stub::do_thumb16_special): New method declaration.
4568 (Stub::do_fixed_endian_write): New template member.
4569 (Reloc_stub::do_write): Remove.
4570 (Reloc_stub::do_fixed_endian_write): Remove.
4571 (Cortex_a8_stub): New class definition.
4572 (Stub_factory::make_cortex_a8_stub): New method definition.
4573 (Stub_factory::Stub_factory): Add missing static storage class
4574 qualifier for elf32_arm_stub_a8_veneer_blx.
4575
ffeef7df
ILT
45762010-01-07 Ian Lance Taylor <iant@google.com>
4577
dc3f80fe
ILT
4578 PR 10980
4579 * options.h (class General_options): Add --warn-unresolved-symbols
4580 and --error-unresolved-symbols.
4581 * errors.cc (Errors::undefined_symbol): Implement
4582 --warn-unresolved-symbols.
4583
ffeef7df
ILT
4584 * options.h (class General_options): Add -z text and -z textoff.
4585 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
4586
f1ec9ded
ST
45872010-01-06 Sriraman Tallam <tmsriram@google.com>
4588
4589 * gc.h (Garbage_collection::Cident_section_map): New typedef.
4590 (Garbage_collection::cident_sections): New function.
4591 (Garbage_collection::add_cident_section): New function.
4592 (Garbage_collection::cident_sections_): New member.
4593 (gc_process_relocs): Add references to sections whose names are C
4594 identifiers.
4595 * gold.h (cident_section_start_prefix): New constant.
4596 (cident_section_stop_prefix): New constant.
4597 (is_cident): New function.
4598 * layout.cc (Layout::define_section_symbols): Replace string constants
4599 with the newly defined constants.
4600 * object.cc (Sized_relobj::do_layout): Track sections whose names are
4601 C identifiers.
4602 * testsuite/Makefile.am: Add gc_orphan_section_test.
4603 * testsuite/Makefile.in: Regenerate.
4604 * testsuite/gc_orphan_section_test.cc: New file.
4605 * testsuite/gc_orphan_section_test.sh: New file.
4606
6eda8c29
ILT
46072010-01-06 Ian Lance Taylor <iant@google.com>
4608
b9674e17
ILT
4609 PR 10980
4610 * options.h (class General_options): Add --warn-shared-textrel.
4611 * layout.cc (Layout::finish_dynamic_section): Implement
4612 --warn-shared-textrel.
4613
6eda8c29
ILT
4614 PR 10980
4615 * options.h (class General_options): Add --warn-multiple-gp.
4616
32dcd44e
ILT
46172010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4618
4619 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
4620 $(THREADSLIB) and $(LIBDL).
4621 * Makefile.in: Rebuild.
4622
a192ba05
ILT
46232010-01-06 Ian Lance Taylor <iant@google.com>
4624
4625 PR 10980
4626 * options.cc (General_options::parse_section_start): New function.
4627 (General_options::section_start): New function.
4628 (General_options::General_options): Initialize all members.
4629 * options.h: Include <map>
4630 (class General_options): Add --section-start. Add section_starts_
4631 member.
4632 * layout.cc (Layout::attach_allocated_section_to_segment): If
4633 --section-start was used, set the address of the segment. Remove
4634 local sort_sections.
4635 (Layout::relaxation_loop_body): If the address of the load segment
4636 has been set by --section-start, don't use it.
4637 * output.h (Output_segment::update_flags_for_output_section): New
4638 function.
4639 * output.cc (Output_segment::add_output_section): Call
4640 update_flags_for_output_section.
4641
dde3f402
ILT
46422010-01-05 Ian Lance Taylor <iant@google.com>
4643
62dfdd4d
ILT
4644 PR 10980
4645 * options.h (class General_options): Add --undefined-version.
4646 * script.cc (struct Version_expression): Add was_matched_by_symbol
4647 field.
4648 (Version_script_info::matched_symbol): New function.
4649 (Version_script_info::get_symbol_version_helper): Call
4650 matched_symbol.
4651 (Version_script_info::check_unmatched_names): New function.
4652 * script.h (class Version_script_info): Update declarations.
4653 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
4654
9c4ae156
ILT
4655 * options.h (class General_options): Use DEFINE_bool_alias for
4656 allow_multiple_definition.
4657 * resolve.cc (Symbol_table::should_override): Don't test
4658 allow_multiple_definition.
4659
dde3f402
ILT
4660 PR 10980
4661 * options.h (class General_options): Add --cref.
4662 * main.cc (main): Print cref table if --cref. Don't close mapfile
4663 until after printing cref table.
4664 * cref.cc: Include "symtab.h".
4665 (class Cref_inputs): Define Cref_table_compare and Cref_table.
4666 (Cref_table_compare::operator()): New function.
4667 (Cref_inputs::gather_cref): New function.
4668 (filecol): New static const.
4669 (Cref_inputs::print_cref): New function.
4670 (Cref::print_cref): New function.
4671 * cref.h: Include <cstdio>.
4672 (class Cref): Update declarations.
4673 * mapfile.h (Mapfile::file): New function.
4674 * object.h (class Object): Define Symbols. Declare virtual
4675 do_get_global_symbols.
4676 (Object::get_global_symbols): New function.
4677 * object.cc (Input_objects::add_object): Pass object to cref_ if
4678 --cref.
4679 (Input_objects::archive_start): Likewise.
4680 (Input_objects::archive_stop): Likewise.
4681 (Input_objects::print_cref): New function.
4682 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
4683 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
4684 --cref.
4685 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
4686 function.
4687 * plugin.h (class Sized_pluginobj): Update declarations.
4688
8781f709
ILT
46892010-01-05 Ian Lance Taylor <iant@google.com>
4690
4691 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
4692 to is_default_version. Rename insdef to insdefault.
4693 (Symbol_table::add_from_relobj): Rename def to is_default_version
4694 and local to is_forced_local.
4695 (Symbol_table::add_from_pluginobj): Likewise.
4696 (Symbol_table::add_from_dynobj): Likewise.
4697 (Symbol_table::define_special_symbol): Rename insdef to
4698 insdefault.
4699
fe35d28d
ILT
47002010-01-04 Ian Lance Taylor <iant@google.com>
4701
30bc8c46
ILT
4702 PR 10980
4703 * options.h (class General_options): Add
4704 --allow-multiple-definition and -z muldefs.
4705 * resolve.cc (Symbol_table::should_override): Don't warn about a
4706 multiple symbol definition if --allow-multiple-definition or -z
4707 muldefs.
4708
7eaea549
ILT
4709 PR 10980
4710 * options.h (class General_options): Add --add-needed and
4711 --copy-dt-needed-entries. Tweak --as-needed help entry.
4712 * object.cc (Input_objects::check_dynamic_dependencies): Give an
4713 error if --copy-dt-needed-entries aka --add-needed is used and
4714 would cause a change in behaviour.
4715
fe35d28d
ILT
4716 PR 10980
4717 * options.h (class General_options): Add -G as a short version of
4718 --shared. Add no-op options -assert, -g, and -i.
4719
55a2bb35
ST
47202010-01-04 Sriraman Tallam <tmsriram@google.com>
4721
4722 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
4723 check for .text or .gnu.linkonce.t sections.
4724 * icf.cc (Icf::find_identical_sections): Ditto.
4725 Change the detection for mangled function name within the section
4726 name.
4727 * icf.h (is_section_foldable_candidate): New function.
4728
719328e1
ILT
47292009-12-30 Ian Lance Taylor <iant@google.com>
4730
4731 PR 10980
4732 * options.h (class General_options): Permit two dashes with
4733 --retain-symbols-file.
4734
d7bb5745
ILT
47352009-12-30 Ian Lance Taylor <iant@google.com>
4736
403a15dd
ILT
4737 PR 10979
4738 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
4739 don't put the file header and segment headers in the text
4740 segment.
4741
eda294df
ILT
4742 PR 10979
4743 * common.cc (Sort_commons::operator()): Stabilize sort when both
4744 entries are NULL.
4745 (Symbol_table::do_allocate_commons_list): When allocating common
4746 symbols, skip a symbol which is no longer common.
4747 * symtab.h (Symbol::is_common): Test whether the symbol comes from
4748 an object before checking its type.
4749 * testsuite/common_test_2.c: New file.
4750 * testsuite/common_test_3.c: New file.
4751 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
4752 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
4753 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
4754 (common_test_2_pic.o, common_test_2.so): New targets.
4755 (common_test_3_pic.o, common_test_3.so): New targets.
4756 * testsuite/Makefile.in: Rebuild.
4757
d7bb5745
ILT
4758 PR 10979
4759 * script.cc (read_input_script): If we see a new SECTIONS clause,
4760 and we have added an input section, give an error.
4761 * layout.h (class Layout): Add have_added_input_section function.
4762 Add have_added_input_section_ field.
4763 * layout.cc (Layout::Layout): Initialize
4764 have_added_input_section_.
4765 (Layout::layout): Set have_added_input_section_.
4766 (Layout::layout_eh_frame): Likewise.
4767
fc59c572
ILT
47682009-12-30 Ian Lance Taylor <iant@google.com>
4769
4770 PR 10931
4771 * options.h (class General_options): Add --sort-common option.
4772 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
4773 * common.cc (Sort_common): Add sort_order parameter to
4774 constructor. Add sort_order_ field.
4775 (Sort_commons::operator): Check sort_order_.
4776 (Symbol_table::allocate_commons): Determine the sort order.
4777 (Symbol_table::do_allocate_commons): Add sort_order parameter.
4778 Change all callers.
4779 (Symbol_table::do_allocate_commons_list): Likewise.
4780
1c74fab0
ILT
47812009-12-30 Ian Lance Taylor <iant@google.com>
4782
4783 PR 10916
4784 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
4785 symbols from this object, don't change the visibility of an
4786 undefined symbol.
4787 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
4788
6affe781
ILT
47892009-12-30 Ian Lance Taylor <iant@google.com>
4790
4791 PR 10861
4792 * script.h (class Version_script_info): Define Language enum.
4793 Update declarations. Define Glob, Exact, and Lookup types. Add
4794 new fields globals_, locals_, and is_finalized_.
4795 * script.cc: Various formatting fixes.
4796 (class Parser_closure): Change language_stack_ from a vector of
4797 std::string to one of Version_script_info::Language. Adjust all
4798 uses accordingly.
4799 (class Lazy_demangler): Remove.
4800 (struct Version_expression): Change language from std::string to
4801 Version_script_info::Language.
4802 (Version_script_info::Version_script_info): New function.
4803 (Version_script_info::~Version_script_info): Don't call clear.
4804 (Version_script_info::finalize): New function.
4805 (Version_script_info::build_lookup_tables): New function.
4806 (Version_script_info::build_expression_list_lookup): New
4807 function.
4808 (Version_script_info::get_symbol_version_helper): Rewrite to use
4809 lookup tables.
4810 (Version_script_info::print_expression_list): Adjust to use
4811 Version_script_info::Language.
4812 (script_push_lex_into_version_mode): Check that the version script
4813 has not been finalized.
4814 (version_script_push_lang): Change language string to
4815 Version_script_info::Language.
4816 * options.cc (Command_line::version_script): New function.
4817 * options.h (class General_options): Add finalize_dynamic_list
4818 function. Change version_script from declaration to definition.
4819 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
4820 * testsuite/version_script.map: Remove duplicate def of foo.
4821 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
4822 version_script.map.
4823 * testsuite/Makefile.in: Rebuild.
4824
818bf354
ILT
48252009-12-30 Ian Lance Taylor <iant@google.com>
4826
4827 PR 10843
4828 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
4829 if the input symbol index is 0, make the output symbol index 0.
4830
ebcc8304
ILT
48312009-12-30 Ian Lance Taylor <iant@google.com>
4832
4833 PR 10670
4834 * options.h (class General_options): Add -x/--discard-all.
4835 * object.cc (Sized_relobj::do_count_local_symbols): Handle
4836 --discard-all. If the local symbol needs a dynamic entry, check
4837 that before handling --discard-locals.
4838
176fe33f
ILT
48392009-12-30 Ian Lance Taylor <iant@google.com>
4840
bb321bb1
ILT
4841 PR 10450
4842 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
4843 flags to PF_R.
4844 (Output_segment::add_output_section): Don't change the flags if
4845 the type is PT_TLS.
4846
176fe33f
ILT
4847 PR 10450
4848 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
4849 GNU hash table if they need a dynamic value. Otherwise, don't add
4850 them if they are defined in a dynamic object or are forced local.
4851
e8cd95c7
ILT
48522009-12-29 Ian Lance Taylor <iant@google.com>
4853
1b81fb71
ILT
4854 PR 10450
4855 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
4856 .gnu.hash table for a 32-bit target.
4857
8d6d383d
ILT
4858 PR 10450
4859 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
4860 regular and a dynamic object only needs a dynamic symbol table
4861 entry if it is externally visible.
4862
e785ec03
ILT
4863 PR 10450
4864 * i386.cc (class Target_i386): Initialize global_offset_table_ in
4865 constructor. Add global_offset_table_ field.
4866 (Target_i386::got_section): Set global_offset_table_.
4867 (Target_i386::do_finalize_sections): Set global_offset_table_
4868 size.
4869 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
4870 in constructor. Add global_offset_table_ field.
4871 (Target_x86_64::got_section): Set global_offset_table_.
4872 (Target_x86_64::do_finalize_sections): Set global_offset_table_
4873 size.
4874
1a2dff53
ILT
4875 * layout.cc (Layout::Layout): Initialize increase_relro_.
4876 (Layout::get_output_section): Add is_relro, is_last_relro, and
4877 is_first_non_relro parameters. Change all callers.
4878 (Layout::choose_output_section): Likewise.
4879 (Layout::add_output_section_data): Likewise.
4880 (Layout::make_output_section): Likewise.
4881 (Layout::set_segment_offsets): Clear increase_relro when using a
4882 linker script.
4883 * layout.h (class Layout): Add increase_relro method. Add
4884 increase_relro_ field. Update declarations.
4885 * output.cc (Output_section::Output_section): Initialize
4886 is_last_relro_ and is_first_non_relro_.
4887 (Output_segment::add_output_section): Group relro sections is
4888 do_sort is true. Handle is_last_relro and is_first_non_relro.
4889 (Output_segment::maximum_alignment): Remove relro handling.
4890 (Output_segment::set_section_addresses): Add increase_relro
4891 parameter. Change all callers. Add initial alignment to align
4892 relro sections on separate page. Remove old relro handling.
4893 (Output_segment::set_section_list_addresses): Remove in_relro
4894 parameter. Change all callers.
4895 (Output_segment::set_offset): Add increase parameter. Change all
4896 callers. Remove old relro handling.
4897 * output.h (class Output_section): Add new methods: is_last_relro,
4898 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
4899 Add is_last_relro_ and is_first_non_relro_ fields.
4900 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
4901 Create separate .got.plt section. Call increase_relro.
4902 * x86_64.cc (Target_x86_64::got_section): Likewise.
4903 * testsuite/relro_script_test.t: Add .got.plt.
4904
f0ba79e2
ILT
4905 PR 10450
4906 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
4907 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
4908 (Layout::finalize): Call set_dynamic_symbol_size.
4909 (Layout::set_dynamic_symbol_size): New function.
4910 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
4911 set_dynamic_symbol_size.
4912
e8cd95c7
ILT
4913 PR 10450
4914 * output.h (class Output_section): Add is_entsize_zero_ field.
4915 * output.cc (Output_section::Output_section): Initialize
4916 is_entsize_zero_.
4917 (Output_section::set_entsize): If two different entsizes are
4918 requested, force it to zero.
4919 (Output_section::add_input_section): Set flags for .debug_str
4920 before updating section flags. Set entsize.
4921 (Output_section::update_flags_for_input_section): Set SHF_MERGE
4922 and SHF_STRING if all input sections have those flags.
4923
3e1b9a8a
RÁE
49242009-12-29 Rafael Espindola <espindola@google.com>
4925
4926 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
4927 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
4928 reporting.
3e1b9a8a 4929
3dcad376
ST
49302009-12-29 Sriraman Tallam <tmsriram@google.com>
4931
4932 * options.cc (General_options::parse_version): Allow -v to exit
4933 without an error if there is nothing to link.
4934
084e2665
ILT
49352009-12-29 Ian Lance Taylor <iant@google.com>
4936
4937 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
4938 using a version of gcc before 4.1.
4939 * configure: Rebuild.
4940
250acde3
CD
49412009-12-28 Chris Demetriou <cgd@google.com>
4942
4943 * attributes.cc (Output_attributes_section_data::do_write): Use
4944 std::vector::front rather than std::vector::data.
4945
99fff23b
ILT
49462009-12-28 Ian Lance Taylor <iant@google.com>
4947
4948 * symtab.h (class Symbol_table): Add enum Defined.
4949 * resolve.cc (Symbol_table::should_override): Add defined
4950 parameter. Change all callers. Test whether object is NULL
4951 before calling a method on it.
4952 (Symbol_table::report_resolve_problem): Add defined parameter.
4953 Change all callers.
4954 (Symbol_table::should_override_with_special): Likewise.
4955 * symtab.cc (Symbol_table::define_in_output_data): Add defined
4956 parameter. Change all callers.
4957 (Symbol_table::do_define_in_output_data): Likewise.
4958 (Symbol_table::define_in_output_segment): Likewise.
4959 (Symbol_table::do_define_in_output_segment): Likewise.
4960 (Symbol_table::define_as_constant): Likewise.
4961 (Symbol_table::do_define_as_constant): Likewise.
4962 * script.h (class Symbol_assignment): Add is_defsym parameter to
4963 constructor; change all callers.
4964 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
4965 parameter. Change all callers. Add is_defsym_ field.
4966 (class Parser_closure): Add parsing_defsym parameter to
4967 constructor; change all callers. Add parsing_defsym accessor
4968 function. Add parsing_defsym_ field.
4969
556bd683
ILT
49702009-12-28 Ian Lance Taylor <iant@google.com>
4971
4972 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 4973 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 4974
1782c879
ILT
49752009-12-23 Ian Lance Taylor <iant@google.com>
4976
4977 * i386.cc (Target_i386::do_calls_non_split): Recognize
4978 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
4979 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
4980 -fsplit-stack prologue when using %r11.
1782c879 4981
329ca2b1
ST
49822009-12-21 Sriraman Tallam <tmsriram@google.com>
4983
4984 * options.cc (General_options::parse_version): Make -v continue and do
4985 the link like GNU ld does.
4986
d675ff46
RÁE
49872009-12-17 Rafael Avila de Espindola <espindola@google.com>
4988
4989 * Makefile.am (CCFILES): Add timer.cc.
4990 (HFILES): Add timer.h.
4991 * configure.ac: Check for sysconf and times.
4992 * main.cc: include timer.h.
4993 (main): Use Timer instead of get_run_time.
4994 * timer.cc: New.
4995 * timer.h: New.
4996 * workqueue.cc: include timer.h.
4997 (Workqueue::find_and_run_task):
4998 Report user, sys and wall time.
4999 * Makefile.in: Regenerate.
5000 * config.in: Regenerate.
5001 * configure: Regenerate.
5002
d6344fb5
DK
50032009-12-16 Doug Kwan <dougkwan@google.com>
5004
5005 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5006 sections.
5007 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5008 relaxed input sections.
5009 * output.cc (Output_section::find_relaxed_input_section): Change
5010 return type to Output_relaxed_input_section pointer. Adjust code
5011 for new type of relaxed_input_section_map_.
5012 * output.h (Output_section::find_relaxed_input_section): Change
5013 return type to Output_relaxed_input_section pointer.
5014 (Output_section::Output_relaxed_input_section_by_input_section_map):
5015 New type.
5016 (Output_section::relaxed_input_section_map_): Change type to
5017 Output_section::Output_relaxed_input_section_by_input_section_map.
5018 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5019 input section.
5020
0e0d5469
ILT
50212009-12-15 Ian Lance Taylor <iant@google.com>
5022
5023 * layout.cc (Layout::create_shstrtab): Only write out after input
5024 sections if we are compressing debug sections.
5025
0649a889
ILT
50262009-12-15 Ian Lance Taylor <iant@google.com>
5027
5028 * archive.cc (Archive::add_symbols): Only look up a symbol without
5029 a version if there is, in fact, a version.
5030
2ea97941
ILT
50312009-12-14 Ian Lance Taylor <iant@google.com>
5032
5033 Revert -Wshadow changes, all changes from:
5034 2009-12-11 Doug Kwan <dougkwan@google.com>
5035 2009-12-11 Nick Clifton <nickc@redhat.com>
5036 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5037
b0eec2cc
DK
50382009-12-11 Doug Kwan <dougkwan@google.com>
5039
5040 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5041 due to -Wshadow.
5042 * attributes.cc (Object_attribute::size): Ditto.
5043 (Attributes_section_data::size): Ditto.
5044 (Attributes_section_data::Attributes_section_data): Ditto.
5045 (Output_attributes_section_data::do_write): Ditto.
5046 * attributes.h (Object_attribute::set_type): Ditto.
5047 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5048
91d6fa6a
NC
50492009-12-11 Nick Clifton <nickc@redhat.com>
5050
5051 * archive.cc: Fix shadowed variable warnings.
5052 * arm.cc: Likewise.
5053 * compressed_output.cc: Likewise.
5054 * compressed_output.h: Likewise.
5055 * configure: Likewise.
5056 * dwarf_reader.cc: Likewise.
5057 * dynobj.cc: Likewise.
5058 * dynobj.h: Likewise.
5059 * ehframe.cc: Likewise.
5060 * ehframe.h: Likewise.
5061 * errors.cc: Likewise.
5062 * expression.cc: Likewise.
5063 * fileread.cc: Likewise.
5064 * fileread.h: Likewise.
5065 * freebsd.h: Likewise.
5066 * i386.cc: Likewise.
5067 * icf.cc: Likewise.
5068 * incremental.h: Likewise.
5069 * layout.cc: Likewise.
5070 * layout.h: Likewise.
5071 * mapfile.cc: Likewise.
5072 * merge.cc: Likewise.
5073 * merge.h: Likewise.
5074 * object.cc: Likewise.
5075 * object.h: Likewise.
5076 * options.h: Likewise.
5077 * output.cc: Likewise.
5078 * output.h: Likewise.
5079 * parameters.cc: Likewise.
5080 * plugin.cc: Likewise.
5081 * powerpc.cc: Likewise.
5082 * reduced_debug_output.cc: Likewise.
5083 * reduced_debug_output.h: Likewise.
5084 * reloc.cc: Likewise.
5085 * reloc.h: Likewise.
5086 * resolve.cc: Likewise.
5087 * script-sections.cc: Likewise.
5088 * script.cc: Likewise.
5089 * script.h: Likewise.
5090 * sparc.cc: Likewise.
5091 * symtab.cc: Likewise.
5092 * symtab.h: Likewise.
5093 * target-select.cc: Likewise.
5094 * target-select.h: Likewise.
5095 * token.h: Likewise.
5096 * workqueue.cc: Likewise.
5097 * workqueue.h: Likewise.
5098 * x86_64.cc: Likewise.
5099
a0351a69
DK
51002009-12-10 Doug Kwan <dougkwan@google.com>
5101
5102 * arm.cc (attributes.h): New include.
5103 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5104 (Arm_relobj::~Arm_relobj): Delete object pointed by
5105 attributes_section_data_.
5106 (Arm_relobj::attributes_section_data): New method definition.
5107 (Arm_relobj::attributes_section_data_): New data member declaration.
5108 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5109 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5110 attributes_section_data_.
5111 (Arm_dynobj::attributes_section_data): New method definition.
5112 (Arm_dynobj::attributes_section_data_): New data member declaration.
5113 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5114 initialization value of may_use_blx_ to false.
5115 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5116 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5117 object attributes to compute results instead of hard-coding.
5118 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5119 Target_arm::get_secondary_compatible_arch,
5120 Target_arm::set_secondary_compatible_arch
5121 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5122 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5123 New method declarations.
5124 (Target_arm::get_aeabi_object_attribute): New method definition.
5125 (Target_arm::attributes_section_data_): New data member declaration.
5126 (read_arm_attributes_section): New template definition.
5127 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5128 (Arm_dynobj::do_read_symbols): Ditto.
5129 (Target_arm::do_finalize_sections): Merge attributes sections from
5130 input. Check for BLX use after attributes section merging.
5131 Fix __exidx_start and __exidx_end visibility. Create an
5132 .ARM.attributes section if necessary.
5133 (Target_arm::get_secondary_compatible_arch,
5134 Target_arm::set_secondary_compatible_arch,
5135 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5136 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5137 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5138 New method definitions.
5139
b59befec
ILT
51402009-12-09 Ian Lance Taylor <iant@google.com>
5141
5142 * plugin.cc (Plugin::load): Don't cast from void* to a function
5143 pointer.
5144
1276bc89
ILT
51452009-12-09 Ian Lance Taylor <iant@google.com>
5146
5147 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5148 information fields.
5149
2f2de248
L
51502009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5151
5152 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5153 Replace two_file_shared_1.so with two_file_shared_2.so.
5154 * testsuite/Makefile.in: Regenerated.
5155
4f787271
DK
51562009-12-08 Doug Kwan <dougkwan@google.com>
5157
5158 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5159 (HFILES): Add attributes.h and int_encoding.h.
5160 * Makefile.in: Regenerate.
5161 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5162 function definitions to int_encoding.cc
5163 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5164 prototypes to int_encoding.h
5165 * reduced_debug_output.cc (int_encoding.h): New include.
5166 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5167 function definitions to int_encoding.cc
5168 (insert_into_vector, read_from_pointer): Move template definitions to
5169 int_encoding.h
5170 * attributes.cc: New file.
5171 * attributes.h: New file.
5172 * int_encoding.cc: New file.
5173 * int_encoding.h: New file.
5174
20b52f1a
RÁE
51752009-12-07 Rafael Avila de Espindola <espindola@google.com>
5176
5177 PR gold/11055
5178 * incremental-dump.cc (dump_incremental_inputs): New.
5179 (main): Use dump_incremental_inputs.
5180
53d7974c
L
51812009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5182
5183 PR gold/10893
5184 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5185 checking elfcpp::STT_FUNC.
5186 (Target_i386::Relocate::relocate): Likewise.
5187 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5188
5189 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5190 symbols from shared libraries into normal FUNC symbols.
5191
5192 * symtab.h (Symbol): Add is_func and use it.
5193
05a352e6
DK
51942009-12-05 Doug Kwan <dougkwan@google.com>
5195
5196 * arm.cc (Target_arm::arm_info): Initialize new fields
5197 attributes_section and attributes_vendor.
5198 * i386.cc (Target_i386::i386_info): Same.
5199 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5200 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5201 fields attributes_section and attributes_vendor.
53d7974c 5202 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5203 * target.h (Target::attributes_section, Target::attributes_vendor,
5204 Target::is_attributes_section, Target::attribute_arg_type,
5205 Target::attributes_order): New method definitions.
5206 (Target::Target_info::attributes_section,
5207 Target::Target_info::attributes_vendor): New fields.
5208 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5209 virtual method definitions.
5210 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5211 attributes_section and attributes_vendor.
5212 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5213
f4e5969c
DK
52142009-12-05 Doug Kwan <dougkwan@google.com>
5215
5216 * arm.cc: Update comments about interworking and stub generation.
5217 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5218 considered as non-PIC.
5219 (Arm_relocate_functions::base_abs): Fix formatting.
5220 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5221 of function to use GOT entry address instead of offset.
5222 (Target_arm::Scan::global): Issue an error if a symbol would need a
5223 PLT does not get one because it is untyped. Remove code to create
5224 dynamic symbols for relative branches.
5225 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5226 takes unsigned integer instead of boolean.
5227
1abce4a6
L
52282009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5229
5230 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5231 (two_file_test_LDADD): Likewise.
5232 (common_test_1_LDADD): Likewise.
5233 (exception_test_LDADD) Likewise.
5234 (weak_test_LDADD): Likewise.
5235 (many_sections_test_LDADD): Likewise.
5236 (initpri1_LDADD): Likewise.
5237 (script_test_1_LDADD): Likewise.
5238 (script_test_2_LDADD): Likewise.
5239 (justsyms_LDADD): Likewise.
5240 (binary_test_LDADD): Likewise.
5241 (large_LDADD): Likewise.
5242 * testsuite/Makefile.in: Regenerated.
5243
adcf2816 52442009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5245
adcf2816
L
5246 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5247 (Symbol_table::override_with_special): Likewise.
5248 (Symbol_table::add_from_object): Likewise.
5249
28e67f5d
RÁE
52502009-12-04 Rafael Avila de Espindola <espindola@google.com>
5251
5252 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5253 Don't set the data_offset twice.
5254
ae10a101
RÁE
52552009-12-04 Rafael Avila de Espindola <espindola@google.com>
5256
5257 * testsuite/Makefile.in: Regenerate.
5258
f59f41f3
DK
52592009-12-03 Doug Kwan <dougkwan@google.com>
5260
5261 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5262 (Target_arm::do_finalize_sections): Add parameter for symbol table
5263 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5264 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5265 parameter for symbol table pointer.
5266 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5267 an additional parameter for a pointer to symbol table.
5268 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5269 parameter for a symbol table pointer.
5270 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5271 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5272 Ditto.
5273 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5274 parameter for a symbol table pointer.
5275
ca55d848
RÁE
52762009-12-03 Rafael Avila de Espindola <espindola@google.com>
5277
5278 * incremental.cc (Incremental_inputs_header)
5279 (Incremental_inputs_header_write, Incremental_inputs_entry)
5280 (Incremental_inputs_entry_write): Move ...
5281 * incremental.h (Incremental_inputs_header)
5282 (Incremental_inputs_header_write, Incremental_inputs_entry)
5283 (Incremental_inputs_entry_write): here.
5284
3aec4f9c
RÁE
52852009-12-02 Rafael Avila de Espindola <espindola@google.com>
5286
5287 * incremental.cc (make_sized_incremental_binary): Set the target.
5288 Error if it is incompatible.
5289 * output.h (Output_file): Add filename method.
5290
9c0ae74d
RÁE
52912009-12-02 Rafael Avila de Espindola <espindola@google.com>
5292
5293 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5294 from the get_* methods.
5295
a45500ae
RÁE
52962009-12-02 Rafael Avila de Espindola <espindola@google.com>
5297
5298 * incremental-dump.cc (main): Check that the offeset of a script is 0.
5299 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5300 Write 0 for the data_offset of scripts.
5301
325e6408
RÁE
53022009-12-02 Rafael Avila de Espindola <espindola@google.com>
5303
5304 * testsuite/Makefile.am: Add the incremental_test.sh test.
5305 * testsuite/incremental_test.sh: New.
5306 * testsuite/incremental_test_1.c: New.
5307 * testsuite/incremental_test_2.c: New.
5308
954c3e2e
RÁE
53092009-12-01 Rafael Avila de Espindola <espindola@google.com>
5310
5311 * incremental-dump.cc (main): Fix typos.
5312
f8086623
RÁE
53132009-11-27 Rafael Avila de Espindola <espindola@google.com>
5314
5315 PR gold/11025
5316 * incremental-dump.cc (main): Use llu to print 64 bit values.
5317
3b0dd6ac
L
53182009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
5319 H.J. Lu <hongjiu.lu@intel.com>
5320
5321 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
5322 $(LIBDL).
5323 (incremental_dump_LDADD): Likewise.
5324 * Makefile.in: Regenerated.
5325
a6d1ef57 53262009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 5327
a6d1ef57
DK
5328 Revert:
5329
5330 2009-11-25 Doug Kwan <dougkwan@google.com>
5331
5332 * arm.cc (Target_arm::Target_arm): Move method definition
5333 outside of class definition. Add code to handle
5334 --target1-rel, --target1-abs and --target2= options.
5335 (Target_arm::get_reloc_reloc_type): Change method to be
5336 non-static and const.
5337 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
5338 New data member declaration.
5339 (Target_arm::Scan::local, Target_arm::Scan::global,
5340 Target_arm::Relocate::relocate,
5341 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5342 Adjust call to Target_arm::get_real_reloc_type.
5343 (Target_arm::get_real_reloc_type): Use command line options
5344 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5345 * options.h (--target1-rel, --target1-abs, --target2): New
5346 ARM-only options.
5347
50aeb7d4
DK
53482009-11-25 Doug Kwan <dougkwan@google.com>
5349
5350 * arm.cc (Target_arm::Target_arm): Move method definition outside of
5351 class definition. Add code to handle --target1-rel, --target1-abs
5352 and --target2= options.
5353 (Target_arm::get_reloc_reloc_type): Change method to be non-static
5354 and const.
5355 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
5356 member declaration.
5357 (Target_arm::Scan::local, Target_arm::Scan::global,
5358 Target_arm::Relocate::relocate,
5359 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
5360 call to Target_arm::get_real_reloc_type.
5361 (Target_arm::get_real_reloc_type): Use command line options to
5362 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5363 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
5364 options.
5365
51938283
DK
53662009-11-25 Doug Kwan <dougkwan@google.com>
5367
5368 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
5369 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
5370 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
5371 formatting.
5372 (Arm_relocate_functions::thm_call): Replace body with a call to
5373 Arm_relocate_functions::thumb_branch_common.
5374 (Arm_relocate_functions::thm_jump24,
5375 Arm_relocate_functions::thm_xpc22): New method definitions.
5376 (Arm_relocate_functions::thumb_branch_common): New method definition.
5377 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
5378 operator.
5379 (Target_arm::Relocate::relocate): Adjust call to thm_call.
5380 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
5381
e2b8f3c4
RÁE
53822009-11-24 Rafael Avila de Espindola <espindola@google.com>
5383
5384 * Makefile.am: Build incremental-dump
5385 * Makefile.in: Regenerate.
5386 * incremental-dump.cc: New.
5387 * incremental.cc (Incremental_inputs_header_data,
5388 Incremental_inputs_entry_data): Move to incremental.h
5389 * incremental.h: (Incremental_inputs_header_data,
5390 Incremental_inputs_entry_data): Move from incremental.cc
5391
bcba9aec
RÁE
53922009-11-24 Rafael Avila de Espindola <espindola@google.com>
5393
5394 * incremental.cc (Incremental_inputs_header,
5395 Incremental_inputs_header_write, Incremental_inputs_entry,
5396 Incremental_inputs_entry_write): Add a typedef with the data type.
5397
7c3afe08
RÁE
53982009-11-24 Rafael Avila de Espindola <espindola@google.com>
5399
5400 * incremental.cc (Incremental_inputs_header,
5401 Incremental_inputs_header_write, Incremental_inputs_entry,
5402 Incremental_inputs_entry_write): Update comment about which
5403 type has the filed descriptions.
5404
d204b6e9
DK
54052009-11-15 Doug Kwan <dougkwan@google.com>
5406
5407 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
5408 (Arm_relocate_functions::arm_branch_common): Change method defintion
5409 in class definition to a method declaration and update list of formal
5410 parameters.
5411 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
5412 Arm_relocation_functions::jump24): Adjust call to
5413 Arm_relocate_functions::arm_branch_common. Update list of formal
5414 parameters.
5415 (Arm_relocate_functions::xpc25): New method definition.
5416 (Arm_relocate_functions::arm_branch_common): Move method defintion
5417 out from class definition. Use stubs for mode-switching and extending
5418 branch ranges.
5419 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
5420 specially. Change code to enable use of stubs in ARM branches.
5421
43d12afe
DK
54222009-11-10 Doug Kwan <dougkwan@google.com>
5423
5424 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
5425 in method declaration.
5426 (Target_arm::relocate_stub): New method declaration.
5427 (Target_arm::default_target): Change to return a pointer instead of
5428 a const reference.
5429 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
5430 Target_arm::default_target.
5431 (Arm_Relobj::do_relocate_sections): Remove options paramater in
5432 method definition.
5433 (Target_arm::relocate_section): Adjust view.
5434 (Target_arm::relocate_stub): New method definition.
5435
ac33a407
DK
54362009-11-10 Doug Kwan <dougkwan@google.com>
5437
5438 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
5439 a format warning.
5440 * incremental.cc (open_incremental_binary): Initialized local
5441 variables to avoid warnings.
5442 * object.cc (make_elf_object): Ditto.
5443 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
5444 a format warning.
e1df38aa 5445
88ee28e9
L
5446009-11-09 H.J. Lu <hongjiu.lu@intel.com>
5447
5448 PR gold/10930
5449 * testsuite/plugin_test.c: Include "config.h".
5450
2daedcd6
DK
54512009-11-09 Doug Kwan <dougkwan@google.com>
5452
5453 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
5454 (arm_symbol_value): Remove.
5455 (Arm_relocate_functions::arm_branch_common,
5456 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
5457 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
5458 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
5459 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
5460 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
5461 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
5462 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
5463 Arm_relocate_functions::thm_mobw_abs_nc,
5464 Arm_relocate_functions::thm_mov_abs,
5465 Arm_relocate_functions::movw_prel_nc,
5466 Arm_relocate_functions::thm_movt_abs,
5467 Arm_relocate_functions::movt_prel,
5468 Arm_relocate_functions::thm_movw_prel_nc,
5469 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
5470 (Target_arm::Relocate::relocate): Only decompose address into two
5471 parts if relocation type uses the thumb-bit and pass the actual
5472 bit instead of a flag indicating that the thumb-bit is used. Adjust
5473 calls to methods in Arm_relocate_functions for this change.
5474
1276bc89 54752009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
5476
5477 PR 10925
5478 * reloc.cc: Instantiate
5479 Sized_relobj::initialize_input_to_output_maps and
5480 Sized_relobj:free_input_to_output_maps.
5481
e53ad1b5
ILT
54822009-11-06 Ian Lance Taylor <iant@google.com>
5483
5484 PR 10876
5485 * defstd.cc (in_segment): Set only_if_ref true for "end".
5486
eb44217c
DK
54872009-11-06 Doug Kwan <dougkwan@google.com>
5488
5489 * arm.cc (class Reloc_stub): Correct a comment.
5490 (Target_arm::Target_arm): Initialize arm_input_section_map_.
5491 (Target_arm::scan_section_for_stubs): New method declaration.
5492 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
5493 Change methods from private to protected.
5494 (Target_arm::do_may_relax): New method definition.
5495 (Target_arm::do_relax, Target_arm::group_sections,
5496 Target_arm::scan_reloc_for_stub,
5497 Target_arm::scan_reloc_section_for_stubs): New method declarations.
5498 (Target_arm::arm_input_section_map_): New data member declaration.
5499 (Target_arm::scan_reloc_for_stub,
5500 Target_arm::scan_reloc_section_for_stubs,
5501 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
5502 Target_arm::do_relax): New method definitions.
5503
5d329b7d
ILT
55042009-11-06 Mikolaj Zalewski <mikolaj@google.com>
5505
5506 * configure.ac: Check for (struct stat)::st_mtim
5507 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
5508 * config.in: Regenerate.
5509 * configure: Regenerate.
5510
96a0d71b
ILT
55112009-11-05 Ian Lance Taylor <iant@google.com>
5512
5513 PR 10910
5514 * output.cc (Output_segment::add_output_section): Add missing
5515 return statement.
5516
594c8e5e
ILT
55172009-11-04 Ian Lance Taylor <iant@google.com>
5518
5519 PR 10880
5520 * object.h (class Object): Add is_needed and set_is_needed
5521 methods. Add is_needed_ field. Make bool fields into bitfields.
5522 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
5523 defined in a dynamic object and referenced by a regular object,
5524 set is_needed for the dynamic object.
5525 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
5526 if the file is marked with as_needed and it is not needed.
5527
22b127cc
ILT
55282009-11-04 Ian Lance Taylor <iant@google.com>
5529
5530 PR 10887
5531 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
5532 tags if data is discarded by linker script.
5533 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5534 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5535 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5536 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5537
f5c870d2
ILT
55382009-11-04 Ian Lance Taylor <iant@google.com>
5539
5540 * layout.cc (Layout::get_output_section): Add is_interp and
5541 is_dynamic_linker_section parameters. Change all callers.
5542 (Layout::choose_output_section): Likewise.
5543 (Layout::make_output_section): Likewise.
5544 (Layout::add_output_section_data): Add is_dynamic_linker_section
5545 parameter. Change all callers.
5546 * layout.h (class Layout): Update declarations.
5547 * output.h (class Output_section): Add is_interp, set_is_interp,
5548 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
5549 Add is_interp_, is_dynamic_linker_section_ fields. Change
5550 generate_code_fills_at_write_ to a bitfield.
5551 * output.cc (Output_section::Output_sections): Initialize new
5552 fields.
5553 (Output_segment::add_output_section): Add do_sort parameter.
5554 Change all callers.
5555
1ae4d23b
ILT
55562009-11-03 Ian Lance Taylor <iant@google.com>
5557
5558 PR 10860
5559 * options.h (class General_options): Add --warn-common.
5560 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
5561 merging two common symbols.
5562 (Symbol_table::should_override): Handle --warn-common when merging
5563 a common symbol with a defined symbol. Use report_resolve_problem
5564 for multiple definitions.
5565 (Symbol_table::report_resolve_problem): New function.
5566 * symtab.h (class Symbol_table): Declare report_resolve_problem.
5567
55da9579
DK
55682009-11-03 Doug Kwan <dougkwan@google.com>
5569
5570 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
5571 stub_factory_.
5572 (Target_arm::stub_factory): New method definition.
5573 (Target_arm::new_arm_input_section,
5574 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
5575 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 5576 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
5577 New type definitions.
5578 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
5579 member declarations.
5580 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
5581 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
5582 New method definitions.
5583
37a9ac43
ILT
55842009-11-03 Ian Lance Taylor <iant@google.com>
5585
5586 * options.h (class General_options): Add --warn_constructors.
5587
b3d6a3d4
ILT
55882009-11-03 Ian Lance Taylor <iant@google.com>
5589
5590 PR 10893
5591 * defstd.cc (in_section): Add entries for __rel_iplt_start,
5592 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
5593
934b01dd
ILT
55942009-11-03 Ian Lance Taylor <iant@google.com>
5595
5596 PR 10895
5597 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
5598 --msgid-bugs-address.
5599 (install-pdf): New target.
5600 (install-data_yes): Look up one directory to find mkinstalldirs.
5601
03c1939b
L
56022009-11-03 H.J. Lu <hongjiu.lu@intel.com>
5603
5604 * po/Make-in (.po.gmo): Don't generate .gmo files in source
5605 tree.
5606
ebd95253
DK
56072009-10-30 Doug Kwan <dougkwan@google.com>
5608
5609 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
5610
e9bbb538
DK
56112009-10-30 Doug Kwan <dougkwan@google.com>
5612
5613 * arm.cc (Stub_addend_reader): New struct template definition
5614 and partial specializations.
5615 (Stub_addend_reader::operator()): New method definition for a
5616 partially specialized template.
5617
d5b40221
DK
56182009-10-30 Doug Kwan <dougkwan@google.com>
5619
5620 * arm.cc (Arm_relobj::processor_specific_flags): New method
5621 definition.
5622 (Arm_relobj::do_read_symbols): New method declaration.
5623 (Arm_relobj::processor_specific_flags_): New data member declaration.
5624 (Arm_dynobj): New class definition.
5625 (Target_arm::do_finalize_sections): Add input_objects parameter.
5626 (Target_arm::do_adjust_elf_header): New method declaration.
5627 (Target_arm::are_eabi_versions_compatible,
5628 (Target_arm::merge_processor_specific_flags): New method declaration.
5629 (Target_arm::do_make_elf_object): New overloaded method definitions
5630 and declaration.
5631 (Arm_relobj::do_read_symbols): New method definition.
5632 (Arm_dynobj::do_read_symbols): Ditto.
5633 (Target_arm::do_finalize_sections): Add input_objects parameters.
5634 Merge processor-specific flags from all input objects.
5635 (Target_arm::are_eabi_versions_compatible,
5636 Target_arm::merge_processor_specific_flags,
5637 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
5638 New method definitions.
5639 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
5640 Input_objects pointer type parameter.
5641 * layout.cc (Layout::finalize): Pass input objects to target's.
5642 finalize_sections function.
5643 * output.cc (Output_file_header::do_sized_write): Set ELF file
5644 header's processor-specific flags.
5645 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
5646 Input_objects pointer type parameter.
5647 * sparc.cc (Target_sparc::do_finalize_sections): Same.
5648 * target.h (Input_objects): New forward class declaration.
5649 (Target::processor_specific_flags,
5650 Target::are_processor_specific_flags_sect): New method definitions.
5651 (Target::finalize_sections): Add input_objects parameter.
5652 (Target::Target): Initialize processor_specific_flags_ and
5653 are_processor_specific_flags_set_.
5654 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
5655 parameter.
5656 (Target::set_processor_specific_flags): New method definition.
5657 (Target::processor_specific_flags_,
5658 Target::are_processor_specific_flags_set_): New data member
5659 declarations.
5660 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
5661 Input_objects pointer type parameter.
5662
ebabffbd
DK
56632009-10-30 Doug Kwan <dougkwan@google.com>
5664
5665 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
5666
ad0f2072
ILT
56672009-10-28 Ian Lance Taylor <iant@google.com>
5668
5669 * object.h (class Relobj): Drop options parameter from
5670 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
5671 do_scan_relocs, do_relocate. Change all callers.
5672 (class Sized_relobj): Drop options parameters from
5673 do_gc_process_relocs, do_scan_relocs, do_relocate,
5674 do_relocate_sections, relocate_sections, emit_relocs_scan,
5675 emit_relocs_scan_reltype. Change all callers.
5676 (struct Relocate_info): Remove options field and all references to
5677 it.
5678 * reloc.h (class Read_relocs): Remove options constructor
5679 parameter and options_ field. Change all callers.
5680 (class Gc_process_relocs, class Scan_relocs): Likewise.
5681 (class Relocate_task): Likewise.
5682 * target-reloc.h (scan_relocs): Remove options parameter. Change
5683 all callers.
5684 (scan_relocatable_relocs): Likewise.
5685 * target.h (class Sized_target): Remove options parameter from
5686 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
5687 all callers.
5688 * gc.h (gc_process_relocs): Remove options parameter. Change all
5689 callers.
5690 * arm.cc: Update functions to remove options parameters.
5691 * i386.cc: Likewise.
5692 * powerpc.cc: Likewise.
5693 * sparc.cc: Likewise.
5694 * x86_64.cc: Likewise.
5695 * testsuite/testfile.cc: Likewise.
5696
8ffa3667
DK
56972009-10-28 Doug Kwan <dougkwan@google.com>
5698
5699 * arm.cc (Arm_relobj): New class definition.
e1df38aa 5700 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
5701 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
5702 New method definitions.
5703
40f36857
CC
57042009-10-28 Cary Coutant <ccoutant@google.com>
5705
5706 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
5707 (Plugin::cleanup_done_): New member.
5708 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
5709 (Plugin_manager::cleanup_done_): Remove.
5710 (Plugin_manager::add_input_file): Edit error message.
5711 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
5712 (Plugin_manager::cleanup): Remove use of cleanup_done_.
5713
2c849493
ILT
57142009-10-27 Mikolaj Zalewski <mikolajz@google.com>
5715
5716 * fileread.cc: (File_read::View::~View): Use the new
5717 data_ownership_ filed.
5718 (File_read::~File_read): Dispose the new whole_file_view_.
5719 (File_read::open): Mmap the whole file if needed.
5720 (File_read::open): Use whole_file_view_ instead of contents_.
5721 (File_read::find_view): Use whole_file_view_ if applicable.
5722 (File_read::do_read): Use whole_file_view_ instead of contents_.
5723 (File_read::make_view): Use whole_file_view_ instead of contents_,
5724 update File_read::View::View call.
5725 (File_read::find_or_make_view): Update File_read::View::View
5726 call.
5727 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
5728 remove contents_
5729 (File_read::View::Data_ownership): New enum.
5730 (File_read::View::View): Replace bool mapped_ with Data_ownership
5731 argument.
5732 (File_read::View::mapped_): Remove (replaced by data_ownership_).
5733 (File_read::View::data_ownership_): New field.
5734 (File_read::contents_): Remove (replaced by whole_file_view_).
5735 (File_read::whole_file_view_): New field.
5736 * options.h (class General_options): Add --keep-files-mapped.
5737
24998053
CC
57382009-10-27 Cary Coutant <ccoutant@google.com>
5739
5740 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
5741 * testsuite/Makefile.am (plugin_test_5): New test case.
5742 * testsuite/Makefile.in: Regenerate.
5743
72adc4fa
DK
57442009-10-25 Doug Kwan <dougkwan@google.com>
5745
5746 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
5747 from private to protected to allow access by child class.
5748 (Sized_relobj::do_relocate_sections): New method declaration.
5749 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 5750 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
5751 Sized_relobj::relocate_sections. Instantiate template explicitly
5752 for different target sizes and endianity.
5753
07f508a2
DK
57542009-10-24 Doug Kwan <dougkwan@google.com>
5755
5756 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
5757 (Arm_input_section::as_arm_input_section): New method.
5758 (Arm_output_section): New class definition.
5759 (Arm_output_section::create_stub_group,
5760 Arm_output_section::group_sections): New method definitions.
5761
10ad9fe5
DK
57622009-10-22 Doug Kwan <dougkwan@google.com>
5763
5764 * arm.cc (Arm_input_section): New class definition.
5765 (Arm_input_section::init, Arm_input_section:do_write,
5766 Arm_input_section::set_final_data_size,
5767 Arm_input_section::do_reset_address_and_file_offset): New method
5768 definitions.
5769
56ee5e00
DK
57702009-10-21 Doug Kwan <dougkwan@google.com>
5771
5772 * arm.cc (Stub_table, Arm_input_section): New forward class
5773 declarations.
5774 (Stub_table): New class defintion.
5775 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
5776 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
5777 New method definition.
5778
b569affa
DK
57792009-10-21 Doug Kwan <dougkwan@google.com>
5780
5781 * arm.cc: Update copyright comments.
5782 (Target_arm): New forward class template declaration.
5783 (Arm_address): New type.
5784 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
5785 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
5786 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
5787 constants.
5788 (Insn_template): Same.
5789 (DEF_STUBS): New macro.
5790 (Stub_type): New enum type.
5791 (Stub_template): New class definition.
5792 (Stub): Same.
5793 (Reloc_stub): Same.
5794 (Stub_factory): Same.
5795 (Target_arm::Target_arm): Initialize may_use_blx_ and
5796 should_force_pic_veneer_.
5797 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
5798 Target_arm::should_force_pic_veneer,
5799 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
5800 Target_arm::using_thumb_only, Target_arm:;default_target): New
5801 method defintions.
5802 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
5803 New data member declarations.
5804 (Insn_template::size, Insn_template::alignment): New method defintions.
5805 (Stub_template::Stub_template): New method definition.
5806 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
5807 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
5808 (Stub_factory::Stub_factory): New method definition.
5809 * gold.h (string_hash): New template.
5810 * output.h (Input_section_specifier::hash_value): Use
5811 gold::string_hash.
5812 (Input_section_specifier::string_hash): Remove.
5813 * stringpool.cc (Stringpool_template::string_hash): Use
5814 gold::string_hash.
5815
6c172549
DK
58162009-10-20 Doug Kwan <dougkwan@google.com>
5817
5818 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
5819 symbols of relaxed input sections.
5820 * output.h (Output_section::find_relaxed_input_section): Make
5821 method public.
5822
c5617f2f
DK
58232009-10-16 Doug Kwan <dougkwan@google.com>
5824
5825 * dynobj.cc (Versions::Versions): Initialize version_script_.
5826 Only insert base version symbol definition for a shared object
5827 if version script defines any version versions.
5828 (Versions::define_base_version): New method definition.
5829 (Versions::add_def): Check that base version is not needed.
5830 (Versions::add_need): Define base version lazily.
5831 * dynobj.h (Versions::define_base_version): New method declaration.
5832 (Versions::needs_base_version_): New data member declaration.
5833 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
5834 (check_DATA): Add no_version_test.stdout.
5835 (libno_version_test.so, no_version_test.o no_version_test.stdout):
5836 New make rules.
5837 * testsuite/Makefile.in: Regenerate.
5838 * testsuite/no_version_test.c: New file.
5839 * testsuite/no_version_test.sh: Ditto.
5840
3c12dcdb
DK
58412009-10-16 Doug Kwan <dougkwan@google.com>
5842
5843 * expression.cc (class Segment_start_expression): New class definition.
5844 (Segment_start_expression::value): New method definition.
5845 (script_exp_function_segment_start): Return a new
5846 Segment_start_expression.
5847 * gold/script-c.h (script_saw_segment_start_expression): New function
5848 prototype.
5849 * script-sections.cc (Script_sections::Script_sections): Initialize
5850 SAW_SEGMENT_START_EXPRESSION_ to false.
5851 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
5852 and -Tbbs options to specify section addresses if given in
5853 command line and no SEGMENT_START expression is seen in a script.
5854 * script-sections.h (Script_sections::saw_segment_start_expression,
5855 Script_sections::set_saw_segment_start_expression): New method
5856 definition.
5857 (Script_sections::saw_segment_start_expression_): New data member
5858 declaration.
5859 * script.cc (script_saw_segment_start_expression): New function.
5860 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
5861 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
5862 script_test_7.sh and script_test_8.sh.
5863 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
5864 script_test_8.stdout.
5865 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
5866 (script_test_6, script_test_6.stdout, script_test_7,
5867 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
5868 * Makefile.in: Regenerate.
5869 * testsuite/script_test_6.sh: New file.
5870 * testsuite/script_test_6.t: Same.
5871 * testsuite/script_test_7.sh: Same.
5872 * testsuite/script_test_7.t: Same.
5873 * testsuite/script_test_8.sh: Same.
5874
64b1ae37
DK
58752009-10-16 Doug Kwan <dougkwan@google.com>
5876
5877 * output.cc (Output_segment::set_section_list_address): Cast
5878 expressions to unsigned long long type to avoid format warnings.
5879
661be1e2
ILT
58802009-10-15 Ian Lance Taylor <iant@google.com>
5881
12edd763 5882 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 5883 dot assignment to script_sections_.
12edd763
ILT
5884 * script-sections.cc (Script_sections::add_dot_assignment):
5885 Initialize if necessary.
5886
68b6574b
ILT
5887 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
5888 program headers with no load segment if there is a linker script.
5889
661be1e2
ILT
5890 * layout.cc (Layout::set_segment_offsets): Align the file offset
5891 to the segment aligment for -N or -n with no load segment.
5892 * output.cc (Output_segment::add_output_section): Don't crash if
5893 the first section is a TLS section.
5894 (Output_segment::set_section_list_addresses): Print an error
5895 message if the address moves backward in a linker script.
5896 * script-sections.cc
5897 (Output_section_element_input::set_section_addresses): Don't
5898 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
5899 (Orphan_output_section::set_section_addresses): Likewise.
5900
f15f61a7
DK
59012009-10-15 Doug Kwan <dougkwan@google.com>
5902
5903 * layout.cc (Layout::finish_dynamic_section): Generate tags
5904 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
5905 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
5906 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
5907
82bb573a
ILT
59082009-10-14 Ian Lance Taylor <iant@google.com>
5909
5910 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
5911 fields.
5912 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
5913 data_shdr fields of relinfo.
5914 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
5915 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
5916 R_386_TLS_LDO_32, adjust based on section flags.
5917 (Target_i386::Relocate::fix_up_ldo): Remove.
5918
374ad285
ILT
59192009-10-13 Ian Lance Taylor <iant@google.com>
5920
5921 Add support for -pie.
5922 * options.h (class General_options): Add -pie and
5923 --pic-executable.
5924 (General_options::output_is_position_independent): Test -pie.
5925 (General_options::output_is_executable): Return true if not shared
5926 and not relocatable.
5927 (General_options::output_is_pie): Remove.
5928 * options.cc (General_options::finalize): Reject incompatible uses
5929 of -pie.
5930 * gold.cc (queue_middle_tasks): A -pie link is not static.
5931 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
5932 * symtab.cc (Symbol::final_value_is_known): Return false if
5933 output_is_position_independent.
5934 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
5935 output_is_position_independent.
5936 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
5937 output_is_position_independent.
5938 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
5939 output_is_position_independent.
5940 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
5941 two_file_pie_test.
5942 (basic_pie_test.o, basic_pie_test): New targets.
5943 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
5944 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
5945 (two_file_pie_test): New target.
5946 * testsuite/Makefile.in: Rebuild.
5947 * README: Remove note saying that -pie is not supported.
5948
c6585162
ILT
59492009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
5950
5951 * options.h (class General_options): Add -init and -fini.
5952 * layout.cc (Layout::finish_dynamic_section): Emit
5953 given init and fini functions.
5954
032ce4e9
ST
59552009-10-13 Sriraman Tallam <tmsriram@google.com>
5956
5957 * gc.h (gc_process_relocs): Check if icf is enabled using new
5958 function.
5959 * gold.cc (queue_initial_tasks): Likewise.
5960 (queue_middle_tasks): Likewise.
5961 * object.cc (do_layout): Likewise.
5962 * symtab.cc (is_section_folded): Likewise.
5963 * main.cc (main): Likewise.
5964 * reloc.cc (Read_relocs::run): Likewise.
5965 (Sized_relobj::do_scan_relocs): Likewise.
5966 * icf.cc (is_function_ctor_or_dtor): New function.
5967 (Icf::find_identical_sections): Check if function is ctor or dtor when
5968 safe icf is chosen.
5969 * options.h (General_options::icf): Change option to be an enum.
5970 (Icf_status): New enum.
5971 (icf_enabled): New method.
5972 (icf_safe_folding): New method.
5973 (set_icf_status): New method.
5974 (icf_status_): New variable.
5975 * (options.cc) (General_options::finalize): Set icf_status_.
5976 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
5977 icf_test and icf_keep_unique_test to use the --icf enum flag.
5978 * testsuite/icf_safe_test.sh: New file.
e1df38aa 5979 * testsuite/icf_safe_test.cc: New file.
032ce4e9 5980
f345227a
ST
59812009-10-12 Sriraman Tallam <tmsriram@google.com>
5982
5983 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
5984 includes to gc.h and icf.h.
5985 * arm.cc: Include gc.h.
5986 * gold.cc: Likewise.
5987 * i386.cc: Likewise.
5988 * powerpc.cc: Likewise.
5989 * sparc.cc: Likewise.
5990 * x86_64.cc: Likewise.
5991 * gc.h: Include icf.h.
5992
1c7814ed
ILT
59932009-10-11 Ian Lance Taylor <iant@google.com>
5994
5995 * plugin.cc: Include "gold.h" before other header files.
5996
ae3b5189
CD
59972009-10-10 Chris Demetriou <cgd@google.com>
5998
5999 * options.h (Input_file_argument::Input_file_type): New enum.
6000 (Input_file_argument::is_lib_): Replace with...
6001 (Input_file_argument::type_): New member.
6002 (Input_file_argument::Input_file_argument): Take Input_file_type
6003 'type' rather than boolean 'is_lib' as second argument.
6004 (Input_file_argument::is_lib): Use type_.
6005 (Input_file_argument::is_searched_file): New function.
6006 (Input_file_argument::may_need_search): Handle is_searched_file.
6007 * options.cc (General_options::parse_library): Support -l:filename.
6008 (General_options::parse_just_symbols): Update for Input_file_argument
6009 changes.
6010 (Command_line::process): Likewise.
6011 * archive.cc (Archive::get_file_and_offset): Likewise.
6012 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6013 * script.cc (read_script_file, script_add_file): Likewise.
6014 * fileread.cc (Input_file::Input_file): Likewise.
6015 (Input_file::will_search_for): Handle is_searched_file.
6016 (Input_file::open): Likewise.
6017 * readsyms.cc (Read_symbols::get_name): Likewise.
6018 * testsuite/Makefile.am (searched_file_test): New test.
6019 * testsuite/Makefile.in: Regenerate.
6020 * testsuite/searched_file_test.cc: New file.
6021 * testsuite/searched_file_test_lib.cc: New file.
6022
f3048a1d
ILT
60232009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6024 Ian Lance Taylor <iant@google.com>
6025
6026 * descriptor.cc: Include <cstdio> and "binary-io.h".
6027 (Descriptors::open): Open the files in binary mode always.
6028 * script.cc (Lex::get_token): Treat \r as whitespace.
6029
d4780e57
ILT
60302009-10-09 Ian Lance Taylor <iant@google.com>
6031
6032 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6033
d9a893b8
ILT
60342009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6035 Ian Lance Taylor <iant@google.com>
6036
6037 * configure.ac: Check for readv function also.
6038 * fileread.cc (readv): Define if not HAVE_READV.
6039 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6040 does not exist.
6041 * config.in: Regenerate.
6042 * configure: Regenerate.
6043
c0a62865
DK
60442009-10-09 Doug Kwan <dougkwan@google.com>
6045
6046 * layout.cc (Layout::make_output_section): Call target hook to make
6047 ordinary output section.
6048 (Layout::finalize): Adjust parameter list of call the
6049 Target::may_relax().
6050 * layout.h (class Layout::section_list): New method.
6051 * merge.h (Output_merge_base::entsize): Change visibility to public.
6052 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6053 New methods.
6054 (Output_merge_string::do_is_string): New method.
6055 * object.cc (Sized_relobj::do_setup): renamed from
6056 Sized_relobj::set_up.
6057 * object.h (Sized_relobj::adjust_shndx,
6058 Sized_relobj::initializ_input_to_output_maps,
6059 Sized_relobj::free_input_to_output_maps): Change visibilities to
6060 protected.
6061 (Sized_relobj::setup): Virtualize.
6062 (Sized_relobj::do_setup): New method declaration.
6063 (Sized_relobj::invalidate_section_offset,
6064 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6065 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6066 * options.cc (parse_int): New function.
6067 * options.h (parse_int): New declaration.
6068 (DEFINE_int): New macro.
6069 (stub_group_size): New option.
6070 * output.cc (Output_section::Output_section): Initialize memebers
6071 merge_section_map_, merge_section_by_properties_map_,
6072 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6073 (Output_section::add_input_section): Handled deferred code-fill
6074 generation and remove an old comment.
6075 (Output_section::add_relaxed_input_section): New method definition.
6076 (Output_section::add_merge_input_section): Use merge section by
6077 properties map to speed to search. Update merge section maps
6078 as appropriate.
6079 (Output_section::build_relaxation_map): New method definition.
6080 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6081 Same.
6082 (Output_section::relax_input_section): Renamed to
6083 Output_section::convert_input_sections_to_relaxed_sections and change
6084 interface to take a vector of pointers to relaxed sections.
6085 (Output_section::find_merge_section,
6086 Output_section::find_relaxed_input_section): New method definitions.
6087 (Output_section::is_input_address_mapped,
6088 Output_section::output_offset, Output_section::output_address):
6089 Use output section data maps to speed up searching.
6090 (Output_section::find_starting_output_address): Add comments.
6091 (Output_section::do_write,
6092 Output_section::write_to_postprocessing_buffer): Do code-fill
6093 generation as appropriate.
6094 (Output_section::get_input_sections): Invalidate relaxed input section
6095 map.
6096 (Output_section::restore_states): Adjust type of checkpoint .
6097 Invalidate relaxed input section map.
6098 * output.h (Output_merge_base): New class declaration.
6099 (Input_section_specifier): New class defintion.
6100 (class Output_relaxed_input_section) Change base class to
6101 Output_section_data_build.
6102 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6103 base class initializer.
6104 (Output_section::add_relaxed_input_section): New method declaration.
6105 (Output_section::Input_section): Change visibility to protected.
6106 (Output_section::Input_section::relobj,
6107 Output_section::Input_section::shndx): Handle relaxed input sections.
6108 Output_section::input_sections) Change visibility to protected. Also
6109 define overload to return a non-const pointer.
6110 (Output_section::Merge_section_properties): New class defintion.
6111 (Output_section::Merge_section_by_properties_map,
6112 Output_section::Output_section_data_by_input_section_map,
6113 Output_section::Relaxation_map): New types.
6114 (Output_section::relax_input_section): Rename method to
6115 Output_section::convert_input_sections_to_relaxed_sections and change
6116 interface to take a vector of relaxed section pointers.
6117 (Output_section::find_merge_section,
6118 Output_section::find_relaxed_input_section,
6119 Output_section::build_relaxation_map,
6120 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6121 New method declarations.
6122 (Output_section::merge_section_map_
6123 Output_section::merge_section_by_properties_map_,
6124 Output_section::relaxed_input_section_map_,
6125 Output_section::is_relaxed_input_section_map_valid_,
6126 Output_section::generate_code_fills_at_write_): New data members.
6127 * script-sections.cc
6128 (Output_section_element_input::set_section_addresses): Call
6129 current_data_size and addralign methods of relaxed input sections.
6130 (Orphan_output_section::set_section_addresses): Call current_data_size
6131 and addralign methods of relaxed input sections.
6132 * symtab.cc (Symbol_table::compute_final_value): Extract template
6133 from the body of Symbol_table::sized_finalize_symbol.
6134 (Symbol_table::sized_finalized_symbol): Call
6135 Symbol_table::compute_final_value.
6136 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6137 (Symbol_table::compute_final_value): New templated method declaration.
6138 * target.cc (Target::do_make_output_section): New method defintion.
6139 * target.h (Target::make_output_section): New method declaration.
6140 (Target::relax): Add more parameters for input objects, symbol table
6141 and layout. Adjust call to do_relax.
6142 (Target::do_make_output_section): New method declaration.
6143 (Target::do_relax): Add parameters for input objects, symbol table
6144 and layout.
6145
d446d6c4
ILT
61462009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6147
6148 * pread.c: Include stdio.h.
6149
bc06c745
ILT
61502009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6151
6152 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6153 defined.
6154
75aea3d0
ILT
61552009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6156
6157 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6158 Change read_shndx type to unsigned int.
6159 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6160 int.
6161 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6162 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6163 Change read_shndx type to unsigned int.
6164 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6165 int.
6166 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6167 * layout.cc (Layout::create_symtab_sections): Cast the result of
6168 local_symcount * symsize to off_t in the gold_assert.
6169
be8fcb75
ILT
61702009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6171
6172 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6173 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6174 R_ARM_BASE_ABS.
6175 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6176 (Arm_relocate_functions::thm_abs5): New function.
6177 (Arm_relocate_functions::abs12): New function.
6178 (Arm_relocate_functions::abs16): New function.
6179 (Arm_relocate_functions::base_abs): New function.
6180 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6181 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6182 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6183 R_ARM_BASE_ABS.
6184 (Scan::global): Likewise.
6185 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6186 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6187 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6188 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6189 R_ARM_BASE_ABS.
6190
c2a122b6
ILT
61912009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6192
6193 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6194 (Arm_relocate_functions::movt_prel): New function.
6195 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6196 (Arm_relocate_functions::thm_movt_prel): New function.
6197 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6198 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6199 (Scan::global, Relocate::relocate): Likewise.
6200 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6201
c4aa1e2d
ILT
62022009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6203
6204 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6205 Incremental_checker.
6206 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6207 unsigned int.
6208 (class Incremental_inputs_header): New class.
6209 (Incremental_inputs_header_writer): Edit comment.
6210 (Incremental_inputs_entry): New class.
6211 (Incremental_inputs_entry_writer): Edit comment.
6212 (Sized_incremental_binary::do_find_incremental_inputs_section):
6213 Add *strtab_shndx parameter, fill it.
6214 (Sized_incremental_binary::do_check_inputs): New method.
6215 (Incremental_checker::can_incrementally_link_output_file): Use
6216 Sized_incremental_binary::check_inputs.
6217 (Incremental_inputs::report_command_line): Save command line in
6218 command_line_.
6219 * incremental.h:
6220 (Incremental_binary::find_incremental_inputs_section): New
6221 method.
6222 (Incremental_binary::do_find_incremental_inputs_section): Add
6223 strtab_shndx parameter.
6224 (Incremental_binary::do_check_inputs): New pure virtual method.
6225 (Sized_incremental_binary::do_check_inputs): Declare.
6226 (Incremental_checker::Incremental_checker): Add incremental_inputs
6227 parameter, use it to initialize incremental_inputs_.
6228 (Incremental_checker::incremental_inputs_): New field.
6229 (Incremental_checker::command_line): New method.
6230 (Incremental_checker::inputs): New method.
6231 (Incremental_checker::command_line_): New field.
6232
c549a694
ILT
62332009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6234
6235 * incremental.cc: Include <cstdarg> and "target-select.h".
6236 (vexplain_no_incremental): New function.
6237 (explain_no_incremental): New function.
6238 (Incremental_binary::error): New method.
6239 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6240 method.
6241 (make_sized_incremental_binary): New function.
6242 (open_incremental_binary): New function.
6243 (can_incrementally_link_file): Add checks if output is ELF and has
6244 inputs section.
6245 * incremental.h: Include "elfcpp_file.h" and "output.h".
6246 (Incremental_binary): New class.
6247 (Sized_incremental_binary): New class.
6248 (open_incremental_binary): Declare.
6249 * object.cc (is_elf_object): Use
6250 elfcpp::Elf_recognizer::is_elf_file.
6251 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6252 * output.h (Output_file::filesize): New method.
6253
fd3c5f0b
ILT
62542009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6255
6256 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6257 New function.
6258 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6259 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6260 function.
6261 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6262 function.
6263 (Arm_relocate_functions::movw_abs_nc): New function.
6264 (Arm_relocate_functions::movt_abs): New function.
6265 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6266 (Arm_relocate_functions::thm_movt_abs): New function.
6267 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6268 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6269 (Scan::global): Likewise.
6270 (Relocate::relocate): Likewise.
6271 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6272
7f5309a5
ILT
62732009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6274
6275 * arm.cc (Arm_relocate_functions::got_prel) New function.
6276 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6277 (Relocate::relocate): Likewise.
6278 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6279
364c7fa5
ILT
62802009-10-06 Ian Lance Taylor <iant@google.com>
6281
6282 * options.h (class General_options): Define
6283 split_stack_adjust_size parameter.
6284 * object.h (class Object): Add uses_split_stack_ and
6285 has_no_split_stack_ fields. Add uses_split_stack and
6286 has_no_split_stack accessor functions. Declare
6287 handle_split_stack_section.
6288 (class Reloc_symbol_changes): Define.
6289 (class Sized_relobj): Define Function_offsets. Declare
6290 split_stack_adjust, split_stack_adjust_reltype, and
6291 find_functions.
6292 * object.cc (Object::handle_split_stack_section): New function.
6293 (Sized_relobj::do_layout): Call handle_split_stack_section.
6294 * dynobj.cc (Sized_dynobj::do_layout): Call
6295 handle_split_stack_section.
6296 * reloc.cc (Sized_relobj::relocate_sections): Call
6297 split_stack_adjust for executable sections in split_stack
6298 objects. Pass reloc_map to relocate_section.
6299 (Sized_relobj::split_stack_adjust): New function.
6300 (Sized_relobj::split_stack_adjust_reltype): New function.
6301 (Sized_relobj::find_functions): New function.
6302 * target-reloc.h: Include "object.h".
6303 (relocate_section): Add reloc_symbol_changes parameter. Change
6304 all callers.
6305 * target.h (class Target): Add calls_non_split method. Declare
6306 do_calls_non_split virtual method. Declare match_view and
6307 set_view_to_nop.
6308 * target.cc: Include "elfcpp.h".
6309 (Target::do_calls_non_split): New function.
6310 (Target::match_view): New function.
6311 (Target::set_view_to_nop): New function.
6312 * gold.cc (queue_middle_tasks): Give an error if mixing
6313 split-stack and non-split-stack objects with -r.
6314 * i386.cc (Target_i386::relocate_section): Add
6315 reloc_symbol_changes parameter.
6316 (Target_i386::do_calls_non_split): New function.
6317 * x86_64.cc (Target_x86_64::relocate_section): Add
6318 reloc_symbol_changes parameter.
6319 (Target_x86_64::do_calls_non_split): New function.
6320 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
6321 parameter.
6322 * powerpc.cc (Target_powerpc::relocate_section): Add
6323 reloc_symbol_changes parameter.
6324 * sparc.cc (Target_sparc::relocate_section): Add
6325 reloc_symbol_changes parameter.
6326 * configure.ac: Call AM_CONDITIONAL for the default target.
6327 * configure: Rebuild.
6328 * testsuite/Makefile.am (TEST_AS): New variable.
6329 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
6330 (check_DATA): Add split_i386 and split_x86_64 files.
6331 (SPLIT_DEFSYMS): Define.
6332 (split_i386_[1234n].o): New targets.
6333 (split_i386_[124]): New targets.
6334 (split_i386_[1234r].stdout): New targets.
6335 (split_x86_64_[1234n].o): New targets.
6336 (split_x86_64_[124]): New targets.
6337 (split_x86_64_[1234r].stdout): New targets.
6338 (MOSTLYCLEANFILES): Add new executables.
6339 * testsuite/split_i386.sh: New file.
6340 * testsuite/split_x86_64.sh: New file.
6341 * testsuite/split_i386_1.s: New file.
6342 * testsuite/split_i386_2.s: New file.
6343 * testsuite/split_i386_3.s: New file.
6344 * testsuite/split_i386_4.s: New file.
6345 * testsuite/split_i386_n.s: New file.
6346 * testsuite/split_x86_64_1.s: New file.
6347 * testsuite/split_x86_64_2.s: New file.
6348 * testsuite/split_x86_64_3.s: New file.
6349 * testsuite/split_x86_64_4.s: New file.
6350 * testsuite/split_x86_64_n.s: New file.
6351 * testsuite/testfile.cc (Target_test): Update relocation_section
6352 function.
6353 * testsuite/Makefile.in: Rebuild.
6354
e8a9fcda
ILT
63552009-10-06 Ian Lance Taylor <iant@google.com>
6356
6357 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
6358 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
6359 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
6360 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
6361 the address on ldo_addrs_.
6362 (Target_i386::Relocate::fix_up_ldo): New function.
6363
e99daf92
ILT
63642009-10-06 Rafael Espindola <espindola@google.com>
6365
6366 * plugin.cc (add_input_library): New.
6367 (Plugin::load): Add add_input_library to tv.
6368 (Plugin_manager::add_input_file): Add the is_lib argument.
6369 (add_input_file): Update call to Plugin_manager::add_input_file.
6370 (add_input_library): New.
6371 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
6372
966d4097
DK
63732009-09-30 Doug Kwan <dougkwan@google.com>
6374
6375 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
6376 symbol and call Symbol::may_need_copy_reloc to determine if
6377 a copy reloc is needed.
6378 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
6379 nocopyreloc is given in command line.
6380 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
6381 given in command line.
6382 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
6383 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
6384 of the removed Target_i386::may_need_copy_reloc.
6385 * options.h (copyreloc): New option with default value false.
6386 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6387 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
6388 instead of the removed Target_powerpc::may_need_copy_reloc.
6389 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6390 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
6391 instead of the removed Target_sparc::may_need_copy_reloc.
6392 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
6393 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
6394 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
6395 instead of the removed Target_x86_64::may_need_copy_reloc.
6396
029ba973
ILT
63972009-09-30 Ian Lance Taylor <iant@google.com>
6398
6399 * object.h (class Object): Remove target_ field, and target,
6400 sized_target, and set_target methods.
6401 (Object::sized_target): Remove.
6402 (class Sized_relobj): Update declarations. Remove sized_target.
6403 * object.cc (Sized_relobj::setup): Remove target parameter.
6404 Change all callers.
6405 (Input_objects::add_object): Don't do anything with the target.
6406 (make_elf_sized_object): Add punconfigured parameter. Change all
6407 callers. Set or test parameter target.
6408 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
6409 Change all callers.
6410 * parameters.cc (Parameters::set_target): Change parameter type to
6411 be non-const.
6412 (Parameters::default_target): Remove.
6413 (set_parameters_target): Change parameter type to be non-const.
6414 (parameters_force_valid_target): New function.
6415 (parameters_clear_target): New function.
6416 * parameters.h (class Parameters): Update declarations. Remove
6417 default_target method. Add sized_target and clear_target
6418 methods. Change target_ to be non-const.
6419 (set_parameters_target): Update declaration.
6420 (parameters_force_valid_target): Declare.
6421 (parameters_clear_target): Declare.
6422 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
6423 as NULL if we aren't searching.
6424 (Add_symbols::run): Don't check for compatible target.
6425 * fileread.cc (Input_file::open_binary): Call
6426 parameters_force_valid_target.
6427 * gold.cc (queue_middle_tasks): Likewise.
6428 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
6429 set_target on object.
6430 * dynobj.h (class Sized_dynobj): Update declarations.
6431 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
6432 make_elf_object returns NULL.
6433 (Archive::include_member): Don't check whether object target is
6434 compatible.
6435 * output.cc (Output_section::add_input_section): Get target from
6436 parameters.
6437 (Output_section::relax_input_section): Likewise.
6438 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
6439 parameters.
6440 (Sized_relobj::do_scan_relocs): Likewise.
6441 (Sized_relobj::relocate_sections): Likewise.
6442 * resolve.cc (Symbol_table::resolve): Likewise.
6443 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
6444 parameter. Change all callers.
6445 (Symbol_table::add_from_object): Get target from parameters.
6446 (Symbol_table::add_from_relobj): Don't check object target.
6447 (Symbol_table::add_from_dynobj): Likewise.
6448 (Symbol_table::define_special_symbol): Get target from
6449 parameters.
6450 * symtab.h (class Symbol_table): Update declaration.
6451 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
6452 parameter. Change all callers. Clear parameter target.
6453 (Binary_test): Test target here.
6454 * testsuite/object_unittest.cc (gold_testsuite): Remove
6455 target_test_pointer parameter. Change all callers.
6456 (Object_test): Test target here.
6457
a6a22b83
ILT
64582009-09-26 Ian Lance Taylor <iant@google.com>
6459
6460 * testsuite/initpri1.c: Don't try to use constructor priorities if
6461 compiling with gcc before 4.3.
6462
6a8f49fe
ILT
64632009-09-22 Mikolaj Zalewski <mikolajz@google.com>
6464
6465 * testsuite/retain_symbols_file_test.sh (check_present): Change
6466 output file name to retain_symbols_file_test.stdout.
6467 (check_absent): Likewise.
6468
8c604651
CS
64692009-09-18 Craig Silverstein <csilvers@google.com>
6470
6471 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
6472 * options.cc: Include <cerrno> and <fstream>.
6473 (General_options::finalize): Parse -retain-symbols-file tag.
6474 * options.h: New flag.
6475 (General_options): New method should_retain_symbol, new
6476 variable symbols_to_retain.
6477 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
6478 should_retain_symbol map.
6479 * testsuite/Makefile.am (retain_symbols_file_test): New test.
6480 * testsuite/Makefile.in: Regenerate.
6481 * testsuite/retain_symbols_file_test.sh: New file.
6482
ca58b19f
NC
64832009-09-18 Nick Clifton <nickc@redhat.com>
6484
6485 * po/es.po: Updated Spanish translation.
6486
20e6d0d6
DK
64872009-09-17 Doug Kwan <dougkwan@google.com>
6488
6489 * debug.h (DEBUG_RELAXATION): New constant.
6490 (DEBUG_ALL): Add DEBUG_RELAXATION.
6491 (debug_string_to_enum): Add relaxation debug option.
6492 * layout.cc
6493 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
6494 Layout::Relaxation_debug_check::read_sections,
6495 Layout::Relaxation_debug_check::read_sections): New method definitions.
6496 (Layout::Layout): Initialize data members
6497 record_output_section_data_from_scrips_,
6498 script_output_section_data_list_ and relaxation_debug_check_.
6499 (Layout::save_segments, Layout::restore_segments,
6500 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6501 Layout::relaxation_loop_body): New method definitions.
6502 (Layout::finalize): Support relaxation. Move section layout code to
6503 Layout::relaxation_loop_body.
6504 (Layout::set_asection_address_from_script): Move code for orphan
6505 section placement out.
6506 (Layout::place_orphan_sections_in_script): New method definition.
6507 * layout.h (Output_segment_headers, Output_file_header):
6508 New forward class declarations.
6509 (Layout::~Layout): Define.
6510 (Layout::new_output_section_data_from_script): New method definition.
6511 (Layout::place_orphan_sections_in_script): New method declaration.
6512 (Layout::Segment_states): New type declaration.
6513 (Layout::save_segments, Layout::restore_segments,
6514 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6515 Layout::relaxation_loop_body): New method declarations.
6516 (Layout::Output_section_data_list): New type declaration.
6517 (Layout::Relaxation_debug_check): New class definition.
6518 (Layout::record_output_section_data_from_script_,
6519 Layout::script_output_section_data_list_, Layout::segment_states_,
6520 Layout::relaxation_debug_check_): New data members.
6521 * output.cc: (Output_section_headers::do_size): New method definition.
6522 (Output_section_headers::Output_section_headers): Move size
6523 computation to Output_section_headers::do_size.
6524 (Output_segment_headers::do_size): New method definition.
e1df38aa 6525 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
6526 Output_file_header::do_size and call it.
6527 (Output_file_header::do_size): New method definition.
6528 (Output_data_group::Output_data_group): Adjust call to
6529 Output_section_data.
6530 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
6531 (Output_symtab_xindex::do_write): Add array bound check.
6532 (Output_section::Input_section::print_to_mapfile): Handle
6533 RELAXED_INPUT_SECTION_CODE.
6534 (Output_section::Output_section): Initialize data member checkpoint_.
6535 (Output_section::~Output_section): Delete checkpoint object pointed
6536 by checkpoint_.
6537 (Output_section::add_input_section): Always add an Input_section if
6538 relaxing.
6539 (Output_section::add_merge_input_section): Add assert.
6540 (Output_section::relax_input_section): New method definition.
6541 (Output_section::set_final_data_size): Set load address to zero for
6542 an unallocated section.
6543 (Output_section::do_address_and_file_offset_have_reset_values):
6544 New method definition.
6545 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
6546 Handle relaxed input section.
6547 (Output_section::sort_attached_input_sections): Checkpoint input
6548 section list lazily.
6549 (Output_section::get_input_sections): Change type of input_sections to
6550 list of Simple_input_section pointers. Checkpoint input section list
6551 lazily. Also handle relaxed input sections.
6552 (Output_section::add_input_section_for_script): Take a reference to
6553 a Simple_input_section object instead of Relobj pointer and section
6554 index as parameter. Handle relaxed input sections.
6555 (Output_section::save_states, Output_section::restore_states): New
6556 method definitions.
6557 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
6558 (Output_data::is_data_size_fixed): New method definition.
6559 (Output_data::reset_addresss_and_file_offset): Do not reset data size
6560 if it is fixed.
6561 (Output_data::address_and_file_offset_have_reset_values): New method
6562 definition.
6563 (Output_data::do_address_and_file_offset_have_reset_values): New method
6564 definition.
6565 (Output_data::set_data_size): Check that data size is not fixed.
6566 (Output_data::fix_data_size): New method definition.
6567 (Output_data::is_data_size_fixed_): New data member.
6568 (Output_section_headers::set_final_data_size): New method definition.
6569 (Output_section_headers::do_size): New method declaration.
6570 (Output_segment_headers::set_final_data_size): New method definition.
6571 (Output_segment_headers::do_size): New method declaration.
6572 (Output_file_header::set_final_data_size)::New method definition.
6573 (Output_file_header::do_size)::New method declaration.
6574 (Output_section_data::Output_section_data): Add new parameter
6575 is_data_size_fixed and use it to fix data size.
6576 (Output_data_const::Output_data_const): Adjust call to base class
6577 constructor and fix data size.
6578 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
6579 base class constructor and fix data size.
6580 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
6581 base class constructor and fix data size.
6582 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
6583 class constructor and fix data size.
6584 (Output_data_group::set_final_data_size): New method definition.
6585 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
6586 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
6587 class constructor and fix data size.
6588 (Output_relaxed_input_section): New class definition.
6589 (Output_section::Simple_input_section): New class definition.
6590 (Output_section::get_input_sections): Adjust parameter list.
6591 (Output_section::add_input_section_for_script): Same.
6592 (Output_section::save_states, Output_section::restore_states,
6593 Output_section::do_address_and_file_offset_have_reset_values,
6594 (Output_section::Input_section::Input_section): Handle
6595 RELAXED_INPUT_SECTION_CODE. Add new overload for
6596 Output_relaxed_input_section.
6597 (Output_section::Input_section::is_input_section,
6598 Output_section::Input_section::set_output_section): Handle relaxed
6599 input section.
6600 (Output_section::Input_section::is_relaxed_input_section,
6601 Output_section::Input_section::output_section_data,
6602 Output_section::Input_section::relaxed_input_section): New method
6603 definitions.
6604 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
6605 value.
6606 (Output_section::Input_section::u1_): Update comments.
6607 (Output_section::Input_section::u2_): Add new union member poris.
6608 (Output_section::Checkpoint_output_section): New classs definition.
6609 (Output_section::relax_input_section): New method declaration.
6610 (Output_section::checkpoint_): New data member.
6611 (Output_segment): Update comments.
6612 (Output_segment::Output_segment): Un-privatize copy constructor.
6613 (Output_segment::operator=): Un-privatize.
6614 * script-sections.cc (Output_section_element::Input_section_list):
6615 Change element type to Output_section::Simple_input_section.
6616 (Output_section_element_dot_assignment::set_section_addresses):
6617 Register output section data for relaxation clean up.
6618 (Output_data_exression::Output_data_expression): Adjust call to base
6619 constructor to fix data size.
6620 (Output_section_element_data::set_section_addresses): Register
6621 Output_data_expression object for relaxation clean up.
6622 (struct Input_section_info): Replace Relobj pointer and section index
6623 pair with Output_section::Simple_input_section and Convert struct to a
6624 class.
6625 (Input_section_sorter::operator()): Adjust access to
e1df38aa 6626 Input_section_info data member to use accessors.
20e6d0d6
DK
6627 (Output_section_element_input::set_section_addresses): Use layout
6628 parameter. Adjust code to use Output_section::Simple_input_section
6629 and Input_secction_info classes. Register filler for relaxation
6630 clean up.
6631 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
6632 and section index pair with Output_section::Simple_input_section
6633 class. Adjust code accordingly.
6634 (Phdrs_element::release_segment): New method definition.
6635 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
6636 segment list.
6637 (Script_sections::release_segments): New method definition.
6638 * gold/script-sections.h (Script_sections::release_segments): New
6639 method declaration.
6640 * gold/target.h (Target::may_relax, Target::relax,
6641 Target::do_may_relax, Target::do_relax): New method definitions.
6642
5e445df6
ILT
66432009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6644
6645 * arm.cc (has_signed_unsigned_overflow): New function.
6646 (Arm_relocate_functions::abs8): New function.
6647 (Target_arm::Scan::local): Handle R_ARM_ABS8.
6648 (Target_arm::Scan::global): Likewise.
6649 (Target_arm::relocate::relocate): Likewise.
6650 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6651 Likewise.
6652
8c604651 66532009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
6654
6655 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
6656 * testsuite/Makefile.in: Regenerate.
6657
1e9cc1c2
NC
66582009-09-11 Nick Clifton <nickc@redhat.com>
6659
6660 * po/gold.pot: Updated by the Translation project.
6661
6a89f575
CC
66622009-09-08 Cary Coutant <ccoutant@google.com>
6663
6664 * output.cc (Output_file::open): Add execute permission to empty file.
6665 * testsuite/Makefile.am (permission_test): New test.
6666 * testsuite/Makefile.in: Regenerate.
6667
fdcac5af
ILT
66682009-09-02 Ian Lance Taylor <iant@google.com>
6669
6670 * output.cc (Output_file::resize): Call map_no_anonymous rather
6671 than map.
6672
44453f85
ILT
66732009-09-01 Mikolaj Zalewski <mikolajz@google.com>
6674
6675 * gold.cc: Include "incremental.h".
6676 (queue_initial_tasks): Call Incremental_checker methods.
6677 * incremental.cc: Include "output.h".
6678 (Incremental_checker::can_incrementally_link_output_file): New
6679 method.
6680 * incremental.h (Incremental_checker): New class.
6681
6682 * output.cc (Output_file::open_for_modification): New method.
6683 (Output_file::map_anonymous): Changed return type to bool. Record
6684 map in base_ field.
6685 (Output_file::map_no_anonymous): New method, broken out of map.
6686 (Output_file::map): Use map_no_anonymous and map_anonymous.
6687 * output.h (class Output_file): Update declarations.
6688
293c1386
CC
66892009-08-24 Cary Coutant <ccoutant@google.com>
6690
6691 * options.h (Command_line::Pre_options): New class.
6692 (Command_line::pre_options): New member.
6693 * options.cc (gold::options::ready_to_register): New variable.
6694 (One_option::register_option): Do nothing if not registering options.
6695 Assert if same short option registered twice.
6696 (General_options::General_options): Turn off option registration when
6697 done constructing.
6698 (Command_line::Pre_options::Pre_options): New constructor.
6699
f773f3d2
CC
67002009-08-24 Cary Coutant <ccoutant@google.com>
6701
06a73cfe
CC
6702 * options.h (General_options::no_keep_memory): Remove incorrect
6703 short option.
f773f3d2 6704
a15af8e2
RW
67052009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6706
6707 * Makefile.am (am__skiplex, am__skipyacc): New.
6708 * Makefile.in: Regenerate.
6709
c462b41b
RW
67102009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6711
14ec8efd
RW
6712 * Makefile.am (AM_CPPFLAGS): Renamed from ...
6713 (INCLUDES): ... this.
6714 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
6715 (AM_CPPFLAGS): Renamed from ...
6716 (INCLUDE): ... this.
6717 * Makefile.in, testsuite/Makefile.in: Regenerate.
6718
81ecdfbb
RW
6719 * Makefile.in: Regenerate.
6720 * aclocal.m4: Likewise.
6721 * config.in: Likewise.
6722 * configure: Likewise.
6723 * testsuite/Makefile.in: Likewise.
6724
c462b41b
RW
6725 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
6726 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
6727 * Makefile.in: Regenerate.
6728 * testsuite/Makefile.in: Regenerate.
6729
2da73f13
CC
67302009-08-19 Cary Coutant <ccoutant@google.com>
6731
6732 * resolve.cc (Symbol_table::resolve): Don't complain about defined
6733 symbols in shared libraries overridden by hidden or internal symbols
6734 in the main program.
6735
2db70501
CD
67362009-08-19 Chris Demetriou <cgd@google.com>
6737
6738 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
6739 checking source file names in error messages.
6740
f733487b
DK
67412009-08-18 Doug Kwan <dougkwan@google.com>
6742
6743 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
6744 an elcpp::Ehdr as parameter. Adjust call to set_target.
6745 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
6746 an elfcpp::Ehdr as parameter.
6747 * object.cc (Object::set_target): Remove the version that looks up
6748 a target and sets it.
6749 (Sized_relobj::setup): Take a Target object instead of
6750 an elfcpp::Ehdr as parameter. Adjust call to set_target.
6751 (make_elf_sized_object): Find target and ask target to
6752 make an ELF object.
6753 * object.h: (Object::set_target): Remove the version that looks up
6754 a target and sets it.
6755 (Sized_relobj::setup): Take a Target object instead of
6756 an elfcpp:Ehdr as parameter.
6757 * target.cc: Include dynobj.h.
6758 (Target::do_make_elf_object_implementation): New.
6759 (Target::do_make_elf_object): New.
6760 * target.h (Target::make_elf_object): New template declaration.
6761 (Target::do_make_elf_object): New method declarations.
6762 (Target::do_make_elf_object_implementation): New template declaration.
6763
cc70f101
ILT
67642009-08-14 Ian Lance Taylor <iant@google.com>
6765
6766 * gold.h (FUNCTION_NAME): Define.
6767 (gold_unreachable): Use FUNCTION_NAME.
6768
ef5e0cb1
ST
67692009-08-12 Sriraman Tallam <tmsriram@google.com>
6770
6771 * icf.cc (Icf::find_identical_sections): Issue a warning when a
6772 symbol in the --keep-unique list is not found.
6773
48c187ce
ST
67742009-08-12 Sriraman Tallam <tmsriram@google.com>
6775
6776 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
6777 been maked as --keep-unique.
6778 (Icf::unfold_section): New function.
6779 * icf.h (Icf::unfold_section): New function.
6780 * options.h (General_options::keep_unique): New option.
6781 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
6782 * testsuite/Makefile.in: Regenerate.
6783 * testsuite/icf_keep_unique_test.sh: New file.
6784 * testsuite/icf_keep_unique_test.cc: New file.
6785
645afe0c
CC
67862009-08-12 Cary Coutant <ccoutant@google.com>
6787
6788 PR 10471
6789 * resolve.cc (Symbol_table::resolve): Check for references from
6790 dynamic objects to hidden and internal symbols.
6791 * testsuite/Makefile.am (hidden_test.sh): New test.
6792 * testsuite/Makefile.in: Regenerate.
6793 * testsuite/hidden_test.sh: New script.
6794 * testsuite/hidden_test_1.c: New test source.
6795 * testsuite/hidden_test_main.c: New test source.
6796
11af873f
DK
67972009-08-11 Doug Kwan <dougkwan@google.com>
6798
6799 * arm.cc: Update comments.
6800 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
6801 segment to locate the .ARM.exidx section if present.
6802
b9f7d72d
DK
68032009-08-09 Doug Kwan <dougkwan@google.com>
6804
6805 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
6806 patch.
6807
ddd3c53c
ST
68082009-08-07 Sriraman Tallam <tmsriram@google.com>
6809 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
6810 compiler warnings.
6811
27721062
ST
68122009-08-06 Sriraman Tallam <tmsriram@google.com>
6813
6814 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
6815 valid tls_segment only for non-debug-section relocations.
6816 * testsuite/Makefile.am: Add gc_tls_test.
6817 * testsuite/Makefile.in: Regenerate.
6818 * testsuite/gc_tls_test.cc: New file.
6819 * testsuite/gc_tls_test.sh: New file.
6820
ef15dade 68212009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 6822
ef15dade
ST
6823 * icf.cc: New file.
6824 * icf.h: New file.
6825 * Makefile.am (CCFILES): Add icf.cc.
6826 (HFILES): Add icf.h
6827 * Makefile.in: Regenerate.
6828 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
6829 * gc.h (gc_process_relocs): Populate lists used by icf to contain
6830 section, symbol and addend information for the relocs.
6831 * gold.cc (queue_middle_tasks): Call identical code folding.
6832 * gold.h: Add defines for multimap.
6833 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
6834 to the call of finalize_local_symbols.
6835 * main.cc (main): Create object of class Icf.
6836 * object.cc (Sized_relobj::do_layout): Allow this function to be
6837 called twice during icf.
6838 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
6839 to sections marked as identical by icf.
6840 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
6841 when available.
6842 (Sized_relobj::do_section_entsize): New function.
6843 * object.h (Object::section_entsize): New function.
6844 (Object::do_section_entsize): New pure virtual function.
6845 (Relobj::finalize_local_symbols): Add new parameter.
6846 (Relobj::do_section_entsize): New function.
6847 * options.h (General_options::icf): New option.
6848 (General_options::icf_iterations): New option.
6849 (General_options::print_icf_sections): New option.
6850 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
6851 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
6852 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
6853 icf.
6854 * symtab.cc (Symbol_table::is_section_folded): New function.
6855 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
6856 to sections marked as identical by icf.
6857 * symtab.h (Symbol_table::set_icf): New function.
6858 (Symbol_table::icf): New function.
6859 (Symbol_table::is_section_folded): New function.
6860 (Symbol_table::icf_): New data member.
6861 * target-reloc.h (relocate_section): Ignore sections folded by icf.
6862 * testsuite/Makefile.am: Add commands to build icf_test.
6863 * testsuite/Makefile.in: Regenerate.
6864 * testsuite/icf_test.sh: New file.
6865 * testsuite/icf_test.cc: New file.
6866
c3b65ac4
CD
68672009-07-24 Chris Demetriou <cgd@google.com>
6868
6869 * layout.cc (is_compressible_debug_section): Fix incorrect
6870 comment about compressed section names.
6871
1caf2c51
ILT
68722009-07-20 Ian Lance Taylor <ian@airs.com>
6873
6874 PR 10419
6875 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
6876
1ef4d87f
ILT
68772009-07-16 Ian Lance Taylor <iant@google.com>
6878
6879 PR 10400
6880 * layout.h: #include <map>.
6881 (class Kept_section): Change from struct to class. Add accessors
6882 and setters. Add section size to Comdat_group mapping. Change
6883 Comdat_group to std::map. Add is_comdat_ field. Add
6884 linkonce_size field in union.
6885 (class Layout): Update declaration of find_or_add_kept_section.
6886 Don't declare find_kept_object.
6887 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
6888 parameter. Add object, shndx, is_comdat, and is_group_name
6889 parameters. Change all callers. Adjust for new Kept_section.
6890 (Layout::find_kept_object): Remove.
6891 * object.cc (Sized_relobj::include_section_group): Update use of
6892 Kept_section. Rename secnum to shndx. Only record
6893 Kept_comdat_section if sections are the same size.
6894 (Sized_relobj::include_linkonce_section): Update use of
6895 Kept_section. Only record Kept_comdat_section if sections are the
6896 same size. Set size of linkonce section.
6897 (Sized_relobj::map_to_kept_section): Update call to
6898 get_kept_comdat_section.
6899 * object.h (class Sized_relobj): Rename fields in
6900 Kept_comdat_section to drop trailing underscores; change object
6901 field to Relobj*. Change Kept_comdat_section_table to store
6902 struct rather than pointer.
6903 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
6904 Add kept_object and kept_shndx parameters. Change all callers.
6905 (Sized_relobj::get_kept_comdat_section): Change return type to
6906 bool. Add kept_object and kept_shndx parameters. Change all
6907 callers.
6908 * plugin.cc (Pluginobj::include_comdat_group): Update call to
6909 Layout::find_or_add_kept_section.
6910
37c3b7b0
ILT
69112009-07-09 Ian Lance Taylor <iant@google.com>
6912
6913 * merge.cc (Object_merge_map::initialize_input_to_output_map):
6914 Reserve space in the hash table.
6915
98fa85cb
ILT
69162009-07-06 Mikolaj Zalewski <mikolajz@google.com>
6917
6918 * fileread.cc (File_read::get_mtime): New method.
6919 * fileread.h (Timespec): New structure.
6920 (File_read::get_mtime): New method.
6921 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
6922 Renamed from timestamp_nsec.
6923 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
6924 Elf_Xword.
e1df38aa 6925 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 6926 timestamp_nsec.
e1df38aa 6927 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
6928 (Incremental_inputs::report_obejct): Save mtime; style fix.
6929 (Incremental_inputs::report_script): Save mtime; style fix.
6930 (Incremental_inputs::finalize_inputs): Style fix.
6931 (Incremental_inputs::finalize): Style fix.
6932 (Incremental_inputs::create_input_section_data): Store inputs
6933 mtime.
6934 * incremental.h (Incremental_inputs::report_script): Add mtime
6935 argument.
6936 (Incremental_inputs::Input_info::Input_info): Intialize only one
6937 union member.
6938 (Incremental_inputs::Input_info::archive): Move to nameless
6939 union.
6940 (Incremental_inputs::Input_info::obejct): Move to nameless union.
6941 (Incremental_inputs::Input_info::script): Move to nameless union.
6942 (Incremental_inputs::mtime): New field.
6943 * script.cc (read_input_script): Pass file mtime to
6944 Incremental_input.
6945 * script.h (Script_info::inputs): Style fix.
6946
c9d70757
ILT
69472009-07-01 Ian Lance Taylor <ian@airs.com>
6948
6949 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
6950 instead of 32.
6951
9c547ec3
ILT
69522009-06-24 Ian Lance Taylor <iant@google.com>
6953
6954 PR 10156
6955 * layout.cc (Layout::choose_output_section): If we find an
6956 existing section, update the flags.
6957 (Layout::create_notes): New function, broken out of
6958 Layout::finalize.
6959 (Layout::finalize): Don't create note sections.
6960 (Layout::create_note): Don't crash if linker script discards
6961 section.
6962 (Layout::create_gold_note): Likewise.
6963 (Layout::create_build_id): Likewise. Don't set
6964 after_input_sections on the section.
6965 (Layout::create_executable_stack_info): Remove target parameter.
6966 Change caller.
6967 * layout.h (class Layout): Declare create_notes. Update
6968 declaration of create_executable_stack_info.
6969 * gold.cc (queue_middle_tasks): Call create_notes.
6970 * output.cc (Output_section::update_flags_for_input_section): Move
6971 here from output.h. If SHF_ALLOC flag is newly set, mark address
6972 invalid.
6973 * output.h (Output_data::mark_address_invalid): New function.
6974 (class Output_section): Only declare, not define,
6975 update_flags_for_input_section. Remove set_flags.
6976
55458500
ILT
69772009-06-24 Ian Lance Taylor <iant@google.com>
6978
6979 * script-sections.cc (Output_section_definition::
6980 set_section_addresses): Rename shadowing local load_address to
6981 laddr.
6982
1307d6cd
ILT
69832009-06-24 Ian Lance Taylor <iant@google.com>
6984
6985 PR 10244
6986 * reloc.cc (relocate_sections): Skip empty relocation sections.
6987
ec3f783e
ILT
69882009-06-23 Ian Lance Taylor <iant@google.com>
6989
6990 PR 10156
6991 * layout.cc (Layout::create_note): Use choose_output_section
6992 rather than make_output_section.
6993
459c9f1c
ILT
69942009-06-23 Ian Lance Taylor <iant@google.com>
6995
6996 PR 10237
6997 * options.cc (General_options::parse_V): Set printed_version_.
6998 (General_options::General_options): Initialize printed_version_.
6999 * options.h (class General_options): Add printed_version_ field.
7000 * gold.cc (queue_initial_tasks): If there are no input files,
7001 don't give a fatal error if we printed the version information.
7002 (queue_middle_tasks): If using -r with a shared object, give a
7003 fatal error rather than an ordinary error.
7004
1518dc8f
ILT
70052009-06-23 Ian Lance Taylor <iant@google.com>
7006
7007 PR 10219
7008 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7009 (Layout::make_output_section): Set have_stabstr_section_ if we see
7010 a .stab*str section.
7011 (Layout::finalize): Call link_stabs_sections.
7012 (Layout::link_stabs_sections): New file.
7013 * layout.h (class Layout): Add have_stabstr_section_ field.
7014 Declare link_stabs_sections.
7015
3d857b98
DK
70162009-06-23 Doug Kwan <dougkwan@google.com>
7017
7018 * Makefile.am (libgold_a_LIBADD): New.
7019 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7020 * Makefile.in: Regenerate.
7021 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7022 * configure: Regenerate.
7023 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7024 * fileread.cc: Include sys/state.h
7025 * gold.h: Declare memmem and strndup if found missing.
7026 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7027
0639a6f6
ILT
70282009-06-23 Ian Lance Taylor <iant@google.com>
7029
7030 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7031 * configure: Rebuild.
7032
8d63875c
ILT
70332009-06-23 Ian Lance Taylor <iant@google.com>
7034
7035 PR 10147
7036 * object.cc (Object::section_contents): Don't try to get a view if
7037 the section has length zero.
7038 (Object::handle_gnu_warning_section): If the section is empty, use
7039 the name of the section as the warning.
7040
f7c8a183
ILT
70412009-06-23 Ian Lance Taylor <iant@google.com>
7042
7043 PR 10133
7044 * stringpool.h (class Stringpool_template): Add optimize_ field.
7045 (Stringpool_template::set_optimize): New function.
7046 * stringpool.cc (Stringpool_template::Stringpool_template):
7047 Initialize optimize_ field.
7048 (Stringpool_template::set_string_offsets): Test local optimize
7049 fild rather than parameter.
7050 * layout.cc (Layout::Layout): Call set_optimize on the section
7051 name stringpool.
7052
e6a307ba
ILT
70532009-06-22 Ian Lance Taylor <iant@google.com>
7054
7055 PR 10030
7056 * yyscript.y: Parse TARGET.
7057 * script.cc (script_set_target): New function.
7058 * script-c.h (script_set_target): Declare.
7059 * options.cc (General_options::string_to_object_format): Rename
7060 from string_to_object_format in anonymous namespace. Change
7061 callers.
7062 * options.h (class General_options): Declare
7063 string_to_object_format.
7064
3ee173de
ILT
70652009-06-22 Ian Lance Taylor <iant@google.com>
7066
7067 * script-sections.cc (Script_sections::create_segments): Don't put
7068 program headers in a PT_LOAD segment if -n or -N.
7069
70702009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7071
7072 PR 10141
7073 * options.h (class General_options): Add -z lazy and -z now. Sort
7074 -z options into alphabetical order.
7075 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7076
cd6739a1 70772009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7078
7079 * layout.cc (Layout::make_output_section): Call
7080 Target::new_output_section.
7081 (Layout::attach_allocated_section_to_segment): Put large section
7082 sections in a separate load segment with the large segment flag
7083 set.
7084 (Layout::segment_precedes): Sort large data segments after other
7085 load segments.
7086 (align_file_offset): New static function.
7087 (Layout::set_segment_offsets): Use align_file_offset.
7088 * output.h (class Output_section): Add is_small_section_ and
7089 is_large_section_ fields.
7090 (Output_section::is_small_section): New function.
7091 (Output_section::set_is_small_section): New function.
7092 (Output_section::is_large_section): New function.
7093 (Output_section::set_is_large_section): New function.
7094 (Output_section::is_large_data_section): New function.
7095 (class Output_segment): Add is_large_data_segment_ field.
7096 (Output_segment::is_large_data_segment): New function.
7097 (Output_segment::set_is_large_data_segment): New function.
7098 * output.cc (Output_section::Output_section): Initialize new
7099 fields.
7100 (Output_segment::Output_segment): Likewise.
7101 (Output_segment::add_output_section): Add assertion that large
7102 data sections always go in large data segments. Force small data
7103 sections to the end of the list of data sections. Force small BSS
7104 sections to the start of the list of BSS sections. For large BSS
7105 sections to the end of the list of BSS sections.
7106 * symtab.h (class Symbol): Declare is_common_shndx.
7107 (Symbol::is_defined): Check Symbol::is_common_shndx.
7108 (Symbol::is_common): Likewise.
7109 (class Symbol_table): Define enum Commons_section_type. Update
7110 declarations. Add small_commons_ and large_commons_ fields.
7111 * symtab.cc (Symbol::is_common_shndx): New function.
7112 (Symbol_table::Symbol_table): Initialize new fields.
7113 (Symbol_table::add_from_object): Put small and large common
7114 symbols in the right list.
7115 (Symbol_table::sized_finalized_symbol): Check
7116 Symbol::is_common_shndx.
7117 (Symbol_table::sized_write_globals): Likewise.
7118 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7119 common symbol lists. Don't call do_allocate_commons_list if the
7120 list is empty.
7121 (Symbol_table::do_allocate_commons_list): Remove is_tls
7122 parameter. Add comons_section_type parameter. Change all
7123 callers. Handle small and large common symbols.
7124 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7125 Symbol::is_common_shndx.
7126 * resolve.cc (symbol_to_bits): Likewise.
7127 * target.h (Target::small_common_shndx): New function.
7128 (Target::small_common_section_flags): New function.
7129 (Target::large_common_shndx): New function.
7130 (Target::large_common_section_flags): New function.
7131 (Target::new_output_section): New function.
7132 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7133 small_common_section_flags, and large_common_section_flags
7134 fields.
7135 (Target::do_new_output_section): New virtual function.
7136 * arm.cc (Target_arm::arm_info): Initialize new fields.
7137 * i386.cc (Target_i386::i386_info): Likewise.
7138 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7139 Likewise.
7140 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7141 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7142 (Target_x86_64::do_new_output_section): New function.
7143 * configure.ac: Define conditional MCMODEL_MEDIUM.
7144 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7145 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7146 (large_LDFLAGS): Define.
7147 * testsuite/large.c: New file.
7148 * testsuite/testfile.cc (Target_test::test_target_info):
7149 Initialize new fields.
7150 * configure, testsuite/Makefile.in: Rebuild.
7151
bb04269c
DK
71522009-06-05 Doug Kwan <dougkwan@google.com>
7153
7154 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7155 * Makefile.in: Regenerate.
bb04269c
DK
7156 * i386.cc (class Target_i386): Define new virtual method to
7157 override do_is_local_label_name in parent.
7158 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7159 local symbols if --discard-locals or -X is given.
7160 * options.h (class General_options): Declare new options
7161 '--discard-locals' and '-X' for discarding locals.
7162 * target.h (class Target): Define new methods is_local_label_name.
7163 Declare new virtual method do_is_local_label_name.
7164 * target.cc: New file.
7165 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7166 (check_SCRIPTS): Add discard_locals_test.sh.
7167 (check_DATA): Add discard_local_tests.syms.
7168 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7169 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7170 * testsuite/Makefile.in: Regenerate.
7171 * testsuite/discard_locals_test.c: New file.
7172 * testsuite/discard_locals_test.sh: Same.
7173
805bb01c
DK
71742009-06-05 Doug Kwan <dougkwan@google.com>
7175
7176 * object.cc (Sized_relobj::Sized_relobj): Initialize
7177 discarded_eh_frame_shndx_ to -1U.
7178 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7179 section.
7180 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7181 a discarded .eh_frame section.
7182 (Sized_relobj::do_finalize_local_symbols): Ditto.
7183 * object.h (class Sized_relobj): Declare new member
7184 discarded_eh_frame_shndx_.
7185 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7186 (local_labels_test.o, local_labels_test): New rules.
7187 * testsuite/Makefile.in: Regenerate.
7188
1dcd334d
DK
71892009-06-04 Doug Kwan <dougkwan@google.com>
7190
7191 * layout.cc (Layout::section_name_mapping): Add mapping for
7192 special ARM sections.
7193
96d49306
DK
71942009-06-03 Doug Kwan <dougkwan@google.com>
7195
7196 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7197 (utils::has_overflow): Same.
7198
dff16297
ILT
71992009-06-03 Ian Lance Taylor <iant@google.com>
7200
7201 * layout.cc (Layout::section_name_mapping): New array, replacing
7202 Layout::linkonce_mapping.
7203 (Layout::section_name_mapping_count): New variable, replacing
7204 Layout::linkonce_mapping_count.
7205 (Layout::linkonce_output_name): Remove.
7206 (Layout::output_section_name): Rewrite.
7207 * layout.h (class Layout): Rename Linkonce_mapping to
7208 Section_name_mapping, linkonce_mapping to section_name_mapping,
7209 linkonce_mapping_count to section_name_mapping_count. Don't
7210 declare linkonce_output_name.
7211
c121c671
DK
72122009-06-03 Doug Kwan <dougkwan@google.com>
7213
7214 * gold/arm.cc (namespace utils): New.
7215 (Target_arm::reloc_is_non_pic): Define new method.
7216 (class Arm_relocate_functions): New.
7217 (Target_arm::Relocate::relocate): Handle relocation types used by
7218 Android.
7219
07800fab
ILT
72202009-06-03 Ian Lance Taylor <iant@google.com>
7221
7222 * arm.cc (Target_arm::scan::global): Use || instead of |.
7223
c121c671
DK
72242009-06-02 Doug Kwan <dougkwan@google.com>
7225
7226 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7227 issued_non_pic_error_.
7228 (class Target_arm::Scan): Declare new method check_non_pic.
7229 Define new method symbol_needs_plt_entry.
7230 Declare new data member issued_non_pic_error_.
7231 (class Target_arm::Relocate): Declare new method
7232 should_apply_static_reloc.
7233 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7234 (Target_arm::Scan::check_non_pic): Define new method.
7235 (Target_arm::Scan::local): Handle a small subset of reloc types used
7236 by Android.
7237 (Target_arm::Scan::local): Same.
7238 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7239
b19b0c6d
ILT
72402009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7241
7242 * incremental.cc (Incremental_inputs::report_command_line): Filter
7243 out --incremental-* options.
7244
94cdfcff
DK
72452009-05-29 Doug Kwan <dougkwan@google.com>
7246
7247 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7248 template class.
7249 (class Target_arm): Update comment.
7250 (Target_arm::Target_arm): Initialize new data members GOT_,
7251 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7252 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7253 and Target_arm::rel_dyn_section.
7254 Declare new_enum Target_arm::Got_type.
7255 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7256 and DYNBSS_.
7257 Update commments for member do_dynsym_value.
7258 (Target_arm::got_size, Target_arm::plt_section,
7259 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7260 new methods inside class defintion.
7261 (Target_arm::got_section): Define new method.
7262 (Target_arm::rel_dyn_section): Same.
7263 (Output_data_plt_arm): New template class.
7264 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7265 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7266 (Output_data_plt_arm::add_entry): Same.
7267 (Output_data_plt_arm::first_plt_entry): Define new
7268 static data member for PLT instruction template.
7269 (Output_data_plt_arm::plt_entry): Same.
7270 (Output_data_plt_arm::do_write): Define new method.
7271 (Target_arm::make_plt_entry): Same.
7272 (Target_arm::do_finalize_sections): Same.
7273 (Target_arm::do_dynsym_value): Same.
7274
4a657b0d
DK
72752009-05-28 Doug Kwan <dougkwan@google.com>
7276
7277 * Makefile.am (TARGETSOURCES): Add arm.cc.
7278 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7279 * Makefile.in: Regenerate.
7280 * arm.cc: New file.
7281 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7282
e7ae8c36
DK
72832009-05-26 Doug Kwan <dougkwan@google.com>
7284
7285 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7286 (General_options::check_excluded_libs): Strip off directories in
7287 archive name before matching like GNU ld does.
7288 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7289 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7290 (exclude_libs_test_LDFLAGS): Add linker option
7291 -Wl,--exclude-libs,libexclude_libs_test_3
7292 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7293 an explicit archive without using -l.
7294 (alt/libexclude_libs_test_3.a): New make rule.
7295 * testsuite/Makefile.in: Regenerate.
7296 * testsuite/exclude_libs_test.c : Declare lib3_default().
7297 (main): Call it.
7298 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
7299 * exclude_libs_test_3.c: New file.
7300
f12e7348
NC
73012009-05-26 Nick Clifton <nickc@redhat.com>
7302
7303 * po/id.po: New Indonesian translation.
7304 * po/gold.pot: Updated template file.
7305
4daadc0d
ST
73062009-05-22 Sriraman Tallam <tmsriram@google.com>
7307
e1df38aa 7308 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
7309 gc_comdat_test files. Add -Wl,--gc-sections to build
7310 gc_comdat_test.
7311 * testsuite/Makefile.in: Regenerate.
7312 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
7313
531813ad
ST
73142009-05-21 Sriraman Tallam <tmsriram@google.com>
7315
7316 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
7317 kept comdat section was garbage collected.
7318 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
7319 * testsuite/Makefile.in: Regenerate.
7320 * testsuite/gc_comdat_test.sh: New file.
7321 * testsuite/gc_comdat_test_1.cc: New file.
7322 * testsuite/gc_comdat_test_2.cc: New file.
7323
65514900
CC
73242009-05-19 Doug Kwan <dougkwan@google.com>
7325
7326 * archive.cc (Archive::Archive): Move constructor from archive.h
7327 to here. Initialize no_export_.
7328 (Archive::get_elf_object_for_member): Set no_export flag of object.
7329 * archive.h (Archive::Archive): Move constructor body to
7330 archive.cc.
7331 (Archive::no_export): New method.
7332 (Archive::no_export_): New field.
7333 * object.h (Object::Object): Initialize no_export_ to false.
7334 (Object::no_export, Object::set_no_export): New methods.
7335 (Object::no_export_): New field.
7336 * options.cc (General_options::parse_exclude_libs): New method.
7337 (General_options::check_excluded_libs) Same.
7338 * options.h (exclude_libs): New option.
7339 (General_options::check_excluded_libs): New method declaration.
7340 (General_options::excluded_libs_): New field.
7341 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
7342 default or protected visibility if an object has no-export flag set.
7343 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
7344 (check_SCRIPTS): Add exclude_libs_test.sh.
7345 (check_DATA): Add exclude_libs_test.syms.
7346 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
7347 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
7348 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
7349 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
7350 (exclude_libs_test.syms, libexclude_libs_test_1.a,
7351 libexclude_libs_test_2.a): New rules.
7352 * testsuite/Makefile.in: Regenerate.
7353 * testsuite/exclude_libs_test.c: New file.
7354 * testsuite/exclude_libs_test.sh: Ditto.
7355 * testsuite/exclude_libs_test_1.c: Ditto.
7356 * testsuite/exclude_libs_test_2.c: Ditto.
7357
1b77ea50
ILT
73582009-05-15 Ian Lance Taylor <iant@google.com>
7359
7360 * configure.ac: Check for declarations for cases where libiberty.h
7361 checks HAVE_DECL_xxx.
7362 * configure, config.in: Rebuild.
7363
072fe7ce
ILT
73642009-05-15 Mikolaj Zalewski <mikolajz@google.com>
7365
7366 * gold.h (Incremental_argument_list): Remove (invalid) forward
7367 declaration.
7368 * incremental.cc (Incremental_inputs::report_achive): New method.
7369 (Incremental_inputs::report_object): New method.
7370 (Incremental_inputs::report_script): New method.
7371 (Incremental_inputs::finalize_inputs): New method.
7372 (Incremental_inputs::finalize): Call finalize_inputs().
7373 (Incremental_inputs::sized_create_incremental_inputs_section_data):
7374 Create inputs entries.
7375 * incremental.h (Incremental_input_type): New enum.
7376 (Incremental_inputs::Incremental_input): Initialize new fields.
7377 (Incremental_inputs::report_inputs): New method.
7378 (Incremental_inputs::report_achive): New method.
7379 (Incremental_inputs::report_object): New method.
7380 (Incremental_inputs::report_script): New method.
7381 (Incremental_inputs::finalize_inputs): New method.
7382 (Incremental_inputs::Input_info): New struct.
7383 (Incremental_inputs::Input_info_map): New typedef.
7384 (Incremental_inputs::lock_): New field.
7385 (Incremental_inputs::Inputs_): New field.
7386 (Incremental_inputs::Inputs_map): New field.
7387 * main.cc (main): Call Incremental_input::report_inputs.
7388 * options.h (Input_argument_list): Typedef moved from
7389 Input_arguments.
7390 (Input_file_group::Files): Remove, use ::Input_argument_list.
7391 (Input_file_group::Input_argument_list): Remove, use
7392 ::Input_argument_list.
7393 * plugin.cc (Plugin_manager::add_input_file): Add error in
7394 incremental build.
7395 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
7396 functions.
7397 * script.cc (read_input_script): Call
7398 Incremental_input::report_script.
7399 * script.h (Script_info): New class.
7400
b0481b0b
ILT
74012009-04-27 Ian Lance Taylor <iant@google.com>
7402
7403 * x86_64.cc (do_adjust_output_section): Set entsize to
7404 plt_entry_size.
7405
b22a5a41 74062009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
7407
7408 * output.cc (Output_file::close): After short writes, continue
7409 writing from the correct offset in the buffer being written.
7410
40fde488
CD
74112009-04-23 Chris Demetriou <cgd@google.com>
7412
7413 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
7414 * configure: Regenerate.
7415 * config.in: Regenerate.
7416 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
7417 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
7418
3ce2c28e
ILT
74192009-04-21 Mikolaj Zalewski <mikolajz@google.com>
7420
7421 * incremental.cc (Incremental_inputs_header_data): Renamed from
7422 Incremental_input_header_data.
7423 (Incremental_inputs_header_data::data_size): New field.
7424 (Incremental_inputs_header_data::put_input_file_count): Renamed
7425 from input_file_count.
7426 (Incremental_inputs_header_data::put_command_line_offset): Renamed
7427 from command_line_offset.
7428 (Incremental_inputs_header_data::put_reserved): Renamed from
7429 put_reserved.
7430 (Incremental_inputs_entry_data): Renamed from
7431 Incremental_input_entry_data.
7432 (Incremental_inputs_entry_data::data_size): New field.
7433 (Incremental_inputs::report_command_line): New method.
7434 (Incremental_inputs::finalize): New method.
7435 (Incremental_inputs::create_incremental_inputs_data): New method.
7436 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
7437 * incremental.h: New file.
7438 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
7439 (Layout::finalize): Create incremental inputs section in
7440 incremental builds.
7441 (Layout::create_incremental_info_sections): New method.
7442 * layout.h (Layout::incremental_inputs): New method.
7443 (Layout::create_incremental_info_sections): New method.
7444 (Layout::incremental_inputs_): New field.
7445 * main.cc (main): Notify Incremental_input of the command line.
7446
e55bde5e
ILT
74472009-04-01 Ian Lance Taylor <iant@google.com>
7448 Mikolaj Zalewski <mikolajz@google.com>
7449
7450 * gold.h (reserve_unordered_map): Define, three versions, one for
7451 each version of Unordered_map.
7452 * layout.cc (Layout::Layout): Remove options parameter. Add
7453 number_of_input_files parameter. Don't initialize options_.
7454 Initialize number_of_input_files_ and resized_signatures_. Move
7455 sections_are_attached_.
7456 (Layout::layout_group): Reserve space for group_signatures_.
7457 (Layout::find_or_add_kept_section): Change name parameter to be a
7458 reference. Resize signatures_ map when it gets large enough.
7459 (Layout::layout_eh_frame): Use parameters->options() instead of
7460 this->options_.
7461 (Layout::make_output_section): Likewise.
7462 (Layout::attach_allocated_section_to_segment): Likewise.
7463 (Layout::finalize, Layout::create_executable_stack): Likewise.
7464 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
7465 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
7466 * layout.h (class Layout): Update declarations. Remove options_
7467 field. Add number_of_input_files_ and resized_signatures_
7468 fields. Move sections_are_attached_ field.
7469 * main.cc (main): Pass number of input files to Layout
7470 constructor. Don't pass options.
7471
154b857c
ILT
74722009-03-30 Ian Lance Taylor <iant@google.com>
7473
7474 * ffsll.c (ffsll): Correct implementation.
7475
2f35ab9b
ILT
74762009-03-27 Ian Lance Taylor <iant@google.com>
7477
fd03461a
ILT
7478 * ffsll.c: New file.
7479 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
7480 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
7481 * ftruncate.c (ftruncate): Declare before definition.
7482 * mremap.c (mremap): Likewise.
7483 * pread.c (pread): Likewise.
7484 * configure, Makefile.in, config.in: Rebuild.
7485
2f35ab9b
ILT
7486 * mremap.c: New file.
7487 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
7488 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
7489 (mremap): Declare if HAVE_MREMAP is not defined.
7490 * configure, Makefile.in, config.in: Rebuild.
7491
33aea2fd
CC
74922009-03-27 Cary Coutant <ccoutant@google.com>
7493
7494 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
7495 position independent.
7496 * sparc.cc (Target_sparc::check_non_pic): Likewise.
7497 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
7498
6d479619
CC
74992009-03-24 Cary Coutant <ccoutant@google.com>
7500
7501 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
7502 an executable.
7503 (needs_dynamic_reloc): Likewise.
7504
afc06bb8
ILT
75052009-03-24 Ian Lance Taylor <iant@google.com>
7506
7507 * yyscript.y (file_cmd): Recognize EXTERN.
7508 (extern_name_list, extern_name_list_body): New nonterminals.
7509 * script.cc (script_add_extern): Define.
7510 * script-c.h (script_add_extern): Declare.
7511
f6060a4d
ILT
75122009-03-24 Rafael Avila de Espindola <espindola@google.com>
7513
7514 * object.cc (is_elf_object): Define.
7515 * object.h (is_elf_object): Declare.
7516 * archive.cc (Archive::get_elf_object_for_member): Call
7517 is_elf_object.
33aea2fd 7518 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 7519
26736d8e
ILT
75202009-03-24 Elliott Hughes <enh@google.com>
7521
7522 * output.cc (Output_file::map_anonymous): Define.
7523 (Output_file::map): Use map_anonymous. If the regular mmap fails,
7524 try an anonymous one. Report the size if the mmap fails.
7525 * output.h (class Output_file): Declare map_anonymous.
7526
22fd9730
ILT
75272009-03-24 Ian Lance Taylor <iant@google.com>
7528
7529 * target-select.cc (instantiate_target): Don't acquire the lock if
7530 the instantiated_target_ field has already been set.
7531
cb010894
ILT
75322009-03-23 Ian Lance Taylor <iant@google.com>
7533
7f055c20
ILT
7534 * gold-threads.h (class Initialize_lock): Define.
7535 * gold-threads.cc (class Initialize_lock_once): Define.
7536 (initialize_lock_control): New static variable.
7537 (initialize_lock_pointer): New static variable.
7538 (initialize_lock_once): New static function.
7539 (Initialize_lock::Initialize_lock): Define.
7540 (Initialize_lock::initialize): Define.
7541 * target-select.h: Include "gold-threads.h".
7542 (class Target_selector): Add lock_ and initialize_lock_ fields.
7543 Don't define instantiate_target, just declare it.
7544 * target-select.cc (Target_selector::Target_selector): Initialize
7545 new fields.
7546 (Target_selector::instantiate_target): Define.
7547 * descriptors.h: Include "gold-threads.h".
7548 (class Descriptors): Add initialize_lock_ field.
7549 * descriptors.cc (Descriptors::Descriptors): Initialize new
7550 field.
7551 (Descriptors::open): Use initialize_lock_ field
7552 * errors.h (class Errors): Add initialize_lock_ field.
7553 * errors.cc (Errors::Errors): Initialize new field.
7554 (Errors::initialize_lock): Use initialize_lock_ field.
7555 * powerpc.cc (class Target_selector_powerpc): Remove
7556 instantiated_target_ field. In do_recognize call
7557 instantiate_target rather than do_instantiate_target. In
7558 do_instantiate_target just allocate a new target.
7559 * sparc.cc (class Target_selector_sparc): Likewise.
7560
36959681
ILT
7561 * freebsd.h: New file.
7562 * i386.cc: Include "freebsd.h".
7563 (Target_i386): Derive from Target_freebsd rather than
7564 Sized_target.
7565 (Target_selector_i386): Derive from Target_selector_freebsd rather
7566 than Target_selector.
7567 * x86_64.cc: Include "freebsd.h".
7568 (Target_x86_64): Derive from Target_freebsd rather than
7569 Sized_target.
7570 (Target_selector_x86_64): Derive from Target_selector_freebsd
7571 rather than Target_selector.
7572 * target.h (class Target): Add adjust_elf_header and
7573 do_adjust_elf_header.
7574 * output.cc (Output_file_header:: do_sized_write): Call target
7575 adjust_elf_header routine.
7576 * configure.tgt: Set targ_osabi.
7577 * configure.ac: Define GOLD_DEFAULT_OSABI.
7578 * parameters.cc (Parameters::default_target): Pass
7579 GOLD_DEFAULT_OSABI to select_target.
7580 * target-select.h (class Target_selector): Make instantiate_target
7581 protected rather than private.
7582 * Makefile.am (HFILES): Add freebsd.h.
7583 * configure, Makefile.in, config.in: Rebuild.
7584
cb010894
ILT
7585 * merge.cc (do_add_input_section): Correct pend value. Change
7586 message about last entry not being null terminated from error to
7587 warning.
7588
0e879927
ILT
75892009-03-20 Mikolaj Zalewski <mikolajz@google.com>
7590
7591 * incremental.cc: New file.
7592 * Makefile.am (CCFILES): Add incremental.cc.
7593 * Makefile.in: Rebuild.
7594
41105937
PP
75952009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
7596
7597 * layout.cc (Layout::output_section_name): Preserve names
7598 of '.note.' sections.
e1df38aa 7599
60439920
ILT
76002009-03-19 Ian Lance Taylor <iant@google.com>
7601
7602 * descriptors.cc (Descriptors::open): Check that the options are
7603 valid before using them.
7604
0d371ad3
ILT
76052009-03-18 Ian Lance Taylor <iant@google.com>
7606
7607 * script-sections.h: Include <list>.
7608 (class Script_sections): Change Sections_elements from std::vector
7609 to std::list. Typedef public Elements_iterator. Add
7610 orphan_section_placement_, data_segment_align_start_, and
7611 saw_data_segment_align_ fields. Remove data_segment_align_index_
7612 field.
7613 * script-sections.cc (class Orphan_section_placement): New class.
7614 (class Sections_element): Add virtual functions is_relro and
7615 orphan_section_init. Remove virtual function place_orphan_here.
7616 (class Output_section_definition): Add is_relro and
7617 orphan_section_init. Remove place_orphan_here.
7618 (class Orphan_output_section): Likewise.
7619 (Script_sections::Script_sections): Update for field changes.
7620 (Script_sections::data_segment_align): Set saw_data_segment_align_
7621 and data_segment_align_start_, not data_segment_align_index.
7622 (Script_sections::data_segment_relro_end): Check
7623 saw_data_segment_align_. Use data_segment_align_start_ rather
7624 than data_segment_align_index_.
7625 (Script_sections::place_orphan): Rewrite to use
7626 Orphan_section_placement.
7627
9201d894
ILT
76282009-03-17 Ian Lance Taylor <iant@google.com>
7629
9c5b8369
ILT
7630 * archive.cc (Archive::add_symbols): Check for a version attached
7631 to the symbol name in the archive map.
7632 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
7633 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
7634 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
7635 (ver_test_11.a): New target.
7636 * testsuite/Makefile.in: Rebuild.
7637
9201d894
ILT
7638 * configure.ac: Check for chsize and posix_fallocate. Replace
7639 ftruncate.
7640 * ftruncate.c: New file, from gnulib.
7641 * output.cc (posix_fallocate): Define dummy version if not
7642 HAVE_POSIX_FALLOCATE.
7643 (Output_file::map): Call posix_fallocate rather than lseek and
7644 write.
7645 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
7646 * configure, Makefile.in, config.in: Rebuild.
7647
ef4ab7a8 76482009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 7649
ef4ab7a8
PP
7650 * layout.h (Layout::create_note): Add section_name parameter.
7651 * layout.cc (Layout::create_note): Likewise.
7652 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 7653
8c500701
ILT
76542009-03-17 Ian Lance Taylor <iant@google.com>
7655
e85b18e1
ILT
7656 * descriptors.cc: Include "options.h".
7657 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
7658 (Descriptors::open): Always use O_CLOEXEC when opening a new
7659 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
7660 then set FD_CLOEXEC.
7661
9efe6174
ILT
7662 * sparc.cc (class Target_sparc): Add has_got_section.
7663 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
7664 make sure we have a GOT section.
7665
7666 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
7667 (Target_sparc::Scan::local): Likewise.
7668 (Target_sparc::Scan::global): Likewise.
7669 (Target_sparc::Relocate::relocate): Likewise.
7670 (Target_sparc::Relocate::relocate_tls): Likewise.
7671
8c500701
ILT
7672 * symtab.cc (Symbol_table::define_default_version): New function,
7673 broken out of add_from_object.
7674 (Symbol_table::add_from_object): Call define_default_version.
7675 (Symbol_table::define_special_symbol): Add resolve_oldsym
7676 parameter. Change all callers. If the version for a symbol comes
7677 from a version script, resolve it with the symbol with the same
7678 name with no version. Also add the symbol without a version if
7679 appropriate.
7680 (do_define_in_output_data): If resolving with oldsym, don't delete
7681 sym.
7682 (do_define_in_output_segment): Likewise.
7683 (do_define_as_constant): Likewise.
7684 * symtab.h (class Symbol_table): Update declarations.
7685
f1ed28fb
ILT
76862009-03-13 Ian Lance Taylor <iant@google.com>
7687
15f8229b
ILT
7688 * readsyms.cc (Read_symbols::incompatible_warning): New function.
7689 (Read_symbols::requeue): New function.
7690 (Read_symbols::do_read_symbols): If make_elf_object fails because
7691 the target type is not configured, and the file was searched for,
7692 issue a warning and retry with the next directory.
7693 (Add_symbols::run): If the file has an incompatible format, and
7694 it was searched for, requeue the Read_symbols task. On error,
7695 release the object.
7696 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
7697 dirindex parameter to constructor. Change all callers. Declare
7698 incompatible_warning and requeue.
7699 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
7700 input_argument_ and input_group_ fields. Add them to
7701 constructor. Change all callers.
7702 (class Read_script): Add dirindex_ field. Add it to constructor.
7703 Change all callers.
7704 * archive.cc (Archive::setup): Remove input_objects parameter.
7705 Change all callers.
7706 (Archive::get_file_and_offset): Likewise.
7707 (Archive::read_all_symbols): Likewise.
7708 (Archive::read_symbols): Likewise.
7709 (Archive::get_elf_object_for_member): Remove input_objects
7710 parameter. Add punconfigured parameter. Change all callers.
7711 (Archive::add_symbols): Change return type to bool. Check return
7712 value of include_member.
7713 (Archive::include_all_members): Likewise.
7714 (Archive::include_member): Change return type to bool. Return
7715 false if first included object has incompatible target. Set
7716 included_member_ field.
7717 (Add_archive_symbols::run): If add_symbols returns false, requeue
7718 Read_symbols task.
7719 * archive.h (class Archive): Add included_member_ field.
7720 Initialize it in constructor. Add input_file and searched_for
7721 methods. Update declarations.
7722 (class Add_archive_symbols): Add dirpath_, dirindex_, and
7723 input_argument_ fields. Add them to constructor. Change all
7724 callers.
7725 * script.cc: Include "target-select.h".
7726 (class Parser_closure): Add skip_on_incompatible_target_ and
7727 found_incompatible_target_ fields. Add
7728 skip_on_incompatible_target parameter to constructor. Change all
7729 callers. Add methods skip_on_incompatible_target,
7730 clear_skip_on_incompatible_target, found_incompatible_target, and
7731 set_found_incompatible_target.
7732 (read_input_script): Add dirindex parameter. Change all callers.
7733 If parser finds an incompatible target, requeue Read_symbols
7734 task.
7735 (script_set_symbol): Clear skip_on_incompatible_target in
7736 closure.
7737 (script_add_assertion, script_parse_option): Likewise.
7738 (script_start_sections, script_add_phdr): Likewise.
7739 (script_check_output_format): New function.
7740 * script.h (read_input_script): Update declaration.
7741 * script-c.h (script_check_output_format): Declare.
7742 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
7743 (ignore_cmd): Remove OUTPUT_FORMAT.
7744 * fileread.cc (Input_file::Input_file): Add explicit this.
7745 (Input_file::will_search_for): New function.
7746 (Input_file::open): Add pindex parameter. Change all callers.
7747 * fileread.h (class Input_file): Add input_file_argument method.
7748 Declare will_search_for. Update declarations.
7749 * object.cc (make_elf_object): Add punconfigured parameter.
7750 Change all callers.
7751 * object.h (class Object): Make input_file public. Add
7752 searched_for method.
7753 (make_elf_object): Update declaration.
7754 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
7755 restart search.
7756 * dirsearch.h (class Dirsearch): Update declaration.
7757 * options.h (class General_options): Add --warn-search-mismatch.
7758 * parameters.cc (Parameters::is_compatible_target): New function.
7759 * parameters.h (class Parameters): Declare is_compatible_target.
7760 * workqueue.cc (Workqueue::add_blocker): New function.
7761 * workqueue.h (class Workqueue): Declare add_blocker.
7762
f1ed28fb
ILT
7763 * fileread.cc (Input_file::open): Remove options parameter.
7764 Change all callers.
7765 (Input_file::open_binary): Likewise.
7766 * script.cc (read_input_script): Likewise.
7767 * readsyms.h (class Read_symbols): Remove options_ field. Remove
7768 options parameter from constructor. Change all callers.
7769 (class Read_script): Likewise.
7770 * fileread.h (class Input_file): Update declarations.
7771 * script.h (read_input_script): Update declaration.
7772
34dd024a
NC
77732009-03-10 Nick Clifton <nickc@redhat.com>
7774
7775 * po/es.po: New Spanish translation.
7776
6d71b17c
CC
77772009-03-06 Cary Coutant <ccoutant@google.com>
7778
7779 * options.cc (parse_short_option): Keep dash_z from registering itself.
7780
031cdbed
ILT
77812009-03-03 Ian Lance Taylor <iant@google.com>
7782
7783 PR 9918
7784 * target-reloc.h (relocate_section): Pass output_section to
7785 relocate.
7786 * i386.cc (Target_i386::should_apply_static_reloc): Add
7787 output_section parameter. Change all callers.
7788 (Target_i386::Relocate::relocate): Add output_section parameter.
7789 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7790 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
7791 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
7792 * testsuite/two_file_shared.sh: New script.
7793 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
7794 (check_DATA): Add two_file_shared.dbg.
7795 (two_file_shared.dbg): New target.
7796 * testsuite/Makefile.in: Rebuild.
7797
15d5fa16
ILT
77982009-03-01 Ian Lance Taylor <iant@google.com>
7799
7800 * configure.ac: Check for byteswap.h.
7801 * configure: Rebuild.
7802 * config.in: Rebuild.
7803
8a4c0b0d
ILT
78042009-03-01 Mikolaj Zalewski <mikolajz@google.com>
7805
7806 * layout.cc (Layout::find_or_add_kept_section): New function.
7807 (Layout::add_comdat): Removed.
7808 * layout.h (struct Kept_section): Move out of class Layout.
7809 Remove trailing underscores from field names. Add group_sections
7810 field. Rename group_ field to is_group. Change all uses.
7811 (class Layout): Declare find_or_add_kept_section, not add_comdat.
7812 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
7813 comdat_groups_ field.
7814 (Sized_relobj::include_section_group): Use
7815 find_or_add_kept_section and Kept_section::group_sections.
7816 (Sized_relobj::include_linkonce_section): Likewise.
7817 * object.cc (class Sized_relobj): Don't define Comdat_group or
7818 Comdat_group_table. Remove find_comdat_group and
7819 add_comdat_group. Remove comdat_groups_ field.
7820 * plugin.cc (include_comdat_group): Use
7821 Layout::find_or_add_kept_section.
7822
b4ecf66b
ILT
78232009-02-28 Ian Lance Taylor <iant@google.com>
7824
14359ca0
ILT
7825 * README: --gc-sections and map files are now supported. Document
7826 some build requirements.
7827
b4ecf66b
ILT
7828 PR 6992
7829 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
7830 relocatable link set the value of the section symbol to zero.
7831 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
7832 relocatable link don't include the section address in the local
7833 symbol value.
7834
0602e05a
ILT
78352009-02-27 Ian Lance Taylor <iant@google.com>
7836
fd9d194f
ILT
7837 PR 6811
7838 * options.h (class Search_directory): Add is_system_directory.
7839 (class General_options): Declare is_in_system_directory.
7840 * options.cc (get_relative_sysroot): Make static.
7841 (get_default_sysroot): Make static.
7842 (General_optoins::is_in_system_directory): New function.
7843 * fileread.cc (Input_file::is_in_system_directory): New function.
7844 * fileread.h (class Input_file): Declare is_in_system_directory.
7845 * object.h (class Object): Add is_in_system_directory.
7846 (class Input_objects): Remove system_library_directory_ field.
7847 * object.cc (Input_objects::add_object): Don't set
7848 system_library_directory_.
7849 (input_objects::found_in_system_library_directory): Remove.
7850 * symtab.cc (Symbol_table::write_globals): Remove input_objects
7851 parameter. Change all callers.
7852 (Symbol_table::sized_write_globals): Likewise.
7853 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
7854 Call Object::is_in_system_directory.
7855 * symtab.h (class Symbol_table): Update declarations.
7856
61edd21f
ILT
7857 PR 5990
7858 * descriptors.h (Open_descriptor): Add is_on_stack field.
7859 * descriptors.cc (Descriptors::open): If the descriptor is on the
7860 top of the stack, remove it. Initialize is_on_stack field.
7861 (Descriptors::release): Only add pod to stack if it is not on the
7862 stack already.
7863 (Descriptors::close_some_descriptor): Clear stack_next and
7864 is_on_stack fields.
7865
e29e076a
ILT
7866 PR 7091
7867 * output.cc (Output_section::find_starting_output_address): Rename
7868 from starting_output_address; add PADDR parameter; change return
7869 type.
7870 * output.h (class Output_section): Declare
7871 find_starting_output_address instead of starting_output_address.
7872 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
7873 section symbol for which we can't find a merge section.
7874
0602e05a
ILT
7875 PR 9836
7876 * symtab.cc (Symbol_table::add_from_object): If the visibility is
7877 hidden or internal, force the symbol to be local.
7878 * resolve.cc (Symbol::override_visibility): Define.
7879 (Symbol::override_base): Use override_visibility.
7880 (Symbol_table::resolve): Likewise.
7881 (Symbol::override_base_with_special): Likewise.
7882 (Symbol_table::override_with_special): If the visibility is hidden
7883 or internal, force the symbol to be local.
7884 * symtab.h (class Symbol): Add set_visibility and
7885 override_visibility.
7886 * testsuite/ver_test_1.sh: New file.
7887 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
7888 (check_DATA): Add ver_test_1.syms.
7889 (ver_test_1.syms): New target.
7890 * testsuite/Makefile.in: Rebuild.
7891
401a9a73
CC
78922009-02-25 Cary Coutant <ccoutant@google.com>
7893
7894 * layout.cc (Layout::choose_output_section): Don't rename sections
7895 when using a linker script that has a SECTIONS clause.
7896 * Makefile.in: Regenerate.
7897
7898 * testsuite/Makefile.am (script_test_5.sh): New test case.
7899 * testsuite/Makefile.in: Regenerate.
7900 * testsuite/script_test_5.cc: New file.
7901 * testsuite/script_test_5.sh: New file.
7902 * testsuite/script_test_5.t: New file.
7903
f488e4b0
CC
79042009-02-13 Rafael Avila de Espindola <espindola@google.com>
7905
7906 * archive.cc (Archive::include_member): Update calls to add_symbols.
7907 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
7908 the Layout argument.
7909 * dynobj.h (do_add_symbols): Add the Layout argument.
7910 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
7911 Layout argument.
7912 * object.h (Object::add_symbols): Add the Layout argument.
7913 (Object::do_add_symbols): Add the Layout argument.
7914 (Sized_relobj::do_add_symbols): Add the Layout argument.
7915 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
7916 Unify the two versions.
7917 (Add_plugin_symbols): Remove.
7918 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
7919 (Sized_pluginobj::do_add_symbols): Unify the two versions.
7920 (Add_plugin_symbols): Remove.
7921 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
7922 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
7923 (Add_symbols::run): Make it work with Pulginobj.
7924
89dd1680
ILT
79252009-02-06 Ian Lance Taylor <iant@google.com>
7926
7927 * object.cc (Sized_relobj::do_layout): Make info message start
7928 with lower case letter.
7929
266d0a74
ILT
79302009-02-06 Mikolaj Zalewski <mikolajz@google.com>
7931
602b464e
ILT
7932 * binary.cc: Fix file comment.
7933
266d0a74
ILT
7934 * options.h (enum Incremental_disposition): Define.
7935 (class General_options): Add new options: --incremental,
7936 --incremental_changed, --incremental_unchanged,
7937 --incremental_unknown. Add incremental_disposition_ and
7938 implicit_incremental_ fields.
7939 (General_options::incremental_disposition): New function.
7940 (class Position_dependent_options): Add incremental_disposition
7941 option.
7942 (Position_dependent_options::copy_from_options): Set incremental
7943 dispositions.
7944 * options.cc (General_options::parse_incremental_changed): New
7945 function.
7946 (General_options::parse_incremental_unchanged): New function.
7947 (General_options::parse_incremental_unknown): New function.
7948 (General_options::General_options): Initialize new fields
7949 incremental_disposition_ and implicit_incremental_.
7950 (General_options::finalize): Check for uasge of --incremental-*
7951 without --incremental.
7952
f073bbf7
CD
79532009-02-06 Chris Demetriou <cgd@google.com>
7954
7955 * gold.h (gold_undefined_symbol): Change to take only a Symbol
7956 pointer and to report location as the file name associated with
7957 the symbol.
7958 (gold_undefined_symbol_at_location): New function to replace the
7959 old gold_undefined_symbol functionality.
7960 * target-reloc.h (relocate_section): Update to use
7961 gold_undefined_symbol_at_location.
7962 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
7963 Call gold_undefined_symbol function rather than gold_error.
7964 * errors.h (Errors::undefined_symbol): Take location as a
7965 string, rather than calculating it from a relocation.
7966 * errors.cc (Errors::fatal): Print "fatal error:" before the
7967 formatted message.
7968 (Errors::error, Errors::error_at_location): Print "error: "
7969 before the formatted message.
7970 (Errors::undefined_symbol): Take location as a string, rather
7971 than calculating it from a relocation.
7972 (gold_undefined_symbol_at_location): New function akin to
7973 old gold_undefined_symbol, calculates location from relocation.
7974 (gold_undefined_symbol): Change to take only a Symbol pointer
7975 and to report location as the file name associated with the symbol.
7976 * testsuite/debug_msg.sh: Update for changed error messages.
7977 * testsuite/undef_symbol.sh: Likewise.
7978
8e94a90c
ILT
79792009-02-04 Duncan Sands <baldrick@free.fr>
7980
7981 PR 9812
7982 * reduced_debug_output.h
7983 (Output_reduced_debug_abbrev_section::failed): Use format for
7984 gold_warning.
7985 (Output_reduced_debug_info_section::faild): Likewise.
7986
88a0e15b
ILT
79872009-01-31 Mikolaj Zalewski <mikolajz@google.com>
7988
7989 * script.cc (Lazy_demangler): New class.
7990 (Version_script_info::get_symbol_version_helper): Demangle a
7991 symbol only once.
7992
5efc7cd2
CC
79932009-01-29 Cary Coutant <ccoutant@google.com>
7994
7995 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
7996 to __tls_get_addr.
7997 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7998
e0ebcf42
ILT
79992009-01-28 Ian Lance Taylor <iant@google.com>
8000
5efc7cd2 8001 * version.cc (version_string): Bump to 1.9.
75fe7426 8002
e0ebcf42
ILT
8003 * gold.h: Include <cstring> and <stdint.h>.
8004 * version.cc: Include <cstdio>.
8005 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8006 warning.
8007 * reduced_debug_output.cc (insert_into_vector): Rename from
8008 Insert_into_vector; change all callers. Use Swap_unaligned to
8009 avoid aliasing issue; remove union since it is unnecessary.
8010
8e2813be 80112009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8012
8013 * Makefile.am (CCFILES): Add gc.cc.
8014 (HFILES): Add gc.h.
8015 * Makefile.in: Regenerate.
8016 * gold.cc (Gc_runner): New class.
8017 (queue_initial_tasks): Call garbage collection related tasks
8018 when corresponding options are invoked.
8019 (queue_middle_gc_tasks): New function.
8020 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8021 processed early before laying out sections during garbage collection.
8022 * gold.h (queue_middle_gc_tasks): New function.
8023 (is_prefix_of): Move from "layout.cc".
8024 * i386.cc (Target_i386::gc_process_relocs): New function.
8025 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8026 * main.cc (main): Create object of class "Garbage_collection".
8027 * object.cc (Relobj::copy_symbols_data): New function.
8028 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8029 (Sized_relobj::do_layout): Allow this function to be called twice
8030 during garbage collection and defer layout of section during the
6d03d481
ST
8031 first call.
8032 * object.h (Relobj::get_symbols_data): New function.
8033 (Relobj::is_section_name_included): New function.
8034 (Relobj::copy_symbols_data): New function.
8035 (Relobj::set_symbols_data): New function.
8036 (Relobj::get_relocs_data): New function.
8037 (Relobj::set_relocs_data): New function.
8038 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8039 (Relobj::gc_process_relocs): New function.
8040 (Relobj::do_gc_process_relocs): New pure virtual function.
8041 (Relobj::sd_): New data member.
8042 (Sized_relobj::is_output_section_offset_invalid): New function.
8043 (Sized_relobj::do_gc_process_relocs): New function.
8044 * options.h (General_options::gc_sections): Modify to not be a no-op.
8045 (General_options::print_gc_sections): New option.
8046 * plugin.cc (Plugin_finish::run): Remove function call to
8047 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8048 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8049 * reloc.cc (Read_relocs::run): Add task to process relocs and
8050 determine unreferenced sections when doing garbage collection.
8051 (Gc_process_relocs): New class.
8052 (Sized_relobj::do_gc_process_relocs): New function.
8053 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8054 sections that are garbage collected.
8055 * reloc.h (Gc_process_relocs): New class.
8056 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8057 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8058 symbols whose corresponding sections are garbage collected.
8059 (Symbol_table::Symbol_table): Add new parameter for the garbage
8060 collection object.
8061 (Symbol_table::gc_mark_undef_symbols): New function.
8062 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8063 (Symbol_table::gc_mark_dyn_syms): New function.
8064 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8065 as garbage.
8066 (Symbol_table::add_from_object): Likewise.
8067 (Symbol_table::add_from_relobj): When building shared objects, do not
8068 treat externally visible symbols as garbage.
8069 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8070 table information for static and relocatable links.
8071 * symtab.h (Symbol_table::set_gc): New function.
8072 (Symbol_table::gc): New function.
8073 (Symbol_table::gc_mark_undef_symbols): New function.
8074 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8075 (Symbol_table::gc_mark_dyn_syms): New function.
8076 (Symbol_table::gc_): New data member.
e1df38aa 8077 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8078 function.
8079 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8080 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8081
3b293544
CF
80822009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8083
8084 * options.h (General_options::gc_sections): Define as a no-op for now.
8085 (General_options::no_keep_memory): Ditto.
8086 (General_options::Bshareable): Define.
8087 * options.cc (General_options::finalize): Honor -Bshareable.
8088
83d22aa8
AS
80892009-01-20 Andreas Schwab <schwab@suse.de>
8090
8091 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8092 read the value in the contents, since we don't use it. Use the
8093 template endianness when writing.
8094 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8095
cd536b21
AS
80962009-01-19 Andreas Schwab <schwab@suse.de>
8097
8098 * configure.tgt (powerpc64-*): Fix targ_obj.
8099
99e9a495
ILT
81002009-01-15 Ian Lance Taylor <iant@google.com>
8101
8102 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8103 local symbols when stripping all symbols.
8104
bbbfea06
CC
81052009-01-14 Cary Coutant <ccoutant@google.com>
8106
99e9a495 8107 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8108
0f7c0701
CC
81092009-01-14 Cary Coutant <ccoutant@google.com>
8110
8111 * archive.cc (Archive::get_elf_object_for_member): Remove call
8112 to File_read::claim_for_plugin.
8113 * descriptors.cc (Descriptors::open): Remove reference to
8114 is_claimed.
8115 (Descriptors::claim_for_plugin): Remove.
8116 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8117 (Descriptors::is_claimed): Remove.
8118 (claim_descriptor_for_plugin): Remove.
8119 * fileread.cc (File_read::claim_for_plugin): Remove.
8120 * fileread.h (File_read::claim_for_plugin): Remove.
8121 (File_read::descriptor): Reopen descriptor if necessary.
8122 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8123 (Plugin_manager::all_symbols_read): Add task parameter. Change
8124 all callers.
8125 (Plugin_manager::get_input_file): New function.
8126 (Plugin_manager::release_input_file): New function.
8127 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8128 corresponding data member.
8129 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8130 and pass to base constructor. Change all callers.
8131 (get_input_file, release_input_file): New functions.
8132 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8133 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8134 (Plugin_manager::all_symbols_read): Add task parameter.
8135 (Plugin_manager::get_input_file): New function.
8136 (Plugin_manager::release_input_file): New function.
8137 (Plugin_manager::task_): New data member.
8138 (Pluginobj::Pluginobj): Add filesize parameter.
8139 (Pluginobj::filename): New function.
8140 (Pluginobj::descriptor): New function.
8141 (Pluginobj::filesize): New function.
8142 (Pluginobj::filesize_): New data member.
8143 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8144 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8145 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8146
8147 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8148 with archive libraries.
8149 * testsuite/Makefile.in: Regenerate.
8150 * testsuite/plugin_test.c (struct sym_info): New type.
8151 (get_input_file, release_input_file): New static variables.
8152 (onload): Capture new transfer vector entries.
8153 (claim_file_hook): Stop reading at end of file according to filesize.
8154 Factor out parsing of readelf output into separate function.
8155 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8156 APIs and get the source file name from the symbol table. Convert
8157 source file name to corresponding object file name. Print info
8158 message when adding new input files.
8159 (parse_readelf_line): New function.
8160 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8161 * testsuite/plugin_test_2.sh: Likewise.
8162 * testsuite/plugin_test_3.sh: Likewise.
8163 * testsuite/plugin_test_4.sh: New test case.
8164
62a6d109
ILT
81652009-01-07 Ian Lance Taylor <iant@google.com>
8166
8167 * version.cc (version_string): Bump to 1.8.
8168
483620e8
CC
81692008-12-23 Cary Coutant <ccoutant@google.com>
8170
8171 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8172 * plugin.cc (Plugin_manager::finish): Rename as
8173 layout_deferred_objects. Move cleanup to separate function.
8174 (Plugin_manager::cleanup): New function.
8175 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8176 separately.
8177 * plugin.h (Plugin_manager::finish): Rename as
8178 layout_deferred_objects.
8179 (Plugin_manager::cleanup): New function.
8180 (Plugin_manager::cleanup_done): New field.
8181
d66a9eb3
CC
81822008-12-23 Cary Coutant <ccoutant@google.com>
8183
8184 * plugin.cc (is_visible_from_outside): New function.
8185 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8186 so we don't return "IR only" status for exported symbols or -r links.
8187
8188 * testsuite/Makefile.am (plugin_test_3): New test case.
8189 * testsuite/Makefile.in: Regenerate.
8190 * testsuite/plugin_test_3.sh: New file.
8191
5995b570
CC
81922008-12-22 Cary Coutant <ccoutant@google.com>
8193
8194 * object.cc (Sized_relobj::layout_section): New function.
8195 (Sized_relobj::do_layout): Defer layout of input sections until after
8196 plugin has provided replacement files.
8197 (Sized_relobj::do_layout_deferred_sections): New function.
8198 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8199 (Relobj::layout_deferred_sections): New function.
8200 (Relobj::do_layout_deferred_sections): New function.
8201 (Sized_relobj::do_layout_deferred_sections): New function.
8202 (Sized_relobj::layout_section): New function.
8203 (Sized_relobj::Deferred_layout): New structure.
8204 (Sized_relobj::deferred_layout_): New field.
8205 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8206 Change all callers. Layout deferred sections.
8207 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8208 references.
8209 (Plugin_hook::run): Move code from do_plugin_hook inline.
8210 (Plugin_hook::do_plugin_hook): Remove.
8211 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8212 (Plugin_manager::finish): Renamed, was cleanup.
8213 (Plugin_manager::should_defer_layout): New function.
8214 (Plugin_manager::add_deferred_layout_object): New function.
8215 (Plugin_manager::Deferred_layout_list): New type.
8216 (Plugin_manager::deferred_layout_objects_): New field.
8217 (Plugin_hook::do_plugin_hook): Remove.
8218
ee769c88
ILT
82192008-12-17 Ian Lance Taylor <iant@google.com>
8220
8221 * options.h (class General_options): Add --no case for
8222 --export-dynamic.
8223
abc8dcba
CC
82242008-12-16 Cary Coutant <ccoutant@google.com>
8225
8226 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8227 vector.
8228 (Plugin_manager::claim_file): Create plugin object even if
8229 plugin did not call the add_symbols callback.
8230 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8231 asking for more symbols than were added.
8232 * testsuite/Makefile.am (plugin_test_1): Add test case with
8233 no global symbols.
8234 (empty.syms): New target.
8235 * testsuite/Makefile.in: Regenerate.
8236 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8237 message. Don't call add_symbols if no globals.
8238 (all_symbols_read_hook): Don't provide replacement for empty
8239 claimed file.
8240
b0074644
ILT
82412008-12-12 Ian Lance Taylor <iant@google.com>
8242
68943102
ILT
8243 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8244 r_type == 0 for a local symbol with r_sym == 0.
8245 (scan_relocatable_relocs): Pass r_sym to
8246 local_non_section_strategy.
8247 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8248 r_sym parameter.
8249
b0074644
ILT
8250 * configure.ac: Update test for TLS descriptors: they are
8251 supported as of glibc 2.9.
8252 * configure: Rebuild.
8253
c2508178
ILT
82542008-12-11 Ian Lance Taylor <iant@google.com>
8255
8256 PR 7091
8257 * target-reloc.h (Default_scan_relocatable_relocs): For each
8258 function, map r_type == 0 to RELOC_DISCARD.
8259
2756a258
CC
82602008-12-10 Cary Coutant <ccoutant@google.com>
8261
8262 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8263 object to override a kept COMDAT group from a plugin object.
8264
bb6f53d3
ILT
82652008-12-09 Ian Lance Taylor <iant@google.com>
8266
fbc558e1
ILT
8267 PR 7088
8268 * yyscript.y (file_cmd): Handle INPUT.
8269
bb6f53d3
ILT
8270 * testsuite/initpri1.c: Change all declarations to be full
8271 prototypes by adding void, to avoid compiler warnings.
8272
4674ecfc
CC
82732008-12-05 Rafael Avila de Espindola <espindola@google.com>
8274
8275 * options.cc (General_options::parse_plugin_opt): New.
8276 (General_options::add_plugin): The argument now is just the filename.
8277 (General_options::add_plugin_option): New.
8278 * options.h (plugin_opt): New.
8279 (add_plugin): Change argument name.
8280 (add_plugin_option): New.
8281 * plugin.cc (Plugin::load): Don't parse the plugin option.
8282 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8283 (Plugin::add_option): New.
8284 (Plugin::args_): Change type.
8285 (Plugin::filename_): New.
8286 (Plugin_manager::add_plugin_option): New.
8287 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8288 * testsuite/Makefile.in: Regenerate.
8289
fd06b4aa
CC
82902008-12-05 Cary Coutant <ccoutant@google.com>
8291
8292 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8293 Handle --strip-lto-sections option.
8294 * options.h (strip_lto_sections): New option.
8295
6c52134c
CC
82962008-12-01 Cary Coutant <ccoutant@google.com>
8297
8298 * plugin.cc (ld_plugin_message): Change format parameter to const.
8299 Fix mismatch between new[] and delete.
8300
a45248e0
CC
83012008-11-14 Cary Coutant <ccoutant@google.com>
8302
8303 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
8304 instead of -1U.
8305
c82fbeee
CS
83062008-11-05 Craig Silverstein <csilvers@google.com>
8307
8308 * options.cc (General_options::parse_dynamic_list): New function.
8309 * options.h (General_options): New flags dynamic_list,
8310 dynamic_list_data, dynamic_list_cpp_new, and
8311 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
8312 (General_options::in_dynamic_list): New function.
8313 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
8314 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
8315 (Lex::can_continue_name): Likewise.
8316 (yylex): Likewise.
8317 (read_script_file): New parameter script_options.
8318 (read_dynamic_list): New function.
8319 (Script_options::define_dynamic_list): New function.
8320 (dynamic_list_keyword_parsecodes): New variable.
8321 (dynamic_list_keywords): New variable.
8322 * script.h (Script_options::define_dynamic_list): New function
8323 prototype.
8324 (read_dynamic_list): New function prototype.
8325 * symtab.cc (strprefix): New macro.
8326 (Symbol::should_add_dynsym_entry): Support dynamic_list,
8327 dynamic_list_data, dynamic_list_cpp_new, and
8328 dynamic_list_cpp_typeinfo.
8329 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
8330 (dynamic_list_expr): New rule.
8331 (dynamic_list_nodes): Likewise.
8332 (dynamic_list_node): Likewise.
8333 * testsuite/Makefile.am (dynamic_list): New test.
8334 * testsuite/Makefile.in: Regenerated.
8335 * testsuite/dynamic_list.t: New file.
8336 * testsuite/dynamic_list.sh: New file.
8337
e0bb29a5
CS
83382008-11-05 Craig Silverstein <csilvers@google.com>
8339
8340 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
8341 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
8342 (t11_last): Likewise.
8343 * testsuite/ver_test_6.c (main): Likewise.
8344
4e1e25e0
CC
83452008-10-07 Cary Coutant <ccoutant@google.com>
8346
8347 * options.c (General_options::finalize): Add check for -static and
8348 -shared.
8349 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
8350 is not empty.
8351
92f03fcb
CC
83522008-10-02 Cary Coutant <ccoutant@google.com>
8353
8354 * plugin.cc (make_sized_plugin_object): Fix conditional
8355 compilation to work when not all targets are enabled.
8356
fbd8a257
CC
83572008-09-29 Cary Coutant <ccoutant@google.com>
8358
8359 * archive.cc (Archive::get_file_and_offset): Use filename instead
8360 of name to get library path.
8361 (Archive::include_member): Unlock external member of a thin archive.
8362
8363 * testsuite/Makefile.am (TEST_AR): New variable.
8364 (thin_archive_test_1): New test.
8365 (thin_archive_test_2): New test.
81636b3f
CC
8366 * testsuite/Makefile.in: Regenerate.
8367 * testsuite/thin_archive_main.cc: New file.
8368 * testsuite/thin_archive_test_1.cc: New file.
8369 * testsuite/thin_archive_test_2.cc: New file.
8370 * testsuite/thin_archive_test_3.cc: New file.
8371 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 8372
eff45813
CC
83732008-09-29 Cary Coutant <ccoutant@google.com>
8374
8375 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
8376 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
8377 instead of -1U.
8378 (Sized_relobj::do_finalize_local_symbols): Likewise.
8379 (Sized_relobj::map_to_kept_section): Likewise.
8380 * object.h (Sized_relobj::invalid_address): New constant.
8381 (Sized_relobj::do_output_section_offset): Check for invalid_address
8382 and return -1ULL.
8383 * output.cc (Output_reloc::local_section_offset): Use constant
8384 invalid_address instead of -1U.
8385 (Output_reloc::get_address): Likewise.
8386 (Output_section::output_address): Change -1U to -1ULL.
8387 * output.h (Output_reloc::invalid_address): New constant.
8388 * reloc.cc (Sized_relobj::write_sections): Use constant
8389 invalid_address instead of -1U.
8390 (Sized_relobj::relocate_sections): Likewise.
8391 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
8392 values for merge sections.
8393 * target-reloc.h (relocate_for_relocatable): Use constant
8394 invalid_address instead of -1U.
8395
89fc3421
CC
83962008-09-19 Cary Coutant <ccoutant@google.com>
8397
8398 Add plugin functionality for link-time optimization (LTO).
8399 * configure.ac (plugins): Add --enable-plugins option.
8400 * configure: Regenerate.
8401 * config.in: Regenerate.
8402 * Makefile.am (LIBDL): New variable.
8403 (CCFILES): Add plugin.cc.
8404 (HFILES): Add plugin.h.
8405 (ldadd_var): Add LIBDL.
8406 * Makefile.in: Regenerate.
8407
8408 * archive.cc: Include "plugin.h".
8409 (Archive::setup): Don't preread archive symbols when using a plugin.
8410 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
8411 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
8412 files.
8413 (Archive::include_member): Add symbols from plugin objects.
8414 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
8415 * descriptors.cc (Descriptors::open): Check for file descriptors
8416 abandoned by plugins.
8417 (Descriptors::claim_for_plugin): New function.
8418 * descriptors.h (Descriptors::claim_for_plugin): New function.
8419 (Open_descriptor::is_claimed): New field.
8420 (claim_descriptor_for_plugin): New function.
8421 * fileread.cc (File_read::claim_for_plugin): New function.
8422 * fileread.h (File_read::claim_for_plugin): New function.
8423 (File_read::descriptor): New function.
8424 * gold.cc: Include "plugin.h".
8425 (queue_initial_tasks): Add task to call plugin hooks for generating
8426 new object files.
8427 * main.cc: Include "plugin.h".
8428 (main): Load plugin libraries.
8429 * object.h (Pluginobj): Declare.
8430 (Object::pluginobj): New function.
8431 (Object::do_pluginobj): New function.
8432 (Object::set_target): New function.
8433 * options.cc: Include "plugin.h".
8434 (General_options::parse_plugin): New function.
8435 (General_options::General_options): Initialize plugins_ field.
8436 (General_options::add_plugin): New function.
8437 * options.h (Plugin_manager): Declare.
8438 (General_options): Add --plugin option.
8439 (General_options::has_plugins): New function.
8440 (General_options::plugins): New function.
8441 (General_options::add_plugin): New function.
8442 (General_options::plugins_): New field.
8443 * plugin.cc: New file.
8444 * plugin.h: New file.
8445 * readsyms.cc: Include "plugin.h".
8446 (Read_symbols::do_read_symbols): Check for archive before checking
8447 for ELF file. Call plugin hooks to claim files.
8448 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
8449 from a real object file; force override when processing replacement
8450 files.
8451 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
8452 (Symbol::init_base_object): Likewise.
8453 (Symbol::init_base_output_data): Likewise.
8454 (Symbol::init_base_output_segment): Likewise.
8455 (Symbol::init_base_constant): Likewise.
8456 (Symbol::init_base_undefined): Likewise.
8457 (Symbol::output_section): Assert that object is not a plugin.
8458 (Symbol_table::add_from_pluginobj): New function.
8459 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
8460 undefined.
8461 (Symbol_table::sized_write_globals): Likewise.
8462 (Symbol_table::add_from_pluginobj): Instantiate template.
8463 * symtab.h (Sized_pluginobj): Declare.
8464 (Symbol::in_real_elf): New function.
8465 (Symbol::set_in_real_elf): New function.
8466 (Symbol::in_real_elf_): New field.
8467 (Symbol_table::add_from_pluginobj): New function.
8468
8469 * testsuite/Makefile.am (AM_CFLAGS): New variable.
8470 (LIBDL): New variable.
8471 (LDADD): Add LIBDL.
8472 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
8473 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
8474 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
8475 (MOSTLYCLEANFILES): Likewise.
8476 * testsuite/Makefile.in: Regenerate.
8477 * testsuite/plugin_test.c: New file.
8478 * testsuite/plugin_test_1.sh: New file.
8479 * testsuite/plugin_test_2.sh: New file.
8480
de31bda5
ILT
84812008-09-16 Ian Lance Taylor <iant@google.com>
8482
9c2d0ef9
ILT
8483 * target-reloc.h (relocate_section): Check whether a symbol is
8484 defined by the ABI before reporting an undefined symbol error.
8485 * target.h (Target::is_defined_by_abi): Make parameter const.
8486 (Target::do_is_defined_by_abi): Likewise.
8487 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
8488 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
8489 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
8490 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
8491 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
8492 * testsuite/Makefile.in: Rebuild.
8493
de31bda5
ILT
8494 * fileread.cc (make_view): Add casts to avoid warning.
8495
9fa33bee
AO
84962008-09-16 Alexandre Oliva <aoliva@redhat.com>
8497
8498 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
8499 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8500
183fd0e3
AO
85012008-09-16 Alexandre Oliva <aoliva@redhat.com>
8502
8503 * options.h (General_options::output_is_executable): New.
8504 (General_options::output_is_pie): New.
8505 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
8506 for shared libraries.
8507 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8508
7be8330a
CD
85092008-09-11 Chris Demetriou <cgd@google.com>
8510
8511 * options.h (origin): New -z option.
8512 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
8513 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
8514 in DT_FLAGS_1.
8515
a9caad02
CC
85162008-09-05 Cary Coutant <ccoutant@google.com>
8517
8518 * fileread.cc (File_read::make_view): Add check for attempt to map
8519 beyond end of file.
8520
ae6dce4d
CC
85212008-09-05 Cary Coutant <ccoutant@google.com>
8522
8523 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
8524 explicit instantiations.
8525
d7ab2a47
KVH
85262008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
8527
8528 PR gold/6858
8529 * options.cc (General_options::finalize): Allow undefined symbols
8530 in shlibs if linking -shared.
8531
8532 PR gold/6859
8533 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
8534 symbols as not needing a dynsym entry.
8535
1e52a9c1
CS
85362008-08-20 Craig Silverstein <csilvers@google.com>
8537
8538 * fileread.cc (File_read::open): Do not lock the file unless it
8539 was successfully opened.
8540
d85c80a3
CC
85412008-08-14 Cary Coutant <ccoutant@google.com>
8542
8543 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
8544 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
8545 * testsuite/tls_test.cc (struct int128): 128-bit struct
8546 for testing TLS relocs with non-zero addend.
8547 (v12): New TLS variable.
8548 (t12): New test.
8549 (t_last): Add check for v12.
8550 * testsuite/tls_test.h (t12): New function.
8551 * testsuite/tls_test_main.cc (thread_routine): Call new test.
8552
2d924fd9
ILT
85532008-08-13 Ian Lance Taylor <iant@google.com>
8554
8555 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
8556 set tls_segment_ or relro_segment_.
8557 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
8558 when appropriate.
8559 * output.h (Output_section::clear_is_relro): New function.
8560 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
8561 sections specially even when output_data_ is empty.
8562 (Output_segment::maximum_alignment): When first section is relro,
8563 only force alignment for PT_LOAD segments.
8564 * script.cc (script_data_segment_align): New function.
8565 (script_data_segment_relro_end): New function.
8566 * script-c.h (script_data_segment_align): Declare.
8567 (script_data_segment_relro_end): Declare.
8568 * script-sections.h (class Script_sections): Declare
8569 data_segment_align and data_segment_relro_end. Add fields
8570 segment_align_index_ and saw_relro_end_.
8571 * script-sections.cc (class Sections_element): Add set_is_relro
8572 virtual function. Add new bool* parameter to place_orphan_here.
8573 Add get_output_section virtual function.
8574 (class Output_section_definition): Add set_is_relro. Add new
8575 bool* parameter to place_orphan_here. Add get_output_section.
8576 Add is_relro_ field.
8577 (Output_section_definition::Output_section_definition): Initialize
8578 evaluated_address_, evaluated_load_address, evaluated_addralign_,
8579 and is_relro_ fields.
8580 (Output_section_definition::place_orphan_here): Add is_relro
8581 parameter.
8582 (Output_section_definition::set_section_addresses): Set relro for
8583 output section.
8584 (Output_section_definition::alternate_constraint): Likewise.
8585 (class Orphan_output_section): Add new bool* parameter to
8586 place_orphan_here. Add get_output_section.
8587 (Orphan_output_section::place_orphan_here): Add is_relro
8588 parameter.
8589 (Script_sections::Script_sections): Initialize
8590 data_segment_align_index_ and saw_relro_end_.
8591 (Script_sections::data_segment_align): New function.
8592 (Script_sections::data_segment_relro_end): New function.
8593 (Script_sections::place_orphan): Set or clear is_relro.
8594 (Script_sections::set_section_addresses): Force alignment of first
8595 TLS section.
8596 * yyscript.y (exp): Call script_data_segment_align and
8597 script_data_segment_relro_end.
8598 * testsuite/relro_script_test.t: New file.
8599 * testsuite/relro_test.cc (using_script): Declare.
8600 (t1, t2): Test using_script.
8601 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
8602 (relro_script_test_SOURCES): Define.
8603 (relro_script_test_DEPENDENCIES): Define.
8604 (relro_script_test_LDFLAGS): Define.
8605 (relro_script_test_LDADD): Define.
8606 (relro_script_test.so): New target.
8607 * testsuite/Makefile.in: Rebuild.
8608
f827c9a9
CC
86092008-08-06 Cary Coutant <ccoutant@google.com>
8610
8611 * archive.cc (Archive::total_archives, Archive::total_members)
8612 (Archive::total_members_loaded): New variables.
8613 (Archive::setup): Add parameter. Add option to preread
8614 archive symbols.
8615 (Archive::read_armap): Add counter.
8616 (Archive::get_file_and_offset): New function.
8617 (Archive::get_elf_object_for_member): New function.
8618 (Archive::read_all_symbols): New function.
8619 (Archive::read_symbols): New function.
8620 (Archive::add_symbols): Add counters.
8621 (Archive::include_all_members): Use armap to find members if it's
8622 already built.
8623 (Archive::include_member): Skip reading symbols if already read.
8624 Factored code into Archive::get_file_and_offset and
8625 Archive::get_elf_object_for_member. Changed call to
8626 Mapfile::report_include_archive_member.
8627 (Archive::print_stats): New function.
8628 * archive.h: Declare Object and Read_symbols_data classes.
8629 (Archive::Archive): Add initializers for new members.
8630 (Archive::setup): Add parameter.
8631 (Archive::print_stats): New function.
8632 (Archive::total_archives, Archive::total_members)
8633 (Archive::total_members_loaded): New variables.
8634 (Archive::get_file_and_offset): New function.
8635 (Archive::get_elf_object_for_member): New function.
8636 (Archive::read_all_symbols): New function.
8637 (Archive::read_symbols): New function.
8638 (Archive::Archive_member): New class.
8639 (Archive::members_): New member.
8640 (Archive::num_members_): New member.
8641 * main.cc: Include archive.h.
8642 (main): Call Archive::print_stats.
8643 * mapfile.cc (Mapfile::report_include_archive_member): Delete
8644 archive parameter; member_name is now the fully-decorated name.
8645 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
8646 * options.h: (General_options): Add --preread-archive-symbols option.
8647 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
8648 Archive::setup.
8649
de4c45bd
ILT
86502008-08-04 Ian Lance Taylor <iant@google.com>
8651
8652 * symtab.h (Symbol::use_plt_offset): New function.
8653 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
8654 * powerpc.cc (Relocate::relocate): Likewise.
8655 * sparc.cc (Relocate::relocate): Likewise.
8656 * x86_64.cc (Relocate::relocate): Likewise.
8657 * testsuite/weak_plt.sh: New test.
8658 * testsuite/weak_plt_main.cc: New test.
8659 * testsuite/weak_plt_shared.cc: New test.
8660 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
8661 (check_PROGRAMS): Add weak_plt.
8662 (check_DATA): Add weak_plt_shared.so.
8663 (weak_plt_main_pic.o, weak_plt): New targets.
8664 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
8665 * testsuite/Makefile.in: Rebuild.
8666
8667 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
8668 gcctestdir/ld.
8669 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
8670 * testsuite/Makefile.in: Rebuild.
8671
323ee3f4
AM
86722008-08-04 Alan Modra <amodra@bigpond.net.au>
8673
8674 * Makefile.am (POTFILES.in): Set LC_ALL=C.
8675 * Makefile.in: Regenerate.
8676 * po/POTFILES.in: Regenerate.
8677
7c07ecec
ILT
86782008-07-29 Ian Lance Taylor <iant@google.com>
8679
8680 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
8681 symbols before other symbols.
8682 * testsuite/script_test_2.cc (test_addr): Declare.
8683 (test_addr_alias): Declare.
8684 (main): Check that test_addr and test_addr_alias have the right
cd536b21 8685 values.
7c07ecec
ILT
8686 * testsuite/script_test_2.t: Define test_addr_alias and
8687 test_addr.
8688
5778530e
ILT
86892008-07-24 Ian Lance Taylor <iant@google.com>
8690
2a00e4fb
ILT
8691 PR 5990
8692 * descriptors.cc: New file.
8693 * descriptors.h: New file.
8694 * gold-threads.h (class Hold_optional_lock): New class.
8695 * fileread.cc: Include "descriptors.h".
8696 (File_read::~File_read): Release descriptor rather than closing
8697 it.
8698 (File_read::open) [file]: Call open_descriptor rather than open.
8699 Set is_descriptor_opened_.
8700 (File_read::open) [memory]: Assert that descriptor is not open.
8701 (File_read::reopen_descriptor): New function.
8702 (File_read::release): Release descriptor.
8703 (File_read::do_read): Make non-const. Reopen descriptor.
8704 (File_read::read): Make non-const.
8705 (File_read::make_view): Reopen descriptor.
8706 (File_read::do_readv): Likewise.
8707 * fileread.h (class File_read): Add is_descriptor_opened_ field.
8708 Update declarations.
8709 * layout.cc: Include "descriptors.h".
8710 (Layout::create_build_id): Use open_descriptor rather than open.
8711 * output.cc: Include "descriptors.h".
8712 (Output_file::open): Use open_descriptor rather than open.
8713 * archive.cc (Archive::const_iterator): Change Archive to be
8714 non-const.
8715 (Archive::begin, Archive::end): Make non-const.
8716 (Archive::count_members): Likewise.
8717 * archive.h (class Archive): Update declarations.
8718 * object.h (Object::read): Make non-const.
8719 * Makefile.am (CCFILES): Add descriptors.cc.
8720 (HFILES): Add descriptors.h.
8721 * Makefile.in: Rebuild.
8722
801647d1
ILT
8723 PR 6716
8724 * gold.h: Always include <clocale>. Add Solaris workarounds
8725 following code in binutils/sysdep.h.
8726
5edd166e
ILT
8727 PR 6048
8728 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
8729 this->eh_frame_hdr_ is NULL before using it.
8730
c89ad728
ILT
8731 * dynobj.cc (Versions::Versions): Update comment.
8732
aa86f06b
ILT
8733 * dynobj.cc (Versions::Versions): If there is an soname, use it as
8734 the base version name.
8735
5778530e
ILT
8736 * stringpool.cc (Stringpool_template::add_with_length): Set key to
8737 array size plus one.
8738 (Stringpool_template::set_string_offsets): Subtract one from key
8739 before using it as an array index.
8740 (Stringpool_template::get_offset_with_length): Likewise.
8741 (Stringpool_template::write_to_buffer): Likewise.
8742 * stringpool.h (Stringpool_template::get_offset_from_key):
8743 Likewise.
8744
057ead22
ILT
87452008-07-23 Ian Lance Taylor <iant@google.com>
8746
7f649c59
ILT
8747 PR 6658
8748 * object.h (Merged_symbol_value::value): Do our best to handle a
8749 negative addend.
8750
057ead22
ILT
8751 PR 6647
8752 * script.cc (Version_script_info::get_versions): Don't add empty
8753 version tag to return value.
8754 (Version_script_info::get_symbol_version_helper): Change return
8755 type to bool. Add pversion parameter. Change all callers.
8756 (script_register_vers_node): Don't require a non-NULL tag.
8757 * script.h (class Version_script_info): Update declarations.
8758 (Version_script_info::get_symbol_version): Change return type to
8759 bool. Add version parameter. Change all callers.
8760 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
8761 handling. Handle an empty version from a version script.
8762 (Symbol_table::define_special_symbol): Likewise.
8763 * testsuite/ver_test_10.script: New file.
8764 * testsuite/ver_test_10.sh: New file.
8765 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
8766 (check_DATA): Add ver_test_10.syms.
8767 (ver_test_10.syms, ver_test_10.so): New target.
8768 * testsuite/Makefile.in: Rebuild.
8769
58e54ac2
CD
87702008-07-23 Simon Baldwin <simonb@google.com>
8771
8772 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
8773 to zero for undefined symbols from dynamic libraries.
8774
95d14cd3
ILT
87752008-07-23 Ian Lance Taylor <iant@google.com>
8776
8777 * symtab.cc (Symbol_table::resolve): Remove version parameter.
8778 Change all callers.
8779 * symtab.h (class Symbol_table): Update declaration.
8780 * testsuite/ver_test_9.cc: New file.
8781 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
8782 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
8783 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
8784 (ver_test_9.so, ver_test_9.o): New targets.
8785 * testsuite/Makefile.in: Rebuild.
8786
92de84a6
ILT
87872008-07-22 Ian Lance Taylor <iant@google.com>
8788
34810851
ILT
8789 * options.h (class General_options): Define --check-sections.
8790 * layout.cc (Layout::set_segment_offsets): Handle
8791 --check-sections.
8792
af6156ef
ILT
8793 * options.h (class General_options): Define -n/--nmagic and
8794 -N/--omagic.
8795 * options.cc (General_options::finalize): For -n/--nmagic or
8796 -N/--omagic, set -static.
8797 * layout.cc (Layout::attach_allocated_section_to_segment): If
8798 -N/--omagic, don't put read-only and read-write sections in
8799 different segments.
8800 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
8801 finding a read-only segment.
8802 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
8803 don't set the minimum segment alignment to the common page size,
8804 and don't set the file offset to the address modulo the page size.
8805 * script-sections.cc (Script_sections::create_segments): If
8806 -n/--omagic, don't put read-only and read-write sections in
8807 different segments.
8808
92de84a6
ILT
8809 * cref.cc: New file.
8810 * cref.h: New file.
8811 * options.h (class General_options): Add --print-symbol-counts.
8812 * main.cc (main): Issue defined symbol report if requested.
8813 * archive.cc (Archive::interpret_header): Make into a const member
8814 function.
8815 (Archive::add_symbols): Call Input_objects::archive_start and
8816 archive_stop.
8817 (Archive::const_iterator): Define new class.
8818 (Archive::begin, Archive::end): New functions.
8819 (Archive::include_all_members): Rewrite to use iterator.
8820 (Archive::count_members): New function.
8821 * archive.h (class Archive): Update declarations.
8822 (Archive::filename): New function.
8823 * object.cc: Include "cref.h".
8824 (Sized_relobj::Sized_relobj): Initialize defined_count_.
8825 (Sized_relobj::do_get_global_symbol_counts): New function.
8826 (Input_objects::add_object): Add object to cross-referencer.
8827 (Input_objects::archive_start): New function.
8828 (Input_objects::archive_stop): New function.
8829 (Input_objects::print_symbol_counts): New function.
8830 * object.h: Declare Cref and Archive.
8831 (Object::get_global_symbol_counts): New function.
8832 (Object::do_get_global_symbol_counts): New pure virtual function.
8833 (class Sized_relobj): Add defined_count_ field. Update
8834 declarations.
8835 (class Input_objects): Add cref_ field. Update constructor.
8836 Update declarations.
8837 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
8838 defined_count_.
8839 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
8840 symbol counts.
8841 (Sized_dynobj::do_get_global_symbol_counts): New function.
8842 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
8843 defined_count_. Update declarations. Define Symbols typedef.
8844 * symtab.cc (Symbol_table::add_from_relobj): Add defined
8845 parameter. Change all callers.
8846 (Symbol_table::add_from_dynobj): Add sympointers and defined
8847 parameters. Change all callers.
8848 * symtab.h (class Symbol_table): Update declarations.
8849 * Makefile.am (CCFILES): Add cref.cc.
8850 (HFILES): Add cref.h.
8851 * Makefile.in: Rebuild.
8852
3f7c5e1d
CD
88532008-07-22 Simon Baldwin <simonb@google.com>
8854
8855 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
8856 to zero when writing undefined symbols.
8857
e0b64032
ILT
88582008-07-22 Ian Lance Taylor <iant@google.com>
8859
8860 * output.cc (Output_section::add_input_section): Don't try to
8861 merge empty merge sections.
8862
096b02cf
CS
88632008-07-21 Craig Silverstein <csilvers@google.com>
8864
8865 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8866 Include symbol version in error message.
cd536b21 8867
1d1f116d
CD
88682008-07-20 Chris Demetriou <cgd@google.com>
8869
cd536b21 8870 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
8871 (RANDOM_SEED_CFLAGS): New substituted variable.
8872 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
8873 * configure: Rebuild.
8874 * Makefile.in: Likewise.
8875 * testsuite/Makefile.in: Likewise.
8876
a18f591e
ILT
88772008-07-18 Ian Lance Taylor <iant@google.com>
8878
8879 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
8880 where we see NAME/NULL and NAME/VERSION as separate symbols.
8881 * testsuite/ver_test_main.cc (main): Call t4.
8882 (t4, t4_2a): Define.
8883 * testsuite/ver_test_2.cc (t4_2): Define.
8884 * testsuite/ver_test_2.script: Put t4_2a in VER2.
8885 * testsuite/ver_test_4.cc (t4_2a): Define.
8886 * testsuite/ver_test_4.script: Put t4_2a in VER2.
8887 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
8888
c6e3f6ed
ILT
88892008-07-17 Ian Lance Taylor <iant@google.com>
8890
8891 * dynobj.cc (Versions::add_def): If we give an error about a
8892 missing version, go ahead and create the version anyhow.
8893
ef9beddf
ILT
88942008-07-10 Ian Lance Taylor <iant@google.com>
8895
8896 Handle output sections with more than 0x7fffffff bytes.
8897 * object.h (class Relobj): Change map_to_output_ to
8898 output_sections_, and just keep a section pointer. Change all
8899 uses. Move comdat group support to Sized_relobj.
8900 (Relobj::is_section_specially_mapped): Remove.
8901 (Relobj::output_section): Remove poff parameter. Change all
8902 callers.
8903 (Relobj::output_section_offset): New function.
8904 (Relobj::set_section_offset): Rewrite.
8905 (Relobj::map_to_output): Remove.
8906 (Relobj::output_sections): New function.
8907 (Relobj::do_output_section_offset): New pure virtual function.
8908 (Relobj::do_set_section_offset): Likewise.
8909 (class Sized_relobj): Add section_offsets_ field. Add comdat
8910 group support from Relobj. Update declarations.
8911 (Sized_relobj::get_output_section_offset): New function.
8912 (Sized_relobj::do_output_section_offset): New function.
8913 (Sized_relobj::do_set_section_offset): New function.
8914 * object.cc (Relobj::output_section_address): Remove.
8915 (Sized_relobj::Sized_relobj): Initialize new fields.
8916 (Sized_relobj::include_section_group): Cast find_kept_object to
8917 Sized_relobj.
8918 (Sized_relobj::include_linkonce_section): Likewise.
8919 (Sized_relobj::do_layout): Use separate arrays for output section
8920 and output offset.
8921 (Sized_relobj::do_count_local_symbols): Change map_to_output to
8922 output_sections.
8923 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
8924 output_sections and section_offsets.
8925 (Sized_relobj::write_local_symbols): Likewise.
8926 (map_to_kept_section): Compute output address directly.
8927 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
8928 output_sections and section_offsets.
8929 (Sized_relobj::write_sections): Likewise.
8930 (Sized_relobj::relocate_sections): Likewise.
8931 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
8932 * output.h (class Output_reloc): Update declarations. Change
8933 u2_.relobj to Sized_relobj*.
8934 (class Output_data_reloc): Change add functions to use
8935 Sized_relobj*.
8936 * output.cc (Output_reloc::Output_reloc): Change relobj to
8937 Sized_relobj*.
8938 (Output_reloc::local_section_offset): Change return type to
8939 Elf_Addr. Use get_output_section_offset.
8940 (Output_reloc::get_address): Likewise.
8941 (Output_section::is_input_address_mapped): Don't call
8942 is_section_specially_mapped.
8943 (Output_section::output_offset): Likewise.
8944 (Output_section::output_address): Likewise.
8945 (Output_section::starting_output_address): Likewise.
8946 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
8947 parameter to Sized_relobj*.
8948 (Copy_relocs::need_copy_reloc): Likewise.
8949 (Copy_relocs::save): Likewise.
8950 * copy-relocs.h (class Copy_relocs): Update declarations.
8951 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
8952 Sized_relobj*. Change relobj_ field to Sized_relobj*.
8953 * target-reloc.h (relocate_for_relocatable): Change
8954 offset_in_output_section type to Elf_Addr. Change code that uses
8955 it as well.
8956 * layout.cc (Layout::layout): Always set *off.
8957 * mapfile.cc (Mapfile::print_input_section): Use
8958 output_section_offset.
8959 * i386.cc (Target_i386::copy_reloc): Change object parameter to
8960 Sized_relobj*.
8961 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
8962 * sparc.cc (Target_sparc::copy_reloc): Likewise.
8963 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
8964
5cb66f97
ILT
89652008-07-03 Ian Lance Taylor <iant@google.com>
8966
8967 * layout.cc (Layout::include_section): Do not discard unrecognized
8968 SHT_STRTAB sections.
8969
afe47622
CS
89702008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
8971
8972 * script.cc (Lex::can_continue_name): Make '?' allowable in
8973 version-script names.
8974 * testsuite/version_script.map: Change glob pattern to use '?'
8975
5adf9721
ILT
89762008-06-30 Manish Singh <yosh@gimp.org>
8977
8978 PR 6585
8979 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
8980 Correct typo.
8981
e6fde208
ILT
89822008-06-30 Ian Lance Taylor <iant@google.com>
8983
8984 PR 6660
8985 PR 6682
8986 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
8987 versions]: Don't try to read the value in the contents, since we
8988 don't use it. Use the template endianness when writing.
8989
3f2e6a2d
CC
89902008-06-25 Cary Coutant <ccoutant@google.com>
8991
8992 * fileread.cc (File_read::make_view): Assert on zero-length view.
8993 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
8994 symbol table when there are no symbols to read.
8995
c43d3a48
CS
89962008-06-23 Craig Silverstein <csilvers@google.com>
8997
8998 * version.cc (version_string): Bump to 1.7
8999
5f494ea0
CS
90002008-06-18 Craig Silverstein <csilvers@google.com>
9001
9002 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9003 constant 0xFFFF to type Valtype.
9004 (Powerpc_relocate_functions::rel16_ha): Likewise.
9005
c42e122e
ILT
90062008-06-17 Ian Lance Taylor <iant@google.com>
9007
f34787f8
ILT
9008 * output.h (Output_section::Input_section): Initialize p2align_ to
9009 zero for Output_section_data constructors.
9010 (Output_section::Input_section::addralign): If not an input
9011 section, return the alignment of the Output_section_data.
9012 * testsuite/copy_test.cc: New file.
9013 * testsuite/copy_test_1.cc: New file.
9014 * testsuite/copy_test_2.cc: New file.
9015 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9016 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9017 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9018 (copy_test_1_pic.o, copy_test_1.so): New targets.
9019 (copy_test_2_pic.o, copy_test_2.so): New targets.
9020 * testsuite/Makefile.in: Rebuild.
9021
c42e122e
ILT
9022 * script-sections.cc (Script_sections::place_orphan): Initialize
9023 local variable exact.
9024
ce3ac18a
DE
90252008-06-13 David Edelsohn <edelsohn@gnu.org>
9026
9027 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9028
42cacb20
DE
90292008-06-12 David Edelsohn <edelsohn@gnu.org>
9030 David S. Miller <davem@davemloft.net>
9031
9032 * powerpc.cc: New file.
9033 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9034 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9035 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9036 * Makefile.in: Rebuild.
9037
7b308235
ILT
90382008-06-09 Ian Lance Taylor <iant@google.com>
9039
9040 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9041 <exception>.
9042 (throwing, orig_terminate): New static variables.
9043 (terminate_handler): New static function.
9044 (t2): Set terminate handler.
9045
f0b886e3
ILT
90462008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9047
9048 PR 6584
cd536b21 9049 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9050 alignment.
9051
3e90f135
CC
90522008-05-30 Cary Coutant <ccoutant@google.com>
9053
9054 * archive.cc (Archive::include_all_members) Correct to step
9055 over symbol table and extended name table in thin archives.
9056
e09ad04a
ILT
90572008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9058
9059 PR 6407
9060 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9061 calculation.
9062
62b01cb5
ILT
90632008-05-28 Caleb Howe <cshowe@google.com>
9064
9065 * reduced_debug_output.cc: New file.
9066 * reduced_debug_output.h: New file.
92de84a6 9067 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9068 * options.cc (General_options::finalize): Add strip_debug_non_line
9069 to the strip heirarchy.
9070 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9071 fields.
9072 * layout.cc: Include "reduced_debug_output.h".
9073 (Layout::Layout): Initialize new fields.
9074 (line_only_debug_sections): New static array.
9075 (is_lines_only_debug_sections): New static inline function.
9076 (Layout::include_section): Handle --strip-debug-non-line.
9077 (Layout::make_output_section): If --strip-debug-non-line, build
9078 new output sections for .debug_abbrev and .debug_info.
9079 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9080 gold. Warn about possible overflow.
9081 (read_signed_LEB_128): Likewise.
9082 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9083 (read_signed_LEB_128): Declare.
9084 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9085 (HFILES): Add reduced_debug_output.h.
9086 * Makefile.in: Rebuild.
9087
7d9e3d98
ILT
90882008-05-21 Ian Lance Taylor <iant@google.com>
9089
9090 * mapfile.cc: New file.
9091 * mapfile.h: New file.
9092 * options.h (class General_options): Add -M/--print-map and -Map.
9093 * options.cc (General_options::finalize): Make -M equivalent to
9094 -Map -.
9095 * main.cc: Include <cstdio> and "mapfile.h".
9096 (main): Open mapfile if requested.
9097 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9098 constructor. Change caller.
9099 (queue_initial_tasks): Add mapfile parameter. Change caller.
9100 (queue_middle_tasks): Likewise.
9101 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9102 declarations.
9103 * archive.cc: Include "mapfile.h".
9104 (Archive::add_symbols): Add mapfile parameter. Change all
9105 callers. Pass mapfile, symbol, and reason to include_member.
9106 (Archive::include_all_members): Add mapfile parameter. Change all
9107 callers.
9108 (Archive::include_member): Add mapfile, sym, and why parameters.
9109 Change all callers. Report inclusion to map file.
9110 * archive.h: Include "fileread.h".
9111 (class Archive): Update declarations.
9112 (Archive::file): New const method.
9113 (class Add_archive_symbols): Add mapfile_ field. Update
9114 constructor. Change all callers.
9115 * readsyms.h (class Read_symbols): Likewise.
9116 (class Finish_group): Likewise.
9117 (class Read_script): Likewise.
9118 * common.cc: Include "mapfile.h".
9119 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9120 all callers.
9121 (Symbol_table::do_allocate_commons): Likewise.
9122 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9123 symbol allocation to mapfile.
9124 * common.h (class Allocate_commons_task): Add mapfile_ field.
9125 Update constructor. Change all callers.
9126 * symtab.h (class Symbol_table): Update declarations.
9127 * layout.cc: Include "mapfile.h".
9128 (Layout_task_runner::run): Print information to mapfile.
9129 (Layout::create_gold_note): Change Output_data_fixed_space to
9130 Output_data_zero_fill.
9131 (Layout::create_build_id): Likewise.
9132 (Layout::print_to_mapfile): New function.
9133 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9134 constructor. Change caller.
9135 (class Layout): Declare print_to_mapfile.
9136 * output.cc (Output_section::Input_section::print_to_mapfile): New
9137 function.
9138 (Output_section::add_input_section): If producing a map, always
9139 add to input_sections_ list.
9140 (Output_section::do_print_to_mapfile): New function.
9141 (Output_segment::print_sections_to_mapfile): New function.
9142 (Output_segment::print_section_list_to_mapfile): New function.
9143 * output.h: Include "mapfile.h".
9144 (Output_data::print_to_mapfile): New function.
9145 (Output_data::do_print_to_mapfile): New virtual function.
9146 (Output_segment_headers::do_print_to_mapfile): New function.
9147 (Output_file_header::do_print_to_mapfile): New function.
9148 (Output_data_const::do_print_to_mapfile): New function.
9149 (class Output_data_const_buffer): Add map_name_ field. Update
9150 constructor. Change all callers. Add do_print_to_mapfile
9151 function.
9152 (class Output_data_fixed_space): Likewise.
9153 (class Output_data_space): Likewise.
9154 (class Output_data_zero_fill): New class.
9155 (Output_data_strtab::do_print_to_mapfile): New function.
9156 (Output_data_reloc_base::do_print_to_mapfile): New function.
9157 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9158 (Output_data_group::do_print_to_mapfile): New function.
9159 (Output_data_got::do_print_to_mapfile): New function.
9160 (Output_data_dynamic::do_print_to_mapfile): New function.
9161 (Output_symtab_xindex::do_print_to_mapfile): New function.
9162 (class Output_section): Declare do_print_to_mapflie. Declare
9163 print_to_mapfile in Input_section.
9164 (class Output_segment): Declare new functions.
9165 * object.h (Sized_relobj::symbol_count): New function.
9166 * script-sections.cc
9167 (Output_section_element_dot_assignment::set_section_addresses):
9168 Change Output_data_fixed_space to Output_data_zero_fill.
9169 (Output_data_expression::do_print_to_mapfile): New function.
9170 * script.cc (read_input_script): Add mapfile parameter. Change
9171 all callers.
9172 * script.h (read_input_script): Update declaration.
9173 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9174 (Eh_frame::do_print_to_mapfile): New function.
9175 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9176 (Output_merge_string::do_print_to_mapfile): New function.
9177 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9178 function.
9179 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9180 function.
9181 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9182 function.
9183 * Makefile.am (CCFILES): Add mapfile.cc.
9184 (HFILES): Add mapfile.h.
9185 * Makefile.in: Rebuild.
9186
9f1d377b
ILT
91872008-05-19 Ian Lance Taylor <iant@google.com>
9188
9189 * options.h (class General_options): Add -z relro.
9190 * layout.cc (Layout::Layout): Initialize relro_segment_.
9191 (Layout::add_output_section_data): Return the output section.
9192 (Layout::make_output_section): Rcognize relro sections and mark
9193 them appropriately.
9194 (Layout::attach_allocated_section_to_segment): Put relro sections
9195 in a PT_GNU_RELRO segment.
9196 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9197 section as relro.
9198 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9199 PT_TLS segments.
9200 (Layout::linkonce_mapping): Map d.rel.ro.local to
9201 .data.rel.ro.local.
9202 (Layout::output_section_name): Us .data.rel.ro.local for any
9203 section which begins with that.
9204 * layout.h (class Layout): Update add_output_section_data
9205 declaration. Add relro_segment_ field.
9206 * output.cc (Output_section::Output_section): Initialize is_relro_
9207 and is_relro_local_ fields.
9208 (Output_segment::add_output_section): Group relro sections.
9209 (Output_segment::is_first_section_relro): New function.
9210 (Output_segment::maximum_alignment): If there is a relro section,
9211 align the segment to the common page size.
9212 (Output_segment::set_section_addresses): Track whether we are
9213 looking at relro sections. If the last section is a relro
9214 section, align to the common page size.
9215 (Output_segment::set_section_list_addresses): Add in_relro
9216 parameter. Change all callers. Align to the page size when
9217 moving from relro to non-relro section.
9218 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9219 segment.
9220 * output.h (class Output_section): Add is_relro_ and
9221 is_relro_local_ fields.
9222 (Output_section::is_relro): New function.
9223 (Output_section::set_is_relro): New function.
9224 (Output_section::is_relro_local): New function.
9225 (Output_section::set_is_relro_local): New function.
9226 (class Output_segment): Update declarations.
9227 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9228 * sparc.cc (Target_sparc::got_section): Likewise.
9229 * x86_64.cc (Target_x86_64::got_section): Likewise.
9230 * testsuite/relro_test_main.cc: New file.
9231 * testsuite/relro_test.cc: New file.
9232 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9233 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9234 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9235 (relro_test.so, relro_test_pic.o): New targets.
9236 * testsuite/Makefile.in: Rebuild.
9237
a984ee1d
ILT
92382008-05-16 Ian Lance Taylor <iant@google.com>
9239
01676dcd
ILT
9240 * output.cc (Output_segment::add_output_section): Remove front
9241 parameter.
9242 * output.h (class Output_segment): Remove
9243 add_initial_output_section and overloaded add_output_section.
9244 Update declaration of remaining add_output_section.
9245 * layout.cc (Layout::create_interp): Call add_output_section
9246 rather than add_initial_output_section.
9247 (Layout::finish_dynamic_section): Likewise.
9248
497897f9
ILT
9249 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9250 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9251 know the dynamic type.
9252 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9253 field. Initialize it in constructor.
9254 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9255 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9256 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9257 reloc.
9258
a984ee1d
ILT
9259 * output.cc (Output_reloc::get_address): Change return type to
9260 Elf_Addr.
9261 * output.h (class Output_reloc): Update get_address declaration.
9262 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9263 for section addresses.
9264
55ba0940
ILT
92652008-05-09 Ian Lance Taylor <iant@google.com>
9266
9267 PR 6493
9268 * gold.cc (gold_nomem): Use return value of write.
9269
75517b77
ILT
92702008-05-08 Ian Lance Taylor <iant@google.com>
9271
9272 * symtab.c (Symbol::init_base_output_data): Add version
9273 parameter. Change all callers.
9274 (Symbol::init_base_output_segment): Likewise.
9275 (Symbol::init_base_constant): Likewise.
9276 (Symbol::init_base_undefined): Likewise.
9277 (Sized_symbol::init_output_data): Likewise.
9278 (Sized_symbol::init_output_segment): Likewise.
9279 (Sized_symbol::init_constant): Likewise.
9280 (Sized_symbol::init_undefined): Likewise.
9281 (Symbol_table::do_define_in_output_data): If the new symbol has a
9282 version, mark it as the default.
9283 (Symbol_table::do_define_in_output_segment): Likewise.
9284 (Symbol_table::do_define_as_constant): Likewise.
9285 * symtab.h (class Symbol): Update declarations.
9286 (class Sized_symbol): Likewise.
9287 * resolve.cc (Symbol::override_version): New function.
c42e122e 9288 (Symbol::override_base): Call override_version.
75517b77
ILT
9289 (Symbol::override_base_with_special): Likewise.
9290 * testsuite/ver_script_8.script: New file.
9291 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9292 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9293 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9294 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9295
f1f70eae
ILT
92962008-05-06 Ian Lance Taylor <iant@google.com>
9297
f3e9c5c5
ILT
9298 PR 6049
9299 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
9300 functions.
9301 (class General_options): Remove existing --undefined, and add
9302 --no-undefined instead. Add new --undefined as synonym for -u.
9303 * archive.cc (Archive::add_symbols): Check whether symbol was
9304 named with -u.
9305 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
9306 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
9307 all uses. Add IS_UNDEFINED. Update declarations to split
9308 different versions of init_base. Declare init_base_undefined.
9309 (Symbol::is_defined): Handle IS_UNDEFINED.
9310 (Symbol::is_undefined): Likewise.
9311 (Symbol::is_weak_undefined): Call is_undefined.
9312 (Symbol::is_absolute): Handle IS_CONSTANT.
9313 (class Sized_symbol): Update declarations to split different
9314 versions of init. Declare init_undefined.
9315 (class Symbol_table): Declare new functions.
9316 * symtab.cc (Symbol::init_base_object): Rename from init_base.
9317 Change all callers.
9318 (Symbol::init_base_output_data): Likewise.
9319 (Symbol::init_base_output_segment): Likewise.
9320 (Symbol::init_base_constant): Likewise.
9321 (Symbol::init_base_undefined): New function.
9322 (Sized_symbol::init_object): Rename from init. Change all
9323 callers.
9324 (Sized_symbol::init_output_data): Likewise.
9325 (Sized_symbol::init_output_segment): Likewise.
9326 (Sized_symbol::init_constant): Likewise.
9327 (Sized_symbol::init_undefined): New function.
9328 (Symbol_table::add_undefined_symbols_from_command_line): New
9329 function.
9330 (Symbol_table::do_add_undefined_symbols_from_command_line): New
9331 function.
9332 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
9333 (Symbol::output_section): Likewise.
9334 (Symbol::set_output_section): Likewise.
9335 (Symbol_table::sized_finalize_symbol): Likewise.
9336 (Symbol_table::sized_write_globals): Likewise.
9337 * resolve.cc (Symbol_table::should_override): Likewise.
9338 (Symbol::override_base_with_special): Likewise.
9339
8bdcdf2c
ILT
9340 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
9341 symbol, change it to have default visibility.
9342 * testsuite/protected_1.cc: New file.
9343 * testsuite/protected_2.cc: New file.
9344 * testsuite/protected_3.cc: New file.
9345 * testsuite/protected_main_1.cc: New file.
9346 * testsuite/protected_main_2.cc: New file.
9347 * testsuite/protected_main_3.cc: New file.
9348 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
9349 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
9350 (protected_1_LDFLAGS, protected_1_LDADD): Define.
9351 (protected_1.so): New target.
9352 (protected_1_pic.o, protected_2_pic.o): New targets.
9353 (protected_3_pic.o): New target.
9354 (check_PROGRAMS): Add protected_2.
9355 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
9356 (protected_2_LDFLAGS, protected_2_LDADD): Define.
9357 * testsuite/Makefile.in: Rebuild.
9358
2b706932
ILT
9359 * options.h (DEFINE_var): Add set_user_set_##varname__.
9360 (DEFINE_bool_alias): New macro.
9361 (class General_options): Define -Bstatic using DEFINE_bool_alias
9362 rather than DEFINE_special. Add --undefined as an alias for -z
9363 defs.
9364 * options.cc (General_options::parse_Bstatic): Remove.
9365
d82a5bcc
ILT
9366 * options.h (class General_options): Add --fatal-warnings.
9367 * main.cc (main): Implement --fatal-warnings.
9368 * errors.h (Errors::warning_count): New function.
9369
f1f70eae
ILT
9370 * options.h (class General_options): Add -Bsymbolic-functions.
9371 * symtab.h (Symbol::is_preemptible): Check for
9372 -Bsymbolic-functions.
9373
8825ac63
ILT
93742008-05-05 Ian Lance Taylor <iant@google.com>
9375
d98bc257
ILT
9376 * options.h (DEFINE_bool): For DASH_Z, create the negative option
9377 as noVARNAME rather than no-VARNAME.
9378 (class General_options): Add option -z combreloc.
9379 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
9380 get_address.
9381 (Output_reloc::sort_before) [SHT_REL]: New function.
9382 (Output_reloc::sort_before) [SHT_RELA]: New function.
9383 (class Output_data_reloc_base): Add sort_relocs_ field. Define
9384 Sort_relocs_comparison.
9385 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
9386 parameter. Change all callers.
9387 (Output_data_reloc::Output_data_reloc) [both versions]: Add
9388 sort_relocs parameter. Change all callers.
9389 * output.cc (Output_reloc::get_address): New function, broken out
9390 of write_rel.
9391 (Output_reloc::write_rel): Call it.
9392 (Output_reloc::compare): New function.
9393 (Output_data_reloc_base::do_write): Optionally sort relocs.
9394
60b2b4e7
ILT
9395 * configure.ac: If targ_extra_obj is set, link it in.
9396 * configure.tgt: Initialize all variables.
9397 (x86_64*): Set targ_extra_obj and targ_extra_size.
9398 * configure: Rebuild.
9399
8825ac63
ILT
9400 * object.cc (Sized_relobj::include_section_group): Adjust section
9401 indexes read from group data. Build vector to pass to
9402 layout_group.
9403 * layout.cc (Layout::layout_group): Add flags and shndxes
9404 parameters. Remove contents parameter. Change caller. Update
9405 explicit instantiations.
9406 * layout.h (class Layout): Update layout_group declaration.
9407 * output.cc (Output_data_group::Output_data_group): Add flags and
9408 input_shndxes parameters. Remove contents parameter. Change
9409 caller.
9410 (Output_data_group::do_write): Change input_sections_ to
9411 input_shndxes_.
9412 * output.h (class Output_data_group): Update constructor
9413 declaration. Rename input_sections_ to input_shndxes_.
9414 * testsuite/many_sections_test.cc: Add template.
9415
e94cf127
CC
94162008-04-30 Cary Coutant <ccoutant@google.com>
9417
4418b2d5
CC
9418 * target-reloc.h (relocate_section): Fix dead-pointer bug.
9419
e94cf127
CC
9420 * layout.cc (Layout::include_section): Refactored check for debug
9421 info section.
9422 (Layout::add_comdat): Add new parameters. Change type
9423 of signature parameter. Add object and shndx to signatures table.
9424 (Layout::find_kept_object): New function.
9425 * layout.h: Include <cstring>.
9426 (Layout::is_debug_info_section): New function.
9427 (Layout::add_comdat): Add new parameters.
9428 (Layout::find_kept_object): New function.
9429 (Layout::Kept_section): New struct.
9430 (Layout::Signatures): Change type of map range.
9431 * object.cc (Relobj::output_section_address): New function.
9432 (Sized_relobj::include_section_group): Add new parameters. Change
9433 calls to Layout::add_comdat. Change to build table of kept comdat
9434 groups and table mapping discarded sections to kept sections.
9435 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
9436 (Sized_relobj::do_layout): Change calls to include_section_group and
9437 include_linkonce_section.
9438 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
9439 value to zero when section is discarded.
9440 (Sized_relobj::map_to_kept_section): New function.
9441 * object.h (Relobj::output_section_address): New function.
9442 (Relobj::Comdat_group): New type.
9443 (Relobj::find_comdat_group): New function.
9444 (Relobj::Comdat_group_table): New type.
9445 (Relobj::Kept_comdat_section): New type.
9446 (Relobj::Kept_comdat_section_table): New type.
9447 (Relobj::add_comdat_group): New function.
9448 (Relobj::set_kept_comdat_section): New function.
9449 (Relobj::get_kept_comdat_section): New function.
9450 (Relobj::comdat_groups_): New field.
9451 (Relobj::kept_comdat_sections_): New field.
9452 (Symbol_value::input_value): Update comment.
9453 (Sized_relobj::map_to_kept_section) New function.
9454 (Sized_relobj::include_linkonce_section): Add new parameter.
9455 * target-reloc.h (Comdat_behavior): New type.
9456 (get_comdat_behavior): New function.
9457 (relocate_section): Add code to map a discarded section to the
9458 corresponding kept section when applying a relocation.
9459
e4e5049b
CS
94602008-04-30 Craig Silverstein <csilvers@google.com>
9461
9462 * dwarf_reader.cc (next_generation_count): New static var.
9463 (Addr2line_cache_entry): New struct.
9464 (addr2line_cache): New static var.
9465 (Dwarf_line_info::one_addr2line): Added caching.
9466 (Dwarf_line_info::clear_addr2line_cache): New function.
9467 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
9468 cache-size parameter.
9469 (Dwarf_line_info::one_addr2line_cache): New function.
9470 * symtab.cc (Symbol_table::detect_odr_violations): Pass
9471 new cache-size argument to one_addr2line(), and clear cache.
9472
d09e9154
CC
94732008-04-28 Cary Coutant <ccoutant@google.com>
9474
9475 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
9476 R_386_PC8 relocations.
9477
7ef73768
ILT
94782008-04-23 Ian Lance Taylor <iant@google.com>
9479
55438702
ILT
9480 * object.cc (Sized_relobj::include_section_group): Check for
9481 invalid section group.
9482
c165fb93
ILT
9483 * object.cc (make_elf_object): Correct test for 64-bit ELF file
9484 header size.
9485
7ef73768
ILT
9486 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
9487 than read for file header.
9488 * archive.cc (Archive::include_member): Likewise.
9489
6194aaab
L
94902008-04-23 Paolo Bonzini <bonzini@gnu.org>
9491
9492 * aclocal.m4: Regenerate.
9493 * configure: Regenerate.
9494
d491d34e
ILT
94952008-04-19 Ian Lance Taylor <iant@google.com>
9496
5ea2bac6
ILT
9497 * version.cc (version_string): Bump to 1.6.
9498
7bc3e21a
ILT
9499 * testsuite/Makefile.am (many_sections_r_test): New target.
9500 (many_sections_r_test_SOURCES): Remove.
9501 (many_sections_r_test_DEPENDENCIES): Remove.
9502 (many_sections_r_test_LDFLAGS): Remove.
9503 (many_sections_r_test_LDADD): Remove.
9504
7fcd3aa9
ILT
9505 * object.cc (Sized_relobj::do_add_symbols): Always pass
9506 local_symbol_count_ to add_from_relobj.
9507
4c94d6ae
ILT
9508 * testsuite/Makefile.am (many_sections_check.h): Only check one in
9509 every thousand variables.
9510 * testsuite/Makefile.in: Rebuild.
9511
d491d34e
ILT
9512 * object.cc (Xindex::initialize_symtab_xindex): New function.
9513 (Xindex::read_symtab_xindex): New function.
9514 (Xindex::sym_xindex_to_shndx): New function.
9515 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
9516 available.
9517 (Sized_relobj::do_initialize_xindex): New function.
9518 (Sized_relobj::do_read_symbols): Adjust section links.
9519 (Sized_relobj::symbol_section_and_value): Add is_ordinary
9520 parameter. Change all callers.
9521 (Sized_relobj::include_section_group): Adjust section links and
9522 symbol section indexes.
9523 (Sized_relobj::do_layout): Adjust section links.
9524 (Sized_relobj::do_count_local_symbols): Adjust section links and
9525 symbol section indexes.
9526 (Sized_relobj::do_finalize_local_symbols): Distinguish between
9527 ordinary and special symbols.
9528 (Sized_relobj::write_local_symbols): Add symtab_xindex and
9529 dynsym_xindex parameters. Change all callers. Adjust section
9530 links. Use SHN_XINDEX when needed.
9531 (Sized_relobj::get_symbol_location_info): Adjust section links.
9532 Don't get fooled by special symbols.
9533 * object.h (class Xindex): Define.
9534 (class Object): Add xindex_ parameter. Declare virtual functoin
9535 do_initialize_xindex.
9536 (Object::adjust_sym_shndx): New function.
9537 (Object::set_xindex): New protected function.
9538 (class Symbol_value): Add is_ordinary_shndx_ field.
9539 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
9540 (Symbol_value::value): Assert ordinary section.
9541 (Symbol_value::initialize_input_to_output_map): Likewise.
9542 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
9543 Change all callers.
9544 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
9545 all callers.
9546 (class Sized_relobj): Update declarations.
9547 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
9548 parameter. Change all callers.
9549 (Sized_relobj::adjust_shndx): New function.
9550 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
9551 field.
9552 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
9553 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
9554 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
9555 (Sized_dynobj::read_dynsym_section): Adjust section links.
9556 (Sized_dynobj::read_dynamic): Likewise.
9557 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
9558 section links.
9559 (Sized_dynobj::do_initialize_xindex): New function.
9560 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
9561 do_initialize_xindex.
9562 (Sized_dynobj::adjust_shndx): New function.
9563 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
9564 dynsym_xindex_ fields.
9565 (Layout::finalize): Add a call to set_section_indexes before
9566 creating the symtab sections.
9567 (Layout::set_section_indexes): Don't do anything if the section
9568 already has a section index.
9569 (Layout::create_symtab_sections): Add shnum parameter. Change
9570 caller. Create .symtab_shndx section if needed.
9571 (Layout::create_shdrs): Add shstrtab_section parameter. Change
9572 caller.
9573 (Layout::allocated_output_section_count): New function.
9574 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
9575 needed.
9576 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
9577 fields. Update declarations.
9578 (Layout::symtab_xindex): New function.
9579 (Layout::dynsym_xindex): New function.
9580 (class Write_symbols_task): Add layout_ field.
9581 (Write_symbols_task::Write_symbols_task): Add layout parameter.
9582 Change caller.
9583 * output.cc (Output_section_headers::Output_section_headers): Add
9584 shstrtab_section parameter. Change all callers.
9585 (Output_section_headers::do_sized_write): Store overflow values
9586 for section count and section string table section index in
9587 section header zero.
9588 (Output_file_header::do_sized_write): Check for overflow of
9589 section count and section string table section index.
9590 (Output_symtab_xindex::do_write): New function.
9591 (Output_symtab_xindex::endian_do_write): New function.
9592 * output.h (class Output_section_headers): Add shstrtab_section_.
9593 Update declarations.
9594 (class Output_symtab_xindex): Define.
9595 (Output_section::has_out_shndx): New function.
9596 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
9597 field.
9598 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
9599 Change all callers.
9600 (Sized_symbol::init): Likewise.
9601 (Symbol::output_section): Check for ordinary symbol.
9602 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
9603 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
9604 callers.
9605 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
9606 Change all callers. Simplify handling of symbols from sections
9607 not included in the link.
9608 (Symbol_table::add_from_dynobj): Handle ordinary symbol
9609 distinction.
9610 (Weak_alias_sorter::operator()): Assert that symbols are
9611 ordinary.
9612 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
9613 distinction.
9614 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
9615 parameters. Change all callers.
9616 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
9617 symbol distinction. Use SHN_XINDEX when needed.
9618 (Symbol_table::write_section_symbol): Add symtab_xindex
9619 parameter. Change all callers.
9620 (Symbol_table::sized_write_section_symbol): Likewise. Use
9621 SHN_XINDEX when needed.
9622 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
9623 declarations.
9624 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
9625 (Symbol::is_defined): Check is_ordinary.
9626 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
9627 (Symbol::is_absolute, Symbol::is_common): Likewise.
9628 (class Sized_symbol): Update declarations.
9629 (class Symbol_table): Update declarations.
9630 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
9631 parameters. Change all callers.
9632 (Sized_symbol::override): Likewise.
9633 (Symbol_table::override): Likewise.
9634 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
9635 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
9636 is_ordinary, and orig_st_shndx parameters. Change all callers.
9637 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
9638 to be in an ordinary section.
9639 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
9640 object and is_ordinary parameters. Change all callers.
9641 (Sized_dwarf_line_info::read_relocs): Add object parameter.
9642 Change all callers. Don't add undefined or non-ordinary symbols
9643 to reloc_map_.
9644 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
9645 Change all callers.
9646 * dwarf_reader.h (class Sized_dwarf_line_info): Update
9647 declarations.
9648 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
9649 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
9650 (Sized_relobj::relocate_sections): Likewise.
9651 * target-reloc.h (scan_relocs): Adjust section symbol index.
9652 (scan_relocatable_relocs): Likewise.
9653 * i386.cc (Scan::local): Check for ordinary symbols.
9654 * sparc.cc (Scan::local): Likewise.
9655 * x86_64.cc (Scan::local): Likewise.
9656 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
9657 to symbol_section_and_value.
9658 * testsuite/many_sections_test.cc: New file.
9659 * testsuite/Makefile.am (BUILT_SOURCES): Define.
9660 (check_PROGRAMS): Add many_sections_test.
9661 (many_sections_test_SOURCES): Define.
9662 (many_sections_test_DEPENDENCIES): Define.
9663 (many_sections_test_LDFLAGS): Define.
9664 (BUILT_SOURCES): Add many_sections_define.h.
9665 (many_sections_define.h): New target.
9666 (BUILT_SOURCES): Add many_sections_check.h.
9667 (many_sections_check.h): New target.
9668 (check_PROGRAMS): Add many_sections_r_test.
9669 (many_sections_r_test_SOURCES): Define.
9670 (many_sections_r_test_DEPENDENCIES): Define.
9671 (many_sections_r_test_LDFLAGS): Define.
9672 (many_sections_r_test_LDADD): Define.
9673 (many_sections_r_test.o): New target.
9674 * testsuite/Makefile.in: Rebuild.
9675
c5818ff1
CC
96762008-04-17 Cary Coutant <ccoutant@google.com>
9677
9678 * errors.cc (Errors::info): New function.
9679 (gold_info): New function.
9680 * errors.h (Errors::info): New function.
9681 * gold.h (gold_info): New function.
9682 * object.cc (Input_objects::add_object): Print trace output.
9683 * options.cc (options::parse_set): New function.
9684 (General_options::parse_wrap): Deleted.
9685 (General_options::General_options): Deleted initializer.
9686 * options.h (options::String_set): New typedef.
9687 (options::parse_set): New function.
9688 (DEFINE_set): New macro.
9689 (General_options::wrap): Changed to use DEFINE_set. Changed
9690 callers of any_wrap_symbols and is_wrap_symbol.
9691 (General_options::trace, General_options::trace_symbol):
9692 New options.
9693 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
9694 (General_options::wrap_symbols_): Deleted.
9695 * symtab.cc (Symbol_table::add_from_object): Print trace output.
9696
b5be4a7c
DM
96972008-04-17 David S. Miller <davem@davemloft.net>
9698
9699 * options.cc (General_options::parse_V): New function.
9700 * options.h: Add entries for -V and -Qy.
9701
155a0dd7
ILT
97022008-04-17 Ian Lance Taylor <iant@google.com>
9703
9704 * common.cc (Symbol_table::allocate_commons): Remove options
9705 parameter. Change caller.
9706 (Symbol_table::do_allocate_commons): Remove options parameter.
9707 Change caller. Just call do_allocate_commons_list twice.
9708 (Symbol_table::do_allocate_commons_list): New function, broken out
9709 of do_allocate_commons.
9710 * common.h (class Allocate_commons_task): Remove options_ field.
9711 Update constructor.
9712 * symtab.cc (Symbol_table::Symbol_table): Initialize
9713 tls_commons_.
9714 (Symbol_table::add_from_object): Put TLS common symbols on
9715 tls_commons_ list.
9716 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
9717 which are IN_OUTPUT_DATA.
9718 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
9719 allocate_commons and do_allocate_commons declarations. Declare
9720 do_allocate_commons_list.
9721 * gold.cc (queue_middle_tasks): Update creation of
9722 Allocate_commons_task to not pass options.
9723 * testsuite/Makefile.am (INCLUDES): Add -I.. .
9724 (TLS_TEST_C_FLAGS): New variable.
9725 (tls_test_c_pic.o): New target.
9726 (tls_test_shared.so): Link in tls_test_c_pic.o.
9727 (tls_test_c_pic_ie.o): New target.
9728 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
9729 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
9730 (tls_test_c.o): New target.
9731 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
9732 (tls_pic_test_LDADD): Likewise.
9733 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
9734 (tls_shared_gd_to_ie_test_LDADD): Likewise.
9735 (tls_test_c_gnu2.o): New target.
9736 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
9737 tls_test_c_gnu2.o.
9738 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
9739 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
9740 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
9741 * testsuite/tls_test.cc: Include "config.h".
9742 (t_last): Call t11_last.
9743 * testsuite/tls_test.h (t11, t11_last): Declare.
9744 * testsuite/tls_test_c.c: New file.
9745 * testsuite/tls_test_main.cc (thread_routine): Call t11.
9746 * configure.ac: Check for OpenMP support.
9747 * configure, config.in, Makefile.in: Rebuild.
9748 * testsuite/Makefile.in: Rebuild.
9749
edfbb029
CC
97502008-04-16 Cary Coutant <ccoutant@google.com>
9751
9752 * i386.cc (Target_i386::define_tls_base_symbol): New function.
9753 (Target_i386::tls_base_symbol_defined_): New field.
9754 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9755 (Target_i386::Scan::global): Likewise.
9756 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
9757 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
9758 (Target_x86_64::tls_base_symbol_defined_): New field.
9759 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9760 (Target_x86_64::Scan::global): Likewise.
9761
f3c69fca
CC
97622008-04-16 Cary Coutant <ccoutant@google.com>
9763
9764 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
9765 (Symbol::needs_plt_entry): Allow weak undefined symbols.
9766 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
9767 building shared libraries.
9768 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
9769 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
9770 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
9771 * testsuite/Makefile.in: Rebuild.
9772 * testsuite/weak_undef.h: New file.
9773 * testsuite/weak_undef_file1.cc: Add extra test cases.
9774 * testsuite/weak_undef_file2.cc: Likewise.
9775 * testsuite/weak_undef_test.cc: Likewise.
9776
7c414435
DM
97772008-04-16 David S. Miller <davem@davemloft.net>
9778
32b769e1
DM
9779 * sparc.cc (Target_sparc::Scan): Change from struct to class.
9780 Add issued_non_pic_error_ field. Declare check_non_pic.
9781 (Target_sparc::Scan::check_non_pic): New function.
9782 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
9783 (Target_sparc::Scan::global): Likewise.
9784
11936fb1
DM
9785 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
9786 * configure: Rebuild.
9787
7c414435
DM
9788 * options.h (DEFINE_enable): New macro.
9789 (new_dtags): New enable option.
9790 (initfirst, interpose, loadfltr, nodefaultlib,
9791 nodelete, nodlopen, nodump): New -z options.
9792 * layout.cc (Layout:finish_dynamic_section): If new
9793 dtags enabled, emit DT_RUNPATH. Also, emit a
9794 DT_FLAGS_1 containing any specified -z flags.
9795
85c7bf8b
ILT
97962008-04-16 Ian Lance Taylor <iant@google.com>
9797
12c0daef
ILT
9798 * copy-relocs.cc: New file.
9799 * copy-relocs.h: New file.
9800 * reloc.cc: Remove Copy_relocs code.
9801 * reloc.h: Likewise.
9802 * reloc-types.h (struct Reloc_types) [both versions]: Add
9803 get_reloc_addend_noerror.
9804 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
9805 variants of add_global which take an addend which must be zero.
9806 * i386.cc: Include "copy-relocs.h".
9807 (class Target_i386): Change type of copy_relocs_ to variable,
9808 update initializer.
9809 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
9810 Change all callers.
9811 (Target_i386::do_finalize_sections): Change handling of
9812 copy_relocs_.
9813 * sparc.cc: Include "copy-relocs.h".
9814 (class Target_sparc): Change type of copy_relocs_ to variable,
9815 update initializer.
9816 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
9817 Change all callers.
9818 (Target_sparc::do_finalize_sections): Change handling of
9819 copy_relocs_.
9820 * x86_64.cc: Include "copy-relocs.h".
9821 (class Target_x86_64): Change type of copy_relocs_ to variable,
9822 update initializer.
9823 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
9824 class. Change all callers.
9825 (Target_x86_64::do_finalize_sections): Change handling of
9826 copy_relocs_.
9827 * Makefile.am (CCFILES): Add copy-relocs.cc.
9828 (HFILES): Add copy-relocs.h.
9829
4f4995b6
ILT
9830 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
9831
85c7bf8b
ILT
9832 * testsuite/script_test_4.sh: Permit leading zeroes.
9833
4f2a9edd
ILT
98342008-04-15 Ian Lance Taylor <iant@google.com>
9835
e6188289
ILT
9836 * script-sections.cc (Script_sections::create_segments): Use
9837 header_size_adjustment even when there is enough room for the
9838 headers.
9839 * testsuite/script_test_4.sh: New file.
9840 * testsuite/script_test_4.t: New file.
9841 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
9842 (check_DATA): Add script_test_4.stdout.
9843 (MOSTLYCLEANFILES): Likewise.
9844 (script_test_4): New target.
9845 (script_test_4.stdout): New target.
9846 * testsuite/Makefile.in: Rebuild.
9847
4f2a9edd
ILT
9848 * sparc.cc: Add definitions for Output_data_plt_sparc class
9849 constants.
9850
f5314dd5
DM
98512008-04-14 David S. Miller <davem@davemloft.net>
9852
9853 * sparc.cc: New file.
9854 * Makefile.am (TARGETSOURCES): Add sparc.cc
9855 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
9856 * configure.tgt: Document targ_extra_size and
9857 targ_extra_big_endian. Add entries for sparc-* and
9858 sparc64-*.
9859 * configure.ac: Handle targ_extra_size and
9860 targ_extra_big_endian.
9861 * Makefile.in: Rebuild.
9862 * configure: Likewise.
9863 * po/POTFILES.in: Likewise.
9864 * po/gold.pot: Likewise.
9865
154e0e9a
ILT
98662008-04-14 Ian Lance Taylor <iant@google.com>
9867
9868 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
9869 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
9870 in the name/type/flags to section mapping. Don't call
9871 allocate_output_section.
9872 (Layout::choose_output_section): Change parameter from adjust_name
9873 to is_input_section. Don't permit input sections after sections
9874 are attached to segments. Don't call allocate_output_section.
9875 (Layout::layout_eh_frame): Call update_flags_for_input_section,
9876 not write_enable_output_section.
9877 (Layout::make_output_section): Don't push to
9878 unattached_section_list_ nor call attach_to_segment. Call
9879 attach_section_to_segment if sections are attached.
9880 (Layout::attach_sections_to_segments): New function.
9881 (Layout::attach_section_to_segment): New function.
9882 (Layout::attach_allocated_section_to_segment): Rename from
9883 attach_to_segment. Remove flags parameter.
9884 (Layout::allocate_output_section): Remove function.
9885 (Layout::write_enable_output_section): Remove function.
9886 * layout.h (class Layout): Update for above changes. Add new
9887 field sections_are_attached_.
9888 * output.h (Output_section::update_flags_for_input_section): New
9889 function.
9890 * output.cc (Output_section::add_input_section): Call
9891 update_flags_for_input_section.
9892 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
9893
009a67a2
CC
98942008-04-11 Cary Coutant <ccoutant@google.com>
9895
9896 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
9897 thought unnecessary.
9898 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
9899
759b1a24
ILT
99002008-04-11 Ian Lance Taylor <iant@google.com>
9901
9902 * output.h (class Output_section_data): Remove inline definition
9903 of set_addralign.
9904 * output.cc (Output_section_data::set_addralign): New function.
9905
c2b45e22
CC
99062008-04-11 Cary Coutant <ccoutant@google.com>
9907
9908 Add support for TLS descriptors for i386 and x86_64.
9909 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
9910 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
9911 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
9912 GOT_TYPE_TLS_DESC.
9913 (Target_i386::got_mod_index_entry): Remove unnecessary code.
9914 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
9915 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
9916 relocations.
9917 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
9918 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
9919 Fix problem with initial-exec relocations.
9920 (Target_i386::Relocate::relocate_tls): Likewise.
9921 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
9922 relaxation.
9923 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
9924 support for section-plus-offset dynamic table entries.
9925 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
9926 (Output_data_dynamic::Dynamic_entry): Add support for
9927 section-plus-offset dynamic table entries.
9928 (Output_data_dynamic::Classification): Likewise.
9929 (Output_data_dynamic::classification_): Renamed offset_.
9930 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
9931 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
9932 (Target_x86_64::make_plt_section): New function.
9933 (Target_x86_64::reserve_tlsdesc_entries): New function.
9934 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
9935 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
9936 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
9937 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
9938 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
9939 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
9940 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
9941 add extra PLT entry for TLS descriptors.
9942 (Output_data_plt_x86_64::got_): New field.
9943 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
9944 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
9945 fields.
9946 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
9947 descriptors.
9948 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
9949 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
9950 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
9951 R_386_TLS_DESC_CALL relocations.
9952 (Target_x86_64::Scan::global): Likewise.
9953 (Target_x86_64::do_finalize_sections): Add dynamic table entries
9954 for TLS descriptors.
9955 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
9956 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
9957 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
9958 GD-to-IE relaxation.
9959 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
9960 and TLS_DESCRIPTORS.
9961 * Makefile.in: Rebuild.
9962 * configure: Rebuild.
9963 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
9964 (tls_test_shared2.so): New target.
9965 (tls_shared_gd_to_ie_test_SOURCES): New variable.
9966 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
9967 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
9968 (tls_shared_gd_to_ie_test_LDADD): New variable.
9969 (tls_shared_gnu2_gd_to_ie_test): New target.
9970 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
9971 New targets.
9972 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
9973 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
9974 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
9975 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
9976 (tls_shared_gnu2_test): New target.
9977 (tls_test_gnu2_shared.so): New target.
9978 (tls_shared_gnu2_test_SOURCES): New variable.
9979 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
9980 (tls_shared_gnu2_test_LDFLAGS): New variable.
9981 (tls_shared_gnu2_test_LDADD): New variable.
9982 * testsuite/Makefile.in: Rebuild.
9983 * testsuite/Makefile.
9984
83bfb6b7
ILT
99852008-04-11 Ian Lance Taylor <iant@google.com>
9986
9987 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
9988 justsyms.t.
9989 * testsuite/Makefile.in: Rebuild.
9990
9991 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
9992 long.
9993 * testsuite/script_test_2.cc (main): Adjust test.
9994
706e1f5e
ILT
99952008-04-11 David S. Miller <davem@davemloft.net>
9996 Ian Lance Taylor <iant@google.com>
9997
9998 * options.h (General_options): Add entries for '-Y' and
9999 '-relax'.
10000 * options.cc (General_options:finalize): If -Y was used, add those
10001 entries to the library path instead of the default "/lib" and
10002 "/usr/lib".
10003
7c98e6bb
DM
100042008-04-11 David S. Miller <davem@davemloft.net>
10005
10006 * testsuite/justsyms.t: Start at 0x100.
10007 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10008 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10009 long.
10010 * testsuite/script_test_2.cc: Adjust string and section length
10011 checks.
7c98e6bb 10012
99a37bfd
ILT
100132008-04-09 Ian Lance Taylor <iant@google.com>
10014
2cefc357
ILT
10015 PR gold/5996
10016 * script-sections.cc (Sections_element::allocate_to_segment): Add
10017 orphan parameter.
10018 (Output_section_definition::allocate_to_segment): Likewise.
10019 (Orphan_output_section::allocate_to_segment): Likewise.
10020 (Script_sections::attach_sections_using_phdrs_clause): Don't
10021 propagate non-PT_LOAD segments to orphan sections.
10022 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10023 readelf rather than objdump.
10024 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10025 .interp section and PT_INTERP segment are the same size.
10026 * testsuite/Makefile.in: Rebuild.
10027
99a37bfd
ILT
10028 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10029 aliases for symbols defined in the same object.
10030 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10031 (weak_alias_test_SOURCES): New variable.
10032 (weak_alias_test_DEPENDENCIES): New variable.
10033 (weak_alias_test_LDFLAGS): New variable.
10034 (weak_alias_test_LDADD): New variable.
10035 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10036 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10037 (weak_alias_test_3.o): New target.
10038 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10039 * testsuite/weak_alias_test_main.cc: New file.
10040 * testsuite/weak_alias_test_1.cc: New file.
10041 * testsuite/weak_alias_test_2.cc: New file.
10042 * testsuite/weak_alias_test_3.cc: New file.
10043
780e49c5
ILT
100442008-04-08 Ian Lance Taylor <iant@google.com>
10045
cdb0b8f5
ILT
10046 * options.h (class General_options): Add --noinhibit-exec option.
10047 * main.cc (main): Check --noinhibit-exec.
10048
0864d551
ILT
10049 * options.h (class General_options): Define --wrap as a special
10050 option. Add wrap_symbols_ field.
10051 (General_options::any_wrap_symbols): New function.
10052 (General_options::is_wrap_symbol): New function.
10053 * options.cc (General_options::parse_wrap): New function.
10054 (General_options::General_options): Initialize wrap_symbols_.
10055 * symtab.cc (Symbol_table::wrap_symbol): New function.
10056 (Symbol_table::add_from_object): Handle --wrap.
10057 * symtab.h (class Symbol_table): Declare wrap_symbol.
10058 * target.h (Target::wrap_char): New function.
10059 (Target::Target_info): Add wrap_char field.
10060 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10061 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10062 * testsuite/testfile.cc (Target_test::test_target_info):
10063 Likewise.
10064
789aa6de
ILT
10065 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10066 there is one.
10067
2c38906f
ILT
10068 * layout.h (class Layout): Add added_eh_frame_data_ field.
10069 * layout.cc (Layout::Layout): Initialize new field.
10070 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10071 output section until we find a section we merged successfully.
10072 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10073 that the size be non-zero.
10074
780e49c5
ILT
10075 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10076 qualifier.
10077
7fcd0256
ILT
100782008-04-08 Craig Silverstein <csilvers@google.com>
10079
10080 * configure.ac: Export new conditional variable HAVE_ZLIB.
10081 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10082 on HAVE_ZLIB.
10083 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10084 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10085
6835af53
ILT
100862008-04-07 Ian Lance Taylor <iant@google.com>
10087
e24f324c
ILT
10088 * version.cc (version_string): Set to "1.5".
10089
a036edd8
ILT
10090 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10091 Add issued_non_pic_error_ field. Declare check_non_pic.
10092 (Target_x86_64::Scan::check_non_pic): New function.
10093 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10094 (Target_x86_64::Scan::global): Likewise.
10095
624f8810
ILT
10096 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10097 addend parameter. Change caller. Handle merge sections.
10098 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10099 Address to Addend. Don't add in the result of
10100 local_section_offset, pass down the addend and use the returned
10101 value.
10102 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10103 Update declarations of local_section_offset and symbol_value.
10104 * testsuite/two_file_test_1.cc (t18): New function.
10105 * testsuite/two_file_test_2.cc (f18): New function.
10106 * testsuite/two_file_test_main.cc (main): Call t18.
10107 * testsuite/two_file_test.h (t18, f18): Declare.
10108
6835af53
ILT
10109 * configure.ac: Don't test for objdump, c++filt, or readelf.
10110 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10111 conditionals.
10112 (TEST_READELF): New variable.
10113 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10114 (check_PROGRAMS): Add two_file_strip_test.
10115 (two_file_strip_test): New target.
10116 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10117 (two_file_same_shared_strip_test_SOURCES): New variable.
10118 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10119 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10120 (two_file_same_shared_strip_test_LDADD): New variable.
10121 (two_file_shared_strip.so): New target.
10122 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10123 (ver_test_5.syms, ver_test_7.syms): Likewise.
10124 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10125 (strip_test_3.stdout): Use TEST_OBJDUMP.
10126 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10127
86925eef
CC
101282008-04-04 Cary Coutant <ccoutant@google.com>
10129
10130 * symtab.h (Symbol::is_weak_undefined): New function.
10131 (Symbol::is_strong_undefined): New function.
10132 (Symbol::is_absolute): New function.
10133 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10134 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10135 absolute symbols.
10136 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10137 (weak_undef_test): New target.
10138 * testsuite/Makefile.in: Rebuild.
10139 * testsuite/weak_undef_file1.cc: New file.
10140 * testsuite/weak_undef_file2.cc: New file.
10141 * testsuite/weak_undef_test.cc: New file.
10142
126f3ece
ILT
101432008-04-03 Craig Silverstein <csilvers@google.com>
10144
10145 * compressed_output.h (class Output_compressed_section): Use
10146 unsigned buffer.
10147 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10148 add zlib header.
10149 (zlib_compressed_suffix): Removed.
10150 (Output_compressed_section::set_final_data_size): Use unsigned
10151 buffers.
10152 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10153 Fix linker invocation.
10154 (flagstest_o_specialfile_and_compress_debug_sections):
10155 Likewise.
10156 * testsuite/Makefile.in: Regenerated.
10157
deae2a14
DM
101582008-04-02 David S. Miller <davem@davemloft.net>
10159
10160 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10161 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10162
70752818
ILT
101632008-04-02 Craig Silverstein <csilvers@google.com>
10164
10165 * TODO: New file.
10166
39d0cb0e
ILT
101672008-04-02 Ian Lance Taylor <iant@google.com>
10168
10169 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10170 parameters. Update for new key type to views_. Change all
10171 callers.
10172 (File_read::read): Adjust for byteshift in returned view.
10173 (File_read::add_view): New function, broken out of
10174 find_and_make_view.
10175 (File_read::make_view): New function, broken out of
10176 find_and_make_view.
10177 (File_read::find_or_make_view): Add offset and aligned
10178 parameters. Rewrite accordingly. Change all callers.
10179 (File_read::get_view): Add offset and aligned parameters. Adjust
10180 for byteshift in return value.
10181 (File_read::get_lasting_view): Likewise.
10182 * fileread.h (class File_read): Update declarations.
10183 (class File_read::View): Add byteshift_ field. Add byteshift to
10184 constructor. Add byteshift method.
10185 * archive.h (Archive::clear_uncached_views): New function.
10186 (Archive::get_view): Add aligned parameter. Change all callers.
10187 * object.h (Object::get_view): Add aligned parameter. Change all
10188 callers.
10189 (Object::get_lasting_view): Likewise.
10190
10191 * fileread.cc (File_read::release): Don't call clear_views if
10192 there are multiple objects.
10193 * fileread.h (File_read::clear_uncached_views): New function.
10194 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10195 on the archive.
10196
a1207466
CC
101972008-03-31 Cary Coutant <ccoutant@google.com>
10198
10199 Add thin archive support.
10200 * archive.cc (Archive::armagt): New const.
10201 (Archive::setup): Remove task parameter and calls to unlock.
10202 (Archive::unlock_nested_archives): New function.
10203 (Archive::read_header): Add nested_off parameter. Change
10204 all callers.
10205 (Archive::interpret_header): Likewise.
10206 (Archive::include_all_members): Change to handle thin
10207 archives.
10208 (Archive::include_member): Likewise.
10209 * archive.h (Archive::Archive): Add new parameters and
10210 initializers.
10211 (Archive::armagt): New const.
10212 (Archive::setup): Remove task parameter.
10213 (Archive::unlock_nested_archives): New function.
10214 (Archive::read_header): Add nested_off parameter.
10215 (Archive::interpret_header): Likewise.
10216 (Archive::Nested_archive_table): New typedef.
10217 (Archive::is_thin_archive_): New field.
10218 (Archive::nested_archives_): New field.
10219 (Archive::options_): New field.
10220 (Archive::dirpath_): New field.
10221 (Archive::task_): New field.
10222 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10223 for thin archives. Pass additional parameters to
10224 Archive::Archive. Unlock the archive file after calling
10225 Archive::setup.
cd536b21 10226
479f6503
ILT
102272008-03-29 Ian Lance Taylor <iant@google.com>
10228
686c8caf
ILT
10229 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10230 version symbol to be local.
10231 * testsuite/ver_test_4.sh: New file.
10232 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10233 (check_DATA): Add ver_test_4.syms.
10234 (ver_test_4.syms): New target.
10235 * testsuite/Makefile.in: Rebuild.
10236
ab794b6b
ILT
10237 * output.cc
10238 (Output_section::Input_section_sort_entry::has_priority): New
10239 function.
10240 (Output_section::Input_section_sort_entry::match_file_name): New
10241 function.
10242 (Output_section::Input_section_sort_entry::match_section_name):
10243 Remove.
10244 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10245 Remove.
10246 (Output_section::Input_section_sort_entry::match_section_file):
10247 Remove.
10248 (Output_section::Input_section_sort_compare::operator()): Rewrite
10249 using new Input_section_sort_entry functions. Sort crtbegin and
10250 crtend first. Sort sections with no priority before sections with
10251 a priority.
10252 * testsuite/initpri1.c (d3): Check j != 4.
10253 (cd5): New constructor/destructor function.
10254 (main): Check j != 2.
10255
479f6503
ILT
10256 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10257 new symbol when resolving, don't call set_is_default.
10258 * testsuite/ver_test_7.cc: New file.
10259 * testsuite/ver_test_7.sh: New file.
10260 * testsuite/Makefile.am (ver_test_7.so): New target.
10261 (ver_test_7.o): New target.
10262 (check_SCRIPTS): Add ver_test_7.sh.
10263 (check_DATA): Add ver_test_7.syms.
10264 (ver_test_7.syms): New target.
10265
2fd32231
ILT
102662008-03-28 Ian Lance Taylor <iant@google.com>
10267
10268 * layout.cc (Layout::layout): If we see an input section with a
10269 name that needs sorting, set the must_sort flag for the output
10270 section.
10271 (Layout::make_output_section): If the name of the output section
10272 indicates that it might require sorting, set the may_sort flag.
10273 * output.h (Output_section::may_sort_attached_input_sections): New
10274 function.
10275 (Output_section::set_may_sort_attached_input_sections): New
10276 function.
10277 (Output_section::must_sort_attached_input_sections): New
10278 function.
10279 (Output_section::set_must_sort_attached_input_sections): New
10280 function.
10281 (class Output_section): Declare Input_section_sort_entry. Define
10282 Input_section_sort_compare. Declare
10283 sort_attached_input_sections. Add new fields:
10284 may_sort_attached_input_sections_,
10285 must_sort_attached_input_sections_,
10286 attached_input_sections_are_sorted_.
10287 * output.cc (Output_section::Output_section): Initialize new
10288 fields.
10289 (Output_section::add_input_section): Add an entry to
10290 input_sections_ if may_sort or must_sort are true.
10291 (Output_section::set_final_data_size): Call
10292 sort_attached_input_sections if necessary.
10293 (Output_section::Input_section_sort_entry): Define new class.
10294 (Output_section::Input_section_sort_compare::operator()): New
10295 function.
10296 (Output_section::sort_attached_input_sections): New function.
10297 * configure.ac: Check whether the compiler supports constructor
10298 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
10299 * testsuite/initpri1.c: New file.
10300 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
10301 CONSTRUCTOR_PRIORITY.
10302 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
10303 (initpri1_LDFLAGS): New variable.
10304 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10305
18e6b24e
ILT
103062008-03-27 Ian Lance Taylor <iant@google.com>
10307
49bdd526
ILT
10308 * common.cc (Sort_commons::operator): Correct sorting algorithm.
10309 * testsuite/common_test_1.c: New file.
10310 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
10311 (common_test_1_SOURCES): New variable.
10312 (common_test_1_DEPENDENCIES): New variable.
10313 (common_test_1_LDFLAGS): New variable.
10314
18e6b24e
ILT
10315 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
10316 and commons_ correctly when NAME/VERSION does not override
10317 NAME/NULL.
10318 * testsuite/ver_test_6.c: New file.
10319 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
10320 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
10321 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
10322
04bf7072
ILT
103232008-03-26 Ian Lance Taylor <iant@google.com>
10324
5871526f
ILT
10325 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
10326 of an undefined symbol from a version script.
10327 * testsuite/Makefile.am (ver_test_5.so): New target.
10328 (ver_test_5.o): New target.
10329 (check_SCRIPTS): Add ver_test_5.sh.
10330 (check_DATA): Add ver_test_5.syms.
10331 (ver_test_5.syms): New target.
10332 * testsuite/ver_test_5.cc: New file.
10333 * testsuite/ver_test_5.script: New file.
10334 * testsuite/ver_test_5.sh: New file.
10335 * Makefile.in, testsuite/Makefile.in: Rebuild.
10336
04bf7072
ILT
10337 PR gold/5986
10338 Fix problems building gold with gcc 4.3.0.
10339 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
10340 (gold_error_at_location, gold_warning_at_location): Use it.
10341 * configure.ac: Check whether we can compile and use a template
10342 function with a printf attribute.
10343 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
10344 when jumping over bytes.
10345 * object.cc: Instantiate Object::read_section_data.
10346 * debug.h: Include <cstring>
10347 * dwarf_reader.cc: Include <algorithm>
10348 * main.cc: Include <cstring>.
10349 * options.cc: Include <cstring>.
10350 * output.cc: Include <cstring>.
10351 * script.cc: Include <cstring>.
10352 * script.h: Include <string>.
10353 * symtab.cc: Include <cstring> and <algorithm>.
10354 * target-select.cc: Include <cstring>.
10355 * version.cc: Include <string>.
10356 * testsuite/testmain.cc: Include <cstdlib>.
10357 * configure, config.in: Rebuild.
10358
874c5b28
ILT
103592008-03-25 Ian Lance Taylor <iant@google.com>
10360
819d6c3a
ILT
10361 * options.cc: Include "../bfd/bfdver.h".
10362 (options::help): Print bug reporting address.
10363
f4b2c6f5
ILT
10364 * version.cc (print_version): Adjust output for current value of
10365 BFD_VERSION_STRING.
10366
10367 * NEWS: New file.
10368
e96caa79
ILT
10369 * options.cc (options::help): Print list of supported targets.
10370 * target-select.h: Include <vector>.
10371 (class Target_selector): Make machine_, size_, and is_big_endian_
10372 fields const. Add bfd_name_ and instantiated_target_ fields.
10373 (Target_selector::Target_selector): Add bfd_name parameter.
10374 (Target_selector::recognize): Make non-virtual, call
10375 do_recognize.
10376 (Target_selector::recognize_by_name): Make non-virtual, call
10377 do_recognize_by_name.
10378 (Target_selector::supported_names): New function.
10379 (Target_selector::bfd_name): New function.
10380 (Target_selector::do_instantiate_target): New pure virtual
10381 function.
10382 (Target_selector::do_recognize): New virtual function.
10383 (Target_selector::do_recognize_by_name): New virtual function.
10384 (Target_selector::instantiate_target): New private function.
10385 (supported_target_names): Declare.
10386 * target-select.cc (Target_selector::Target_selector): Update for
10387 new parameter and fields.
10388 (select_target_by_name): Check that the name matches before
10389 calling recognize_by_name.
10390 (supported_target_names): New function.
10391 * i386.cc (class Target_selector_i386): Update Target_selector
10392 constructor call. Remove recognize and recognize_by_name. Add
10393 do_instantiate_target.
10394 * x86_64.cc (class Target_selector_x86_64): Likewise.
10395 * testsuite/testfile.cc (class Target_selector_test): Update for
10396 changes to Target_selector.
10397
874c5b28
ILT
10398 * README: Rewrite, with some notes on unsupported features.
10399
0a65a3a7
CC
104002008-03-24 Cary Coutant <ccoutant@google.com>
10401
10402 * i386.cc (Target_i386::Got_type): New enum declaration.
10403 (Target_i386::Scan::local): Updated callers of Output_data_got
10404 member functions.
10405 (Target_i386::Scan::global): Likewise.
10406 (Target_i386::Relocate::relocate): Likewise.
10407 (Target_i386::Relocate::relocate_tls): Likewise.
10408 * object.h (Got_offset_list): New class.
10409 (Sized_relobj::local_has_got_offset): Added got_type parameter.
10410 (Sized_relobj::local_got_offset): Likewise.
10411 (Sized_relobj::set_local_got_offset): Likewise.
10412 (Sized_relobj::local_has_tls_got_offset): Removed.
10413 (Sized_relobj::local_tls_got_offset): Removed.
10414 (Sized_relobj::set_local_tls_got_offset): Removed.
10415 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
10416 * output.cc (Output_data_got::add_global): Added got_type parameter.
10417 (Output_data_got::add_global_with_rel): Likewise.
10418 (Output_data_got::add_global_with_rela): Likewise.
10419 (Output_data_got::add_global_pair_with_rel): New function.
10420 (Output_data_got::add_global_pair_with_rela): New function.
10421 (Output_data_got::add_local): Added got_type parameter.
10422 (Output_data_got::add_local_with_rel): Likewise.
10423 (Output_data_got::add_local_with_rela): Likewise.
10424 (Output_data_got::add_local_pair_with_rel): New function.
10425 (Output_data_got::add_local_pair_with_rela): New function.
10426 (Output_data_got::add_global_tls): Removed.
10427 (Output_data_got::add_global_tls_with_rel): Removed.
10428 (Output_data_got::add_global_tls_with_rela): Removed.
10429 (Output_data_got::add_local_tls): Removed.
10430 (Output_data_got::add_local_tls_with_rel): Removed.
10431 (Output_data_got::add_local_tls_with_rela): Removed.
10432 * output.h (Output_data_got::add_global): Added got_type parameter.
10433 (Output_data_got::add_global_with_rel): Likewise.
10434 (Output_data_got::add_global_with_rela): Likewise.
10435 (Output_data_got::add_global_pair_with_rel): New function.
10436 (Output_data_got::add_global_pair_with_rela): New function.
10437 (Output_data_got::add_local): Added got_type parameter.
10438 (Output_data_got::add_local_with_rel): Likewise.
10439 (Output_data_got::add_local_with_rela): Likewise.
10440 (Output_data_got::add_local_pair_with_rel): New function.
10441 (Output_data_got::add_local_pair_with_rela): New function.
10442 (Output_data_got::add_global_tls): Removed.
10443 (Output_data_got::add_global_tls_with_rel): Removed.
10444 (Output_data_got::add_global_tls_with_rela): Removed.
10445 (Output_data_got::add_local_tls): Removed.
10446 (Output_data_got::add_local_tls_with_rel): Removed.
10447 (Output_data_got::add_local_tls_with_rela): Removed.
10448 * resolve.cc (Symbol::override_base_with_special): Removed
10449 reference to has_got_offset_ field.
10450 * symtab.cc (Symbol::init_fields): Replaced initialization
10451 of got_offset_ with got_offsets_. Removed initialization
10452 of has_got_offset_
53fcba31 10453 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
10454 (Symbol::got_offset): Likewise.
10455 (Symbol::set_got_offset): Likewise.
10456 (Symbol::has_tls_got_offset): Removed.
10457 (Symbol::tls_got_offset): Removed.
10458 (Symbol::set_tls_got_offset): Removed.
10459 (Symbol::got_offset_): Removed.
10460 (Symbol::tls_mod_got_offset_): Removed.
10461 (Symbol::tls_pair_got_offset_): Removed.
10462 (Symbol::got_offsets_): New field.
10463 (Symbol::has_got_offset): Removed.
10464 (Symbol::has_tls_mod_got_offset): Removed.
10465 (Symbol::has_tls_pair_got_offset): Removed.
10466 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
10467 (Target_x86_64::Scan::local): Updated callers of Output_data_got
10468 member functions.
10469 (Target_x86_64::Scan::global): Likewise.
10470 (Target_x86_64::Relocate::relocate): Likewise.
10471 (Target_x86_64::Relocate::relocate_tls): Likewise.
10472
bd52eafb
BE
104732008-03-25 Ben Elliston <bje@au.ibm.com>
10474
10475 * yyscript.y: Fix spelling error in comment.
10476
8b105e34
ILT
104772008-03-24 Ian Lance Taylor <iant@google.com>
10478
8ed814a9
ILT
10479 * options.h (class General_options): Define build_id option.
10480 * layout.h (class Layout): Declare write_build_id, create_note,
10481 create_build_id. Add build_id_note_ member.
10482 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
10483 "libiberty.h", "md5.h", "sha1.h".
10484 (Layout::Layout): Initialize eh_frame_data_,
10485 eh_frame_hdr_section_, and build_id_note_.
10486 (Layout::finalize): Call create_build_id.
10487 (Layout::create_note): New function, broken out of
10488 Layout::create_gold_note.
10489 (Layout::create_gold_note): Call create_note.
10490 (Layout::create_build_id): New function.
10491 (Layout::write_build_id): New function.
10492 (Close_task_runner::run): Call write_build_id.
10493
8b105e34
ILT
10494 * x86_64.cc: Correct license to GPLv3.
10495
086a1841
ILT
104962008-03-23 Ian Lance Taylor <iant@google.com>
10497
10498 * options.cc: Include "demangle.h".
10499 (parse_optional_string): New function.
10500 (parse_long_option): Handle takes_optional_argument.
10501 (parse_short_option): Update dash_z initializer. Handle
10502 takes_optional_argument.
10503 (General_options::General_options): Initialize do_demangle_.
10504 (General_options::finalize): Set do_demangle_. Handle demangling
10505 style.
10506 * options.h (parse_optional_string): Declare.
10507 (struct One_option): Add optional_arg field. Update constructor.
10508 Update call constructor calls. Add takes_optional_argument
10509 function.
10510 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
10511 (DEFINE_optional_string): Define.
10512 (General_options::demangle): Change from DEFINE_bool to
10513 DEFINE_optional_string.
10514 (General_options::no_demangle): New function.
10515 (General_options::do_demangle): New function.
10516 (General_options::set_do_demangle): New function.
10517 (General_options::execstack_status_): Move definition to end of
10518 class definition.
10519 (General_options::static_): Likewise.
10520 (General_options::do_demangle_): New field.
10521 * object.cc (big_endian>::get_symbol_location_info): Call
10522 Options::do_demangle, not Options::demangle.
10523 * symtab.cc (demangle): Likewise.
10524
cbb93e63
ILT
105252008-03-22 Ian Lance Taylor <iant@google.com>
10526
10527 * gold.h: Include <cstddef> and <sys/types.h>
10528 * options.h: Include <cstring>.
10529
ec531623
ILT
105302008-03-21 Ian Lance Taylor <iant@google.com>
10531
10532 * Added source code to GNU binutils.
This page took 0.611732 seconds and 4 git commands to generate.