2011-04-22 Doug Kwan <dougkwan@google.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
c87e4302
DK
12011-04-22 Doug Kwan <dougkwan@google.com>
2
3 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
4 flag of a SHT_ARM_EXIDX section.
5 * testsuite/Makefile.am (arm_exidx_test): New test rules.
6 * testsuite/Makefile.in: Regenerate.
7 * testsuite/arm_exidx_test.s: New file.
8 * testsuite/arm_exidx_test.sh: Same.
9
e7782cf6
CC
102011-04-20 Cary Coutant <ccoutant@google.com>
11
12 PR gold/12689
13 * archive.h (Incremental_archive_entry::Archive_member):
14 Initialize arg_serial_ (second constructor).
15
308ecdc7
ILT
162011-04-17 Ian Lance Taylor <iant@google.com>
17
18 * object.cc (Relocate_info::location): Simplify location string.
19 * errors.cc (Errors::error_at_location): Don't print program
20 name.
21 (Errors::warning_at_location): Likewise.
22 (Errors::undefined_symbol): Likewise.
23 * testsuite/debug_msg.sh: Update accordingly.
24
bec5b579
CC
252011-04-14 Cary Coutant <ccoutant@google.com>
26
27 * gold/layout.cc (Layout::symtab_section_offset): New function.
28 * gold/layout.h (Layout::symtab_section_offset): New function.
29 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
30
88597d34
ILT
312011-04-12 Ian Lance Taylor <iant@google.com>
32
33 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
34 with MREMAP_MAYMOVE.
35 * output.h (class Output_file): Add map_is_allocated_ field.
36 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
37 not available, provide stubs. If mremap is not available, #define
38 it to gold_mremap.
39 (MREMAP_MAYMOVE): Define if not defined.
40 (Output_file::Output_file): Initialize map_is_allocated_.
41 (Output_file::resize): Check map_is_allocated_.
42 (Output_file::map_anonymous): If mmap fails, use malloc.
43 (Output_file::unmap): Don't do anything for an anonymous map.
44 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
45 is not available, provide stubs.
46 (File_read::View::~View): Use free rather than delete[].
47 (File_read::make_view): Use malloc rather than new[]. If mmap
48 fails, use malloc.
49 (File_read::find_or_make_view): Use malloc rather than new[].
50 * gold.h: Remove HAVE_REMAP code.
51 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
52 exists. Rename mremap to gold_mremap. If mmap is not available
53 don't do anything.
54 * configure, config.in: Rebuild.
55
11e361bc
ILT
562011-04-11 Ian Lance Taylor <iant@google.com>
57
58 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
59 initialize local variable v.
60
cdc29364
CC
612011-04-11 Cary Coutant <ccoutant@google.com>
62
63 * archive.cc (Archive::include_member): Adjust call to
64 report_object.
65 (Add_archive_symbols::run): Track argument serial numbers.
66 (Lib_group::include_member): Likewise.
67 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
68 * archive.h (Incremental_archive_entry::Archive_member):
69 Initialize arg_serial_.
70 (Archive_member::arg_serial_): New data member.
71 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
72 (Sized_dynobj::do_add_symbols): Track symbols when doing an
73 incremental link.
74 (Sized_dynobj::do_for_all_local_got_entries): New function.
75 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
76 function.
77 * fileread.cc (get_mtime): New function.
78 * fileread.h (get_mtime): New function.
79 * gold.cc (queue_initial_tasks): Check for incremental update.
80 (process_incremental_input): New function.
81 (queue_middle_tasks): Don't force valid target for incremental
82 update.
83 * incremental-dump.cc (find_input_containing_global): Adjust
84 size of symbol info entry.
85 (dump_incremental_inputs): Dump argument serial number and
86 in_system_directory flag; bias shndx by 1; print symbol names
87 when dumping per-file symbol lists; use new symbol info readers.
88 * incremental.cc
89 (Output_section_incremental_inputs:update_data_size): New function.
90 (Sized_incremental_binary::setup_readers): Setup input readers
91 for each input file; build maps for files added from libraries
92 and scripts.
93 (Sized_incremental_binary::check_input_args): New function.
94 (Sized_incremental_binary::do_check_inputs): Build map of argument
95 serial numbers to input arguments.
96 (Sized_incremental_binary::do_file_has_changed): Rename
97 do_file_is_unchanged to this; compare file modification times.
98 (Sized_incremental_binary::do_init_layout): New function.
99 (Sized_incremental_binary::do_reserve_layout): New function.
100 (Sized_incremental_binary::do_get_input_reader): Remove.
101 (Sized_incremental_binary::get_symtab_view): New function.
102 (Incremental_checker::can_incrementally_link_output_file): Remove.
103 (Incremental_inputs::report_command_line): Exclude --debug options.
104 (Incremental_inputs::report_archive_begin): Add parameter; track
105 argument serial numbers; don't put input file entry for archive
106 before archive members.
107 (Incremental_inputs::report_archive_end): Put input file entry
108 for archive after archive members.
109 (Incremental_inputs::report_object): Add parameter; track argument
110 serial numbers and in_system_directory flag.
111 (Incremental_inputs::report_script): Add parameter; track argument
112 serial numbers.
113 (Output_section_incremental_inputs::set_final_data_size): Adjust
114 size of symbol info entry; check for forwarding symbols.
115 (Output_section_incremental_inputs::write_input_files): Write
116 in_system_directory flag and argument serial number.
117 (Output_section_incremental_inputs::write_info_blocks): Map section
118 indices between incremental info and original input file; store
119 input section index for each symbol.
120 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
121 change operator() to visit().
122 (class Global_got_offset_visitor): Likewise.
123 (class Global_symbol_visitor_got_plt):
124 (Output_section_incremental_inputs::write_got_plt): Use new visitor
125 classes.
126 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
127 (Sized_incr_relobj::do_read_symbols): New function.
128 (Sized_incr_relobj::do_layout): New function.
129 (Sized_incr_relobj::do_layout_deferred_sections): New function.
130 (Sized_incr_relobj::do_add_symbols): New function.
131 (Sized_incr_relobj::do_should_include_member): New function.
132 (Sized_incr_relobj::do_for_all_global_symbols): New function.
133 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
134 (Sized_incr_relobj::do_section_size): New function.
135 (Sized_incr_relobj::do_section_name): New function.
136 (Sized_incr_relobj::do_section_contents): New function.
137 (Sized_incr_relobj::do_section_flags): New function.
138 (Sized_incr_relobj::do_section_entsize): New function.
139 (Sized_incr_relobj::do_section_address): New function.
140 (Sized_incr_relobj::do_section_type): New function.
141 (Sized_incr_relobj::do_section_link): New function.
142 (Sized_incr_relobj::do_section_info): New function.
143 (Sized_incr_relobj::do_section_addralign): New function.
144 (Sized_incr_relobj::do_initialize_xindex): New function.
145 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
146 (Sized_incr_relobj::do_read_relocs): New function.
147 (Sized_incr_relobj::do_gc_process_relocs): New function.
148 (Sized_incr_relobj::do_scan_relocs): New function.
149 (Sized_incr_relobj::do_count_local_symbols): New function.
150 (Sized_incr_relobj::do_finalize_local_symbols): New function.
151 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
152 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
153 (Sized_incr_relobj::do_relocate): New function.
154 (Sized_incr_relobj::do_set_section_offset): New function.
155 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
156 (Sized_incr_dynobj::do_read_symbols): New function.
157 (Sized_incr_dynobj::do_layout): New function.
158 (Sized_incr_dynobj::do_add_symbols): New function.
159 (Sized_incr_dynobj::do_should_include_member): New function.
160 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
161 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
162 (Sized_incr_dynobj::do_section_size): New function.
163 (Sized_incr_dynobj::do_section_name): New function.
164 (Sized_incr_dynobj::do_section_contents): New function.
165 (Sized_incr_dynobj::do_section_flags): New function.
166 (Sized_incr_dynobj::do_section_entsize): New function.
167 (Sized_incr_dynobj::do_section_address): New function.
168 (Sized_incr_dynobj::do_section_type): New function.
169 (Sized_incr_dynobj::do_section_link): New function.
170 (Sized_incr_dynobj::do_section_info): New function.
171 (Sized_incr_dynobj::do_section_addralign): New function.
172 (Sized_incr_dynobj::do_initialize_xindex): New function.
173 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
174 (make_sized_incremental_object): New function.
175 (Incremental_library::copy_unused_symbols): New function.
176 (Incremental_library::do_for_all_unused_symbols): New function.
177 * incremental.h (enum Incremental_input_flags): New type.
178 (class Incremental_checker): Remove.
179 (Incremental_input_entry::Incremental_input_entry): Add argument
180 serial number.
181 (Incremental_input_entry::arg_serial): New function.
182 (Incremental_input_entry::set_is_in_system_directory): New function.
183 (Incremental_input_entry::is_in_system_directory): New function.
184 (Incremental_input_entry::arg_serial_): New data member.
185 (Incremental_input_entry::is_in_system_directory_): New data member.
186 (class Script_info): Move here from script.h.
187 (Script_info::Script_info): Add filename parameter.
188 (Script_info::filename): New function.
189 (Script_info::filename_): New data member.
190 (Incremental_script_entry::Incremental_script_entry): Add argument
191 serial number.
192 (Incremental_object_entry::Incremental_object_entry): Likewise.
193 (Incremental_object_entry::add_input_section): Build list of input
194 sections with map to original shndx.
195 (Incremental_object_entry::get_input_section_index): New function.
196 (Incremental_object_entry::shndx_): New data member.
197 (Incremental_object_entry::name_key_): Rename; adjust all refs.
198 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
199 (Incremental_archive_entry::Incremental_archive_entry): Add argument
200 serial number.
201 (Incremental_inputs::report_archive_begin): Likewise.
202 (Incremental_inputs::report_object): Likewise.
203 (Incremental_inputs::report_script): Likewise.
204 (class Incremental_global_symbol_reader): New class.
205 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
206 and store flags and input file type.
207 (Incremental_input_entry_reader::arg_serial): New function.
208 (Incremental_input_entry_reader::type): Extract type from flags.
209 (Incremental_input_entry_reader::is_in_system_directory): New function.
210 (Incremental_input_entry_reader::get_input_section_count): Call
211 accessor function for type.
212 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
213 function for type; adjust size of global symbol entry.
214 (Incremental_input_entry_reader::get_global_symbol_count): Call
215 accessor function for type.
216 (Incremental_input_entry_reader::get_object_count): Likewise.
217 (Incremental_input_entry_reader::get_object_offset): Likewise.
218 (Incremental_input_entry_reader::get_member_count): Likewise.
219 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
220 (Incremental_input_entry_reader::get_member_offset): Likewise.
221 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
222 (Incremental_input_entry_reader::Global_symbol_info): Remove.
223 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
224 (Incremental_input_entry_reader::get_global_symbol_reader): New
225 function.
226 (Incremental_input_entry_reader::get_output_symbol_index): New
227 function.
228 (Incremental_input_entry_reader::type_): Remove.
229 (Incremental_input_entry_reader::flags_): New data member.
230 (Incremental_inputs_reader::input_file_offset): New function.
231 (Incremental_inputs_reader::input_file_index): New function.
232 (Incremental_inputs_reader::input_file): Call input_file_offset.
233 (Incremental_inputs_reader::input_file_at_offset): New function.
234 (Incremental_relocs_reader::get_r_type): Reformat.
235 (Incremental_relocs_reader::get_r_shndx): Reformat.
236 (Incremental_relocs_reader::get_r_offset): Reformat.
237 (Incremental_relocs_reader::data): New function.
238 (Incremental_binary::Incremental_binary): Initialize new data members.
239 (Incremental_binary::check_inputs): Add cmdline parameter.
240 (Incremental_binary::file_is_unchanged): Remove.
241 (Input_reader::arg_serial): New function.
242 (Input_reader::get_unused_symbol_count): New function.
243 (Input_reader::get_unused_symbol): New function.
244 (Input_reader::do_arg_serial): New function.
245 (Input_reader::do_get_unused_symbol_count): New function.
246 (Input_reader::do_get_unused_symbol): New function.
247 (Incremental_binary::input_file_count): New function.
248 (Incremental_binary::get_input_reader): Change signature to use
249 index instead of filename.
250 (Incremental_binary::file_has_changed): New function.
251 (Incremental_binary::get_input_argument): New function.
252 (Incremental_binary::get_library): New function.
253 (Incremental_binary::get_script_info): New function.
254 (Incremental_binary::init_layout): New function.
255 (Incremental_binary::reserve_layout): New function.
256 (Incremental_binary::output_file): New function.
257 (Incremental_binary::do_check_inputs): New function.
258 (Incremental_binary::do_file_is_unchanged): Remove.
259 (Incremental_binary::do_file_has_changed): New function.
260 (Incremental_binary::do_init_layout): New function.
261 (Incremental_binary::do_reserve_layout): New function.
262 (Incremental_binary::do_input_file_count): New function.
263 (Incremental_binary::do_get_input_reader): Change signature.
264 (Incremental_binary::input_args_map_): New data member.
265 (Incremental_binary::library_map_): New data member.
266 (Incremental_binary::script_map_): New data member.
267 (Sized_incremental_binary::Sized_incremental_binary): Initialize
268 new data members.
269 (Sized_incremental_binary::output_section): New function.
270 (Sized_incremental_binary::inputs_reader): Add const.
271 (Sized_incremental_binary::symtab_reader): Add const.
272 (Sized_incremental_binary::relocs_reader): Add const.
273 (Sized_incremental_binary::got_plt_reader): Add const.
274 (Sized_incremental_binary::get_symtab_view): New function.
275 (Sized_incremental_binary::Inputs_reader): New typedef.
276 (Sized_incremental_binary::Input_entry_reader): New typedef.
277 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
278 (Sized_incremental_binary::do_file_is_unchanged): Remove.
279 (Sized_incremental_binary::do_file_has_changed): New function.
280 (Sized_incremental_binary::do_init_layout): New function.
281 (Sized_incremental_binary::do_reserve_layout): New function.
282 (Sized_input_reader::Inputs_reader): Remove.
283 (Sized_input_reader::Input_entry_reader): Remove.
284 (Sized_input_reader::do_arg_serial): New function.
285 (Sized_input_reader::do_get_unused_symbol_count): New function.
286 (Sized_input_reader::do_get_unused_symbol): New function.
287 (Sized_incremental_binary::do_input_file_count): New function.
288 (Sized_incremental_binary::do_get_input_reader): Change signature;
289 use index instead of filename.
290 (Sized_incremental_binary::section_map_): New data member.
291 (Sized_incremental_binary::input_entry_readers_): New data member.
292 (class Sized_incr_relobj): New class.
293 (class Sized_incr_dynobj): New class.
294 (make_sized_incremental_object): New function.
295 (class Incremental_library): New class.
296 * layout.cc (Free_list::num_lists): New static data member.
297 (Free_list::num_nodes): New static data member.
298 (Free_list::num_removes): New static data member.
299 (Free_list::num_remove_visits): New static data member.
300 (Free_list::num_allocates): New static data member.
301 (Free_list::num_allocate_visits): New static data member.
302 (Free_list::init): New function.
303 (Free_list::remove): New function.
304 (Free_list::allocate): New function.
305 (Free_list::dump): New function.
306 (Free_list::print_stats): New function.
307 (Layout_task_runner::run): Resize output file for incremental updates.
308 (Layout::Layout): Initialize new data members.
309 (Layout::set_incremental_base): New function.
310 (Layout::init_fixed_output_section): New function.
311 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
312 incremental updates.
313 (Layout::create_gold_note): Do not create gold note section for
314 incremental updates.
315 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
316 for incremental updates.
317 (Layout::set_section_offsets): For incremental updates, allocate space
318 from free list.
319 (Layout::create_symtab_sections): Layout with offsets relative to
320 start of section; for incremental updates, allocate space from free
321 list.
322 (Layout::create_shdrs): For incremental updates, allocate space from
323 free list.
324 (Layout::finish_dynamic_section): For incremental updates, do not
325 check --as-needed (fixed in subsequent patch).
326 * layout.h (class Free_list): New class.
327 (Layout::set_incremental_base): New function.
328 (Layout::incremental_base): New function.
329 (Layout::init_fixed_output_section): New function.
330 (Layout::allocate): New function.
331 (Layout::incremental_base_): New data member.
332 (Layout::free_list_): New data member.
333 * main.cc (main): Print Free_list statistics.
334 * object.cc (Relobj::finalize_incremental_relocs): Add
335 clear_counts parameter; clear counts only when clear_counts is set.
336 (Sized_relobj::Sized_relobj): Initialize new base class.
337 (Sized_relobj::do_layout): Don't report special sections.
338 (Sized_relobj::do_for_all_local_got_entries): New function.
339 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
340 symtab_off to all symbol table offsets.
341 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
342 * object.h (class Got_offset_list): Move to top of file.
343 (Object::Object): Allow case where input_file == NULL.
344 (Object::~Object): Likewise.
345 (Object::input_file): Assert that input_file != NULL.
346 (Object::lock): Allow case where input_file == NULL.
347 (Object::unlock): Likewise.
348 (Object::is_locked): Likewise.
349 (Object::token): Likewise.
350 (Object::release): Likewise.
351 (Object::is_incremental): New function.
352 (Object::get_mtime): New function.
353 (Object::for_all_local_got_entries): New function.
354 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
355 (Object::set_is_in_system_directory): New function.
356 (Object::is_in_system_directory): New function.
357 (Object::do_is_incremental): New function.
358 (Object::do_get_mtime): New function.
359 (Object::do_for_all_local_got_entries): New function.
360 (Object::is_in_system_directory_): New data member.
361 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
362 (class Sized_relobj_base): New class.
363 (class Sized_relobj): Derive from Sized_relobj_base.
364 (class Sized_relobj::Symbols): Redeclare from base class.
365 (class Sized_relobj::local_got_offset_list): Remove.
366 (class Sized_relobj::Output_sections): Redeclare from base class.
367 (class Sized_relobj::do_for_all_local_got_entries): New function.
368 (class Sized_relobj::write_local_symbols): Add offset parameter.
369 (class Sized_relobj::local_symbol_offset_): Update comment.
370 (class Sized_relobj::local_dynsym_offset_): Update comment.
371 * options.cc (Input_arguments::add_file): Remove const.
372 * options.h (Input_file_argument::Input_file_argument):
373 Initialize arg_serial_ (all constructors).
374 (Input_file_argument::set_arg_serial): New function.
375 (Input_file_argument::arg_serial): New function.
376 (Input_file_argument::arg_serial_): New data member.
377 (Input_arguments::Input_arguments): Initialize file_count_.
378 (Input_arguments::add_file): Remove const.
379 (Input_arguments::number_of_input_files): New function.
380 (Input_arguments::file_count_): New data member.
381 (Command_line::number_of_input_files): Call
382 Input_arguments::number_of_input_files.
383 * output.cc (Output_segment_headers::Output_segment_headers):
384 Set current size.
385 (Output_section::Input_section::current_data_size): New function.
386 (Output_section::Output_section): Initialize new data members.
387 (Output_section::add_input_section): Don't do merge sections for
388 an incremental link; allocate space from free list for an
389 incremental update.
390 (Output_section::add_output_section_data): Allocate space from
391 free list for an incremental update.
392 (Output_section::update_data_size): New function.
393 (Output_section::set_fixed_layout): New function.
394 (Output_section::reserve): New function.
395 (Output_segment::set_section_addresses): Remove const.
396 (Output_segment::set_section_list_addresses): Remove const; allocate
397 space from free list for an incremental update.
398 (Output_segment::set_offset): Adjust size of RELRO segment for an
399 incremental update.
400 * output.h (Output_data::current_data_size): Move here from
401 child classes.
402 (Output_data::pre_finalize_data_size): New function.
403 (Output_data::update_data_size): New function.
404 (Output_section_headers::update_data_size): new function.
405 (Output_section_data_build::current_data_size): Move to Output_data.
406 (Output_data_strtab::update_data_size): New function.
407 (Output_section::current_data_size): Move to Output_data.
408 (Output_section::set_fixed_layout): New function.
409 (Output_section::has_fixed_layout): New function.
410 (Output_section::reserve): New function.
411 (Output_section::update_data_size): New function.
412 (Output_section::has_fixed_layout_): New data member.
413 (Output_section::free_list_): New data member.
414 (Output_segment::set_section_addresses): Remove const.
415 (Output_segment::set_section_list_addresses): Remove const.
416 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
417 New function.
418 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
419 New function.
420 * readsyms.cc (Read_symbols::do_read_symbols): Add library
421 parameter when calling Add_symbols constructor; store argument
422 serial number for members of a lib group.
423 (Add_symbols::locks): Allow case where token == NULL.
424 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
425 (Read_member::~Read_member): New function.
426 (Read_member::is_runnable): New function.
427 (Read_member::locks): New function.
428 (Read_member::run): New function.
429 (Check_script::~Check_script): New function.
430 (Check_script::is_runnable): New function.
431 (Check_script::locks): New function.
432 (Check_script::run): New function.
433 (Check_library::~Check_library): New function.
434 (Check_library::is_runnable): New function.
435 (Check_library::locks): New function.
436 (Check_library::run): New function.
437 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
438 (Add_symbols::library_): New data member.
439 (class Read_member): New class.
440 (class Check_script): New class.
441 (class Check_library): New class.
442 * reloc.cc (Read_relocs::is_runnable): Allow case where
443 token == NULL.
444 (Read_relocs::locks): Likewise.
445 (Scan_relocs::locks): Likewise.
446 (Relocate_task::locks): Likewise.
447 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
448 to clear counters.
449 (Sized_relobj::incremental_relocs_scan): Fix comment.
450 (Sized_relobj::do_relocate): Pass output file offset to
451 write_local_symbols.
452 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
453 from class declaration.
454 * script.cc (read_input_script): Allocate Script_info; pass
455 argument serial number to report_script.
456 * script.h (class Script_info): Move to incremental.h.
457 * symtab.cc (Symbol_table::add_from_incrobj): New function.
458 * symtab.h (Symbol_table::add_from_incrobj): New function.
459 (Symbol_table::set_file_offset): New function.
460
b961d0d7
CC
4612011-04-05 Cary Coutant <ccoutant@google.com>
462
463 * incremental-dump.cc (dump_incremental_inputs): Change signature
464 to take a Sized_incremental_binary; change caller. Use readers
465 in Sized_incremental_binary.
466 * incremental.cc
467 (Sized_incremental_binary::find_incremental_inputs_sections):
468 Rename do_find_incremental_inputs_sections to this.
469 (Sized_incremental_binary::setup_readers): New function.
470 (Sized_incremental_binary::do_check_inputs): Check
471 has_incremental_info_ flag; move setup code to setup_readers;
472 use input readers.
473 (Sized_incremental_binary::do_file_is_unchanged): New function.
474 (Sized_incremental_binary::do_get_input_reader): New function.
475 * incremental.h (class Incremental_binary): Move to end of file.
476 (Incremental_binary::file_is_unchanged): New function.
477 (Incremental_binary::do_file_is_unchanged): New function.
478 (Incremental_binary::Input_reader): New class.
479 (Incremental_binary::get_input_reader): New function.
480 (class Sized_incremental_binary): Move to end of file.
481 (Sized_incremental_binary::Sized_incremental_binary): Setup the
482 input section reader classes.
483 (Sized_incremental_binary::has_incremental_info): New function.
484 (Sized_incremental_binary::inputs_reader): New function.
485 (Sized_incremental_binary::symtab_reader): New function.
486 (Sized_incremental_binary::relocs_reader): New function.
487 (Sized_incremental_binary::got_plt_reader): New function.
488 (Sized_incremental_binary::do_file_is_unchanged): New function.
489 (Sized_incremental_binary::Sized_input_reader): New class.
490 (Sized_incremental_binary::get_input_reader): New function.
491 (Sized_incremental_binary::find_incremental_inputs_sections):
492 Rename do_find_incremental_inputs_sections to this.
493 (Sized_incremental_binary::setup_readers): New function.
494 (Sized_incremental_binary::has_incremental_info_): New data member.
495 (Sized_incremental_binary::inputs_reader_): New data member.
496 (Sized_incremental_binary::symtab_reader_): New data member.
497 (Sized_incremental_binary::relocs_reader_): New data member.
498 (Sized_incremental_binary::got_plt_reader_): New data member.
499 (Sized_incremental_binary::current_input_file_): New data member.
500
a869183f
PP
5012011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
502
503 PR gold/12640
504 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
505 violation.
506
5072011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
508
509 * archive.cc (Archive::include_member): Adjust call to report_object.
510 (Add_archive_symbols::run): Add script_info to call to
511 report_archive_begin.
512 (Lib_group::include_member): Adjust call to report_object.
513 (Add_lib_group_symbols::run): Adjust call to report_object.
514 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
515 blocks. Add object count for script input files.
516 * incremental.cc (Incremental_inputs::report_archive_begin): Add
517 script_info parameter; change all callers.
518 (Incremental_inputs::report_object): Add script_info parameter;
519 change all callers.
520 (Incremental_inputs::report_script): Store backpointer to
521 incremental info entry.
522 (Output_section_incremental_inputs::set_final_data_size): Record
523 additional information for scripts.
524 (Output_section_incremental_inputs::write_info_blocks): Likewise.
525 * incremental.h (Incremental_script_entry::add_object): New function.
526 (Incremental_script_entry::get_object_count): New function.
527 (Incremental_script_entry::get_object): New function.
528 (Incremental_script_entry::objects_): New data member; adjust
529 constructor.
530 (Incremental_inputs::report_archive_begin): Add script_info parameter.
531 (Incremental_inputs::report_object): Add script_info parameter.
532 (Incremental_inputs_reader::get_object_count): New function.
533 (Incremental_inputs_reader::get_object_offset): New function.
534 * options.cc (Input_arguments::add_file): Return reference to
535 new input argument.
536 * options.h (Input_argument::set_script_info): New function.
537 (Input_argument::script_info): New function.
538 (Input_argument::script_info_): New data member; adjust all
539 constructors.
540 (Input_file_group::add_file): Return reference to new input argument.
541 (Input_file_lib::add_file): Likewise.
542 (Input_arguments::add_file): Likewise.
543 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
544 * script.cc (Parser_closure::Parser_closure): Add script_info
545 parameter; adjust all callers.
546 (Parser_closure::script_info): New function.
547 (Parser_closure::script_info_): New data member.
548 (read_input_script): Report scripts earlier to incremental info.
549 (script_add_file): Set script_info in Input_argument.
550 (script_add_library): Likewise.
551 * script.h (Script_options::Script_info): Rewrite class.
552
a869183f 5532011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
554
555 * archive.cc (Library_base::should_include_member): Move
556 method here from class Archive.
557 (Archive::Archive): Initialize base class.
558 (Archive::should_include_member): Move to base class.
559 (Archive::do_for_all_unused_symbols): New function.
560 (Add_archive_symbols::run): Remove redundant access to
561 incremental_inputs.
562 (Lib_group::Lib_group): Initialize base class.
563 (Lib_group::do_filename): New function.
564 (Lib_group::include_member): Pass pointer to Lib_group to
565 report_object.
566 (Lib_group::do_for_all_unused_symbols): New function.
567 (Add_lib_group_symbols::run): Report archive information for
568 incremental links.
569 * archive.h (class Library_base): New base class.
570 (class Archive): Derive from Library_base.
571 (Archive::filename): Move to base class.
572 (Archive::set_incremental_info): Likewise.
573 (Archive::incremental_info): Likewise.
574 (Archive::Should_include): Likewise.
575 (Archive::should_include_member): Likewise.
576 (Archive::Armap_entry): Remove.
577 (Archive::Unused_symbol_iterator): Remove.
578 (Archive::unused_symbols_begin): Remove.
579 (Archive::unused_symbols_end): Remove.
580 (Archive::do_filename): New function.
581 (Archive::do_get_mtime): New function.
582 (Archive::do_for_all_unused_symbols): New function.
583 (Archive::task_): Move to base class.
584 (Archive::incremental_info_): Likewise.
585 (class Lib_group): Derive from Library_base.
586 (Lib_group::do_filename): New function.
587 (Lib_group::do_get_mtime): New function.
588 (Lib_group::do_for_all_unused_symbols): New function.
589 (Lib_group::task_): Move to base class.
590 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
591 function.
592 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
593 function.
594 * incremental.cc (Incremental_inputs::report_archive_begin):
595 Use Library_base; call library's get_mtime; add incremental inputs
596 entry before members.
597 (class Unused_symbol_visitor): New class.
598 (Incremental_inputs::report_archive_end): Use Library_base; use
599 visitor class to record unused symbols; don't add incremental inputs
600 entry after members.
601 (Incremental_inputs::report_object): Use Library_base.
602 * incremental.h
603 (Incremental_archive_entry::Incremental_archive_entry): Remove
604 unused Archive parameter.
605 (Incremental_inputs::report_archive_begin): Use Library_base.
606 (Incremental_inputs::report_archive_end): Likewise.
607 (Incremental_inputs::report_object): Likewise.
608 * object.cc (Sized_relobj::do_for_all_global_symbols): New
609 function.
610 * object.h (Object::for_all_global_symbols): New function.
611 (Object::do_for_all_global_symbols): New function.
612 (Sized_relobj::do_for_all_global_symbols): New function.
613 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
614 function.
615 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
616 function.
617
61ab3e40
ILT
6182011-03-27 Ian Lance Taylor <iant@google.com>
619
620 * archive.cc (Archive::interpret_header): Return -1 if something
621 goes wrong. Change callers accordingly.
622
30e1f9e6
CC
6232011-03-25 Cary Coutant <ccoutant@google.com>
624
625 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
626 * testsuite/Makefile.in: Regenerate.
627
9c793f14
RÁE
6282010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
629
630 * plugin.cc (get_view): New.
631 (Plugin::load): Pass get_view to the plugin.
632 (Plugin_manager::get_view): New.
633
9312bb0a
ILT
6342011-03-21 Ian Lance Taylor <iant@google.com>
635
636 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 637 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 638
7e12ba9e
ST
6392011-03-21 Sriraman Tallam <tmsriram@google.com>
640
641 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
642 Change == to -eq.
643 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
644 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
645 Change == to -eq.
646 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
647 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
648
fd7a005d
ILT
6492011-03-14 Ian Lance Taylor <iant@google.com>
650
651 * script-sections.cc (Sort_output_sections::script_compare):
652 Rename from is_before, change return type.
653 (Sort_output_sections::operator()): Adjust accordingly.
654
ed16fd1b
ILT
6552011-03-11 Jeffrey Yasskin <jyasskin@google.com>
656
657 PR gold/12572
658 * testsuite/odr_violation2.cc: Add comment to make all error line
659 numbers double digits.
660 * testsuite/debug_msg.sh: Adjust expected errors.
661
71ff8986
ILT
6622011-03-09 Jeffrey Yasskin <jyasskin@google.com>
663
664 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
665 but mark earlier ones as non-canonical
666 (offset_to_iterator): Update search target and example
667 (do_addr2line): Return extra lines in a vector*
668 (format_file_lineno): Extract from do_addr2line
669 (one_addr2line): Add vector* out-param
670 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
671 when a lineno entry appeared last for its instruction
672 (Dwarf_line_info): Add vector* out-param
673 * object.cc (Relocate_info): Pass NULL for the vector* out-param
674 * symtab.cc (Odr_violation_compare): Include the lineno in the
675 comparison again.
676 (linenos_from_loc): New. Combine the canonical line for an
677 address with its other lines.
678 (True_if_intersect): New. Helper functor to make
679 std::set_intersection a query.
680 (detect_odr_violations): Compare sets of lines instead of just
681 one line for each function. This became less deterministic, but
682 has fewer false positives.
683 * symtab.h: Declarations.
684 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
685 mix an optimized and non-optimized object in the same binary
686 (odr_violation2.so): Same.
687 * testsuite/Makefile.in: Regenerate from Makefile.am.
688 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
689 * testsuite/debug_msg.sh: Update line numbers and add
690 assertions.
691 * testsuite/odr_violation1.cc: Use OdrDerived, in a
692 non-optimized context.
693 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
694 isn't inlined, and use OdrDerived in an optimized context.
695 * testsuite/odr_header1.h: Defines OdrDerived, where
696 optimization will change the
697 first-instruction-in-the-destructor's file and line number.
698 * testsuite/odr_header2.h: Defines OdrBase.
699
a19fefdc
ILT
7002011-03-09 Ian Lance Taylor <iant@google.com>
701
702 * fileread.cc (File_read::clear_views): Don't delete the whole
703 file view.
704
ecb351e9
ILT
7052011-03-08 Ian Lance Taylor <iant@google.com>
706
707 PR gold/12525
708 * fileread.cc: #include <climits>.
709 (GOLD_IOV_MAX): Define.
710 (File_read::read_multiple): Limit number of entries by iov_max.
711 * fileread.h (class File_read): Always set max_readv_entries to
712 128.
713
b821d13c
ILT
7142011-03-07 Ian Lance Taylor <iant@google.com>
715
716 PR gold/12525
717 * options.h (class General_options): Add -dy and -dn.
718
89243142
CC
7192011-03-02 Cary Coutant <ccoutant@google.com>
720
721 * testsuite/script_test_9.t: Add TLS segment.
722
d0773f31
ILT
7232011-03-02 Simon Baldwin <simonb@google.com>
724
725 * configure.ac: Add check for gnu_indirect_function support in
726 the toolchain building binutils.
727 * configure: Rebuild.
728
badc8139
RÁE
7292010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
730
731 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
732 plugin only symbols.
733 (Symbol_table::sized_finalize_symbol) Mark symbol only present
734 in plugin files as not needed in the symbol table.
735
4cf7a849
ST
7362011-02-11 Sriraman Tallam <tmsriram@google.com>
737
738 * output.cc (Output_section::add_input_section): Delay fill
739 generation for section ordering.
740
b578bd7d
ILT
7412011-02-09 Ian Lance Taylor <iant@google.com>
742
743 PR gold/12316
744 * object.h (class Sized_relobj): Remove clear_local_symbols.
745 * reloc.cc (Sized_relobj::do_relocate): Don't call
746 clear_local_symbols.
747
84ced98a
RÁE
7482010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
749
750 * plugin.cc (is_visible_from_outside): Return true for symbols
751 in the -u option.
752
55382fb7
ILT
7532011-02-04 Jeffrey Yasskin <jyasskin@google.com>
754
755 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
756 filename.
757
4e271fff
ST
7582011-02-02 Sriraman Tallam <tmsriram@google.com>
759
760 * icf.h (is_section_foldable_candidate): Change type of parameter
761 to std::string.
762 * icf.cc (Icf::find_identical_sections): Change type of local variable
763 section_name to be std::string.
764 (is_function_ctor_or_dtor): Change type of parameter to std::string.
765
d433c3ac
ILT
7662011-01-25 Ian Lance Taylor <iant@google.com>
767
768 * script.cc (script_add_extern): Rewrite to use
769 add_symbol_reference.
770
880473a6
DK
7712011-01-25 Doug Kwan <dougkwan@google.com>
772
d433c3ac 773 * icf.cc (get_section_contents): Always lock section's object.
880473a6 774
f30f86fa
ILT
7752011-01-24 Ian Lance Taylor <iant@google.com>
776
777 * options.h (class General_options): Accept
778 --no-detect-odr-violations.
779
8e51a0b9
ILT
7802011-01-24 Ian Lance Taylor <iant@google.com>
781
782 * version.cc (version_string): Bump to 1.11.
783
0f3b89d8
ILT
7842011-01-24 Ian Lance Taylor <iant@google.com>
785
786 * plugin.cc (class Plugin_rescan): Define new class.
787 (Plugin_manager::claim_file): Set any_claimed_.
788 (Plugin_manager::save_archive): New function.
789 (Plugin_manager::save_input_group): New function.
790 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
791 necessary.
792 (Plugin_manager::new_undefined_symbol): New function.
793 (Plugin_manager::rescan): New function.
794 (Plugin_manager::rescannable_defines): New function.
795 (Plugin_manager::add_input_file): Set any_added_.
796 * plugin.h (class Plugin_manager): define new fields rescannable_,
797 undefined_symbols_, any_claimed_, and any_added_. Declare
798 Plugin_rescan as friend. Declare new functions.
799 (Plugin_manager::Rescannable): Define type.
800 (Plugin_manager::Rescannable_list): Define type.
801 (Plugin_manager::Undefined_symbol_list): Define type.
802 (Plugin_manager::Plugin_manager): Initialize new fields.
803 * archive.cc (Archive::defines_symbol): New function.
804 (Add_archive_symbols::run): Pass archive to plugins if any.
805 * archive.h (class Archive): Declare defines_symbol.
806 * readsyms.cc (Input_group::~Input_group): New function.
807 (Finish_group::run): Pass input_group to plugins if any.
808 * readsyms.h (class Input_group): Declare destructor.
809 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
810 any.
811
3bb951e5
ILT
8122011-01-10 Ian Lance Taylor <iant@google.com>
813
814 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
815 section as relro.
816 (Layout::set_segment_offsets): Reset increase_relro before calling
817 set_section_addresses a second time.
818
0aa45fac
CC
8192011-01-04 Cary Coutant <ccoutant@google.com>
820
821 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
822 sections before NOBITS sections.
823
0db46eb4
L
8242011-01-01 H.J. Lu <hongjiu.lu@intel.com>
825
826 * version.cc (print_version): Update copyright to 2011.
827
829c9745
CC
8282010-12-23 Cary Coutant <ccoutant@google.com>
829
830 * output.h (Output_data_reloc::add_output_section): Pass OD instead
831 of OS to this->add. Add OD parameter to second form of the function.
832
7500420b
ILT
8332010-12-20 Ian Lance Taylor <iant@google.com>
834
835 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
836 second of two consecutive entries with same offset.
837
f8e9a930
RW
8382010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
839
840 * testsuite/Makefile.am (ifuncmain2static_LDADD)
841 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
842 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
843 to avoid unneeded links against $(LDADD).
844 * testsuite/Makefile.in: Regenerate.
845
2fbb4320
ILT
8462010-12-15 Ian Lance Taylor <iant@google.com>
847
848 PR gold/12324
849 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
850 for R_X86_64_32 and R_X86_64_PC32.
851 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
852 ver_matching_def_pic.o.
853 (ver_matching_def_pic.o): New target.
854
fedb228d
RW
8552010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
856
857 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
858 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
859 Move definition before File_read::View member definitions.
860 (File_read::View::~View): Initialize and hold lock before
861 updating current_mapped_bytes.
862
9b547ce6
RW
8632010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
864
865 * dwarf_reader.cc: Remove outdated comment.
866 * gold-threads.cc: Fix typo in error message.
867 * archive.cc: Fix typos in comments.
868 * archive.h: Likewise.
869 * arm-reloc-property.cc: Likewise.
870 * arm-reloc-property.h: Likewise.
871 * arm-reloc.def: Likewise.
872 * arm.cc: Likewise.
873 * attributes.h: Likewise.
874 * cref.cc: Likewise.
875 * ehframe.cc: Likewise.
876 * fileread.h: Likewise.
877 * gold.h: Likewise.
878 * i386.cc: Likewise.
879 * icf.cc: Likewise.
880 * incremental.h: Likewise.
881 * int_encoding.cc: Likewise.
882 * layout.h: Likewise.
883 * main.cc: Likewise.
884 * merge.h: Likewise.
885 * object.cc: Likewise.
886 * object.h: Likewise.
887 * options.cc: Likewise.
888 * readsyms.cc: Likewise.
889 * reduced_debug_output.cc: Likewise.
890 * reloc.cc: Likewise.
891 * script-sections.cc: Likewise.
892 * sparc.cc: Likewise.
893 * symtab.h: Likewise.
894 * target-reloc.h: Likewise.
895 * target.cc: Likewise.
896 * target.h: Likewise.
897 * timer.cc: Likewise.
898 * timer.h: Likewise.
899 * x86_64.cc: Likewise.
900
83e17bd5
CC
9012010-12-09 Cary Coutant <ccoutant@google.com>
902
903 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
904 stack.
905 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
906 parameter; change all callers.
907 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
908 * options.h (warn_execstack): New option.
909
017257f8
DK
9102010-12-07 Doug Kwan <dougkwan@google.com>
911
912 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
913 like function call relocations.
914
c20cbc06
ILT
9152010-12-07 Ian Lance Taylor <iant@google.com>
916
917 * archive.cc (Archive::get_elf_object_for_member): Permit
918 punconfigured to be NULL.
919 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
920 (Archive::include_member): Pass NULL to get_elf_object_for_member
921 if we searched for the archive and this is the first included
922 object.
923
4dbfafcc
ILT
9242010-12-01 Ian Lance Taylor <iant@google.com>
925
926 * dwarf_reader.h (class Sized_dwarf_line_info): Add
927 track_relocs_type_ field.
928 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
929 Set track_relocs_type_.
930 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
931 contents when using RELA relocs.
932 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
933 reloc_map_.
934 * reloc.cc (Track_relocs::next_addend): New function.
935 * reloc.h (class Track_relocs): Declare next_addend.
936
e5e19edd
ILT
9372010-12-01 Ian Lance Taylor <iant@google.com>
938
939 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
940 virtual destructor.
941
9a5ce24c
ILT
9422010-12-01 Ian Lance Taylor <iant@google.com>
943
944 * README: Update compilers known to work and fail.
945
c7791212
NC
9462010-11-23 Matthias Klose <doko@ubuntu.com>
947
948 * configure.in: For --enable-gold, handle value `default' instead of
949 `both*'. Always install ld as ld.bfd, install as ld if gold is
950 not the default.
951 * configure: Regenerate.
952
0ad220c9
DK
9532010-11-18 Doug Kwan <dougkwan@google.com>
954
955 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
956 and right_alignment to be zero. Store result alignment only if it is
957 greater than existing alignment.
958
ab8056e0
CC
9592010-11-16 Cary Coutant <ccoutant@google.com>
960
961 PR gold/12220
962 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
963 Check for ".zdebug_line".
964
fd064a5b
CC
9652010-11-16 Doug Kwan <dougkwan@google.com>
966 Cary Coutant <ccoutant@google.com>
967
968 * output.h (Output_segment::set_section_addresses): Pass increase_relro
969 by reference; adjust all callers.
970 * output.cc (Output_segment::set_section_addresses): Adjust references
971 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
972 list is empty.
973 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
974 end at page boundary.
975
6fc6ea19
CC
9762010-11-16 Cary Coutant <ccoutant@google.com>
977
978 PR gold/12220
979 * layout.cc (Layout::choose_output_section): Transform names of
980 compressed sections even when using a script with a SECTIONS clause.
981 (Layout::output_section_name): Remove code to transform
982 compressed debug section names.
983 * output.cc (Output_section::add_input_section): Use uncompressed
984 section size when tracking input sections.
985
95a2c8d6
RS
9862010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
987
988 * symtab.h (Symbol::NON_PIC_REF): Remove.
989 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
990 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
991 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
992 (Symbol::use_plt_offset): Take a flags argument and pass it
993 directly to needs_dynamic_reloc. Restrict check for undefined
994 weak symbols to function calls.
995 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
996 (Target_arm::Scan::global): Use it.
997 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
998 (Target_arm::Relocate::relocate): Likewise.
999 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1000 parameter with an r_type parameter. Use get_reference_flags
1001 to get the flags.
1002 (Target_arm::Relocate::relocate): Update accordingly.
1003 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1004 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1005 (Target_i386::Scan::global): Likewise.
1006 (Target_i386::Relocate::relocate): Likewise.
1007 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1008 parameter with an r_type parameter. Use get_reference_flags
1009 to get the flags.
1010 (Target_i386::Relocate::relocate): Update accordingly.
1011 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1012 (Target_powerpc::Scan::global): Use it.
1013 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1014 (Target_powerpc::Relocate::relocate): Likewise.
1015 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1016 (Target_sparc::Scan::global): Use it.
1017 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1018 (Target_sparc::Relocate::relocate): Likewise.
1019 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1020 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1021 (Target_x86_64::Scan::global): Likewise.
1022 (Target_x86_64::Relocate::relocate): Likewise.
1023
f625ae50
DK
10242010-11-08 Doug Kwan <dougkwan@google.com>
1025 Cary Coutant <ccoutant@google.com>
1026
1027 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1028 (Arm_exidx_merge_section::section_contents_): New data member.
1029 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1030 (Arm_input_section::~Arm_input_section): De-allocate memory.
1031 (Arm_input_section::original_contents_): New data member.
1032 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1033 in parameters instead of calling Object::section_contents without
1034 locking.
1035 (Arm_output_section::group_section): New parameter TASK. Pass it
1036 to callees that need locking objects.
1037 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1038 to lock EXIDX input sections. Fix a formatting issue. Call
1039 Arm_exidx_merged_section::build_contents to create merged section
1040 contents.
1041 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1042 to lock object of stub table owner.
1043 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1044 TEXT_SIZE to initialize data member TEXT_SIZE_.
1045 (Arm_exidx_input_section::addralign): Fix typo in comment.
1046 (Arm_exidx_input_section::text_size): New method.
1047 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1048 that require locking objects. Lock objects before scanning for stubs
1049 and updating local symbols.
1050 (Arm_input_section<big_endian>::init): Copy contents of original
1051 input section.
1052 (Arm_input_section<big_endian>::do_write): Use saved contents of
1053 original input section instead of calling Object::section_contents
1054 without locking.
1055 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1056 size without calling Object::section_size().
1057 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1058 for size. Allocate a buffer for merged EXIDX entries.
1059 (Arm_exidx_merged_section::build_contents): New method.
1060 (Arm_exidx_merged_section::do_write): Move merge section contents
1061 building code to Arm_exidx_merged_section::build_contetns. Write
1062 out contetns in buffer instead of building it on the fly.
1063 (Arm_relobj::make_exidx_input_section): Also pass text section size
1064 to Arm_exidx_input_section constructor.
1065 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1066 (Arm_dynobj::do_read_symbols): Fix memory leak.
1067 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1068 * target.h: (class Task): Add forward declaration.
1069 (Target::relax): Add new parameter TASK and pass it to
1070 Target::do_relax().
1071 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1072
5f9bcf58
CC
10732010-11-05 Cary Coutant <ccoutant@google.com>
1074
1075 PR gold/10708
1076 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1077 object when reading from the file.
1078 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1079 second layout pass.
1080 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1081 when reading section contents.
1082 (get_section_contents): Likewise.
1083 (icf::find_identical_sections): Likewise.
1084 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1085 object when reading from the file.
1086 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1087 the object when doing deferred section layout.
1088
e597fa08
NC
10892010-11-03 Nick Clifton <nickc@redhat.com>
1090
1091 PR gold/12001
1092 * script.h (class Symbol_assignment: name): New member. Returns
1093 the name of the symbol.
1094 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1095 Returns true if the given symbol name is on the list of
1096 assignments wating to be processed.
1097 * archive.cc (should_incldue_member): If the symbol is undefined,
1098 check to see if it is on the list of symbols pending assignment.
1099
3f9a3278
ILT
11002010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1101
1102 * script-sections.cc (Script_sections::find_memory_region): Check
1103 for a NULL output section pointer.
1104
d06fb4d1
DK
11052010-10-29 Doug Kwan <dougkwan@google.com>
1106
1107 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1108 Output_section::add_relaxed_input_section.
1109 * output.cc (Output_section::add_relaxed_input_section): Add new
1110 arguments LAYOUT and NAME. Set section order index.
1111 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1112 Copy section order index.
1113 * output.h (Output_section::add_relaxed_input_section): Add new
1114 arguments LAYOUT and NAME.
1115
90e24de5
ILT
11162010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1117
1118 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1119 NATIVE_OR_CROSS_LINKER.
1120 * testsuite/Makefile.in: Regenerate.
1121
c9484ea5
DK
11222010-10-20 Doug Kwan <dougkwan@google.com>
1123
1124 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1125 without SHF_LINK_ORDER flags.
1126 * layout.cc (Layout::choose_output_section): Do not filter
1127 SHF_LINK_ORDER flag in a relocatable link.
1128
5bc2f5be
CC
11292010-10-17 Cary Coutant <ccoutant@google.com>
1130
1131 * output.h (Output_segment::set_section_addresses): Change function
1132 signature. Update all callers.
1133 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1134 sections.
1135 (Output_segment::set_section_addresses): Align after last TLS
1136 section. Add padding before last relro section instead of after.
1137
0c91cf04
DK
11382010-10-17 Doug Kwan <dougkwan@google.com>
1139
1140 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1141 GOT output section to be writable.
1142
8c21d9d3
CC
11432010-10-14 Cary Coutant <ccoutant@google.com>
1144
1145 * debug.h (DEBUG_INCREMENTAL): New flag.
1146 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1147 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1148 mode.
1149 * incremental.cc (report_command_line): Ignore all forms of
1150 --incremental.
1151 * layout.cc (Layout::Layout): Check parameters for incremental link
1152 mode.
1153 * options.cc (General_options::parse_incremental): New function.
1154 (General_options::parse_no_incremental): New function.
1155 (General_options::parse_incremental_full): New function.
1156 (General_options::parse_incremental_update): New function.
1157 (General_options::incremental_mode_): New data member.
1158 (General_options::finalize): Check incremental_mode_.
1159 * options.h (General_options): Update help text for --incremental.
1160 Add --no-incremental, --incremental-full, --incremental-update.
1161 (General_options::Incremental_mode): New enum type.
1162 (General_options::incremental_mode): New function.
1163 (General_options::incremental_mode_): New data member.
1164 * parameters.cc (Parameters::incremental_mode_): New data member.
1165 (Parameters::set_options): Set incremental_mode_.
1166 (Parameters::set_incremental_full): New function.
1167 (Parameters::incremental): New function.
1168 (Parameters::incremental_update): New function.
1169 (set_parameters_incremental_full): New function.
1170 * parameters.h (Parameters::set_incremental_full): New function.
1171 (Parameters::incremental): New function.
1172 (Parameters::incremental_update): New function.
1173 (Parameters::incremental_mode_): New data member.
1174 (set_parameters_incremental_full): New function.
1175 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1176 incremental link mode.
1177 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1178 (Sized_relobj::do_relocate_sections): Likewise.
1179 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1180 option.
1181 * testsuite/Makefile.in: Regenerate.
1182 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1183
bb32aa18 11842010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1185
1186 * script-sections.h (class Script_sections): Make
1187 Sections_elements typedef public.
1188 * script-sections.cc (class Sort_output_sections): Add elements_
1189 field. Add constructor which sets it; change all callers.
1190 (Sort_output_sections::is_before): New function.
1191 (Sort_output_sections::operator()): Call is_before.
1192 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1193 conditional.
1194 * testsuite/script_test_10.sh: New test. Test script section
1195 order.
1196 * testsuite/script_test_10.t: Likewise.
1197 * testsuite/script_test_10.s: Likewise.
1198 * testsuite/Makefile.am: Wrap the cross linker tests and the
1199 common tests into NATIVE_OR_CROSS_LINKER.
1200 (check_SCRIPTS): Add script_test_10.sh.
1201 (check_DATA): Add script_test_10.stdout.
1202 (script_test_10.o, script_test_10): New targets.
1203 (script_test_10.stdout): New target.
1204 * configure, testsuite/Makefile.in: Regenerate.
1205
3cef7179
ILT
12062010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1207
1208 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
1209 error for the deprecated relocations.
1210 (Target_arm::Scan::global): Likewise.
1211 (Target_arm::Relocate::relocate): Likewise.
1212
7411e9a8
RS
12132010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
1214
1215 * fileread.cc (Input_file::find_file): Initialize *found_name
1216 and *namep when using the fallback search for case 4.
1217
6a9da32a
CC
12182010-10-11 Cary Coutant <ccoutant@google.com>
1219
1220 * options.h (class General_options): Redefine -z lazy as an alias for
1221 the negation of -z now.
1222
ac897c20
ILT
12232010-10-11 Ian Lance Taylor <iant@google.com>
1224
1225 * resolve.cc (symbol_to_bits): Report the value of the unsupported
1226 binding.
1227
ea5cae92
NC
12282010-10-06 Nick Clifton <nickc@redhat.com>
1229
1230 * script-sections.cc(class Memory_region): Remove
1231 current_lma_offset_ field. Rename current_vma_offset_ to
1232 current_offset_. Add last_section_ field.
1233 (Memory_region::get_current_vma_address): Rename to
1234 get_current_address.
1235 (Memory_region::get_current_lma_address): Delete.
1236 (Memory_region::increment_vma_offset): Rename to
1237 increment_offset.
1238 (Memory_region::increment_lma_offset): Delete.
1239 (Memory_region::attributes_compatible): New method. Returns
1240 true if the provided section is compatible with the region.
1241 (Memory_region::get_last_section): New method. Returns the last
1242 section to use the region.
1243 (Memory_region::set_last_section): New method. Stores the last
1244 section to use the region.
1245 (Script_sections::block_in_region): New method. Returns true if
1246 a block of memory is contained within a region.
1247 (Script_sections::find_memory_region): New method. Locates a
1248 memory region to be used to set a VMA or LMA address.
1249 (Output_section_definition::set_section_addresses): Add code to
1250 check for addresses set by memory regions.
1251 (Output_segment::set_section_addresses): Remove memory region
1252 walking code.
1253 (Script_sections::create_segment): Add a warning if a header
1254 segment is created outside of any region.
1255 * script-sections.h (class Script_sections): Add prototypes for
1256 find_memory_region and block_in_region methods.
1257 * testsuite/memory_test.s: Use .long instead of .word.
1258 * testsuite/memory_test.t: Add some more output sections.
1259 * testsuite/memory_test.sh: Update expected output.
1260
a9bfd952
DK
12612010-10-02 Doug Kwan <dougkwan@google.com>
1262
1263 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
1264 defintion to symtab.h
1265 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
1266 declaration to defintion.
1267
bacff3ab
NC
12682010-10-01 Nick Clifton <nickc@redhat.com>
1269
1270 * expression.cc (eval): Replace dummy argument with NULL.
1271 (eval_maybe_dot): Check for a NULL result section pointer.
1272 (Symbol_expression::value): Likewise.
1273 (Dot_expression::value): Likewise.
1274 (BINARY_EXPRESSION): Likewise.
1275 (Max_expression::value): Likewise.
1276 (Min_expression::value): Likewise.
1277 (Absolute_expression::value): Likewise.
1278 (Addr_expression::value_from_output_section): Likewise.
1279 (Loaddddr_expression::value_from_output_section): Likewise.
1280 (Segment_start_expression::value): Likewise.
1281 * script-sections.cc
1282 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
1283 argument with NULL.
1284 (Sections_elememt_dot_assignment::set_section_addresses):
1285 Likewise.
1286 (Output_data_expression::do_write_to_buffer): Likewise.
1287 (Output_section_definition::finalize_symbols): Likewise.
1288 (Output_section_definition::set_section_addresses): Likewise.
1289
f81bc8b5
DK
12902010-09-30 Doug Kwan <dougkwan@google.com>
1291
1292 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
1293
c95e9f27
ST
12942010-09-28 Sriraman Tallam <tmsriram@google.com>
1295
1296 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 1297 function.
c95e9f27
ST
1298 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
1299 virtual function.
1300 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
1301 virtual function.
1302 * icf.cc (get_section_contents): Inline merge sections only when
1303 target allows it.
1304
3cac54d2
RW
13052010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1306
1307 * configure: Regenerate.
1308
2904037a
ILT
13092010-09-17 Ian Lance Taylor <iant@google.com>
1310
1311 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
1312 * testsuite/Makefile.am (memory_test.o): New target.
1313 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
1314 memory_test.t.
1315 * testsuite/Makefile.in: Rebuild.
2904037a 1316
bca7fb63
DK
13172010-09-17 Doug Kwan <dougkwan@google.com>
1318
1319 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
1320 defintion if relocation uses GOT entries of the symbol.
1321 * testsuite/icf_safe_test.sh: Fix test.
1322 * testsuite/icf_safe_so_test.sh: Fix test.
1323
4ef28648
CC
13242010-09-16 Cary Coutant <ccoutant@google.com>
1325
1326 * script_sections.cc (class Memory_region): Remove "NULL" from
1327 vector initializations.
1328
793990de
CC
13292010-09-15 Cary Coutant <ccoutant@google.com>
1330
1331 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
1332 Resolve forwarding symbols.
1333
81e015e2
DK
13342010-09-15 Doug Kwan <dougkwan@google.com>
1335
1336 * gold/testsuite/script_test_3.t: Add ARM special sections.
1337 * gold/testsuite/script_test_4.t: Same.
1338 * gold/testsuite/script_test_5.t: Same.
1339 * gold/testsuite/script_test_6.t: Same.
1340 * gold/testsuite/script_test_7.t: Same.
1341 * gold/testsuite/script_test_7.t: Same.
1342 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
1343
36171d64
CC
13442010-09-14 Cary Coutant <ccoutant@google.com>
1345
1346 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
1347 (Target_x86_64::Relocate::relocate_tls): Replace check for
1348 saw_tls_block_reloc_ with test for executable section.
1349
d89051bd
CC
13502010-09-12 Cary Coutant <ccoutant@google.com>
1351
1352 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
1353 position-independent executables to shared libraries need dynamic
1354 relocations.
1355 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
1356 position-independent executables.
1357 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
1358 * testsuite/Makefile.in: Regenerate.
1359
fca41f0f
NC
13602010-09-10 Nick Clifton <nickc@redhat.com>
1361
1362 PR gold/11997
1363 * testsuite/memory_test.t: Discard any sections that are not
1364 needed.
1365
6695e4b3
L
13662010-09-09 H.J. Lu <hongjiu.lu@intel.com>
1367
1368 PR gold/11996
1369 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
1370 "This::" to work around a bug in gcc 4.2.
1371
1372 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
1373
0f72bf6f
RÁE
13742010-09-09 Rafael Espindola <espindola@google.com>
1375
1376 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
1377 sections with different PF_X flags in the same segment.
1378 (Layout::find_first_load_seg): Search all segments to find the first
1379 one.
1380 * options.h (rosegment): New.
1381
13822010-09-08 Rafael Espindola <espindola@google.com>
a6577478 1383
05a79166 1384 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 1385
aa98ff75
DK
13862010-09-08 Doug Kwan <dougkwan@google.com>
1387
1388 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
1389 (Arm_relobj::do_relocate_sections): Add new parameter for output
1390 file to match the parent.
1391 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
1392 of local symbols instead of input values. Update code to track
1393 changes in gold::relocate_section.
1394 * object.cc (Sized_relobj::compute_final_local_value): New methods.
1395 (Sized_relobj::compute_final_local_value_internal): New methods.
1396 (Sized_relobj::do_finalize_local_symbols): Move code from loop
1397 body into private version of Sized_relobj::compute_final_local_value.
1398 Call the inline method.
1399 * object.h (Symbol_value::Symbol_value): Define destructor. Free
1400 merged symbol value if there is one.
1401 (Symbol_value::has_output_value): New method defintiion.
1402 (Sized_relobj::Compute_final_local_value_status): New enum type.
1403 (Sized_relobj::compute_final_local_value): New methods.
1404 (Sized_relobj::compute_final_local_value_internal): New methods.
1405 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
1406 and arm_cortex_a8.sh.
1407 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
1408 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
1409 New tests.
1410 * Makefile.in: Regenerate.
1411 * testsuite/arm_bl_out_of_range.s: Update test.
1412 * testsuite/thumb_bl_out_of_range.s: Ditto.
1413 * testsuite/thumb_blx_out_of_range.s: Ditto.
1414 * testsuite/arm_branch_out_of_range.sh: New file.
1415 * testsuite/arm_cortex_a8.sh: Ditto.
1416 * testsuite/arm_cortex_a8_b.s: Ditto.
1417 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
1418 * testsuite/arm_cortex_a8_b_local.s: Ditto.
1419 * testsuite/arm_cortex_a8_bl.s: Ditto.
1420 * testsuite/arm_cortex_a8_blx.s: Ditto.
1421 * testsuite/arm_cortex_a8_local.s: Ditto.
1422 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
1423 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
1424
05a79166
L
14252010-09-08 Rafael Espindola <espindola@google.com>
1426
1427 * Makefile.am (memory_test.stdout): Run readelf with -W.
1428 * Makefile.in: Regenerate.
1429 * testsuite/memory_test.sh: Make the regexps accept both 32 and
1430 64 bit output.
1431
33dbc701
RÁE
14322010-09-08 Rafael Espindola <espindola@google.com>
1433
1434 * script-sections.cc (Script_sections::add_memory_region): Convert
1435 field precision to int.
1436 * script.cc (script_set_section_region, script_set_section_region):
1437 Convert field precision to int.
1438
731ca54a
RÁE
14392010-09-08 Rafael Espindola <espindola@google.com>
1440
1441 * arm.cc (do_finalize_sections): Create the __exidx_start and
1442 __exdix_end symbols even when the section is missing.
1443
7f8cd844
NC
14442010-09-08 Nick Clifton <nickc@redhat.com>
1445
1446 * README: Remove claim that MEMORY is not supported.
1447 * expression.cc (script_exp_function_origin)
1448 (script_exp_function_length): Move from here to ...
1449 * script.cc: ... here.
1450 (script_set_section_region, script_add_memory)
1451 (script_parse_memory_attr, script_include_directive): New
1452 functions.
1453 * script-sections.cc
1454 (class Memory_region): New class.
1455 (class Output_section_definition): Add set_memory_region,
1456 set_section_vma, set_section_lma and get_section_name methods.
1457 (class Script_Sections): Add add_memory_region,
1458 find_memory_region, find_memory_region_origin,
1459 find_memory_region_length and set_memory_region methods.
1460 Have set_section_addresses method walk the list of set memory
1461 regions.
1462 Extend the print methos to display memory regions.
1463 * script-sections.h: Add prototypes for new methods.
1464 Add enum for MEMORY region attributes.
1465 * yyscript.y: Add support for parsing MEMORY regions.
1466 * script-c.h: Add prototypes for new functions.
1467 * testsuite/Makefile.am: Add test of MEMORY region functionality.
1468 * testsuite/Makefile.in: Regenerate.
1469 * testsuite/memory_test.sh: New script.
1470 * testsuite/memory_test.s: New assembler source file.
1471 * testsuite/memory_test.t: New linker script.
1472
a4649286
DK
14732010-08-27 Doug Kwan <dougkwan@google.com>
1474
1475 * gold/resolve.cc (Symbol_table::should_override): Let a weak
1476 reference override an existing dynamic weak reference.
1477 * testsuite/Makefile.am: Add new test dyn_weak_ref.
1478 * testsuite/Makefile.in: Regenerate.
1479 * testsuite/dyn_weak_ref.sh: New file.
1480 * testsuite/dyn_weak_ref_1.c: Ditto.
1481 * testsuite/dyn_weak_ref_2.c: Ditto.
1482
b56648ad
ILT
14832010-08-27 Ian Lance Taylor <iant@google.com>
1484
1485 * incremental.h (class Incremental_input_entry): Add virtual
1486 destructor.
1487
809313cb
ILT
14882010-08-27 Ian Lance Taylor <iant@google.com>
1489
1490 * testsuite/start_lib_test_3.c: Mark t3 as used.
1491
11e32464
NC
14922010-08-27 Nick Clifton <nickc@redhat.com>
1493
1494 * options.cc (version_script): Fix small typo in previous
1495 whitespace tidyup.
1496
ca09d69a
NC
14972010-08-25 Nick Clifton <nickc@redhat.com>
1498
1499 * archive.cc: Formatting fixes: Remove whitespace between
1500 typename and following asterisk. Remove whitespace between
1501 function name and opening parenthesis.
1502 * archive.h: Likewise.
1503 * arm.cc: Likewise.
1504 * attributes.cc: Likewise.
1505 * attributes.h: Likewise.
1506 * common.cc: Likewise.
1507 * copy-relocs.cc: Likewise.
1508 * dirsearch.h: Likewise.
1509 * dynobj.cc: Likewise.
1510 * ehframe.cc: Likewise.
1511 * ehframe.h: Likewise.
1512 * expression.cc: Likewise.
1513 * fileread.cc: Likewise.
1514 * fileread.h: Likewise.
1515 * gc.h: Likewise.
1516 * gold-threads.cc: Likewise.
1517 * gold.cc: Likewise.
1518 * i386.cc: Likewise.
1519 * icf.h: Likewise.
1520 * incremental-dump.cc: Likewise.
1521 * incremental.cc: Likewise.
1522 * layout.cc: Likewise.
1523 * layout.h: Likewise.
1524 * main.cc: Likewise.
1525 * merge.cc: Likewise.
1526 * merge.h: Likewise.
1527 * object.cc: Likewise.
1528 * object.h: Likewise.
1529 * options.cc: Likewise.
1530 * options.h: Likewise.
1531 * output.cc: Likewise.
1532 * output.h: Likewise.
1533 * plugin.cc: Likewise.
1534 * plugin.h: Likewise.
1535 * powerpc.cc: Likewise.
1536 * reloc.cc: Likewise.
1537 * script-c.h: Likewise.
1538 * script-sections.cc: Likewise.
1539 * script.cc: Likewise.
1540 * stringpool.cc: Likewise.
1541 * symtab.cc: Likewise.
1542 * symtab.h: Likewise.
1543 * target.cc: Likewise.
1544 * timer.cc: Likewise.
1545 * timer.h: Likewise.
1546 * version.cc: Likewise.
1547 * x86_64.cc: Likewise.
1548
b8fa8750
NC
15492010-08-24 Nick Clifton <nickc@redhat.com>
1550
1551 PR 11899
1552 * layout.cc (segment_precedes): Sort segments by their physical
1553 addresses, if they have been set.
1554
9919d93b
CC
15552010-08-23 Cary Coutant <ccoutant@google.com>
1556
1557 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
1558 symbols data.
1559 (Lib_group::include_member): Unlock object after deleting its
1560 symbols data.
1561 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
1562 the bug fixed here.
1563
97b4be1c
CC
15642010-08-19 Neil Vachharajani <nvachhar@google.com>
1565 Cary Coutant <ccoutant@google.com>
1566
1567 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
1568 constructor, and set_blocker.
1569 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
1570 readsyms_blocker_.
1571 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
1572 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
1573 * testsuite/Makefile.am (start_lib_test): New test case.
1574 * testsuite/Makefile.in: Regenerate.
1575 * testsuite/start_lib_test_main.c: New file.
1576 * testsuite/start_lib_test_1.c: New file.
1577 * testsuite/start_lib_test_2.c: New file.
1578 * testsuite/start_lib_test_3.c: New file.
1579
dd0b1884
ILT
15802010-08-19 Ian Lance Taylor <iant@google.com>
1581
1582 * Makefile.in: Rebuild with automake 1.11.1.
1583 * aclocal.m4: Likewise.
1584 * testsuite/Makefile.in: Likewise.
1585
7223e9ca
ILT
15862010-08-19 Ian Lance Taylor <iant@google.com>
1587
1588 PR 10893
1589 * i386.cc (class Output_data_plt_i386): Update declarations.
1590 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
1591 local_ifuncs_ fields.
1592 (Target_i386::do_plt_section_for_global): New function.
1593 (Target_i386::do_plt_section_for_local): New function.
1594 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
1595 parameter; change all callers. Initialize global_ifuncs_ and
1596 local_ifuncs_. If doing a static link define __rel_iplt_start and
1597 __rel_iplt_end.
1598 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
1599 (Output_data_plt_i386::add_local_ifunc_entry): New function.
1600 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
1601 symbols.
1602 (Target_i386::make_plt_section): New function, broken out of
1603 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
1604 (Target_i386::make_plt_entry): Call make_plt_section.
1605 (Target_i386::make_local_ifunc_plt_entry): New function.
1606 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
1607 (Target_i386::Scan::local): Handle IFUNC symbols. Add
1608 R_386_IRELATIVE to switch.
1609 (Target_i386::Scan::global): Likewise.
1610 (Target_i386::Relocate::relocate): Likewise.
1611 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
1612 switch.
1613 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
1614 (Target_x86_64::do_plt_section_for_global): New function.
1615 (Target_x86_64::do_plt_section_for_local): New function.
1616 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
1617 parameter; change all callers. If doing a static link define
1618 __rela_iplt_start and __rela_iplt_end.
1619 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
1620 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
1621 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
1622 to point to .plt.
1623 (Target_x86_64::make_local_ifunc_plt_entry): New function.
1624 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
1625 switch.
1626 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
1627 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
1628 R_X86_64_IRELATIVE to switch.
1629 (Target_x86_64::Scan::global): Likewise.
1630 (Target_x86_64::Relocate::relocate): Likewise.
1631 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
1632 switch.
1633 * target.h (class Target): Add plt_section_for_global and
1634 plt_section_for_local functions. Add do_plt_section_for_global
1635 and do_plt_section_for_local virtual functions.
1636 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
1637 clarifying comments.
1638 (Symbol::use_plt_offset): Handle IFUNC symbol.
1639 * object.cc (Sized_relobj::Sized_relobj): Initialize
1640 local_plt_offsets_.
1641 (Sized_relobj::local_has_plt_offset): New function.
1642 (Sized_relobj::local_plt_offset): New function.
1643 (Sized_relobj::set_local_plt_offset): New function.
1644 (Sized_relobj::do_count): Handle IFUNC symbol.
1645 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
1646 a bit away from input_shndx_ field. Add set_is_func_symbol and
1647 is_ifunc_symbol functions.
1648 (class Sized_relobj): Update declarations. Remove Tls_got_entry
1649 and Local_tls_got_offsets. Define Local_plt_offsets. Add
1650 local_plt_offsets_ field.
1651 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
1652 * output.h (class Output_section_data): Add non-const
1653 output_section function.
1654 (class Output_data_got): Update declarations.
1655 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
1656 Add use_plt_offset parameter to global and local constructors.
1657 Change all callers. Change local_sym_index_ field to 31 bits.
1658 Change GSYM_CODE and CONSTANT_CODE accordingly.
1659 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
1660 doing a static link don't set sh_link field.
1661 (Output_data_got::Got_entry::write): Use PLT offset if
1662 appropriate.
1663 (Output_data_got::add_global_plt): New function.
1664 (Output_data_got::add_local_plt): New function.
1665 * target-reloc.h (relocate_section): Handle IFUNC symbol.
1666 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
1667 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
1668 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
1669 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
1670 IFUNC conditional.
1671 * testsuite/ifunc-sel.h: New file.
1672 * testsuite/ifuncmain1.c: New file.
1673 * testsuite/ifuncmain1vis.c: New file.
1674 * testsuite/ifuncmod1.c: New file.
1675 * testsuite/ifuncdep2.c: New file.
1676 * testsuite/ifuncmain2.c: New file.
1677 * testsuite/ifuncmain3.c: New file.
1678 * testsuite/ifuncmod3.c: New file.
1679 * testsuite/ifuncmain4.c: New file.
1680 * testsuite/ifuncmain5.c: New file.
1681 * testsuite/ifuncmod5.c: New file.
1682 * testsuite/ifuncmain6pie.c: New file.
1683 * testsuite/ifuncmod6.c: New file.
1684 * testsuite/ifuncmain7.c: New file.
1685 * configure, testsuite/Makefile.in: Rebuild.
1686
56f75c03
ILT
16872010-08-18 Ian Lance Taylor <iant@google.com>
1688
1689 * incremental.cc
1690 (Output_section_incremental_inputs::write_input_files): Add cast
1691 to avoid signed/unsigned comparison warning.
1692 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1693
55455f89
CC
16942010-08-12 Cary Coutant <ccoutant@google.com>
1695
1696 * common.cc (Sort_commons::operator()): Remove unnecessary code.
1697
e2054bcb
ILT
16982010-08-13 Ian Lance Taylor <iant@google.com>
1699
1700 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
1701
74f67560
DK
17022010-08-12 Cary Coutant <ccoutant@google.com>
1703 Doug Kwan <dougkwan@google.com>
1704
1705 * resolve.cc (Symbol_table::should_override): When a weak dynamic
1706 defintion overrides non-weak undef, remember that the original undef
1707 is not weak.
1708 * symtab.cc (Symbol_table::sized_write_global): For undef without
1709 an original weak binding, set binding to global in output.
1710 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
1711 * testsuite/Makefile.in: Regenerate.
1712 * testsuite/strong_ref_weak_def.sh: New file.
1713 * testsuite/strong_ref_weak_def_1.c: Ditto.
1714 * testsuite/strong_ref_weak_def_2.c: Ditto.
1715
d1238d12
CC
17162010-08-12 Cary Coutant <ccoutant@google.com>
1717
1718 * testsuite/incremental_test.sh: Rewrite.
1719 * testsuite/incremental_test_1.c: Rewrite.
1720 * testsuite/incremental_test_2.c: Rewrite.
1721
0e70b911
CC
17222010-08-12 Cary Coutant <ccoutant@google.com>
1723
1724 * arm.cc (Target_arm::got_size): Add const.
1725 (Target_arm::got_entry_count): New function.
1726 (Target_arm::plt_entry_count): New function.
1727 (Target_arm::first_plt_entry_offset): New function.
1728 (Target_arm::plt_entry_size): New function.
1729 (Output_data_plt_arm::entry_count): New function.
1730 (Output_data_plt_arm::first_plt_entry_offset): New function.
1731 (Output_data_plt_arm::get_plt_entry_size): New function.
1732 * i386.cc (Target_i386::got_size): Add const.
1733 (Target_i386::got_entry_count): New function.
1734 (Target_i386::plt_entry_count): New function.
1735 (Target_i386::first_plt_entry_offset): New function.
1736 (Target_i386::plt_entry_size): New function.
1737 (Output_data_plt_i386::entry_count): New function.
1738 (Output_data_plt_i386::first_plt_entry_offset): New function.
1739 (Output_data_plt_i386::get_plt_entry_size): New function.
1740 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
1741 find_incremental_inputs_sections. Dump incremental_got_plt section.
1742 * incremental.cc: Include target.h.
1743 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
1744 parameter. Adjust all callers. Find incremental_got_plt section.
1745 (Incremental_inputs::create_data_sections): Create incremental_got_plt
1746 section.
1747 (Output_section_incremental_inputs::set_final_data_size): Calculate
1748 size of incremental_got_plt section.
1749 (Output_section_incremental_inputs::do_write): Write the
1750 incremental_got_plt section.
1751 (Got_plt_view_info): New struct.
1752 (Local_got_offset_visitor): New class.
1753 (Global_got_offset_visitor): New class.
1754 (Global_symbol_visitor_got_plt): New class.
1755 (Output_section_incremental_inputs::write_got_plt): New function.
1756 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
1757 Add parameter. Adjust all callers.
1758 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1759 (Incremental_inputs::got_plt_section): New function.
1760 (Incremental_inputs::got_plt_section_): New data member.
1761 (Incremental_got_plt_reader): New class.
1762 * layout.cc (Layout::create_incremental_info_sections): Add the
1763 incremental_got_plt section.
1764 * object.h (Got_offset_list::get_list): New function.
1765 (Got offset_list::for_all_got_offsets): New function.
1766 (Sized_relobj::local_got_offset_list): New function.
1767 * powerpc.cc (Target_powerpc::got_size): Add const.
1768 (Target_powerpc::got_entry_count): New function.
1769 (Target_powerpc::plt_entry_count): New function.
1770 (Target_powerpc::first_plt_entry_offset): New function.
1771 (Target_powerpc::plt_entry_size): New function.
1772 (Output_data_plt_powerpc::entry_count): New function.
1773 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
1774 (Output_data_plt_powerpc::get_plt_entry_size): New function.
1775 * sparc.cc (Target_sparc::got_size): Add const.
1776 (Target_sparc::got_entry_count): New function.
1777 (Target_sparc::plt_entry_count): New function.
1778 (Target_sparc::first_plt_entry_offset): New function.
1779 (Target_sparc::plt_entry_size): New function.
1780 (Output_data_plt_sparc::entry_count): New function.
1781 (Output_data_plt_sparc::first_plt_entry_offset): New function.
1782 (Output_data_plt_sparc::get_plt_entry_size): New function.
1783 * symtab.h (Symbol::got_offset_list): New function.
1784 (Symbol_table::for_all_symbols): New function.
1785 * target.h (Sized_target::got_entry_count): New function.
1786 (Sized_target::plt_entry_count): New function.
1787 (Sized_target::plt_entry_size): New function.
1788 * x86_64.cc (Target_x86_64::got_size): Add const.
1789 (Target_x86_64::got_entry_count): New function.
1790 (Target_x86_64::plt_entry_count): New function.
1791 (Target_x86_64::first_plt_entry_offset): New function.
1792 (Target_x86_64::plt_entry_size): New function.
1793 (Output_data_plt_x86_64::entry_count): New function.
1794 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
1795 (Output_data_plt_x86_64::get_plt_entry_size): New function.
1796
09ec0418
CC
17972010-08-12 Cary Coutant <ccoutant@google.com>
1798
1799 * archive.cc: Include incremental.h.
1800 (Archive::Archive): Initialize incremental_info_.
1801 (Archive::include_member): Record archive members in incremental info.
1802 (Add_archive_symbols::run): Record begin and end of an archive in
1803 incremental info.
1804 (Lib_group::include_member): Record objects in incremental info.
1805 * archive.h (Incremental_archive_entry): Forward declaration.
1806 (Archive::set_incremental_info): New member function.
1807 (Archive::incremental_info): New member function.
1808 (Archive::Unused_symbol_iterator): New class.
1809 (Archive::unused_symbols_begin): New member function.
1810 (Archive::unused_symbols_end): New member function.
1811 (Archive::incremental_info_): New data member.
1812 * incremental-dump.cc (find_input_containing_global): New function.
1813 (dump_incremental_inputs): Dump new incremental info sections.
1814 * incremental.cc: Include symtab.h.
1815 (Output_section_incremental_inputs): New class.
1816 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
1817 new incremental info sections.
1818 (Sized_incremental_binary::do_check_inputs): Likewise.
1819 (Incremental_inputs::report_archive): Remove.
1820 (Incremental_inputs::report_archive_begin): New function.
1821 (Incremental_inputs::report_archive_end): New function.
1822 (Incremental_inputs::report_object): New function.
1823 (Incremental_inputs::finalize_inputs): Remove.
1824 (Incremental_inputs::report_input_section): New function.
1825 (Incremental_inputs::report_script): Rewrite.
1826 (Incremental_inputs::finalize): Do nothing but finalize string table.
1827 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1828 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1829 (Incremental_inputs::create_data_sections): New function.
1830 (Incremental_inputs::relocs_entsize): New function.
1831 (Output_section_incremental_inputs::set_final_data_size): New function.
1832 (Output_section_incremental_inputs::do_write): New function.
1833 (Output_section_incremental_inputs::write_header): New function.
1834 (Output_section_incremental_inputs::write_input_files): New function.
1835 (Output_section_incremental_inputs::write_info_blocks): New function.
1836 (Output_section_incremental_inputs::write_symtab): New function.
1837 * incremental.h (Incremental_script_entry): Forward declaration.
1838 (Incremental_object_entry): Forward declaration.
1839 (Incremental_archive_entry): Forward declaration.
1840 (Incremental_inputs): Forward declaration.
1841 (Incremental_inputs_header_data): Remove.
1842 (Incremental_inputs_header): Remove.
1843 (Incremental_inputs_header_write): Remove.
1844 (Incremental_inputs_entry_data): Remove.
1845 (Incremental_inputs_entry): Remove.
1846 (Incremental_inputs_entry_write): Remove.
1847 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
1848 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
1849 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1850 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
1851 Likewise.
1852 (Incremental_input_entry): New class.
1853 (Incremental_script_entry): New class.
1854 (Incremental_object_entry): New class.
1855 (Incremental_archive_entry): New class.
1856 (Incremental_inputs::Incremental_inputs): Initialize new data members.
1857 (Incremental_inputs::report_inputs): Remove.
1858 (Incremental_inputs::report_archive): Remove.
1859 (Incremental_inputs::report_archive_begin): New function.
1860 (Incremental_inputs::report_archive_end): New function.
1861 (Incremental_inputs::report_object): Change prototype.
1862 (Incremental_inputs::report_input_section): New function.
1863 (Incremental_inputs::report_script): Change prototype.
1864 (Incremental_inputs::get_reloc_count): New function.
1865 (Incremental_inputs::set_reloc_count): New function.
1866 (Incremental_inputs::create_data_sections): New function.
1867 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1868 (Incremental_inputs::inputs_section): New function.
1869 (Incremental_inputs::symtab_section): New function.
1870 (Incremental_inputs::relocs_section): New function.
1871 (Incremental_inputs::get_stringpool): Add const.
1872 (Incremental_inputs::command_line): Add const.
1873 (Incremental_inputs::inputs): Remove.
1874 (Incremental_inputs::command_line_key): New function.
1875 (Incremental_inputs::input_file_count): New function.
1876 (Incremental_inputs::input_files): New function.
1877 (Incremental_inputs::relocs_entsize): New function.
1878 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1879 (Incremental_inputs::finalize_inputs): Remove.
1880 (Incremental_inputs::Input_info): Remove.
1881 (Incremental_inputs::lock_): Remove.
1882 (Incremental_inputs::inputs_): Change type.
1883 (Incremental_inputs::inputs_map_): Remove.
1884 (Incremental_inputs::current_object_entry_): New data member.
1885 (Incremental_inputs::inputs_section_): New data member.
1886 (Incremental_inputs::symtab_section_): New data member.
1887 (Incremental_inputs::relocs_section_): New data member.
1888 (Incremental_inputs::reloc_count_): New data member.
1889 (Incremental_inputs_reader): New class.
1890 (Incremental_symtab_reader): New class.
1891 (Incremental_relocs_reader): New class.
1892 * layout.cc (Layout::finalize): Move finalization of incremental info
1893 and creation of incremental info sections to follow finalization of
1894 symbol table. Set offsets for postprocessing sections.
1895 (Layout::create_incremental_info_sections): Call
1896 Incremental_inputs::create_data_sections. Add incremental symtab
1897 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
1898 sections to layout after input sections.
1899 * layout.h (struct Timespec): Forward declaration.
1900 (Layout::incremental_inputs): Add const.
1901 (Layout::create_incremental_info_sections): Add parameter.
1902 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
1903 * object.cc: Include incremental.h.
1904 (Relobj::finalize_incremental_relocs): New function.
1905 (Sized_relobj::do_layout): Record input sections in incremental info.
1906 * object.h (Object::output_section): New function.
1907 (Object::output_section_offset): Moved from Relobj.
1908 (Object::get_incremental_reloc_base): New function.
1909 (Object::get_incremental_reloc_count): New function.
1910 (Object::do_output_section): New function.
1911 (Object::do_output_section_offset): Moved from Relobj.
1912 (Object::do_get_incremental_reloc_base): New function.
1913 (Object::do_get_incremental_reloc_count): New function.
1914 (Object::Object): Initialize new data members.
1915 (Relobj::output_section): Renamed do_output_section and moved to
1916 protected.
1917 (Relobj::output_section_offset): Moved to Object.
1918 (Relobj::do_get_incremental_reloc_base): New function.
1919 (Relobj::do_get_incremental_reloc_count): New function.
1920 (Relobj::allocate_incremental_reloc_counts): New function.
1921 (Relobj::count_incremental_reloc): New function.
1922 (Relobj::finalize_incremental_relocs): New function.
1923 (Relobj::next_incremental_reloc_index): New function.
1924 (Relobj::reloc_counts_): New data member.
1925 (Relobj::reloc_bases_): New data member.
1926 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
1927 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
1928 (Sized_relobj::incremental_relocs_scan): New function.
1929 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1930 (Sized_relobj::incremental_relocs_write): New function.
1931 (Sized_relobj::incremental_relocs_write_reltype): New function.
1932 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
1933 incremental link.
1934 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
1935 archives and object files elsewhere.
1936 (Add_symbols::run): Report object files here.
1937 (Finish_group::run): Report end of archive at end of group.
1938 * reloc.cc: Include layout.h, incremental.h.
1939 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
1940 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
1941 (Sized_relobj::incremental_relocs_scan): New function.
1942 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1943 (Sized_relobj::do_relocate_sections): Write incremental relocations.
1944 (Sized_relobj::incremental_relocs_write): New function.
1945 (Sized_relobj::incremental_relocs_write_reltype): New function.
1946 * script.cc (read_input_script): Rewrite test for incremental link.
1947 Change call to Incremental_inputs::report_script.
1948 * symtab.h (Symbol_table::first_global_index): New function.
1949 (Symbol_table::output_count): New function.
1950
ce0d1972
DK
19512010-08-12 Doug Kwan <dougkwan@google.com>
1952
1953 * arm.cc (Target_arm::merge_object_attributes): Check command line
1954 options --no-wchar-size-warning and --no-enum-size-warning.
1955 * options.h (General_options): Add ld-compatible options
1956 --no-enum-size-warning and --no-wchar-size-warning.
1957
6e5710ce
ILT
19582010-08-04 Ian Lance Taylor <iant@google.com>
1959
1960 * x86_64.cc (Target_x86_64::Scan::local): Use
1961 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
1962 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
1963 (Target_x86_64::Scan::global): Likewise.
1964 (Target_x86_64::Relocate::relocate): Likewise.
1965 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1966 Likewise.
1967
fef830db
CC
19682010-08-03 Cary Coutant <ccoutant@google.com>
1969
1970 * merge.cc (Output_merge_string::do_add_input_section): Count strings
1971 to reserve space in merged_strings vector. Keep total input size
1972 for stats.
1973 (Output_merge_string::do_print_merge_stats): Print total input size.
1974 * merge.h (Output_merge_string): Add input_size_ field.
1975 * stringpool.cc (Stringpool_template::string_length): Move
1976 implementations out of Stringpool_template class and place in
1977 stringpool.h.
1978 * stringpool.h (string_length): Move out of Stringpool_template.
1979
1e3811b0
ILT
19802010-08-03 Ian Lance Taylor <iant@google.com>
1981
1982 PR 11712
1983 * layout.cc (relaxation_loop_body): If address of load segment is
1984 set, adjust address to include headers if possible.
1985
7af0c620
ILT
19862010-08-03 Ian Lance Taylor <iant@google.com>
1987
1988 * version.cc (version_string): Bump to 1.10.
1989
22f0da72
ILT
19902010-08-03 Ian Lance Taylor <iant@google.com>
1991
1992 PR 11805
1993 * layout.h (enum Output_section_order): Define.
1994 (class Layout): Update declarations.
1995 * layout.cc (Layout::get_output_section): Add order parameter.
1996 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
1997 is_first_non_relro parameters. Change all callers.
1998 (Layout::choose_output_section): Likewise.
1999 (Layout::add_output_section_data): Likewise.
2000 (Layout::make_output_section): Likewise. Set order.
2001 (Layout::default_section_order): New function.
2002 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2003 * output.cc (Output_section::Output_section): Initialize order_.
2004 Don't initialize deleted fields.
2005 (Output_segment::Output_segment): Don't initialize deleted
2006 fields.
2007 (Output_segment::add_output_section_to_load): New function
2008 replacing add_output_section. Change all callers to call this or
2009 add_output_section_to_nonload.
2010 (Output_segment::add_output_section_to_nonload): New function.
2011 (Output_segment::remove_output_section): Rewrite.
2012 (Output_segment::add_initial_output_data): Likewise.
2013 (Output_segment::has_any_data_sections): Likewise.
2014 (Output_segment::is_first_section_relro): Likewise.
2015 (Output_segment::maximum_alignment): Likewise.
2016 (Output_segment::has_dynamic_reloc): New function replacing
2017 dynamic_reloc_count. Change all callers.
2018 (Output_segment::has_dynamic_reloc_list): New function replacing
2019 dynamic_reloc_count_list. Change all callers.
2020 (Output_segment::set_section_addresses): Rewrite.
2021 (Output_segment::set_offset): Rewrite.
2022 (Output_segment::find_first_and_last_list): Remove.
2023 (Output_segment::set_tls_offsets): Rewrite.
2024 (Output_segment::first_section_load_address): Likewise.
2025 (Output_segment::output_section_count): Likewise.
2026 (Output_segment::section_with_lowest_load_address): Likewise.
2027 (Output_segment::write_section_headers): Likewise.
2028 (Output_segment::print_sections_to_map): Likewise.
2029 * output.h (class Output_data): Remove dynamic_reloc_count_
2030 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2031 (Output_data::add_dynamic_reloc): Rewrite.
2032 (Output_data::has_dynamic_reloc): New function.
2033 (Output_data::dynamic_reloc_count): Remove.
2034 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2035 is_last_relro_, is_first_non_relro_, is_interp_,
2036 is_dynamic_linker_section_ fields. Add order and set_order
2037 functions. Remove is_relro_local, set_is_relro_local,
2038 is_last_relro, set_is_last_relro, is_first_non_relro,
2039 set_is_first_non_relro functions, is_interp, set_is_interp,
2040 is_dynamic_linker_section, and set_is_dynamic_linker_section
2041 functions.
2042 (class Output_segment): Change Output_data_list from std::list to
2043 std:;vector. Add output_lists_ field. Remove output_data_ and
2044 output_bss_ fields. Update declarations.
2045
3ff2ccb0
ILT
20462010-08-02 Ian Lance Taylor <iant@google.com>
2047
2048 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2049 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2050 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2051
88a4108b
ILT
20522010-08-02 Ian Lance Taylor <iant@google.com>
2053
2054 PR 11855
2055 * script.cc (Script_options::Script_options): Initialize
2056 symbol_definitions_ and symbol_references_.
2057 (Script_options::add_symbol_assignment): Update
2058 symbol_definitions_ and symbol_references_.
2059 (Script_options::add_symbol_reference): New function.
2060 (script_symbol): New function.
2061 * script.h (class Script_options): Add symbol_definitions_ and
2062 symbol_references_ fields.
2063 (Script_options::referenced_const_iterator): New type.
2064 (Script_options::referenced_begin): New function.
2065 (Script_options::referenced_end): New function.
2066 (Script_options::is_referenced): New function.
2067 (Script_options::any_unreferenced): New function.
2068 * script-c.h (script_symbol): Declare.
2069 * yyscript.y (exp): Call script_symbol.
2070 * symtab.cc: Include "script.h".
2071 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2072 Change all callers. Check symbols referenced by scripts.
2073 (Symbol_table::add_undefined_symbols_from_command_line): Add
2074 layout parameter. Change all callers.
2075 (Symbol_table::do_add_undefined_symbols_from_command_line):
2076 Likewise. Break out loop body. Check symbols referenced by
2077 scripts.
2078 (Symbol_table::add_undefined_symbol_from_command_line): New
2079 function broken out of
2080 do_add_undefined_symbols_from_command_line.
2081 * symtab.h (class Symbol_table): Update declarations.
2082 * archive.cc: Include "layout.h".
2083 (Archive::should_include_member): Add layout parameter. Change
2084 all callers. Check for symbol mentioned in expression.
2085 * archive.h (class Archive): Update declaration.
2086 * object.cc (Sized_relobj::do_should_include_member): Add layout
2087 parameter.
2088 * object.h (Object::should_include_member): Add layout parameter.
2089 Change all callers.
2090 (Object::do_should_include_member): Add layout parameter.
2091 (class Sized_relobj): Update declaration.
2092 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2093 parameter.
2094 * dynobj.h (class Sized_dynobj): Update declaration.
2095 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2096 layout parameter.
2097 * plugin.h (class Sized_pluginobj): Update declaration.
2098
5f1ab67a
ILT
20992010-08-02 Ian Lance Taylor <iant@google.com>
2100
2101 PR 11866
2102 * output.cc (Output_segment::set_offset): Search for the first and
2103 last sections rather than assuming that the list is in order.
2104 (Output_segment::find_first_and_last_list): New function.
2105 * output.h (class Output_segment): Update declarations.
2106 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2107 (relro_strip_test_SOURCES): New variable.
2108 (relro_strip_test_DEPENDENCIES): New variable.
2109 (relro_strip_test_LDFLAGS): New variable.
2110 (relro_strip_test_LDADD): New variable.
2111 (relro_strip_test.so): New target.
2112
a8df5856
ILT
21132010-08-02 Ian Lance Taylor <iant@google.com>
2114
2115 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2116 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2117 (Target_i386::got_tlsdesc_section): New function.
2118 (Target_i386::got_section): Create space for GOT entries for
2119 TLSDESC relocations.
2120 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2121 R_386_TLS_GOTDESC.
2122 (Target_i386::Scan::global): Likewise.
2123 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2124 using TLSDESC GOT.
2125 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2126 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2127 (Target_x86_64::got_tlsdesc_section): New function.
2128 (Target_x86_64::got_section): Create space for GOT entries for
2129 TLSDESC relocations.
2130 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2131 R_386_TLS_GOTDESC.
2132 (Target_x86_64::Scan::global): Likewise.
2133 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2134 using TLSDESC GOT.
2135
0c10a0a6
ILT
21362010-08-02 Ian Lance Taylor <iant@google.com>
2137
2138 * testsuite/final_layout.sh: Use dc to convert from hex to
2139 decimal.
2140
41cbeecc
ST
21412010-07-29 Sriraman Tallam <tmsriram@google.com>
2142
2143 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2144 paramter to the call to gold::gc_process_relocs.
2145 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2146 paramter to the call to gold::gc_process_relocs.
2147 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2148 parameter to the call to gold::gc_process_relocs.
2149 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2150 template parameter to the call to gold::gc_process_relocs.
2151 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2152 paramter to the call to gold::gc_process_relocs.
2153 * gc.h (get_embedded_addend_size): New function.
2154 (gc_process_relocs): Save the size of the reloc for use by ICF.
2155 * icf.cc (get_section_contents): Get the addend from the text section
2156 for SHT_REL relocation sections.
2157 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2158 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2159 * int_encoding.h (read_from_pointer): New overloaded function.
2160 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2161 * testsuite/icf_sht_rel_addend_test.sh: New file.
2162 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2163 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2164
6ea55b82
RW
21652010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2166
2167 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2168 * Makefile.in: Regenerate.
2169 * testsuite/Makefile.in: Regenerate.
2170
9691462b
ILT
21712010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2172
2173 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2174 * gold/testsuite/debug_msg.cc: Likewise.
2175 * gold/testsuite/odr_violation1.cc
2176 * gold/testsuite/odr_violation2.cc
2177
76897331
CC
21782010-07-21 Cary Coutant <ccoutant@google.com>
2179
2180 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2181 string, and length fields.
2182 (Output_merge_string::Merged_strings_list): New type.
2183 (Output_merge_string::Merged_strings_lists): New typedef.
2184 (Output_merge_string): Replace merged_strings_ with
2185 merged_strings_lists_.
2186 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2187 Merged_strings_list per input object and section. Don't store pointer
2188 to the string. Don't store length with each merged string entry.
2189 (Output_merge_string::finalize_merged_data): Loop over list of merged
2190 strings lists. Recompute length of each merged string.
2191
78384e8f
CC
21922010-07-15 Cary Coutant <ccoutant@google.com>
2193
2194 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2195 here.
2196
783659f9
ILT
21972010-07-14 Ian Lance Taylor <iant@google.com>
2198
2199 * descriptors.cc (Descriptors::open): Report correct name in error
2200 message.
2201
131687b4
DK
22022010-07-13 Doug Kwan <dougkwan@google.com>
2203
2204 * arm.cc (Arm_input_section::Arm_input_section): For a
2205 SHT_ARM_EXIDX section, always keeps the input sections.
2206 (Arm_input_section::set_exidx_section_link): New method.
2207 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
2208 has_errors_ to false.
2209 (Arm_exidx_input_section::has_errors,
2210 Arm_exidx_input_section::set_has_errors): New methods.
2211 (Arm_exidx_input_section::has_errors_): New data member.
2212 (Arm_relobj::get_exidx_shndx_list): New method.
2213 (Arm_output_section::append_text_sections_to_list): Do not skip
2214 section without SHF_EXECINSTR.
2215 (Arm_output_section::fix_exidx_coverage): Skip input sections with
2216 errors.
2217 (Arm_relobj::make_exidx_input_section): Add new parameter for text
2218 section header. Make error messages more verbose. Check for
2219 a non-executable section linked to an EXIDX section.
2220 (Arm_relobj::do_read_symbols): Remove error checking, which has been
2221 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
2222 check that there is no deferred EXIDX section if we exit early.
2223 Instead of not making an EXIDX section in case of an error, make one
2224 and set the has_errors flag of it.
2225 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
2226 in a relocatable link.
2227 (Target_arm::do_relax): Look for the EXIDX output section instead of
2228 assuming that it is called .ARM.exidx.
2229 (Target_arm::fix_exidx_coverage): Add a new parameter for input
2230 section list. Do not check for SHF_EXECINSTR section flags but
2231 skip any input section with errors.
2232 * output.cc (Output_section::Output_section): Initialize
2233 always_keeps_input_sections_ to false.
2234 (Output_section::add_input_section): Check for
2235 always_keeps_input_sections_.
2236 * output.h (Output_section::always_keeps_input_sections,
2237 Output_section::set_always_keeps_input_sections): New methods.
2238 (Output_section::always_keeps_input_sections): New data member.
2239
69517287
RÁE
22402010-07-13 Rafael Espindola <espindola@google.com>
2241
2242 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
2243 * fileread.h (Input_file): Add try_extra_search_path and find_file.
2244
82742395
ILT
22452010-07-13 Philip Herron <herron.philip@googlemail.com>
2246 Ian Lance Taylor <iant@google.com>
2247
2248 * output.h (Output_section_lookup_maps::add_merge_section):
2249 Correct check of whether value was inserted.
2250 (Output_section_lookup_maps::add_merge_input_section): Likewise.
2251 (Output_section_lookup_maps::add_relaxed_input_section):
2252 Likewise.
2253 * arm.cc (Target_arm::got_section): Remove used local os.
2254 * i386.cc (Target_i386::got_section): Likewise.
2255 * x86_64.cc (Target_x86_64::got_section): Likewise.
2256 * sparc.cc (Target_sparc::got_section): Likewise.
2257 (Target_sparc::relocate): Remove unused local have_got_offset.
2258 * powerpc.cc (Target_powerpc::relocate): Likewise.
2259
f2d707b5
ILT
22602010-07-13 Ian Lance Taylor <iant@google.com>
2261
241531d6
ILT
2262 * compressed_output.cc (zlib_decompress): Fix signature in
2263 !HAVE_ZLIB_H case.
2264
f2d707b5
ILT
2265 * archive.cc (Archive::include_member): Unlock an external member
2266 of a thin archive. Don't bother to delete an object we know is
2267 NULL.
2268
a2e47362
CC
22692010-07-12 Cary Coutant <ccoutant@google.com>
2270
2271 * compressed_output.cc (zlib_decompress): New function.
2272 (get_uncompressed_size): New function.
2273 (decompress_input_section): New function.
2274 * compressed_output.h (get_uncompressed_size): New function.
2275 (decompress_input_section): New function.
2276 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
2277 Handle compressed debug sections.
2278 * layout.cc (is_compressed_debug_section): New function.
2279 (Layout::output_section_name): Map compressed section names to
2280 canonical names.
2281 * layout.h (is_compressed_debug_section): New function.
2282 (is_debug_info_section): Recognize compressed debug sections.
2283 * merge.cc: Include compressed_output.h.
2284 (Output_merge_data::do_add_input_section): Handle compressed
2285 debug sections.
2286 (Output_merge_string::do_add_input_section): Handle compressed
2287 debug sections.
2288 * object.cc: Include compressed_output.h.
2289 (Sized_relobj::Sized_relobj): Initialize new data members.
2290 (build_compressed_section_map): New function.
2291 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
2292 * object.h (Object::section_is_compressed): New method.
2293 (Object::do_section_is_compressed): New method.
2294 (Sized_relobj::Compressed_section_map): New type.
2295 (Sized_relobj::do_section_is_compressed): New method.
2296 (Sized_relobj::compressed_sections_): New data member.
2297 * output.cc (Output_section::add_input_section): Handle compressed
2298 debug sections.
2299 * reloc.cc: Include compressed_output.h.
2300 (Sized_relobj::write_sections): Handle compressed debug sections.
2301
ce279a62
CC
23022010-07-08 Cary Coutant <ccoutant@google.com>
2303
2304 * resolve.cc (Symbol_table::resolve): Remember whether undef was
2305 weak when resolving to a dynamic def.
2306 (Symbol_table::should_override): Add adjust_dyndef flag; set it
2307 for weak undef/dynamic def cases. Adjust callers.
2308 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
2309 undef_binding_weak_.
2310 (Symbol_table::sized_write_globals): Adjust symbol binding.
2311 (Symbol_table::sized_write_symbol): Add binding parameter.
2312 * symtab.h (Symbol::set_undef_binding): New method.
2313 (Symbol::is_undef_binding_weak): New method.
2314 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
2315 (Symbol_table::should_override): Add new parameter.
2316 (Symbol_table::sized_write_symbol): Add new parameter.
2317
2318 * testsuite/weak_undef_file1.cc: Add new test case.
2319 * testsuite/weak_undef_file2.cc: Fix header comment.
2320 * testsuite/weak_undef_test.cc: Add new test case.
2321
b2286c10
DK
23222010-06-29 Doug Kwan <dougkwan@google.com>
2323
2324 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
2325 Initialize USE_SYMBOL_.
2326 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
2327 definition.
2328 (Arm_reloc_property::uses_symbol_): New data member declaration.
2329 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
2330 uses symbol value and symbol is undefined but not weakly undefined.
2331
4802450a
RÁE
23322010-06-28 Rafael Espindola <espindola@google.com>
2333
2334 * plugin.cc (Plugin::load): Use dlerror.
2335
e5ca47ba
ILT
23362010-06-26 Jeffrey Yaskin <jyasskin@google.com>
2337
2338 * symtab.cc (detect_odr_violations): When reporting an ODR
2339 violation, report an object where the symbol is defined.
2340
8a75a161
DK
23412010-06-25 Doug Kwan <dougkwan@google.com>
2342
2343 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
2344 (Target_arm::section_may_have_icf_unsafe_pointers): New method
2345 definition.
2346 (Target_arm::Scan::local_reloc_may_be_function_pointer,
2347 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
2348 target hook to detect function points.
2349 (Target_arm::Scan::possible_function_pointer_reloc): New method.
2350 * icf.h (Icf::check_section_for_function_pointers): Change type of
2351 parameter SECTION_NAME to const reference to std::string. Use
2352 target hook to determine if section may have unsafe pointers.
2353 * target.h (Target::section_may_have_icf_unsafe_pointers): New
2354 method definition.
2355
42218b9f
RÁE
23562010-06-21 Rafael Espindola <espindola@google.com>
2357
2358 * fileread.cc (Input_file::find_fie): New
2359 (Input_file::open): Use Input_file::find_fie.
2360 * fileread.h (Input_file::find_fie): New
2361 * plugin.cc (set_extra_library_path): New.
2362 (Plugin::load): Add set_extra_library_path to the transfer vector.
2363 (Plugin_manager::set_extra_library_path): New.
2364 (Plugin_manager::add_input_file): Use the extra search path if set.
2365 (set_extra_library_path(): New.
2366 * plugin.h (Plugin_manager): Add set_extra_library_path and
2367 extra_search_path_.
2368
a0506cca
CC
23692010-06-19 Cary Coutant <ccoutant@google.com>
2370
2371 * layout.cc (gdb_sections): Add .debug_types.
2372 (lines_only_debug_sections): Likewise.
2373
6508b958
RÁE
23742010-06-18 Rafael Espindola <espindola@google.com>
2375
2376 * plugin.cc (add_input_file,add_input_library)
2377 (Plugin_manager::add_input_file): Make filename arguments const.
2378 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
2379 const.
2380
3e235302
DK
23812010-06-16 Doug Kwan <dougkwan@google.com>
2382
2383 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
2384 .ARM.attributes section if we have not merged any input
2385 attributes sections.
2386
106e8a6c
DK
23872010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2388
2389 * arm.cc: Allow combining objects with no EABI version
2390 information.
2391
91ff43fe
RÁE
23922010-06-15 Rafael Espindola <espindola@google.com>
2393
2394 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
2395
68ed838c
ILT
23962010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2397
2398 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
2399 (struct iovec): Correct !HAVE_READV definition.
2400
f3a2388f
CC
24012010-06-10 Cary Coutant <ccoutant@google.com>
2402
2403 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
2404 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
2405 reloc sections.
2406 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
2407
2408 PR 11683
2409 * symtab.h (Symbol::is_placeholder): New member function.
2410 * target-reloc.h (relocate_section): Check for placeholder symbols.
2411
2412 * testsuite/Makefile.am (plugin_test_8): New test.
2413 (plugin_test_9): New test.
2414 * testsuite/Makefile.in: Regenerate.
2415
e1df38aa
NC
24162010-06-09 Nick Clifton <nickc@redhat.com>
2417
2418 * yyscript.y (input_list_element): Allow strings prefixed with
2419 the '-' character. Treat these as libraries.
2420 * script.cc (script_add_library): New function. Adds a library
2421 specified by "-l<name>" found in an input script.
2422 * script-c.h: Add prototype for script_add_library.
2423
25bbe950
DK
24242010-06-07 Doug Kwan <dougkwan@google.com>
2425
2426 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
2427 Restrict stub-group size to be within long conditional branch
2428 range when working around cortex-A8 erratum.
2429
0f32ea4c
ILT
24302010-06-07 Damien Diederen <dd@crosstwine.com>
2431
2432 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
2433 #ifdef typo.
2434
8fe2a369
ST
24352010-06-03 Sriraman Tallam <tmsriram@google.com>
2436
2437 PR gold/11658
2438 * output.cc
2439 (Output_section::Input_section_sort_entry::compare_section_ordering):
2440 Change to return non-zero correctly.
2441 (Output_section::Input_section_sort_section_order_index_compare
2442 ::operator()): Change to fix ambiguity in comparisons.
2443
6e9ba2ca
ST
24442010-06-01 Sriraman Tallam <tmsriram@google.com>
2445
2446 * gold.h (is_wildcard_string): New function.
2447 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
2448 (Layout::layout_eh_frame): Ditto.
2449 (Layout::find_section_order_index): New method.
2450 (Layout::read_layout_from_file): New method.
2451 * layout.h (Layout::find_section_order_index): New method.
2452 (Layout::read_layout_from_file): New method.
2453 (Layout::input_section_position_): New private member.
2454 (Layout::input_section_glob_): New private member.
2455 * main.cc (main): Call read_layout_from_file here.
2456 * options.h (--section-ordering-file): New option.
2457 * output.cc (Output_section::input_section_order_specified_): New
2458 member.
2459 (Output_section::Output_section): Initialize new member.
2460 (Output_section::add_input_section): Add new parameter.
2461 Keep input sections when --section-ordering-file is used.
2462 (Output_section::set_final_data_size): Sort input sections when
2463 section ordering file is specified.
2464 (Output_section::Input_section_sort_entry): Add new parameter.
2465 Check sorting type.
2466 (Output_section::Input_section_sort_entry::compare_section_ordering):
2467 New method.
2468 (Output_section::Input_section_sort_compare::operator()): Change to
2469 consider section_order_index.
2470 (Output_section::Input_section_sort_init_fini_compare::operator()):
2471 Change to consider section_order_index.
2472 (Output_section::Input_section_sort_section_order_index_compare
2473 ::operator()): New method.
2474 (Output_section::sort_attached_input_sections): Change to sort
2475 according to section order when specified.
e1df38aa
NC
2476 (Output_section::add_input_section<32, true>): Add new parameter.
2477 (Output_section::add_input_section<64, true>): Add new parameter.
2478 (Output_section::add_input_section<32, false>): Add new parameter.
2479 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
2480 * output.h (Output_section::add_input_section): Add new parameter.
2481 (Output_section::input_section_order_specified): New
2482 method.
2483 (Output_section::set_input_section_order_specified): New method.
2484 (Input_section::Input_section): Initialize section_order_index_.
2485 (Input_section::section_order_index): New method.
2486 (Input_section::set_section_order_index): New method.
2487 (Input_section::section_order_index_): New member.
2488 (Input_section::Input_section_sort_section_order_index_compare): New
2489 struct.
2490 (Output_section::input_section_order_specified_): New member.
2491 * script-sections.cc (is_wildcard_string): Delete and move modified
2492 method to gold.h.
2493 (Output_section_element_input::Output_section_element_input): Modify
2494 call to is_wildcard_string.
2495 (Output_section_element_input::Input_section_pattern
2496 ::Input_section_pattern): Ditto.
2497 (Output_section_element_input::Output_section_element_input): Ditto.
2498 * testsuite/Makefile.am (final_layout): New test case.
2499 * testsuite/Makefile.in: Regenerate.
2500 * testsuite/final_layout.cc: New file.
2501 * testsuite/final_layout.sh: New file.
2502
3537c84b
RÁE
25032010-06-01 Rafael Espindola <espindola@google.com>
2504
2505 * plugin.cc (Plugin::load): Pass the output name to the plugin.
2506
105b6afd
RÁE
25072010-06-01 Rafael Espindola <espindola@google.com>
2508
2509 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
2510 visibility of symbols.
2511
29e11421
DK
25122010-05-27 Doug Kwan <dougkwan@google.com>
2513
2514 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
2515 from start of output section instead of address for a local symbol
2516 in a merged or relaxed section when doing a relocatable link.
2517
5e0f337e
RÁE
25182010-05-26 Rafael Espindola <espindola@google.com>
2519
2520 PR 11604
2521 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
2522 adding sections the garbage collector removed.
2523 * gold/testsuite/Makefile.am: Add test.
2524 * gold/testsuite/Makefile.in: Regenerate.
2525 * gold/testsuite/plugin_test_7.sh: New.
2526 * gold/testsuite/plugin_test_7_1.c: New.
2527 * gold/testsuite/plugin_test_7_2.c: New.
2528
f4187277
RÁE
25292010-05-26 Rafael Espindola <espindola@google.com>
2530
2531 * script-sections.cc (Output_section_definition::set_section_addresses):
2532 Check for --section-start.
2533
5c388529
DK
25342010-05-26 Doug Kwan <dougkwan@google.com>
2535
2536 * arm.cc (Arm_scan_relocatable_relocs): New class.
2537 (Target_arm::relocate_special_relocatable): New method.
2538 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
2539 (Arm_relocate_functions::thumb_branch_common): Same.
2540 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
2541 instead of Default_scan_relocatable_relocs.
2542 * target-reloc.h (relocate_for_relocatable): Let target handle
2543 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
2544 * target.h (Sized_target::relocate_special_relocatable): New method.
2545
bca1c3ae
ILT
25462010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2547
2548 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
2549
0439c796
DK
25502010-05-23 Doug Kwan <dougkwan@google.com>
2551
2552 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
2553 instead of a cast.
2554 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
2555 with a direct branch, not a conditional branch, to a stub.
2556 * merge.cc (Output_merge_base::record_input_section): New method
2557 defintion.
2558 (Output_merge_data::do_add_input_section): Record input section if
2559 keeps-input-sections flag is set.
2560 (Output_merge_string::do_add_input_section): Ditto.
2561 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
2562 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
2563 INPUT_SECTIONS_.
2564 (Output_merge_base::keeps_input_sections,
2565 Output_merge_base::set_keeps_input_sections,
2566 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
2567 method definitions.
2568 (Output_merge_base::Input_sections): New type declaration.
2569 (Output_merge_base::input_sections_begin,
2570 Output_merge_base::input_sections_end,
2571 Output_merge_base::do_set_keeps_input_sections): New method definitions.
2572 (Output_merge_base::bool keeps_input_sections_,
2573 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
2574 Output_merge_base::input_sections_): New data members.
2575 (Output_merge_data::do_set_keeps_input_sections): New method
2576 defintion.
2577 (Output_merge_string::do_set_keeps_input_sections): Ditto.
2578 * output.cc (Output_section::Input_section::relobj): Move method
2579 defintion from class declaration to here and handle merge sections.
2580 (Output_section::Input_section::shndx): Ditto.
2581 (Output_section::Output_section): Remove initializations of removed
2582 data members and initialize new data member LOOKUP_MAPS_.
2583 (Output_section::add_input_section): Set keeps-input-sections flag
2584 for a newly created merge output section as appropriate. Adjust code
2585 to use Output_section_lookup_maps class.
2586 (Output_section::add_relaxed_input_section): Adjst code for lookup
2587 maps code refactoring.
2588 (Output_section::add_merge_input_section): Add a new parameter
2589 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
2590 class. If adding input section to a newly created merge output
2591 section fails, remove the new merge section.
2592 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 2593 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
2594 (Output_section::find_merge_section): Ditto.
2595 (Output_section::build_lookup_maps): New method defintion.
2596 (Output_section::find_relaxed_input_section): Adjust code to use
2597 Output_section_lookup_maps class.
2598 (Output_section::get_input_sections): Export merge sections. Adjust
2599 code to use Output_section_lookup_maps class.
2600 (Output_section:::add_script_input_section): Adjust code to use
2601 Output_section_lookup_maps class. Update lookup maps for merge
2602 sections also.
2603 (Output_section::discard_states): Use Output_section_lookup_maps.
2604 (Output_section::restore_states): Same.
2605 * output.h (Merge_section_properties): Move class defintion out of
2606 Output_section.
2607 (Output_section_lookup_maps): New class.
2608 (Output_section::Input_section::is_merge_section): New method
2609 defintion.
2610 (Output_section::Input_section::relobj): Move defintion out of class
2611 defintion. Declare method only.
2612 (Output_section::Input_section::shndx): Ditto.
2613 (Output_section::Input_section::output_merge_base): New method defintion.
2614 (Output_section::Input_section::u2_.pomb): New union field.
2615 (Output_section::Merge_section_by_properties_map,
2616 Output_section::Output_section_data_by_input_section_map,
2617 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
2618 Remove types.
2619 (Output_section::add_merge_input_section): Add new parameter
2620 KEEPS_INPUT_SECTIONS.
2621 (Output_section::build_lookup_maps): New method declaration.
2622 (Output_section::merge_section_map_,
2623 Output_section::merge_section_by_properties_map_,
2624 Output_section::relaxed_input_section_map_,
2625 Output_section::is_relaxed_input_section_map_valid_): Remove data
2626 members.
2627 (Output_section::lookup_maps_): New data member.
2628
76295588
L
26292010-05-21 Doug Kwan <dougkwan@google.com>
2630
2631 PR gold/11619
2632 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
2633 avoid a compilation error.
2634
d103a984
RÁE
26352010-05-19 Rafael Espindola <espindola@google.com>
2636
2637 * script-sections.cc (Output_section_definition::allocate_to_segment):
2638 Update the phdrs_list even when the output section is NULL.
2639 * testsuite/Makefile.am: Add test.
2640 * testsuite/Makefile.in: Regenerate.
2641 * testsuite/script_test_9.cc: New.
2642 * testsuite/script_test_9.sh: New.
2643 * testsuite/script_test_9.t: New.
2644
6625d24e
DK
26452010-05-19 Doug Kwan <dougkwan@google.com>
2646
2647 * arm.cc (Arm_input_section::original_size): New method.
2648 (Arm_input_section::do_addralign): Add a cast.
2649 (Arm_input_section::do_output_offset): Remove static cast.
2650 (Arm_input_section::original_addralign,
2651 Arm_input_section::original_size_): Change type to uint32_t.
2652 (Arm_input_section::init): Add safe casts for section alignment
2653 and size.
2654 (Arm_input_section::set_final_data_size): Do not set address and
2655 offset of stub table.
2656 (Arm_output_section::fix_exidx_coverage): Change use of of
2657 Output_section::Simple_input_section to that of
2658 Output_section::Input_section.
2659 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
2660 except for the first pass.
2661 * output.cc (Output_section::get_input_sections): Change type of
2662 input_sections to std::list<Input_section>.
2663 (Output_section::add_script_input_section): Rename from
2664 Output_section::add_simple_input_section. Change type of SIS
2665 parameter from Simple_input_section to Input_section.
2666 * output.h (Output_section::Simple_input_section): Remove class.
2667 (Output_section::Input_section): Change class visibility to public.
2668 (Output_section::Input_section::addralign): Use stored alignments
2669 for special input sections if set.
2670 (Output_section::Input_section::set_addralign): New method.
2671 (Output_section::get_input_sections): Change parameter type from
2672 list of Simple_input_section to list of Input_section.
2673 (Output_section::add_script_input_section): Rename from
2674 Output_section::add_simple_input_section. Change first parameter's
2675 type from Simple_input_section to Input_section and remove the
2676 second and third parameters.
2677 * script-sections.cc (Input_section::Input_section_list): Change
2678 type to list of Output_section::Input_section/
2679 (Input_section_info::Input_section_info): Change parameter type of
2680 INPUT_SECTION to Output_section::Input_section.
2681 (Input_section_info::input_section): Change return type.
2682 (Input_section_info::input_section_): Change type to
2683 Output_section::Input_section.
2684 (Output_section_element_input::set_section_addresses): Adjust code
2685 to use Output_section::Input_section instead of
2686 Output_section::Simple_input_section. Adjust code for renaming
2687 of Output_section::add_simple_input_section.
2688 (Orphan_output_section::set_section_addresses): Ditto.
2689
e1e82ea4
RW
26902010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2691
2692 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
2693 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
2694
91e75c8a
RÁE
26952010-05-18 Rafael Espindola <espindola@google.com>
2696
2697 * options.cc (General_options::finalize): Handle -nostdlib.
2698 * options.h (nostdlib): New option.
2699 * script.cc (script_add_search_dir): Handle -nostdlib.
2700
da59ad79
DK
27012010-05-12 Doug Kwan <dougkwan@google.com>
2702
2703 * arm.cc (Target_arm::do_finalize_sections): Create an empty
2704 attributes section only if there no attributes section after merging.
2705 (Target_arm::merge_object_attributes): Move value of
e1df38aa 2706 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
2707 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
2708 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
2709 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
2710 and arm_attr_merge_7.stdout.
2711 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
2712 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
2713 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
2714 arm_attr_merge_7b.o): New rules.
2715 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
2716 arm_attr_merge_7
2717 * testsuite/Makefile.in: Regenerate.
2718 * testsuite/arm_attr_merge.sh: New file.
2719 * testsuite/arm_attr_merge_[67][ab].s: Same.
2720
3e01a7fd
NC
27212010-05-05 Nick Clifton <nickc@redhat.com>
2722
2723 * po/es.po: Updated Spanish translation.
2724
7ad2014a
L
27252010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2726
2727 * Makefile.am (install-exec-local): Properly install gold as
2728 default cross linker.
2729 * Makefile.in: Regenerated.
2730
4fda8867
NC
27312010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2732 Nick Clifton <nickc@redhat.com>
2733
2734 * configure.ac (install_as_default): Define and set to false
2735 unless --enable-gold or --enable-gold=both/gold has been
2736 specified.
2737 * configure: Regenerate.
2738
2739 * Makefile.am (install-exec-local): Install the executable as
2740 'ld.gold'. If install_as_default is true then also install it as
2741 'ld'.
2742 * Makefile.in: Regenerated.
2743
bd288ea2
ILT
27442010-04-24 Ian Lance Taylor <iant@google.com>
2745
2746 * layout.cc (Layout::layout_reloc): In relocatable link don't
2747 combine reloc sections for grouped sections.
2748
ef38fd8a
ST
27492010-04-23 Sriraman Tallam <tmsriram@google.com>
2750
2751 * gc.h (gc_process_relocs): Pass information on relocs pointing to
2752 sections that are not ordinary to icf.
2753 * icf.cc (get_section_contents): Handle relocation pointing to section
2754 with no object or shndx information.
2755 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
2756 * testsuite/Makefile.in: Regenerate.
2757 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
2758 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
2759
f6973bdc
ILT
27602010-04-22 Ian Lance Taylor <iant@google.com>
2761
2762 * expression.cc (Expression::Expression_eval_info): Add
2763 result_alignment_pointer field.
2764 (Expression::eval_with_dot): Add result_alignment_pointer
2765 parameter. Change all callers.
2766 (Expression::eval_maybe_dot): Likewise.
2767 (class Binary_expression): Add alignment_pointer parameter to
2768 left_value and right_value. Change all callers.
2769 (BINARY_EXPRESSION): Set result alignment.
2770 (class Trinary_expression): Add alignment_pointer parameter to
2771 arg2_value and arg3_value. Change all callers.
2772 (Trinary_cond::value): Set result alignment.
2773 (Max_expression::value, Min_expression::value): Likewise.
2774 (Align_expression::value): Likewise.
2775 * script-sections.cc (class Sections_element): Add dot_alignment
2776 parameter to set_section_addresses virtual function. Update
2777 instantiations.
2778 (class Output_section_element): Likewise.
2779 (Script_sections::create_segments): Add dot_alignment parameter.
2780 Change all callers.
2781 (Script_sections::create_segments_from_phdrs_clause): Likewise.
2782 (Script_sections::set_phdrs_clause_addresses): Likewise.
2783 * script-sections.h: Update declarations.
2784 * script.h: Update declarations.
2785 * output.h (Output_segment::set_minimum_p_align): Don't decrease
2786 min_p_align.
2787 * testsuite/script_test_3.t: Set large alignment.
2788 * testsuite/script_test_3.sh: Make sure that at least one LOAD
2789 segment has expected alignment.
2790
9c9c98a5
NC
27912010-04-22 Nick Clifton <nickc@redhat.com>
2792
2793 * po/gold.pot: Updated by the Translation project.
2794 * po/vi.po: Updated Vietnamese translation.
2795
2253bfba
L
27962010-04-22 H.J. Lu <hongjiu.lu@intel.com>
2797
2798 * testsuite/Makefile.am (check_PROGRAMS): Add
2799 icf_virtual_function_folding_test.
2800 * testsuite/Makefile.in: Regenerated.
2801
85fdf906
AH
28022010-04-15 Andrew Haley <aph@redhat.com>
2803
2804 * options.h (merge_exidx_entries): New option.
2805 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
2806 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
2807 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
2808 (Target_arm::merge_exidx_entries): New function.
2809 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
2810 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
2811 to Arm_exidx_fixup constructor.
2812 Add new arg, merge_exidx_entries.
2813 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
2814 Arm_output_section::fix_exidx_coverage.
2815
ce97fa81
ST
28162010-04-18 Sriraman Tallam <tmsriram@google.com>
2817
2818 * icf.cc (get_section_contents): Check for preemptible functions.
2819 Ignore addend when appropriate.
2820 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
2821 section folded.
2822 (add_from_relobj): Check for section folded.
2823 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
2824 * symtab.h (should_add_dynsym_entry): Add new parameter.
2825 * target-reloc.h (scan_relocs): Check for section folded.
2826 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
2827 Check reloc types for function pointers in shared objects.
2828 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
2829 case.
2830 (icf_preemptible_functions_test): New test case.
2831 (icf_string_merge_test): New test case.
2832 * testsuite.Makefile.in: Regenerate.
2833 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
2834 bar_glob. Refactor code.
2835 * testsuite/icf_preemptible_functions_test.cc: New file.
2836 * testsuite/icf_preemptible_functions_test.sh: New file.
2837 * testsuite/icf_string_merge_test.cc: New file.
2838 * testsuite/icf_string_merge_test.sh: New file.
2839 * testsuite/icf_virtual_function_folding_test.cc: New file.
2840 * testsuite/icf_virtual_function_folding_test.sh: New file.
2841
04ceb17c
DK
28422010-04-14 Doug Kwan <dougkwan@google.com>
2843
2844 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
2845 for local symbol recounting if we remove a section due to ICF.
2846 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
2847 there are no regular objects in input.
2848
153e7da4
DK
28492010-04-13 Doug Kwan <dougkwan@google.com>
2850
2851 * arm.cc (Arm_input_section::set_final_data_size): Compute
2852 accurate final data size instead of using current data size.
2853
4dbd9faf
DK
28542010-04-09 Doug Kwan <dougkwan@google.com>
2855
2856 * layout.cc (Layout::choose_output_section): Handle script section
2857 types.
2858 (Layout::make_output_section_for_script): Add section type parameter.
2859 Handle script section types.
2860 * layout.h (Layout::make_output_section_for_script): Add section
2861 type parameter.
2862 * output.cc (Output_section::Output_section): Initialize data member
2863 is_noload_.
2864 (Output_section::do_reset_address_and_file_offset): Do not set address
2865 to 0 if section is a NOLOAD section.
2866 * output.h (Output_section::is_noload): New method.
2867 (Output_section::set_is_noload): Ditto.
2868 (Output_section::is_noload_): New data member.
2869 * script-c.h (Script_section_type): New enum type.
2870 (struct Parser_output_section_header): Add new file section_type.
2871 * script-sections.cc (Sections_element::output_section_name): Add
2872 parameter for returning script section type.
2873 (Output_section_definition::output_section_name): Ditto.
2874 (Output_section_definition::section_type)P; New method.
2875 (Output_section_definiton::script_section_type_name): Ditto.
2876 (Output_section_definition::script_section_type_): New data member.
2877 (Output_section_definition::Output_section_definition): Initialize
2878 data member Output_section_definition::script_section_type_.
2879 (Output_section_definition::create_sections): Pass script section type
2880 to Layout::make_output_section_for_script.
2881 (Output_section_definition::output_section_name): Return script
2882 section type to caller.
2883 (Output_section_definition::set_section_address): Do not advance
2884 dot value and load address if section type is NOLOAD. Set address
2885 of NOLOAD sections regardless of section flags.
2886 (Output_section_definition::print): Print section type if it is
2887 not SCRIPT_SECTION_TYPE_NONE.
2888 (Output_section_definition::section_type): New method.
2889 (Output_section_definition::script_section_type_name): Ditto.
2890 (Script_sections::output_section_name): Add new parameter
2891 PSECTION_TYPE for returning script section type. Pass it to
2892 section elements. Handle discard sections.
2893 (Sort_output_sections::operator()): Handle NOLOAD sections.
2894 * script-sections.h (Script_sections::Section_type): New enum type.
2895 (Script_sections::output_section_name): Add a new parameter for
2896 returning script section type.
2897 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
2898 INFO and NOLOAD.
2899 * yyscript.y (union): Add new field SECTION_TYPE.
2900 (COPY, DSECT, INFO, NOLOAD): New tokens.
2901 (opt_address_and_section_type): Change type to output_section_header.
2902 (section_type): New non-terminal
2903 (section_header): Handle section type.
2253bfba 2904 (opt_address_and_section_type): Return section type value.
4dbd9faf 2905
721ea635
L
29062010-04-09 H.J. Lu <hongjiu.lu@intel.com>
2907
2908 * testsuite/plugin_common_test_1.c (foo): Add prototype.
2909 * testsuite/plugin_common_test_2.c (foo): Likewise.
2910
6bf924b0
DK
29112010-04-08 Doug Kwan <dougkwan@google.com>
2912
2913 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
2914 Output_merge_data.
2915 * output.cc (Output_section::add_merge_input_section): Simplify
2916 code and return status of Output_merge_base::add_input_section.
e1df38aa 2917 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
2918 returns true.
2919
24af6f92
DK
29202010-04-07 Doug Kwan <dougkwan@google.com>
2921
2922 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
2923 if section is marked as containing instructions but has no mapping
2924 symbols.
2925 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
2926 correct section index.
2927 (Arm_relobj::find_linked_text_section): Ditto.
2928
00698fc5
CC
29292010-04-07 Cary Coutant <ccoutant@google.com>
2930
2931 * archive.cc (include_member): Destroy Read_symbols_data object before
2932 releasing file.
2933 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
2934 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
2935 (Read_symbols_data::~Read_symbols_data) New destructor.
2936 (Section_relocs::Section_relocs) New constructor.
2937 (Section_relocs::~Section_relocs) New destructor.
2938 (Read_relocs_data::Read_relocs_data) New constructor.
2939 (Read_relocs_data::~Read_relocs_data) New destructor.
2940 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
2941 pointers to NULL after deleting.
2942
7296d933
DK
29432010-04-07 Doug Kwan <dougkwan@google.com>
2944
2945 * arm.cc: Replace "endianity" with "endianness" in comments.
2946 (Arm_exidx_cantunwind): Ditto.
2947 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
2948 (Arm_relobj::merge_flags_and_attributes): New method.
2949 (Arm_relobj::merge_flags_and_attributes_): New data member.
2950 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
2951 (Arm_relobj::scan_sections_for_stubs): Ditto.
2952 (Arm_relobj::do_read_symbols): Check to see if we really want to
2953 merge processor-specific flags and attributes. Exit early if
2954 an object is empty except for section names and the undefined symbol.
2955 (Target_arm::do_finalize_sections): Move check for ELF format to
2956 Arm_relobj::do_read_symbols. Merge processor specific flags and
2957 attributes from a regular object only when we have determined that
2958 it is aapropriate. Do not create an .ARM.attributes section in
2959 output if there is no regular input object.
2960 (Target_arm::merge_processor_specific_flags): Check
2961 --warn-mismatch before printing any error.
2962 (Target_arm::merge_object_attributes): Ditto.
2963 * gold.cc (queue_middle_tasks): Handle the case in which there is
2964 no regular object in input.
2965 * options.cc (General_options::parse_EB): New method.
2966 (General_options::parse_EL): Same.
2967 (General_options::General_options): Initialize endianness_.
2968 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
2969 New options.
2970 (General_options::Endianness): New enum.
2971 (General_options::endianness): New method.
2972 (General_options::endianness_): New data member.
2973 * parameters.cc (Parameters::set_options): Check target endianness.
2974 (Parameters::set_target_once): Ditto.
2975 (Parameters::check_target_endianness): New method.
2976 (parameters_force_valid_target): If either -EL or -EB is specified,
2977 use it to define endianness of default target.
2978 * parameters.h (Parameters::check_target_endianness): New method
2979 declaration.
2980 * target.h (class Target): Change "endianity" to "endianness"
2981 in comments.
2982
efc8d4f2
RW
29832010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2984
2985 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
2986 * configure: Regenerate.
2987 * Makefile.in: Regenerate.
2988 * testsuite/Makefile.in: Regenerate.
2989
be234d88
CC
29902010-04-06 Cary Coutant <ccoutant@google.com>
2991
2992 gcc PR lto/42757
2993 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
2994 prevailing definitions of common symbols.
2995 * testsuite/plugin_test_6.sh: New test case.
2996 * testsuite/plugin_common_test_1.c: New test case.
2997 * testsuite/plugin_common_test_2.c: New test case.
2998 * testsuite/Makefile.am (plugin_test_6): New test case.
2999 * testsuite/Makefile.in: Regenerate.
3000
bd32c6bd
NC
30012010-04-06 Nick Clifton <nickc@redhat.com>
3002
3003 * po/vi.po: New Vietnamese translation.
3004
323c532f
DK
30052010-03-30 Doug Kwan <dougkwan@google.com>
3006
3007 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3008
4fcd97eb
DK
30092010-03-25 Doug Kwan <dougkwan@google.com>
3010
3011 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3012 to avoid a conversion warning on a 32-bit host.
3013
4ebf39db
ILT
30142010-03-24 Ian Lance Taylor <iant@google.com>
3015
3016 * testsuite/script_test_3.t: Add a TLS segment.
3017 * testsuite/Makefile.am (check_PROGRAMS): Add
3018 tls_phdrs_script_test.
3019 (tls_phdrs_script_test_SOURCES): Define.
3020 (tls_phdrs_script_test_DEPENDENCIES): Define.
3021 (tls_phdrs_script_test_LDFLAGS): Define.
3022 (tls_phdrs_script_test_LDADD): Define.
3023 * testsuite/Makefile.in: Rebuild.
3024
4a599bdd
CC
30252010-03-23 Cary Coutant <ccoutant@google.com>
3026
3027 * fileread.cc (find_or_make_view): Fix comment.
3028
6c93b22c
ILT
30292010-03-23 Ian Lance Taylor <iant@google.com>
3030
3031 * script-sections.cc (class Orphan_section_placement): Define
3032 PLACE_TLS and PLACE_TLS_BSS.
3033 (Orphan_section_placement::Orphan_section_placement): Initialize
3034 new places.
3035 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3036 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3037 (tls_script_test_SOURCES): Define.
3038 (tls_script_test_DEPENDENCIES): Define.
3039 (tls_script_test_LDFLAGS): Define.
3040 (tls_script_test_LDADD): Define.
3041 * testsuite/Makefile.in: Rebuild.
3042
a2c7281b
DK
30432010-03-22 Doug Kwan <dougkwan@google.com>
3044
3045 * arm.cc (Arm_relocate_functions::abs8,
3046 Arm_relocate_functions::abs16): Use correct check for overflow
3047 specified in the ARM ELF specs.
3048 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3049 target of a BLX instruction specially.
3050 (Reloc_stub::stub_type_for_reloc): Ditto.
3051 (Relocate::relocate): Use symbolic names instead of numeric relocation
3052 codes to report error.
3053 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3054 workaround.
3055 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3056 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3057 thumb2_blx_out_of_range.stdout
3058 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3059 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3060 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3061 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3062 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3063 thumb2_blx_in_range, thumb2_blx_in_range.o,
3064 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3065 thumb2_blx_out_of_range.o): New rules.
3066 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3067 thumb2_blx_in_range and thumb2_blx_out_of_range.
3068 * testsuite/Makefile.in: Regenerate.
3069 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3070 * testsuite/thumb_blx_in_range.s: New file.
3071 * testsuite/thumb_blx_out_of_range.s: New file.
3072
b0193076
RÁE
30732010-03-22 Rafael Espindola <espindola@google.com>
3074
3075 * archive.cc (Should_include): Move to archive.h.
3076 (should_include_member): Make it a member of Archive.
3077 (Lib_group): New.
3078 (Add_lib_group_symbols): New.
3079 * archive.h: Include options.h.
3080 (Archive_member): Moved from Archive.
3081 (Should_include): Moved from archive.cc.
3082 (Lib_group): New.
3083 (Add_lib_group_symbols): New.
3084 * dynobj.cc (do_should_include_member): New.
3085 * dynobj.h (do_should_include_member): New.
3086 * gold.cc (queue_initial_tasks): Update call to queue.
3087 * main.cc (main): Print lib group stats.
3088 * object.cc (do_should_include_member): New.
3089 * object.h: Include archive.h.
3090 (Object::should_include_member): New.
3091 (Object::do_should_include_member): New.
3092 (Sized_relobj::do_should_include_member): New.
3093 * options.cc (General_options::parse_start_lib): New.
3094 (General_options::parse_end_lib): New.
3095 (Input_arguments::add_file): Handle lib groups.
3096 (Input_arguments::start_group): Check we are not in a lib.
3097 (Input_arguments::start_lib): New.
3098 (Input_arguments::end_lib): New.
3099 * options.h (General_options): Add start_lib and end_lib.
3100 (Input_argument::lib_): New.
3101 (Input_argument::lib): New.
3102 (Input_argument::is_lib): New.
3103 (Input_file_lib): New.
3104 (Input_arguments::in_lib_): New.
3105 (Input_arguments::in_lib): New.
3106 (Input_arguments::start_lib): New.
3107 (Input_arguments::end_lib_): New.
3108 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3109 in unused members as preempted.
3110 (Sized_pluginobj::do_should_include_member): New.
3111 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3112 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3113 return the blocker.
3114 (Read_symbols::do_whole_lib_group): New.
3115 (Read_symbols::do_lib_group): New.
3116 (Read_symbols::do_read_symbols): Handle lib groups.
3117 (Read_symbols::get_name): Handle lib groups.
3118 * readsyms.h (Read_symbols): Add an archive member pointer.
3119 (Read_symbols::do_whole_lib_group): New.
3120 (Read_symbols::do_lib_group): New.
3121 (Read_symbols::member_): New.
3122 * script.cc (read_input_script): Update call to queue_soon.
3123
d099120c
DK
31242010-03-19 Doug Kwan <dougkwan@google.com>
3125
3126 * arm.cc (Stub_table::Stub_table): Initialize new data members
3127 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3128 (Stub_table::add_reloc_stub): Assign stub offset and update
3129 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3130 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3131 New data members.
3132 (Stub_table::update_data_size_and_addralign): Use
3133 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3134 instead of going over all reloc stubs.
3135 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3136 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3137 Stringpool_template::offset_ to size of Stringpool_char.
3138 (Stringpool_template::new_key_offset): Remove code to initialize
3139 Stringpool_template::offset_.
3140 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3141 Stringpool_template::offset_ to zero.
3142
1aa37384
DK
31432010-03-15 Doug Kwan <dougkwan@google.com>
3144
3145 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3146 offset_.
3147 (Stringpool_template::new_key_offset): New method.
3148 (Stringpool_template::add_string): Assign offsets when adding new
3149 strings.
3150 (Stringpool_template::set_string_offsets): Do not set string offsets
3151 when not optimizing.
3152 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3153 member size_.
3154 (Chunked_vector::clear): Clear size_.
3155 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3156 (Chunked_vector::size): Return size_.
3157 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3158 (Chunked_vector::size_): New data member.
1aa37384
DK
3159 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3160 (Stringpool_template::new_key_offset): New method declaration.
3161 (Stringpool_template::offset_): New data member.
3162
b672b057
RÁE
31632010-03-15 Rafael Espindola <espindola@google.com>
3164
3165 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3166 Add_symbols' constructor.
3167 * readsyms.h (Add_symbols): Remove the input_group member.
3168
b6848d3c
ILT
31692010-03-10 Ian Lance Taylor <iant@google.com>
3170
3171 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3172 target to ask whether a reference to a symbol requires a stack
3173 split.
3174 * target.h (Target::is_call_to_non_split): New function.
3175 (Target::do_is_call_to_non_split): Declare virtual function.
3176 * target.cc: Include "symtab.h".
3177 (Target::do_is_call_to_non_split): New function.
3178 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3179
a2a5469e
CC
31802010-03-10 Cary Coutant <ccoutant@google.com>
3181
3182 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3183 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3184 (File_read::open[2]): Add whole_file_view_ to list of views.
3185 (File_read::make_view): Remove test of whole_file_view_.
3186 (File_read::find_or_make_view): Create whole_file_view_ if
3187 necessary.
3188 (File_read::clear_views): Replace bool parameter with enum;
3189 adjust all callers. Don't delete views with permanent data;
3190 do delete cached views and views from archives if
3191 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3192 if clearing the corresponding view.
3193 * fileread.h (File_read::Clear_views_mode): New enum.
3194 (File_read::View::is_permanent_view): New method.
3195 (File_read::clear_views): Replace bool parameter
3196 with enum; adjust all callers.
3197 * options.h (General_options): Change keep_files_mapped option;
3198 add map_whole_files.
3199 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3200 releasing the file.
3201 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3202 the file.
3203
8861f32b
DM
32042010-03-10 David S. Miller <davem@davemloft.net>
3205
3206 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
3207
d62d0f5f
ST
32082010-03-09 Sriraman Tallam <tmsriram@google.com>
3209
3210 * icf.cc (get_section_contents): Add '@' marker after processing the
3211 merge reloc.
3212
9177756d
DK
32132010-03-08 Doug Kwan <dougkwan@google.com>
3214
3215 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
3216 due to a conversion warning.
3217 (Arm_relobj::update_output_local_symbol_count): Check for local
3218 symbol with unset output index.
3219
9e9e071b
ILT
32202010-03-05 Ian Lance Taylor <iant@google.com>
3221
3222 * options.h (class General_options): Add --spare-dynamic-tags.
3223 * output.cc (Output_data_dynamic::set_final_data_size): Implement
3224 --spare-dynamic-tags.
3225
a81ee015
ILT
32262010-03-05 Ian Lance Taylor <iant@google.com>
3227
3228 * incremental.cc: Include "libiberty.h".
3229
44ec90b9
RO
32302010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3231
3232 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
3233 function, is_info_ member.
3234 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
3235 (Versions::Versions): Update caller.
3236 (Versions::define_base_version): Likewise.
3237 (Versions::add_def): Likewise.
3238
0897ed3b
ST
32392010-03-03 Sriraman Tallam <tmsriram@google.com>
3240
3241 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
3242 (Scan::possible_function_pointer_reloc): New function.
3243 (Scan::local_reloc_may_be_function_pointer): Change to call
3244 possible_function_pointer_reloc.
3245 (Scan::global_reloc_may_be_function_pointer): Ditto.
3246 * icf.h (Icf::check_section_for_function_pointers): Change to reject
3247 relocations in ".data.rel.ro._ZTV" section.
3248 * testsuite/icf_safe_so_test.sh: Change to pass i386.
3249 * testsuite/icf_safe_so_test.cc: Ditto.
3250 * testsuite/icf_safe_test.cc: Ditto.
3251 * testsuite/icf_safe_test.sh: Ditto.
3252
d3bbad62
ILT
32532010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3254 Ian Lance Taylor <iant@google.com>
3255
3256 * target-reloc.h (relocate_section): Check the symbol table index
3257 for -1U before setting the local symbol index.
3258 (scan_relocatable_relocs): If copying the relocation, record that
3259 the local symbol is required.
3260 * object.h (Symbol_value::is_output_symtab_index_set): New
3261 function.
3262 (Symbol_value::may_be_discarded_from_output_symtab): New
3263 function.
3264 (Symbol_value::has_output_symtab_entry): New function.
3265 (Symbol_value::needs_output_symtab_entry): Remove.
3266 (Symbol_value::output_symtab_index): Make sure the symbol index is
3267 set.
3268 (Symbol_value::set_output_symtab_index): Make sure the symbol
3269 index is not set. Make sure the new index is valid.
3270 (Symbol_value::set_must_have_output_symtab_entry): New function.
3271 (Symbol_value::has_output_dynsym_entry): New function.
3272 (Symbol_value::set_output_dynsym_index): Make sure the new index
3273 is valid.
3274 (Sized_relobj::set_must_have_output_symtab_entry): New function.
3275 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
3276 local symbol if permitted.
3277 (Sized_relobj::do_finalize_local_symbols): Call
3278 is_output_symtab_index_set rather than needs_output_symtab_entry.
3279 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
3280 rather than needs_output_symtab_entry. Call
3281 has_output_dynsym_entry rather than needs_output_dynsym_entry.
3282 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
3283 is_output_symtab_index_set rather than needs_output_symtab_entry.
3284 * testsuite/discard_locals_relocatable_test.c: New file.
3285 * testsuite/discard_locals_test.sh: Test -r.
3286 * testsuite/Makefile.am (check_DATA): Add
3287 discard_locals_relocatable_test1.syms,
3288 discard_local_relocatable_test2.syms.
3289 (MOSTLYCLEANFILES): Likewise. Also add
3290 discard_locals_relocatable_test1.lout and
3291 discard_locals_relocatable_test2.out.
3292 (discard_locals_relocatable_test1.syms): New target.
3293 (discard_locals_relocatable_test.o): New target.
3294 (discard_locals_relocatable_test1.out): New target.
3295 (discard_locals_relocatable_test2.syms): New target.
3296 (discard_locals_relocatable_test2.out): New target.
3297 (various): Add missing ../ld-new dependencies.
3298 * testsuite/Makefile.in: Rebuild.
3299
7e8ccf26
NC
33002010-03-03 Nick Clifton <nickc@redhat.com>
3301
3302 * po/fi.po: New Finnish translation.
3303
2a0ff005
DK
33042010-03-01 Doug Kwan <dougkwan@google.com>
3305
3306 * layout.cc (Layout::Layout): Force section types of .init_array*,
3307 .preinit_array* and .fini_array* sections.
3308 * output.cc (Output_section::Input_section_sort_entry::has_priority):
3309 Fix check of return value of std::string::find.().
3310 (Output_section::Input_section_sort_compare::operator()): Remove
3311 comment about .init_array.
3312 (Output_section::Input_section_sort_init_fini_compare::operator()):
3313 New method.
3314 (Output_section::sort_attached_input_sections): Handle .init_array
3315 and .fini_array specially.
3316 * output.h (Output_section::Inut_section_sort_compare): Update
3317 comment.
3318 (Output_section::Input_section_sort_init_fini_compare): New struct.
3319
c3e4ae29
DK
33202010-02-26 Doug Kwan <dougkwan@google.com>
3321
3322 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
3323 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
3324 * testsuite/debug_msg.sh: Avoid matching source line number for
3325 use of global variable undef_int.
3326
2fd9ae7a
DK
33272010-02-26 Doug Kwan <dougkwan@google.com>
3328
3329 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
3330 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
3331 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
3332 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
3333 * options.cc (General_options::General_options): Initialize member
3334 fix_v4bx_.
3335 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
3336 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
3337 and rm_no_fix_v4bx.stdout
3338 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
3339 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
3340 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
3341 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
3342 and arm_no_fix_v4bx.
3343 * Makefile.in: Regenerate.
3344 * testsuite/arm_fix_v4bx.s: New file.
3345 * testsuite/arm_fix_v4bx.sh: Ditto.
3346
67ec7d0b
DK
33472010-02-24 Doug Kwan <dougkwan@google.com>
3348
3349 * arm.cc (Target_arm::got_section): Make the .got section the first
3350 non RELRO section in the data segment.
3351 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
3352 suffixes of section names.
3353
10165461
DK
33542010-02-24 Doug Kwan <dougkwan@google.com>
3355
3356 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
3357 flags and attributes merging if an input file is a binary file.
3358 * fileread.cc (Input_file::open): Record format of original file.
3359 * fileread.h (Input_file::Format): New enum type.
3360 (Input_file::Input_file): Initialize data member format_.
3361 (Input_file::format): New method definition.
3362 (Input_file::format_):: New data member.
3363
4a54abbb
DK
33642010-02-24 Doug Kwan <dougkwan@google.com>
3365
3366 * arm.cc (Arm_output_data_got): New class.
3367 (ARM_TCB_SIZE): New constant
3368 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
3369 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
3370 If user uses a script with a SECTIONS clause, issue only a warning
3371 for a misplaced EXIDX input section. Otherwise, issue an error.
3372 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
3373 garbage collection.
3374 (Target_arm::got_mode_index_entry): Handle static linking.
3375 (Target_arm::Scan::local): Ditto.
3376 (Target_arm::Scan::global): Ditto.
3377 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
3378 all incorrectly implemented relocations.
e1df38aa 3379 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
3380 Arm_output_section::fix_exidx_coverage.
3381 * layout.cc (Layout::section_name_mapping): Remove trailing dots
3382 from ".ARM.exidx." and ".ARM.extab.".
3383
ca419a6f
ILT
33842010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3385
3386 * arm.cc (Target_arm::do_finalize_sections): Create attribute
3387 section if it does not already exist.
3388 * attributes.cc (Attributes_section_data::Attributes_section_data):
3389 Don't crash if size is zero.
3390
135b9c78
ILT
33912010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3392 Ian Lance Taylor <iant@google.com>
3393
3394 * gold.cc (queue_middle_tasks): If no input files were opened,
3395 exit.
3396 * workqueue.h (Task_function::Task_function): Assert that there is
3397 a blocker.
3398
bb0bfe4f
DK
33992010-02-22 Doug Kwan <dougkwan@google.com>
3400
3401 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
3402 * icf.cc (get_section_contents): Cast snprintf arguments to long long
3403 types to avoid warnings due to different uint64_t implementations
3404 on different hosts.
3405
2a2b6d42
DK
34062010-02-21 Doug Kwan <dougkwan@google.com>
3407
3408 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
3409 handling of the maximum backward branch offset.
3410 (Arm_relocate_functions::thumb_branch_common): Ditto.
3411 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
3412 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 3413 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
3414 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
3415 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
3416 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
3417 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
3418 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
3419 thumb_bl_out_of_range thumb_bl_out_of_range.o,
3420 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
3421 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
3422 thumb2_bl_out_of_range.o): New rules.
3423 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
3424 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
3425 thumb2_bl_out_of_range
3426 * testsuite/Makefile.in: Regenerate.
3427 * testsuite/arm_bl_in_range.s: New file.
3428 * testsuite/arm_bl_out_of_range.s: Ditto.
3429 * testsuite/arm_branch_in_range.sh: Ditto.
3430 * testsuite/arm_branch_range.t: Ditto.
3431 * testsuite/thumb2_branch_range.t: Ditto.
3432 * testsuite/thumb_bl_in_range.s: Ditto.
3433 * testsuite/thumb_bl_out_of_range.s: Ditto.
3434 * testsuite/thumb_branch_range.t: Ditto.
3435
b487ad64
ST
34362010-02-20 Sriraman Tallam <tmsriram@google.com>
3437
3438 * gc.h (gc_process_relocs): Change vectors to point to the new list.
3439 Add reloc offset information.
3440 * icf.cc (get_section_contents): Change iterators to point to the new
3441 vectors. Add reloc offset information to the contents.
3442 * icf.h (Icf::Sections_reachable_info): New typedef.
3443 (Icf::Sections_reachable_list): New typedef.
3444 (Icf::Offset_info): New typedef.
3445 (Icf::Reloc_info): New struct typedef.
3446 (Icf::Reloc_info_list): New typedef.
3447 (Icf::symbol_reloc_list): Delete method.
3448 (Icf::addend_reloc_list): Delete method.
3449 (Icf::section_reloc_list): Delete method.
3450 (Icf::reloc_info_list): New method.
3451 (Icf::reloc_info_list_): New member.
3452
f96accdf
DK
34532010-02-19 Doug Kwan <dougkwan@google.com>
3454
3455 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
3456 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
3457 * arm.cc (Arm_relocation_functions): New forward declaration.
3458 (Target_arm::Target_arm): Initialize new data members
3459 got_mod_index_offset_ and tls_base_symbol_defined_.
3460 (Target_arm::Relocate::relocate_tls): New method.
3461 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
3462 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
3463 New methods.
3464 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
3465 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
3466 (Target_arm::got_mod_index_offset_,
3467 Target_arm::tls_base_symbol_defined_): New data members.
3468 (Target_arm::Scan::local, Target::Scan::global,
3469 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
3470 relocations.
3471
c8761b9a
DK
34722010-02-18 Doug Kwan <dougkwan@google.com>
3473
3474 * arm.cc (Arm_relobj::find_linked_text_section): New method.
3475 (Arm_relobj::make_exidx_input_section): Pass section index of linked
3476 text section as a parameter becuase some broken tools may not set
3477 the link in section header.
3478 (Target_arm::has_got_section): New method.
3479 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
3480 without any mapping symbol as data only. Remove warning.
3481 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
3482 link in its section header, try to discover the link by inspecting the
3483 REL31 relocation at the beginning of the section.
3484 (Target_arm::Scan::check_non_pic): Report name of offending relocation
3485 in error message.
3486 (Target_arm::Scan::global): Treat any reference to the symbol
3487 _GLOBAL_OFFSET_TABLE_ as a GOT access.
3488
21bb3914
ST
34892010-02-12 Sriraman Tallam <tmsriram@google.com>
3490
3491 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
3492 (Scan::global_reloc_may_be_function_pointer): New function.
3493 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3494 (Scan::global_reloc_may_be_function_pointer): New function.
3495 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3496 (Scan::global_reloc_may_be_function_pointer): New function.
3497 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
3498 (Scan::global_reloc_may_be_function_pointer): New function.
3499 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
3500 (Scan::global_reloc_may_be_function_pointer): New function.
3501 (Scan::possible_function_pointer_reloc): New function.
3502 (Target_x86_64::can_check_for_function_pointers): New function.
3503 * gc.h (gc_process_relocs): Scan relocation types to determine if
3504 function pointers were taken for targets that support it.
3505 * icf.cc (Icf::find_identical_sections): Include functions for
3506 folding in safe ICF whose pointer is not taken.
3507 * icf.h (Secn_fptr_taken_set): New typedef.
3508 (fptr_section_id_): New member.
3509 (section_has_function_pointers): New function.
3510 (set_section_has_function_pointers): New function.
3511 (check_section_for_function_pointers): New function.
3512 * options.h: Fix comment for safe ICF option.
3513 * target.h (can_check_for_function_pointers): New function.
3514 * testsuite/Makefile.am: Add icf_safe_so_test test case.
3515 Modify icf_safe_test for X86-64.
3516 * testsuite/Makefile.in: Regenerate.
3517 * testsuite/icf_safe_so_test.cc: New file.
3518 * testsuite/icf_safe_so_test.sh: New file.
3519 * testsuite/icf_safe_test.cc (kept_func_3): New function.
3520 (main): Change to take pointer to function kept_func_3.
3521 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
3522 folding is done correctly for X86-64.
3523
0da6fa6c
DM
35242010-02-12 David S. Miller <davem@davemloft.net>
3525
3526 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
3527 is_symbolless parameter.
3528 (Output_reloc<SHT_REL>::is_symbolless): New.
3529 (Output_reloc<SHT_REL>::is_symbolless_): New.
3530 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
3531 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
3532 (Output_reloc<SHT_RELA>::is_symbolless): New.
3533 (Output_data_reloc::add_global): Handle is_symbolless.
3534 (Output_data_reloc::add_global_relative): Likewise.
3535 (Output_data_reloc::add_local): Likewise.
3536 (Output_data_reloc::add_local_relative): Likewise.
3537 (Output_data_reloc::add_symbolless_global_addend): New.
3538 (Output_data_reloc::add_symbolless_local_addend): New.
3539 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
3540 is_symbolless.
3541 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
3542 instead of ->is_relative_
3543 (Output_reloc::write): Likewise.
3544 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
3545 (Output_reloc::write_rel): Simplify.
3546
3547 * sparc.cc (Target_sparc::Scan::local): Use
3548 ->add_symbolless_local_addend as needed.
3549 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
3550 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
3551 based upon relocation offset.
3552
e4782e83
DK
35532010-02-11 Doug Kwan <dougkwan@google.com>
3554
3555 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
3556 (Target_arm::Scan::global): Ditto. Also remove a comment before the
3557 beginning of function.
3558 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
3559 and MOVT_ABS relocations. Those are non issued in scanning. Fix
3560 parameter is_32bit in calls to should_apply_static_reloc.
3561 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
3562 (check_DATA): Add arm_abs_global.stdout.
3563 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
3564 arm_abs_global.stdout): New rules.
3565 (MOSTLLYCLEANFILES): Add arm_abs_global
3566 * Makefile.in: Regenerate.
3567 * testsuite/arm_abs_global.s: New file.
3568 * testsuite/arm_abs_global.sh: Ditto.
3569 * testsuite/arm_abs_lib.s: Ditto.
3570
93ceb764
ILT
35712010-02-11 Ian Lance Taylor <iant@google.com>
3572
3573 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
3574 Read_relocs task.
3575 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
3576 Allocate_commons_task first.
3577 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
3578 task, rather than symtab_lock_.
3579 (Gc_process_relocs::~Gc_process_relocs): New function.
3580 (Gc_process_relocs::is_runnable): Check this_blocker_.
3581 (Gc_process_relocs::locks): Use next_blocker_ rather than
3582 blocker_.
3583 (Scan_relocs::~Scan_relocs): New function.
3584 (Scan_relocs::is_runnable): Check this_blocker_ rather than
3585 symtab_lock_.
3586 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
3587 next_blocker_.
3588 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
3589 fields. Add this_blocker_ and next_blocker_ fields. Adjust
3590 constructor accordingly.
3591 (class Gc_process_relocs): Likewise.
3592 (class Scan_relocs): Likewise.
3593 * common.h (class Allocate_commons_task): Remove symtab_lock_
3594 field, and corresponding constructor parameter.
3595 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
3596 symtab_lock_.
3597 (Allocate_commons_task::locks): Likewise.
3598
114dfbe1
ILT
35992010-02-11 Ian Lance Taylor <iant@google.com>
3600
3601 * gold-threads.h (class Once): Define.
3602 (class Initialize_lock): Rewrite as child of Once.
3603 * gold-threads.cc (class Once_initialize): Define.
3604 (once_pointer_control): New static variable.
3605 (once_pointer, once_arg): New static variables.
3606 (c_run_once): New static function.
3607 (Once::Once, Once::run_once, Once::internal_run): New functions.
3608 (class Initialize_lock_once): Remove.
3609 (initialize_lock_control): Remove.
3610 (initialize_lock_pointer): Remove.
3611 (initialize_lock_once): Remove.
3612 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
3613 (Initialize_lock::initialize): Rewrite.
3614 (Initialize_lock::do_run_once): New function.
3615 * archive.cc (Archive::interpret_header): Only clear name if it is
3616 not already empty.
3617 * fileread.cc: Include "gold-threads.h"
3618 (file_counts_lock): New static variable.
3619 (file_counts_initialize_lock): Likewise.
3620 (File_read::release): Only increment counts when using --stats.
3621 Use a lock around the increment.
3622 * parameters.cc (class Set_parameters_target_once): Define.
3623 (set_parameters_target_once): New static variable.
3624 (Parameters::Parameters): Move here from parameters.h.
3625 (Parameters::set_target): Rewrite.
3626 (Parameters::set_target_once): New function.
3627 (Parameters::clear_target): Move here and rewrite.
3628 * parameters.h (class Parameters): Update declarations. Add
3629 set_parameters_target_once_ field.
3630 (Parameters::Parameters): Move to parameters.cc.
3631 (Parameters::clear_target): Likewise.
3632 * readsyms.cc (Read_symbols::do_group): Create a Start_group
3633 task.
3634 (Start_group::~Start_group): New function.
3635 (Start_group::is_runnable): New function.
3636 (Start_group::locks, Start_group::run): New functions.
3637 (Finish_group::run): Change saw_undefined to size_t.
3638 * readsyms.h (class Start_group): Define.
3639 (class Finish_group): Change saw_undefined_ field to size_t.
3640 (Finish_group::Finish_group): Remove saw_undefined and
3641 this_blocker parameters. Change all callers.
3642 (Finish_group::set_saw_undefined): New function.
3643 (Finish_group::set_blocker): New function.
3644 * symtab.h (class Symbol_table): Change saw_undefined to return
3645 size_t. Change saw_undefined_ field to size_t.
3646 * target-select.cc (Set_target_once::do_run_once): New function.
3647 (Target_selector::Target_selector): Initialize set_target_once_
3648 field. Don't initialize lock_ and initialize_lock_ fields.
3649 (Target_selector::instantiate_target): Rewrite.
3650 (Target_selector::set_target): New function.
3651 * target-select.h (class Set_target_once): Define.
3652 (class Target_selector): Update declarations. Make
3653 Set_target_once a friend. Remove lock_ and initialize_lock_
3654 fields. Add set_target_once_ field.
3655
fa17a3f4
ILT
36562010-02-10 Ian Lance Taylor <iant@google.com>
3657
3658 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
3659 queueing any tasks.
3660 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
3661 (queue_middle_tasks): Add all blockers before queueing any tasks.
3662 (queue_final_tasks): Likewise.
3663 * token.h (Task_token::add_blockers): New function.
3664 * object.h (Input_objects::number_of_relobjs): New function.
3665
c7177d31
ILT
36662010-02-10 Ian Lance Taylor <iant@google.com>
3667
5de0e392
ILT
3668 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
3669 shared, not if not position independent.
3670 * x86_64.cc (Relocate::relocate_tls): Likewise.
3671 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
3672 (tls_pie_pic_test): New target.
3673 * testsuite/Makefile.in: Rebuild.
3674
c7177d31
ILT
3675 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
3676 (tls_test_main_pie.o, tls_test_pie.o): New targets.
3677 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
3678 * testsuite/Makefile.in: Rebuild.
3679
684b268a
DM
36802010-02-09 David S. Miller <davem@davemloft.net>
3681
3682 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
3683 R_SPARC_RELATIVE using ->add_local_relative().
3684 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
3685
612a8d3d
DM
3686 * output.h (Output_data_dynamic::add_section_size): New method
3687 that takes two Output_data objects.
3688 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
3689 entry param. Handle it in initializers.
3690 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
3691 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
3692 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
3693 arg.
3694 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
3695 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
3696 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
3697 for dynrel_includes_plt.
3698 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3699 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3700 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
3701 before .rela.plt
3702 (Target_sparc::do_finalize_sections): Update to pass true for
3703 dynrel_includes_plt.
3704 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
3705 output before .rela.plt
3706 (Target_powerpc::do_finalize_sections): Update to pass true for
3707 dynrel_includes_plt when 32-bit.
3708
cb1be87e
DK
37092010-02-08 Doug Kwan <dougkwan@google.com>
3710
3711 * arm.cc (Arm_relobj::simple_input_section_output_address): New
3712 method.
3713 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
3714 Arm_relobj::scan_section_for_cortex_a8_stubs,
3715 Arm_relobj::do_relocation_section): Instead of calling
3716 Output_section::output_address, use faster
3717 Arm_relobj::simple_input_section_output_address.
3718
705b5121
DM
37192010-02-08 David S. Miller <davem@davemloft.net>
3720
3721 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
3722 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
3723 relocation helper function.
3724
024c4466
DM
3725 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
3726 just like R_SPARC_GOT{10,13,22}.
3727 (Target_sparc::Scan::local): Likewise.
3728 (Target_sparc::Relocate:relocate): Likewise.
3729
9109c078
ILT
37302010-02-06 Ian Lance Taylor <iant@google.com>
3731
3732 * configure.ac: Rewrite targetobjs duplicate removal code to use
3733 only shell constructs.
3734 * configure: Rebuild.
3735
cf846138
DK
37362010-02-05 Doug Kwan <dougkwan@google.com>
3737
3738 PR 11247
3739 * arm.cc (Arm_relobj::section_is_scannable): New method.
3740 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
3741 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
3742
6cfaf60b
DK
37432010-02-04 Doug Kwan <dougkwan@google.com>
3744
3745 PR 11247
3746 * arm-reloc-property.cc (cstdio): Include.
3747 * configure.ac (targetobjs): Remove duplicates.
3748 * configure: Regenerate.
3749 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
3750 big and little endian version for a given address size.
3751
5c57f1be
DK
37522010-02-03 Doug Kwan <dougkwan@google.com>
3753
3754 * arm-reloc-property.cc
3755 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3756 definition.
3757 * arm-reloc-property.h
3758 (Arm_reloc_property_table::get_implemented_static_reloc_property):
3759 New method definition.
3760 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3761 declaration.
3762 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
3763 overflow to N.
3764 (GOT_PREL): Change implemented to Y.
3765 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
3766 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
3767 (Arm_relocate_functions::movw_abs_nc): Remove method.
3768 (Arm_relocate_functions::movt_abs): Ditto.
3769 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
3770 (Arm_relocate_functions::thm_movt_abs): Ditto.
3771 (Arm_relocate_functions::movw_rel_nc): Ditto.
3772 (Arm_relocate_functions::movw_rel): Ditto.
3773 (Arm_relocate_functions::movt_rel): Ditto.
3774 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
3775 (Arm_relocate_functions:thm_movw_rel): Ditto.
3776 (Arm_relocate_functions:thm_movt_rel): Ditto.
3777 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
3778 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
3779 New method definitions.
3780 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
3781 (Arm_relocation_functions::arm_grp_ldr): Ditto.
3782 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
3783 (Arm_relocation_functions::arm_grp_ldc): Ditto.
3784 (Target_arm::Relocate::relocate): Check for non-static or
3785 unimplemented relocation code and exit early. Change calls to
3786 Target_arm::reloc_uses_thumb_bit and
3787 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
3788 instead. Refactor code to handle similar relocations to increase
3789 code sharing. Remove check for unsupported relocation code in switch
3790 statement.
3791 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
3792 relocation property table to find out size. Change error message to
3793 print out the name of a relocation code instead of the numeric value.
3794 (Target_arm::scan_reloc_for_stub): Use relocation property table
3795 instead of calling Target_arm::reloc_uses_thumb_bit().
3796
218c5831
DK
37972010-02-02 Doug Kwan <dougkwan@google.com>
3798
3799 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
3800 types of relaxed input section.
3801
0d31c79d
DK
38022010-02-02 Doug Kwan <dougkwan@google.com>
3803
3804 * Makefile.am (HFILES): Add arm-reloc-property.h.
3805 (DEFFILES): New.
3806 (TARGETSOURCES): Add arm-reloc-property.cc
3807 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
3808 (libgold_a_SOURCES): $(DEFFILES)
3809 * Makefile.in: Regenerate.
3810 * arm-reloc-property.cc: New file.
3811 * arm-reloc-property.h: New file.
3812 * arm-reloc.def: New file.
3813 * arm.cc: Update comments.
3814 (arm-reloc-property.h): New included header.
3815 (arm_reloc_property_table): New global variable.
3816 (Target_arm::do_select_as_default_target): New method definition.
3817 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
3818 arm-reloc-property to targ_extra_obj.
3819 * parameters.cc (set_parameters_target): Call
3820 Target::select_as_default_target().
3821 * target.h (Target::select_as_default_target): New method definition.
3822 (Target::do_select_as_default_target): Same.
3823
546c7457
DK
38242010-02-01 Doug Kwan <dougkwan@google.com>
3825
3826 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
3827 first_output_text_section_.
3828 (Arm_exidx_fixup::first_output_text_section): New method definition.
3829 (Arm_exidx_fixup::first_output_text_section_): New data member.
3830 (Arm_exidx_fixup::process_exidx_section): Record the first text
3831 output section seen.
3832 (Arm_output_section::fix_exidx_coverage): Set correct linked section
3833 and entsize in output section header.
3834
11b861d5
DK
38352010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3836
3837 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
3838 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
3839 (Arm_relocate_functions::thm_alu11): New Method.
3840 (Arm_relocate_functions::thm_pc8): New Method.
3841 (Arm_relocate_functions::thm_pc12): New Method.
3842 (Target_arm::Scan::local): Handle the relocations.
3843 (Target_arm::Scan::global): Likewise.
3844 (Target_arm::Relocate::relocate): Likewise.
3845 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
3846
c9a2c125
DK
38472010-01-29 Doug Kwan <dougkwan@google.com>
3848
3849 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
3850 of relocation types as ld.
3851
1521477a
DK
38522010-01-29 Doug Kwan <dougkwan@google.com>
3853
3854 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
3855 to public.
3856 (Arm_relocate_functions::thumb_branch_common): Ditto.
3857 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
3858 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
3859 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
3860 Arm_relocate_functions::jump24): Remove.
3861 (Target_arm::Relocate::relocate): Adjust code to call
3862 Arm_relocation_functions::arm_branch_common and
3863 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 3864 wrappers. Merge switch-cases together to reduce source code size.
1521477a 3865
e7eca48c
DK
38662010-01-29 Doug Kwan <dougkwan@google.com>
3867
3868 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
3869 output_local_symbol_count_needs_update_.
3870 (Arm_relobj::output_local_symbol_count_needs_update,
3871 Arm_relobj::set_output_local_symbol_count_needs_update,
3872 Arm_relobj::update_output_local_symbol_count): New methods.
3873 (Arm_relobj::output_local_symbol_count_needs_update_): New data
3874 member.
3875 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
3876 of pointed function as in a R_ARM_PREL31 relocation.
3877 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
3878 for output local symbol count updating.
3879 (Target_arm::do_relax): Update output local symbol counts in objects
3880 if necessary.
3881 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
3882
02961d7e
ILT
38832010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3884
3885 * arm.cc: Added support for the ARM relocations:
3886 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
3887 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
3888 (Arm_relocate_functions::movw_rel_nc): Renamed (was
3889 movw_prel_nc).
3890 (Arm_relocate_functions::movw_rel): New method.
3891 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
3892 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
3893 thm_movw_prel_nc).
3894 (Arm_relocate_functions::thm_movw_rel): New method.
3895 (Arm_relocate_functions::thm_movt_rel): Renamed (was
3896 thm_movt_prel).
3897 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
3898 relocations.
3899 (Target_arm::Scan::global): Likewise.
3900 (Target_arm::Relocate::relocate): Likewise.
3901 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3902 Likewise.
3903
b10d2873
ILT
39042010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3905
3906 * arm.cc: Added support for ARM group relocations.
3907 (Target_arm::reloc_needs_sym_origin): New method.
3908 (Arm_relocate_functions::calc_grp_kn): New method.
3909 (Arm_relocate_functions::calc_grp_residual): New method.
3910 (Arm_relocate_functions::calc_grp_gn): New method.
3911 (Arm_relocate_functions::arm_grp_alu): New Method.
3912 (Arm_relocate_functions::arm_grp_ldr): New Method.
3913 (Arm_relocate_functions::arm_grp_ldrs): New Method.
3914 (Arm_relocate_functions::arm_grp_ldc): New Method.
3915 (Target_arm::Scan::local): Handle the ARM group relocations.
3916 (Target_arm::Scan::global): Likewise.
3917 (Target_arm::Relocate::relocate): Likewise.
3918 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3919 Likewise.
3920
2b328d4e
DK
39212010-01-26 Doug Kwan <dougkwan@google.com>
3922
3923 * arm.cc (set): Include.
3924 (class Arm_exidx_fixup): Change type of last_input_section_ to const
3925 pointer type.
3926 (Arm_output_section::Text_section_list): New type.
3927 (Arm_output_section::append_text_sections_to_list): New method.
3928 (Arm_output_section::fix_exidx_coverage): Ditto.
3929 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
3930 (Arm_relobj::convert_input_section_to_relaxed_section): Use
3931 Relobj::set_section_offset() instead of
3932 Sized_relobj::invalidate_section_offset().
3933 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
3934 parameter for section headers. Ignore relocation sections for
3935 unallocated sections and EXIDX sections.
3936 (Target_arm::fix_exidx_coverage): New method.
3937 (Target_arm::output_section_address_less_than): New type.
3938 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
3939 linked text section instead of the EXIDX section.
3940 (Arm_output_section::create_stub_group): Add an assertion to check
3941 that this is not an EXIDX output section.
3942 (Arm_output_section::append_text_sections_to_list): New method.
3943 (Arm_output_section::fix_exidx_coverage): Ditto.
3944 (Arm_relobj::scan_sections_for_stubs): Adjust call to
3945 Arm_relobj::section_needs_reloc_stub_scanning.
3946 (Target_arm::do_relax): Fix EXIDX output section coverage in the
3947 first pass.
3948 (Target_arm::fix_exidx_coverage): New method.
3949 * object.h (Relobj::set_output_section): New method.
3950 (Sized_relobj::invalidate_section_offset): Remove method.
3951 (Sized_relobj::do_invalidate_section_offset): Remove method.
3952 (Sized_relobj::do_set_section_offset): Handle offset value -1.
3953
c7f3c371
DK
39542010-01-25 Doug Kwan <dougkwan@google.com>
3955
3956 * arm.cc (Arm_exidx_merged_section::do_output_offset):
3957 Fix warning due to signed and unsigned comparison on a 32-bit host.
3958
8923b24c
DK
39592010-01-22 Doug Kwan <dougkwan@google.com>
3960
3961 * arm.cc (Target_arm::do_relax): Record an output section for section
3962 offset adjustment it contains any stub table that has changed.
3963 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
3964 offsets in an output section if necessary.
3965 * output.cc (Output_section::Output_section): Initialize
3966 section_offsets_need_adjustments_.
3967 (Output_section::add_input_section_for_script): Renamed to
3968 Output_section::add_simple_input_section.
3969 (Output_section::save_states): Add a comment.
3970 (Output_section::discard_states): New method defintion.
3971 (Output_section::adjust_section_offsets): Same.
3972 * output.h (Output_section::add_input_section_for_script): Renamed to
3973 Output_section::add_simple_input_section.
3974 (Output_section::discard_states): New method declaration.
3975 (Output_section::adjust_section_offsets): Same.
3976 (Output_section::section_offsets_need_adjustment,
3977 Output_section::set_section_offsets_need_adjustment): New method
3978 definitions.
3979 (Output_section::section_offsets_need_adjustment_): New data member.
3980 * script-sections.cc
3981 (Output_section_element_input::set_section_address): Adjust code for
3982 renaming of Output_section::add_input_section_for_script.
3983 (Orphan_output_section::set_section_address): Same.
3984
9b2fd367
DK
39852010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3986
3987 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
3988 Fix_v4bx enum values .
3989 * gold/options.h (General_options): New option definitions.
3990 (General_options::fix_v4bx): New method.
3991 (General_options::Fix_v4bx): New enum.
3992 * gold/options.cc (General_options::parse_fix_v4bx): New method.
3993 (General_options::parse_fix_v4bx_interworking): New method.
3994
80d0d023
DK
39952010-01-22 Doug Kwan <dougkwan@google.com>
3996
3997 * arm.cc (Arm_exidx_fixup): New class.
3998
af2cdeae
DK
39992010-01-21 Doug Kwan <dougkwan@google.com>
4000
4001 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4002 classes.
4003 (Arm_exidx_section_offset_map): New type.
4004
993d07c1
DK
40052010-01-21 Doug Kwan <dougkwan@google.com>
4006
4007 * arm.cc (Arm_exidx_input_section): New class.
4008 (Arm_relobj::exidx_input_section_by_link,
4009 Arm_relobj::exidx_input_section_by_shndx,
4010 Arm_relobj::make_exidx_input_section): New methods.
4011 (read_arm_attributes_section): Remove.
4012 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4013 information about them.
4014 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4015 to here.
4016
5ac169d4
DK
40172010-01-20 Doug Kwan <dougkwan@google.com>
4018
4019 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4020 Input_section_specifier to Section_id.
4021 (Target_arm::new_arm_input_section: Adjust code for change of key
4022 type.
4023 (Target_arm::find_arm_input_section): Ditto.
4024 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4025 (Section_id): Remove.
4026 (Garbage_collection::Section_id_hash): Remove.
4027 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4028 (Section_id): Remove.
4029 (Icf::Section_id_hash): Remove.
4030 * object.h (Section_id, Const_section_id, Section_id_hash,
4031 Const_section_id_hash): New type definitions.
4032 * output.cc (Output_section::add_relaxed_input_section): Change to
4033 use Const_section_id instead of Input_section_specifier as key type.
4034 (Output_section::add_merge_input_section): Ditto.
4035 (Output_section::build_relaxation_map): Change to use Section_id
4036 instead of Input_section_specifier as key type.
4037 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4038 Ditto.
4039 (Output_section::convert_input_sections_to_relaxed_sections): Change
4040 to use Const_section_id instead of Input_section_specifier as key type.
4041 (Output_section::find_merge_section): Ditto.
4042 (Output_section::find_relaxed_input_section): Ditto.
4043 * output.h (Input_section_specifier): Remove class.
4044 (Output_section::Output_section_data_by_input_section_map): Change
4045 key type to Const_section_id.
4046 (Output_section::Output_relaxed_input_section_by_input_section_map):
4047 Ditto.
4048 (Output_section::Relaxation_map): Change key type to Section_id.
4049
a2162063
ILT
40502010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4051
4052 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4053 (class Arm_v4bx_stub): New class.
4054 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4055 (Stub_factory::make_arm_v4bx_stub): New method.
4056 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4057 (Stub_table::empty): Handle v4bx stubs.
4058 (Stub_table::add_arm_v4bx_stub): New method.
4059 (Stub_table::find_arm_v4bx_stub): New method.
4060 (Arm_relocate_functions::v4bx): New method.
4061 (Target_arm::fix_v4bx): New method.
4062 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4063 (Stub_table::relocate_stubs): Likewise.
4064 (Stub_table::do_write): Likewise.
4065 (Stub_table::update_data_size_and_addralign): Likewise.
4066 (Stub_table::finalize_stubs): Likewise.
4067 (Target_arm::Scan::local): Likewise.
4068 (Target_arm::Scan::global): Likewise.
4069 (Target_arm::do_finalize_sections): Likewise.
4070 (Target_arm::Relocate::relocate): Likewise.
4071 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4072 Likewise.
4073 (Target_arm::scan_reloc_for_stub): Likewise.
4074 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4075
5696ab0b
ILT
40762010-01-19 Ian Lance Taylor <iant@google.com>
4077
4078 * output.cc (Output_section_headers::do_sized_write): Write large
4079 segment count to sh_info field.
4080 (Output_file_header::do_sized_write): For large segment count,
4081 write PN_XNUM to e_phnum field.
4082
800d0f56
ILT
40832010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4084
4085 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4086 (Arm_relocate_functions::thm_jump8): New function.
4087 (Arm_relocate_functions::thm_jump11): New function.
4088 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4089 R_ARM_THM_JUMP11.
4090 (Target_arm::Scan::global): Likewise.
4091 (Target_arm::Relocate::relocate): Likewise.
4092 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4093 Likewise.
4094
41263c05
DK
40952010-01-14 Doug Kwan <dougkwan@google.com>
4096
4097 * arm.cc (map, utility): Include headers.
4098 (Target_arm::apply_cortex_a8_workaround): New method.
4099 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4100 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4101 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4102 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4103 the --[no-]fix-cortex-a8 command line options.
4104 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4105 (Target_arm::relocate_stub): Use addend in instruction template.
4106 * options.h (DEFINE_bool): Set the user-set flag.
4107 (General_options): Add --[no-]-fix-cortex options.
4108 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4109 : Update fast look-up map after conversion.
41263c05 4110
459e9b03
ST
41112010-01-14 Sriraman Tallam <tmsriram@google.com>
4112
4113 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4114 in the first pass of do_layout.
4115
b521dfe4
DK
41162010-01-13 Doug Kwan <dougkwan@google.com>
4117
4118 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4119 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4120 apparent compiler problem of not folding static constant integral
4121 data members of elfcpp::Elf_sizes<32>.
4122
44272192
DK
41232010-01-13 Doug Kwan <dougkwan@google.com>
4124
4125 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4126 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4127 Arm_relobj::scan_section_for_cortex_a8_erratum,
4128 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4129 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4130 sections to scan for relocation stubs into a new method
4131 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4132 relocation and Cortex-A8 stub scanning.
4133 (Target_arm::do_relax): Force stubs to be after stubbed sections
4134 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4135 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4136 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4137
44b71ece
ILT
41382010-01-12 Ian Lance Taylor <iant@google.com>
4139
4140 * target-reloc.h (visibility_error): New inline function.
4141 (relocate_section): Call visibility_error.
4142 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4143 (MOSTLYCLEANFILES): Likewise.
4144 (protected_4_pic.o, protected_3.err): New targets.
4145 * testsuite/protected_4.cc: New file.
4146
a120bc7f
DK
41472010-01-12 Doug Kwan <dougkwan@google.com>
4148
4149 * arm.cc (Cortex_a8_reloc): New class.
4150 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4151 and cortex_a8_relocs_info_.
4152 (Target_arm::fix_cortex_a8): New method definition.
4153 (Target_arm::Cortex_a8_relocs_info): New type.
4154 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4155 New data member declarations.
4156 (Target_arm::scan_reloc_for_stub): Record information about
4157 relocations for THUMB branches that might be exempted from the
4158 Cortex-A8 workaround.
4159 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4160 at the beginning of a relaxation pass.
4161
20138696
DK
41622010-01-12 Doug Kwan <dougkwan@google.com>
4163
4164 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4165 (Arm_relobj::Mapping_symbol_position,
4166 Arm_reloj::Mapping_symbol_position_less,
4167 Arm_relobj::Mapping_symbols_info): New types.
4168 (Target_arm::is_mapping_symbol_name): New method definition.
4169 (Arm_relobj::do_count_local_symbols): Save information about mapping
4170 symbols.
4171
089d69dc
DK
41722010-01-11 Doug Kwan <dougkwan@google.com>
4173
4174 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4175 Arm_relocate_functions::thumb32_branch_upper,
4176 Arm_relocate_functions::thumb32_branch_lower,
4177 Arm_relocate_functions::thumb32_cond_branch_offset,
4178 Arm_relocate_functions::thumb32_cond_branch_upper,
4179 Arm_relocate_functions::thumb32_cond_branch_lower,
4180 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4181 branch offset encoding.
4182 (Arm_relocate_functions::thumb_branch_common): Use new branch
4183 offset encoding methods to avoid code duplication.
4184 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4185 (Stub_addend_reader::operator()): Use new branch encoding method
4186 to avoid code duplication.
4187
99e5bff2
DK
41882010-01-11 Doug Kwan <dougkwan@google.com>
4189
4190 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4191 (Target_arm::do_finalize_sections): Define special EXIDX section
4192 symbols only if referenced.
4193 * gc.h (Garbage_collection::add_reference): New method.
4194 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4195 code duplication.
4196
98e090bd
ILT
41972010-01-11 Ian Lance Taylor <iant@google.com>
4198
d0a91bd8
ILT
4199 * script.cc (Version_script_info::build_expression_list_lookup):
4200 Change complaing about duplicate wildcard match from error to
4201 warning.
4202
98e090bd
ILT
4203 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4204 of 2009-12-30.
4205 (Version_script_info::Version_script_info): Initialize globs_,
4206 default_version_, default_is_global_, and exact_. Don't
4207 initialize globals_ or locals_.
4208 (Version_script_info::build_lookup_tables): Build local symbols
4209 first.
4210 (Version_script_info::unquote): New function.
4211 (Version_script_info::add_exact_match): New function.
4212 (Version_script_info::build_expression_list_lookup): Remove lookup
4213 parameter. Add is_global parameter. Change all callers. Handle
4214 wildcard pattern specially. Unquote pattern. Call
4215 add_exact_match.
4216 (Version_script_info::get_name_to_match): New function.
4217 (Version_script_info::get_symbol_version): New function.
4218 (Version_script_info::get_symbol_version_helper): Remove.
4219 (Version_script_info::check_unmatched_names): Call unquote.
4220 * script.h (class Version_script_info): Change get_symbol_version
4221 to be non-inline and add is_global parameter; change all callers.
4222 Rewrite symbol_is_local. Update declarations. Define struct
4223 Version_tree_match, Exact, Globs. Don't define struct Lookup.
4224 Remove globals_ and locals_ members. Add exact_, globs_,
4225 default_version_, is_global_.
4226 (Version_script_info::Glob): Remove pattern, add expression and
4227 is_global. Update constructor. Change all callers.
4228 * dynobj.cc (Versions::finalize): Mark the version symbol as the
4229 default version.
4230 (Versions::symbol_section_contents): If a symbol is undefined, or
4231 defined in a dynamic object, set the version index to
4232 VER_NDX_LOCAL.
4233 * symtab.cc (Symbol_table::add_from_relobj): Don't call
4234 symbol_is_local.
4235 (Symbol_table::add_from_pluginobj): Likewise.
4236 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
4237
d56962d3
DK
42382010-01-11 Doug Kwan <dougkwan@google.com>
4239
4240 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
4241 (incremental_dump_LDADD): Add linking option for libintl.
4242 * Makefile.in: Regenerate.
4243
94e6ee91
L
42442010-01-11 H.J. Lu <hongjiu.lu@intel.com>
4245
4246 PR gold/11144
4247 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
4248 instead of -Ds.
4249 * testsuite/Makefile.in: Regenerated.
4250
e96c574b
DK
42512010-01-10 Doug Kwan <dougkwan@google.com>
4252
4253 * options.h (DEFINE_var): Use parentheses around argument varname__
4254 in macro body to avoid any unintended subsequent substitutions.
4255
7198066b
ILT
42562010-01-10 Ian Lance Taylor <iant@google.com>
4257
ba4d53bf
ILT
4258 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
4259 candidates before doing symbol resolution.
4260
7198066b
ILT
4261 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
4262 ODR candidates if only one is weak.
4263
a2beed37
ILT
42642010-01-08 Ian Lance Taylor <iant@google.com>
4265
4266 * script.cc (Version_script_info::build_expression_list_lookup):
4267 Don't warn about ambiguous version, just record the ambiguity.
4268 (Version_script_info::get_symbol_version_helper): Give error if
4269 version is ambiguous.
4270
2fb7225c
DK
42712010-01-08 Doug Kwan <dougkwan@google.com>
4272
4273 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
4274 prev_data_size_ and prev_addralign_. Remove initializer for
4275 deleted data member has_been_changed_.
4276 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
4277 to determine if the table is empty.
4278 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
4279 Remove.
4280 (Stub_table::add_reloc_stub): Define method in class definition
4281 instead of just declaring it there.
4282 (Stub_table::add_cortex_a8_stub): New method definition.
4283 (Stub_table::update_data_size_and_addralign): Ditto.
4284 (Stub_table::finalize_stubs): Ditto.
4285 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
4286 (Stub_table::do_addralign_): Return address alignment in the
4287 (Stub_table::do_reset_address_and_file_offset): Define method in
4288 class definition instead of declaring it there. Set current data
4289 size to be the data size of the previous pass.
4290 (Stub_table::set_final_data_size): Use current data size as the
4291 final data size.
4292 (Stub_table::relocate_stub): Change parameter type of stub from
4293 Reloc_stub pointer to Stub pointer.
4294 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
4295 (Stub_table::Cortex_a8_stub_list): New typedef.
4296 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
4297 Stub_table::prev_addralign_): New data member.
4298 (Arm_relobj::Arm_relobj): Initialize data member
4299 section_has_cortex_a8_workaround_.
4300 (Arm_relobj::section_has_cortex_a8_workaround,
4301 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
4302 definitions.
4303 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
4304 declarations.
4305 (Target_arm::relocate_stub): Change parameter type of stub from
4306 Reloc_stub pointer to Stub pointer.
4307 (Insn_template::size, Insn_template::alignment): Handle
4308 THUMB16_SPECIAL_TYPE.
4309 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
4310 Stub_table::update_data_size_and_addralign,
4311 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
4312 definitions.
4313 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
4314 (Stub_table::do_write): Ditto.
4315 (Target_arm::do_relax): Adjust code for changes in Stub_table.
4316
880cd20d
ILT
43172010-01-08 Ian Lance Taylor <iant@google.com>
4318
4319 PR 11108
4320 * symtab.h (class Symbol): Remove fields is_target_special_ and
4321 has_plt_offset_. Add field is_defined_in_discarded_section_.
4322 (Symbol::is_defined_in_discarded_section): New function.
4323 (Symbol::set_is_defined_in_discarded_section): New function.
4324 (Symbol::has_plt_offset): Rewrite.
4325 (Symbol::set_plt_offset): Verify that new offset is not -1U.
4326 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
4327 Don't initialize is_target_special_ or has_plt_offset_.
4328 Initialize is_defined_in_discarded_section_.
4329 (Symbol_table::add_from_relobj): If appropriate, set
4330 is_defined_in_discarded_section.
4331 * resolve.cc (Symbol::override_base_with_special): Don't test
4332 is_target_special_. Change has_plt_offset_ to has_plt_offset().
4333 * target-reloc.h (relocate_section): Do special handling for
4334 symbols defined in discarded sections for global symbols as well
4335 as local symbols.
4336
2703e3eb
ILT
43372010-01-08 Ian Lance Taylor <iant@google.com>
4338
4339 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
4340 the SHT_SYMTAB case.
4341
339d40a3
ILT
43422010-01-08 Ian Lance Taylor <iant@google.com>
4343
4344 * object.cc (Sized_relobj::do_layout): Don't get confused if
4345 layout_eh_frame returns NULL.
4346
abecea76
ILT
43472010-01-08 Ian Lance Taylor <iant@google.com>
4348
4349 PR 11084
4350 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
4351 dynamic symbol table, use the normal symbol table.
4352 (Sized_dynobj::do_read_symbols): Remove assertion about type of
4353 symbol table.
4354
6b7dd3f3
ILT
43552010-01-08 Ian Lance Taylor <iant@google.com>
4356
4357 PR 11072
4358 * layout.cc (Layout::include_section): Remove .gnu_debuglink
4359 sections.
4360
36c50e63
L
43612010-01-08 H.J. Lu <hongjiu.lu@intel.com>
4362
4363 * version.cc (print_version): Change to "Copyright 2010".
4364
e291e7b9
ILT
43652010-01-08 Ian Lance Taylor <iant@google.com>
4366
4367 PR 10287
4368 PR 11063
4369 * i386.cc (class Target_i386): Change return type of plt_section
4370 to be non-const.
4371 (class Output_data_plt_i386): Add tls_desc_rel_ field.
4372 (Output_data_plt_i386::Output_data_plt_i386): Initialize
4373 tls_desc_rel_ field.
4374 (Output_data_plt_i386::rel_tls_desc): New function.
4375 (Target_i386::rel_tls_desc_section): New function.
4376 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
4377 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
4378 R_386_TLS_DESC reloc in rel_tls_desc_section.
4379 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
4380 Define struct Tlsdesc_info.
4381 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
4382 (Target_x86_64::do_reloc_symbol_index): New function.
4383 (Target_x86_64::add_tlsdesc_info): New function.
4384 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
4385 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
4386 tlsdesc_rel_ field.
4387 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
4388 all callers.
4389 (Output_data_plt_x86_64::rela_tlsdesc): New function.
4390 (Target_x86_64::rela_tlsdesc_section): New function.
4391 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
4392 handling.
4393 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
4394 (Target_x86_64::do_reloc_addend): New function.
4395 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
4396 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
4397 declarations. Define TARGET_CODE. Add arg field to u1_ union.
4398 (Output_reloc::type): New function.
4399 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
4400 (Output_reloc::is_target_specific): New function.
4401 (Output_reloc::target_arg): New function.
4402 (class Output_reloc) [SHT_RELA]: Add four new constructors for
4403 absolute relocs and target specific relocs.
4404 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
4405 add_target_specific.
4406 (class Output_data_reloc) [SHT_RELA]: Likewise.
4407 * output.cc (Output_reloc::Output_reloc): Add four new versions
4408 for absolute relocs and target specific relocs.
4409 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
4410 (Output_reloc::get_symbol_index): Likewise.
4411 (Output_reloc::local_section_offset): Check that local_sym_index_
4412 is not TARGET_CODE or 0.
4413 (Output_reloc::symbol_value): Likewise.
4414 (Output_reloc::write) [SHT_RELA]: Call target for target specific
4415 reloc.
4416 * target.h (class Target): Add reloc_symbol_index and reloc_addend
4417 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
4418 functions.
4419 * layout.cc (add_target_dynamic_tags): Use output section for
4420 DT_PLTRELSZ and DT_JMPREL.
4421
3a44184e
ILT
44222010-01-07 Ian Lance Taylor <iant@google.com>
4423
4424 PR 11061
4425 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
4426 function.
4427 (class Output_data_reloc_generic): Define.
4428 (class Output_data_reloc_base): Change base class to
4429 Output_data_reloc_generic. Change add() method to call
4430 bump_relative_reloc_count for a relative reloc. Remove
4431 sort_relocs_ field.
4432 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
4433 to sort_relocs().
4434 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
4435 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
4436 appropriate.
4437 * layout.h (class Layout): Update declaration.
4438
ea715a34
ILT
44392010-01-07 Ian Lance Taylor <iant@google.com>
4440
4441 * output.h (class Output_data): Add const version of
4442 output_section and do_output_section.
4443 (class Output_section_data): Add const version of
4444 do_output_section.
4445 (class Output_section): Likewise.
4446 * layout.cc (Layout::add_target_dynamic_tags): New function.
4447 * layout.h (class Layout): Update declarations.
4448 * arm.cc (Target_arm::do_finalize_sections): Use
4449 add_target_dynamic_tags.
4450 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4451 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4452 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4453 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4454
659948a4
ILT
44552010-01-07 Ian Lance Taylor <iant@google.com>
4456
4457 PR 11042
4458 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
4459 object as needed.
4460
9d3b86f6
ILT
44612010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
4462 Ian Lance Taylor <iant@google.com>
4463
4464 PR 11019
4465 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
4466 Xindex::read_symtab_xindex.
4467
bb0d3eb0
DK
44682010-01-07 Doug Kwan <dougkwan@google.com>
4469
4470 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
4471 (Insn_template::thumb16_bcond_insn): New method declaration.
4472 (Insn_template): Fix spelling.
4473 (Stub::thumb16_special): New method declaration.
4474 (Stub::do_write): Define virtual method which was previously pure
4475 virtual.
4476 (Stub::do_thumb16_special): New method declaration.
4477 (Stub::do_fixed_endian_write): New template member.
4478 (Reloc_stub::do_write): Remove.
4479 (Reloc_stub::do_fixed_endian_write): Remove.
4480 (Cortex_a8_stub): New class definition.
4481 (Stub_factory::make_cortex_a8_stub): New method definition.
4482 (Stub_factory::Stub_factory): Add missing static storage class
4483 qualifier for elf32_arm_stub_a8_veneer_blx.
4484
ffeef7df
ILT
44852010-01-07 Ian Lance Taylor <iant@google.com>
4486
dc3f80fe
ILT
4487 PR 10980
4488 * options.h (class General_options): Add --warn-unresolved-symbols
4489 and --error-unresolved-symbols.
4490 * errors.cc (Errors::undefined_symbol): Implement
4491 --warn-unresolved-symbols.
4492
ffeef7df
ILT
4493 * options.h (class General_options): Add -z text and -z textoff.
4494 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
4495
f1ec9ded
ST
44962010-01-06 Sriraman Tallam <tmsriram@google.com>
4497
4498 * gc.h (Garbage_collection::Cident_section_map): New typedef.
4499 (Garbage_collection::cident_sections): New function.
4500 (Garbage_collection::add_cident_section): New function.
4501 (Garbage_collection::cident_sections_): New member.
4502 (gc_process_relocs): Add references to sections whose names are C
4503 identifiers.
4504 * gold.h (cident_section_start_prefix): New constant.
4505 (cident_section_stop_prefix): New constant.
4506 (is_cident): New function.
4507 * layout.cc (Layout::define_section_symbols): Replace string constants
4508 with the newly defined constants.
4509 * object.cc (Sized_relobj::do_layout): Track sections whose names are
4510 C identifiers.
4511 * testsuite/Makefile.am: Add gc_orphan_section_test.
4512 * testsuite/Makefile.in: Regenerate.
4513 * testsuite/gc_orphan_section_test.cc: New file.
4514 * testsuite/gc_orphan_section_test.sh: New file.
4515
6eda8c29
ILT
45162010-01-06 Ian Lance Taylor <iant@google.com>
4517
b9674e17
ILT
4518 PR 10980
4519 * options.h (class General_options): Add --warn-shared-textrel.
4520 * layout.cc (Layout::finish_dynamic_section): Implement
4521 --warn-shared-textrel.
4522
6eda8c29
ILT
4523 PR 10980
4524 * options.h (class General_options): Add --warn-multiple-gp.
4525
32dcd44e
ILT
45262010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4527
4528 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
4529 $(THREADSLIB) and $(LIBDL).
4530 * Makefile.in: Rebuild.
4531
a192ba05
ILT
45322010-01-06 Ian Lance Taylor <iant@google.com>
4533
4534 PR 10980
4535 * options.cc (General_options::parse_section_start): New function.
4536 (General_options::section_start): New function.
4537 (General_options::General_options): Initialize all members.
4538 * options.h: Include <map>
4539 (class General_options): Add --section-start. Add section_starts_
4540 member.
4541 * layout.cc (Layout::attach_allocated_section_to_segment): If
4542 --section-start was used, set the address of the segment. Remove
4543 local sort_sections.
4544 (Layout::relaxation_loop_body): If the address of the load segment
4545 has been set by --section-start, don't use it.
4546 * output.h (Output_segment::update_flags_for_output_section): New
4547 function.
4548 * output.cc (Output_segment::add_output_section): Call
4549 update_flags_for_output_section.
4550
dde3f402
ILT
45512010-01-05 Ian Lance Taylor <iant@google.com>
4552
62dfdd4d
ILT
4553 PR 10980
4554 * options.h (class General_options): Add --undefined-version.
4555 * script.cc (struct Version_expression): Add was_matched_by_symbol
4556 field.
4557 (Version_script_info::matched_symbol): New function.
4558 (Version_script_info::get_symbol_version_helper): Call
4559 matched_symbol.
4560 (Version_script_info::check_unmatched_names): New function.
4561 * script.h (class Version_script_info): Update declarations.
4562 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
4563
9c4ae156
ILT
4564 * options.h (class General_options): Use DEFINE_bool_alias for
4565 allow_multiple_definition.
4566 * resolve.cc (Symbol_table::should_override): Don't test
4567 allow_multiple_definition.
4568
dde3f402
ILT
4569 PR 10980
4570 * options.h (class General_options): Add --cref.
4571 * main.cc (main): Print cref table if --cref. Don't close mapfile
4572 until after printing cref table.
4573 * cref.cc: Include "symtab.h".
4574 (class Cref_inputs): Define Cref_table_compare and Cref_table.
4575 (Cref_table_compare::operator()): New function.
4576 (Cref_inputs::gather_cref): New function.
4577 (filecol): New static const.
4578 (Cref_inputs::print_cref): New function.
4579 (Cref::print_cref): New function.
4580 * cref.h: Include <cstdio>.
4581 (class Cref): Update declarations.
4582 * mapfile.h (Mapfile::file): New function.
4583 * object.h (class Object): Define Symbols. Declare virtual
4584 do_get_global_symbols.
4585 (Object::get_global_symbols): New function.
4586 * object.cc (Input_objects::add_object): Pass object to cref_ if
4587 --cref.
4588 (Input_objects::archive_start): Likewise.
4589 (Input_objects::archive_stop): Likewise.
4590 (Input_objects::print_cref): New function.
4591 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
4592 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
4593 --cref.
4594 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
4595 function.
4596 * plugin.h (class Sized_pluginobj): Update declarations.
4597
8781f709
ILT
45982010-01-05 Ian Lance Taylor <iant@google.com>
4599
4600 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
4601 to is_default_version. Rename insdef to insdefault.
4602 (Symbol_table::add_from_relobj): Rename def to is_default_version
4603 and local to is_forced_local.
4604 (Symbol_table::add_from_pluginobj): Likewise.
4605 (Symbol_table::add_from_dynobj): Likewise.
4606 (Symbol_table::define_special_symbol): Rename insdef to
4607 insdefault.
4608
fe35d28d
ILT
46092010-01-04 Ian Lance Taylor <iant@google.com>
4610
30bc8c46
ILT
4611 PR 10980
4612 * options.h (class General_options): Add
4613 --allow-multiple-definition and -z muldefs.
4614 * resolve.cc (Symbol_table::should_override): Don't warn about a
4615 multiple symbol definition if --allow-multiple-definition or -z
4616 muldefs.
4617
7eaea549
ILT
4618 PR 10980
4619 * options.h (class General_options): Add --add-needed and
4620 --copy-dt-needed-entries. Tweak --as-needed help entry.
4621 * object.cc (Input_objects::check_dynamic_dependencies): Give an
4622 error if --copy-dt-needed-entries aka --add-needed is used and
4623 would cause a change in behaviour.
4624
fe35d28d
ILT
4625 PR 10980
4626 * options.h (class General_options): Add -G as a short version of
4627 --shared. Add no-op options -assert, -g, and -i.
4628
55a2bb35
ST
46292010-01-04 Sriraman Tallam <tmsriram@google.com>
4630
4631 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
4632 check for .text or .gnu.linkonce.t sections.
4633 * icf.cc (Icf::find_identical_sections): Ditto.
4634 Change the detection for mangled function name within the section
4635 name.
4636 * icf.h (is_section_foldable_candidate): New function.
4637
719328e1
ILT
46382009-12-30 Ian Lance Taylor <iant@google.com>
4639
4640 PR 10980
4641 * options.h (class General_options): Permit two dashes with
4642 --retain-symbols-file.
4643
d7bb5745
ILT
46442009-12-30 Ian Lance Taylor <iant@google.com>
4645
403a15dd
ILT
4646 PR 10979
4647 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
4648 don't put the file header and segment headers in the text
4649 segment.
4650
eda294df
ILT
4651 PR 10979
4652 * common.cc (Sort_commons::operator()): Stabilize sort when both
4653 entries are NULL.
4654 (Symbol_table::do_allocate_commons_list): When allocating common
4655 symbols, skip a symbol which is no longer common.
4656 * symtab.h (Symbol::is_common): Test whether the symbol comes from
4657 an object before checking its type.
4658 * testsuite/common_test_2.c: New file.
4659 * testsuite/common_test_3.c: New file.
4660 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
4661 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
4662 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
4663 (common_test_2_pic.o, common_test_2.so): New targets.
4664 (common_test_3_pic.o, common_test_3.so): New targets.
4665 * testsuite/Makefile.in: Rebuild.
4666
d7bb5745
ILT
4667 PR 10979
4668 * script.cc (read_input_script): If we see a new SECTIONS clause,
4669 and we have added an input section, give an error.
4670 * layout.h (class Layout): Add have_added_input_section function.
4671 Add have_added_input_section_ field.
4672 * layout.cc (Layout::Layout): Initialize
4673 have_added_input_section_.
4674 (Layout::layout): Set have_added_input_section_.
4675 (Layout::layout_eh_frame): Likewise.
4676
fc59c572
ILT
46772009-12-30 Ian Lance Taylor <iant@google.com>
4678
4679 PR 10931
4680 * options.h (class General_options): Add --sort-common option.
4681 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
4682 * common.cc (Sort_common): Add sort_order parameter to
4683 constructor. Add sort_order_ field.
4684 (Sort_commons::operator): Check sort_order_.
4685 (Symbol_table::allocate_commons): Determine the sort order.
4686 (Symbol_table::do_allocate_commons): Add sort_order parameter.
4687 Change all callers.
4688 (Symbol_table::do_allocate_commons_list): Likewise.
4689
1c74fab0
ILT
46902009-12-30 Ian Lance Taylor <iant@google.com>
4691
4692 PR 10916
4693 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
4694 symbols from this object, don't change the visibility of an
4695 undefined symbol.
4696 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
4697
6affe781
ILT
46982009-12-30 Ian Lance Taylor <iant@google.com>
4699
4700 PR 10861
4701 * script.h (class Version_script_info): Define Language enum.
4702 Update declarations. Define Glob, Exact, and Lookup types. Add
4703 new fields globals_, locals_, and is_finalized_.
4704 * script.cc: Various formatting fixes.
4705 (class Parser_closure): Change language_stack_ from a vector of
4706 std::string to one of Version_script_info::Language. Adjust all
4707 uses accordingly.
4708 (class Lazy_demangler): Remove.
4709 (struct Version_expression): Change language from std::string to
4710 Version_script_info::Language.
4711 (Version_script_info::Version_script_info): New function.
4712 (Version_script_info::~Version_script_info): Don't call clear.
4713 (Version_script_info::finalize): New function.
4714 (Version_script_info::build_lookup_tables): New function.
4715 (Version_script_info::build_expression_list_lookup): New
4716 function.
4717 (Version_script_info::get_symbol_version_helper): Rewrite to use
4718 lookup tables.
4719 (Version_script_info::print_expression_list): Adjust to use
4720 Version_script_info::Language.
4721 (script_push_lex_into_version_mode): Check that the version script
4722 has not been finalized.
4723 (version_script_push_lang): Change language string to
4724 Version_script_info::Language.
4725 * options.cc (Command_line::version_script): New function.
4726 * options.h (class General_options): Add finalize_dynamic_list
4727 function. Change version_script from declaration to definition.
4728 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
4729 * testsuite/version_script.map: Remove duplicate def of foo.
4730 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
4731 version_script.map.
4732 * testsuite/Makefile.in: Rebuild.
4733
818bf354
ILT
47342009-12-30 Ian Lance Taylor <iant@google.com>
4735
4736 PR 10843
4737 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
4738 if the input symbol index is 0, make the output symbol index 0.
4739
ebcc8304
ILT
47402009-12-30 Ian Lance Taylor <iant@google.com>
4741
4742 PR 10670
4743 * options.h (class General_options): Add -x/--discard-all.
4744 * object.cc (Sized_relobj::do_count_local_symbols): Handle
4745 --discard-all. If the local symbol needs a dynamic entry, check
4746 that before handling --discard-locals.
4747
176fe33f
ILT
47482009-12-30 Ian Lance Taylor <iant@google.com>
4749
bb321bb1
ILT
4750 PR 10450
4751 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
4752 flags to PF_R.
4753 (Output_segment::add_output_section): Don't change the flags if
4754 the type is PT_TLS.
4755
176fe33f
ILT
4756 PR 10450
4757 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
4758 GNU hash table if they need a dynamic value. Otherwise, don't add
4759 them if they are defined in a dynamic object or are forced local.
4760
e8cd95c7
ILT
47612009-12-29 Ian Lance Taylor <iant@google.com>
4762
1b81fb71
ILT
4763 PR 10450
4764 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
4765 .gnu.hash table for a 32-bit target.
4766
8d6d383d
ILT
4767 PR 10450
4768 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
4769 regular and a dynamic object only needs a dynamic symbol table
4770 entry if it is externally visible.
4771
e785ec03
ILT
4772 PR 10450
4773 * i386.cc (class Target_i386): Initialize global_offset_table_ in
4774 constructor. Add global_offset_table_ field.
4775 (Target_i386::got_section): Set global_offset_table_.
4776 (Target_i386::do_finalize_sections): Set global_offset_table_
4777 size.
4778 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
4779 in constructor. Add global_offset_table_ field.
4780 (Target_x86_64::got_section): Set global_offset_table_.
4781 (Target_x86_64::do_finalize_sections): Set global_offset_table_
4782 size.
4783
1a2dff53
ILT
4784 * layout.cc (Layout::Layout): Initialize increase_relro_.
4785 (Layout::get_output_section): Add is_relro, is_last_relro, and
4786 is_first_non_relro parameters. Change all callers.
4787 (Layout::choose_output_section): Likewise.
4788 (Layout::add_output_section_data): Likewise.
4789 (Layout::make_output_section): Likewise.
4790 (Layout::set_segment_offsets): Clear increase_relro when using a
4791 linker script.
4792 * layout.h (class Layout): Add increase_relro method. Add
4793 increase_relro_ field. Update declarations.
4794 * output.cc (Output_section::Output_section): Initialize
4795 is_last_relro_ and is_first_non_relro_.
4796 (Output_segment::add_output_section): Group relro sections is
4797 do_sort is true. Handle is_last_relro and is_first_non_relro.
4798 (Output_segment::maximum_alignment): Remove relro handling.
4799 (Output_segment::set_section_addresses): Add increase_relro
4800 parameter. Change all callers. Add initial alignment to align
4801 relro sections on separate page. Remove old relro handling.
4802 (Output_segment::set_section_list_addresses): Remove in_relro
4803 parameter. Change all callers.
4804 (Output_segment::set_offset): Add increase parameter. Change all
4805 callers. Remove old relro handling.
4806 * output.h (class Output_section): Add new methods: is_last_relro,
4807 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
4808 Add is_last_relro_ and is_first_non_relro_ fields.
4809 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
4810 Create separate .got.plt section. Call increase_relro.
4811 * x86_64.cc (Target_x86_64::got_section): Likewise.
4812 * testsuite/relro_script_test.t: Add .got.plt.
4813
f0ba79e2
ILT
4814 PR 10450
4815 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
4816 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
4817 (Layout::finalize): Call set_dynamic_symbol_size.
4818 (Layout::set_dynamic_symbol_size): New function.
4819 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
4820 set_dynamic_symbol_size.
4821
e8cd95c7
ILT
4822 PR 10450
4823 * output.h (class Output_section): Add is_entsize_zero_ field.
4824 * output.cc (Output_section::Output_section): Initialize
4825 is_entsize_zero_.
4826 (Output_section::set_entsize): If two different entsizes are
4827 requested, force it to zero.
4828 (Output_section::add_input_section): Set flags for .debug_str
4829 before updating section flags. Set entsize.
4830 (Output_section::update_flags_for_input_section): Set SHF_MERGE
4831 and SHF_STRING if all input sections have those flags.
4832
3e1b9a8a
RÁE
48332009-12-29 Rafael Espindola <espindola@google.com>
4834
4835 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
4836 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
4837 reporting.
3e1b9a8a 4838
3dcad376
ST
48392009-12-29 Sriraman Tallam <tmsriram@google.com>
4840
4841 * options.cc (General_options::parse_version): Allow -v to exit
4842 without an error if there is nothing to link.
4843
084e2665
ILT
48442009-12-29 Ian Lance Taylor <iant@google.com>
4845
4846 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
4847 using a version of gcc before 4.1.
4848 * configure: Rebuild.
4849
250acde3
CD
48502009-12-28 Chris Demetriou <cgd@google.com>
4851
4852 * attributes.cc (Output_attributes_section_data::do_write): Use
4853 std::vector::front rather than std::vector::data.
4854
99fff23b
ILT
48552009-12-28 Ian Lance Taylor <iant@google.com>
4856
4857 * symtab.h (class Symbol_table): Add enum Defined.
4858 * resolve.cc (Symbol_table::should_override): Add defined
4859 parameter. Change all callers. Test whether object is NULL
4860 before calling a method on it.
4861 (Symbol_table::report_resolve_problem): Add defined parameter.
4862 Change all callers.
4863 (Symbol_table::should_override_with_special): Likewise.
4864 * symtab.cc (Symbol_table::define_in_output_data): Add defined
4865 parameter. Change all callers.
4866 (Symbol_table::do_define_in_output_data): Likewise.
4867 (Symbol_table::define_in_output_segment): Likewise.
4868 (Symbol_table::do_define_in_output_segment): Likewise.
4869 (Symbol_table::define_as_constant): Likewise.
4870 (Symbol_table::do_define_as_constant): Likewise.
4871 * script.h (class Symbol_assignment): Add is_defsym parameter to
4872 constructor; change all callers.
4873 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
4874 parameter. Change all callers. Add is_defsym_ field.
4875 (class Parser_closure): Add parsing_defsym parameter to
4876 constructor; change all callers. Add parsing_defsym accessor
4877 function. Add parsing_defsym_ field.
4878
556bd683
ILT
48792009-12-28 Ian Lance Taylor <iant@google.com>
4880
4881 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 4882 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 4883
1782c879
ILT
48842009-12-23 Ian Lance Taylor <iant@google.com>
4885
4886 * i386.cc (Target_i386::do_calls_non_split): Recognize
4887 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
4888 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
4889 -fsplit-stack prologue when using %r11.
1782c879 4890
329ca2b1
ST
48912009-12-21 Sriraman Tallam <tmsriram@google.com>
4892
4893 * options.cc (General_options::parse_version): Make -v continue and do
4894 the link like GNU ld does.
4895
d675ff46
RÁE
48962009-12-17 Rafael Avila de Espindola <espindola@google.com>
4897
4898 * Makefile.am (CCFILES): Add timer.cc.
4899 (HFILES): Add timer.h.
4900 * configure.ac: Check for sysconf and times.
4901 * main.cc: include timer.h.
4902 (main): Use Timer instead of get_run_time.
4903 * timer.cc: New.
4904 * timer.h: New.
4905 * workqueue.cc: include timer.h.
4906 (Workqueue::find_and_run_task):
4907 Report user, sys and wall time.
4908 * Makefile.in: Regenerate.
4909 * config.in: Regenerate.
4910 * configure: Regenerate.
4911
d6344fb5
DK
49122009-12-16 Doug Kwan <dougkwan@google.com>
4913
4914 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
4915 sections.
4916 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
4917 relaxed input sections.
4918 * output.cc (Output_section::find_relaxed_input_section): Change
4919 return type to Output_relaxed_input_section pointer. Adjust code
4920 for new type of relaxed_input_section_map_.
4921 * output.h (Output_section::find_relaxed_input_section): Change
4922 return type to Output_relaxed_input_section pointer.
4923 (Output_section::Output_relaxed_input_section_by_input_section_map):
4924 New type.
4925 (Output_section::relaxed_input_section_map_): Change type to
4926 Output_section::Output_relaxed_input_section_by_input_section_map.
4927 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
4928 input section.
4929
0e0d5469
ILT
49302009-12-15 Ian Lance Taylor <iant@google.com>
4931
4932 * layout.cc (Layout::create_shstrtab): Only write out after input
4933 sections if we are compressing debug sections.
4934
0649a889
ILT
49352009-12-15 Ian Lance Taylor <iant@google.com>
4936
4937 * archive.cc (Archive::add_symbols): Only look up a symbol without
4938 a version if there is, in fact, a version.
4939
2ea97941
ILT
49402009-12-14 Ian Lance Taylor <iant@google.com>
4941
4942 Revert -Wshadow changes, all changes from:
4943 2009-12-11 Doug Kwan <dougkwan@google.com>
4944 2009-12-11 Nick Clifton <nickc@redhat.com>
4945 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
4946
b0eec2cc
DK
49472009-12-11 Doug Kwan <dougkwan@google.com>
4948
4949 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
4950 due to -Wshadow.
4951 * attributes.cc (Object_attribute::size): Ditto.
4952 (Attributes_section_data::size): Ditto.
4953 (Attributes_section_data::Attributes_section_data): Ditto.
4954 (Output_attributes_section_data::do_write): Ditto.
4955 * attributes.h (Object_attribute::set_type): Ditto.
4956 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
4957
91d6fa6a
NC
49582009-12-11 Nick Clifton <nickc@redhat.com>
4959
4960 * archive.cc: Fix shadowed variable warnings.
4961 * arm.cc: Likewise.
4962 * compressed_output.cc: Likewise.
4963 * compressed_output.h: Likewise.
4964 * configure: Likewise.
4965 * dwarf_reader.cc: Likewise.
4966 * dynobj.cc: Likewise.
4967 * dynobj.h: Likewise.
4968 * ehframe.cc: Likewise.
4969 * ehframe.h: Likewise.
4970 * errors.cc: Likewise.
4971 * expression.cc: Likewise.
4972 * fileread.cc: Likewise.
4973 * fileread.h: Likewise.
4974 * freebsd.h: Likewise.
4975 * i386.cc: Likewise.
4976 * icf.cc: Likewise.
4977 * incremental.h: Likewise.
4978 * layout.cc: Likewise.
4979 * layout.h: Likewise.
4980 * mapfile.cc: Likewise.
4981 * merge.cc: Likewise.
4982 * merge.h: Likewise.
4983 * object.cc: Likewise.
4984 * object.h: Likewise.
4985 * options.h: Likewise.
4986 * output.cc: Likewise.
4987 * output.h: Likewise.
4988 * parameters.cc: Likewise.
4989 * plugin.cc: Likewise.
4990 * powerpc.cc: Likewise.
4991 * reduced_debug_output.cc: Likewise.
4992 * reduced_debug_output.h: Likewise.
4993 * reloc.cc: Likewise.
4994 * reloc.h: Likewise.
4995 * resolve.cc: Likewise.
4996 * script-sections.cc: Likewise.
4997 * script.cc: Likewise.
4998 * script.h: Likewise.
4999 * sparc.cc: Likewise.
5000 * symtab.cc: Likewise.
5001 * symtab.h: Likewise.
5002 * target-select.cc: Likewise.
5003 * target-select.h: Likewise.
5004 * token.h: Likewise.
5005 * workqueue.cc: Likewise.
5006 * workqueue.h: Likewise.
5007 * x86_64.cc: Likewise.
5008
a0351a69
DK
50092009-12-10 Doug Kwan <dougkwan@google.com>
5010
5011 * arm.cc (attributes.h): New include.
5012 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5013 (Arm_relobj::~Arm_relobj): Delete object pointed by
5014 attributes_section_data_.
5015 (Arm_relobj::attributes_section_data): New method definition.
5016 (Arm_relobj::attributes_section_data_): New data member declaration.
5017 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5018 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5019 attributes_section_data_.
5020 (Arm_dynobj::attributes_section_data): New method definition.
5021 (Arm_dynobj::attributes_section_data_): New data member declaration.
5022 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5023 initialization value of may_use_blx_ to false.
5024 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5025 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5026 object attributes to compute results instead of hard-coding.
5027 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5028 Target_arm::get_secondary_compatible_arch,
5029 Target_arm::set_secondary_compatible_arch
5030 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5031 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5032 New method declarations.
5033 (Target_arm::get_aeabi_object_attribute): New method definition.
5034 (Target_arm::attributes_section_data_): New data member declaration.
5035 (read_arm_attributes_section): New template definition.
5036 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5037 (Arm_dynobj::do_read_symbols): Ditto.
5038 (Target_arm::do_finalize_sections): Merge attributes sections from
5039 input. Check for BLX use after attributes section merging.
5040 Fix __exidx_start and __exidx_end visibility. Create an
5041 .ARM.attributes section if necessary.
5042 (Target_arm::get_secondary_compatible_arch,
5043 Target_arm::set_secondary_compatible_arch,
5044 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5045 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5046 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5047 New method definitions.
5048
b59befec
ILT
50492009-12-09 Ian Lance Taylor <iant@google.com>
5050
5051 * plugin.cc (Plugin::load): Don't cast from void* to a function
5052 pointer.
5053
1276bc89
ILT
50542009-12-09 Ian Lance Taylor <iant@google.com>
5055
5056 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5057 information fields.
5058
2f2de248
L
50592009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5060
5061 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5062 Replace two_file_shared_1.so with two_file_shared_2.so.
5063 * testsuite/Makefile.in: Regenerated.
5064
4f787271
DK
50652009-12-08 Doug Kwan <dougkwan@google.com>
5066
5067 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5068 (HFILES): Add attributes.h and int_encoding.h.
5069 * Makefile.in: Regenerate.
5070 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5071 function definitions to int_encoding.cc
5072 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5073 prototypes to int_encoding.h
5074 * reduced_debug_output.cc (int_encoding.h): New include.
5075 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5076 function definitions to int_encoding.cc
5077 (insert_into_vector, read_from_pointer): Move template definitions to
5078 int_encoding.h
5079 * attributes.cc: New file.
5080 * attributes.h: New file.
5081 * int_encoding.cc: New file.
5082 * int_encoding.h: New file.
5083
20b52f1a
RÁE
50842009-12-07 Rafael Avila de Espindola <espindola@google.com>
5085
5086 PR gold/11055
5087 * incremental-dump.cc (dump_incremental_inputs): New.
5088 (main): Use dump_incremental_inputs.
5089
53d7974c
L
50902009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5091
5092 PR gold/10893
5093 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5094 checking elfcpp::STT_FUNC.
5095 (Target_i386::Relocate::relocate): Likewise.
5096 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5097
5098 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5099 symbols from shared libraries into normal FUNC symbols.
5100
5101 * symtab.h (Symbol): Add is_func and use it.
5102
05a352e6
DK
51032009-12-05 Doug Kwan <dougkwan@google.com>
5104
5105 * arm.cc (Target_arm::arm_info): Initialize new fields
5106 attributes_section and attributes_vendor.
5107 * i386.cc (Target_i386::i386_info): Same.
5108 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5109 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5110 fields attributes_section and attributes_vendor.
53d7974c 5111 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5112 * target.h (Target::attributes_section, Target::attributes_vendor,
5113 Target::is_attributes_section, Target::attribute_arg_type,
5114 Target::attributes_order): New method definitions.
5115 (Target::Target_info::attributes_section,
5116 Target::Target_info::attributes_vendor): New fields.
5117 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5118 virtual method definitions.
5119 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5120 attributes_section and attributes_vendor.
5121 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5122
f4e5969c
DK
51232009-12-05 Doug Kwan <dougkwan@google.com>
5124
5125 * arm.cc: Update comments about interworking and stub generation.
5126 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5127 considered as non-PIC.
5128 (Arm_relocate_functions::base_abs): Fix formatting.
5129 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5130 of function to use GOT entry address instead of offset.
5131 (Target_arm::Scan::global): Issue an error if a symbol would need a
5132 PLT does not get one because it is untyped. Remove code to create
5133 dynamic symbols for relative branches.
5134 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5135 takes unsigned integer instead of boolean.
5136
1abce4a6
L
51372009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5138
5139 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5140 (two_file_test_LDADD): Likewise.
5141 (common_test_1_LDADD): Likewise.
5142 (exception_test_LDADD) Likewise.
5143 (weak_test_LDADD): Likewise.
5144 (many_sections_test_LDADD): Likewise.
5145 (initpri1_LDADD): Likewise.
5146 (script_test_1_LDADD): Likewise.
5147 (script_test_2_LDADD): Likewise.
5148 (justsyms_LDADD): Likewise.
5149 (binary_test_LDADD): Likewise.
5150 (large_LDADD): Likewise.
5151 * testsuite/Makefile.in: Regenerated.
5152
adcf2816 51532009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5154
adcf2816
L
5155 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5156 (Symbol_table::override_with_special): Likewise.
5157 (Symbol_table::add_from_object): Likewise.
5158
28e67f5d
RÁE
51592009-12-04 Rafael Avila de Espindola <espindola@google.com>
5160
5161 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5162 Don't set the data_offset twice.
5163
ae10a101
RÁE
51642009-12-04 Rafael Avila de Espindola <espindola@google.com>
5165
5166 * testsuite/Makefile.in: Regenerate.
5167
f59f41f3
DK
51682009-12-03 Doug Kwan <dougkwan@google.com>
5169
5170 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5171 (Target_arm::do_finalize_sections): Add parameter for symbol table
5172 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5173 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5174 parameter for symbol table pointer.
5175 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5176 an additional parameter for a pointer to symbol table.
5177 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5178 parameter for a symbol table pointer.
5179 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5180 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5181 Ditto.
5182 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5183 parameter for a symbol table pointer.
5184
ca55d848
RÁE
51852009-12-03 Rafael Avila de Espindola <espindola@google.com>
5186
5187 * incremental.cc (Incremental_inputs_header)
5188 (Incremental_inputs_header_write, Incremental_inputs_entry)
5189 (Incremental_inputs_entry_write): Move ...
5190 * incremental.h (Incremental_inputs_header)
5191 (Incremental_inputs_header_write, Incremental_inputs_entry)
5192 (Incremental_inputs_entry_write): here.
5193
3aec4f9c
RÁE
51942009-12-02 Rafael Avila de Espindola <espindola@google.com>
5195
5196 * incremental.cc (make_sized_incremental_binary): Set the target.
5197 Error if it is incompatible.
5198 * output.h (Output_file): Add filename method.
5199
9c0ae74d
RÁE
52002009-12-02 Rafael Avila de Espindola <espindola@google.com>
5201
5202 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5203 from the get_* methods.
5204
a45500ae
RÁE
52052009-12-02 Rafael Avila de Espindola <espindola@google.com>
5206
5207 * incremental-dump.cc (main): Check that the offeset of a script is 0.
5208 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5209 Write 0 for the data_offset of scripts.
5210
325e6408
RÁE
52112009-12-02 Rafael Avila de Espindola <espindola@google.com>
5212
5213 * testsuite/Makefile.am: Add the incremental_test.sh test.
5214 * testsuite/incremental_test.sh: New.
5215 * testsuite/incremental_test_1.c: New.
5216 * testsuite/incremental_test_2.c: New.
5217
954c3e2e
RÁE
52182009-12-01 Rafael Avila de Espindola <espindola@google.com>
5219
5220 * incremental-dump.cc (main): Fix typos.
5221
f8086623
RÁE
52222009-11-27 Rafael Avila de Espindola <espindola@google.com>
5223
5224 PR gold/11025
5225 * incremental-dump.cc (main): Use llu to print 64 bit values.
5226
3b0dd6ac
L
52272009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
5228 H.J. Lu <hongjiu.lu@intel.com>
5229
5230 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
5231 $(LIBDL).
5232 (incremental_dump_LDADD): Likewise.
5233 * Makefile.in: Regenerated.
5234
a6d1ef57 52352009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 5236
a6d1ef57
DK
5237 Revert:
5238
5239 2009-11-25 Doug Kwan <dougkwan@google.com>
5240
5241 * arm.cc (Target_arm::Target_arm): Move method definition
5242 outside of class definition. Add code to handle
5243 --target1-rel, --target1-abs and --target2= options.
5244 (Target_arm::get_reloc_reloc_type): Change method to be
5245 non-static and const.
5246 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
5247 New data member declaration.
5248 (Target_arm::Scan::local, Target_arm::Scan::global,
5249 Target_arm::Relocate::relocate,
5250 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5251 Adjust call to Target_arm::get_real_reloc_type.
5252 (Target_arm::get_real_reloc_type): Use command line options
5253 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5254 * options.h (--target1-rel, --target1-abs, --target2): New
5255 ARM-only options.
5256
50aeb7d4
DK
52572009-11-25 Doug Kwan <dougkwan@google.com>
5258
5259 * arm.cc (Target_arm::Target_arm): Move method definition outside of
5260 class definition. Add code to handle --target1-rel, --target1-abs
5261 and --target2= options.
5262 (Target_arm::get_reloc_reloc_type): Change method to be non-static
5263 and const.
5264 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
5265 member declaration.
5266 (Target_arm::Scan::local, Target_arm::Scan::global,
5267 Target_arm::Relocate::relocate,
5268 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
5269 call to Target_arm::get_real_reloc_type.
5270 (Target_arm::get_real_reloc_type): Use command line options to
5271 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5272 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
5273 options.
5274
51938283
DK
52752009-11-25 Doug Kwan <dougkwan@google.com>
5276
5277 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
5278 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
5279 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
5280 formatting.
5281 (Arm_relocate_functions::thm_call): Replace body with a call to
5282 Arm_relocate_functions::thumb_branch_common.
5283 (Arm_relocate_functions::thm_jump24,
5284 Arm_relocate_functions::thm_xpc22): New method definitions.
5285 (Arm_relocate_functions::thumb_branch_common): New method definition.
5286 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
5287 operator.
5288 (Target_arm::Relocate::relocate): Adjust call to thm_call.
5289 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
5290
e2b8f3c4
RÁE
52912009-11-24 Rafael Avila de Espindola <espindola@google.com>
5292
5293 * Makefile.am: Build incremental-dump
5294 * Makefile.in: Regenerate.
5295 * incremental-dump.cc: New.
5296 * incremental.cc (Incremental_inputs_header_data,
5297 Incremental_inputs_entry_data): Move to incremental.h
5298 * incremental.h: (Incremental_inputs_header_data,
5299 Incremental_inputs_entry_data): Move from incremental.cc
5300
bcba9aec
RÁE
53012009-11-24 Rafael Avila de Espindola <espindola@google.com>
5302
5303 * incremental.cc (Incremental_inputs_header,
5304 Incremental_inputs_header_write, Incremental_inputs_entry,
5305 Incremental_inputs_entry_write): Add a typedef with the data type.
5306
7c3afe08
RÁE
53072009-11-24 Rafael Avila de Espindola <espindola@google.com>
5308
5309 * incremental.cc (Incremental_inputs_header,
5310 Incremental_inputs_header_write, Incremental_inputs_entry,
5311 Incremental_inputs_entry_write): Update comment about which
5312 type has the filed descriptions.
5313
d204b6e9
DK
53142009-11-15 Doug Kwan <dougkwan@google.com>
5315
5316 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
5317 (Arm_relocate_functions::arm_branch_common): Change method defintion
5318 in class definition to a method declaration and update list of formal
5319 parameters.
5320 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
5321 Arm_relocation_functions::jump24): Adjust call to
5322 Arm_relocate_functions::arm_branch_common. Update list of formal
5323 parameters.
5324 (Arm_relocate_functions::xpc25): New method definition.
5325 (Arm_relocate_functions::arm_branch_common): Move method defintion
5326 out from class definition. Use stubs for mode-switching and extending
5327 branch ranges.
5328 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
5329 specially. Change code to enable use of stubs in ARM branches.
5330
43d12afe
DK
53312009-11-10 Doug Kwan <dougkwan@google.com>
5332
5333 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
5334 in method declaration.
5335 (Target_arm::relocate_stub): New method declaration.
5336 (Target_arm::default_target): Change to return a pointer instead of
5337 a const reference.
5338 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
5339 Target_arm::default_target.
5340 (Arm_Relobj::do_relocate_sections): Remove options paramater in
5341 method definition.
5342 (Target_arm::relocate_section): Adjust view.
5343 (Target_arm::relocate_stub): New method definition.
5344
ac33a407
DK
53452009-11-10 Doug Kwan <dougkwan@google.com>
5346
5347 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
5348 a format warning.
5349 * incremental.cc (open_incremental_binary): Initialized local
5350 variables to avoid warnings.
5351 * object.cc (make_elf_object): Ditto.
5352 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
5353 a format warning.
e1df38aa 5354
88ee28e9
L
5355009-11-09 H.J. Lu <hongjiu.lu@intel.com>
5356
5357 PR gold/10930
5358 * testsuite/plugin_test.c: Include "config.h".
5359
2daedcd6
DK
53602009-11-09 Doug Kwan <dougkwan@google.com>
5361
5362 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
5363 (arm_symbol_value): Remove.
5364 (Arm_relocate_functions::arm_branch_common,
5365 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
5366 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
5367 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
5368 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
5369 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
5370 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
5371 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
5372 Arm_relocate_functions::thm_mobw_abs_nc,
5373 Arm_relocate_functions::thm_mov_abs,
5374 Arm_relocate_functions::movw_prel_nc,
5375 Arm_relocate_functions::thm_movt_abs,
5376 Arm_relocate_functions::movt_prel,
5377 Arm_relocate_functions::thm_movw_prel_nc,
5378 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
5379 (Target_arm::Relocate::relocate): Only decompose address into two
5380 parts if relocation type uses the thumb-bit and pass the actual
5381 bit instead of a flag indicating that the thumb-bit is used. Adjust
5382 calls to methods in Arm_relocate_functions for this change.
5383
1276bc89 53842009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
5385
5386 PR 10925
5387 * reloc.cc: Instantiate
5388 Sized_relobj::initialize_input_to_output_maps and
5389 Sized_relobj:free_input_to_output_maps.
5390
e53ad1b5
ILT
53912009-11-06 Ian Lance Taylor <iant@google.com>
5392
5393 PR 10876
5394 * defstd.cc (in_segment): Set only_if_ref true for "end".
5395
eb44217c
DK
53962009-11-06 Doug Kwan <dougkwan@google.com>
5397
5398 * arm.cc (class Reloc_stub): Correct a comment.
5399 (Target_arm::Target_arm): Initialize arm_input_section_map_.
5400 (Target_arm::scan_section_for_stubs): New method declaration.
5401 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
5402 Change methods from private to protected.
5403 (Target_arm::do_may_relax): New method definition.
5404 (Target_arm::do_relax, Target_arm::group_sections,
5405 Target_arm::scan_reloc_for_stub,
5406 Target_arm::scan_reloc_section_for_stubs): New method declarations.
5407 (Target_arm::arm_input_section_map_): New data member declaration.
5408 (Target_arm::scan_reloc_for_stub,
5409 Target_arm::scan_reloc_section_for_stubs,
5410 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
5411 Target_arm::do_relax): New method definitions.
5412
5d329b7d
ILT
54132009-11-06 Mikolaj Zalewski <mikolaj@google.com>
5414
5415 * configure.ac: Check for (struct stat)::st_mtim
5416 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
5417 * config.in: Regenerate.
5418 * configure: Regenerate.
5419
96a0d71b
ILT
54202009-11-05 Ian Lance Taylor <iant@google.com>
5421
5422 PR 10910
5423 * output.cc (Output_segment::add_output_section): Add missing
5424 return statement.
5425
594c8e5e
ILT
54262009-11-04 Ian Lance Taylor <iant@google.com>
5427
5428 PR 10880
5429 * object.h (class Object): Add is_needed and set_is_needed
5430 methods. Add is_needed_ field. Make bool fields into bitfields.
5431 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
5432 defined in a dynamic object and referenced by a regular object,
5433 set is_needed for the dynamic object.
5434 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
5435 if the file is marked with as_needed and it is not needed.
5436
22b127cc
ILT
54372009-11-04 Ian Lance Taylor <iant@google.com>
5438
5439 PR 10887
5440 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
5441 tags if data is discarded by linker script.
5442 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5443 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5444 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5445 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5446
f5c870d2
ILT
54472009-11-04 Ian Lance Taylor <iant@google.com>
5448
5449 * layout.cc (Layout::get_output_section): Add is_interp and
5450 is_dynamic_linker_section parameters. Change all callers.
5451 (Layout::choose_output_section): Likewise.
5452 (Layout::make_output_section): Likewise.
5453 (Layout::add_output_section_data): Add is_dynamic_linker_section
5454 parameter. Change all callers.
5455 * layout.h (class Layout): Update declarations.
5456 * output.h (class Output_section): Add is_interp, set_is_interp,
5457 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
5458 Add is_interp_, is_dynamic_linker_section_ fields. Change
5459 generate_code_fills_at_write_ to a bitfield.
5460 * output.cc (Output_section::Output_sections): Initialize new
5461 fields.
5462 (Output_segment::add_output_section): Add do_sort parameter.
5463 Change all callers.
5464
1ae4d23b
ILT
54652009-11-03 Ian Lance Taylor <iant@google.com>
5466
5467 PR 10860
5468 * options.h (class General_options): Add --warn-common.
5469 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
5470 merging two common symbols.
5471 (Symbol_table::should_override): Handle --warn-common when merging
5472 a common symbol with a defined symbol. Use report_resolve_problem
5473 for multiple definitions.
5474 (Symbol_table::report_resolve_problem): New function.
5475 * symtab.h (class Symbol_table): Declare report_resolve_problem.
5476
55da9579
DK
54772009-11-03 Doug Kwan <dougkwan@google.com>
5478
5479 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
5480 stub_factory_.
5481 (Target_arm::stub_factory): New method definition.
5482 (Target_arm::new_arm_input_section,
5483 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
5484 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 5485 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
5486 New type definitions.
5487 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
5488 member declarations.
5489 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
5490 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
5491 New method definitions.
5492
37a9ac43
ILT
54932009-11-03 Ian Lance Taylor <iant@google.com>
5494
5495 * options.h (class General_options): Add --warn_constructors.
5496
b3d6a3d4
ILT
54972009-11-03 Ian Lance Taylor <iant@google.com>
5498
5499 PR 10893
5500 * defstd.cc (in_section): Add entries for __rel_iplt_start,
5501 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
5502
934b01dd
ILT
55032009-11-03 Ian Lance Taylor <iant@google.com>
5504
5505 PR 10895
5506 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
5507 --msgid-bugs-address.
5508 (install-pdf): New target.
5509 (install-data_yes): Look up one directory to find mkinstalldirs.
5510
03c1939b
L
55112009-11-03 H.J. Lu <hongjiu.lu@intel.com>
5512
5513 * po/Make-in (.po.gmo): Don't generate .gmo files in source
5514 tree.
5515
ebd95253
DK
55162009-10-30 Doug Kwan <dougkwan@google.com>
5517
5518 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
5519
e9bbb538
DK
55202009-10-30 Doug Kwan <dougkwan@google.com>
5521
5522 * arm.cc (Stub_addend_reader): New struct template definition
5523 and partial specializations.
5524 (Stub_addend_reader::operator()): New method definition for a
5525 partially specialized template.
5526
d5b40221
DK
55272009-10-30 Doug Kwan <dougkwan@google.com>
5528
5529 * arm.cc (Arm_relobj::processor_specific_flags): New method
5530 definition.
5531 (Arm_relobj::do_read_symbols): New method declaration.
5532 (Arm_relobj::processor_specific_flags_): New data member declaration.
5533 (Arm_dynobj): New class definition.
5534 (Target_arm::do_finalize_sections): Add input_objects parameter.
5535 (Target_arm::do_adjust_elf_header): New method declaration.
5536 (Target_arm::are_eabi_versions_compatible,
5537 (Target_arm::merge_processor_specific_flags): New method declaration.
5538 (Target_arm::do_make_elf_object): New overloaded method definitions
5539 and declaration.
5540 (Arm_relobj::do_read_symbols): New method definition.
5541 (Arm_dynobj::do_read_symbols): Ditto.
5542 (Target_arm::do_finalize_sections): Add input_objects parameters.
5543 Merge processor-specific flags from all input objects.
5544 (Target_arm::are_eabi_versions_compatible,
5545 Target_arm::merge_processor_specific_flags,
5546 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
5547 New method definitions.
5548 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
5549 Input_objects pointer type parameter.
5550 * layout.cc (Layout::finalize): Pass input objects to target's.
5551 finalize_sections function.
5552 * output.cc (Output_file_header::do_sized_write): Set ELF file
5553 header's processor-specific flags.
5554 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
5555 Input_objects pointer type parameter.
5556 * sparc.cc (Target_sparc::do_finalize_sections): Same.
5557 * target.h (Input_objects): New forward class declaration.
5558 (Target::processor_specific_flags,
5559 Target::are_processor_specific_flags_sect): New method definitions.
5560 (Target::finalize_sections): Add input_objects parameter.
5561 (Target::Target): Initialize processor_specific_flags_ and
5562 are_processor_specific_flags_set_.
5563 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
5564 parameter.
5565 (Target::set_processor_specific_flags): New method definition.
5566 (Target::processor_specific_flags_,
5567 Target::are_processor_specific_flags_set_): New data member
5568 declarations.
5569 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
5570 Input_objects pointer type parameter.
5571
ebabffbd
DK
55722009-10-30 Doug Kwan <dougkwan@google.com>
5573
5574 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
5575
ad0f2072
ILT
55762009-10-28 Ian Lance Taylor <iant@google.com>
5577
5578 * object.h (class Relobj): Drop options parameter from
5579 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
5580 do_scan_relocs, do_relocate. Change all callers.
5581 (class Sized_relobj): Drop options parameters from
5582 do_gc_process_relocs, do_scan_relocs, do_relocate,
5583 do_relocate_sections, relocate_sections, emit_relocs_scan,
5584 emit_relocs_scan_reltype. Change all callers.
5585 (struct Relocate_info): Remove options field and all references to
5586 it.
5587 * reloc.h (class Read_relocs): Remove options constructor
5588 parameter and options_ field. Change all callers.
5589 (class Gc_process_relocs, class Scan_relocs): Likewise.
5590 (class Relocate_task): Likewise.
5591 * target-reloc.h (scan_relocs): Remove options parameter. Change
5592 all callers.
5593 (scan_relocatable_relocs): Likewise.
5594 * target.h (class Sized_target): Remove options parameter from
5595 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
5596 all callers.
5597 * gc.h (gc_process_relocs): Remove options parameter. Change all
5598 callers.
5599 * arm.cc: Update functions to remove options parameters.
5600 * i386.cc: Likewise.
5601 * powerpc.cc: Likewise.
5602 * sparc.cc: Likewise.
5603 * x86_64.cc: Likewise.
5604 * testsuite/testfile.cc: Likewise.
5605
8ffa3667
DK
56062009-10-28 Doug Kwan <dougkwan@google.com>
5607
5608 * arm.cc (Arm_relobj): New class definition.
e1df38aa 5609 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
5610 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
5611 New method definitions.
5612
40f36857
CC
56132009-10-28 Cary Coutant <ccoutant@google.com>
5614
5615 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
5616 (Plugin::cleanup_done_): New member.
5617 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
5618 (Plugin_manager::cleanup_done_): Remove.
5619 (Plugin_manager::add_input_file): Edit error message.
5620 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
5621 (Plugin_manager::cleanup): Remove use of cleanup_done_.
5622
2c849493
ILT
56232009-10-27 Mikolaj Zalewski <mikolajz@google.com>
5624
5625 * fileread.cc: (File_read::View::~View): Use the new
5626 data_ownership_ filed.
5627 (File_read::~File_read): Dispose the new whole_file_view_.
5628 (File_read::open): Mmap the whole file if needed.
5629 (File_read::open): Use whole_file_view_ instead of contents_.
5630 (File_read::find_view): Use whole_file_view_ if applicable.
5631 (File_read::do_read): Use whole_file_view_ instead of contents_.
5632 (File_read::make_view): Use whole_file_view_ instead of contents_,
5633 update File_read::View::View call.
5634 (File_read::find_or_make_view): Update File_read::View::View
5635 call.
5636 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
5637 remove contents_
5638 (File_read::View::Data_ownership): New enum.
5639 (File_read::View::View): Replace bool mapped_ with Data_ownership
5640 argument.
5641 (File_read::View::mapped_): Remove (replaced by data_ownership_).
5642 (File_read::View::data_ownership_): New field.
5643 (File_read::contents_): Remove (replaced by whole_file_view_).
5644 (File_read::whole_file_view_): New field.
5645 * options.h (class General_options): Add --keep-files-mapped.
5646
24998053
CC
56472009-10-27 Cary Coutant <ccoutant@google.com>
5648
5649 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
5650 * testsuite/Makefile.am (plugin_test_5): New test case.
5651 * testsuite/Makefile.in: Regenerate.
5652
72adc4fa
DK
56532009-10-25 Doug Kwan <dougkwan@google.com>
5654
5655 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
5656 from private to protected to allow access by child class.
5657 (Sized_relobj::do_relocate_sections): New method declaration.
5658 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 5659 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
5660 Sized_relobj::relocate_sections. Instantiate template explicitly
5661 for different target sizes and endianity.
5662
07f508a2
DK
56632009-10-24 Doug Kwan <dougkwan@google.com>
5664
5665 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
5666 (Arm_input_section::as_arm_input_section): New method.
5667 (Arm_output_section): New class definition.
5668 (Arm_output_section::create_stub_group,
5669 Arm_output_section::group_sections): New method definitions.
5670
10ad9fe5
DK
56712009-10-22 Doug Kwan <dougkwan@google.com>
5672
5673 * arm.cc (Arm_input_section): New class definition.
5674 (Arm_input_section::init, Arm_input_section:do_write,
5675 Arm_input_section::set_final_data_size,
5676 Arm_input_section::do_reset_address_and_file_offset): New method
5677 definitions.
5678
56ee5e00
DK
56792009-10-21 Doug Kwan <dougkwan@google.com>
5680
5681 * arm.cc (Stub_table, Arm_input_section): New forward class
5682 declarations.
5683 (Stub_table): New class defintion.
5684 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
5685 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
5686 New method definition.
5687
b569affa
DK
56882009-10-21 Doug Kwan <dougkwan@google.com>
5689
5690 * arm.cc: Update copyright comments.
5691 (Target_arm): New forward class template declaration.
5692 (Arm_address): New type.
5693 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
5694 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
5695 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
5696 constants.
5697 (Insn_template): Same.
5698 (DEF_STUBS): New macro.
5699 (Stub_type): New enum type.
5700 (Stub_template): New class definition.
5701 (Stub): Same.
5702 (Reloc_stub): Same.
5703 (Stub_factory): Same.
5704 (Target_arm::Target_arm): Initialize may_use_blx_ and
5705 should_force_pic_veneer_.
5706 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
5707 Target_arm::should_force_pic_veneer,
5708 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
5709 Target_arm::using_thumb_only, Target_arm:;default_target): New
5710 method defintions.
5711 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
5712 New data member declarations.
5713 (Insn_template::size, Insn_template::alignment): New method defintions.
5714 (Stub_template::Stub_template): New method definition.
5715 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
5716 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
5717 (Stub_factory::Stub_factory): New method definition.
5718 * gold.h (string_hash): New template.
5719 * output.h (Input_section_specifier::hash_value): Use
5720 gold::string_hash.
5721 (Input_section_specifier::string_hash): Remove.
5722 * stringpool.cc (Stringpool_template::string_hash): Use
5723 gold::string_hash.
5724
6c172549
DK
57252009-10-20 Doug Kwan <dougkwan@google.com>
5726
5727 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
5728 symbols of relaxed input sections.
5729 * output.h (Output_section::find_relaxed_input_section): Make
5730 method public.
5731
c5617f2f
DK
57322009-10-16 Doug Kwan <dougkwan@google.com>
5733
5734 * dynobj.cc (Versions::Versions): Initialize version_script_.
5735 Only insert base version symbol definition for a shared object
5736 if version script defines any version versions.
5737 (Versions::define_base_version): New method definition.
5738 (Versions::add_def): Check that base version is not needed.
5739 (Versions::add_need): Define base version lazily.
5740 * dynobj.h (Versions::define_base_version): New method declaration.
5741 (Versions::needs_base_version_): New data member declaration.
5742 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
5743 (check_DATA): Add no_version_test.stdout.
5744 (libno_version_test.so, no_version_test.o no_version_test.stdout):
5745 New make rules.
5746 * testsuite/Makefile.in: Regenerate.
5747 * testsuite/no_version_test.c: New file.
5748 * testsuite/no_version_test.sh: Ditto.
5749
3c12dcdb
DK
57502009-10-16 Doug Kwan <dougkwan@google.com>
5751
5752 * expression.cc (class Segment_start_expression): New class definition.
5753 (Segment_start_expression::value): New method definition.
5754 (script_exp_function_segment_start): Return a new
5755 Segment_start_expression.
5756 * gold/script-c.h (script_saw_segment_start_expression): New function
5757 prototype.
5758 * script-sections.cc (Script_sections::Script_sections): Initialize
5759 SAW_SEGMENT_START_EXPRESSION_ to false.
5760 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
5761 and -Tbbs options to specify section addresses if given in
5762 command line and no SEGMENT_START expression is seen in a script.
5763 * script-sections.h (Script_sections::saw_segment_start_expression,
5764 Script_sections::set_saw_segment_start_expression): New method
5765 definition.
5766 (Script_sections::saw_segment_start_expression_): New data member
5767 declaration.
5768 * script.cc (script_saw_segment_start_expression): New function.
5769 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
5770 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
5771 script_test_7.sh and script_test_8.sh.
5772 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
5773 script_test_8.stdout.
5774 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
5775 (script_test_6, script_test_6.stdout, script_test_7,
5776 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
5777 * Makefile.in: Regenerate.
5778 * testsuite/script_test_6.sh: New file.
5779 * testsuite/script_test_6.t: Same.
5780 * testsuite/script_test_7.sh: Same.
5781 * testsuite/script_test_7.t: Same.
5782 * testsuite/script_test_8.sh: Same.
5783
64b1ae37
DK
57842009-10-16 Doug Kwan <dougkwan@google.com>
5785
5786 * output.cc (Output_segment::set_section_list_address): Cast
5787 expressions to unsigned long long type to avoid format warnings.
5788
661be1e2
ILT
57892009-10-15 Ian Lance Taylor <iant@google.com>
5790
12edd763 5791 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 5792 dot assignment to script_sections_.
12edd763
ILT
5793 * script-sections.cc (Script_sections::add_dot_assignment):
5794 Initialize if necessary.
5795
68b6574b
ILT
5796 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
5797 program headers with no load segment if there is a linker script.
5798
661be1e2
ILT
5799 * layout.cc (Layout::set_segment_offsets): Align the file offset
5800 to the segment aligment for -N or -n with no load segment.
5801 * output.cc (Output_segment::add_output_section): Don't crash if
5802 the first section is a TLS section.
5803 (Output_segment::set_section_list_addresses): Print an error
5804 message if the address moves backward in a linker script.
5805 * script-sections.cc
5806 (Output_section_element_input::set_section_addresses): Don't
5807 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
5808 (Orphan_output_section::set_section_addresses): Likewise.
5809
f15f61a7
DK
58102009-10-15 Doug Kwan <dougkwan@google.com>
5811
5812 * layout.cc (Layout::finish_dynamic_section): Generate tags
5813 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
5814 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
5815 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
5816
82bb573a
ILT
58172009-10-14 Ian Lance Taylor <iant@google.com>
5818
5819 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
5820 fields.
5821 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
5822 data_shdr fields of relinfo.
5823 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
5824 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
5825 R_386_TLS_LDO_32, adjust based on section flags.
5826 (Target_i386::Relocate::fix_up_ldo): Remove.
5827
374ad285
ILT
58282009-10-13 Ian Lance Taylor <iant@google.com>
5829
5830 Add support for -pie.
5831 * options.h (class General_options): Add -pie and
5832 --pic-executable.
5833 (General_options::output_is_position_independent): Test -pie.
5834 (General_options::output_is_executable): Return true if not shared
5835 and not relocatable.
5836 (General_options::output_is_pie): Remove.
5837 * options.cc (General_options::finalize): Reject incompatible uses
5838 of -pie.
5839 * gold.cc (queue_middle_tasks): A -pie link is not static.
5840 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
5841 * symtab.cc (Symbol::final_value_is_known): Return false if
5842 output_is_position_independent.
5843 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
5844 output_is_position_independent.
5845 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
5846 output_is_position_independent.
5847 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
5848 output_is_position_independent.
5849 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
5850 two_file_pie_test.
5851 (basic_pie_test.o, basic_pie_test): New targets.
5852 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
5853 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
5854 (two_file_pie_test): New target.
5855 * testsuite/Makefile.in: Rebuild.
5856 * README: Remove note saying that -pie is not supported.
5857
c6585162
ILT
58582009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
5859
5860 * options.h (class General_options): Add -init and -fini.
5861 * layout.cc (Layout::finish_dynamic_section): Emit
5862 given init and fini functions.
5863
032ce4e9
ST
58642009-10-13 Sriraman Tallam <tmsriram@google.com>
5865
5866 * gc.h (gc_process_relocs): Check if icf is enabled using new
5867 function.
5868 * gold.cc (queue_initial_tasks): Likewise.
5869 (queue_middle_tasks): Likewise.
5870 * object.cc (do_layout): Likewise.
5871 * symtab.cc (is_section_folded): Likewise.
5872 * main.cc (main): Likewise.
5873 * reloc.cc (Read_relocs::run): Likewise.
5874 (Sized_relobj::do_scan_relocs): Likewise.
5875 * icf.cc (is_function_ctor_or_dtor): New function.
5876 (Icf::find_identical_sections): Check if function is ctor or dtor when
5877 safe icf is chosen.
5878 * options.h (General_options::icf): Change option to be an enum.
5879 (Icf_status): New enum.
5880 (icf_enabled): New method.
5881 (icf_safe_folding): New method.
5882 (set_icf_status): New method.
5883 (icf_status_): New variable.
5884 * (options.cc) (General_options::finalize): Set icf_status_.
5885 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
5886 icf_test and icf_keep_unique_test to use the --icf enum flag.
5887 * testsuite/icf_safe_test.sh: New file.
e1df38aa 5888 * testsuite/icf_safe_test.cc: New file.
032ce4e9 5889
f345227a
ST
58902009-10-12 Sriraman Tallam <tmsriram@google.com>
5891
5892 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
5893 includes to gc.h and icf.h.
5894 * arm.cc: Include gc.h.
5895 * gold.cc: Likewise.
5896 * i386.cc: Likewise.
5897 * powerpc.cc: Likewise.
5898 * sparc.cc: Likewise.
5899 * x86_64.cc: Likewise.
5900 * gc.h: Include icf.h.
5901
1c7814ed
ILT
59022009-10-11 Ian Lance Taylor <iant@google.com>
5903
5904 * plugin.cc: Include "gold.h" before other header files.
5905
ae3b5189
CD
59062009-10-10 Chris Demetriou <cgd@google.com>
5907
5908 * options.h (Input_file_argument::Input_file_type): New enum.
5909 (Input_file_argument::is_lib_): Replace with...
5910 (Input_file_argument::type_): New member.
5911 (Input_file_argument::Input_file_argument): Take Input_file_type
5912 'type' rather than boolean 'is_lib' as second argument.
5913 (Input_file_argument::is_lib): Use type_.
5914 (Input_file_argument::is_searched_file): New function.
5915 (Input_file_argument::may_need_search): Handle is_searched_file.
5916 * options.cc (General_options::parse_library): Support -l:filename.
5917 (General_options::parse_just_symbols): Update for Input_file_argument
5918 changes.
5919 (Command_line::process): Likewise.
5920 * archive.cc (Archive::get_file_and_offset): Likewise.
5921 * plugin.cc (Plugin_manager::release_input_file): Likewise.
5922 * script.cc (read_script_file, script_add_file): Likewise.
5923 * fileread.cc (Input_file::Input_file): Likewise.
5924 (Input_file::will_search_for): Handle is_searched_file.
5925 (Input_file::open): Likewise.
5926 * readsyms.cc (Read_symbols::get_name): Likewise.
5927 * testsuite/Makefile.am (searched_file_test): New test.
5928 * testsuite/Makefile.in: Regenerate.
5929 * testsuite/searched_file_test.cc: New file.
5930 * testsuite/searched_file_test_lib.cc: New file.
5931
f3048a1d
ILT
59322009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5933 Ian Lance Taylor <iant@google.com>
5934
5935 * descriptor.cc: Include <cstdio> and "binary-io.h".
5936 (Descriptors::open): Open the files in binary mode always.
5937 * script.cc (Lex::get_token): Treat \r as whitespace.
5938
d4780e57
ILT
59392009-10-09 Ian Lance Taylor <iant@google.com>
5940
5941 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
5942
d9a893b8
ILT
59432009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5944 Ian Lance Taylor <iant@google.com>
5945
5946 * configure.ac: Check for readv function also.
5947 * fileread.cc (readv): Define if not HAVE_READV.
5948 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
5949 does not exist.
5950 * config.in: Regenerate.
5951 * configure: Regenerate.
5952
c0a62865
DK
59532009-10-09 Doug Kwan <dougkwan@google.com>
5954
5955 * layout.cc (Layout::make_output_section): Call target hook to make
5956 ordinary output section.
5957 (Layout::finalize): Adjust parameter list of call the
5958 Target::may_relax().
5959 * layout.h (class Layout::section_list): New method.
5960 * merge.h (Output_merge_base::entsize): Change visibility to public.
5961 (Output_merge_base::is_string, Output_merge_base::do_is_string):
5962 New methods.
5963 (Output_merge_string::do_is_string): New method.
5964 * object.cc (Sized_relobj::do_setup): renamed from
5965 Sized_relobj::set_up.
5966 * object.h (Sized_relobj::adjust_shndx,
5967 Sized_relobj::initializ_input_to_output_maps,
5968 Sized_relobj::free_input_to_output_maps): Change visibilities to
5969 protected.
5970 (Sized_relobj::setup): Virtualize.
5971 (Sized_relobj::do_setup): New method declaration.
5972 (Sized_relobj::invalidate_section_offset,
5973 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
5974 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
5975 * options.cc (parse_int): New function.
5976 * options.h (parse_int): New declaration.
5977 (DEFINE_int): New macro.
5978 (stub_group_size): New option.
5979 * output.cc (Output_section::Output_section): Initialize memebers
5980 merge_section_map_, merge_section_by_properties_map_,
5981 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
5982 (Output_section::add_input_section): Handled deferred code-fill
5983 generation and remove an old comment.
5984 (Output_section::add_relaxed_input_section): New method definition.
5985 (Output_section::add_merge_input_section): Use merge section by
5986 properties map to speed to search. Update merge section maps
5987 as appropriate.
5988 (Output_section::build_relaxation_map): New method definition.
5989 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5990 Same.
5991 (Output_section::relax_input_section): Renamed to
5992 Output_section::convert_input_sections_to_relaxed_sections and change
5993 interface to take a vector of pointers to relaxed sections.
5994 (Output_section::find_merge_section,
5995 Output_section::find_relaxed_input_section): New method definitions.
5996 (Output_section::is_input_address_mapped,
5997 Output_section::output_offset, Output_section::output_address):
5998 Use output section data maps to speed up searching.
5999 (Output_section::find_starting_output_address): Add comments.
6000 (Output_section::do_write,
6001 Output_section::write_to_postprocessing_buffer): Do code-fill
6002 generation as appropriate.
6003 (Output_section::get_input_sections): Invalidate relaxed input section
6004 map.
6005 (Output_section::restore_states): Adjust type of checkpoint .
6006 Invalidate relaxed input section map.
6007 * output.h (Output_merge_base): New class declaration.
6008 (Input_section_specifier): New class defintion.
6009 (class Output_relaxed_input_section) Change base class to
6010 Output_section_data_build.
6011 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6012 base class initializer.
6013 (Output_section::add_relaxed_input_section): New method declaration.
6014 (Output_section::Input_section): Change visibility to protected.
6015 (Output_section::Input_section::relobj,
6016 Output_section::Input_section::shndx): Handle relaxed input sections.
6017 Output_section::input_sections) Change visibility to protected. Also
6018 define overload to return a non-const pointer.
6019 (Output_section::Merge_section_properties): New class defintion.
6020 (Output_section::Merge_section_by_properties_map,
6021 Output_section::Output_section_data_by_input_section_map,
6022 Output_section::Relaxation_map): New types.
6023 (Output_section::relax_input_section): Rename method to
6024 Output_section::convert_input_sections_to_relaxed_sections and change
6025 interface to take a vector of relaxed section pointers.
6026 (Output_section::find_merge_section,
6027 Output_section::find_relaxed_input_section,
6028 Output_section::build_relaxation_map,
6029 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6030 New method declarations.
6031 (Output_section::merge_section_map_
6032 Output_section::merge_section_by_properties_map_,
6033 Output_section::relaxed_input_section_map_,
6034 Output_section::is_relaxed_input_section_map_valid_,
6035 Output_section::generate_code_fills_at_write_): New data members.
6036 * script-sections.cc
6037 (Output_section_element_input::set_section_addresses): Call
6038 current_data_size and addralign methods of relaxed input sections.
6039 (Orphan_output_section::set_section_addresses): Call current_data_size
6040 and addralign methods of relaxed input sections.
6041 * symtab.cc (Symbol_table::compute_final_value): Extract template
6042 from the body of Symbol_table::sized_finalize_symbol.
6043 (Symbol_table::sized_finalized_symbol): Call
6044 Symbol_table::compute_final_value.
6045 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6046 (Symbol_table::compute_final_value): New templated method declaration.
6047 * target.cc (Target::do_make_output_section): New method defintion.
6048 * target.h (Target::make_output_section): New method declaration.
6049 (Target::relax): Add more parameters for input objects, symbol table
6050 and layout. Adjust call to do_relax.
6051 (Target::do_make_output_section): New method declaration.
6052 (Target::do_relax): Add parameters for input objects, symbol table
6053 and layout.
6054
d446d6c4
ILT
60552009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6056
6057 * pread.c: Include stdio.h.
6058
bc06c745
ILT
60592009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6060
6061 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6062 defined.
6063
75aea3d0
ILT
60642009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6065
6066 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6067 Change read_shndx type to unsigned int.
6068 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6069 int.
6070 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6071 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6072 Change read_shndx type to unsigned int.
6073 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6074 int.
6075 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6076 * layout.cc (Layout::create_symtab_sections): Cast the result of
6077 local_symcount * symsize to off_t in the gold_assert.
6078
be8fcb75
ILT
60792009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6080
6081 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6082 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6083 R_ARM_BASE_ABS.
6084 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6085 (Arm_relocate_functions::thm_abs5): New function.
6086 (Arm_relocate_functions::abs12): New function.
6087 (Arm_relocate_functions::abs16): New function.
6088 (Arm_relocate_functions::base_abs): New function.
6089 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6090 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6091 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6092 R_ARM_BASE_ABS.
6093 (Scan::global): Likewise.
6094 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6095 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6096 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6097 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6098 R_ARM_BASE_ABS.
6099
c2a122b6
ILT
61002009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6101
6102 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6103 (Arm_relocate_functions::movt_prel): New function.
6104 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6105 (Arm_relocate_functions::thm_movt_prel): New function.
6106 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6107 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6108 (Scan::global, Relocate::relocate): Likewise.
6109 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6110
c4aa1e2d
ILT
61112009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6112
6113 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6114 Incremental_checker.
6115 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6116 unsigned int.
6117 (class Incremental_inputs_header): New class.
6118 (Incremental_inputs_header_writer): Edit comment.
6119 (Incremental_inputs_entry): New class.
6120 (Incremental_inputs_entry_writer): Edit comment.
6121 (Sized_incremental_binary::do_find_incremental_inputs_section):
6122 Add *strtab_shndx parameter, fill it.
6123 (Sized_incremental_binary::do_check_inputs): New method.
6124 (Incremental_checker::can_incrementally_link_output_file): Use
6125 Sized_incremental_binary::check_inputs.
6126 (Incremental_inputs::report_command_line): Save command line in
6127 command_line_.
6128 * incremental.h:
6129 (Incremental_binary::find_incremental_inputs_section): New
6130 method.
6131 (Incremental_binary::do_find_incremental_inputs_section): Add
6132 strtab_shndx parameter.
6133 (Incremental_binary::do_check_inputs): New pure virtual method.
6134 (Sized_incremental_binary::do_check_inputs): Declare.
6135 (Incremental_checker::Incremental_checker): Add incremental_inputs
6136 parameter, use it to initialize incremental_inputs_.
6137 (Incremental_checker::incremental_inputs_): New field.
6138 (Incremental_checker::command_line): New method.
6139 (Incremental_checker::inputs): New method.
6140 (Incremental_checker::command_line_): New field.
6141
c549a694
ILT
61422009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6143
6144 * incremental.cc: Include <cstdarg> and "target-select.h".
6145 (vexplain_no_incremental): New function.
6146 (explain_no_incremental): New function.
6147 (Incremental_binary::error): New method.
6148 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6149 method.
6150 (make_sized_incremental_binary): New function.
6151 (open_incremental_binary): New function.
6152 (can_incrementally_link_file): Add checks if output is ELF and has
6153 inputs section.
6154 * incremental.h: Include "elfcpp_file.h" and "output.h".
6155 (Incremental_binary): New class.
6156 (Sized_incremental_binary): New class.
6157 (open_incremental_binary): Declare.
6158 * object.cc (is_elf_object): Use
6159 elfcpp::Elf_recognizer::is_elf_file.
6160 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6161 * output.h (Output_file::filesize): New method.
6162
fd3c5f0b
ILT
61632009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6164
6165 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6166 New function.
6167 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6168 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6169 function.
6170 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6171 function.
6172 (Arm_relocate_functions::movw_abs_nc): New function.
6173 (Arm_relocate_functions::movt_abs): New function.
6174 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6175 (Arm_relocate_functions::thm_movt_abs): New function.
6176 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6177 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6178 (Scan::global): Likewise.
6179 (Relocate::relocate): Likewise.
6180 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6181
7f5309a5
ILT
61822009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6183
6184 * arm.cc (Arm_relocate_functions::got_prel) New function.
6185 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6186 (Relocate::relocate): Likewise.
6187 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6188
364c7fa5
ILT
61892009-10-06 Ian Lance Taylor <iant@google.com>
6190
6191 * options.h (class General_options): Define
6192 split_stack_adjust_size parameter.
6193 * object.h (class Object): Add uses_split_stack_ and
6194 has_no_split_stack_ fields. Add uses_split_stack and
6195 has_no_split_stack accessor functions. Declare
6196 handle_split_stack_section.
6197 (class Reloc_symbol_changes): Define.
6198 (class Sized_relobj): Define Function_offsets. Declare
6199 split_stack_adjust, split_stack_adjust_reltype, and
6200 find_functions.
6201 * object.cc (Object::handle_split_stack_section): New function.
6202 (Sized_relobj::do_layout): Call handle_split_stack_section.
6203 * dynobj.cc (Sized_dynobj::do_layout): Call
6204 handle_split_stack_section.
6205 * reloc.cc (Sized_relobj::relocate_sections): Call
6206 split_stack_adjust for executable sections in split_stack
6207 objects. Pass reloc_map to relocate_section.
6208 (Sized_relobj::split_stack_adjust): New function.
6209 (Sized_relobj::split_stack_adjust_reltype): New function.
6210 (Sized_relobj::find_functions): New function.
6211 * target-reloc.h: Include "object.h".
6212 (relocate_section): Add reloc_symbol_changes parameter. Change
6213 all callers.
6214 * target.h (class Target): Add calls_non_split method. Declare
6215 do_calls_non_split virtual method. Declare match_view and
6216 set_view_to_nop.
6217 * target.cc: Include "elfcpp.h".
6218 (Target::do_calls_non_split): New function.
6219 (Target::match_view): New function.
6220 (Target::set_view_to_nop): New function.
6221 * gold.cc (queue_middle_tasks): Give an error if mixing
6222 split-stack and non-split-stack objects with -r.
6223 * i386.cc (Target_i386::relocate_section): Add
6224 reloc_symbol_changes parameter.
6225 (Target_i386::do_calls_non_split): New function.
6226 * x86_64.cc (Target_x86_64::relocate_section): Add
6227 reloc_symbol_changes parameter.
6228 (Target_x86_64::do_calls_non_split): New function.
6229 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
6230 parameter.
6231 * powerpc.cc (Target_powerpc::relocate_section): Add
6232 reloc_symbol_changes parameter.
6233 * sparc.cc (Target_sparc::relocate_section): Add
6234 reloc_symbol_changes parameter.
6235 * configure.ac: Call AM_CONDITIONAL for the default target.
6236 * configure: Rebuild.
6237 * testsuite/Makefile.am (TEST_AS): New variable.
6238 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
6239 (check_DATA): Add split_i386 and split_x86_64 files.
6240 (SPLIT_DEFSYMS): Define.
6241 (split_i386_[1234n].o): New targets.
6242 (split_i386_[124]): New targets.
6243 (split_i386_[1234r].stdout): New targets.
6244 (split_x86_64_[1234n].o): New targets.
6245 (split_x86_64_[124]): New targets.
6246 (split_x86_64_[1234r].stdout): New targets.
6247 (MOSTLYCLEANFILES): Add new executables.
6248 * testsuite/split_i386.sh: New file.
6249 * testsuite/split_x86_64.sh: New file.
6250 * testsuite/split_i386_1.s: New file.
6251 * testsuite/split_i386_2.s: New file.
6252 * testsuite/split_i386_3.s: New file.
6253 * testsuite/split_i386_4.s: New file.
6254 * testsuite/split_i386_n.s: New file.
6255 * testsuite/split_x86_64_1.s: New file.
6256 * testsuite/split_x86_64_2.s: New file.
6257 * testsuite/split_x86_64_3.s: New file.
6258 * testsuite/split_x86_64_4.s: New file.
6259 * testsuite/split_x86_64_n.s: New file.
6260 * testsuite/testfile.cc (Target_test): Update relocation_section
6261 function.
6262 * testsuite/Makefile.in: Rebuild.
6263
e8a9fcda
ILT
62642009-10-06 Ian Lance Taylor <iant@google.com>
6265
6266 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
6267 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
6268 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
6269 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
6270 the address on ldo_addrs_.
6271 (Target_i386::Relocate::fix_up_ldo): New function.
6272
e99daf92
ILT
62732009-10-06 Rafael Espindola <espindola@google.com>
6274
6275 * plugin.cc (add_input_library): New.
6276 (Plugin::load): Add add_input_library to tv.
6277 (Plugin_manager::add_input_file): Add the is_lib argument.
6278 (add_input_file): Update call to Plugin_manager::add_input_file.
6279 (add_input_library): New.
6280 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
6281
966d4097
DK
62822009-09-30 Doug Kwan <dougkwan@google.com>
6283
6284 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
6285 symbol and call Symbol::may_need_copy_reloc to determine if
6286 a copy reloc is needed.
6287 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
6288 nocopyreloc is given in command line.
6289 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
6290 given in command line.
6291 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
6292 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
6293 of the removed Target_i386::may_need_copy_reloc.
6294 * options.h (copyreloc): New option with default value false.
6295 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6296 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
6297 instead of the removed Target_powerpc::may_need_copy_reloc.
6298 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6299 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
6300 instead of the removed Target_sparc::may_need_copy_reloc.
6301 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
6302 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
6303 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
6304 instead of the removed Target_x86_64::may_need_copy_reloc.
6305
029ba973
ILT
63062009-09-30 Ian Lance Taylor <iant@google.com>
6307
6308 * object.h (class Object): Remove target_ field, and target,
6309 sized_target, and set_target methods.
6310 (Object::sized_target): Remove.
6311 (class Sized_relobj): Update declarations. Remove sized_target.
6312 * object.cc (Sized_relobj::setup): Remove target parameter.
6313 Change all callers.
6314 (Input_objects::add_object): Don't do anything with the target.
6315 (make_elf_sized_object): Add punconfigured parameter. Change all
6316 callers. Set or test parameter target.
6317 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
6318 Change all callers.
6319 * parameters.cc (Parameters::set_target): Change parameter type to
6320 be non-const.
6321 (Parameters::default_target): Remove.
6322 (set_parameters_target): Change parameter type to be non-const.
6323 (parameters_force_valid_target): New function.
6324 (parameters_clear_target): New function.
6325 * parameters.h (class Parameters): Update declarations. Remove
6326 default_target method. Add sized_target and clear_target
6327 methods. Change target_ to be non-const.
6328 (set_parameters_target): Update declaration.
6329 (parameters_force_valid_target): Declare.
6330 (parameters_clear_target): Declare.
6331 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
6332 as NULL if we aren't searching.
6333 (Add_symbols::run): Don't check for compatible target.
6334 * fileread.cc (Input_file::open_binary): Call
6335 parameters_force_valid_target.
6336 * gold.cc (queue_middle_tasks): Likewise.
6337 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
6338 set_target on object.
6339 * dynobj.h (class Sized_dynobj): Update declarations.
6340 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
6341 make_elf_object returns NULL.
6342 (Archive::include_member): Don't check whether object target is
6343 compatible.
6344 * output.cc (Output_section::add_input_section): Get target from
6345 parameters.
6346 (Output_section::relax_input_section): Likewise.
6347 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
6348 parameters.
6349 (Sized_relobj::do_scan_relocs): Likewise.
6350 (Sized_relobj::relocate_sections): Likewise.
6351 * resolve.cc (Symbol_table::resolve): Likewise.
6352 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
6353 parameter. Change all callers.
6354 (Symbol_table::add_from_object): Get target from parameters.
6355 (Symbol_table::add_from_relobj): Don't check object target.
6356 (Symbol_table::add_from_dynobj): Likewise.
6357 (Symbol_table::define_special_symbol): Get target from
6358 parameters.
6359 * symtab.h (class Symbol_table): Update declaration.
6360 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
6361 parameter. Change all callers. Clear parameter target.
6362 (Binary_test): Test target here.
6363 * testsuite/object_unittest.cc (gold_testsuite): Remove
6364 target_test_pointer parameter. Change all callers.
6365 (Object_test): Test target here.
6366
a6a22b83
ILT
63672009-09-26 Ian Lance Taylor <iant@google.com>
6368
6369 * testsuite/initpri1.c: Don't try to use constructor priorities if
6370 compiling with gcc before 4.3.
6371
6a8f49fe
ILT
63722009-09-22 Mikolaj Zalewski <mikolajz@google.com>
6373
6374 * testsuite/retain_symbols_file_test.sh (check_present): Change
6375 output file name to retain_symbols_file_test.stdout.
6376 (check_absent): Likewise.
6377
8c604651
CS
63782009-09-18 Craig Silverstein <csilvers@google.com>
6379
6380 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
6381 * options.cc: Include <cerrno> and <fstream>.
6382 (General_options::finalize): Parse -retain-symbols-file tag.
6383 * options.h: New flag.
6384 (General_options): New method should_retain_symbol, new
6385 variable symbols_to_retain.
6386 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
6387 should_retain_symbol map.
6388 * testsuite/Makefile.am (retain_symbols_file_test): New test.
6389 * testsuite/Makefile.in: Regenerate.
6390 * testsuite/retain_symbols_file_test.sh: New file.
6391
ca58b19f
NC
63922009-09-18 Nick Clifton <nickc@redhat.com>
6393
6394 * po/es.po: Updated Spanish translation.
6395
20e6d0d6
DK
63962009-09-17 Doug Kwan <dougkwan@google.com>
6397
6398 * debug.h (DEBUG_RELAXATION): New constant.
6399 (DEBUG_ALL): Add DEBUG_RELAXATION.
6400 (debug_string_to_enum): Add relaxation debug option.
6401 * layout.cc
6402 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
6403 Layout::Relaxation_debug_check::read_sections,
6404 Layout::Relaxation_debug_check::read_sections): New method definitions.
6405 (Layout::Layout): Initialize data members
6406 record_output_section_data_from_scrips_,
6407 script_output_section_data_list_ and relaxation_debug_check_.
6408 (Layout::save_segments, Layout::restore_segments,
6409 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6410 Layout::relaxation_loop_body): New method definitions.
6411 (Layout::finalize): Support relaxation. Move section layout code to
6412 Layout::relaxation_loop_body.
6413 (Layout::set_asection_address_from_script): Move code for orphan
6414 section placement out.
6415 (Layout::place_orphan_sections_in_script): New method definition.
6416 * layout.h (Output_segment_headers, Output_file_header):
6417 New forward class declarations.
6418 (Layout::~Layout): Define.
6419 (Layout::new_output_section_data_from_script): New method definition.
6420 (Layout::place_orphan_sections_in_script): New method declaration.
6421 (Layout::Segment_states): New type declaration.
6422 (Layout::save_segments, Layout::restore_segments,
6423 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6424 Layout::relaxation_loop_body): New method declarations.
6425 (Layout::Output_section_data_list): New type declaration.
6426 (Layout::Relaxation_debug_check): New class definition.
6427 (Layout::record_output_section_data_from_script_,
6428 Layout::script_output_section_data_list_, Layout::segment_states_,
6429 Layout::relaxation_debug_check_): New data members.
6430 * output.cc: (Output_section_headers::do_size): New method definition.
6431 (Output_section_headers::Output_section_headers): Move size
6432 computation to Output_section_headers::do_size.
6433 (Output_segment_headers::do_size): New method definition.
e1df38aa 6434 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
6435 Output_file_header::do_size and call it.
6436 (Output_file_header::do_size): New method definition.
6437 (Output_data_group::Output_data_group): Adjust call to
6438 Output_section_data.
6439 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
6440 (Output_symtab_xindex::do_write): Add array bound check.
6441 (Output_section::Input_section::print_to_mapfile): Handle
6442 RELAXED_INPUT_SECTION_CODE.
6443 (Output_section::Output_section): Initialize data member checkpoint_.
6444 (Output_section::~Output_section): Delete checkpoint object pointed
6445 by checkpoint_.
6446 (Output_section::add_input_section): Always add an Input_section if
6447 relaxing.
6448 (Output_section::add_merge_input_section): Add assert.
6449 (Output_section::relax_input_section): New method definition.
6450 (Output_section::set_final_data_size): Set load address to zero for
6451 an unallocated section.
6452 (Output_section::do_address_and_file_offset_have_reset_values):
6453 New method definition.
6454 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
6455 Handle relaxed input section.
6456 (Output_section::sort_attached_input_sections): Checkpoint input
6457 section list lazily.
6458 (Output_section::get_input_sections): Change type of input_sections to
6459 list of Simple_input_section pointers. Checkpoint input section list
6460 lazily. Also handle relaxed input sections.
6461 (Output_section::add_input_section_for_script): Take a reference to
6462 a Simple_input_section object instead of Relobj pointer and section
6463 index as parameter. Handle relaxed input sections.
6464 (Output_section::save_states, Output_section::restore_states): New
6465 method definitions.
6466 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
6467 (Output_data::is_data_size_fixed): New method definition.
6468 (Output_data::reset_addresss_and_file_offset): Do not reset data size
6469 if it is fixed.
6470 (Output_data::address_and_file_offset_have_reset_values): New method
6471 definition.
6472 (Output_data::do_address_and_file_offset_have_reset_values): New method
6473 definition.
6474 (Output_data::set_data_size): Check that data size is not fixed.
6475 (Output_data::fix_data_size): New method definition.
6476 (Output_data::is_data_size_fixed_): New data member.
6477 (Output_section_headers::set_final_data_size): New method definition.
6478 (Output_section_headers::do_size): New method declaration.
6479 (Output_segment_headers::set_final_data_size): New method definition.
6480 (Output_segment_headers::do_size): New method declaration.
6481 (Output_file_header::set_final_data_size)::New method definition.
6482 (Output_file_header::do_size)::New method declaration.
6483 (Output_section_data::Output_section_data): Add new parameter
6484 is_data_size_fixed and use it to fix data size.
6485 (Output_data_const::Output_data_const): Adjust call to base class
6486 constructor and fix data size.
6487 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
6488 base class constructor and fix data size.
6489 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
6490 base class constructor and fix data size.
6491 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
6492 class constructor and fix data size.
6493 (Output_data_group::set_final_data_size): New method definition.
6494 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
6495 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
6496 class constructor and fix data size.
6497 (Output_relaxed_input_section): New class definition.
6498 (Output_section::Simple_input_section): New class definition.
6499 (Output_section::get_input_sections): Adjust parameter list.
6500 (Output_section::add_input_section_for_script): Same.
6501 (Output_section::save_states, Output_section::restore_states,
6502 Output_section::do_address_and_file_offset_have_reset_values,
6503 (Output_section::Input_section::Input_section): Handle
6504 RELAXED_INPUT_SECTION_CODE. Add new overload for
6505 Output_relaxed_input_section.
6506 (Output_section::Input_section::is_input_section,
6507 Output_section::Input_section::set_output_section): Handle relaxed
6508 input section.
6509 (Output_section::Input_section::is_relaxed_input_section,
6510 Output_section::Input_section::output_section_data,
6511 Output_section::Input_section::relaxed_input_section): New method
6512 definitions.
6513 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
6514 value.
6515 (Output_section::Input_section::u1_): Update comments.
6516 (Output_section::Input_section::u2_): Add new union member poris.
6517 (Output_section::Checkpoint_output_section): New classs definition.
6518 (Output_section::relax_input_section): New method declaration.
6519 (Output_section::checkpoint_): New data member.
6520 (Output_segment): Update comments.
6521 (Output_segment::Output_segment): Un-privatize copy constructor.
6522 (Output_segment::operator=): Un-privatize.
6523 * script-sections.cc (Output_section_element::Input_section_list):
6524 Change element type to Output_section::Simple_input_section.
6525 (Output_section_element_dot_assignment::set_section_addresses):
6526 Register output section data for relaxation clean up.
6527 (Output_data_exression::Output_data_expression): Adjust call to base
6528 constructor to fix data size.
6529 (Output_section_element_data::set_section_addresses): Register
6530 Output_data_expression object for relaxation clean up.
6531 (struct Input_section_info): Replace Relobj pointer and section index
6532 pair with Output_section::Simple_input_section and Convert struct to a
6533 class.
6534 (Input_section_sorter::operator()): Adjust access to
e1df38aa 6535 Input_section_info data member to use accessors.
20e6d0d6
DK
6536 (Output_section_element_input::set_section_addresses): Use layout
6537 parameter. Adjust code to use Output_section::Simple_input_section
6538 and Input_secction_info classes. Register filler for relaxation
6539 clean up.
6540 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
6541 and section index pair with Output_section::Simple_input_section
6542 class. Adjust code accordingly.
6543 (Phdrs_element::release_segment): New method definition.
6544 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
6545 segment list.
6546 (Script_sections::release_segments): New method definition.
6547 * gold/script-sections.h (Script_sections::release_segments): New
6548 method declaration.
6549 * gold/target.h (Target::may_relax, Target::relax,
6550 Target::do_may_relax, Target::do_relax): New method definitions.
6551
5e445df6
ILT
65522009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6553
6554 * arm.cc (has_signed_unsigned_overflow): New function.
6555 (Arm_relocate_functions::abs8): New function.
6556 (Target_arm::Scan::local): Handle R_ARM_ABS8.
6557 (Target_arm::Scan::global): Likewise.
6558 (Target_arm::relocate::relocate): Likewise.
6559 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6560 Likewise.
6561
8c604651 65622009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
6563
6564 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
6565 * testsuite/Makefile.in: Regenerate.
6566
1e9cc1c2
NC
65672009-09-11 Nick Clifton <nickc@redhat.com>
6568
6569 * po/gold.pot: Updated by the Translation project.
6570
6a89f575
CC
65712009-09-08 Cary Coutant <ccoutant@google.com>
6572
6573 * output.cc (Output_file::open): Add execute permission to empty file.
6574 * testsuite/Makefile.am (permission_test): New test.
6575 * testsuite/Makefile.in: Regenerate.
6576
fdcac5af
ILT
65772009-09-02 Ian Lance Taylor <iant@google.com>
6578
6579 * output.cc (Output_file::resize): Call map_no_anonymous rather
6580 than map.
6581
44453f85
ILT
65822009-09-01 Mikolaj Zalewski <mikolajz@google.com>
6583
6584 * gold.cc: Include "incremental.h".
6585 (queue_initial_tasks): Call Incremental_checker methods.
6586 * incremental.cc: Include "output.h".
6587 (Incremental_checker::can_incrementally_link_output_file): New
6588 method.
6589 * incremental.h (Incremental_checker): New class.
6590
6591 * output.cc (Output_file::open_for_modification): New method.
6592 (Output_file::map_anonymous): Changed return type to bool. Record
6593 map in base_ field.
6594 (Output_file::map_no_anonymous): New method, broken out of map.
6595 (Output_file::map): Use map_no_anonymous and map_anonymous.
6596 * output.h (class Output_file): Update declarations.
6597
293c1386
CC
65982009-08-24 Cary Coutant <ccoutant@google.com>
6599
6600 * options.h (Command_line::Pre_options): New class.
6601 (Command_line::pre_options): New member.
6602 * options.cc (gold::options::ready_to_register): New variable.
6603 (One_option::register_option): Do nothing if not registering options.
6604 Assert if same short option registered twice.
6605 (General_options::General_options): Turn off option registration when
6606 done constructing.
6607 (Command_line::Pre_options::Pre_options): New constructor.
6608
f773f3d2
CC
66092009-08-24 Cary Coutant <ccoutant@google.com>
6610
06a73cfe
CC
6611 * options.h (General_options::no_keep_memory): Remove incorrect
6612 short option.
f773f3d2 6613
a15af8e2
RW
66142009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6615
6616 * Makefile.am (am__skiplex, am__skipyacc): New.
6617 * Makefile.in: Regenerate.
6618
c462b41b
RW
66192009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6620
14ec8efd
RW
6621 * Makefile.am (AM_CPPFLAGS): Renamed from ...
6622 (INCLUDES): ... this.
6623 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
6624 (AM_CPPFLAGS): Renamed from ...
6625 (INCLUDE): ... this.
6626 * Makefile.in, testsuite/Makefile.in: Regenerate.
6627
81ecdfbb
RW
6628 * Makefile.in: Regenerate.
6629 * aclocal.m4: Likewise.
6630 * config.in: Likewise.
6631 * configure: Likewise.
6632 * testsuite/Makefile.in: Likewise.
6633
c462b41b
RW
6634 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
6635 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
6636 * Makefile.in: Regenerate.
6637 * testsuite/Makefile.in: Regenerate.
6638
2da73f13
CC
66392009-08-19 Cary Coutant <ccoutant@google.com>
6640
6641 * resolve.cc (Symbol_table::resolve): Don't complain about defined
6642 symbols in shared libraries overridden by hidden or internal symbols
6643 in the main program.
6644
2db70501
CD
66452009-08-19 Chris Demetriou <cgd@google.com>
6646
6647 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
6648 checking source file names in error messages.
6649
f733487b
DK
66502009-08-18 Doug Kwan <dougkwan@google.com>
6651
6652 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
6653 an elcpp::Ehdr as parameter. Adjust call to set_target.
6654 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
6655 an elfcpp::Ehdr as parameter.
6656 * object.cc (Object::set_target): Remove the version that looks up
6657 a target and sets it.
6658 (Sized_relobj::setup): Take a Target object instead of
6659 an elfcpp::Ehdr as parameter. Adjust call to set_target.
6660 (make_elf_sized_object): Find target and ask target to
6661 make an ELF object.
6662 * object.h: (Object::set_target): Remove the version that looks up
6663 a target and sets it.
6664 (Sized_relobj::setup): Take a Target object instead of
6665 an elfcpp:Ehdr as parameter.
6666 * target.cc: Include dynobj.h.
6667 (Target::do_make_elf_object_implementation): New.
6668 (Target::do_make_elf_object): New.
6669 * target.h (Target::make_elf_object): New template declaration.
6670 (Target::do_make_elf_object): New method declarations.
6671 (Target::do_make_elf_object_implementation): New template declaration.
6672
cc70f101
ILT
66732009-08-14 Ian Lance Taylor <iant@google.com>
6674
6675 * gold.h (FUNCTION_NAME): Define.
6676 (gold_unreachable): Use FUNCTION_NAME.
6677
ef5e0cb1
ST
66782009-08-12 Sriraman Tallam <tmsriram@google.com>
6679
6680 * icf.cc (Icf::find_identical_sections): Issue a warning when a
6681 symbol in the --keep-unique list is not found.
6682
48c187ce
ST
66832009-08-12 Sriraman Tallam <tmsriram@google.com>
6684
6685 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
6686 been maked as --keep-unique.
6687 (Icf::unfold_section): New function.
6688 * icf.h (Icf::unfold_section): New function.
6689 * options.h (General_options::keep_unique): New option.
6690 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
6691 * testsuite/Makefile.in: Regenerate.
6692 * testsuite/icf_keep_unique_test.sh: New file.
6693 * testsuite/icf_keep_unique_test.cc: New file.
6694
645afe0c
CC
66952009-08-12 Cary Coutant <ccoutant@google.com>
6696
6697 PR 10471
6698 * resolve.cc (Symbol_table::resolve): Check for references from
6699 dynamic objects to hidden and internal symbols.
6700 * testsuite/Makefile.am (hidden_test.sh): New test.
6701 * testsuite/Makefile.in: Regenerate.
6702 * testsuite/hidden_test.sh: New script.
6703 * testsuite/hidden_test_1.c: New test source.
6704 * testsuite/hidden_test_main.c: New test source.
6705
11af873f
DK
67062009-08-11 Doug Kwan <dougkwan@google.com>
6707
6708 * arm.cc: Update comments.
6709 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
6710 segment to locate the .ARM.exidx section if present.
6711
b9f7d72d
DK
67122009-08-09 Doug Kwan <dougkwan@google.com>
6713
6714 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
6715 patch.
6716
ddd3c53c
ST
67172009-08-07 Sriraman Tallam <tmsriram@google.com>
6718 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
6719 compiler warnings.
6720
27721062
ST
67212009-08-06 Sriraman Tallam <tmsriram@google.com>
6722
6723 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
6724 valid tls_segment only for non-debug-section relocations.
6725 * testsuite/Makefile.am: Add gc_tls_test.
6726 * testsuite/Makefile.in: Regenerate.
6727 * testsuite/gc_tls_test.cc: New file.
6728 * testsuite/gc_tls_test.sh: New file.
6729
ef15dade 67302009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 6731
ef15dade
ST
6732 * icf.cc: New file.
6733 * icf.h: New file.
6734 * Makefile.am (CCFILES): Add icf.cc.
6735 (HFILES): Add icf.h
6736 * Makefile.in: Regenerate.
6737 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
6738 * gc.h (gc_process_relocs): Populate lists used by icf to contain
6739 section, symbol and addend information for the relocs.
6740 * gold.cc (queue_middle_tasks): Call identical code folding.
6741 * gold.h: Add defines for multimap.
6742 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
6743 to the call of finalize_local_symbols.
6744 * main.cc (main): Create object of class Icf.
6745 * object.cc (Sized_relobj::do_layout): Allow this function to be
6746 called twice during icf.
6747 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
6748 to sections marked as identical by icf.
6749 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
6750 when available.
6751 (Sized_relobj::do_section_entsize): New function.
6752 * object.h (Object::section_entsize): New function.
6753 (Object::do_section_entsize): New pure virtual function.
6754 (Relobj::finalize_local_symbols): Add new parameter.
6755 (Relobj::do_section_entsize): New function.
6756 * options.h (General_options::icf): New option.
6757 (General_options::icf_iterations): New option.
6758 (General_options::print_icf_sections): New option.
6759 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
6760 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
6761 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
6762 icf.
6763 * symtab.cc (Symbol_table::is_section_folded): New function.
6764 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
6765 to sections marked as identical by icf.
6766 * symtab.h (Symbol_table::set_icf): New function.
6767 (Symbol_table::icf): New function.
6768 (Symbol_table::is_section_folded): New function.
6769 (Symbol_table::icf_): New data member.
6770 * target-reloc.h (relocate_section): Ignore sections folded by icf.
6771 * testsuite/Makefile.am: Add commands to build icf_test.
6772 * testsuite/Makefile.in: Regenerate.
6773 * testsuite/icf_test.sh: New file.
6774 * testsuite/icf_test.cc: New file.
6775
c3b65ac4
CD
67762009-07-24 Chris Demetriou <cgd@google.com>
6777
6778 * layout.cc (is_compressible_debug_section): Fix incorrect
6779 comment about compressed section names.
6780
1caf2c51
ILT
67812009-07-20 Ian Lance Taylor <ian@airs.com>
6782
6783 PR 10419
6784 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
6785
1ef4d87f
ILT
67862009-07-16 Ian Lance Taylor <iant@google.com>
6787
6788 PR 10400
6789 * layout.h: #include <map>.
6790 (class Kept_section): Change from struct to class. Add accessors
6791 and setters. Add section size to Comdat_group mapping. Change
6792 Comdat_group to std::map. Add is_comdat_ field. Add
6793 linkonce_size field in union.
6794 (class Layout): Update declaration of find_or_add_kept_section.
6795 Don't declare find_kept_object.
6796 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
6797 parameter. Add object, shndx, is_comdat, and is_group_name
6798 parameters. Change all callers. Adjust for new Kept_section.
6799 (Layout::find_kept_object): Remove.
6800 * object.cc (Sized_relobj::include_section_group): Update use of
6801 Kept_section. Rename secnum to shndx. Only record
6802 Kept_comdat_section if sections are the same size.
6803 (Sized_relobj::include_linkonce_section): Update use of
6804 Kept_section. Only record Kept_comdat_section if sections are the
6805 same size. Set size of linkonce section.
6806 (Sized_relobj::map_to_kept_section): Update call to
6807 get_kept_comdat_section.
6808 * object.h (class Sized_relobj): Rename fields in
6809 Kept_comdat_section to drop trailing underscores; change object
6810 field to Relobj*. Change Kept_comdat_section_table to store
6811 struct rather than pointer.
6812 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
6813 Add kept_object and kept_shndx parameters. Change all callers.
6814 (Sized_relobj::get_kept_comdat_section): Change return type to
6815 bool. Add kept_object and kept_shndx parameters. Change all
6816 callers.
6817 * plugin.cc (Pluginobj::include_comdat_group): Update call to
6818 Layout::find_or_add_kept_section.
6819
37c3b7b0
ILT
68202009-07-09 Ian Lance Taylor <iant@google.com>
6821
6822 * merge.cc (Object_merge_map::initialize_input_to_output_map):
6823 Reserve space in the hash table.
6824
98fa85cb
ILT
68252009-07-06 Mikolaj Zalewski <mikolajz@google.com>
6826
6827 * fileread.cc (File_read::get_mtime): New method.
6828 * fileread.h (Timespec): New structure.
6829 (File_read::get_mtime): New method.
6830 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
6831 Renamed from timestamp_nsec.
6832 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
6833 Elf_Xword.
e1df38aa 6834 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 6835 timestamp_nsec.
e1df38aa 6836 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
6837 (Incremental_inputs::report_obejct): Save mtime; style fix.
6838 (Incremental_inputs::report_script): Save mtime; style fix.
6839 (Incremental_inputs::finalize_inputs): Style fix.
6840 (Incremental_inputs::finalize): Style fix.
6841 (Incremental_inputs::create_input_section_data): Store inputs
6842 mtime.
6843 * incremental.h (Incremental_inputs::report_script): Add mtime
6844 argument.
6845 (Incremental_inputs::Input_info::Input_info): Intialize only one
6846 union member.
6847 (Incremental_inputs::Input_info::archive): Move to nameless
6848 union.
6849 (Incremental_inputs::Input_info::obejct): Move to nameless union.
6850 (Incremental_inputs::Input_info::script): Move to nameless union.
6851 (Incremental_inputs::mtime): New field.
6852 * script.cc (read_input_script): Pass file mtime to
6853 Incremental_input.
6854 * script.h (Script_info::inputs): Style fix.
6855
c9d70757
ILT
68562009-07-01 Ian Lance Taylor <ian@airs.com>
6857
6858 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
6859 instead of 32.
6860
9c547ec3
ILT
68612009-06-24 Ian Lance Taylor <iant@google.com>
6862
6863 PR 10156
6864 * layout.cc (Layout::choose_output_section): If we find an
6865 existing section, update the flags.
6866 (Layout::create_notes): New function, broken out of
6867 Layout::finalize.
6868 (Layout::finalize): Don't create note sections.
6869 (Layout::create_note): Don't crash if linker script discards
6870 section.
6871 (Layout::create_gold_note): Likewise.
6872 (Layout::create_build_id): Likewise. Don't set
6873 after_input_sections on the section.
6874 (Layout::create_executable_stack_info): Remove target parameter.
6875 Change caller.
6876 * layout.h (class Layout): Declare create_notes. Update
6877 declaration of create_executable_stack_info.
6878 * gold.cc (queue_middle_tasks): Call create_notes.
6879 * output.cc (Output_section::update_flags_for_input_section): Move
6880 here from output.h. If SHF_ALLOC flag is newly set, mark address
6881 invalid.
6882 * output.h (Output_data::mark_address_invalid): New function.
6883 (class Output_section): Only declare, not define,
6884 update_flags_for_input_section. Remove set_flags.
6885
55458500
ILT
68862009-06-24 Ian Lance Taylor <iant@google.com>
6887
6888 * script-sections.cc (Output_section_definition::
6889 set_section_addresses): Rename shadowing local load_address to
6890 laddr.
6891
1307d6cd
ILT
68922009-06-24 Ian Lance Taylor <iant@google.com>
6893
6894 PR 10244
6895 * reloc.cc (relocate_sections): Skip empty relocation sections.
6896
ec3f783e
ILT
68972009-06-23 Ian Lance Taylor <iant@google.com>
6898
6899 PR 10156
6900 * layout.cc (Layout::create_note): Use choose_output_section
6901 rather than make_output_section.
6902
459c9f1c
ILT
69032009-06-23 Ian Lance Taylor <iant@google.com>
6904
6905 PR 10237
6906 * options.cc (General_options::parse_V): Set printed_version_.
6907 (General_options::General_options): Initialize printed_version_.
6908 * options.h (class General_options): Add printed_version_ field.
6909 * gold.cc (queue_initial_tasks): If there are no input files,
6910 don't give a fatal error if we printed the version information.
6911 (queue_middle_tasks): If using -r with a shared object, give a
6912 fatal error rather than an ordinary error.
6913
1518dc8f
ILT
69142009-06-23 Ian Lance Taylor <iant@google.com>
6915
6916 PR 10219
6917 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
6918 (Layout::make_output_section): Set have_stabstr_section_ if we see
6919 a .stab*str section.
6920 (Layout::finalize): Call link_stabs_sections.
6921 (Layout::link_stabs_sections): New file.
6922 * layout.h (class Layout): Add have_stabstr_section_ field.
6923 Declare link_stabs_sections.
6924
3d857b98
DK
69252009-06-23 Doug Kwan <dougkwan@google.com>
6926
6927 * Makefile.am (libgold_a_LIBADD): New.
6928 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
6929 * Makefile.in: Regenerate.
6930 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
6931 * configure: Regenerate.
6932 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
6933 * fileread.cc: Include sys/state.h
6934 * gold.h: Declare memmem and strndup if found missing.
6935 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
6936
0639a6f6
ILT
69372009-06-23 Ian Lance Taylor <iant@google.com>
6938
6939 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
6940 * configure: Rebuild.
6941
8d63875c
ILT
69422009-06-23 Ian Lance Taylor <iant@google.com>
6943
6944 PR 10147
6945 * object.cc (Object::section_contents): Don't try to get a view if
6946 the section has length zero.
6947 (Object::handle_gnu_warning_section): If the section is empty, use
6948 the name of the section as the warning.
6949
f7c8a183
ILT
69502009-06-23 Ian Lance Taylor <iant@google.com>
6951
6952 PR 10133
6953 * stringpool.h (class Stringpool_template): Add optimize_ field.
6954 (Stringpool_template::set_optimize): New function.
6955 * stringpool.cc (Stringpool_template::Stringpool_template):
6956 Initialize optimize_ field.
6957 (Stringpool_template::set_string_offsets): Test local optimize
6958 fild rather than parameter.
6959 * layout.cc (Layout::Layout): Call set_optimize on the section
6960 name stringpool.
6961
e6a307ba
ILT
69622009-06-22 Ian Lance Taylor <iant@google.com>
6963
6964 PR 10030
6965 * yyscript.y: Parse TARGET.
6966 * script.cc (script_set_target): New function.
6967 * script-c.h (script_set_target): Declare.
6968 * options.cc (General_options::string_to_object_format): Rename
6969 from string_to_object_format in anonymous namespace. Change
6970 callers.
6971 * options.h (class General_options): Declare
6972 string_to_object_format.
6973
3ee173de
ILT
69742009-06-22 Ian Lance Taylor <iant@google.com>
6975
6976 * script-sections.cc (Script_sections::create_segments): Don't put
6977 program headers in a PT_LOAD segment if -n or -N.
6978
69792009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
6980
6981 PR 10141
6982 * options.h (class General_options): Add -z lazy and -z now. Sort
6983 -z options into alphabetical order.
6984 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
6985
cd6739a1 69862009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
6987
6988 * layout.cc (Layout::make_output_section): Call
6989 Target::new_output_section.
6990 (Layout::attach_allocated_section_to_segment): Put large section
6991 sections in a separate load segment with the large segment flag
6992 set.
6993 (Layout::segment_precedes): Sort large data segments after other
6994 load segments.
6995 (align_file_offset): New static function.
6996 (Layout::set_segment_offsets): Use align_file_offset.
6997 * output.h (class Output_section): Add is_small_section_ and
6998 is_large_section_ fields.
6999 (Output_section::is_small_section): New function.
7000 (Output_section::set_is_small_section): New function.
7001 (Output_section::is_large_section): New function.
7002 (Output_section::set_is_large_section): New function.
7003 (Output_section::is_large_data_section): New function.
7004 (class Output_segment): Add is_large_data_segment_ field.
7005 (Output_segment::is_large_data_segment): New function.
7006 (Output_segment::set_is_large_data_segment): New function.
7007 * output.cc (Output_section::Output_section): Initialize new
7008 fields.
7009 (Output_segment::Output_segment): Likewise.
7010 (Output_segment::add_output_section): Add assertion that large
7011 data sections always go in large data segments. Force small data
7012 sections to the end of the list of data sections. Force small BSS
7013 sections to the start of the list of BSS sections. For large BSS
7014 sections to the end of the list of BSS sections.
7015 * symtab.h (class Symbol): Declare is_common_shndx.
7016 (Symbol::is_defined): Check Symbol::is_common_shndx.
7017 (Symbol::is_common): Likewise.
7018 (class Symbol_table): Define enum Commons_section_type. Update
7019 declarations. Add small_commons_ and large_commons_ fields.
7020 * symtab.cc (Symbol::is_common_shndx): New function.
7021 (Symbol_table::Symbol_table): Initialize new fields.
7022 (Symbol_table::add_from_object): Put small and large common
7023 symbols in the right list.
7024 (Symbol_table::sized_finalized_symbol): Check
7025 Symbol::is_common_shndx.
7026 (Symbol_table::sized_write_globals): Likewise.
7027 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7028 common symbol lists. Don't call do_allocate_commons_list if the
7029 list is empty.
7030 (Symbol_table::do_allocate_commons_list): Remove is_tls
7031 parameter. Add comons_section_type parameter. Change all
7032 callers. Handle small and large common symbols.
7033 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7034 Symbol::is_common_shndx.
7035 * resolve.cc (symbol_to_bits): Likewise.
7036 * target.h (Target::small_common_shndx): New function.
7037 (Target::small_common_section_flags): New function.
7038 (Target::large_common_shndx): New function.
7039 (Target::large_common_section_flags): New function.
7040 (Target::new_output_section): New function.
7041 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7042 small_common_section_flags, and large_common_section_flags
7043 fields.
7044 (Target::do_new_output_section): New virtual function.
7045 * arm.cc (Target_arm::arm_info): Initialize new fields.
7046 * i386.cc (Target_i386::i386_info): Likewise.
7047 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7048 Likewise.
7049 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7050 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7051 (Target_x86_64::do_new_output_section): New function.
7052 * configure.ac: Define conditional MCMODEL_MEDIUM.
7053 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7054 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7055 (large_LDFLAGS): Define.
7056 * testsuite/large.c: New file.
7057 * testsuite/testfile.cc (Target_test::test_target_info):
7058 Initialize new fields.
7059 * configure, testsuite/Makefile.in: Rebuild.
7060
bb04269c
DK
70612009-06-05 Doug Kwan <dougkwan@google.com>
7062
7063 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7064 * Makefile.in: Regenerate.
bb04269c
DK
7065 * i386.cc (class Target_i386): Define new virtual method to
7066 override do_is_local_label_name in parent.
7067 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7068 local symbols if --discard-locals or -X is given.
7069 * options.h (class General_options): Declare new options
7070 '--discard-locals' and '-X' for discarding locals.
7071 * target.h (class Target): Define new methods is_local_label_name.
7072 Declare new virtual method do_is_local_label_name.
7073 * target.cc: New file.
7074 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7075 (check_SCRIPTS): Add discard_locals_test.sh.
7076 (check_DATA): Add discard_local_tests.syms.
7077 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7078 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7079 * testsuite/Makefile.in: Regenerate.
7080 * testsuite/discard_locals_test.c: New file.
7081 * testsuite/discard_locals_test.sh: Same.
7082
805bb01c
DK
70832009-06-05 Doug Kwan <dougkwan@google.com>
7084
7085 * object.cc (Sized_relobj::Sized_relobj): Initialize
7086 discarded_eh_frame_shndx_ to -1U.
7087 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7088 section.
7089 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7090 a discarded .eh_frame section.
7091 (Sized_relobj::do_finalize_local_symbols): Ditto.
7092 * object.h (class Sized_relobj): Declare new member
7093 discarded_eh_frame_shndx_.
7094 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7095 (local_labels_test.o, local_labels_test): New rules.
7096 * testsuite/Makefile.in: Regenerate.
7097
1dcd334d
DK
70982009-06-04 Doug Kwan <dougkwan@google.com>
7099
7100 * layout.cc (Layout::section_name_mapping): Add mapping for
7101 special ARM sections.
7102
96d49306
DK
71032009-06-03 Doug Kwan <dougkwan@google.com>
7104
7105 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7106 (utils::has_overflow): Same.
7107
dff16297
ILT
71082009-06-03 Ian Lance Taylor <iant@google.com>
7109
7110 * layout.cc (Layout::section_name_mapping): New array, replacing
7111 Layout::linkonce_mapping.
7112 (Layout::section_name_mapping_count): New variable, replacing
7113 Layout::linkonce_mapping_count.
7114 (Layout::linkonce_output_name): Remove.
7115 (Layout::output_section_name): Rewrite.
7116 * layout.h (class Layout): Rename Linkonce_mapping to
7117 Section_name_mapping, linkonce_mapping to section_name_mapping,
7118 linkonce_mapping_count to section_name_mapping_count. Don't
7119 declare linkonce_output_name.
7120
c121c671
DK
71212009-06-03 Doug Kwan <dougkwan@google.com>
7122
7123 * gold/arm.cc (namespace utils): New.
7124 (Target_arm::reloc_is_non_pic): Define new method.
7125 (class Arm_relocate_functions): New.
7126 (Target_arm::Relocate::relocate): Handle relocation types used by
7127 Android.
7128
07800fab
ILT
71292009-06-03 Ian Lance Taylor <iant@google.com>
7130
7131 * arm.cc (Target_arm::scan::global): Use || instead of |.
7132
c121c671
DK
71332009-06-02 Doug Kwan <dougkwan@google.com>
7134
7135 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7136 issued_non_pic_error_.
7137 (class Target_arm::Scan): Declare new method check_non_pic.
7138 Define new method symbol_needs_plt_entry.
7139 Declare new data member issued_non_pic_error_.
7140 (class Target_arm::Relocate): Declare new method
7141 should_apply_static_reloc.
7142 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7143 (Target_arm::Scan::check_non_pic): Define new method.
7144 (Target_arm::Scan::local): Handle a small subset of reloc types used
7145 by Android.
7146 (Target_arm::Scan::local): Same.
7147 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7148
b19b0c6d
ILT
71492009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7150
7151 * incremental.cc (Incremental_inputs::report_command_line): Filter
7152 out --incremental-* options.
7153
94cdfcff
DK
71542009-05-29 Doug Kwan <dougkwan@google.com>
7155
7156 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7157 template class.
7158 (class Target_arm): Update comment.
7159 (Target_arm::Target_arm): Initialize new data members GOT_,
7160 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7161 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7162 and Target_arm::rel_dyn_section.
7163 Declare new_enum Target_arm::Got_type.
7164 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7165 and DYNBSS_.
7166 Update commments for member do_dynsym_value.
7167 (Target_arm::got_size, Target_arm::plt_section,
7168 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7169 new methods inside class defintion.
7170 (Target_arm::got_section): Define new method.
7171 (Target_arm::rel_dyn_section): Same.
7172 (Output_data_plt_arm): New template class.
7173 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7174 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7175 (Output_data_plt_arm::add_entry): Same.
7176 (Output_data_plt_arm::first_plt_entry): Define new
7177 static data member for PLT instruction template.
7178 (Output_data_plt_arm::plt_entry): Same.
7179 (Output_data_plt_arm::do_write): Define new method.
7180 (Target_arm::make_plt_entry): Same.
7181 (Target_arm::do_finalize_sections): Same.
7182 (Target_arm::do_dynsym_value): Same.
7183
4a657b0d
DK
71842009-05-28 Doug Kwan <dougkwan@google.com>
7185
7186 * Makefile.am (TARGETSOURCES): Add arm.cc.
7187 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7188 * Makefile.in: Regenerate.
7189 * arm.cc: New file.
7190 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7191
e7ae8c36
DK
71922009-05-26 Doug Kwan <dougkwan@google.com>
7193
7194 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7195 (General_options::check_excluded_libs): Strip off directories in
7196 archive name before matching like GNU ld does.
7197 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7198 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7199 (exclude_libs_test_LDFLAGS): Add linker option
7200 -Wl,--exclude-libs,libexclude_libs_test_3
7201 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7202 an explicit archive without using -l.
7203 (alt/libexclude_libs_test_3.a): New make rule.
7204 * testsuite/Makefile.in: Regenerate.
7205 * testsuite/exclude_libs_test.c : Declare lib3_default().
7206 (main): Call it.
7207 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
7208 * exclude_libs_test_3.c: New file.
7209
f12e7348
NC
72102009-05-26 Nick Clifton <nickc@redhat.com>
7211
7212 * po/id.po: New Indonesian translation.
7213 * po/gold.pot: Updated template file.
7214
4daadc0d
ST
72152009-05-22 Sriraman Tallam <tmsriram@google.com>
7216
e1df38aa 7217 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
7218 gc_comdat_test files. Add -Wl,--gc-sections to build
7219 gc_comdat_test.
7220 * testsuite/Makefile.in: Regenerate.
7221 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
7222
531813ad
ST
72232009-05-21 Sriraman Tallam <tmsriram@google.com>
7224
7225 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
7226 kept comdat section was garbage collected.
7227 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
7228 * testsuite/Makefile.in: Regenerate.
7229 * testsuite/gc_comdat_test.sh: New file.
7230 * testsuite/gc_comdat_test_1.cc: New file.
7231 * testsuite/gc_comdat_test_2.cc: New file.
7232
65514900
CC
72332009-05-19 Doug Kwan <dougkwan@google.com>
7234
7235 * archive.cc (Archive::Archive): Move constructor from archive.h
7236 to here. Initialize no_export_.
7237 (Archive::get_elf_object_for_member): Set no_export flag of object.
7238 * archive.h (Archive::Archive): Move constructor body to
7239 archive.cc.
7240 (Archive::no_export): New method.
7241 (Archive::no_export_): New field.
7242 * object.h (Object::Object): Initialize no_export_ to false.
7243 (Object::no_export, Object::set_no_export): New methods.
7244 (Object::no_export_): New field.
7245 * options.cc (General_options::parse_exclude_libs): New method.
7246 (General_options::check_excluded_libs) Same.
7247 * options.h (exclude_libs): New option.
7248 (General_options::check_excluded_libs): New method declaration.
7249 (General_options::excluded_libs_): New field.
7250 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
7251 default or protected visibility if an object has no-export flag set.
7252 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
7253 (check_SCRIPTS): Add exclude_libs_test.sh.
7254 (check_DATA): Add exclude_libs_test.syms.
7255 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
7256 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
7257 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
7258 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
7259 (exclude_libs_test.syms, libexclude_libs_test_1.a,
7260 libexclude_libs_test_2.a): New rules.
7261 * testsuite/Makefile.in: Regenerate.
7262 * testsuite/exclude_libs_test.c: New file.
7263 * testsuite/exclude_libs_test.sh: Ditto.
7264 * testsuite/exclude_libs_test_1.c: Ditto.
7265 * testsuite/exclude_libs_test_2.c: Ditto.
7266
1b77ea50
ILT
72672009-05-15 Ian Lance Taylor <iant@google.com>
7268
7269 * configure.ac: Check for declarations for cases where libiberty.h
7270 checks HAVE_DECL_xxx.
7271 * configure, config.in: Rebuild.
7272
072fe7ce
ILT
72732009-05-15 Mikolaj Zalewski <mikolajz@google.com>
7274
7275 * gold.h (Incremental_argument_list): Remove (invalid) forward
7276 declaration.
7277 * incremental.cc (Incremental_inputs::report_achive): New method.
7278 (Incremental_inputs::report_object): New method.
7279 (Incremental_inputs::report_script): New method.
7280 (Incremental_inputs::finalize_inputs): New method.
7281 (Incremental_inputs::finalize): Call finalize_inputs().
7282 (Incremental_inputs::sized_create_incremental_inputs_section_data):
7283 Create inputs entries.
7284 * incremental.h (Incremental_input_type): New enum.
7285 (Incremental_inputs::Incremental_input): Initialize new fields.
7286 (Incremental_inputs::report_inputs): New method.
7287 (Incremental_inputs::report_achive): New method.
7288 (Incremental_inputs::report_object): New method.
7289 (Incremental_inputs::report_script): New method.
7290 (Incremental_inputs::finalize_inputs): New method.
7291 (Incremental_inputs::Input_info): New struct.
7292 (Incremental_inputs::Input_info_map): New typedef.
7293 (Incremental_inputs::lock_): New field.
7294 (Incremental_inputs::Inputs_): New field.
7295 (Incremental_inputs::Inputs_map): New field.
7296 * main.cc (main): Call Incremental_input::report_inputs.
7297 * options.h (Input_argument_list): Typedef moved from
7298 Input_arguments.
7299 (Input_file_group::Files): Remove, use ::Input_argument_list.
7300 (Input_file_group::Input_argument_list): Remove, use
7301 ::Input_argument_list.
7302 * plugin.cc (Plugin_manager::add_input_file): Add error in
7303 incremental build.
7304 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
7305 functions.
7306 * script.cc (read_input_script): Call
7307 Incremental_input::report_script.
7308 * script.h (Script_info): New class.
7309
b0481b0b
ILT
73102009-04-27 Ian Lance Taylor <iant@google.com>
7311
7312 * x86_64.cc (do_adjust_output_section): Set entsize to
7313 plt_entry_size.
7314
b22a5a41 73152009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
7316
7317 * output.cc (Output_file::close): After short writes, continue
7318 writing from the correct offset in the buffer being written.
7319
40fde488
CD
73202009-04-23 Chris Demetriou <cgd@google.com>
7321
7322 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
7323 * configure: Regenerate.
7324 * config.in: Regenerate.
7325 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
7326 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
7327
3ce2c28e
ILT
73282009-04-21 Mikolaj Zalewski <mikolajz@google.com>
7329
7330 * incremental.cc (Incremental_inputs_header_data): Renamed from
7331 Incremental_input_header_data.
7332 (Incremental_inputs_header_data::data_size): New field.
7333 (Incremental_inputs_header_data::put_input_file_count): Renamed
7334 from input_file_count.
7335 (Incremental_inputs_header_data::put_command_line_offset): Renamed
7336 from command_line_offset.
7337 (Incremental_inputs_header_data::put_reserved): Renamed from
7338 put_reserved.
7339 (Incremental_inputs_entry_data): Renamed from
7340 Incremental_input_entry_data.
7341 (Incremental_inputs_entry_data::data_size): New field.
7342 (Incremental_inputs::report_command_line): New method.
7343 (Incremental_inputs::finalize): New method.
7344 (Incremental_inputs::create_incremental_inputs_data): New method.
7345 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
7346 * incremental.h: New file.
7347 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
7348 (Layout::finalize): Create incremental inputs section in
7349 incremental builds.
7350 (Layout::create_incremental_info_sections): New method.
7351 * layout.h (Layout::incremental_inputs): New method.
7352 (Layout::create_incremental_info_sections): New method.
7353 (Layout::incremental_inputs_): New field.
7354 * main.cc (main): Notify Incremental_input of the command line.
7355
e55bde5e
ILT
73562009-04-01 Ian Lance Taylor <iant@google.com>
7357 Mikolaj Zalewski <mikolajz@google.com>
7358
7359 * gold.h (reserve_unordered_map): Define, three versions, one for
7360 each version of Unordered_map.
7361 * layout.cc (Layout::Layout): Remove options parameter. Add
7362 number_of_input_files parameter. Don't initialize options_.
7363 Initialize number_of_input_files_ and resized_signatures_. Move
7364 sections_are_attached_.
7365 (Layout::layout_group): Reserve space for group_signatures_.
7366 (Layout::find_or_add_kept_section): Change name parameter to be a
7367 reference. Resize signatures_ map when it gets large enough.
7368 (Layout::layout_eh_frame): Use parameters->options() instead of
7369 this->options_.
7370 (Layout::make_output_section): Likewise.
7371 (Layout::attach_allocated_section_to_segment): Likewise.
7372 (Layout::finalize, Layout::create_executable_stack): Likewise.
7373 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
7374 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
7375 * layout.h (class Layout): Update declarations. Remove options_
7376 field. Add number_of_input_files_ and resized_signatures_
7377 fields. Move sections_are_attached_ field.
7378 * main.cc (main): Pass number of input files to Layout
7379 constructor. Don't pass options.
7380
154b857c
ILT
73812009-03-30 Ian Lance Taylor <iant@google.com>
7382
7383 * ffsll.c (ffsll): Correct implementation.
7384
2f35ab9b
ILT
73852009-03-27 Ian Lance Taylor <iant@google.com>
7386
fd03461a
ILT
7387 * ffsll.c: New file.
7388 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
7389 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
7390 * ftruncate.c (ftruncate): Declare before definition.
7391 * mremap.c (mremap): Likewise.
7392 * pread.c (pread): Likewise.
7393 * configure, Makefile.in, config.in: Rebuild.
7394
2f35ab9b
ILT
7395 * mremap.c: New file.
7396 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
7397 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
7398 (mremap): Declare if HAVE_MREMAP is not defined.
7399 * configure, Makefile.in, config.in: Rebuild.
7400
33aea2fd
CC
74012009-03-27 Cary Coutant <ccoutant@google.com>
7402
7403 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
7404 position independent.
7405 * sparc.cc (Target_sparc::check_non_pic): Likewise.
7406 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
7407
6d479619
CC
74082009-03-24 Cary Coutant <ccoutant@google.com>
7409
7410 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
7411 an executable.
7412 (needs_dynamic_reloc): Likewise.
7413
afc06bb8
ILT
74142009-03-24 Ian Lance Taylor <iant@google.com>
7415
7416 * yyscript.y (file_cmd): Recognize EXTERN.
7417 (extern_name_list, extern_name_list_body): New nonterminals.
7418 * script.cc (script_add_extern): Define.
7419 * script-c.h (script_add_extern): Declare.
7420
f6060a4d
ILT
74212009-03-24 Rafael Avila de Espindola <espindola@google.com>
7422
7423 * object.cc (is_elf_object): Define.
7424 * object.h (is_elf_object): Declare.
7425 * archive.cc (Archive::get_elf_object_for_member): Call
7426 is_elf_object.
33aea2fd 7427 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 7428
26736d8e
ILT
74292009-03-24 Elliott Hughes <enh@google.com>
7430
7431 * output.cc (Output_file::map_anonymous): Define.
7432 (Output_file::map): Use map_anonymous. If the regular mmap fails,
7433 try an anonymous one. Report the size if the mmap fails.
7434 * output.h (class Output_file): Declare map_anonymous.
7435
22fd9730
ILT
74362009-03-24 Ian Lance Taylor <iant@google.com>
7437
7438 * target-select.cc (instantiate_target): Don't acquire the lock if
7439 the instantiated_target_ field has already been set.
7440
cb010894
ILT
74412009-03-23 Ian Lance Taylor <iant@google.com>
7442
7f055c20
ILT
7443 * gold-threads.h (class Initialize_lock): Define.
7444 * gold-threads.cc (class Initialize_lock_once): Define.
7445 (initialize_lock_control): New static variable.
7446 (initialize_lock_pointer): New static variable.
7447 (initialize_lock_once): New static function.
7448 (Initialize_lock::Initialize_lock): Define.
7449 (Initialize_lock::initialize): Define.
7450 * target-select.h: Include "gold-threads.h".
7451 (class Target_selector): Add lock_ and initialize_lock_ fields.
7452 Don't define instantiate_target, just declare it.
7453 * target-select.cc (Target_selector::Target_selector): Initialize
7454 new fields.
7455 (Target_selector::instantiate_target): Define.
7456 * descriptors.h: Include "gold-threads.h".
7457 (class Descriptors): Add initialize_lock_ field.
7458 * descriptors.cc (Descriptors::Descriptors): Initialize new
7459 field.
7460 (Descriptors::open): Use initialize_lock_ field
7461 * errors.h (class Errors): Add initialize_lock_ field.
7462 * errors.cc (Errors::Errors): Initialize new field.
7463 (Errors::initialize_lock): Use initialize_lock_ field.
7464 * powerpc.cc (class Target_selector_powerpc): Remove
7465 instantiated_target_ field. In do_recognize call
7466 instantiate_target rather than do_instantiate_target. In
7467 do_instantiate_target just allocate a new target.
7468 * sparc.cc (class Target_selector_sparc): Likewise.
7469
36959681
ILT
7470 * freebsd.h: New file.
7471 * i386.cc: Include "freebsd.h".
7472 (Target_i386): Derive from Target_freebsd rather than
7473 Sized_target.
7474 (Target_selector_i386): Derive from Target_selector_freebsd rather
7475 than Target_selector.
7476 * x86_64.cc: Include "freebsd.h".
7477 (Target_x86_64): Derive from Target_freebsd rather than
7478 Sized_target.
7479 (Target_selector_x86_64): Derive from Target_selector_freebsd
7480 rather than Target_selector.
7481 * target.h (class Target): Add adjust_elf_header and
7482 do_adjust_elf_header.
7483 * output.cc (Output_file_header:: do_sized_write): Call target
7484 adjust_elf_header routine.
7485 * configure.tgt: Set targ_osabi.
7486 * configure.ac: Define GOLD_DEFAULT_OSABI.
7487 * parameters.cc (Parameters::default_target): Pass
7488 GOLD_DEFAULT_OSABI to select_target.
7489 * target-select.h (class Target_selector): Make instantiate_target
7490 protected rather than private.
7491 * Makefile.am (HFILES): Add freebsd.h.
7492 * configure, Makefile.in, config.in: Rebuild.
7493
cb010894
ILT
7494 * merge.cc (do_add_input_section): Correct pend value. Change
7495 message about last entry not being null terminated from error to
7496 warning.
7497
0e879927
ILT
74982009-03-20 Mikolaj Zalewski <mikolajz@google.com>
7499
7500 * incremental.cc: New file.
7501 * Makefile.am (CCFILES): Add incremental.cc.
7502 * Makefile.in: Rebuild.
7503
41105937
PP
75042009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
7505
7506 * layout.cc (Layout::output_section_name): Preserve names
7507 of '.note.' sections.
e1df38aa 7508
60439920
ILT
75092009-03-19 Ian Lance Taylor <iant@google.com>
7510
7511 * descriptors.cc (Descriptors::open): Check that the options are
7512 valid before using them.
7513
0d371ad3
ILT
75142009-03-18 Ian Lance Taylor <iant@google.com>
7515
7516 * script-sections.h: Include <list>.
7517 (class Script_sections): Change Sections_elements from std::vector
7518 to std::list. Typedef public Elements_iterator. Add
7519 orphan_section_placement_, data_segment_align_start_, and
7520 saw_data_segment_align_ fields. Remove data_segment_align_index_
7521 field.
7522 * script-sections.cc (class Orphan_section_placement): New class.
7523 (class Sections_element): Add virtual functions is_relro and
7524 orphan_section_init. Remove virtual function place_orphan_here.
7525 (class Output_section_definition): Add is_relro and
7526 orphan_section_init. Remove place_orphan_here.
7527 (class Orphan_output_section): Likewise.
7528 (Script_sections::Script_sections): Update for field changes.
7529 (Script_sections::data_segment_align): Set saw_data_segment_align_
7530 and data_segment_align_start_, not data_segment_align_index.
7531 (Script_sections::data_segment_relro_end): Check
7532 saw_data_segment_align_. Use data_segment_align_start_ rather
7533 than data_segment_align_index_.
7534 (Script_sections::place_orphan): Rewrite to use
7535 Orphan_section_placement.
7536
9201d894
ILT
75372009-03-17 Ian Lance Taylor <iant@google.com>
7538
9c5b8369
ILT
7539 * archive.cc (Archive::add_symbols): Check for a version attached
7540 to the symbol name in the archive map.
7541 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
7542 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
7543 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
7544 (ver_test_11.a): New target.
7545 * testsuite/Makefile.in: Rebuild.
7546
9201d894
ILT
7547 * configure.ac: Check for chsize and posix_fallocate. Replace
7548 ftruncate.
7549 * ftruncate.c: New file, from gnulib.
7550 * output.cc (posix_fallocate): Define dummy version if not
7551 HAVE_POSIX_FALLOCATE.
7552 (Output_file::map): Call posix_fallocate rather than lseek and
7553 write.
7554 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
7555 * configure, Makefile.in, config.in: Rebuild.
7556
ef4ab7a8 75572009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 7558
ef4ab7a8
PP
7559 * layout.h (Layout::create_note): Add section_name parameter.
7560 * layout.cc (Layout::create_note): Likewise.
7561 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 7562
8c500701
ILT
75632009-03-17 Ian Lance Taylor <iant@google.com>
7564
e85b18e1
ILT
7565 * descriptors.cc: Include "options.h".
7566 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
7567 (Descriptors::open): Always use O_CLOEXEC when opening a new
7568 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
7569 then set FD_CLOEXEC.
7570
9efe6174
ILT
7571 * sparc.cc (class Target_sparc): Add has_got_section.
7572 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
7573 make sure we have a GOT section.
7574
7575 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
7576 (Target_sparc::Scan::local): Likewise.
7577 (Target_sparc::Scan::global): Likewise.
7578 (Target_sparc::Relocate::relocate): Likewise.
7579 (Target_sparc::Relocate::relocate_tls): Likewise.
7580
8c500701
ILT
7581 * symtab.cc (Symbol_table::define_default_version): New function,
7582 broken out of add_from_object.
7583 (Symbol_table::add_from_object): Call define_default_version.
7584 (Symbol_table::define_special_symbol): Add resolve_oldsym
7585 parameter. Change all callers. If the version for a symbol comes
7586 from a version script, resolve it with the symbol with the same
7587 name with no version. Also add the symbol without a version if
7588 appropriate.
7589 (do_define_in_output_data): If resolving with oldsym, don't delete
7590 sym.
7591 (do_define_in_output_segment): Likewise.
7592 (do_define_as_constant): Likewise.
7593 * symtab.h (class Symbol_table): Update declarations.
7594
f1ed28fb
ILT
75952009-03-13 Ian Lance Taylor <iant@google.com>
7596
15f8229b
ILT
7597 * readsyms.cc (Read_symbols::incompatible_warning): New function.
7598 (Read_symbols::requeue): New function.
7599 (Read_symbols::do_read_symbols): If make_elf_object fails because
7600 the target type is not configured, and the file was searched for,
7601 issue a warning and retry with the next directory.
7602 (Add_symbols::run): If the file has an incompatible format, and
7603 it was searched for, requeue the Read_symbols task. On error,
7604 release the object.
7605 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
7606 dirindex parameter to constructor. Change all callers. Declare
7607 incompatible_warning and requeue.
7608 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
7609 input_argument_ and input_group_ fields. Add them to
7610 constructor. Change all callers.
7611 (class Read_script): Add dirindex_ field. Add it to constructor.
7612 Change all callers.
7613 * archive.cc (Archive::setup): Remove input_objects parameter.
7614 Change all callers.
7615 (Archive::get_file_and_offset): Likewise.
7616 (Archive::read_all_symbols): Likewise.
7617 (Archive::read_symbols): Likewise.
7618 (Archive::get_elf_object_for_member): Remove input_objects
7619 parameter. Add punconfigured parameter. Change all callers.
7620 (Archive::add_symbols): Change return type to bool. Check return
7621 value of include_member.
7622 (Archive::include_all_members): Likewise.
7623 (Archive::include_member): Change return type to bool. Return
7624 false if first included object has incompatible target. Set
7625 included_member_ field.
7626 (Add_archive_symbols::run): If add_symbols returns false, requeue
7627 Read_symbols task.
7628 * archive.h (class Archive): Add included_member_ field.
7629 Initialize it in constructor. Add input_file and searched_for
7630 methods. Update declarations.
7631 (class Add_archive_symbols): Add dirpath_, dirindex_, and
7632 input_argument_ fields. Add them to constructor. Change all
7633 callers.
7634 * script.cc: Include "target-select.h".
7635 (class Parser_closure): Add skip_on_incompatible_target_ and
7636 found_incompatible_target_ fields. Add
7637 skip_on_incompatible_target parameter to constructor. Change all
7638 callers. Add methods skip_on_incompatible_target,
7639 clear_skip_on_incompatible_target, found_incompatible_target, and
7640 set_found_incompatible_target.
7641 (read_input_script): Add dirindex parameter. Change all callers.
7642 If parser finds an incompatible target, requeue Read_symbols
7643 task.
7644 (script_set_symbol): Clear skip_on_incompatible_target in
7645 closure.
7646 (script_add_assertion, script_parse_option): Likewise.
7647 (script_start_sections, script_add_phdr): Likewise.
7648 (script_check_output_format): New function.
7649 * script.h (read_input_script): Update declaration.
7650 * script-c.h (script_check_output_format): Declare.
7651 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
7652 (ignore_cmd): Remove OUTPUT_FORMAT.
7653 * fileread.cc (Input_file::Input_file): Add explicit this.
7654 (Input_file::will_search_for): New function.
7655 (Input_file::open): Add pindex parameter. Change all callers.
7656 * fileread.h (class Input_file): Add input_file_argument method.
7657 Declare will_search_for. Update declarations.
7658 * object.cc (make_elf_object): Add punconfigured parameter.
7659 Change all callers.
7660 * object.h (class Object): Make input_file public. Add
7661 searched_for method.
7662 (make_elf_object): Update declaration.
7663 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
7664 restart search.
7665 * dirsearch.h (class Dirsearch): Update declaration.
7666 * options.h (class General_options): Add --warn-search-mismatch.
7667 * parameters.cc (Parameters::is_compatible_target): New function.
7668 * parameters.h (class Parameters): Declare is_compatible_target.
7669 * workqueue.cc (Workqueue::add_blocker): New function.
7670 * workqueue.h (class Workqueue): Declare add_blocker.
7671
f1ed28fb
ILT
7672 * fileread.cc (Input_file::open): Remove options parameter.
7673 Change all callers.
7674 (Input_file::open_binary): Likewise.
7675 * script.cc (read_input_script): Likewise.
7676 * readsyms.h (class Read_symbols): Remove options_ field. Remove
7677 options parameter from constructor. Change all callers.
7678 (class Read_script): Likewise.
7679 * fileread.h (class Input_file): Update declarations.
7680 * script.h (read_input_script): Update declaration.
7681
34dd024a
NC
76822009-03-10 Nick Clifton <nickc@redhat.com>
7683
7684 * po/es.po: New Spanish translation.
7685
6d71b17c
CC
76862009-03-06 Cary Coutant <ccoutant@google.com>
7687
7688 * options.cc (parse_short_option): Keep dash_z from registering itself.
7689
031cdbed
ILT
76902009-03-03 Ian Lance Taylor <iant@google.com>
7691
7692 PR 9918
7693 * target-reloc.h (relocate_section): Pass output_section to
7694 relocate.
7695 * i386.cc (Target_i386::should_apply_static_reloc): Add
7696 output_section parameter. Change all callers.
7697 (Target_i386::Relocate::relocate): Add output_section parameter.
7698 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7699 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
7700 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
7701 * testsuite/two_file_shared.sh: New script.
7702 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
7703 (check_DATA): Add two_file_shared.dbg.
7704 (two_file_shared.dbg): New target.
7705 * testsuite/Makefile.in: Rebuild.
7706
15d5fa16
ILT
77072009-03-01 Ian Lance Taylor <iant@google.com>
7708
7709 * configure.ac: Check for byteswap.h.
7710 * configure: Rebuild.
7711 * config.in: Rebuild.
7712
8a4c0b0d
ILT
77132009-03-01 Mikolaj Zalewski <mikolajz@google.com>
7714
7715 * layout.cc (Layout::find_or_add_kept_section): New function.
7716 (Layout::add_comdat): Removed.
7717 * layout.h (struct Kept_section): Move out of class Layout.
7718 Remove trailing underscores from field names. Add group_sections
7719 field. Rename group_ field to is_group. Change all uses.
7720 (class Layout): Declare find_or_add_kept_section, not add_comdat.
7721 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
7722 comdat_groups_ field.
7723 (Sized_relobj::include_section_group): Use
7724 find_or_add_kept_section and Kept_section::group_sections.
7725 (Sized_relobj::include_linkonce_section): Likewise.
7726 * object.cc (class Sized_relobj): Don't define Comdat_group or
7727 Comdat_group_table. Remove find_comdat_group and
7728 add_comdat_group. Remove comdat_groups_ field.
7729 * plugin.cc (include_comdat_group): Use
7730 Layout::find_or_add_kept_section.
7731
b4ecf66b
ILT
77322009-02-28 Ian Lance Taylor <iant@google.com>
7733
14359ca0
ILT
7734 * README: --gc-sections and map files are now supported. Document
7735 some build requirements.
7736
b4ecf66b
ILT
7737 PR 6992
7738 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
7739 relocatable link set the value of the section symbol to zero.
7740 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
7741 relocatable link don't include the section address in the local
7742 symbol value.
7743
0602e05a
ILT
77442009-02-27 Ian Lance Taylor <iant@google.com>
7745
fd9d194f
ILT
7746 PR 6811
7747 * options.h (class Search_directory): Add is_system_directory.
7748 (class General_options): Declare is_in_system_directory.
7749 * options.cc (get_relative_sysroot): Make static.
7750 (get_default_sysroot): Make static.
7751 (General_optoins::is_in_system_directory): New function.
7752 * fileread.cc (Input_file::is_in_system_directory): New function.
7753 * fileread.h (class Input_file): Declare is_in_system_directory.
7754 * object.h (class Object): Add is_in_system_directory.
7755 (class Input_objects): Remove system_library_directory_ field.
7756 * object.cc (Input_objects::add_object): Don't set
7757 system_library_directory_.
7758 (input_objects::found_in_system_library_directory): Remove.
7759 * symtab.cc (Symbol_table::write_globals): Remove input_objects
7760 parameter. Change all callers.
7761 (Symbol_table::sized_write_globals): Likewise.
7762 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
7763 Call Object::is_in_system_directory.
7764 * symtab.h (class Symbol_table): Update declarations.
7765
61edd21f
ILT
7766 PR 5990
7767 * descriptors.h (Open_descriptor): Add is_on_stack field.
7768 * descriptors.cc (Descriptors::open): If the descriptor is on the
7769 top of the stack, remove it. Initialize is_on_stack field.
7770 (Descriptors::release): Only add pod to stack if it is not on the
7771 stack already.
7772 (Descriptors::close_some_descriptor): Clear stack_next and
7773 is_on_stack fields.
7774
e29e076a
ILT
7775 PR 7091
7776 * output.cc (Output_section::find_starting_output_address): Rename
7777 from starting_output_address; add PADDR parameter; change return
7778 type.
7779 * output.h (class Output_section): Declare
7780 find_starting_output_address instead of starting_output_address.
7781 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
7782 section symbol for which we can't find a merge section.
7783
0602e05a
ILT
7784 PR 9836
7785 * symtab.cc (Symbol_table::add_from_object): If the visibility is
7786 hidden or internal, force the symbol to be local.
7787 * resolve.cc (Symbol::override_visibility): Define.
7788 (Symbol::override_base): Use override_visibility.
7789 (Symbol_table::resolve): Likewise.
7790 (Symbol::override_base_with_special): Likewise.
7791 (Symbol_table::override_with_special): If the visibility is hidden
7792 or internal, force the symbol to be local.
7793 * symtab.h (class Symbol): Add set_visibility and
7794 override_visibility.
7795 * testsuite/ver_test_1.sh: New file.
7796 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
7797 (check_DATA): Add ver_test_1.syms.
7798 (ver_test_1.syms): New target.
7799 * testsuite/Makefile.in: Rebuild.
7800
401a9a73
CC
78012009-02-25 Cary Coutant <ccoutant@google.com>
7802
7803 * layout.cc (Layout::choose_output_section): Don't rename sections
7804 when using a linker script that has a SECTIONS clause.
7805 * Makefile.in: Regenerate.
7806
7807 * testsuite/Makefile.am (script_test_5.sh): New test case.
7808 * testsuite/Makefile.in: Regenerate.
7809 * testsuite/script_test_5.cc: New file.
7810 * testsuite/script_test_5.sh: New file.
7811 * testsuite/script_test_5.t: New file.
7812
f488e4b0
CC
78132009-02-13 Rafael Avila de Espindola <espindola@google.com>
7814
7815 * archive.cc (Archive::include_member): Update calls to add_symbols.
7816 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
7817 the Layout argument.
7818 * dynobj.h (do_add_symbols): Add the Layout argument.
7819 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
7820 Layout argument.
7821 * object.h (Object::add_symbols): Add the Layout argument.
7822 (Object::do_add_symbols): Add the Layout argument.
7823 (Sized_relobj::do_add_symbols): Add the Layout argument.
7824 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
7825 Unify the two versions.
7826 (Add_plugin_symbols): Remove.
7827 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
7828 (Sized_pluginobj::do_add_symbols): Unify the two versions.
7829 (Add_plugin_symbols): Remove.
7830 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
7831 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
7832 (Add_symbols::run): Make it work with Pulginobj.
7833
89dd1680
ILT
78342009-02-06 Ian Lance Taylor <iant@google.com>
7835
7836 * object.cc (Sized_relobj::do_layout): Make info message start
7837 with lower case letter.
7838
266d0a74
ILT
78392009-02-06 Mikolaj Zalewski <mikolajz@google.com>
7840
602b464e
ILT
7841 * binary.cc: Fix file comment.
7842
266d0a74
ILT
7843 * options.h (enum Incremental_disposition): Define.
7844 (class General_options): Add new options: --incremental,
7845 --incremental_changed, --incremental_unchanged,
7846 --incremental_unknown. Add incremental_disposition_ and
7847 implicit_incremental_ fields.
7848 (General_options::incremental_disposition): New function.
7849 (class Position_dependent_options): Add incremental_disposition
7850 option.
7851 (Position_dependent_options::copy_from_options): Set incremental
7852 dispositions.
7853 * options.cc (General_options::parse_incremental_changed): New
7854 function.
7855 (General_options::parse_incremental_unchanged): New function.
7856 (General_options::parse_incremental_unknown): New function.
7857 (General_options::General_options): Initialize new fields
7858 incremental_disposition_ and implicit_incremental_.
7859 (General_options::finalize): Check for uasge of --incremental-*
7860 without --incremental.
7861
f073bbf7
CD
78622009-02-06 Chris Demetriou <cgd@google.com>
7863
7864 * gold.h (gold_undefined_symbol): Change to take only a Symbol
7865 pointer and to report location as the file name associated with
7866 the symbol.
7867 (gold_undefined_symbol_at_location): New function to replace the
7868 old gold_undefined_symbol functionality.
7869 * target-reloc.h (relocate_section): Update to use
7870 gold_undefined_symbol_at_location.
7871 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
7872 Call gold_undefined_symbol function rather than gold_error.
7873 * errors.h (Errors::undefined_symbol): Take location as a
7874 string, rather than calculating it from a relocation.
7875 * errors.cc (Errors::fatal): Print "fatal error:" before the
7876 formatted message.
7877 (Errors::error, Errors::error_at_location): Print "error: "
7878 before the formatted message.
7879 (Errors::undefined_symbol): Take location as a string, rather
7880 than calculating it from a relocation.
7881 (gold_undefined_symbol_at_location): New function akin to
7882 old gold_undefined_symbol, calculates location from relocation.
7883 (gold_undefined_symbol): Change to take only a Symbol pointer
7884 and to report location as the file name associated with the symbol.
7885 * testsuite/debug_msg.sh: Update for changed error messages.
7886 * testsuite/undef_symbol.sh: Likewise.
7887
8e94a90c
ILT
78882009-02-04 Duncan Sands <baldrick@free.fr>
7889
7890 PR 9812
7891 * reduced_debug_output.h
7892 (Output_reduced_debug_abbrev_section::failed): Use format for
7893 gold_warning.
7894 (Output_reduced_debug_info_section::faild): Likewise.
7895
88a0e15b
ILT
78962009-01-31 Mikolaj Zalewski <mikolajz@google.com>
7897
7898 * script.cc (Lazy_demangler): New class.
7899 (Version_script_info::get_symbol_version_helper): Demangle a
7900 symbol only once.
7901
5efc7cd2
CC
79022009-01-29 Cary Coutant <ccoutant@google.com>
7903
7904 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
7905 to __tls_get_addr.
7906 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7907
e0ebcf42
ILT
79082009-01-28 Ian Lance Taylor <iant@google.com>
7909
5efc7cd2 7910 * version.cc (version_string): Bump to 1.9.
75fe7426 7911
e0ebcf42
ILT
7912 * gold.h: Include <cstring> and <stdint.h>.
7913 * version.cc: Include <cstdio>.
7914 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
7915 warning.
7916 * reduced_debug_output.cc (insert_into_vector): Rename from
7917 Insert_into_vector; change all callers. Use Swap_unaligned to
7918 avoid aliasing issue; remove union since it is unnecessary.
7919
8e2813be 79202009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
7921
7922 * Makefile.am (CCFILES): Add gc.cc.
7923 (HFILES): Add gc.h.
7924 * Makefile.in: Regenerate.
7925 * gold.cc (Gc_runner): New class.
7926 (queue_initial_tasks): Call garbage collection related tasks
7927 when corresponding options are invoked.
7928 (queue_middle_gc_tasks): New function.
7929 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
7930 processed early before laying out sections during garbage collection.
7931 * gold.h (queue_middle_gc_tasks): New function.
7932 (is_prefix_of): Move from "layout.cc".
7933 * i386.cc (Target_i386::gc_process_relocs): New function.
7934 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
7935 * main.cc (main): Create object of class "Garbage_collection".
7936 * object.cc (Relobj::copy_symbols_data): New function.
7937 (Relobj::is_section_name_included): New function.
e1df38aa
NC
7938 (Sized_relobj::do_layout): Allow this function to be called twice
7939 during garbage collection and defer layout of section during the
6d03d481
ST
7940 first call.
7941 * object.h (Relobj::get_symbols_data): New function.
7942 (Relobj::is_section_name_included): New function.
7943 (Relobj::copy_symbols_data): New function.
7944 (Relobj::set_symbols_data): New function.
7945 (Relobj::get_relocs_data): New function.
7946 (Relobj::set_relocs_data): New function.
7947 (Relobj::is_output_section_offset_invalid): New pure virtual function.
7948 (Relobj::gc_process_relocs): New function.
7949 (Relobj::do_gc_process_relocs): New pure virtual function.
7950 (Relobj::sd_): New data member.
7951 (Sized_relobj::is_output_section_offset_invalid): New function.
7952 (Sized_relobj::do_gc_process_relocs): New function.
7953 * options.h (General_options::gc_sections): Modify to not be a no-op.
7954 (General_options::print_gc_sections): New option.
7955 * plugin.cc (Plugin_finish::run): Remove function call to
7956 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
7957 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
7958 * reloc.cc (Read_relocs::run): Add task to process relocs and
7959 determine unreferenced sections when doing garbage collection.
7960 (Gc_process_relocs): New class.
7961 (Sized_relobj::do_gc_process_relocs): New function.
7962 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
7963 sections that are garbage collected.
7964 * reloc.h (Gc_process_relocs): New class.
7965 * sparc.cc (Target_sparc::gc_process_relocs): New function.
7966 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
7967 symbols whose corresponding sections are garbage collected.
7968 (Symbol_table::Symbol_table): Add new parameter for the garbage
7969 collection object.
7970 (Symbol_table::gc_mark_undef_symbols): New function.
7971 (Symbol_table::gc_mark_symbol_for_shlib): New function.
7972 (Symbol_table::gc_mark_dyn_syms): New function.
7973 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
7974 as garbage.
7975 (Symbol_table::add_from_object): Likewise.
7976 (Symbol_table::add_from_relobj): When building shared objects, do not
7977 treat externally visible symbols as garbage.
7978 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
7979 table information for static and relocatable links.
7980 * symtab.h (Symbol_table::set_gc): New function.
7981 (Symbol_table::gc): New function.
7982 (Symbol_table::gc_mark_undef_symbols): New function.
7983 (Symbol_table::gc_mark_symbol_for_shlib): New function.
7984 (Symbol_table::gc_mark_dyn_syms): New function.
7985 (Symbol_table::gc_): New data member.
e1df38aa 7986 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
7987 function.
7988 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
7989 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
7990
3b293544
CF
79912009-01-20 Chris Faylor <me.sourceware@sourceware.org>
7992
7993 * options.h (General_options::gc_sections): Define as a no-op for now.
7994 (General_options::no_keep_memory): Ditto.
7995 (General_options::Bshareable): Define.
7996 * options.cc (General_options::finalize): Honor -Bshareable.
7997
83d22aa8
AS
79982009-01-20 Andreas Schwab <schwab@suse.de>
7999
8000 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8001 read the value in the contents, since we don't use it. Use the
8002 template endianness when writing.
8003 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8004
cd536b21
AS
80052009-01-19 Andreas Schwab <schwab@suse.de>
8006
8007 * configure.tgt (powerpc64-*): Fix targ_obj.
8008
99e9a495
ILT
80092009-01-15 Ian Lance Taylor <iant@google.com>
8010
8011 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8012 local symbols when stripping all symbols.
8013
bbbfea06
CC
80142009-01-14 Cary Coutant <ccoutant@google.com>
8015
99e9a495 8016 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8017
0f7c0701
CC
80182009-01-14 Cary Coutant <ccoutant@google.com>
8019
8020 * archive.cc (Archive::get_elf_object_for_member): Remove call
8021 to File_read::claim_for_plugin.
8022 * descriptors.cc (Descriptors::open): Remove reference to
8023 is_claimed.
8024 (Descriptors::claim_for_plugin): Remove.
8025 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8026 (Descriptors::is_claimed): Remove.
8027 (claim_descriptor_for_plugin): Remove.
8028 * fileread.cc (File_read::claim_for_plugin): Remove.
8029 * fileread.h (File_read::claim_for_plugin): Remove.
8030 (File_read::descriptor): Reopen descriptor if necessary.
8031 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8032 (Plugin_manager::all_symbols_read): Add task parameter. Change
8033 all callers.
8034 (Plugin_manager::get_input_file): New function.
8035 (Plugin_manager::release_input_file): New function.
8036 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8037 corresponding data member.
8038 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8039 and pass to base constructor. Change all callers.
8040 (get_input_file, release_input_file): New functions.
8041 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8042 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8043 (Plugin_manager::all_symbols_read): Add task parameter.
8044 (Plugin_manager::get_input_file): New function.
8045 (Plugin_manager::release_input_file): New function.
8046 (Plugin_manager::task_): New data member.
8047 (Pluginobj::Pluginobj): Add filesize parameter.
8048 (Pluginobj::filename): New function.
8049 (Pluginobj::descriptor): New function.
8050 (Pluginobj::filesize): New function.
8051 (Pluginobj::filesize_): New data member.
8052 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8053 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8054 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8055
8056 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8057 with archive libraries.
8058 * testsuite/Makefile.in: Regenerate.
8059 * testsuite/plugin_test.c (struct sym_info): New type.
8060 (get_input_file, release_input_file): New static variables.
8061 (onload): Capture new transfer vector entries.
8062 (claim_file_hook): Stop reading at end of file according to filesize.
8063 Factor out parsing of readelf output into separate function.
8064 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8065 APIs and get the source file name from the symbol table. Convert
8066 source file name to corresponding object file name. Print info
8067 message when adding new input files.
8068 (parse_readelf_line): New function.
8069 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8070 * testsuite/plugin_test_2.sh: Likewise.
8071 * testsuite/plugin_test_3.sh: Likewise.
8072 * testsuite/plugin_test_4.sh: New test case.
8073
62a6d109
ILT
80742009-01-07 Ian Lance Taylor <iant@google.com>
8075
8076 * version.cc (version_string): Bump to 1.8.
8077
483620e8
CC
80782008-12-23 Cary Coutant <ccoutant@google.com>
8079
8080 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8081 * plugin.cc (Plugin_manager::finish): Rename as
8082 layout_deferred_objects. Move cleanup to separate function.
8083 (Plugin_manager::cleanup): New function.
8084 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8085 separately.
8086 * plugin.h (Plugin_manager::finish): Rename as
8087 layout_deferred_objects.
8088 (Plugin_manager::cleanup): New function.
8089 (Plugin_manager::cleanup_done): New field.
8090
d66a9eb3
CC
80912008-12-23 Cary Coutant <ccoutant@google.com>
8092
8093 * plugin.cc (is_visible_from_outside): New function.
8094 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8095 so we don't return "IR only" status for exported symbols or -r links.
8096
8097 * testsuite/Makefile.am (plugin_test_3): New test case.
8098 * testsuite/Makefile.in: Regenerate.
8099 * testsuite/plugin_test_3.sh: New file.
8100
5995b570
CC
81012008-12-22 Cary Coutant <ccoutant@google.com>
8102
8103 * object.cc (Sized_relobj::layout_section): New function.
8104 (Sized_relobj::do_layout): Defer layout of input sections until after
8105 plugin has provided replacement files.
8106 (Sized_relobj::do_layout_deferred_sections): New function.
8107 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8108 (Relobj::layout_deferred_sections): New function.
8109 (Relobj::do_layout_deferred_sections): New function.
8110 (Sized_relobj::do_layout_deferred_sections): New function.
8111 (Sized_relobj::layout_section): New function.
8112 (Sized_relobj::Deferred_layout): New structure.
8113 (Sized_relobj::deferred_layout_): New field.
8114 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8115 Change all callers. Layout deferred sections.
8116 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8117 references.
8118 (Plugin_hook::run): Move code from do_plugin_hook inline.
8119 (Plugin_hook::do_plugin_hook): Remove.
8120 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8121 (Plugin_manager::finish): Renamed, was cleanup.
8122 (Plugin_manager::should_defer_layout): New function.
8123 (Plugin_manager::add_deferred_layout_object): New function.
8124 (Plugin_manager::Deferred_layout_list): New type.
8125 (Plugin_manager::deferred_layout_objects_): New field.
8126 (Plugin_hook::do_plugin_hook): Remove.
8127
ee769c88
ILT
81282008-12-17 Ian Lance Taylor <iant@google.com>
8129
8130 * options.h (class General_options): Add --no case for
8131 --export-dynamic.
8132
abc8dcba
CC
81332008-12-16 Cary Coutant <ccoutant@google.com>
8134
8135 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8136 vector.
8137 (Plugin_manager::claim_file): Create plugin object even if
8138 plugin did not call the add_symbols callback.
8139 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8140 asking for more symbols than were added.
8141 * testsuite/Makefile.am (plugin_test_1): Add test case with
8142 no global symbols.
8143 (empty.syms): New target.
8144 * testsuite/Makefile.in: Regenerate.
8145 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8146 message. Don't call add_symbols if no globals.
8147 (all_symbols_read_hook): Don't provide replacement for empty
8148 claimed file.
8149
b0074644
ILT
81502008-12-12 Ian Lance Taylor <iant@google.com>
8151
68943102
ILT
8152 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8153 r_type == 0 for a local symbol with r_sym == 0.
8154 (scan_relocatable_relocs): Pass r_sym to
8155 local_non_section_strategy.
8156 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8157 r_sym parameter.
8158
b0074644
ILT
8159 * configure.ac: Update test for TLS descriptors: they are
8160 supported as of glibc 2.9.
8161 * configure: Rebuild.
8162
c2508178
ILT
81632008-12-11 Ian Lance Taylor <iant@google.com>
8164
8165 PR 7091
8166 * target-reloc.h (Default_scan_relocatable_relocs): For each
8167 function, map r_type == 0 to RELOC_DISCARD.
8168
2756a258
CC
81692008-12-10 Cary Coutant <ccoutant@google.com>
8170
8171 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8172 object to override a kept COMDAT group from a plugin object.
8173
bb6f53d3
ILT
81742008-12-09 Ian Lance Taylor <iant@google.com>
8175
fbc558e1
ILT
8176 PR 7088
8177 * yyscript.y (file_cmd): Handle INPUT.
8178
bb6f53d3
ILT
8179 * testsuite/initpri1.c: Change all declarations to be full
8180 prototypes by adding void, to avoid compiler warnings.
8181
4674ecfc
CC
81822008-12-05 Rafael Avila de Espindola <espindola@google.com>
8183
8184 * options.cc (General_options::parse_plugin_opt): New.
8185 (General_options::add_plugin): The argument now is just the filename.
8186 (General_options::add_plugin_option): New.
8187 * options.h (plugin_opt): New.
8188 (add_plugin): Change argument name.
8189 (add_plugin_option): New.
8190 * plugin.cc (Plugin::load): Don't parse the plugin option.
8191 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8192 (Plugin::add_option): New.
8193 (Plugin::args_): Change type.
8194 (Plugin::filename_): New.
8195 (Plugin_manager::add_plugin_option): New.
8196 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8197 * testsuite/Makefile.in: Regenerate.
8198
fd06b4aa
CC
81992008-12-05 Cary Coutant <ccoutant@google.com>
8200
8201 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8202 Handle --strip-lto-sections option.
8203 * options.h (strip_lto_sections): New option.
8204
6c52134c
CC
82052008-12-01 Cary Coutant <ccoutant@google.com>
8206
8207 * plugin.cc (ld_plugin_message): Change format parameter to const.
8208 Fix mismatch between new[] and delete.
8209
a45248e0
CC
82102008-11-14 Cary Coutant <ccoutant@google.com>
8211
8212 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
8213 instead of -1U.
8214
c82fbeee
CS
82152008-11-05 Craig Silverstein <csilvers@google.com>
8216
8217 * options.cc (General_options::parse_dynamic_list): New function.
8218 * options.h (General_options): New flags dynamic_list,
8219 dynamic_list_data, dynamic_list_cpp_new, and
8220 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
8221 (General_options::in_dynamic_list): New function.
8222 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
8223 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
8224 (Lex::can_continue_name): Likewise.
8225 (yylex): Likewise.
8226 (read_script_file): New parameter script_options.
8227 (read_dynamic_list): New function.
8228 (Script_options::define_dynamic_list): New function.
8229 (dynamic_list_keyword_parsecodes): New variable.
8230 (dynamic_list_keywords): New variable.
8231 * script.h (Script_options::define_dynamic_list): New function
8232 prototype.
8233 (read_dynamic_list): New function prototype.
8234 * symtab.cc (strprefix): New macro.
8235 (Symbol::should_add_dynsym_entry): Support dynamic_list,
8236 dynamic_list_data, dynamic_list_cpp_new, and
8237 dynamic_list_cpp_typeinfo.
8238 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
8239 (dynamic_list_expr): New rule.
8240 (dynamic_list_nodes): Likewise.
8241 (dynamic_list_node): Likewise.
8242 * testsuite/Makefile.am (dynamic_list): New test.
8243 * testsuite/Makefile.in: Regenerated.
8244 * testsuite/dynamic_list.t: New file.
8245 * testsuite/dynamic_list.sh: New file.
8246
e0bb29a5
CS
82472008-11-05 Craig Silverstein <csilvers@google.com>
8248
8249 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
8250 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
8251 (t11_last): Likewise.
8252 * testsuite/ver_test_6.c (main): Likewise.
8253
4e1e25e0
CC
82542008-10-07 Cary Coutant <ccoutant@google.com>
8255
8256 * options.c (General_options::finalize): Add check for -static and
8257 -shared.
8258 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
8259 is not empty.
8260
92f03fcb
CC
82612008-10-02 Cary Coutant <ccoutant@google.com>
8262
8263 * plugin.cc (make_sized_plugin_object): Fix conditional
8264 compilation to work when not all targets are enabled.
8265
fbd8a257
CC
82662008-09-29 Cary Coutant <ccoutant@google.com>
8267
8268 * archive.cc (Archive::get_file_and_offset): Use filename instead
8269 of name to get library path.
8270 (Archive::include_member): Unlock external member of a thin archive.
8271
8272 * testsuite/Makefile.am (TEST_AR): New variable.
8273 (thin_archive_test_1): New test.
8274 (thin_archive_test_2): New test.
81636b3f
CC
8275 * testsuite/Makefile.in: Regenerate.
8276 * testsuite/thin_archive_main.cc: New file.
8277 * testsuite/thin_archive_test_1.cc: New file.
8278 * testsuite/thin_archive_test_2.cc: New file.
8279 * testsuite/thin_archive_test_3.cc: New file.
8280 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 8281
eff45813
CC
82822008-09-29 Cary Coutant <ccoutant@google.com>
8283
8284 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
8285 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
8286 instead of -1U.
8287 (Sized_relobj::do_finalize_local_symbols): Likewise.
8288 (Sized_relobj::map_to_kept_section): Likewise.
8289 * object.h (Sized_relobj::invalid_address): New constant.
8290 (Sized_relobj::do_output_section_offset): Check for invalid_address
8291 and return -1ULL.
8292 * output.cc (Output_reloc::local_section_offset): Use constant
8293 invalid_address instead of -1U.
8294 (Output_reloc::get_address): Likewise.
8295 (Output_section::output_address): Change -1U to -1ULL.
8296 * output.h (Output_reloc::invalid_address): New constant.
8297 * reloc.cc (Sized_relobj::write_sections): Use constant
8298 invalid_address instead of -1U.
8299 (Sized_relobj::relocate_sections): Likewise.
8300 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
8301 values for merge sections.
8302 * target-reloc.h (relocate_for_relocatable): Use constant
8303 invalid_address instead of -1U.
8304
89fc3421
CC
83052008-09-19 Cary Coutant <ccoutant@google.com>
8306
8307 Add plugin functionality for link-time optimization (LTO).
8308 * configure.ac (plugins): Add --enable-plugins option.
8309 * configure: Regenerate.
8310 * config.in: Regenerate.
8311 * Makefile.am (LIBDL): New variable.
8312 (CCFILES): Add plugin.cc.
8313 (HFILES): Add plugin.h.
8314 (ldadd_var): Add LIBDL.
8315 * Makefile.in: Regenerate.
8316
8317 * archive.cc: Include "plugin.h".
8318 (Archive::setup): Don't preread archive symbols when using a plugin.
8319 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
8320 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
8321 files.
8322 (Archive::include_member): Add symbols from plugin objects.
8323 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
8324 * descriptors.cc (Descriptors::open): Check for file descriptors
8325 abandoned by plugins.
8326 (Descriptors::claim_for_plugin): New function.
8327 * descriptors.h (Descriptors::claim_for_plugin): New function.
8328 (Open_descriptor::is_claimed): New field.
8329 (claim_descriptor_for_plugin): New function.
8330 * fileread.cc (File_read::claim_for_plugin): New function.
8331 * fileread.h (File_read::claim_for_plugin): New function.
8332 (File_read::descriptor): New function.
8333 * gold.cc: Include "plugin.h".
8334 (queue_initial_tasks): Add task to call plugin hooks for generating
8335 new object files.
8336 * main.cc: Include "plugin.h".
8337 (main): Load plugin libraries.
8338 * object.h (Pluginobj): Declare.
8339 (Object::pluginobj): New function.
8340 (Object::do_pluginobj): New function.
8341 (Object::set_target): New function.
8342 * options.cc: Include "plugin.h".
8343 (General_options::parse_plugin): New function.
8344 (General_options::General_options): Initialize plugins_ field.
8345 (General_options::add_plugin): New function.
8346 * options.h (Plugin_manager): Declare.
8347 (General_options): Add --plugin option.
8348 (General_options::has_plugins): New function.
8349 (General_options::plugins): New function.
8350 (General_options::add_plugin): New function.
8351 (General_options::plugins_): New field.
8352 * plugin.cc: New file.
8353 * plugin.h: New file.
8354 * readsyms.cc: Include "plugin.h".
8355 (Read_symbols::do_read_symbols): Check for archive before checking
8356 for ELF file. Call plugin hooks to claim files.
8357 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
8358 from a real object file; force override when processing replacement
8359 files.
8360 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
8361 (Symbol::init_base_object): Likewise.
8362 (Symbol::init_base_output_data): Likewise.
8363 (Symbol::init_base_output_segment): Likewise.
8364 (Symbol::init_base_constant): Likewise.
8365 (Symbol::init_base_undefined): Likewise.
8366 (Symbol::output_section): Assert that object is not a plugin.
8367 (Symbol_table::add_from_pluginobj): New function.
8368 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
8369 undefined.
8370 (Symbol_table::sized_write_globals): Likewise.
8371 (Symbol_table::add_from_pluginobj): Instantiate template.
8372 * symtab.h (Sized_pluginobj): Declare.
8373 (Symbol::in_real_elf): New function.
8374 (Symbol::set_in_real_elf): New function.
8375 (Symbol::in_real_elf_): New field.
8376 (Symbol_table::add_from_pluginobj): New function.
8377
8378 * testsuite/Makefile.am (AM_CFLAGS): New variable.
8379 (LIBDL): New variable.
8380 (LDADD): Add LIBDL.
8381 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
8382 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
8383 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
8384 (MOSTLYCLEANFILES): Likewise.
8385 * testsuite/Makefile.in: Regenerate.
8386 * testsuite/plugin_test.c: New file.
8387 * testsuite/plugin_test_1.sh: New file.
8388 * testsuite/plugin_test_2.sh: New file.
8389
de31bda5
ILT
83902008-09-16 Ian Lance Taylor <iant@google.com>
8391
9c2d0ef9
ILT
8392 * target-reloc.h (relocate_section): Check whether a symbol is
8393 defined by the ABI before reporting an undefined symbol error.
8394 * target.h (Target::is_defined_by_abi): Make parameter const.
8395 (Target::do_is_defined_by_abi): Likewise.
8396 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
8397 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
8398 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
8399 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
8400 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
8401 * testsuite/Makefile.in: Rebuild.
8402
de31bda5
ILT
8403 * fileread.cc (make_view): Add casts to avoid warning.
8404
9fa33bee
AO
84052008-09-16 Alexandre Oliva <aoliva@redhat.com>
8406
8407 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
8408 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8409
183fd0e3
AO
84102008-09-16 Alexandre Oliva <aoliva@redhat.com>
8411
8412 * options.h (General_options::output_is_executable): New.
8413 (General_options::output_is_pie): New.
8414 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
8415 for shared libraries.
8416 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8417
7be8330a
CD
84182008-09-11 Chris Demetriou <cgd@google.com>
8419
8420 * options.h (origin): New -z option.
8421 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
8422 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
8423 in DT_FLAGS_1.
8424
a9caad02
CC
84252008-09-05 Cary Coutant <ccoutant@google.com>
8426
8427 * fileread.cc (File_read::make_view): Add check for attempt to map
8428 beyond end of file.
8429
ae6dce4d
CC
84302008-09-05 Cary Coutant <ccoutant@google.com>
8431
8432 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
8433 explicit instantiations.
8434
d7ab2a47
KVH
84352008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
8436
8437 PR gold/6858
8438 * options.cc (General_options::finalize): Allow undefined symbols
8439 in shlibs if linking -shared.
8440
8441 PR gold/6859
8442 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
8443 symbols as not needing a dynsym entry.
8444
1e52a9c1
CS
84452008-08-20 Craig Silverstein <csilvers@google.com>
8446
8447 * fileread.cc (File_read::open): Do not lock the file unless it
8448 was successfully opened.
8449
d85c80a3
CC
84502008-08-14 Cary Coutant <ccoutant@google.com>
8451
8452 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
8453 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
8454 * testsuite/tls_test.cc (struct int128): 128-bit struct
8455 for testing TLS relocs with non-zero addend.
8456 (v12): New TLS variable.
8457 (t12): New test.
8458 (t_last): Add check for v12.
8459 * testsuite/tls_test.h (t12): New function.
8460 * testsuite/tls_test_main.cc (thread_routine): Call new test.
8461
2d924fd9
ILT
84622008-08-13 Ian Lance Taylor <iant@google.com>
8463
8464 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
8465 set tls_segment_ or relro_segment_.
8466 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
8467 when appropriate.
8468 * output.h (Output_section::clear_is_relro): New function.
8469 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
8470 sections specially even when output_data_ is empty.
8471 (Output_segment::maximum_alignment): When first section is relro,
8472 only force alignment for PT_LOAD segments.
8473 * script.cc (script_data_segment_align): New function.
8474 (script_data_segment_relro_end): New function.
8475 * script-c.h (script_data_segment_align): Declare.
8476 (script_data_segment_relro_end): Declare.
8477 * script-sections.h (class Script_sections): Declare
8478 data_segment_align and data_segment_relro_end. Add fields
8479 segment_align_index_ and saw_relro_end_.
8480 * script-sections.cc (class Sections_element): Add set_is_relro
8481 virtual function. Add new bool* parameter to place_orphan_here.
8482 Add get_output_section virtual function.
8483 (class Output_section_definition): Add set_is_relro. Add new
8484 bool* parameter to place_orphan_here. Add get_output_section.
8485 Add is_relro_ field.
8486 (Output_section_definition::Output_section_definition): Initialize
8487 evaluated_address_, evaluated_load_address, evaluated_addralign_,
8488 and is_relro_ fields.
8489 (Output_section_definition::place_orphan_here): Add is_relro
8490 parameter.
8491 (Output_section_definition::set_section_addresses): Set relro for
8492 output section.
8493 (Output_section_definition::alternate_constraint): Likewise.
8494 (class Orphan_output_section): Add new bool* parameter to
8495 place_orphan_here. Add get_output_section.
8496 (Orphan_output_section::place_orphan_here): Add is_relro
8497 parameter.
8498 (Script_sections::Script_sections): Initialize
8499 data_segment_align_index_ and saw_relro_end_.
8500 (Script_sections::data_segment_align): New function.
8501 (Script_sections::data_segment_relro_end): New function.
8502 (Script_sections::place_orphan): Set or clear is_relro.
8503 (Script_sections::set_section_addresses): Force alignment of first
8504 TLS section.
8505 * yyscript.y (exp): Call script_data_segment_align and
8506 script_data_segment_relro_end.
8507 * testsuite/relro_script_test.t: New file.
8508 * testsuite/relro_test.cc (using_script): Declare.
8509 (t1, t2): Test using_script.
8510 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
8511 (relro_script_test_SOURCES): Define.
8512 (relro_script_test_DEPENDENCIES): Define.
8513 (relro_script_test_LDFLAGS): Define.
8514 (relro_script_test_LDADD): Define.
8515 (relro_script_test.so): New target.
8516 * testsuite/Makefile.in: Rebuild.
8517
f827c9a9
CC
85182008-08-06 Cary Coutant <ccoutant@google.com>
8519
8520 * archive.cc (Archive::total_archives, Archive::total_members)
8521 (Archive::total_members_loaded): New variables.
8522 (Archive::setup): Add parameter. Add option to preread
8523 archive symbols.
8524 (Archive::read_armap): Add counter.
8525 (Archive::get_file_and_offset): New function.
8526 (Archive::get_elf_object_for_member): New function.
8527 (Archive::read_all_symbols): New function.
8528 (Archive::read_symbols): New function.
8529 (Archive::add_symbols): Add counters.
8530 (Archive::include_all_members): Use armap to find members if it's
8531 already built.
8532 (Archive::include_member): Skip reading symbols if already read.
8533 Factored code into Archive::get_file_and_offset and
8534 Archive::get_elf_object_for_member. Changed call to
8535 Mapfile::report_include_archive_member.
8536 (Archive::print_stats): New function.
8537 * archive.h: Declare Object and Read_symbols_data classes.
8538 (Archive::Archive): Add initializers for new members.
8539 (Archive::setup): Add parameter.
8540 (Archive::print_stats): New function.
8541 (Archive::total_archives, Archive::total_members)
8542 (Archive::total_members_loaded): New variables.
8543 (Archive::get_file_and_offset): New function.
8544 (Archive::get_elf_object_for_member): New function.
8545 (Archive::read_all_symbols): New function.
8546 (Archive::read_symbols): New function.
8547 (Archive::Archive_member): New class.
8548 (Archive::members_): New member.
8549 (Archive::num_members_): New member.
8550 * main.cc: Include archive.h.
8551 (main): Call Archive::print_stats.
8552 * mapfile.cc (Mapfile::report_include_archive_member): Delete
8553 archive parameter; member_name is now the fully-decorated name.
8554 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
8555 * options.h: (General_options): Add --preread-archive-symbols option.
8556 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
8557 Archive::setup.
8558
de4c45bd
ILT
85592008-08-04 Ian Lance Taylor <iant@google.com>
8560
8561 * symtab.h (Symbol::use_plt_offset): New function.
8562 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
8563 * powerpc.cc (Relocate::relocate): Likewise.
8564 * sparc.cc (Relocate::relocate): Likewise.
8565 * x86_64.cc (Relocate::relocate): Likewise.
8566 * testsuite/weak_plt.sh: New test.
8567 * testsuite/weak_plt_main.cc: New test.
8568 * testsuite/weak_plt_shared.cc: New test.
8569 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
8570 (check_PROGRAMS): Add weak_plt.
8571 (check_DATA): Add weak_plt_shared.so.
8572 (weak_plt_main_pic.o, weak_plt): New targets.
8573 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
8574 * testsuite/Makefile.in: Rebuild.
8575
8576 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
8577 gcctestdir/ld.
8578 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
8579 * testsuite/Makefile.in: Rebuild.
8580
323ee3f4
AM
85812008-08-04 Alan Modra <amodra@bigpond.net.au>
8582
8583 * Makefile.am (POTFILES.in): Set LC_ALL=C.
8584 * Makefile.in: Regenerate.
8585 * po/POTFILES.in: Regenerate.
8586
7c07ecec
ILT
85872008-07-29 Ian Lance Taylor <iant@google.com>
8588
8589 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
8590 symbols before other symbols.
8591 * testsuite/script_test_2.cc (test_addr): Declare.
8592 (test_addr_alias): Declare.
8593 (main): Check that test_addr and test_addr_alias have the right
cd536b21 8594 values.
7c07ecec
ILT
8595 * testsuite/script_test_2.t: Define test_addr_alias and
8596 test_addr.
8597
5778530e
ILT
85982008-07-24 Ian Lance Taylor <iant@google.com>
8599
2a00e4fb
ILT
8600 PR 5990
8601 * descriptors.cc: New file.
8602 * descriptors.h: New file.
8603 * gold-threads.h (class Hold_optional_lock): New class.
8604 * fileread.cc: Include "descriptors.h".
8605 (File_read::~File_read): Release descriptor rather than closing
8606 it.
8607 (File_read::open) [file]: Call open_descriptor rather than open.
8608 Set is_descriptor_opened_.
8609 (File_read::open) [memory]: Assert that descriptor is not open.
8610 (File_read::reopen_descriptor): New function.
8611 (File_read::release): Release descriptor.
8612 (File_read::do_read): Make non-const. Reopen descriptor.
8613 (File_read::read): Make non-const.
8614 (File_read::make_view): Reopen descriptor.
8615 (File_read::do_readv): Likewise.
8616 * fileread.h (class File_read): Add is_descriptor_opened_ field.
8617 Update declarations.
8618 * layout.cc: Include "descriptors.h".
8619 (Layout::create_build_id): Use open_descriptor rather than open.
8620 * output.cc: Include "descriptors.h".
8621 (Output_file::open): Use open_descriptor rather than open.
8622 * archive.cc (Archive::const_iterator): Change Archive to be
8623 non-const.
8624 (Archive::begin, Archive::end): Make non-const.
8625 (Archive::count_members): Likewise.
8626 * archive.h (class Archive): Update declarations.
8627 * object.h (Object::read): Make non-const.
8628 * Makefile.am (CCFILES): Add descriptors.cc.
8629 (HFILES): Add descriptors.h.
8630 * Makefile.in: Rebuild.
8631
801647d1
ILT
8632 PR 6716
8633 * gold.h: Always include <clocale>. Add Solaris workarounds
8634 following code in binutils/sysdep.h.
8635
5edd166e
ILT
8636 PR 6048
8637 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
8638 this->eh_frame_hdr_ is NULL before using it.
8639
c89ad728
ILT
8640 * dynobj.cc (Versions::Versions): Update comment.
8641
aa86f06b
ILT
8642 * dynobj.cc (Versions::Versions): If there is an soname, use it as
8643 the base version name.
8644
5778530e
ILT
8645 * stringpool.cc (Stringpool_template::add_with_length): Set key to
8646 array size plus one.
8647 (Stringpool_template::set_string_offsets): Subtract one from key
8648 before using it as an array index.
8649 (Stringpool_template::get_offset_with_length): Likewise.
8650 (Stringpool_template::write_to_buffer): Likewise.
8651 * stringpool.h (Stringpool_template::get_offset_from_key):
8652 Likewise.
8653
057ead22
ILT
86542008-07-23 Ian Lance Taylor <iant@google.com>
8655
7f649c59
ILT
8656 PR 6658
8657 * object.h (Merged_symbol_value::value): Do our best to handle a
8658 negative addend.
8659
057ead22
ILT
8660 PR 6647
8661 * script.cc (Version_script_info::get_versions): Don't add empty
8662 version tag to return value.
8663 (Version_script_info::get_symbol_version_helper): Change return
8664 type to bool. Add pversion parameter. Change all callers.
8665 (script_register_vers_node): Don't require a non-NULL tag.
8666 * script.h (class Version_script_info): Update declarations.
8667 (Version_script_info::get_symbol_version): Change return type to
8668 bool. Add version parameter. Change all callers.
8669 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
8670 handling. Handle an empty version from a version script.
8671 (Symbol_table::define_special_symbol): Likewise.
8672 * testsuite/ver_test_10.script: New file.
8673 * testsuite/ver_test_10.sh: New file.
8674 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
8675 (check_DATA): Add ver_test_10.syms.
8676 (ver_test_10.syms, ver_test_10.so): New target.
8677 * testsuite/Makefile.in: Rebuild.
8678
58e54ac2
CD
86792008-07-23 Simon Baldwin <simonb@google.com>
8680
8681 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
8682 to zero for undefined symbols from dynamic libraries.
8683
95d14cd3
ILT
86842008-07-23 Ian Lance Taylor <iant@google.com>
8685
8686 * symtab.cc (Symbol_table::resolve): Remove version parameter.
8687 Change all callers.
8688 * symtab.h (class Symbol_table): Update declaration.
8689 * testsuite/ver_test_9.cc: New file.
8690 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
8691 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
8692 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
8693 (ver_test_9.so, ver_test_9.o): New targets.
8694 * testsuite/Makefile.in: Rebuild.
8695
92de84a6
ILT
86962008-07-22 Ian Lance Taylor <iant@google.com>
8697
34810851
ILT
8698 * options.h (class General_options): Define --check-sections.
8699 * layout.cc (Layout::set_segment_offsets): Handle
8700 --check-sections.
8701
af6156ef
ILT
8702 * options.h (class General_options): Define -n/--nmagic and
8703 -N/--omagic.
8704 * options.cc (General_options::finalize): For -n/--nmagic or
8705 -N/--omagic, set -static.
8706 * layout.cc (Layout::attach_allocated_section_to_segment): If
8707 -N/--omagic, don't put read-only and read-write sections in
8708 different segments.
8709 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
8710 finding a read-only segment.
8711 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
8712 don't set the minimum segment alignment to the common page size,
8713 and don't set the file offset to the address modulo the page size.
8714 * script-sections.cc (Script_sections::create_segments): If
8715 -n/--omagic, don't put read-only and read-write sections in
8716 different segments.
8717
92de84a6
ILT
8718 * cref.cc: New file.
8719 * cref.h: New file.
8720 * options.h (class General_options): Add --print-symbol-counts.
8721 * main.cc (main): Issue defined symbol report if requested.
8722 * archive.cc (Archive::interpret_header): Make into a const member
8723 function.
8724 (Archive::add_symbols): Call Input_objects::archive_start and
8725 archive_stop.
8726 (Archive::const_iterator): Define new class.
8727 (Archive::begin, Archive::end): New functions.
8728 (Archive::include_all_members): Rewrite to use iterator.
8729 (Archive::count_members): New function.
8730 * archive.h (class Archive): Update declarations.
8731 (Archive::filename): New function.
8732 * object.cc: Include "cref.h".
8733 (Sized_relobj::Sized_relobj): Initialize defined_count_.
8734 (Sized_relobj::do_get_global_symbol_counts): New function.
8735 (Input_objects::add_object): Add object to cross-referencer.
8736 (Input_objects::archive_start): New function.
8737 (Input_objects::archive_stop): New function.
8738 (Input_objects::print_symbol_counts): New function.
8739 * object.h: Declare Cref and Archive.
8740 (Object::get_global_symbol_counts): New function.
8741 (Object::do_get_global_symbol_counts): New pure virtual function.
8742 (class Sized_relobj): Add defined_count_ field. Update
8743 declarations.
8744 (class Input_objects): Add cref_ field. Update constructor.
8745 Update declarations.
8746 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
8747 defined_count_.
8748 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
8749 symbol counts.
8750 (Sized_dynobj::do_get_global_symbol_counts): New function.
8751 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
8752 defined_count_. Update declarations. Define Symbols typedef.
8753 * symtab.cc (Symbol_table::add_from_relobj): Add defined
8754 parameter. Change all callers.
8755 (Symbol_table::add_from_dynobj): Add sympointers and defined
8756 parameters. Change all callers.
8757 * symtab.h (class Symbol_table): Update declarations.
8758 * Makefile.am (CCFILES): Add cref.cc.
8759 (HFILES): Add cref.h.
8760 * Makefile.in: Rebuild.
8761
3f7c5e1d
CD
87622008-07-22 Simon Baldwin <simonb@google.com>
8763
8764 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
8765 to zero when writing undefined symbols.
8766
e0b64032
ILT
87672008-07-22 Ian Lance Taylor <iant@google.com>
8768
8769 * output.cc (Output_section::add_input_section): Don't try to
8770 merge empty merge sections.
8771
096b02cf
CS
87722008-07-21 Craig Silverstein <csilvers@google.com>
8773
8774 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8775 Include symbol version in error message.
cd536b21 8776
1d1f116d
CD
87772008-07-20 Chris Demetriou <cgd@google.com>
8778
cd536b21 8779 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
8780 (RANDOM_SEED_CFLAGS): New substituted variable.
8781 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
8782 * configure: Rebuild.
8783 * Makefile.in: Likewise.
8784 * testsuite/Makefile.in: Likewise.
8785
a18f591e
ILT
87862008-07-18 Ian Lance Taylor <iant@google.com>
8787
8788 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
8789 where we see NAME/NULL and NAME/VERSION as separate symbols.
8790 * testsuite/ver_test_main.cc (main): Call t4.
8791 (t4, t4_2a): Define.
8792 * testsuite/ver_test_2.cc (t4_2): Define.
8793 * testsuite/ver_test_2.script: Put t4_2a in VER2.
8794 * testsuite/ver_test_4.cc (t4_2a): Define.
8795 * testsuite/ver_test_4.script: Put t4_2a in VER2.
8796 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
8797
c6e3f6ed
ILT
87982008-07-17 Ian Lance Taylor <iant@google.com>
8799
8800 * dynobj.cc (Versions::add_def): If we give an error about a
8801 missing version, go ahead and create the version anyhow.
8802
ef9beddf
ILT
88032008-07-10 Ian Lance Taylor <iant@google.com>
8804
8805 Handle output sections with more than 0x7fffffff bytes.
8806 * object.h (class Relobj): Change map_to_output_ to
8807 output_sections_, and just keep a section pointer. Change all
8808 uses. Move comdat group support to Sized_relobj.
8809 (Relobj::is_section_specially_mapped): Remove.
8810 (Relobj::output_section): Remove poff parameter. Change all
8811 callers.
8812 (Relobj::output_section_offset): New function.
8813 (Relobj::set_section_offset): Rewrite.
8814 (Relobj::map_to_output): Remove.
8815 (Relobj::output_sections): New function.
8816 (Relobj::do_output_section_offset): New pure virtual function.
8817 (Relobj::do_set_section_offset): Likewise.
8818 (class Sized_relobj): Add section_offsets_ field. Add comdat
8819 group support from Relobj. Update declarations.
8820 (Sized_relobj::get_output_section_offset): New function.
8821 (Sized_relobj::do_output_section_offset): New function.
8822 (Sized_relobj::do_set_section_offset): New function.
8823 * object.cc (Relobj::output_section_address): Remove.
8824 (Sized_relobj::Sized_relobj): Initialize new fields.
8825 (Sized_relobj::include_section_group): Cast find_kept_object to
8826 Sized_relobj.
8827 (Sized_relobj::include_linkonce_section): Likewise.
8828 (Sized_relobj::do_layout): Use separate arrays for output section
8829 and output offset.
8830 (Sized_relobj::do_count_local_symbols): Change map_to_output to
8831 output_sections.
8832 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
8833 output_sections and section_offsets.
8834 (Sized_relobj::write_local_symbols): Likewise.
8835 (map_to_kept_section): Compute output address directly.
8836 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
8837 output_sections and section_offsets.
8838 (Sized_relobj::write_sections): Likewise.
8839 (Sized_relobj::relocate_sections): Likewise.
8840 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
8841 * output.h (class Output_reloc): Update declarations. Change
8842 u2_.relobj to Sized_relobj*.
8843 (class Output_data_reloc): Change add functions to use
8844 Sized_relobj*.
8845 * output.cc (Output_reloc::Output_reloc): Change relobj to
8846 Sized_relobj*.
8847 (Output_reloc::local_section_offset): Change return type to
8848 Elf_Addr. Use get_output_section_offset.
8849 (Output_reloc::get_address): Likewise.
8850 (Output_section::is_input_address_mapped): Don't call
8851 is_section_specially_mapped.
8852 (Output_section::output_offset): Likewise.
8853 (Output_section::output_address): Likewise.
8854 (Output_section::starting_output_address): Likewise.
8855 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
8856 parameter to Sized_relobj*.
8857 (Copy_relocs::need_copy_reloc): Likewise.
8858 (Copy_relocs::save): Likewise.
8859 * copy-relocs.h (class Copy_relocs): Update declarations.
8860 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
8861 Sized_relobj*. Change relobj_ field to Sized_relobj*.
8862 * target-reloc.h (relocate_for_relocatable): Change
8863 offset_in_output_section type to Elf_Addr. Change code that uses
8864 it as well.
8865 * layout.cc (Layout::layout): Always set *off.
8866 * mapfile.cc (Mapfile::print_input_section): Use
8867 output_section_offset.
8868 * i386.cc (Target_i386::copy_reloc): Change object parameter to
8869 Sized_relobj*.
8870 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
8871 * sparc.cc (Target_sparc::copy_reloc): Likewise.
8872 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
8873
5cb66f97
ILT
88742008-07-03 Ian Lance Taylor <iant@google.com>
8875
8876 * layout.cc (Layout::include_section): Do not discard unrecognized
8877 SHT_STRTAB sections.
8878
afe47622
CS
88792008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
8880
8881 * script.cc (Lex::can_continue_name): Make '?' allowable in
8882 version-script names.
8883 * testsuite/version_script.map: Change glob pattern to use '?'
8884
5adf9721
ILT
88852008-06-30 Manish Singh <yosh@gimp.org>
8886
8887 PR 6585
8888 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
8889 Correct typo.
8890
e6fde208
ILT
88912008-06-30 Ian Lance Taylor <iant@google.com>
8892
8893 PR 6660
8894 PR 6682
8895 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
8896 versions]: Don't try to read the value in the contents, since we
8897 don't use it. Use the template endianness when writing.
8898
3f2e6a2d
CC
88992008-06-25 Cary Coutant <ccoutant@google.com>
8900
8901 * fileread.cc (File_read::make_view): Assert on zero-length view.
8902 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
8903 symbol table when there are no symbols to read.
8904
c43d3a48
CS
89052008-06-23 Craig Silverstein <csilvers@google.com>
8906
8907 * version.cc (version_string): Bump to 1.7
8908
5f494ea0
CS
89092008-06-18 Craig Silverstein <csilvers@google.com>
8910
8911 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
8912 constant 0xFFFF to type Valtype.
8913 (Powerpc_relocate_functions::rel16_ha): Likewise.
8914
c42e122e
ILT
89152008-06-17 Ian Lance Taylor <iant@google.com>
8916
f34787f8
ILT
8917 * output.h (Output_section::Input_section): Initialize p2align_ to
8918 zero for Output_section_data constructors.
8919 (Output_section::Input_section::addralign): If not an input
8920 section, return the alignment of the Output_section_data.
8921 * testsuite/copy_test.cc: New file.
8922 * testsuite/copy_test_1.cc: New file.
8923 * testsuite/copy_test_2.cc: New file.
8924 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
8925 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
8926 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
8927 (copy_test_1_pic.o, copy_test_1.so): New targets.
8928 (copy_test_2_pic.o, copy_test_2.so): New targets.
8929 * testsuite/Makefile.in: Rebuild.
8930
c42e122e
ILT
8931 * script-sections.cc (Script_sections::place_orphan): Initialize
8932 local variable exact.
8933
ce3ac18a
DE
89342008-06-13 David Edelsohn <edelsohn@gnu.org>
8935
8936 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
8937
42cacb20
DE
89382008-06-12 David Edelsohn <edelsohn@gnu.org>
8939 David S. Miller <davem@davemloft.net>
8940
8941 * powerpc.cc: New file.
8942 * Makefile.am (TARGETSOURCES): Add powerpc.cc
8943 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
8944 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
8945 * Makefile.in: Rebuild.
8946
7b308235
ILT
89472008-06-09 Ian Lance Taylor <iant@google.com>
8948
8949 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
8950 <exception>.
8951 (throwing, orig_terminate): New static variables.
8952 (terminate_handler): New static function.
8953 (t2): Set terminate handler.
8954
f0b886e3
ILT
89552008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
8956
8957 PR 6584
cd536b21 8958 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
8959 alignment.
8960
3e90f135
CC
89612008-05-30 Cary Coutant <ccoutant@google.com>
8962
8963 * archive.cc (Archive::include_all_members) Correct to step
8964 over symbol table and extended name table in thin archives.
8965
e09ad04a
ILT
89662008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
8967
8968 PR 6407
8969 * target-reloc.h (relocate_for_relocatable): Fix new_offset
8970 calculation.
8971
62b01cb5
ILT
89722008-05-28 Caleb Howe <cshowe@google.com>
8973
8974 * reduced_debug_output.cc: New file.
8975 * reduced_debug_output.h: New file.
92de84a6 8976 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
8977 * options.cc (General_options::finalize): Add strip_debug_non_line
8978 to the strip heirarchy.
8979 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
8980 fields.
8981 * layout.cc: Include "reduced_debug_output.h".
8982 (Layout::Layout): Initialize new fields.
8983 (line_only_debug_sections): New static array.
8984 (is_lines_only_debug_sections): New static inline function.
8985 (Layout::include_section): Handle --strip-debug-non-line.
8986 (Layout::make_output_section): If --strip-debug-non-line, build
8987 new output sections for .debug_abbrev and .debug_info.
8988 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
8989 gold. Warn about possible overflow.
8990 (read_signed_LEB_128): Likewise.
8991 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
8992 (read_signed_LEB_128): Declare.
8993 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
8994 (HFILES): Add reduced_debug_output.h.
8995 * Makefile.in: Rebuild.
8996
7d9e3d98
ILT
89972008-05-21 Ian Lance Taylor <iant@google.com>
8998
8999 * mapfile.cc: New file.
9000 * mapfile.h: New file.
9001 * options.h (class General_options): Add -M/--print-map and -Map.
9002 * options.cc (General_options::finalize): Make -M equivalent to
9003 -Map -.
9004 * main.cc: Include <cstdio> and "mapfile.h".
9005 (main): Open mapfile if requested.
9006 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9007 constructor. Change caller.
9008 (queue_initial_tasks): Add mapfile parameter. Change caller.
9009 (queue_middle_tasks): Likewise.
9010 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9011 declarations.
9012 * archive.cc: Include "mapfile.h".
9013 (Archive::add_symbols): Add mapfile parameter. Change all
9014 callers. Pass mapfile, symbol, and reason to include_member.
9015 (Archive::include_all_members): Add mapfile parameter. Change all
9016 callers.
9017 (Archive::include_member): Add mapfile, sym, and why parameters.
9018 Change all callers. Report inclusion to map file.
9019 * archive.h: Include "fileread.h".
9020 (class Archive): Update declarations.
9021 (Archive::file): New const method.
9022 (class Add_archive_symbols): Add mapfile_ field. Update
9023 constructor. Change all callers.
9024 * readsyms.h (class Read_symbols): Likewise.
9025 (class Finish_group): Likewise.
9026 (class Read_script): Likewise.
9027 * common.cc: Include "mapfile.h".
9028 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9029 all callers.
9030 (Symbol_table::do_allocate_commons): Likewise.
9031 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9032 symbol allocation to mapfile.
9033 * common.h (class Allocate_commons_task): Add mapfile_ field.
9034 Update constructor. Change all callers.
9035 * symtab.h (class Symbol_table): Update declarations.
9036 * layout.cc: Include "mapfile.h".
9037 (Layout_task_runner::run): Print information to mapfile.
9038 (Layout::create_gold_note): Change Output_data_fixed_space to
9039 Output_data_zero_fill.
9040 (Layout::create_build_id): Likewise.
9041 (Layout::print_to_mapfile): New function.
9042 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9043 constructor. Change caller.
9044 (class Layout): Declare print_to_mapfile.
9045 * output.cc (Output_section::Input_section::print_to_mapfile): New
9046 function.
9047 (Output_section::add_input_section): If producing a map, always
9048 add to input_sections_ list.
9049 (Output_section::do_print_to_mapfile): New function.
9050 (Output_segment::print_sections_to_mapfile): New function.
9051 (Output_segment::print_section_list_to_mapfile): New function.
9052 * output.h: Include "mapfile.h".
9053 (Output_data::print_to_mapfile): New function.
9054 (Output_data::do_print_to_mapfile): New virtual function.
9055 (Output_segment_headers::do_print_to_mapfile): New function.
9056 (Output_file_header::do_print_to_mapfile): New function.
9057 (Output_data_const::do_print_to_mapfile): New function.
9058 (class Output_data_const_buffer): Add map_name_ field. Update
9059 constructor. Change all callers. Add do_print_to_mapfile
9060 function.
9061 (class Output_data_fixed_space): Likewise.
9062 (class Output_data_space): Likewise.
9063 (class Output_data_zero_fill): New class.
9064 (Output_data_strtab::do_print_to_mapfile): New function.
9065 (Output_data_reloc_base::do_print_to_mapfile): New function.
9066 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9067 (Output_data_group::do_print_to_mapfile): New function.
9068 (Output_data_got::do_print_to_mapfile): New function.
9069 (Output_data_dynamic::do_print_to_mapfile): New function.
9070 (Output_symtab_xindex::do_print_to_mapfile): New function.
9071 (class Output_section): Declare do_print_to_mapflie. Declare
9072 print_to_mapfile in Input_section.
9073 (class Output_segment): Declare new functions.
9074 * object.h (Sized_relobj::symbol_count): New function.
9075 * script-sections.cc
9076 (Output_section_element_dot_assignment::set_section_addresses):
9077 Change Output_data_fixed_space to Output_data_zero_fill.
9078 (Output_data_expression::do_print_to_mapfile): New function.
9079 * script.cc (read_input_script): Add mapfile parameter. Change
9080 all callers.
9081 * script.h (read_input_script): Update declaration.
9082 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9083 (Eh_frame::do_print_to_mapfile): New function.
9084 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9085 (Output_merge_string::do_print_to_mapfile): New function.
9086 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9087 function.
9088 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9089 function.
9090 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9091 function.
9092 * Makefile.am (CCFILES): Add mapfile.cc.
9093 (HFILES): Add mapfile.h.
9094 * Makefile.in: Rebuild.
9095
9f1d377b
ILT
90962008-05-19 Ian Lance Taylor <iant@google.com>
9097
9098 * options.h (class General_options): Add -z relro.
9099 * layout.cc (Layout::Layout): Initialize relro_segment_.
9100 (Layout::add_output_section_data): Return the output section.
9101 (Layout::make_output_section): Rcognize relro sections and mark
9102 them appropriately.
9103 (Layout::attach_allocated_section_to_segment): Put relro sections
9104 in a PT_GNU_RELRO segment.
9105 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9106 section as relro.
9107 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9108 PT_TLS segments.
9109 (Layout::linkonce_mapping): Map d.rel.ro.local to
9110 .data.rel.ro.local.
9111 (Layout::output_section_name): Us .data.rel.ro.local for any
9112 section which begins with that.
9113 * layout.h (class Layout): Update add_output_section_data
9114 declaration. Add relro_segment_ field.
9115 * output.cc (Output_section::Output_section): Initialize is_relro_
9116 and is_relro_local_ fields.
9117 (Output_segment::add_output_section): Group relro sections.
9118 (Output_segment::is_first_section_relro): New function.
9119 (Output_segment::maximum_alignment): If there is a relro section,
9120 align the segment to the common page size.
9121 (Output_segment::set_section_addresses): Track whether we are
9122 looking at relro sections. If the last section is a relro
9123 section, align to the common page size.
9124 (Output_segment::set_section_list_addresses): Add in_relro
9125 parameter. Change all callers. Align to the page size when
9126 moving from relro to non-relro section.
9127 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9128 segment.
9129 * output.h (class Output_section): Add is_relro_ and
9130 is_relro_local_ fields.
9131 (Output_section::is_relro): New function.
9132 (Output_section::set_is_relro): New function.
9133 (Output_section::is_relro_local): New function.
9134 (Output_section::set_is_relro_local): New function.
9135 (class Output_segment): Update declarations.
9136 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9137 * sparc.cc (Target_sparc::got_section): Likewise.
9138 * x86_64.cc (Target_x86_64::got_section): Likewise.
9139 * testsuite/relro_test_main.cc: New file.
9140 * testsuite/relro_test.cc: New file.
9141 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9142 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9143 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9144 (relro_test.so, relro_test_pic.o): New targets.
9145 * testsuite/Makefile.in: Rebuild.
9146
a984ee1d
ILT
91472008-05-16 Ian Lance Taylor <iant@google.com>
9148
01676dcd
ILT
9149 * output.cc (Output_segment::add_output_section): Remove front
9150 parameter.
9151 * output.h (class Output_segment): Remove
9152 add_initial_output_section and overloaded add_output_section.
9153 Update declaration of remaining add_output_section.
9154 * layout.cc (Layout::create_interp): Call add_output_section
9155 rather than add_initial_output_section.
9156 (Layout::finish_dynamic_section): Likewise.
9157
497897f9
ILT
9158 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9159 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9160 know the dynamic type.
9161 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9162 field. Initialize it in constructor.
9163 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9164 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9165 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9166 reloc.
9167
a984ee1d
ILT
9168 * output.cc (Output_reloc::get_address): Change return type to
9169 Elf_Addr.
9170 * output.h (class Output_reloc): Update get_address declaration.
9171 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9172 for section addresses.
9173
55ba0940
ILT
91742008-05-09 Ian Lance Taylor <iant@google.com>
9175
9176 PR 6493
9177 * gold.cc (gold_nomem): Use return value of write.
9178
75517b77
ILT
91792008-05-08 Ian Lance Taylor <iant@google.com>
9180
9181 * symtab.c (Symbol::init_base_output_data): Add version
9182 parameter. Change all callers.
9183 (Symbol::init_base_output_segment): Likewise.
9184 (Symbol::init_base_constant): Likewise.
9185 (Symbol::init_base_undefined): Likewise.
9186 (Sized_symbol::init_output_data): Likewise.
9187 (Sized_symbol::init_output_segment): Likewise.
9188 (Sized_symbol::init_constant): Likewise.
9189 (Sized_symbol::init_undefined): Likewise.
9190 (Symbol_table::do_define_in_output_data): If the new symbol has a
9191 version, mark it as the default.
9192 (Symbol_table::do_define_in_output_segment): Likewise.
9193 (Symbol_table::do_define_as_constant): Likewise.
9194 * symtab.h (class Symbol): Update declarations.
9195 (class Sized_symbol): Likewise.
9196 * resolve.cc (Symbol::override_version): New function.
c42e122e 9197 (Symbol::override_base): Call override_version.
75517b77
ILT
9198 (Symbol::override_base_with_special): Likewise.
9199 * testsuite/ver_script_8.script: New file.
9200 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9201 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9202 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9203 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9204
f1f70eae
ILT
92052008-05-06 Ian Lance Taylor <iant@google.com>
9206
f3e9c5c5
ILT
9207 PR 6049
9208 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
9209 functions.
9210 (class General_options): Remove existing --undefined, and add
9211 --no-undefined instead. Add new --undefined as synonym for -u.
9212 * archive.cc (Archive::add_symbols): Check whether symbol was
9213 named with -u.
9214 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
9215 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
9216 all uses. Add IS_UNDEFINED. Update declarations to split
9217 different versions of init_base. Declare init_base_undefined.
9218 (Symbol::is_defined): Handle IS_UNDEFINED.
9219 (Symbol::is_undefined): Likewise.
9220 (Symbol::is_weak_undefined): Call is_undefined.
9221 (Symbol::is_absolute): Handle IS_CONSTANT.
9222 (class Sized_symbol): Update declarations to split different
9223 versions of init. Declare init_undefined.
9224 (class Symbol_table): Declare new functions.
9225 * symtab.cc (Symbol::init_base_object): Rename from init_base.
9226 Change all callers.
9227 (Symbol::init_base_output_data): Likewise.
9228 (Symbol::init_base_output_segment): Likewise.
9229 (Symbol::init_base_constant): Likewise.
9230 (Symbol::init_base_undefined): New function.
9231 (Sized_symbol::init_object): Rename from init. Change all
9232 callers.
9233 (Sized_symbol::init_output_data): Likewise.
9234 (Sized_symbol::init_output_segment): Likewise.
9235 (Sized_symbol::init_constant): Likewise.
9236 (Sized_symbol::init_undefined): New function.
9237 (Symbol_table::add_undefined_symbols_from_command_line): New
9238 function.
9239 (Symbol_table::do_add_undefined_symbols_from_command_line): New
9240 function.
9241 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
9242 (Symbol::output_section): Likewise.
9243 (Symbol::set_output_section): Likewise.
9244 (Symbol_table::sized_finalize_symbol): Likewise.
9245 (Symbol_table::sized_write_globals): Likewise.
9246 * resolve.cc (Symbol_table::should_override): Likewise.
9247 (Symbol::override_base_with_special): Likewise.
9248
8bdcdf2c
ILT
9249 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
9250 symbol, change it to have default visibility.
9251 * testsuite/protected_1.cc: New file.
9252 * testsuite/protected_2.cc: New file.
9253 * testsuite/protected_3.cc: New file.
9254 * testsuite/protected_main_1.cc: New file.
9255 * testsuite/protected_main_2.cc: New file.
9256 * testsuite/protected_main_3.cc: New file.
9257 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
9258 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
9259 (protected_1_LDFLAGS, protected_1_LDADD): Define.
9260 (protected_1.so): New target.
9261 (protected_1_pic.o, protected_2_pic.o): New targets.
9262 (protected_3_pic.o): New target.
9263 (check_PROGRAMS): Add protected_2.
9264 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
9265 (protected_2_LDFLAGS, protected_2_LDADD): Define.
9266 * testsuite/Makefile.in: Rebuild.
9267
2b706932
ILT
9268 * options.h (DEFINE_var): Add set_user_set_##varname__.
9269 (DEFINE_bool_alias): New macro.
9270 (class General_options): Define -Bstatic using DEFINE_bool_alias
9271 rather than DEFINE_special. Add --undefined as an alias for -z
9272 defs.
9273 * options.cc (General_options::parse_Bstatic): Remove.
9274
d82a5bcc
ILT
9275 * options.h (class General_options): Add --fatal-warnings.
9276 * main.cc (main): Implement --fatal-warnings.
9277 * errors.h (Errors::warning_count): New function.
9278
f1f70eae
ILT
9279 * options.h (class General_options): Add -Bsymbolic-functions.
9280 * symtab.h (Symbol::is_preemptible): Check for
9281 -Bsymbolic-functions.
9282
8825ac63
ILT
92832008-05-05 Ian Lance Taylor <iant@google.com>
9284
d98bc257
ILT
9285 * options.h (DEFINE_bool): For DASH_Z, create the negative option
9286 as noVARNAME rather than no-VARNAME.
9287 (class General_options): Add option -z combreloc.
9288 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
9289 get_address.
9290 (Output_reloc::sort_before) [SHT_REL]: New function.
9291 (Output_reloc::sort_before) [SHT_RELA]: New function.
9292 (class Output_data_reloc_base): Add sort_relocs_ field. Define
9293 Sort_relocs_comparison.
9294 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
9295 parameter. Change all callers.
9296 (Output_data_reloc::Output_data_reloc) [both versions]: Add
9297 sort_relocs parameter. Change all callers.
9298 * output.cc (Output_reloc::get_address): New function, broken out
9299 of write_rel.
9300 (Output_reloc::write_rel): Call it.
9301 (Output_reloc::compare): New function.
9302 (Output_data_reloc_base::do_write): Optionally sort relocs.
9303
60b2b4e7
ILT
9304 * configure.ac: If targ_extra_obj is set, link it in.
9305 * configure.tgt: Initialize all variables.
9306 (x86_64*): Set targ_extra_obj and targ_extra_size.
9307 * configure: Rebuild.
9308
8825ac63
ILT
9309 * object.cc (Sized_relobj::include_section_group): Adjust section
9310 indexes read from group data. Build vector to pass to
9311 layout_group.
9312 * layout.cc (Layout::layout_group): Add flags and shndxes
9313 parameters. Remove contents parameter. Change caller. Update
9314 explicit instantiations.
9315 * layout.h (class Layout): Update layout_group declaration.
9316 * output.cc (Output_data_group::Output_data_group): Add flags and
9317 input_shndxes parameters. Remove contents parameter. Change
9318 caller.
9319 (Output_data_group::do_write): Change input_sections_ to
9320 input_shndxes_.
9321 * output.h (class Output_data_group): Update constructor
9322 declaration. Rename input_sections_ to input_shndxes_.
9323 * testsuite/many_sections_test.cc: Add template.
9324
e94cf127
CC
93252008-04-30 Cary Coutant <ccoutant@google.com>
9326
4418b2d5
CC
9327 * target-reloc.h (relocate_section): Fix dead-pointer bug.
9328
e94cf127
CC
9329 * layout.cc (Layout::include_section): Refactored check for debug
9330 info section.
9331 (Layout::add_comdat): Add new parameters. Change type
9332 of signature parameter. Add object and shndx to signatures table.
9333 (Layout::find_kept_object): New function.
9334 * layout.h: Include <cstring>.
9335 (Layout::is_debug_info_section): New function.
9336 (Layout::add_comdat): Add new parameters.
9337 (Layout::find_kept_object): New function.
9338 (Layout::Kept_section): New struct.
9339 (Layout::Signatures): Change type of map range.
9340 * object.cc (Relobj::output_section_address): New function.
9341 (Sized_relobj::include_section_group): Add new parameters. Change
9342 calls to Layout::add_comdat. Change to build table of kept comdat
9343 groups and table mapping discarded sections to kept sections.
9344 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
9345 (Sized_relobj::do_layout): Change calls to include_section_group and
9346 include_linkonce_section.
9347 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
9348 value to zero when section is discarded.
9349 (Sized_relobj::map_to_kept_section): New function.
9350 * object.h (Relobj::output_section_address): New function.
9351 (Relobj::Comdat_group): New type.
9352 (Relobj::find_comdat_group): New function.
9353 (Relobj::Comdat_group_table): New type.
9354 (Relobj::Kept_comdat_section): New type.
9355 (Relobj::Kept_comdat_section_table): New type.
9356 (Relobj::add_comdat_group): New function.
9357 (Relobj::set_kept_comdat_section): New function.
9358 (Relobj::get_kept_comdat_section): New function.
9359 (Relobj::comdat_groups_): New field.
9360 (Relobj::kept_comdat_sections_): New field.
9361 (Symbol_value::input_value): Update comment.
9362 (Sized_relobj::map_to_kept_section) New function.
9363 (Sized_relobj::include_linkonce_section): Add new parameter.
9364 * target-reloc.h (Comdat_behavior): New type.
9365 (get_comdat_behavior): New function.
9366 (relocate_section): Add code to map a discarded section to the
9367 corresponding kept section when applying a relocation.
9368
e4e5049b
CS
93692008-04-30 Craig Silverstein <csilvers@google.com>
9370
9371 * dwarf_reader.cc (next_generation_count): New static var.
9372 (Addr2line_cache_entry): New struct.
9373 (addr2line_cache): New static var.
9374 (Dwarf_line_info::one_addr2line): Added caching.
9375 (Dwarf_line_info::clear_addr2line_cache): New function.
9376 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
9377 cache-size parameter.
9378 (Dwarf_line_info::one_addr2line_cache): New function.
9379 * symtab.cc (Symbol_table::detect_odr_violations): Pass
9380 new cache-size argument to one_addr2line(), and clear cache.
9381
d09e9154
CC
93822008-04-28 Cary Coutant <ccoutant@google.com>
9383
9384 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
9385 R_386_PC8 relocations.
9386
7ef73768
ILT
93872008-04-23 Ian Lance Taylor <iant@google.com>
9388
55438702
ILT
9389 * object.cc (Sized_relobj::include_section_group): Check for
9390 invalid section group.
9391
c165fb93
ILT
9392 * object.cc (make_elf_object): Correct test for 64-bit ELF file
9393 header size.
9394
7ef73768
ILT
9395 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
9396 than read for file header.
9397 * archive.cc (Archive::include_member): Likewise.
9398
6194aaab
L
93992008-04-23 Paolo Bonzini <bonzini@gnu.org>
9400
9401 * aclocal.m4: Regenerate.
9402 * configure: Regenerate.
9403
d491d34e
ILT
94042008-04-19 Ian Lance Taylor <iant@google.com>
9405
5ea2bac6
ILT
9406 * version.cc (version_string): Bump to 1.6.
9407
7bc3e21a
ILT
9408 * testsuite/Makefile.am (many_sections_r_test): New target.
9409 (many_sections_r_test_SOURCES): Remove.
9410 (many_sections_r_test_DEPENDENCIES): Remove.
9411 (many_sections_r_test_LDFLAGS): Remove.
9412 (many_sections_r_test_LDADD): Remove.
9413
7fcd3aa9
ILT
9414 * object.cc (Sized_relobj::do_add_symbols): Always pass
9415 local_symbol_count_ to add_from_relobj.
9416
4c94d6ae
ILT
9417 * testsuite/Makefile.am (many_sections_check.h): Only check one in
9418 every thousand variables.
9419 * testsuite/Makefile.in: Rebuild.
9420
d491d34e
ILT
9421 * object.cc (Xindex::initialize_symtab_xindex): New function.
9422 (Xindex::read_symtab_xindex): New function.
9423 (Xindex::sym_xindex_to_shndx): New function.
9424 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
9425 available.
9426 (Sized_relobj::do_initialize_xindex): New function.
9427 (Sized_relobj::do_read_symbols): Adjust section links.
9428 (Sized_relobj::symbol_section_and_value): Add is_ordinary
9429 parameter. Change all callers.
9430 (Sized_relobj::include_section_group): Adjust section links and
9431 symbol section indexes.
9432 (Sized_relobj::do_layout): Adjust section links.
9433 (Sized_relobj::do_count_local_symbols): Adjust section links and
9434 symbol section indexes.
9435 (Sized_relobj::do_finalize_local_symbols): Distinguish between
9436 ordinary and special symbols.
9437 (Sized_relobj::write_local_symbols): Add symtab_xindex and
9438 dynsym_xindex parameters. Change all callers. Adjust section
9439 links. Use SHN_XINDEX when needed.
9440 (Sized_relobj::get_symbol_location_info): Adjust section links.
9441 Don't get fooled by special symbols.
9442 * object.h (class Xindex): Define.
9443 (class Object): Add xindex_ parameter. Declare virtual functoin
9444 do_initialize_xindex.
9445 (Object::adjust_sym_shndx): New function.
9446 (Object::set_xindex): New protected function.
9447 (class Symbol_value): Add is_ordinary_shndx_ field.
9448 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
9449 (Symbol_value::value): Assert ordinary section.
9450 (Symbol_value::initialize_input_to_output_map): Likewise.
9451 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
9452 Change all callers.
9453 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
9454 all callers.
9455 (class Sized_relobj): Update declarations.
9456 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
9457 parameter. Change all callers.
9458 (Sized_relobj::adjust_shndx): New function.
9459 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
9460 field.
9461 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
9462 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
9463 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
9464 (Sized_dynobj::read_dynsym_section): Adjust section links.
9465 (Sized_dynobj::read_dynamic): Likewise.
9466 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
9467 section links.
9468 (Sized_dynobj::do_initialize_xindex): New function.
9469 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
9470 do_initialize_xindex.
9471 (Sized_dynobj::adjust_shndx): New function.
9472 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
9473 dynsym_xindex_ fields.
9474 (Layout::finalize): Add a call to set_section_indexes before
9475 creating the symtab sections.
9476 (Layout::set_section_indexes): Don't do anything if the section
9477 already has a section index.
9478 (Layout::create_symtab_sections): Add shnum parameter. Change
9479 caller. Create .symtab_shndx section if needed.
9480 (Layout::create_shdrs): Add shstrtab_section parameter. Change
9481 caller.
9482 (Layout::allocated_output_section_count): New function.
9483 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
9484 needed.
9485 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
9486 fields. Update declarations.
9487 (Layout::symtab_xindex): New function.
9488 (Layout::dynsym_xindex): New function.
9489 (class Write_symbols_task): Add layout_ field.
9490 (Write_symbols_task::Write_symbols_task): Add layout parameter.
9491 Change caller.
9492 * output.cc (Output_section_headers::Output_section_headers): Add
9493 shstrtab_section parameter. Change all callers.
9494 (Output_section_headers::do_sized_write): Store overflow values
9495 for section count and section string table section index in
9496 section header zero.
9497 (Output_file_header::do_sized_write): Check for overflow of
9498 section count and section string table section index.
9499 (Output_symtab_xindex::do_write): New function.
9500 (Output_symtab_xindex::endian_do_write): New function.
9501 * output.h (class Output_section_headers): Add shstrtab_section_.
9502 Update declarations.
9503 (class Output_symtab_xindex): Define.
9504 (Output_section::has_out_shndx): New function.
9505 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
9506 field.
9507 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
9508 Change all callers.
9509 (Sized_symbol::init): Likewise.
9510 (Symbol::output_section): Check for ordinary symbol.
9511 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
9512 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
9513 callers.
9514 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
9515 Change all callers. Simplify handling of symbols from sections
9516 not included in the link.
9517 (Symbol_table::add_from_dynobj): Handle ordinary symbol
9518 distinction.
9519 (Weak_alias_sorter::operator()): Assert that symbols are
9520 ordinary.
9521 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
9522 distinction.
9523 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
9524 parameters. Change all callers.
9525 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
9526 symbol distinction. Use SHN_XINDEX when needed.
9527 (Symbol_table::write_section_symbol): Add symtab_xindex
9528 parameter. Change all callers.
9529 (Symbol_table::sized_write_section_symbol): Likewise. Use
9530 SHN_XINDEX when needed.
9531 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
9532 declarations.
9533 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
9534 (Symbol::is_defined): Check is_ordinary.
9535 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
9536 (Symbol::is_absolute, Symbol::is_common): Likewise.
9537 (class Sized_symbol): Update declarations.
9538 (class Symbol_table): Update declarations.
9539 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
9540 parameters. Change all callers.
9541 (Sized_symbol::override): Likewise.
9542 (Symbol_table::override): Likewise.
9543 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
9544 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
9545 is_ordinary, and orig_st_shndx parameters. Change all callers.
9546 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
9547 to be in an ordinary section.
9548 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
9549 object and is_ordinary parameters. Change all callers.
9550 (Sized_dwarf_line_info::read_relocs): Add object parameter.
9551 Change all callers. Don't add undefined or non-ordinary symbols
9552 to reloc_map_.
9553 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
9554 Change all callers.
9555 * dwarf_reader.h (class Sized_dwarf_line_info): Update
9556 declarations.
9557 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
9558 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
9559 (Sized_relobj::relocate_sections): Likewise.
9560 * target-reloc.h (scan_relocs): Adjust section symbol index.
9561 (scan_relocatable_relocs): Likewise.
9562 * i386.cc (Scan::local): Check for ordinary symbols.
9563 * sparc.cc (Scan::local): Likewise.
9564 * x86_64.cc (Scan::local): Likewise.
9565 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
9566 to symbol_section_and_value.
9567 * testsuite/many_sections_test.cc: New file.
9568 * testsuite/Makefile.am (BUILT_SOURCES): Define.
9569 (check_PROGRAMS): Add many_sections_test.
9570 (many_sections_test_SOURCES): Define.
9571 (many_sections_test_DEPENDENCIES): Define.
9572 (many_sections_test_LDFLAGS): Define.
9573 (BUILT_SOURCES): Add many_sections_define.h.
9574 (many_sections_define.h): New target.
9575 (BUILT_SOURCES): Add many_sections_check.h.
9576 (many_sections_check.h): New target.
9577 (check_PROGRAMS): Add many_sections_r_test.
9578 (many_sections_r_test_SOURCES): Define.
9579 (many_sections_r_test_DEPENDENCIES): Define.
9580 (many_sections_r_test_LDFLAGS): Define.
9581 (many_sections_r_test_LDADD): Define.
9582 (many_sections_r_test.o): New target.
9583 * testsuite/Makefile.in: Rebuild.
9584
c5818ff1
CC
95852008-04-17 Cary Coutant <ccoutant@google.com>
9586
9587 * errors.cc (Errors::info): New function.
9588 (gold_info): New function.
9589 * errors.h (Errors::info): New function.
9590 * gold.h (gold_info): New function.
9591 * object.cc (Input_objects::add_object): Print trace output.
9592 * options.cc (options::parse_set): New function.
9593 (General_options::parse_wrap): Deleted.
9594 (General_options::General_options): Deleted initializer.
9595 * options.h (options::String_set): New typedef.
9596 (options::parse_set): New function.
9597 (DEFINE_set): New macro.
9598 (General_options::wrap): Changed to use DEFINE_set. Changed
9599 callers of any_wrap_symbols and is_wrap_symbol.
9600 (General_options::trace, General_options::trace_symbol):
9601 New options.
9602 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
9603 (General_options::wrap_symbols_): Deleted.
9604 * symtab.cc (Symbol_table::add_from_object): Print trace output.
9605
b5be4a7c
DM
96062008-04-17 David S. Miller <davem@davemloft.net>
9607
9608 * options.cc (General_options::parse_V): New function.
9609 * options.h: Add entries for -V and -Qy.
9610
155a0dd7
ILT
96112008-04-17 Ian Lance Taylor <iant@google.com>
9612
9613 * common.cc (Symbol_table::allocate_commons): Remove options
9614 parameter. Change caller.
9615 (Symbol_table::do_allocate_commons): Remove options parameter.
9616 Change caller. Just call do_allocate_commons_list twice.
9617 (Symbol_table::do_allocate_commons_list): New function, broken out
9618 of do_allocate_commons.
9619 * common.h (class Allocate_commons_task): Remove options_ field.
9620 Update constructor.
9621 * symtab.cc (Symbol_table::Symbol_table): Initialize
9622 tls_commons_.
9623 (Symbol_table::add_from_object): Put TLS common symbols on
9624 tls_commons_ list.
9625 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
9626 which are IN_OUTPUT_DATA.
9627 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
9628 allocate_commons and do_allocate_commons declarations. Declare
9629 do_allocate_commons_list.
9630 * gold.cc (queue_middle_tasks): Update creation of
9631 Allocate_commons_task to not pass options.
9632 * testsuite/Makefile.am (INCLUDES): Add -I.. .
9633 (TLS_TEST_C_FLAGS): New variable.
9634 (tls_test_c_pic.o): New target.
9635 (tls_test_shared.so): Link in tls_test_c_pic.o.
9636 (tls_test_c_pic_ie.o): New target.
9637 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
9638 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
9639 (tls_test_c.o): New target.
9640 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
9641 (tls_pic_test_LDADD): Likewise.
9642 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
9643 (tls_shared_gd_to_ie_test_LDADD): Likewise.
9644 (tls_test_c_gnu2.o): New target.
9645 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
9646 tls_test_c_gnu2.o.
9647 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
9648 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
9649 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
9650 * testsuite/tls_test.cc: Include "config.h".
9651 (t_last): Call t11_last.
9652 * testsuite/tls_test.h (t11, t11_last): Declare.
9653 * testsuite/tls_test_c.c: New file.
9654 * testsuite/tls_test_main.cc (thread_routine): Call t11.
9655 * configure.ac: Check for OpenMP support.
9656 * configure, config.in, Makefile.in: Rebuild.
9657 * testsuite/Makefile.in: Rebuild.
9658
edfbb029
CC
96592008-04-16 Cary Coutant <ccoutant@google.com>
9660
9661 * i386.cc (Target_i386::define_tls_base_symbol): New function.
9662 (Target_i386::tls_base_symbol_defined_): New field.
9663 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9664 (Target_i386::Scan::global): Likewise.
9665 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
9666 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
9667 (Target_x86_64::tls_base_symbol_defined_): New field.
9668 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9669 (Target_x86_64::Scan::global): Likewise.
9670
f3c69fca
CC
96712008-04-16 Cary Coutant <ccoutant@google.com>
9672
9673 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
9674 (Symbol::needs_plt_entry): Allow weak undefined symbols.
9675 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
9676 building shared libraries.
9677 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
9678 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
9679 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
9680 * testsuite/Makefile.in: Rebuild.
9681 * testsuite/weak_undef.h: New file.
9682 * testsuite/weak_undef_file1.cc: Add extra test cases.
9683 * testsuite/weak_undef_file2.cc: Likewise.
9684 * testsuite/weak_undef_test.cc: Likewise.
9685
7c414435
DM
96862008-04-16 David S. Miller <davem@davemloft.net>
9687
32b769e1
DM
9688 * sparc.cc (Target_sparc::Scan): Change from struct to class.
9689 Add issued_non_pic_error_ field. Declare check_non_pic.
9690 (Target_sparc::Scan::check_non_pic): New function.
9691 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
9692 (Target_sparc::Scan::global): Likewise.
9693
11936fb1
DM
9694 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
9695 * configure: Rebuild.
9696
7c414435
DM
9697 * options.h (DEFINE_enable): New macro.
9698 (new_dtags): New enable option.
9699 (initfirst, interpose, loadfltr, nodefaultlib,
9700 nodelete, nodlopen, nodump): New -z options.
9701 * layout.cc (Layout:finish_dynamic_section): If new
9702 dtags enabled, emit DT_RUNPATH. Also, emit a
9703 DT_FLAGS_1 containing any specified -z flags.
9704
85c7bf8b
ILT
97052008-04-16 Ian Lance Taylor <iant@google.com>
9706
12c0daef
ILT
9707 * copy-relocs.cc: New file.
9708 * copy-relocs.h: New file.
9709 * reloc.cc: Remove Copy_relocs code.
9710 * reloc.h: Likewise.
9711 * reloc-types.h (struct Reloc_types) [both versions]: Add
9712 get_reloc_addend_noerror.
9713 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
9714 variants of add_global which take an addend which must be zero.
9715 * i386.cc: Include "copy-relocs.h".
9716 (class Target_i386): Change type of copy_relocs_ to variable,
9717 update initializer.
9718 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
9719 Change all callers.
9720 (Target_i386::do_finalize_sections): Change handling of
9721 copy_relocs_.
9722 * sparc.cc: Include "copy-relocs.h".
9723 (class Target_sparc): Change type of copy_relocs_ to variable,
9724 update initializer.
9725 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
9726 Change all callers.
9727 (Target_sparc::do_finalize_sections): Change handling of
9728 copy_relocs_.
9729 * x86_64.cc: Include "copy-relocs.h".
9730 (class Target_x86_64): Change type of copy_relocs_ to variable,
9731 update initializer.
9732 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
9733 class. Change all callers.
9734 (Target_x86_64::do_finalize_sections): Change handling of
9735 copy_relocs_.
9736 * Makefile.am (CCFILES): Add copy-relocs.cc.
9737 (HFILES): Add copy-relocs.h.
9738
4f4995b6
ILT
9739 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
9740
85c7bf8b
ILT
9741 * testsuite/script_test_4.sh: Permit leading zeroes.
9742
4f2a9edd
ILT
97432008-04-15 Ian Lance Taylor <iant@google.com>
9744
e6188289
ILT
9745 * script-sections.cc (Script_sections::create_segments): Use
9746 header_size_adjustment even when there is enough room for the
9747 headers.
9748 * testsuite/script_test_4.sh: New file.
9749 * testsuite/script_test_4.t: New file.
9750 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
9751 (check_DATA): Add script_test_4.stdout.
9752 (MOSTLYCLEANFILES): Likewise.
9753 (script_test_4): New target.
9754 (script_test_4.stdout): New target.
9755 * testsuite/Makefile.in: Rebuild.
9756
4f2a9edd
ILT
9757 * sparc.cc: Add definitions for Output_data_plt_sparc class
9758 constants.
9759
f5314dd5
DM
97602008-04-14 David S. Miller <davem@davemloft.net>
9761
9762 * sparc.cc: New file.
9763 * Makefile.am (TARGETSOURCES): Add sparc.cc
9764 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
9765 * configure.tgt: Document targ_extra_size and
9766 targ_extra_big_endian. Add entries for sparc-* and
9767 sparc64-*.
9768 * configure.ac: Handle targ_extra_size and
9769 targ_extra_big_endian.
9770 * Makefile.in: Rebuild.
9771 * configure: Likewise.
9772 * po/POTFILES.in: Likewise.
9773 * po/gold.pot: Likewise.
9774
154e0e9a
ILT
97752008-04-14 Ian Lance Taylor <iant@google.com>
9776
9777 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
9778 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
9779 in the name/type/flags to section mapping. Don't call
9780 allocate_output_section.
9781 (Layout::choose_output_section): Change parameter from adjust_name
9782 to is_input_section. Don't permit input sections after sections
9783 are attached to segments. Don't call allocate_output_section.
9784 (Layout::layout_eh_frame): Call update_flags_for_input_section,
9785 not write_enable_output_section.
9786 (Layout::make_output_section): Don't push to
9787 unattached_section_list_ nor call attach_to_segment. Call
9788 attach_section_to_segment if sections are attached.
9789 (Layout::attach_sections_to_segments): New function.
9790 (Layout::attach_section_to_segment): New function.
9791 (Layout::attach_allocated_section_to_segment): Rename from
9792 attach_to_segment. Remove flags parameter.
9793 (Layout::allocate_output_section): Remove function.
9794 (Layout::write_enable_output_section): Remove function.
9795 * layout.h (class Layout): Update for above changes. Add new
9796 field sections_are_attached_.
9797 * output.h (Output_section::update_flags_for_input_section): New
9798 function.
9799 * output.cc (Output_section::add_input_section): Call
9800 update_flags_for_input_section.
9801 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
9802
009a67a2
CC
98032008-04-11 Cary Coutant <ccoutant@google.com>
9804
9805 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
9806 thought unnecessary.
9807 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
9808
759b1a24
ILT
98092008-04-11 Ian Lance Taylor <iant@google.com>
9810
9811 * output.h (class Output_section_data): Remove inline definition
9812 of set_addralign.
9813 * output.cc (Output_section_data::set_addralign): New function.
9814
c2b45e22
CC
98152008-04-11 Cary Coutant <ccoutant@google.com>
9816
9817 Add support for TLS descriptors for i386 and x86_64.
9818 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
9819 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
9820 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
9821 GOT_TYPE_TLS_DESC.
9822 (Target_i386::got_mod_index_entry): Remove unnecessary code.
9823 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
9824 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
9825 relocations.
9826 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
9827 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
9828 Fix problem with initial-exec relocations.
9829 (Target_i386::Relocate::relocate_tls): Likewise.
9830 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
9831 relaxation.
9832 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
9833 support for section-plus-offset dynamic table entries.
9834 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
9835 (Output_data_dynamic::Dynamic_entry): Add support for
9836 section-plus-offset dynamic table entries.
9837 (Output_data_dynamic::Classification): Likewise.
9838 (Output_data_dynamic::classification_): Renamed offset_.
9839 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
9840 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
9841 (Target_x86_64::make_plt_section): New function.
9842 (Target_x86_64::reserve_tlsdesc_entries): New function.
9843 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
9844 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
9845 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
9846 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
9847 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
9848 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
9849 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
9850 add extra PLT entry for TLS descriptors.
9851 (Output_data_plt_x86_64::got_): New field.
9852 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
9853 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
9854 fields.
9855 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
9856 descriptors.
9857 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
9858 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
9859 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
9860 R_386_TLS_DESC_CALL relocations.
9861 (Target_x86_64::Scan::global): Likewise.
9862 (Target_x86_64::do_finalize_sections): Add dynamic table entries
9863 for TLS descriptors.
9864 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
9865 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
9866 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
9867 GD-to-IE relaxation.
9868 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
9869 and TLS_DESCRIPTORS.
9870 * Makefile.in: Rebuild.
9871 * configure: Rebuild.
9872 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
9873 (tls_test_shared2.so): New target.
9874 (tls_shared_gd_to_ie_test_SOURCES): New variable.
9875 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
9876 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
9877 (tls_shared_gd_to_ie_test_LDADD): New variable.
9878 (tls_shared_gnu2_gd_to_ie_test): New target.
9879 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
9880 New targets.
9881 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
9882 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
9883 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
9884 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
9885 (tls_shared_gnu2_test): New target.
9886 (tls_test_gnu2_shared.so): New target.
9887 (tls_shared_gnu2_test_SOURCES): New variable.
9888 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
9889 (tls_shared_gnu2_test_LDFLAGS): New variable.
9890 (tls_shared_gnu2_test_LDADD): New variable.
9891 * testsuite/Makefile.in: Rebuild.
9892 * testsuite/Makefile.
9893
83bfb6b7
ILT
98942008-04-11 Ian Lance Taylor <iant@google.com>
9895
9896 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
9897 justsyms.t.
9898 * testsuite/Makefile.in: Rebuild.
9899
9900 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
9901 long.
9902 * testsuite/script_test_2.cc (main): Adjust test.
9903
706e1f5e
ILT
99042008-04-11 David S. Miller <davem@davemloft.net>
9905 Ian Lance Taylor <iant@google.com>
9906
9907 * options.h (General_options): Add entries for '-Y' and
9908 '-relax'.
9909 * options.cc (General_options:finalize): If -Y was used, add those
9910 entries to the library path instead of the default "/lib" and
9911 "/usr/lib".
9912
7c98e6bb
DM
99132008-04-11 David S. Miller <davem@davemloft.net>
9914
9915 * testsuite/justsyms.t: Start at 0x100.
9916 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
9917 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
9918 long.
9919 * testsuite/script_test_2.cc: Adjust string and section length
9920 checks.
7c98e6bb 9921
99a37bfd
ILT
99222008-04-09 Ian Lance Taylor <iant@google.com>
9923
2cefc357
ILT
9924 PR gold/5996
9925 * script-sections.cc (Sections_element::allocate_to_segment): Add
9926 orphan parameter.
9927 (Output_section_definition::allocate_to_segment): Likewise.
9928 (Orphan_output_section::allocate_to_segment): Likewise.
9929 (Script_sections::attach_sections_using_phdrs_clause): Don't
9930 propagate non-PT_LOAD segments to orphan sections.
9931 * testsuite/Makefile.am (script_test_3.stdout): Generate using
9932 readelf rather than objdump.
9933 * testsuite/script_test_3.sh: Adjust accordingly. Test that
9934 .interp section and PT_INTERP segment are the same size.
9935 * testsuite/Makefile.in: Rebuild.
9936
99a37bfd
ILT
9937 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
9938 aliases for symbols defined in the same object.
9939 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
9940 (weak_alias_test_SOURCES): New variable.
9941 (weak_alias_test_DEPENDENCIES): New variable.
9942 (weak_alias_test_LDFLAGS): New variable.
9943 (weak_alias_test_LDADD): New variable.
9944 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
9945 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
9946 (weak_alias_test_3.o): New target.
9947 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
9948 * testsuite/weak_alias_test_main.cc: New file.
9949 * testsuite/weak_alias_test_1.cc: New file.
9950 * testsuite/weak_alias_test_2.cc: New file.
9951 * testsuite/weak_alias_test_3.cc: New file.
9952
780e49c5
ILT
99532008-04-08 Ian Lance Taylor <iant@google.com>
9954
cdb0b8f5
ILT
9955 * options.h (class General_options): Add --noinhibit-exec option.
9956 * main.cc (main): Check --noinhibit-exec.
9957
0864d551
ILT
9958 * options.h (class General_options): Define --wrap as a special
9959 option. Add wrap_symbols_ field.
9960 (General_options::any_wrap_symbols): New function.
9961 (General_options::is_wrap_symbol): New function.
9962 * options.cc (General_options::parse_wrap): New function.
9963 (General_options::General_options): Initialize wrap_symbols_.
9964 * symtab.cc (Symbol_table::wrap_symbol): New function.
9965 (Symbol_table::add_from_object): Handle --wrap.
9966 * symtab.h (class Symbol_table): Declare wrap_symbol.
9967 * target.h (Target::wrap_char): New function.
9968 (Target::Target_info): Add wrap_char field.
9969 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
9970 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9971 * testsuite/testfile.cc (Target_test::test_target_info):
9972 Likewise.
9973
789aa6de
ILT
9974 * errors.cc (Errors::undefined_symbol): Mention symbol version if
9975 there is one.
9976
2c38906f
ILT
9977 * layout.h (class Layout): Add added_eh_frame_data_ field.
9978 * layout.cc (Layout::Layout): Initialize new field.
9979 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
9980 output section until we find a section we merged successfully.
9981 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
9982 that the size be non-zero.
9983
780e49c5
ILT
9984 * merge.cc (Object_merge_map::get_output_offset): Remove inline
9985 qualifier.
9986
7fcd0256
ILT
99872008-04-08 Craig Silverstein <csilvers@google.com>
9988
9989 * configure.ac: Export new conditional variable HAVE_ZLIB.
9990 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
9991 on HAVE_ZLIB.
9992 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
9993 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9994
6835af53
ILT
99952008-04-07 Ian Lance Taylor <iant@google.com>
9996
e24f324c
ILT
9997 * version.cc (version_string): Set to "1.5".
9998
a036edd8
ILT
9999 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10000 Add issued_non_pic_error_ field. Declare check_non_pic.
10001 (Target_x86_64::Scan::check_non_pic): New function.
10002 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10003 (Target_x86_64::Scan::global): Likewise.
10004
624f8810
ILT
10005 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10006 addend parameter. Change caller. Handle merge sections.
10007 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10008 Address to Addend. Don't add in the result of
10009 local_section_offset, pass down the addend and use the returned
10010 value.
10011 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10012 Update declarations of local_section_offset and symbol_value.
10013 * testsuite/two_file_test_1.cc (t18): New function.
10014 * testsuite/two_file_test_2.cc (f18): New function.
10015 * testsuite/two_file_test_main.cc (main): Call t18.
10016 * testsuite/two_file_test.h (t18, f18): Declare.
10017
6835af53
ILT
10018 * configure.ac: Don't test for objdump, c++filt, or readelf.
10019 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10020 conditionals.
10021 (TEST_READELF): New variable.
10022 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10023 (check_PROGRAMS): Add two_file_strip_test.
10024 (two_file_strip_test): New target.
10025 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10026 (two_file_same_shared_strip_test_SOURCES): New variable.
10027 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10028 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10029 (two_file_same_shared_strip_test_LDADD): New variable.
10030 (two_file_shared_strip.so): New target.
10031 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10032 (ver_test_5.syms, ver_test_7.syms): Likewise.
10033 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10034 (strip_test_3.stdout): Use TEST_OBJDUMP.
10035 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10036
86925eef
CC
100372008-04-04 Cary Coutant <ccoutant@google.com>
10038
10039 * symtab.h (Symbol::is_weak_undefined): New function.
10040 (Symbol::is_strong_undefined): New function.
10041 (Symbol::is_absolute): New function.
10042 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10043 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10044 absolute symbols.
10045 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10046 (weak_undef_test): New target.
10047 * testsuite/Makefile.in: Rebuild.
10048 * testsuite/weak_undef_file1.cc: New file.
10049 * testsuite/weak_undef_file2.cc: New file.
10050 * testsuite/weak_undef_test.cc: New file.
10051
126f3ece
ILT
100522008-04-03 Craig Silverstein <csilvers@google.com>
10053
10054 * compressed_output.h (class Output_compressed_section): Use
10055 unsigned buffer.
10056 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10057 add zlib header.
10058 (zlib_compressed_suffix): Removed.
10059 (Output_compressed_section::set_final_data_size): Use unsigned
10060 buffers.
10061 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10062 Fix linker invocation.
10063 (flagstest_o_specialfile_and_compress_debug_sections):
10064 Likewise.
10065 * testsuite/Makefile.in: Regenerated.
10066
deae2a14
DM
100672008-04-02 David S. Miller <davem@davemloft.net>
10068
10069 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10070 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10071
70752818
ILT
100722008-04-02 Craig Silverstein <csilvers@google.com>
10073
10074 * TODO: New file.
10075
39d0cb0e
ILT
100762008-04-02 Ian Lance Taylor <iant@google.com>
10077
10078 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10079 parameters. Update for new key type to views_. Change all
10080 callers.
10081 (File_read::read): Adjust for byteshift in returned view.
10082 (File_read::add_view): New function, broken out of
10083 find_and_make_view.
10084 (File_read::make_view): New function, broken out of
10085 find_and_make_view.
10086 (File_read::find_or_make_view): Add offset and aligned
10087 parameters. Rewrite accordingly. Change all callers.
10088 (File_read::get_view): Add offset and aligned parameters. Adjust
10089 for byteshift in return value.
10090 (File_read::get_lasting_view): Likewise.
10091 * fileread.h (class File_read): Update declarations.
10092 (class File_read::View): Add byteshift_ field. Add byteshift to
10093 constructor. Add byteshift method.
10094 * archive.h (Archive::clear_uncached_views): New function.
10095 (Archive::get_view): Add aligned parameter. Change all callers.
10096 * object.h (Object::get_view): Add aligned parameter. Change all
10097 callers.
10098 (Object::get_lasting_view): Likewise.
10099
10100 * fileread.cc (File_read::release): Don't call clear_views if
10101 there are multiple objects.
10102 * fileread.h (File_read::clear_uncached_views): New function.
10103 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10104 on the archive.
10105
a1207466
CC
101062008-03-31 Cary Coutant <ccoutant@google.com>
10107
10108 Add thin archive support.
10109 * archive.cc (Archive::armagt): New const.
10110 (Archive::setup): Remove task parameter and calls to unlock.
10111 (Archive::unlock_nested_archives): New function.
10112 (Archive::read_header): Add nested_off parameter. Change
10113 all callers.
10114 (Archive::interpret_header): Likewise.
10115 (Archive::include_all_members): Change to handle thin
10116 archives.
10117 (Archive::include_member): Likewise.
10118 * archive.h (Archive::Archive): Add new parameters and
10119 initializers.
10120 (Archive::armagt): New const.
10121 (Archive::setup): Remove task parameter.
10122 (Archive::unlock_nested_archives): New function.
10123 (Archive::read_header): Add nested_off parameter.
10124 (Archive::interpret_header): Likewise.
10125 (Archive::Nested_archive_table): New typedef.
10126 (Archive::is_thin_archive_): New field.
10127 (Archive::nested_archives_): New field.
10128 (Archive::options_): New field.
10129 (Archive::dirpath_): New field.
10130 (Archive::task_): New field.
10131 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10132 for thin archives. Pass additional parameters to
10133 Archive::Archive. Unlock the archive file after calling
10134 Archive::setup.
cd536b21 10135
479f6503
ILT
101362008-03-29 Ian Lance Taylor <iant@google.com>
10137
686c8caf
ILT
10138 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10139 version symbol to be local.
10140 * testsuite/ver_test_4.sh: New file.
10141 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10142 (check_DATA): Add ver_test_4.syms.
10143 (ver_test_4.syms): New target.
10144 * testsuite/Makefile.in: Rebuild.
10145
ab794b6b
ILT
10146 * output.cc
10147 (Output_section::Input_section_sort_entry::has_priority): New
10148 function.
10149 (Output_section::Input_section_sort_entry::match_file_name): New
10150 function.
10151 (Output_section::Input_section_sort_entry::match_section_name):
10152 Remove.
10153 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10154 Remove.
10155 (Output_section::Input_section_sort_entry::match_section_file):
10156 Remove.
10157 (Output_section::Input_section_sort_compare::operator()): Rewrite
10158 using new Input_section_sort_entry functions. Sort crtbegin and
10159 crtend first. Sort sections with no priority before sections with
10160 a priority.
10161 * testsuite/initpri1.c (d3): Check j != 4.
10162 (cd5): New constructor/destructor function.
10163 (main): Check j != 2.
10164
479f6503
ILT
10165 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10166 new symbol when resolving, don't call set_is_default.
10167 * testsuite/ver_test_7.cc: New file.
10168 * testsuite/ver_test_7.sh: New file.
10169 * testsuite/Makefile.am (ver_test_7.so): New target.
10170 (ver_test_7.o): New target.
10171 (check_SCRIPTS): Add ver_test_7.sh.
10172 (check_DATA): Add ver_test_7.syms.
10173 (ver_test_7.syms): New target.
10174
2fd32231
ILT
101752008-03-28 Ian Lance Taylor <iant@google.com>
10176
10177 * layout.cc (Layout::layout): If we see an input section with a
10178 name that needs sorting, set the must_sort flag for the output
10179 section.
10180 (Layout::make_output_section): If the name of the output section
10181 indicates that it might require sorting, set the may_sort flag.
10182 * output.h (Output_section::may_sort_attached_input_sections): New
10183 function.
10184 (Output_section::set_may_sort_attached_input_sections): New
10185 function.
10186 (Output_section::must_sort_attached_input_sections): New
10187 function.
10188 (Output_section::set_must_sort_attached_input_sections): New
10189 function.
10190 (class Output_section): Declare Input_section_sort_entry. Define
10191 Input_section_sort_compare. Declare
10192 sort_attached_input_sections. Add new fields:
10193 may_sort_attached_input_sections_,
10194 must_sort_attached_input_sections_,
10195 attached_input_sections_are_sorted_.
10196 * output.cc (Output_section::Output_section): Initialize new
10197 fields.
10198 (Output_section::add_input_section): Add an entry to
10199 input_sections_ if may_sort or must_sort are true.
10200 (Output_section::set_final_data_size): Call
10201 sort_attached_input_sections if necessary.
10202 (Output_section::Input_section_sort_entry): Define new class.
10203 (Output_section::Input_section_sort_compare::operator()): New
10204 function.
10205 (Output_section::sort_attached_input_sections): New function.
10206 * configure.ac: Check whether the compiler supports constructor
10207 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
10208 * testsuite/initpri1.c: New file.
10209 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
10210 CONSTRUCTOR_PRIORITY.
10211 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
10212 (initpri1_LDFLAGS): New variable.
10213 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10214
18e6b24e
ILT
102152008-03-27 Ian Lance Taylor <iant@google.com>
10216
49bdd526
ILT
10217 * common.cc (Sort_commons::operator): Correct sorting algorithm.
10218 * testsuite/common_test_1.c: New file.
10219 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
10220 (common_test_1_SOURCES): New variable.
10221 (common_test_1_DEPENDENCIES): New variable.
10222 (common_test_1_LDFLAGS): New variable.
10223
18e6b24e
ILT
10224 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
10225 and commons_ correctly when NAME/VERSION does not override
10226 NAME/NULL.
10227 * testsuite/ver_test_6.c: New file.
10228 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
10229 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
10230 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
10231
04bf7072
ILT
102322008-03-26 Ian Lance Taylor <iant@google.com>
10233
5871526f
ILT
10234 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
10235 of an undefined symbol from a version script.
10236 * testsuite/Makefile.am (ver_test_5.so): New target.
10237 (ver_test_5.o): New target.
10238 (check_SCRIPTS): Add ver_test_5.sh.
10239 (check_DATA): Add ver_test_5.syms.
10240 (ver_test_5.syms): New target.
10241 * testsuite/ver_test_5.cc: New file.
10242 * testsuite/ver_test_5.script: New file.
10243 * testsuite/ver_test_5.sh: New file.
10244 * Makefile.in, testsuite/Makefile.in: Rebuild.
10245
04bf7072
ILT
10246 PR gold/5986
10247 Fix problems building gold with gcc 4.3.0.
10248 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
10249 (gold_error_at_location, gold_warning_at_location): Use it.
10250 * configure.ac: Check whether we can compile and use a template
10251 function with a printf attribute.
10252 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
10253 when jumping over bytes.
10254 * object.cc: Instantiate Object::read_section_data.
10255 * debug.h: Include <cstring>
10256 * dwarf_reader.cc: Include <algorithm>
10257 * main.cc: Include <cstring>.
10258 * options.cc: Include <cstring>.
10259 * output.cc: Include <cstring>.
10260 * script.cc: Include <cstring>.
10261 * script.h: Include <string>.
10262 * symtab.cc: Include <cstring> and <algorithm>.
10263 * target-select.cc: Include <cstring>.
10264 * version.cc: Include <string>.
10265 * testsuite/testmain.cc: Include <cstdlib>.
10266 * configure, config.in: Rebuild.
10267
874c5b28
ILT
102682008-03-25 Ian Lance Taylor <iant@google.com>
10269
819d6c3a
ILT
10270 * options.cc: Include "../bfd/bfdver.h".
10271 (options::help): Print bug reporting address.
10272
f4b2c6f5
ILT
10273 * version.cc (print_version): Adjust output for current value of
10274 BFD_VERSION_STRING.
10275
10276 * NEWS: New file.
10277
e96caa79
ILT
10278 * options.cc (options::help): Print list of supported targets.
10279 * target-select.h: Include <vector>.
10280 (class Target_selector): Make machine_, size_, and is_big_endian_
10281 fields const. Add bfd_name_ and instantiated_target_ fields.
10282 (Target_selector::Target_selector): Add bfd_name parameter.
10283 (Target_selector::recognize): Make non-virtual, call
10284 do_recognize.
10285 (Target_selector::recognize_by_name): Make non-virtual, call
10286 do_recognize_by_name.
10287 (Target_selector::supported_names): New function.
10288 (Target_selector::bfd_name): New function.
10289 (Target_selector::do_instantiate_target): New pure virtual
10290 function.
10291 (Target_selector::do_recognize): New virtual function.
10292 (Target_selector::do_recognize_by_name): New virtual function.
10293 (Target_selector::instantiate_target): New private function.
10294 (supported_target_names): Declare.
10295 * target-select.cc (Target_selector::Target_selector): Update for
10296 new parameter and fields.
10297 (select_target_by_name): Check that the name matches before
10298 calling recognize_by_name.
10299 (supported_target_names): New function.
10300 * i386.cc (class Target_selector_i386): Update Target_selector
10301 constructor call. Remove recognize and recognize_by_name. Add
10302 do_instantiate_target.
10303 * x86_64.cc (class Target_selector_x86_64): Likewise.
10304 * testsuite/testfile.cc (class Target_selector_test): Update for
10305 changes to Target_selector.
10306
874c5b28
ILT
10307 * README: Rewrite, with some notes on unsupported features.
10308
0a65a3a7
CC
103092008-03-24 Cary Coutant <ccoutant@google.com>
10310
10311 * i386.cc (Target_i386::Got_type): New enum declaration.
10312 (Target_i386::Scan::local): Updated callers of Output_data_got
10313 member functions.
10314 (Target_i386::Scan::global): Likewise.
10315 (Target_i386::Relocate::relocate): Likewise.
10316 (Target_i386::Relocate::relocate_tls): Likewise.
10317 * object.h (Got_offset_list): New class.
10318 (Sized_relobj::local_has_got_offset): Added got_type parameter.
10319 (Sized_relobj::local_got_offset): Likewise.
10320 (Sized_relobj::set_local_got_offset): Likewise.
10321 (Sized_relobj::local_has_tls_got_offset): Removed.
10322 (Sized_relobj::local_tls_got_offset): Removed.
10323 (Sized_relobj::set_local_tls_got_offset): Removed.
10324 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
10325 * output.cc (Output_data_got::add_global): Added got_type parameter.
10326 (Output_data_got::add_global_with_rel): Likewise.
10327 (Output_data_got::add_global_with_rela): Likewise.
10328 (Output_data_got::add_global_pair_with_rel): New function.
10329 (Output_data_got::add_global_pair_with_rela): New function.
10330 (Output_data_got::add_local): Added got_type parameter.
10331 (Output_data_got::add_local_with_rel): Likewise.
10332 (Output_data_got::add_local_with_rela): Likewise.
10333 (Output_data_got::add_local_pair_with_rel): New function.
10334 (Output_data_got::add_local_pair_with_rela): New function.
10335 (Output_data_got::add_global_tls): Removed.
10336 (Output_data_got::add_global_tls_with_rel): Removed.
10337 (Output_data_got::add_global_tls_with_rela): Removed.
10338 (Output_data_got::add_local_tls): Removed.
10339 (Output_data_got::add_local_tls_with_rel): Removed.
10340 (Output_data_got::add_local_tls_with_rela): Removed.
10341 * output.h (Output_data_got::add_global): Added got_type parameter.
10342 (Output_data_got::add_global_with_rel): Likewise.
10343 (Output_data_got::add_global_with_rela): Likewise.
10344 (Output_data_got::add_global_pair_with_rel): New function.
10345 (Output_data_got::add_global_pair_with_rela): New function.
10346 (Output_data_got::add_local): Added got_type parameter.
10347 (Output_data_got::add_local_with_rel): Likewise.
10348 (Output_data_got::add_local_with_rela): Likewise.
10349 (Output_data_got::add_local_pair_with_rel): New function.
10350 (Output_data_got::add_local_pair_with_rela): New function.
10351 (Output_data_got::add_global_tls): Removed.
10352 (Output_data_got::add_global_tls_with_rel): Removed.
10353 (Output_data_got::add_global_tls_with_rela): Removed.
10354 (Output_data_got::add_local_tls): Removed.
10355 (Output_data_got::add_local_tls_with_rel): Removed.
10356 (Output_data_got::add_local_tls_with_rela): Removed.
10357 * resolve.cc (Symbol::override_base_with_special): Removed
10358 reference to has_got_offset_ field.
10359 * symtab.cc (Symbol::init_fields): Replaced initialization
10360 of got_offset_ with got_offsets_. Removed initialization
10361 of has_got_offset_
53fcba31 10362 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
10363 (Symbol::got_offset): Likewise.
10364 (Symbol::set_got_offset): Likewise.
10365 (Symbol::has_tls_got_offset): Removed.
10366 (Symbol::tls_got_offset): Removed.
10367 (Symbol::set_tls_got_offset): Removed.
10368 (Symbol::got_offset_): Removed.
10369 (Symbol::tls_mod_got_offset_): Removed.
10370 (Symbol::tls_pair_got_offset_): Removed.
10371 (Symbol::got_offsets_): New field.
10372 (Symbol::has_got_offset): Removed.
10373 (Symbol::has_tls_mod_got_offset): Removed.
10374 (Symbol::has_tls_pair_got_offset): Removed.
10375 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
10376 (Target_x86_64::Scan::local): Updated callers of Output_data_got
10377 member functions.
10378 (Target_x86_64::Scan::global): Likewise.
10379 (Target_x86_64::Relocate::relocate): Likewise.
10380 (Target_x86_64::Relocate::relocate_tls): Likewise.
10381
bd52eafb
BE
103822008-03-25 Ben Elliston <bje@au.ibm.com>
10383
10384 * yyscript.y: Fix spelling error in comment.
10385
8b105e34
ILT
103862008-03-24 Ian Lance Taylor <iant@google.com>
10387
8ed814a9
ILT
10388 * options.h (class General_options): Define build_id option.
10389 * layout.h (class Layout): Declare write_build_id, create_note,
10390 create_build_id. Add build_id_note_ member.
10391 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
10392 "libiberty.h", "md5.h", "sha1.h".
10393 (Layout::Layout): Initialize eh_frame_data_,
10394 eh_frame_hdr_section_, and build_id_note_.
10395 (Layout::finalize): Call create_build_id.
10396 (Layout::create_note): New function, broken out of
10397 Layout::create_gold_note.
10398 (Layout::create_gold_note): Call create_note.
10399 (Layout::create_build_id): New function.
10400 (Layout::write_build_id): New function.
10401 (Close_task_runner::run): Call write_build_id.
10402
8b105e34
ILT
10403 * x86_64.cc: Correct license to GPLv3.
10404
086a1841
ILT
104052008-03-23 Ian Lance Taylor <iant@google.com>
10406
10407 * options.cc: Include "demangle.h".
10408 (parse_optional_string): New function.
10409 (parse_long_option): Handle takes_optional_argument.
10410 (parse_short_option): Update dash_z initializer. Handle
10411 takes_optional_argument.
10412 (General_options::General_options): Initialize do_demangle_.
10413 (General_options::finalize): Set do_demangle_. Handle demangling
10414 style.
10415 * options.h (parse_optional_string): Declare.
10416 (struct One_option): Add optional_arg field. Update constructor.
10417 Update call constructor calls. Add takes_optional_argument
10418 function.
10419 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
10420 (DEFINE_optional_string): Define.
10421 (General_options::demangle): Change from DEFINE_bool to
10422 DEFINE_optional_string.
10423 (General_options::no_demangle): New function.
10424 (General_options::do_demangle): New function.
10425 (General_options::set_do_demangle): New function.
10426 (General_options::execstack_status_): Move definition to end of
10427 class definition.
10428 (General_options::static_): Likewise.
10429 (General_options::do_demangle_): New field.
10430 * object.cc (big_endian>::get_symbol_location_info): Call
10431 Options::do_demangle, not Options::demangle.
10432 * symtab.cc (demangle): Likewise.
10433
cbb93e63
ILT
104342008-03-22 Ian Lance Taylor <iant@google.com>
10435
10436 * gold.h: Include <cstddef> and <sys/types.h>
10437 * options.h: Include <cstring>.
10438
ec531623
ILT
104392008-03-21 Ian Lance Taylor <iant@google.com>
10440
10441 * Added source code to GNU binutils.
This page took 0.644473 seconds and 4 git commands to generate.