2011-05-27 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
89d8a36b
CC
12011-05-26 Cary Coutant <ccoutant@google.com>
2
3 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
4 * incremental.cc (Incremental_inputs::report_input_section): Fix
5 comment, indentation.
6 (Incremental_inputs::report_comdat_group): New function.
7 (Output_section_incremental_inputs::set_final_data_size): Adjust size
8 of data for incremental input file entry.
9 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
10 group count, COMDAT group signatures.
11 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
12 an unchanged input file.
13 * incremental.h (Incremental_object_entry::Incremental_object_entry):
14 Initialize new data member.
15 (Incremental_object_entry::add_comdat_group): New function.
16 (Incremental_object_entry::get_comdat_group_count): New function.
17 (Incremental_object_entry::get_comdat_signature_key): New function.
18 (Incremental_object_entry::groups_): New data member.
19 (Incremental_inputs::report_comdat_group): New function.
20 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
21 data for incremental input file entry.
22 (Incremental_input_entry_reader::get_comdat_group_count): New function.
23 (Incremental_input_entry_reader::get_input_section): Adjust size of
24 data for incremental input file entry.
25 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
26 (Incremental_input_entry_reader::get_comdat_group_signature): New
27 function.
28 * object.cc (Sized_relobj::include_section_group): Report kept
29 COMDAT groups for incremental links.
30
1706a06f
ILT
312011-05-24 David Meyer <pdox@google.com>
32
33 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
34 with name parameter. Add found_name parameter.
35 * fileread.cc (Input_file::find_file): Adjust code accordingly.
36 * dirsearch.h (class Dirsearch): Update declaration.
37
a10ae760
ILT
382011-05-24 Ian Lance Taylor <iant@google.com>
39
40 * archive.cc (Library_base::should_include_member): Pull in object
41 from archive if it defines the entry symbol.
42 * parameters.cc (Parameters::entry): New function.
43 * parameters.h (class Parameters): Declare entry.
44 * output.h (class Output_file_header): Remove entry_ field.
45 * output.cc (Output_file_header::Output_file_header): Remove entry
46 parameter. Change all callers.
47 (Output_file_header::entry): Use parameters->entry.
48 * gold.cc (queue_middle_tasks): Likewise.
49 * plugin.cc (Plugin_hook::run): Likewise.
50
aa92d6ed
CC
512011-05-24 Cary Coutant <ccoutant@google.com>
52
53 * gold.cc (queue_initial_tasks): Pass incremental base filename
54 to Output_file::open_base_file; don't print error message.
55 * incremental-dump.cc (main): Adjust call to
56 Output_file::open_for_modification.
57 * incremental-dump.cc (main): Likewise.
58 * incremental.cc (Incremental_inputs::report_command_line):
59 Ignore --incremental-base option when comparing command lines.
60 Ignore parameter when given as separate argument.
61 * options.h (class General_options): Add --incremental-base.
62 * output.cc (Output_file::Output_file):
63 (Output_file::open_base_file): Add base_name and writable parameters;
64 read base file into new file; print error message here.
65 (Output_file::map_no_anonymous): Add writable parameter; adjust all
66 callers.
67 * output.h (Output_file::open_for_modification): Rename to...
68 (Output_file::open_base_file): ...this; add base_name and
69 writable parameters; adjust all callers.
70 (Output_file::map_no_anonymous): Add writable parameter; adjust all
71 callers.
72 * testsuite/Makefile.am (incremental_test_4): Test
73 --incremental-base.
74 * testsuite/Makefile.in: Regenerate.
75
2eedd706
CC
762011-05-24 Cary Coutant <ccoutant@google.com>
77
78 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
79 incremental_test_4.
80 * testsuite/Makefile.in: Regenerate.
81 * testsuite/two_file_test_1_v1.cc: New test source file.
82 * testsuite/two_file_test_1b_v1.cc: New test source file.
83 * testsuite/two_file_test_2_v1.cc: New test source file.
84
0f1c85a6
CC
852011-05-24 Cary Coutant <ccoutant@google.com>
86
87 * dynobj.h (Dynobj::do_dynobj): New function.
88 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
89 flag and soname for shared objects.
90 * incremental.cc (Incremental_inputs::report_object): Make
91 either Incremental_object_entry or Incremental_dynobj_entry; add
92 soname to string table.
93 (Incremental_inputs::report_input_section): Add assertion.
94 (Output_section_incremental_inputs::set_final_data_size): Adjust
95 type of input file entry for shared libraries; adjust size of
96 shared library info entry.
97 (Output_section_incremental_inputs::write_input_files): Write
98 as_needed flag for shared libraries.
99 (Output_section_incremental_inputs::write_info_blocks): Adjust type
100 of input file entry for shared libraries; write soname.
101 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
102 soname from incremental info.
103 * incremental.h (enum Incremental_input_flags): Add
104 INCREMENTAL_INPUT_AS_NEEDED.
105 (Incremental_input_entry::Incremental_input_entry): Initialize new
106 data member.
107 (Incremental_input_entry::set_as_needed): New function.
108 (Incremental_input_entry::as_needed): New function.
109 (Incremental_input_entry::do_dynobj_entry): New function.
110 (Incremental_input_entry::as_needed_): New data member.
111 (Incremental_object_entry::Incremental_object_entry): Don't check
112 for shared library.
113 (Incremental_object_entry::do_type): Likewise.
114 (class Incremental_dynobj_entry): New class.
115 (Incremental_input_entry_reader::as_needed): New function.
116 (Incremental_input_entry_reader::get_soname): New function.
117 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
118 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
119 size of shared library info entry.
120 * layout.cc (Layout::finish_dynamic_section): Don't test for
121 incremental link when adding DT_NEEDED entries.
122 * object.h (Object::Object): Initialize new data member.
123 (Object::dynobj): New function.
124 (Object::set_as_needed): New function.
125 (Object::as_needed): New function.
126 (Object::do_dynobj): New function.
127 (Object::as_needed_): New data member.
128
6fa2a40b
CC
1292011-05-24 Cary Coutant <ccoutant@google.com>
130
131 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
132 info; adjust display of GOT entries.
133 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
134 vector of input objects; remove file_status_.
135 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
136 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
137 got_plt reader; call target hooks to reserve GOT entries.
138 (Output_section_incremental_inputs::set_final_data_size): Adjust size
139 of input file info header and GOT info entry.
140 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
141 relocation info.
142 (Got_plt_view_info::got_descriptor): Remove.
143 (Got_plt_view_info::sym_index): New data member.
144 (Got_plt_view_info::input_index): New data member.
145 (Local_got_offset_visitor::visit): Write input file index.
146 (Global_got_offset_visitor::visit): Write 0 for input file index.
147 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
148 with sym_index and input_index.
149 (Output_section_incremental_inputs::write_got_plt): Adjust size of
150 incremental info GOT entry; replace got_descriptor with input_index.
151 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
152 map from input file index to object.
153 (Sized_relobj_incr::do_layout): Replace direct data member reference
154 with accessor function.
155 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
156 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
157 Adjust size of input file info header.
158 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
159 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
160 (Incremental_input_entry_reader::get_input_section): Adjust size of
161 input file info header.
162 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
163 of incremental info GOT entry.
164 (Incremental_got_plt_reader::get_got_desc): Remove.
165 (Incremental_got_plt_reader::get_got_symndx): New function.
166 (Incremental_got_plt_reader::get_got_input_index): New function.
167 (Sized_incremental_binary::Sized_incremental_binary): Remove
168 file_status_; add input_objects_.
169 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
170 (Sized_incremental_binary::set_file_is_unchanged): Remove.
171 (Sized_incremental_binary::file_is_unchanged): Remove.
172 (Sized_incremental_binary::set_input_object): New function.
173 (Sized_incremental_binary::input_object): New function.
174 (Sized_incremental_binary::file_status_): Remove.
175 (Sized_incremental_binary::input_objects_): New data member.
176 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
177 references.
178 (Sized_relobj_incr::invalid_address): Move to base class.
179 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
180 class.
181 (Sized_relobj_incr::do_output_section_offset): Likewise.
182 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
183 (Sized_relobj_incr::section_offsets_): Likewise.
184 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
185 function.
186 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
187 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
188 with accessor function.
189 (Sized_relobj_file::do_layout): Likewise.
190 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
191 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
192 (Sized_relobj_file::compute_final_local_value): Replace refs to
193 section_offsets_ with accessor function.
194 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
195 * object.h (Relobj::Relobj): Initialize new data members.
196 (Relobj::add_dyn_reloc): New function.
197 (Relobj::first_dyn_reloc): New function.
198 (Relobj::dyn_reloc_count): New function.
199 (Relobj::first_dyn_reloc_): New data member.
200 (Relobj::dyn_reloc_count_): New data member.
201 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
202 references.
203 (Sized_relobj::Address): New typedef.
204 (Sized_relobj::invalid_address): Move here from child class.
205 (Sized_relobj::Sized_relobj): Initialize new data members.
206 (Sized_relobj::sized_relobj): New function.
207 (Sized_relobj::is_output_section_offset_invalid): Move here from
208 child class.
209 (Sized_relobj::get_output_section_offset): Likewise.
210 (Sized_relobj::local_has_got_offset): Likewise.
211 (Sized_relobj::local_got_offset): Likewise.
212 (Sized_relobj::set_local_got_offset): Likewise.
213 (Sized_relobj::do_for_all_local_got_entries): Likewise.
214 (Sized_relobj::clear_got_offsets): New function.
215 (Sized_relobj::section_offsets): Move here from child class.
216 (Sized_relobj::do_output_section_offset): Likewise.
217 (Sized_relobj::do_set_section_offset): Likewise.
218 (Sized_relobj::Local_got_offsets): Likewise.
219 (Sized_relobj::local_got_offsets_): Likewise.
220 (Sized_relobj::section_offsets_): Likewise.
221 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
222 references.
223 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
224 class.
225 (Sized_relobj_file::sized_relobj): New function
226 (Sized_relobj_file::local_has_got_offset): Move to base class.
227 (Sized_relobj_file::local_got_offset): Likewise.
228 (Sized_relobj_file::set_local_got_offset): Likewise.
229 (Sized_relobj_file::get_output_section_offset): Likewise.
230 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
231 (Sized_relobj_file::do_output_section_offset): Likewise.
232 (Sized_relobj_file::do_set_section_offset): Likewise.
233 (Sized_relobj_file::Local_got_offsets): Likewise.
234 (Sized_relobj_file::local_got_offsets_): Likewise.
235 (Sized_relobj_file::section_offsets_): Likewise.
236 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
237 (all constructors).
238 (set_needs_dynsym_index): Convert relobj to derived class pointer.
239 (Output_reloc::get_symbol_index): Likewise.
240 (Output_reloc::local_section_offset): Likewise.
241 (Output_reloc::get_address): Likewise.
242 (Output_reloc::symbol_value): Likewise.
243 (Output_data_got::reserve_slot): Move to class definition.
244 (Output_data_got::reserve_local): New function.
245 (Output_data_got::reserve_slot_for_global): Remove.
246 (Output_data_got::reserve_global): New function.
247 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
248 (all constructors, two instantiations).
249 (Output_reloc::get_relobj): New function (two instantiations).
250 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
251 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
252 (Output_data_reloc::add_global): Adjust type of relobj.
253 (Output_data_reloc::add_global_relative): Likewise.
254 (Output_data_reloc::add_symbolless_global_addend): Likewise.
255 (Output_data_reloc::add_local): Likewise.
256 (Output_data_reloc::add_local_relative): Likewise.
257 (Output_data_reloc::add_symbolless_local_addend): Likewise.
258 (Output_data_reloc::add_local_section): Likewise.
259 (Output_data_reloc::add_output_section): Likewise.
260 (Output_data_reloc::add_absolute): Likewise.
261 (Output_data_reloc::add_target_specific): Likewise.
262 (Output_data_got::reserve_slot): Move definition here.
263 (Output_data_got::reserve_local): New function.
264 (Output_data_got::reserve_global): New function.
265 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
266 section_offsets_ with accessor function.
267 (Sized_relobj_file::write_sections): Likewise.
268 (Sized_relobj_file::do_relocate_sections): Likewise.
269 * target.h (Sized_target::reserve_local_got_entry): New function.
270 (Sized_target::reserve_global_got_entry): New function.
271 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
272 (Target_x86_64::reserve_global_got_entry): New function.
273 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
274
4829d394
CC
2752011-05-23 Cary Coutant <ccoutant@google.com>
276
277 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
278 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
279 bit when checking got_type.
280 * incremental.cc (Sized_incremental_binary::setup_readers):
281 Store symbol table and string table locations; initialize bit vector
282 of file status flags.
283 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
284 unchanged files.
285 (Sized_incremental_binary::do_process_got_plt): New function.
286 (Sized_incremental_binary::get_symtab_view): Use stored locations.
287 (Output_section_incremental_inputs::set_final_data_size): Record
288 file index for each input file.
289 (Output_section_incremental_inputs::write_got_plt): Store file index
290 instead of input entry offset for each GOT entry.
291 * incremental.h
292 (Incremental_input_entry::Incremental_input_entry): Initialize new
293 data member.
294 (Incremental_input_entry::set_offset): Store file index.
295 (Incremental_input_entry::get_file_index): New function.
296 (Incremental_input_entry::file_index_): New data member.
297 (Incremental_binary::process_got_plt): New function.
298 (Incremental_binary::do_process_got_plt): New function.
299 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
300 data members.
301 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
302 (Sized_incremental_binary::set_file_is_unchanged): New function.
303 (Sized_incremental_binary::file_is_unchanged): New function.
304 (Sized_incremental_binary::do_process_got_plt): New function.
305 (Sized_incremental_binary::file_status_): New data member.
306 (Sized_incremental_binary::main_symtab_loc_): New data member.
307 (Sized_incremental_binary::main_strtab_loc_): New data member.
308 * output.cc (Output_data_got::Got_entry::write): Add case
309 RESERVED_CODE.
310 (Output_data_got::add_global): Call add_got_entry.
311 (Output_data_got::add_global_plt): Likewise.
312 (Output_data_got::add_global_with_rel): Likewise.
313 (Output_data_got::add_global_with_rela): Likewise.
314 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
315 (Output_data_got::add_global_pair_with_rela): Likewise.
316 (Output_data_got::add_local): Call add_got_entry.
317 (Output_data_got::add_local_plt): Likewise.
318 (Output_data_got::add_local_with_rel): Likewise.
319 (Output_data_got::add_local_with_rela): Likewise.
320 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
321 (Output_data_got::add_local_pair_with_rela): Likewise.
322 (Output_data_got::reserve_slot): New function.
323 (Output_data_got::reserve_slot_for_global): New function.
324 (Output_data_got::add_got_entry): New function.
325 (Output_data_got::add_got_entry_pair): New function.
326 (Output_section::add_output_section_data): Edit FIXME.
327 * output.h
328 (Output_section_data_build::Output_section_data_build): New
329 constructor with size parameter.
330 (Output_data_space::Output_data_space): Likewise.
331 (Output_data_got::Output_data_got): Initialize new data member; new
332 constructor with size parameter.
333 (Output_data_got::add_constant): Call add_got_entry.
334 (Output_data_got::reserve_slot): New function.
335 (Output_data_got::reserve_slot_for_global): New function.
336 (class Output_data_got::Got_entry): Add RESERVED_CODE.
337 (Output_data_got::add_got_entry): New function.
338 (Output_data_got::add_got_entry_pair): New function.
339 (Output_data_got::free_list_): New data member.
340 * target.h (Sized_target::init_got_plt_for_update): New function.
341 (Sized_target::register_global_plt_entry): New function.
342 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
343 Initialize new data member; call init; add constructor with PLT count.
344 (Output_data_plt_x86_64::init): New function.
345 (Output_data_plt_x86_64::add_relocation): New function.
346 (Output_data_plt_x86_64::reserve_slot): New function.
347 (Output_data_plt_x86_64::free_list_): New data member.
348 (Target_x86_64::init_got_plt_for_update): New function.
349 (Target_x86_64::register_global_plt_entry): New function.
350 (Output_data_plt_x86_64::add_entry): Allocate from free list for
351 incremental updates.
352 (Output_data_plt_x86_64::add_relocation): New function.
353 * testsuite/object_unittest.cc (Object_test): Set default options.
354
ec69d6da
ILT
3552011-05-16 Ian Lance Taylor <iant@google.com>
356
357 * options.h (class General_options): Make -i a synonym for -r.
358
732e31de
ILT
3592011-05-16 Ian Lance Taylor <iant@google.com>
360
361 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
362
403676b5
CC
3632011-05-10 Cary Coutant <ccoutant@google.com>
364
365 * object.cc (Sized_relobj::do_count_local_symbols): Check for
366 strip_all (-s).
367
5b7b7d6e
ILT
3682011-05-06 Ian Lance Taylor <iant@google.com>
369
370 * layout.cc (Layout::layout): If the output section flags change,
371 update the ordering.
372
f0f9babf
CC
3732011-04-25 Cary Coutant <ccoutant@google.com>
374
375 * incremental-dump.cc (dump_incremental_inputs): Print local
376 symbol info for each input file.
377 * incremental.cc
378 (Output_section_incremental_inputs::set_final_data_size): Add local
379 symbol info to input file entries in incremental info.
380 (Output_section_incremental_inputs::write_info_blocks): Likewise.
381 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
382 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
383 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
384 implementation.
385 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
386 (Sized_incr_relobj::do_relocate): Write the local symbols.
387 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
388 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
389 Adjust size of input file header.
390 (Incremental_inputs_reader::get_local_symbol_offset): New function.
391 (Incremental_inputs_reader::get_local_symbol_count): New function.
392 (Incremental_inputs_reader::get_input_section): Adjust size of input
393 file header.
394 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
395 (Sized_incr_relobj::This): New typedef.
396 (Sized_incr_relobj::sym_size): New const data member.
397 (Sized_incr_relobj::Local_symbol): New struct.
398 (Sized_incr_relobj::do_output_local_symbol_count): New function.
399 (Sized_incr_relobj::do_local_symbol_offset): New function.
400 (Sized_incr_relobj::local_symbol_count_): New data member.
401 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
402 (Sized_incr_relobj::local_symbol_index_): New data member.
403 (Sized_incr_relobj::local_symbol_offset_): New data member.
404 (Sized_incr_relobj::local_dynsym_offset_): New data member.
405 (Sized_incr_relobj::local_symbols_): New data member.
406 * object.h (Relobj::output_local_symbol_count): New function.
407 (Relobj::local_symbol_offset): New function.
408 (Relobj::do_output_local_symbol_count): New function.
409 (Relobj::do_local_symbol_offset): New function.
410 (Sized_relobj::do_output_local_symbol_count): New function.
411 (Sized_relobj::do_local_symbol_offset): New function.
412
d0a9ace3
ILT
4132011-04-22 Vladimir Simonov <sv@sw.ru>
414
415 * descriptors.cc (set_close_on_exec): New function.
416 (Descriptors::open): Use set_close_on_exec.
417 * output.cc (S_ISLNK): Define if not defined.
418
94a3fc8b
CC
4192011-04-22 Cary Coutant <ccoutant@google.com>
420
421 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
422 global symbol map.
423 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
424 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
425 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
426 relocations.
427 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
428 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
429 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
430 * incremental.h
431 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
432 function.
433 (Incremental_binary::apply_incremental_relocs): New function.
434 (Incremental_binary::do_apply_incremental_relocs): New function.
435 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
436 data member.
437 (Sized_incremental_binary::add_global_symbol): New function.
438 (Sized_incremental_binary::global_symbol): New function.
439 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
440 (Sized_incremental_binary::symbol_map_): New data member.
441 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
442 * target.h (Sized_target::apply_relocation): New function.
443 * target-reloc.h (apply_relocation): New function.
444 * x86_64.cc (Target_x86_64::apply_relocation): New function.
445
c87e4302
DK
4462011-04-22 Doug Kwan <dougkwan@google.com>
447
448 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
449 flag of a SHT_ARM_EXIDX section.
450 * testsuite/Makefile.am (arm_exidx_test): New test rules.
451 * testsuite/Makefile.in: Regenerate.
452 * testsuite/arm_exidx_test.s: New file.
453 * testsuite/arm_exidx_test.sh: Same.
454
e7782cf6
CC
4552011-04-20 Cary Coutant <ccoutant@google.com>
456
457 PR gold/12689
458 * archive.h (Incremental_archive_entry::Archive_member):
459 Initialize arg_serial_ (second constructor).
460
308ecdc7
ILT
4612011-04-17 Ian Lance Taylor <iant@google.com>
462
463 * object.cc (Relocate_info::location): Simplify location string.
464 * errors.cc (Errors::error_at_location): Don't print program
465 name.
466 (Errors::warning_at_location): Likewise.
467 (Errors::undefined_symbol): Likewise.
468 * testsuite/debug_msg.sh: Update accordingly.
469
bec5b579
CC
4702011-04-14 Cary Coutant <ccoutant@google.com>
471
472 * gold/layout.cc (Layout::symtab_section_offset): New function.
473 * gold/layout.h (Layout::symtab_section_offset): New function.
474 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
475
88597d34
ILT
4762011-04-12 Ian Lance Taylor <iant@google.com>
477
478 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
479 with MREMAP_MAYMOVE.
480 * output.h (class Output_file): Add map_is_allocated_ field.
481 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
482 not available, provide stubs. If mremap is not available, #define
483 it to gold_mremap.
484 (MREMAP_MAYMOVE): Define if not defined.
485 (Output_file::Output_file): Initialize map_is_allocated_.
486 (Output_file::resize): Check map_is_allocated_.
487 (Output_file::map_anonymous): If mmap fails, use malloc.
488 (Output_file::unmap): Don't do anything for an anonymous map.
489 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
490 is not available, provide stubs.
491 (File_read::View::~View): Use free rather than delete[].
492 (File_read::make_view): Use malloc rather than new[]. If mmap
493 fails, use malloc.
494 (File_read::find_or_make_view): Use malloc rather than new[].
495 * gold.h: Remove HAVE_REMAP code.
496 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
497 exists. Rename mremap to gold_mremap. If mmap is not available
498 don't do anything.
499 * configure, config.in: Rebuild.
500
11e361bc
ILT
5012011-04-11 Ian Lance Taylor <iant@google.com>
502
503 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
504 initialize local variable v.
505
cdc29364
CC
5062011-04-11 Cary Coutant <ccoutant@google.com>
507
508 * archive.cc (Archive::include_member): Adjust call to
509 report_object.
510 (Add_archive_symbols::run): Track argument serial numbers.
511 (Lib_group::include_member): Likewise.
512 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
513 * archive.h (Incremental_archive_entry::Archive_member):
514 Initialize arg_serial_.
515 (Archive_member::arg_serial_): New data member.
516 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
517 (Sized_dynobj::do_add_symbols): Track symbols when doing an
518 incremental link.
519 (Sized_dynobj::do_for_all_local_got_entries): New function.
520 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
521 function.
522 * fileread.cc (get_mtime): New function.
523 * fileread.h (get_mtime): New function.
524 * gold.cc (queue_initial_tasks): Check for incremental update.
525 (process_incremental_input): New function.
526 (queue_middle_tasks): Don't force valid target for incremental
527 update.
528 * incremental-dump.cc (find_input_containing_global): Adjust
529 size of symbol info entry.
530 (dump_incremental_inputs): Dump argument serial number and
531 in_system_directory flag; bias shndx by 1; print symbol names
532 when dumping per-file symbol lists; use new symbol info readers.
533 * incremental.cc
534 (Output_section_incremental_inputs:update_data_size): New function.
535 (Sized_incremental_binary::setup_readers): Setup input readers
536 for each input file; build maps for files added from libraries
537 and scripts.
538 (Sized_incremental_binary::check_input_args): New function.
539 (Sized_incremental_binary::do_check_inputs): Build map of argument
540 serial numbers to input arguments.
541 (Sized_incremental_binary::do_file_has_changed): Rename
542 do_file_is_unchanged to this; compare file modification times.
543 (Sized_incremental_binary::do_init_layout): New function.
544 (Sized_incremental_binary::do_reserve_layout): New function.
545 (Sized_incremental_binary::do_get_input_reader): Remove.
546 (Sized_incremental_binary::get_symtab_view): New function.
547 (Incremental_checker::can_incrementally_link_output_file): Remove.
548 (Incremental_inputs::report_command_line): Exclude --debug options.
549 (Incremental_inputs::report_archive_begin): Add parameter; track
550 argument serial numbers; don't put input file entry for archive
551 before archive members.
552 (Incremental_inputs::report_archive_end): Put input file entry
553 for archive after archive members.
554 (Incremental_inputs::report_object): Add parameter; track argument
555 serial numbers and in_system_directory flag.
556 (Incremental_inputs::report_script): Add parameter; track argument
557 serial numbers.
558 (Output_section_incremental_inputs::set_final_data_size): Adjust
559 size of symbol info entry; check for forwarding symbols.
560 (Output_section_incremental_inputs::write_input_files): Write
561 in_system_directory flag and argument serial number.
562 (Output_section_incremental_inputs::write_info_blocks): Map section
563 indices between incremental info and original input file; store
564 input section index for each symbol.
565 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
566 change operator() to visit().
567 (class Global_got_offset_visitor): Likewise.
568 (class Global_symbol_visitor_got_plt):
569 (Output_section_incremental_inputs::write_got_plt): Use new visitor
570 classes.
571 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
572 (Sized_incr_relobj::do_read_symbols): New function.
573 (Sized_incr_relobj::do_layout): New function.
574 (Sized_incr_relobj::do_layout_deferred_sections): New function.
575 (Sized_incr_relobj::do_add_symbols): New function.
576 (Sized_incr_relobj::do_should_include_member): New function.
577 (Sized_incr_relobj::do_for_all_global_symbols): New function.
578 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
579 (Sized_incr_relobj::do_section_size): New function.
580 (Sized_incr_relobj::do_section_name): New function.
581 (Sized_incr_relobj::do_section_contents): New function.
582 (Sized_incr_relobj::do_section_flags): New function.
583 (Sized_incr_relobj::do_section_entsize): New function.
584 (Sized_incr_relobj::do_section_address): New function.
585 (Sized_incr_relobj::do_section_type): New function.
586 (Sized_incr_relobj::do_section_link): New function.
587 (Sized_incr_relobj::do_section_info): New function.
588 (Sized_incr_relobj::do_section_addralign): New function.
589 (Sized_incr_relobj::do_initialize_xindex): New function.
590 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
591 (Sized_incr_relobj::do_read_relocs): New function.
592 (Sized_incr_relobj::do_gc_process_relocs): New function.
593 (Sized_incr_relobj::do_scan_relocs): New function.
594 (Sized_incr_relobj::do_count_local_symbols): New function.
595 (Sized_incr_relobj::do_finalize_local_symbols): New function.
596 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
597 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
598 (Sized_incr_relobj::do_relocate): New function.
599 (Sized_incr_relobj::do_set_section_offset): New function.
600 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
601 (Sized_incr_dynobj::do_read_symbols): New function.
602 (Sized_incr_dynobj::do_layout): New function.
603 (Sized_incr_dynobj::do_add_symbols): New function.
604 (Sized_incr_dynobj::do_should_include_member): New function.
605 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
606 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
607 (Sized_incr_dynobj::do_section_size): New function.
608 (Sized_incr_dynobj::do_section_name): New function.
609 (Sized_incr_dynobj::do_section_contents): New function.
610 (Sized_incr_dynobj::do_section_flags): New function.
611 (Sized_incr_dynobj::do_section_entsize): New function.
612 (Sized_incr_dynobj::do_section_address): New function.
613 (Sized_incr_dynobj::do_section_type): New function.
614 (Sized_incr_dynobj::do_section_link): New function.
615 (Sized_incr_dynobj::do_section_info): New function.
616 (Sized_incr_dynobj::do_section_addralign): New function.
617 (Sized_incr_dynobj::do_initialize_xindex): New function.
618 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
619 (make_sized_incremental_object): New function.
620 (Incremental_library::copy_unused_symbols): New function.
621 (Incremental_library::do_for_all_unused_symbols): New function.
622 * incremental.h (enum Incremental_input_flags): New type.
623 (class Incremental_checker): Remove.
624 (Incremental_input_entry::Incremental_input_entry): Add argument
625 serial number.
626 (Incremental_input_entry::arg_serial): New function.
627 (Incremental_input_entry::set_is_in_system_directory): New function.
628 (Incremental_input_entry::is_in_system_directory): New function.
629 (Incremental_input_entry::arg_serial_): New data member.
630 (Incremental_input_entry::is_in_system_directory_): New data member.
631 (class Script_info): Move here from script.h.
632 (Script_info::Script_info): Add filename parameter.
633 (Script_info::filename): New function.
634 (Script_info::filename_): New data member.
635 (Incremental_script_entry::Incremental_script_entry): Add argument
636 serial number.
637 (Incremental_object_entry::Incremental_object_entry): Likewise.
638 (Incremental_object_entry::add_input_section): Build list of input
639 sections with map to original shndx.
640 (Incremental_object_entry::get_input_section_index): New function.
641 (Incremental_object_entry::shndx_): New data member.
642 (Incremental_object_entry::name_key_): Rename; adjust all refs.
643 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
644 (Incremental_archive_entry::Incremental_archive_entry): Add argument
645 serial number.
646 (Incremental_inputs::report_archive_begin): Likewise.
647 (Incremental_inputs::report_object): Likewise.
648 (Incremental_inputs::report_script): Likewise.
649 (class Incremental_global_symbol_reader): New class.
650 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
651 and store flags and input file type.
652 (Incremental_input_entry_reader::arg_serial): New function.
653 (Incremental_input_entry_reader::type): Extract type from flags.
654 (Incremental_input_entry_reader::is_in_system_directory): New function.
655 (Incremental_input_entry_reader::get_input_section_count): Call
656 accessor function for type.
657 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
658 function for type; adjust size of global symbol entry.
659 (Incremental_input_entry_reader::get_global_symbol_count): Call
660 accessor function for type.
661 (Incremental_input_entry_reader::get_object_count): Likewise.
662 (Incremental_input_entry_reader::get_object_offset): Likewise.
663 (Incremental_input_entry_reader::get_member_count): Likewise.
664 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
665 (Incremental_input_entry_reader::get_member_offset): Likewise.
666 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
667 (Incremental_input_entry_reader::Global_symbol_info): Remove.
668 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
669 (Incremental_input_entry_reader::get_global_symbol_reader): New
670 function.
671 (Incremental_input_entry_reader::get_output_symbol_index): New
672 function.
673 (Incremental_input_entry_reader::type_): Remove.
674 (Incremental_input_entry_reader::flags_): New data member.
675 (Incremental_inputs_reader::input_file_offset): New function.
676 (Incremental_inputs_reader::input_file_index): New function.
677 (Incremental_inputs_reader::input_file): Call input_file_offset.
678 (Incremental_inputs_reader::input_file_at_offset): New function.
679 (Incremental_relocs_reader::get_r_type): Reformat.
680 (Incremental_relocs_reader::get_r_shndx): Reformat.
681 (Incremental_relocs_reader::get_r_offset): Reformat.
682 (Incremental_relocs_reader::data): New function.
683 (Incremental_binary::Incremental_binary): Initialize new data members.
684 (Incremental_binary::check_inputs): Add cmdline parameter.
685 (Incremental_binary::file_is_unchanged): Remove.
686 (Input_reader::arg_serial): New function.
687 (Input_reader::get_unused_symbol_count): New function.
688 (Input_reader::get_unused_symbol): New function.
689 (Input_reader::do_arg_serial): New function.
690 (Input_reader::do_get_unused_symbol_count): New function.
691 (Input_reader::do_get_unused_symbol): New function.
692 (Incremental_binary::input_file_count): New function.
693 (Incremental_binary::get_input_reader): Change signature to use
694 index instead of filename.
695 (Incremental_binary::file_has_changed): New function.
696 (Incremental_binary::get_input_argument): New function.
697 (Incremental_binary::get_library): New function.
698 (Incremental_binary::get_script_info): New function.
699 (Incremental_binary::init_layout): New function.
700 (Incremental_binary::reserve_layout): New function.
701 (Incremental_binary::output_file): New function.
702 (Incremental_binary::do_check_inputs): New function.
703 (Incremental_binary::do_file_is_unchanged): Remove.
704 (Incremental_binary::do_file_has_changed): New function.
705 (Incremental_binary::do_init_layout): New function.
706 (Incremental_binary::do_reserve_layout): New function.
707 (Incremental_binary::do_input_file_count): New function.
708 (Incremental_binary::do_get_input_reader): Change signature.
709 (Incremental_binary::input_args_map_): New data member.
710 (Incremental_binary::library_map_): New data member.
711 (Incremental_binary::script_map_): New data member.
712 (Sized_incremental_binary::Sized_incremental_binary): Initialize
713 new data members.
714 (Sized_incremental_binary::output_section): New function.
715 (Sized_incremental_binary::inputs_reader): Add const.
716 (Sized_incremental_binary::symtab_reader): Add const.
717 (Sized_incremental_binary::relocs_reader): Add const.
718 (Sized_incremental_binary::got_plt_reader): Add const.
719 (Sized_incremental_binary::get_symtab_view): New function.
720 (Sized_incremental_binary::Inputs_reader): New typedef.
721 (Sized_incremental_binary::Input_entry_reader): New typedef.
722 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
723 (Sized_incremental_binary::do_file_is_unchanged): Remove.
724 (Sized_incremental_binary::do_file_has_changed): New function.
725 (Sized_incremental_binary::do_init_layout): New function.
726 (Sized_incremental_binary::do_reserve_layout): New function.
727 (Sized_input_reader::Inputs_reader): Remove.
728 (Sized_input_reader::Input_entry_reader): Remove.
729 (Sized_input_reader::do_arg_serial): New function.
730 (Sized_input_reader::do_get_unused_symbol_count): New function.
731 (Sized_input_reader::do_get_unused_symbol): New function.
732 (Sized_incremental_binary::do_input_file_count): New function.
733 (Sized_incremental_binary::do_get_input_reader): Change signature;
734 use index instead of filename.
735 (Sized_incremental_binary::section_map_): New data member.
736 (Sized_incremental_binary::input_entry_readers_): New data member.
737 (class Sized_incr_relobj): New class.
738 (class Sized_incr_dynobj): New class.
739 (make_sized_incremental_object): New function.
740 (class Incremental_library): New class.
741 * layout.cc (Free_list::num_lists): New static data member.
742 (Free_list::num_nodes): New static data member.
743 (Free_list::num_removes): New static data member.
744 (Free_list::num_remove_visits): New static data member.
745 (Free_list::num_allocates): New static data member.
746 (Free_list::num_allocate_visits): New static data member.
747 (Free_list::init): New function.
748 (Free_list::remove): New function.
749 (Free_list::allocate): New function.
750 (Free_list::dump): New function.
751 (Free_list::print_stats): New function.
752 (Layout_task_runner::run): Resize output file for incremental updates.
753 (Layout::Layout): Initialize new data members.
754 (Layout::set_incremental_base): New function.
755 (Layout::init_fixed_output_section): New function.
756 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
757 incremental updates.
758 (Layout::create_gold_note): Do not create gold note section for
759 incremental updates.
760 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
761 for incremental updates.
762 (Layout::set_section_offsets): For incremental updates, allocate space
763 from free list.
764 (Layout::create_symtab_sections): Layout with offsets relative to
765 start of section; for incremental updates, allocate space from free
766 list.
767 (Layout::create_shdrs): For incremental updates, allocate space from
768 free list.
769 (Layout::finish_dynamic_section): For incremental updates, do not
770 check --as-needed (fixed in subsequent patch).
771 * layout.h (class Free_list): New class.
772 (Layout::set_incremental_base): New function.
773 (Layout::incremental_base): New function.
774 (Layout::init_fixed_output_section): New function.
775 (Layout::allocate): New function.
776 (Layout::incremental_base_): New data member.
777 (Layout::free_list_): New data member.
778 * main.cc (main): Print Free_list statistics.
779 * object.cc (Relobj::finalize_incremental_relocs): Add
780 clear_counts parameter; clear counts only when clear_counts is set.
781 (Sized_relobj::Sized_relobj): Initialize new base class.
782 (Sized_relobj::do_layout): Don't report special sections.
783 (Sized_relobj::do_for_all_local_got_entries): New function.
784 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
785 symtab_off to all symbol table offsets.
786 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
787 * object.h (class Got_offset_list): Move to top of file.
788 (Object::Object): Allow case where input_file == NULL.
789 (Object::~Object): Likewise.
790 (Object::input_file): Assert that input_file != NULL.
791 (Object::lock): Allow case where input_file == NULL.
792 (Object::unlock): Likewise.
793 (Object::is_locked): Likewise.
794 (Object::token): Likewise.
795 (Object::release): Likewise.
796 (Object::is_incremental): New function.
797 (Object::get_mtime): New function.
798 (Object::for_all_local_got_entries): New function.
799 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
800 (Object::set_is_in_system_directory): New function.
801 (Object::is_in_system_directory): New function.
802 (Object::do_is_incremental): New function.
803 (Object::do_get_mtime): New function.
804 (Object::do_for_all_local_got_entries): New function.
805 (Object::is_in_system_directory_): New data member.
806 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
807 (class Sized_relobj_base): New class.
808 (class Sized_relobj): Derive from Sized_relobj_base.
809 (class Sized_relobj::Symbols): Redeclare from base class.
810 (class Sized_relobj::local_got_offset_list): Remove.
811 (class Sized_relobj::Output_sections): Redeclare from base class.
812 (class Sized_relobj::do_for_all_local_got_entries): New function.
813 (class Sized_relobj::write_local_symbols): Add offset parameter.
814 (class Sized_relobj::local_symbol_offset_): Update comment.
815 (class Sized_relobj::local_dynsym_offset_): Update comment.
816 * options.cc (Input_arguments::add_file): Remove const.
817 * options.h (Input_file_argument::Input_file_argument):
818 Initialize arg_serial_ (all constructors).
819 (Input_file_argument::set_arg_serial): New function.
820 (Input_file_argument::arg_serial): New function.
821 (Input_file_argument::arg_serial_): New data member.
822 (Input_arguments::Input_arguments): Initialize file_count_.
823 (Input_arguments::add_file): Remove const.
824 (Input_arguments::number_of_input_files): New function.
825 (Input_arguments::file_count_): New data member.
826 (Command_line::number_of_input_files): Call
827 Input_arguments::number_of_input_files.
828 * output.cc (Output_segment_headers::Output_segment_headers):
829 Set current size.
830 (Output_section::Input_section::current_data_size): New function.
831 (Output_section::Output_section): Initialize new data members.
832 (Output_section::add_input_section): Don't do merge sections for
833 an incremental link; allocate space from free list for an
834 incremental update.
835 (Output_section::add_output_section_data): Allocate space from
836 free list for an incremental update.
837 (Output_section::update_data_size): New function.
838 (Output_section::set_fixed_layout): New function.
839 (Output_section::reserve): New function.
840 (Output_segment::set_section_addresses): Remove const.
841 (Output_segment::set_section_list_addresses): Remove const; allocate
842 space from free list for an incremental update.
843 (Output_segment::set_offset): Adjust size of RELRO segment for an
844 incremental update.
845 * output.h (Output_data::current_data_size): Move here from
846 child classes.
847 (Output_data::pre_finalize_data_size): New function.
848 (Output_data::update_data_size): New function.
849 (Output_section_headers::update_data_size): new function.
850 (Output_section_data_build::current_data_size): Move to Output_data.
851 (Output_data_strtab::update_data_size): New function.
852 (Output_section::current_data_size): Move to Output_data.
853 (Output_section::set_fixed_layout): New function.
854 (Output_section::has_fixed_layout): New function.
855 (Output_section::reserve): New function.
856 (Output_section::update_data_size): New function.
857 (Output_section::has_fixed_layout_): New data member.
858 (Output_section::free_list_): New data member.
859 (Output_segment::set_section_addresses): Remove const.
860 (Output_segment::set_section_list_addresses): Remove const.
861 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
862 New function.
863 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
864 New function.
865 * readsyms.cc (Read_symbols::do_read_symbols): Add library
866 parameter when calling Add_symbols constructor; store argument
867 serial number for members of a lib group.
868 (Add_symbols::locks): Allow case where token == NULL.
869 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
870 (Read_member::~Read_member): New function.
871 (Read_member::is_runnable): New function.
872 (Read_member::locks): New function.
873 (Read_member::run): New function.
874 (Check_script::~Check_script): New function.
875 (Check_script::is_runnable): New function.
876 (Check_script::locks): New function.
877 (Check_script::run): New function.
878 (Check_library::~Check_library): New function.
879 (Check_library::is_runnable): New function.
880 (Check_library::locks): New function.
881 (Check_library::run): New function.
882 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
883 (Add_symbols::library_): New data member.
884 (class Read_member): New class.
885 (class Check_script): New class.
886 (class Check_library): New class.
887 * reloc.cc (Read_relocs::is_runnable): Allow case where
888 token == NULL.
889 (Read_relocs::locks): Likewise.
890 (Scan_relocs::locks): Likewise.
891 (Relocate_task::locks): Likewise.
892 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
893 to clear counters.
894 (Sized_relobj::incremental_relocs_scan): Fix comment.
895 (Sized_relobj::do_relocate): Pass output file offset to
896 write_local_symbols.
897 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
898 from class declaration.
899 * script.cc (read_input_script): Allocate Script_info; pass
900 argument serial number to report_script.
901 * script.h (class Script_info): Move to incremental.h.
902 * symtab.cc (Symbol_table::add_from_incrobj): New function.
903 * symtab.h (Symbol_table::add_from_incrobj): New function.
904 (Symbol_table::set_file_offset): New function.
905
b961d0d7
CC
9062011-04-05 Cary Coutant <ccoutant@google.com>
907
908 * incremental-dump.cc (dump_incremental_inputs): Change signature
909 to take a Sized_incremental_binary; change caller. Use readers
910 in Sized_incremental_binary.
911 * incremental.cc
912 (Sized_incremental_binary::find_incremental_inputs_sections):
913 Rename do_find_incremental_inputs_sections to this.
914 (Sized_incremental_binary::setup_readers): New function.
915 (Sized_incremental_binary::do_check_inputs): Check
916 has_incremental_info_ flag; move setup code to setup_readers;
917 use input readers.
918 (Sized_incremental_binary::do_file_is_unchanged): New function.
919 (Sized_incremental_binary::do_get_input_reader): New function.
920 * incremental.h (class Incremental_binary): Move to end of file.
921 (Incremental_binary::file_is_unchanged): New function.
922 (Incremental_binary::do_file_is_unchanged): New function.
923 (Incremental_binary::Input_reader): New class.
924 (Incremental_binary::get_input_reader): New function.
925 (class Sized_incremental_binary): Move to end of file.
926 (Sized_incremental_binary::Sized_incremental_binary): Setup the
927 input section reader classes.
928 (Sized_incremental_binary::has_incremental_info): New function.
929 (Sized_incremental_binary::inputs_reader): New function.
930 (Sized_incremental_binary::symtab_reader): New function.
931 (Sized_incremental_binary::relocs_reader): New function.
932 (Sized_incremental_binary::got_plt_reader): New function.
933 (Sized_incremental_binary::do_file_is_unchanged): New function.
934 (Sized_incremental_binary::Sized_input_reader): New class.
935 (Sized_incremental_binary::get_input_reader): New function.
936 (Sized_incremental_binary::find_incremental_inputs_sections):
937 Rename do_find_incremental_inputs_sections to this.
938 (Sized_incremental_binary::setup_readers): New function.
939 (Sized_incremental_binary::has_incremental_info_): New data member.
940 (Sized_incremental_binary::inputs_reader_): New data member.
941 (Sized_incremental_binary::symtab_reader_): New data member.
942 (Sized_incremental_binary::relocs_reader_): New data member.
943 (Sized_incremental_binary::got_plt_reader_): New data member.
944 (Sized_incremental_binary::current_input_file_): New data member.
945
a869183f
PP
9462011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
947
948 PR gold/12640
949 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
950 violation.
951
9522011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
953
954 * archive.cc (Archive::include_member): Adjust call to report_object.
955 (Add_archive_symbols::run): Add script_info to call to
956 report_archive_begin.
957 (Lib_group::include_member): Adjust call to report_object.
958 (Add_lib_group_symbols::run): Adjust call to report_object.
959 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
960 blocks. Add object count for script input files.
961 * incremental.cc (Incremental_inputs::report_archive_begin): Add
962 script_info parameter; change all callers.
963 (Incremental_inputs::report_object): Add script_info parameter;
964 change all callers.
965 (Incremental_inputs::report_script): Store backpointer to
966 incremental info entry.
967 (Output_section_incremental_inputs::set_final_data_size): Record
968 additional information for scripts.
969 (Output_section_incremental_inputs::write_info_blocks): Likewise.
970 * incremental.h (Incremental_script_entry::add_object): New function.
971 (Incremental_script_entry::get_object_count): New function.
972 (Incremental_script_entry::get_object): New function.
973 (Incremental_script_entry::objects_): New data member; adjust
974 constructor.
975 (Incremental_inputs::report_archive_begin): Add script_info parameter.
976 (Incremental_inputs::report_object): Add script_info parameter.
977 (Incremental_inputs_reader::get_object_count): New function.
978 (Incremental_inputs_reader::get_object_offset): New function.
979 * options.cc (Input_arguments::add_file): Return reference to
980 new input argument.
981 * options.h (Input_argument::set_script_info): New function.
982 (Input_argument::script_info): New function.
983 (Input_argument::script_info_): New data member; adjust all
984 constructors.
985 (Input_file_group::add_file): Return reference to new input argument.
986 (Input_file_lib::add_file): Likewise.
987 (Input_arguments::add_file): Likewise.
988 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
989 * script.cc (Parser_closure::Parser_closure): Add script_info
990 parameter; adjust all callers.
991 (Parser_closure::script_info): New function.
992 (Parser_closure::script_info_): New data member.
993 (read_input_script): Report scripts earlier to incremental info.
994 (script_add_file): Set script_info in Input_argument.
995 (script_add_library): Likewise.
996 * script.h (Script_options::Script_info): Rewrite class.
997
a869183f 9982011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
999
1000 * archive.cc (Library_base::should_include_member): Move
1001 method here from class Archive.
1002 (Archive::Archive): Initialize base class.
1003 (Archive::should_include_member): Move to base class.
1004 (Archive::do_for_all_unused_symbols): New function.
1005 (Add_archive_symbols::run): Remove redundant access to
1006 incremental_inputs.
1007 (Lib_group::Lib_group): Initialize base class.
1008 (Lib_group::do_filename): New function.
1009 (Lib_group::include_member): Pass pointer to Lib_group to
1010 report_object.
1011 (Lib_group::do_for_all_unused_symbols): New function.
1012 (Add_lib_group_symbols::run): Report archive information for
1013 incremental links.
1014 * archive.h (class Library_base): New base class.
1015 (class Archive): Derive from Library_base.
1016 (Archive::filename): Move to base class.
1017 (Archive::set_incremental_info): Likewise.
1018 (Archive::incremental_info): Likewise.
1019 (Archive::Should_include): Likewise.
1020 (Archive::should_include_member): Likewise.
1021 (Archive::Armap_entry): Remove.
1022 (Archive::Unused_symbol_iterator): Remove.
1023 (Archive::unused_symbols_begin): Remove.
1024 (Archive::unused_symbols_end): Remove.
1025 (Archive::do_filename): New function.
1026 (Archive::do_get_mtime): New function.
1027 (Archive::do_for_all_unused_symbols): New function.
1028 (Archive::task_): Move to base class.
1029 (Archive::incremental_info_): Likewise.
1030 (class Lib_group): Derive from Library_base.
1031 (Lib_group::do_filename): New function.
1032 (Lib_group::do_get_mtime): New function.
1033 (Lib_group::do_for_all_unused_symbols): New function.
1034 (Lib_group::task_): Move to base class.
1035 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1036 function.
1037 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1038 function.
1039 * incremental.cc (Incremental_inputs::report_archive_begin):
1040 Use Library_base; call library's get_mtime; add incremental inputs
1041 entry before members.
1042 (class Unused_symbol_visitor): New class.
1043 (Incremental_inputs::report_archive_end): Use Library_base; use
1044 visitor class to record unused symbols; don't add incremental inputs
1045 entry after members.
1046 (Incremental_inputs::report_object): Use Library_base.
1047 * incremental.h
1048 (Incremental_archive_entry::Incremental_archive_entry): Remove
1049 unused Archive parameter.
1050 (Incremental_inputs::report_archive_begin): Use Library_base.
1051 (Incremental_inputs::report_archive_end): Likewise.
1052 (Incremental_inputs::report_object): Likewise.
1053 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1054 function.
1055 * object.h (Object::for_all_global_symbols): New function.
1056 (Object::do_for_all_global_symbols): New function.
1057 (Sized_relobj::do_for_all_global_symbols): New function.
1058 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1059 function.
1060 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1061 function.
1062
61ab3e40
ILT
10632011-03-27 Ian Lance Taylor <iant@google.com>
1064
1065 * archive.cc (Archive::interpret_header): Return -1 if something
1066 goes wrong. Change callers accordingly.
1067
30e1f9e6
CC
10682011-03-25 Cary Coutant <ccoutant@google.com>
1069
1070 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1071 * testsuite/Makefile.in: Regenerate.
1072
9c793f14
RÁE
10732010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1074
1075 * plugin.cc (get_view): New.
1076 (Plugin::load): Pass get_view to the plugin.
1077 (Plugin_manager::get_view): New.
1078
9312bb0a
ILT
10792011-03-21 Ian Lance Taylor <iant@google.com>
1080
1081 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1082 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1083
7e12ba9e
ST
10842011-03-21 Sriraman Tallam <tmsriram@google.com>
1085
1086 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1087 Change == to -eq.
1088 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1089 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1090 Change == to -eq.
1091 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1092 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1093
fd7a005d
ILT
10942011-03-14 Ian Lance Taylor <iant@google.com>
1095
1096 * script-sections.cc (Sort_output_sections::script_compare):
1097 Rename from is_before, change return type.
1098 (Sort_output_sections::operator()): Adjust accordingly.
1099
ed16fd1b
ILT
11002011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1101
1102 PR gold/12572
1103 * testsuite/odr_violation2.cc: Add comment to make all error line
1104 numbers double digits.
1105 * testsuite/debug_msg.sh: Adjust expected errors.
1106
71ff8986
ILT
11072011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1108
1109 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1110 but mark earlier ones as non-canonical
1111 (offset_to_iterator): Update search target and example
1112 (do_addr2line): Return extra lines in a vector*
1113 (format_file_lineno): Extract from do_addr2line
1114 (one_addr2line): Add vector* out-param
1115 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1116 when a lineno entry appeared last for its instruction
1117 (Dwarf_line_info): Add vector* out-param
1118 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1119 * symtab.cc (Odr_violation_compare): Include the lineno in the
1120 comparison again.
1121 (linenos_from_loc): New. Combine the canonical line for an
1122 address with its other lines.
1123 (True_if_intersect): New. Helper functor to make
1124 std::set_intersection a query.
1125 (detect_odr_violations): Compare sets of lines instead of just
1126 one line for each function. This became less deterministic, but
1127 has fewer false positives.
1128 * symtab.h: Declarations.
1129 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1130 mix an optimized and non-optimized object in the same binary
1131 (odr_violation2.so): Same.
1132 * testsuite/Makefile.in: Regenerate from Makefile.am.
1133 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1134 * testsuite/debug_msg.sh: Update line numbers and add
1135 assertions.
1136 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1137 non-optimized context.
1138 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1139 isn't inlined, and use OdrDerived in an optimized context.
1140 * testsuite/odr_header1.h: Defines OdrDerived, where
1141 optimization will change the
1142 first-instruction-in-the-destructor's file and line number.
1143 * testsuite/odr_header2.h: Defines OdrBase.
1144
a19fefdc
ILT
11452011-03-09 Ian Lance Taylor <iant@google.com>
1146
1147 * fileread.cc (File_read::clear_views): Don't delete the whole
1148 file view.
1149
ecb351e9
ILT
11502011-03-08 Ian Lance Taylor <iant@google.com>
1151
1152 PR gold/12525
1153 * fileread.cc: #include <climits>.
1154 (GOLD_IOV_MAX): Define.
1155 (File_read::read_multiple): Limit number of entries by iov_max.
1156 * fileread.h (class File_read): Always set max_readv_entries to
1157 128.
1158
b821d13c
ILT
11592011-03-07 Ian Lance Taylor <iant@google.com>
1160
1161 PR gold/12525
1162 * options.h (class General_options): Add -dy and -dn.
1163
89243142
CC
11642011-03-02 Cary Coutant <ccoutant@google.com>
1165
1166 * testsuite/script_test_9.t: Add TLS segment.
1167
d0773f31
ILT
11682011-03-02 Simon Baldwin <simonb@google.com>
1169
1170 * configure.ac: Add check for gnu_indirect_function support in
1171 the toolchain building binutils.
1172 * configure: Rebuild.
1173
badc8139
RÁE
11742010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1175
1176 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1177 plugin only symbols.
1178 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1179 in plugin files as not needed in the symbol table.
1180
4cf7a849
ST
11812011-02-11 Sriraman Tallam <tmsriram@google.com>
1182
1183 * output.cc (Output_section::add_input_section): Delay fill
1184 generation for section ordering.
1185
b578bd7d
ILT
11862011-02-09 Ian Lance Taylor <iant@google.com>
1187
1188 PR gold/12316
1189 * object.h (class Sized_relobj): Remove clear_local_symbols.
1190 * reloc.cc (Sized_relobj::do_relocate): Don't call
1191 clear_local_symbols.
1192
84ced98a
RÁE
11932010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1194
1195 * plugin.cc (is_visible_from_outside): Return true for symbols
1196 in the -u option.
1197
55382fb7
ILT
11982011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1199
1200 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1201 filename.
1202
4e271fff
ST
12032011-02-02 Sriraman Tallam <tmsriram@google.com>
1204
1205 * icf.h (is_section_foldable_candidate): Change type of parameter
1206 to std::string.
1207 * icf.cc (Icf::find_identical_sections): Change type of local variable
1208 section_name to be std::string.
1209 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1210
d433c3ac
ILT
12112011-01-25 Ian Lance Taylor <iant@google.com>
1212
1213 * script.cc (script_add_extern): Rewrite to use
1214 add_symbol_reference.
1215
880473a6
DK
12162011-01-25 Doug Kwan <dougkwan@google.com>
1217
d433c3ac 1218 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1219
f30f86fa
ILT
12202011-01-24 Ian Lance Taylor <iant@google.com>
1221
1222 * options.h (class General_options): Accept
1223 --no-detect-odr-violations.
1224
8e51a0b9
ILT
12252011-01-24 Ian Lance Taylor <iant@google.com>
1226
1227 * version.cc (version_string): Bump to 1.11.
1228
0f3b89d8
ILT
12292011-01-24 Ian Lance Taylor <iant@google.com>
1230
1231 * plugin.cc (class Plugin_rescan): Define new class.
1232 (Plugin_manager::claim_file): Set any_claimed_.
1233 (Plugin_manager::save_archive): New function.
1234 (Plugin_manager::save_input_group): New function.
1235 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1236 necessary.
1237 (Plugin_manager::new_undefined_symbol): New function.
1238 (Plugin_manager::rescan): New function.
1239 (Plugin_manager::rescannable_defines): New function.
1240 (Plugin_manager::add_input_file): Set any_added_.
1241 * plugin.h (class Plugin_manager): define new fields rescannable_,
1242 undefined_symbols_, any_claimed_, and any_added_. Declare
1243 Plugin_rescan as friend. Declare new functions.
1244 (Plugin_manager::Rescannable): Define type.
1245 (Plugin_manager::Rescannable_list): Define type.
1246 (Plugin_manager::Undefined_symbol_list): Define type.
1247 (Plugin_manager::Plugin_manager): Initialize new fields.
1248 * archive.cc (Archive::defines_symbol): New function.
1249 (Add_archive_symbols::run): Pass archive to plugins if any.
1250 * archive.h (class Archive): Declare defines_symbol.
1251 * readsyms.cc (Input_group::~Input_group): New function.
1252 (Finish_group::run): Pass input_group to plugins if any.
1253 * readsyms.h (class Input_group): Declare destructor.
1254 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1255 any.
1256
3bb951e5
ILT
12572011-01-10 Ian Lance Taylor <iant@google.com>
1258
1259 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1260 section as relro.
1261 (Layout::set_segment_offsets): Reset increase_relro before calling
1262 set_section_addresses a second time.
1263
0aa45fac
CC
12642011-01-04 Cary Coutant <ccoutant@google.com>
1265
1266 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1267 sections before NOBITS sections.
1268
0db46eb4
L
12692011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1270
1271 * version.cc (print_version): Update copyright to 2011.
1272
829c9745
CC
12732010-12-23 Cary Coutant <ccoutant@google.com>
1274
1275 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1276 of OS to this->add. Add OD parameter to second form of the function.
1277
7500420b
ILT
12782010-12-20 Ian Lance Taylor <iant@google.com>
1279
1280 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1281 second of two consecutive entries with same offset.
1282
f8e9a930
RW
12832010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1284
1285 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1286 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1287 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1288 to avoid unneeded links against $(LDADD).
1289 * testsuite/Makefile.in: Regenerate.
1290
2fbb4320
ILT
12912010-12-15 Ian Lance Taylor <iant@google.com>
1292
1293 PR gold/12324
1294 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1295 for R_X86_64_32 and R_X86_64_PC32.
1296 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1297 ver_matching_def_pic.o.
1298 (ver_matching_def_pic.o): New target.
1299
fedb228d
RW
13002010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1301
1302 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1303 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1304 Move definition before File_read::View member definitions.
1305 (File_read::View::~View): Initialize and hold lock before
1306 updating current_mapped_bytes.
1307
9b547ce6
RW
13082010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1309
1310 * dwarf_reader.cc: Remove outdated comment.
1311 * gold-threads.cc: Fix typo in error message.
1312 * archive.cc: Fix typos in comments.
1313 * archive.h: Likewise.
1314 * arm-reloc-property.cc: Likewise.
1315 * arm-reloc-property.h: Likewise.
1316 * arm-reloc.def: Likewise.
1317 * arm.cc: Likewise.
1318 * attributes.h: Likewise.
1319 * cref.cc: Likewise.
1320 * ehframe.cc: Likewise.
1321 * fileread.h: Likewise.
1322 * gold.h: Likewise.
1323 * i386.cc: Likewise.
1324 * icf.cc: Likewise.
1325 * incremental.h: Likewise.
1326 * int_encoding.cc: Likewise.
1327 * layout.h: Likewise.
1328 * main.cc: Likewise.
1329 * merge.h: Likewise.
1330 * object.cc: Likewise.
1331 * object.h: Likewise.
1332 * options.cc: Likewise.
1333 * readsyms.cc: Likewise.
1334 * reduced_debug_output.cc: Likewise.
1335 * reloc.cc: Likewise.
1336 * script-sections.cc: Likewise.
1337 * sparc.cc: Likewise.
1338 * symtab.h: Likewise.
1339 * target-reloc.h: Likewise.
1340 * target.cc: Likewise.
1341 * target.h: Likewise.
1342 * timer.cc: Likewise.
1343 * timer.h: Likewise.
1344 * x86_64.cc: Likewise.
1345
83e17bd5
CC
13462010-12-09 Cary Coutant <ccoutant@google.com>
1347
1348 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1349 stack.
1350 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1351 parameter; change all callers.
1352 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1353 * options.h (warn_execstack): New option.
1354
017257f8
DK
13552010-12-07 Doug Kwan <dougkwan@google.com>
1356
1357 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1358 like function call relocations.
1359
c20cbc06
ILT
13602010-12-07 Ian Lance Taylor <iant@google.com>
1361
1362 * archive.cc (Archive::get_elf_object_for_member): Permit
1363 punconfigured to be NULL.
1364 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1365 (Archive::include_member): Pass NULL to get_elf_object_for_member
1366 if we searched for the archive and this is the first included
1367 object.
1368
4dbfafcc
ILT
13692010-12-01 Ian Lance Taylor <iant@google.com>
1370
1371 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1372 track_relocs_type_ field.
1373 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1374 Set track_relocs_type_.
1375 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1376 contents when using RELA relocs.
1377 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1378 reloc_map_.
1379 * reloc.cc (Track_relocs::next_addend): New function.
1380 * reloc.h (class Track_relocs): Declare next_addend.
1381
e5e19edd
ILT
13822010-12-01 Ian Lance Taylor <iant@google.com>
1383
1384 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1385 virtual destructor.
1386
9a5ce24c
ILT
13872010-12-01 Ian Lance Taylor <iant@google.com>
1388
1389 * README: Update compilers known to work and fail.
1390
c7791212
NC
13912010-11-23 Matthias Klose <doko@ubuntu.com>
1392
1393 * configure.in: For --enable-gold, handle value `default' instead of
1394 `both*'. Always install ld as ld.bfd, install as ld if gold is
1395 not the default.
1396 * configure: Regenerate.
1397
0ad220c9
DK
13982010-11-18 Doug Kwan <dougkwan@google.com>
1399
1400 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1401 and right_alignment to be zero. Store result alignment only if it is
1402 greater than existing alignment.
1403
ab8056e0
CC
14042010-11-16 Cary Coutant <ccoutant@google.com>
1405
1406 PR gold/12220
1407 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1408 Check for ".zdebug_line".
1409
fd064a5b
CC
14102010-11-16 Doug Kwan <dougkwan@google.com>
1411 Cary Coutant <ccoutant@google.com>
1412
1413 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1414 by reference; adjust all callers.
1415 * output.cc (Output_segment::set_section_addresses): Adjust references
1416 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1417 list is empty.
1418 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1419 end at page boundary.
1420
6fc6ea19
CC
14212010-11-16 Cary Coutant <ccoutant@google.com>
1422
1423 PR gold/12220
1424 * layout.cc (Layout::choose_output_section): Transform names of
1425 compressed sections even when using a script with a SECTIONS clause.
1426 (Layout::output_section_name): Remove code to transform
1427 compressed debug section names.
1428 * output.cc (Output_section::add_input_section): Use uncompressed
1429 section size when tracking input sections.
1430
95a2c8d6
RS
14312010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1432
1433 * symtab.h (Symbol::NON_PIC_REF): Remove.
1434 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1435 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1436 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1437 (Symbol::use_plt_offset): Take a flags argument and pass it
1438 directly to needs_dynamic_reloc. Restrict check for undefined
1439 weak symbols to function calls.
1440 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1441 (Target_arm::Scan::global): Use it.
1442 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1443 (Target_arm::Relocate::relocate): Likewise.
1444 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1445 parameter with an r_type parameter. Use get_reference_flags
1446 to get the flags.
1447 (Target_arm::Relocate::relocate): Update accordingly.
1448 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1449 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1450 (Target_i386::Scan::global): Likewise.
1451 (Target_i386::Relocate::relocate): Likewise.
1452 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1453 parameter with an r_type parameter. Use get_reference_flags
1454 to get the flags.
1455 (Target_i386::Relocate::relocate): Update accordingly.
1456 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1457 (Target_powerpc::Scan::global): Use it.
1458 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1459 (Target_powerpc::Relocate::relocate): Likewise.
1460 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1461 (Target_sparc::Scan::global): Use it.
1462 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1463 (Target_sparc::Relocate::relocate): Likewise.
1464 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1465 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1466 (Target_x86_64::Scan::global): Likewise.
1467 (Target_x86_64::Relocate::relocate): Likewise.
1468
f625ae50
DK
14692010-11-08 Doug Kwan <dougkwan@google.com>
1470 Cary Coutant <ccoutant@google.com>
1471
1472 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1473 (Arm_exidx_merge_section::section_contents_): New data member.
1474 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1475 (Arm_input_section::~Arm_input_section): De-allocate memory.
1476 (Arm_input_section::original_contents_): New data member.
1477 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1478 in parameters instead of calling Object::section_contents without
1479 locking.
1480 (Arm_output_section::group_section): New parameter TASK. Pass it
1481 to callees that need locking objects.
1482 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1483 to lock EXIDX input sections. Fix a formatting issue. Call
1484 Arm_exidx_merged_section::build_contents to create merged section
1485 contents.
1486 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1487 to lock object of stub table owner.
1488 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1489 TEXT_SIZE to initialize data member TEXT_SIZE_.
1490 (Arm_exidx_input_section::addralign): Fix typo in comment.
1491 (Arm_exidx_input_section::text_size): New method.
1492 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1493 that require locking objects. Lock objects before scanning for stubs
1494 and updating local symbols.
1495 (Arm_input_section<big_endian>::init): Copy contents of original
1496 input section.
1497 (Arm_input_section<big_endian>::do_write): Use saved contents of
1498 original input section instead of calling Object::section_contents
1499 without locking.
1500 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1501 size without calling Object::section_size().
1502 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1503 for size. Allocate a buffer for merged EXIDX entries.
1504 (Arm_exidx_merged_section::build_contents): New method.
1505 (Arm_exidx_merged_section::do_write): Move merge section contents
1506 building code to Arm_exidx_merged_section::build_contetns. Write
1507 out contetns in buffer instead of building it on the fly.
1508 (Arm_relobj::make_exidx_input_section): Also pass text section size
1509 to Arm_exidx_input_section constructor.
1510 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1511 (Arm_dynobj::do_read_symbols): Fix memory leak.
1512 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1513 * target.h: (class Task): Add forward declaration.
1514 (Target::relax): Add new parameter TASK and pass it to
1515 Target::do_relax().
1516 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1517
5f9bcf58
CC
15182010-11-05 Cary Coutant <ccoutant@google.com>
1519
1520 PR gold/10708
1521 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1522 object when reading from the file.
1523 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1524 second layout pass.
1525 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1526 when reading section contents.
1527 (get_section_contents): Likewise.
1528 (icf::find_identical_sections): Likewise.
1529 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1530 object when reading from the file.
1531 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1532 the object when doing deferred section layout.
1533
e597fa08
NC
15342010-11-03 Nick Clifton <nickc@redhat.com>
1535
1536 PR gold/12001
1537 * script.h (class Symbol_assignment: name): New member. Returns
1538 the name of the symbol.
1539 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1540 Returns true if the given symbol name is on the list of
1541 assignments wating to be processed.
1542 * archive.cc (should_incldue_member): If the symbol is undefined,
1543 check to see if it is on the list of symbols pending assignment.
1544
3f9a3278
ILT
15452010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1546
1547 * script-sections.cc (Script_sections::find_memory_region): Check
1548 for a NULL output section pointer.
1549
d06fb4d1
DK
15502010-10-29 Doug Kwan <dougkwan@google.com>
1551
1552 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1553 Output_section::add_relaxed_input_section.
1554 * output.cc (Output_section::add_relaxed_input_section): Add new
1555 arguments LAYOUT and NAME. Set section order index.
1556 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1557 Copy section order index.
1558 * output.h (Output_section::add_relaxed_input_section): Add new
1559 arguments LAYOUT and NAME.
1560
90e24de5
ILT
15612010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1562
1563 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1564 NATIVE_OR_CROSS_LINKER.
1565 * testsuite/Makefile.in: Regenerate.
1566
c9484ea5
DK
15672010-10-20 Doug Kwan <dougkwan@google.com>
1568
1569 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1570 without SHF_LINK_ORDER flags.
1571 * layout.cc (Layout::choose_output_section): Do not filter
1572 SHF_LINK_ORDER flag in a relocatable link.
1573
5bc2f5be
CC
15742010-10-17 Cary Coutant <ccoutant@google.com>
1575
1576 * output.h (Output_segment::set_section_addresses): Change function
1577 signature. Update all callers.
1578 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1579 sections.
1580 (Output_segment::set_section_addresses): Align after last TLS
1581 section. Add padding before last relro section instead of after.
1582
0c91cf04
DK
15832010-10-17 Doug Kwan <dougkwan@google.com>
1584
1585 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1586 GOT output section to be writable.
1587
8c21d9d3
CC
15882010-10-14 Cary Coutant <ccoutant@google.com>
1589
1590 * debug.h (DEBUG_INCREMENTAL): New flag.
1591 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1592 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1593 mode.
1594 * incremental.cc (report_command_line): Ignore all forms of
1595 --incremental.
1596 * layout.cc (Layout::Layout): Check parameters for incremental link
1597 mode.
1598 * options.cc (General_options::parse_incremental): New function.
1599 (General_options::parse_no_incremental): New function.
1600 (General_options::parse_incremental_full): New function.
1601 (General_options::parse_incremental_update): New function.
1602 (General_options::incremental_mode_): New data member.
1603 (General_options::finalize): Check incremental_mode_.
1604 * options.h (General_options): Update help text for --incremental.
1605 Add --no-incremental, --incremental-full, --incremental-update.
1606 (General_options::Incremental_mode): New enum type.
1607 (General_options::incremental_mode): New function.
1608 (General_options::incremental_mode_): New data member.
1609 * parameters.cc (Parameters::incremental_mode_): New data member.
1610 (Parameters::set_options): Set incremental_mode_.
1611 (Parameters::set_incremental_full): New function.
1612 (Parameters::incremental): New function.
1613 (Parameters::incremental_update): New function.
1614 (set_parameters_incremental_full): New function.
1615 * parameters.h (Parameters::set_incremental_full): New function.
1616 (Parameters::incremental): New function.
1617 (Parameters::incremental_update): New function.
1618 (Parameters::incremental_mode_): New data member.
1619 (set_parameters_incremental_full): New function.
1620 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1621 incremental link mode.
1622 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1623 (Sized_relobj::do_relocate_sections): Likewise.
1624 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1625 option.
1626 * testsuite/Makefile.in: Regenerate.
1627 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1628
bb32aa18 16292010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1630
1631 * script-sections.h (class Script_sections): Make
1632 Sections_elements typedef public.
1633 * script-sections.cc (class Sort_output_sections): Add elements_
1634 field. Add constructor which sets it; change all callers.
1635 (Sort_output_sections::is_before): New function.
1636 (Sort_output_sections::operator()): Call is_before.
1637 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1638 conditional.
1639 * testsuite/script_test_10.sh: New test. Test script section
1640 order.
1641 * testsuite/script_test_10.t: Likewise.
1642 * testsuite/script_test_10.s: Likewise.
1643 * testsuite/Makefile.am: Wrap the cross linker tests and the
1644 common tests into NATIVE_OR_CROSS_LINKER.
1645 (check_SCRIPTS): Add script_test_10.sh.
1646 (check_DATA): Add script_test_10.stdout.
1647 (script_test_10.o, script_test_10): New targets.
1648 (script_test_10.stdout): New target.
1649 * configure, testsuite/Makefile.in: Regenerate.
1650
3cef7179
ILT
16512010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1652
1653 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
1654 error for the deprecated relocations.
1655 (Target_arm::Scan::global): Likewise.
1656 (Target_arm::Relocate::relocate): Likewise.
1657
7411e9a8
RS
16582010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
1659
1660 * fileread.cc (Input_file::find_file): Initialize *found_name
1661 and *namep when using the fallback search for case 4.
1662
6a9da32a
CC
16632010-10-11 Cary Coutant <ccoutant@google.com>
1664
1665 * options.h (class General_options): Redefine -z lazy as an alias for
1666 the negation of -z now.
1667
ac897c20
ILT
16682010-10-11 Ian Lance Taylor <iant@google.com>
1669
1670 * resolve.cc (symbol_to_bits): Report the value of the unsupported
1671 binding.
1672
ea5cae92
NC
16732010-10-06 Nick Clifton <nickc@redhat.com>
1674
1675 * script-sections.cc(class Memory_region): Remove
1676 current_lma_offset_ field. Rename current_vma_offset_ to
1677 current_offset_. Add last_section_ field.
1678 (Memory_region::get_current_vma_address): Rename to
1679 get_current_address.
1680 (Memory_region::get_current_lma_address): Delete.
1681 (Memory_region::increment_vma_offset): Rename to
1682 increment_offset.
1683 (Memory_region::increment_lma_offset): Delete.
1684 (Memory_region::attributes_compatible): New method. Returns
1685 true if the provided section is compatible with the region.
1686 (Memory_region::get_last_section): New method. Returns the last
1687 section to use the region.
1688 (Memory_region::set_last_section): New method. Stores the last
1689 section to use the region.
1690 (Script_sections::block_in_region): New method. Returns true if
1691 a block of memory is contained within a region.
1692 (Script_sections::find_memory_region): New method. Locates a
1693 memory region to be used to set a VMA or LMA address.
1694 (Output_section_definition::set_section_addresses): Add code to
1695 check for addresses set by memory regions.
1696 (Output_segment::set_section_addresses): Remove memory region
1697 walking code.
1698 (Script_sections::create_segment): Add a warning if a header
1699 segment is created outside of any region.
1700 * script-sections.h (class Script_sections): Add prototypes for
1701 find_memory_region and block_in_region methods.
1702 * testsuite/memory_test.s: Use .long instead of .word.
1703 * testsuite/memory_test.t: Add some more output sections.
1704 * testsuite/memory_test.sh: Update expected output.
1705
a9bfd952
DK
17062010-10-02 Doug Kwan <dougkwan@google.com>
1707
1708 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
1709 defintion to symtab.h
1710 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
1711 declaration to defintion.
1712
bacff3ab
NC
17132010-10-01 Nick Clifton <nickc@redhat.com>
1714
1715 * expression.cc (eval): Replace dummy argument with NULL.
1716 (eval_maybe_dot): Check for a NULL result section pointer.
1717 (Symbol_expression::value): Likewise.
1718 (Dot_expression::value): Likewise.
1719 (BINARY_EXPRESSION): Likewise.
1720 (Max_expression::value): Likewise.
1721 (Min_expression::value): Likewise.
1722 (Absolute_expression::value): Likewise.
1723 (Addr_expression::value_from_output_section): Likewise.
1724 (Loaddddr_expression::value_from_output_section): Likewise.
1725 (Segment_start_expression::value): Likewise.
1726 * script-sections.cc
1727 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
1728 argument with NULL.
1729 (Sections_elememt_dot_assignment::set_section_addresses):
1730 Likewise.
1731 (Output_data_expression::do_write_to_buffer): Likewise.
1732 (Output_section_definition::finalize_symbols): Likewise.
1733 (Output_section_definition::set_section_addresses): Likewise.
1734
f81bc8b5
DK
17352010-09-30 Doug Kwan <dougkwan@google.com>
1736
1737 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
1738
c95e9f27
ST
17392010-09-28 Sriraman Tallam <tmsriram@google.com>
1740
1741 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 1742 function.
c95e9f27
ST
1743 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
1744 virtual function.
1745 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
1746 virtual function.
1747 * icf.cc (get_section_contents): Inline merge sections only when
1748 target allows it.
1749
3cac54d2
RW
17502010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1751
1752 * configure: Regenerate.
1753
2904037a
ILT
17542010-09-17 Ian Lance Taylor <iant@google.com>
1755
1756 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
1757 * testsuite/Makefile.am (memory_test.o): New target.
1758 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
1759 memory_test.t.
1760 * testsuite/Makefile.in: Rebuild.
2904037a 1761
bca7fb63
DK
17622010-09-17 Doug Kwan <dougkwan@google.com>
1763
1764 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
1765 defintion if relocation uses GOT entries of the symbol.
1766 * testsuite/icf_safe_test.sh: Fix test.
1767 * testsuite/icf_safe_so_test.sh: Fix test.
1768
4ef28648
CC
17692010-09-16 Cary Coutant <ccoutant@google.com>
1770
1771 * script_sections.cc (class Memory_region): Remove "NULL" from
1772 vector initializations.
1773
793990de
CC
17742010-09-15 Cary Coutant <ccoutant@google.com>
1775
1776 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
1777 Resolve forwarding symbols.
1778
81e015e2
DK
17792010-09-15 Doug Kwan <dougkwan@google.com>
1780
1781 * gold/testsuite/script_test_3.t: Add ARM special sections.
1782 * gold/testsuite/script_test_4.t: Same.
1783 * gold/testsuite/script_test_5.t: Same.
1784 * gold/testsuite/script_test_6.t: Same.
1785 * gold/testsuite/script_test_7.t: Same.
1786 * gold/testsuite/script_test_7.t: Same.
1787 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
1788
36171d64
CC
17892010-09-14 Cary Coutant <ccoutant@google.com>
1790
1791 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
1792 (Target_x86_64::Relocate::relocate_tls): Replace check for
1793 saw_tls_block_reloc_ with test for executable section.
1794
d89051bd
CC
17952010-09-12 Cary Coutant <ccoutant@google.com>
1796
1797 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
1798 position-independent executables to shared libraries need dynamic
1799 relocations.
1800 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
1801 position-independent executables.
1802 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
1803 * testsuite/Makefile.in: Regenerate.
1804
fca41f0f
NC
18052010-09-10 Nick Clifton <nickc@redhat.com>
1806
1807 PR gold/11997
1808 * testsuite/memory_test.t: Discard any sections that are not
1809 needed.
1810
6695e4b3
L
18112010-09-09 H.J. Lu <hongjiu.lu@intel.com>
1812
1813 PR gold/11996
1814 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
1815 "This::" to work around a bug in gcc 4.2.
1816
1817 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
1818
0f72bf6f
RÁE
18192010-09-09 Rafael Espindola <espindola@google.com>
1820
1821 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
1822 sections with different PF_X flags in the same segment.
1823 (Layout::find_first_load_seg): Search all segments to find the first
1824 one.
1825 * options.h (rosegment): New.
1826
18272010-09-08 Rafael Espindola <espindola@google.com>
a6577478 1828
05a79166 1829 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 1830
aa98ff75
DK
18312010-09-08 Doug Kwan <dougkwan@google.com>
1832
1833 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
1834 (Arm_relobj::do_relocate_sections): Add new parameter for output
1835 file to match the parent.
1836 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
1837 of local symbols instead of input values. Update code to track
1838 changes in gold::relocate_section.
1839 * object.cc (Sized_relobj::compute_final_local_value): New methods.
1840 (Sized_relobj::compute_final_local_value_internal): New methods.
1841 (Sized_relobj::do_finalize_local_symbols): Move code from loop
1842 body into private version of Sized_relobj::compute_final_local_value.
1843 Call the inline method.
1844 * object.h (Symbol_value::Symbol_value): Define destructor. Free
1845 merged symbol value if there is one.
1846 (Symbol_value::has_output_value): New method defintiion.
1847 (Sized_relobj::Compute_final_local_value_status): New enum type.
1848 (Sized_relobj::compute_final_local_value): New methods.
1849 (Sized_relobj::compute_final_local_value_internal): New methods.
1850 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
1851 and arm_cortex_a8.sh.
1852 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
1853 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
1854 New tests.
1855 * Makefile.in: Regenerate.
1856 * testsuite/arm_bl_out_of_range.s: Update test.
1857 * testsuite/thumb_bl_out_of_range.s: Ditto.
1858 * testsuite/thumb_blx_out_of_range.s: Ditto.
1859 * testsuite/arm_branch_out_of_range.sh: New file.
1860 * testsuite/arm_cortex_a8.sh: Ditto.
1861 * testsuite/arm_cortex_a8_b.s: Ditto.
1862 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
1863 * testsuite/arm_cortex_a8_b_local.s: Ditto.
1864 * testsuite/arm_cortex_a8_bl.s: Ditto.
1865 * testsuite/arm_cortex_a8_blx.s: Ditto.
1866 * testsuite/arm_cortex_a8_local.s: Ditto.
1867 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
1868 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
1869
05a79166
L
18702010-09-08 Rafael Espindola <espindola@google.com>
1871
1872 * Makefile.am (memory_test.stdout): Run readelf with -W.
1873 * Makefile.in: Regenerate.
1874 * testsuite/memory_test.sh: Make the regexps accept both 32 and
1875 64 bit output.
1876
33dbc701
RÁE
18772010-09-08 Rafael Espindola <espindola@google.com>
1878
1879 * script-sections.cc (Script_sections::add_memory_region): Convert
1880 field precision to int.
1881 * script.cc (script_set_section_region, script_set_section_region):
1882 Convert field precision to int.
1883
731ca54a
RÁE
18842010-09-08 Rafael Espindola <espindola@google.com>
1885
1886 * arm.cc (do_finalize_sections): Create the __exidx_start and
1887 __exdix_end symbols even when the section is missing.
1888
7f8cd844
NC
18892010-09-08 Nick Clifton <nickc@redhat.com>
1890
1891 * README: Remove claim that MEMORY is not supported.
1892 * expression.cc (script_exp_function_origin)
1893 (script_exp_function_length): Move from here to ...
1894 * script.cc: ... here.
1895 (script_set_section_region, script_add_memory)
1896 (script_parse_memory_attr, script_include_directive): New
1897 functions.
1898 * script-sections.cc
1899 (class Memory_region): New class.
1900 (class Output_section_definition): Add set_memory_region,
1901 set_section_vma, set_section_lma and get_section_name methods.
1902 (class Script_Sections): Add add_memory_region,
1903 find_memory_region, find_memory_region_origin,
1904 find_memory_region_length and set_memory_region methods.
1905 Have set_section_addresses method walk the list of set memory
1906 regions.
1907 Extend the print methos to display memory regions.
1908 * script-sections.h: Add prototypes for new methods.
1909 Add enum for MEMORY region attributes.
1910 * yyscript.y: Add support for parsing MEMORY regions.
1911 * script-c.h: Add prototypes for new functions.
1912 * testsuite/Makefile.am: Add test of MEMORY region functionality.
1913 * testsuite/Makefile.in: Regenerate.
1914 * testsuite/memory_test.sh: New script.
1915 * testsuite/memory_test.s: New assembler source file.
1916 * testsuite/memory_test.t: New linker script.
1917
a4649286
DK
19182010-08-27 Doug Kwan <dougkwan@google.com>
1919
1920 * gold/resolve.cc (Symbol_table::should_override): Let a weak
1921 reference override an existing dynamic weak reference.
1922 * testsuite/Makefile.am: Add new test dyn_weak_ref.
1923 * testsuite/Makefile.in: Regenerate.
1924 * testsuite/dyn_weak_ref.sh: New file.
1925 * testsuite/dyn_weak_ref_1.c: Ditto.
1926 * testsuite/dyn_weak_ref_2.c: Ditto.
1927
b56648ad
ILT
19282010-08-27 Ian Lance Taylor <iant@google.com>
1929
1930 * incremental.h (class Incremental_input_entry): Add virtual
1931 destructor.
1932
809313cb
ILT
19332010-08-27 Ian Lance Taylor <iant@google.com>
1934
1935 * testsuite/start_lib_test_3.c: Mark t3 as used.
1936
11e32464
NC
19372010-08-27 Nick Clifton <nickc@redhat.com>
1938
1939 * options.cc (version_script): Fix small typo in previous
1940 whitespace tidyup.
1941
ca09d69a
NC
19422010-08-25 Nick Clifton <nickc@redhat.com>
1943
1944 * archive.cc: Formatting fixes: Remove whitespace between
1945 typename and following asterisk. Remove whitespace between
1946 function name and opening parenthesis.
1947 * archive.h: Likewise.
1948 * arm.cc: Likewise.
1949 * attributes.cc: Likewise.
1950 * attributes.h: Likewise.
1951 * common.cc: Likewise.
1952 * copy-relocs.cc: Likewise.
1953 * dirsearch.h: Likewise.
1954 * dynobj.cc: Likewise.
1955 * ehframe.cc: Likewise.
1956 * ehframe.h: Likewise.
1957 * expression.cc: Likewise.
1958 * fileread.cc: Likewise.
1959 * fileread.h: Likewise.
1960 * gc.h: Likewise.
1961 * gold-threads.cc: Likewise.
1962 * gold.cc: Likewise.
1963 * i386.cc: Likewise.
1964 * icf.h: Likewise.
1965 * incremental-dump.cc: Likewise.
1966 * incremental.cc: Likewise.
1967 * layout.cc: Likewise.
1968 * layout.h: Likewise.
1969 * main.cc: Likewise.
1970 * merge.cc: Likewise.
1971 * merge.h: Likewise.
1972 * object.cc: Likewise.
1973 * object.h: Likewise.
1974 * options.cc: Likewise.
1975 * options.h: Likewise.
1976 * output.cc: Likewise.
1977 * output.h: Likewise.
1978 * plugin.cc: Likewise.
1979 * plugin.h: Likewise.
1980 * powerpc.cc: Likewise.
1981 * reloc.cc: Likewise.
1982 * script-c.h: Likewise.
1983 * script-sections.cc: Likewise.
1984 * script.cc: Likewise.
1985 * stringpool.cc: Likewise.
1986 * symtab.cc: Likewise.
1987 * symtab.h: Likewise.
1988 * target.cc: Likewise.
1989 * timer.cc: Likewise.
1990 * timer.h: Likewise.
1991 * version.cc: Likewise.
1992 * x86_64.cc: Likewise.
1993
b8fa8750
NC
19942010-08-24 Nick Clifton <nickc@redhat.com>
1995
1996 PR 11899
1997 * layout.cc (segment_precedes): Sort segments by their physical
1998 addresses, if they have been set.
1999
9919d93b
CC
20002010-08-23 Cary Coutant <ccoutant@google.com>
2001
2002 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2003 symbols data.
2004 (Lib_group::include_member): Unlock object after deleting its
2005 symbols data.
2006 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2007 the bug fixed here.
2008
97b4be1c
CC
20092010-08-19 Neil Vachharajani <nvachhar@google.com>
2010 Cary Coutant <ccoutant@google.com>
2011
2012 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2013 constructor, and set_blocker.
2014 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2015 readsyms_blocker_.
2016 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2017 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2018 * testsuite/Makefile.am (start_lib_test): New test case.
2019 * testsuite/Makefile.in: Regenerate.
2020 * testsuite/start_lib_test_main.c: New file.
2021 * testsuite/start_lib_test_1.c: New file.
2022 * testsuite/start_lib_test_2.c: New file.
2023 * testsuite/start_lib_test_3.c: New file.
2024
dd0b1884
ILT
20252010-08-19 Ian Lance Taylor <iant@google.com>
2026
2027 * Makefile.in: Rebuild with automake 1.11.1.
2028 * aclocal.m4: Likewise.
2029 * testsuite/Makefile.in: Likewise.
2030
7223e9ca
ILT
20312010-08-19 Ian Lance Taylor <iant@google.com>
2032
2033 PR 10893
2034 * i386.cc (class Output_data_plt_i386): Update declarations.
2035 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2036 local_ifuncs_ fields.
2037 (Target_i386::do_plt_section_for_global): New function.
2038 (Target_i386::do_plt_section_for_local): New function.
2039 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2040 parameter; change all callers. Initialize global_ifuncs_ and
2041 local_ifuncs_. If doing a static link define __rel_iplt_start and
2042 __rel_iplt_end.
2043 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2044 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2045 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2046 symbols.
2047 (Target_i386::make_plt_section): New function, broken out of
2048 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2049 (Target_i386::make_plt_entry): Call make_plt_section.
2050 (Target_i386::make_local_ifunc_plt_entry): New function.
2051 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2052 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2053 R_386_IRELATIVE to switch.
2054 (Target_i386::Scan::global): Likewise.
2055 (Target_i386::Relocate::relocate): Likewise.
2056 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2057 switch.
2058 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2059 (Target_x86_64::do_plt_section_for_global): New function.
2060 (Target_x86_64::do_plt_section_for_local): New function.
2061 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2062 parameter; change all callers. If doing a static link define
2063 __rela_iplt_start and __rela_iplt_end.
2064 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2065 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2066 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2067 to point to .plt.
2068 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2069 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2070 switch.
2071 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2072 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2073 R_X86_64_IRELATIVE to switch.
2074 (Target_x86_64::Scan::global): Likewise.
2075 (Target_x86_64::Relocate::relocate): Likewise.
2076 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2077 switch.
2078 * target.h (class Target): Add plt_section_for_global and
2079 plt_section_for_local functions. Add do_plt_section_for_global
2080 and do_plt_section_for_local virtual functions.
2081 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2082 clarifying comments.
2083 (Symbol::use_plt_offset): Handle IFUNC symbol.
2084 * object.cc (Sized_relobj::Sized_relobj): Initialize
2085 local_plt_offsets_.
2086 (Sized_relobj::local_has_plt_offset): New function.
2087 (Sized_relobj::local_plt_offset): New function.
2088 (Sized_relobj::set_local_plt_offset): New function.
2089 (Sized_relobj::do_count): Handle IFUNC symbol.
2090 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2091 a bit away from input_shndx_ field. Add set_is_func_symbol and
2092 is_ifunc_symbol functions.
2093 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2094 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2095 local_plt_offsets_ field.
2096 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2097 * output.h (class Output_section_data): Add non-const
2098 output_section function.
2099 (class Output_data_got): Update declarations.
2100 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2101 Add use_plt_offset parameter to global and local constructors.
2102 Change all callers. Change local_sym_index_ field to 31 bits.
2103 Change GSYM_CODE and CONSTANT_CODE accordingly.
2104 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2105 doing a static link don't set sh_link field.
2106 (Output_data_got::Got_entry::write): Use PLT offset if
2107 appropriate.
2108 (Output_data_got::add_global_plt): New function.
2109 (Output_data_got::add_local_plt): New function.
2110 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2111 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2112 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2113 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2114 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2115 IFUNC conditional.
2116 * testsuite/ifunc-sel.h: New file.
2117 * testsuite/ifuncmain1.c: New file.
2118 * testsuite/ifuncmain1vis.c: New file.
2119 * testsuite/ifuncmod1.c: New file.
2120 * testsuite/ifuncdep2.c: New file.
2121 * testsuite/ifuncmain2.c: New file.
2122 * testsuite/ifuncmain3.c: New file.
2123 * testsuite/ifuncmod3.c: New file.
2124 * testsuite/ifuncmain4.c: New file.
2125 * testsuite/ifuncmain5.c: New file.
2126 * testsuite/ifuncmod5.c: New file.
2127 * testsuite/ifuncmain6pie.c: New file.
2128 * testsuite/ifuncmod6.c: New file.
2129 * testsuite/ifuncmain7.c: New file.
2130 * configure, testsuite/Makefile.in: Rebuild.
2131
56f75c03
ILT
21322010-08-18 Ian Lance Taylor <iant@google.com>
2133
2134 * incremental.cc
2135 (Output_section_incremental_inputs::write_input_files): Add cast
2136 to avoid signed/unsigned comparison warning.
2137 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2138
55455f89
CC
21392010-08-12 Cary Coutant <ccoutant@google.com>
2140
2141 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2142
e2054bcb
ILT
21432010-08-13 Ian Lance Taylor <iant@google.com>
2144
2145 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2146
74f67560
DK
21472010-08-12 Cary Coutant <ccoutant@google.com>
2148 Doug Kwan <dougkwan@google.com>
2149
2150 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2151 defintion overrides non-weak undef, remember that the original undef
2152 is not weak.
2153 * symtab.cc (Symbol_table::sized_write_global): For undef without
2154 an original weak binding, set binding to global in output.
2155 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2156 * testsuite/Makefile.in: Regenerate.
2157 * testsuite/strong_ref_weak_def.sh: New file.
2158 * testsuite/strong_ref_weak_def_1.c: Ditto.
2159 * testsuite/strong_ref_weak_def_2.c: Ditto.
2160
d1238d12
CC
21612010-08-12 Cary Coutant <ccoutant@google.com>
2162
2163 * testsuite/incremental_test.sh: Rewrite.
2164 * testsuite/incremental_test_1.c: Rewrite.
2165 * testsuite/incremental_test_2.c: Rewrite.
2166
0e70b911
CC
21672010-08-12 Cary Coutant <ccoutant@google.com>
2168
2169 * arm.cc (Target_arm::got_size): Add const.
2170 (Target_arm::got_entry_count): New function.
2171 (Target_arm::plt_entry_count): New function.
2172 (Target_arm::first_plt_entry_offset): New function.
2173 (Target_arm::plt_entry_size): New function.
2174 (Output_data_plt_arm::entry_count): New function.
2175 (Output_data_plt_arm::first_plt_entry_offset): New function.
2176 (Output_data_plt_arm::get_plt_entry_size): New function.
2177 * i386.cc (Target_i386::got_size): Add const.
2178 (Target_i386::got_entry_count): New function.
2179 (Target_i386::plt_entry_count): New function.
2180 (Target_i386::first_plt_entry_offset): New function.
2181 (Target_i386::plt_entry_size): New function.
2182 (Output_data_plt_i386::entry_count): New function.
2183 (Output_data_plt_i386::first_plt_entry_offset): New function.
2184 (Output_data_plt_i386::get_plt_entry_size): New function.
2185 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2186 find_incremental_inputs_sections. Dump incremental_got_plt section.
2187 * incremental.cc: Include target.h.
2188 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2189 parameter. Adjust all callers. Find incremental_got_plt section.
2190 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2191 section.
2192 (Output_section_incremental_inputs::set_final_data_size): Calculate
2193 size of incremental_got_plt section.
2194 (Output_section_incremental_inputs::do_write): Write the
2195 incremental_got_plt section.
2196 (Got_plt_view_info): New struct.
2197 (Local_got_offset_visitor): New class.
2198 (Global_got_offset_visitor): New class.
2199 (Global_symbol_visitor_got_plt): New class.
2200 (Output_section_incremental_inputs::write_got_plt): New function.
2201 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2202 Add parameter. Adjust all callers.
2203 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2204 (Incremental_inputs::got_plt_section): New function.
2205 (Incremental_inputs::got_plt_section_): New data member.
2206 (Incremental_got_plt_reader): New class.
2207 * layout.cc (Layout::create_incremental_info_sections): Add the
2208 incremental_got_plt section.
2209 * object.h (Got_offset_list::get_list): New function.
2210 (Got offset_list::for_all_got_offsets): New function.
2211 (Sized_relobj::local_got_offset_list): New function.
2212 * powerpc.cc (Target_powerpc::got_size): Add const.
2213 (Target_powerpc::got_entry_count): New function.
2214 (Target_powerpc::plt_entry_count): New function.
2215 (Target_powerpc::first_plt_entry_offset): New function.
2216 (Target_powerpc::plt_entry_size): New function.
2217 (Output_data_plt_powerpc::entry_count): New function.
2218 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2219 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2220 * sparc.cc (Target_sparc::got_size): Add const.
2221 (Target_sparc::got_entry_count): New function.
2222 (Target_sparc::plt_entry_count): New function.
2223 (Target_sparc::first_plt_entry_offset): New function.
2224 (Target_sparc::plt_entry_size): New function.
2225 (Output_data_plt_sparc::entry_count): New function.
2226 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2227 (Output_data_plt_sparc::get_plt_entry_size): New function.
2228 * symtab.h (Symbol::got_offset_list): New function.
2229 (Symbol_table::for_all_symbols): New function.
2230 * target.h (Sized_target::got_entry_count): New function.
2231 (Sized_target::plt_entry_count): New function.
2232 (Sized_target::plt_entry_size): New function.
2233 * x86_64.cc (Target_x86_64::got_size): Add const.
2234 (Target_x86_64::got_entry_count): New function.
2235 (Target_x86_64::plt_entry_count): New function.
2236 (Target_x86_64::first_plt_entry_offset): New function.
2237 (Target_x86_64::plt_entry_size): New function.
2238 (Output_data_plt_x86_64::entry_count): New function.
2239 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2240 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2241
09ec0418
CC
22422010-08-12 Cary Coutant <ccoutant@google.com>
2243
2244 * archive.cc: Include incremental.h.
2245 (Archive::Archive): Initialize incremental_info_.
2246 (Archive::include_member): Record archive members in incremental info.
2247 (Add_archive_symbols::run): Record begin and end of an archive in
2248 incremental info.
2249 (Lib_group::include_member): Record objects in incremental info.
2250 * archive.h (Incremental_archive_entry): Forward declaration.
2251 (Archive::set_incremental_info): New member function.
2252 (Archive::incremental_info): New member function.
2253 (Archive::Unused_symbol_iterator): New class.
2254 (Archive::unused_symbols_begin): New member function.
2255 (Archive::unused_symbols_end): New member function.
2256 (Archive::incremental_info_): New data member.
2257 * incremental-dump.cc (find_input_containing_global): New function.
2258 (dump_incremental_inputs): Dump new incremental info sections.
2259 * incremental.cc: Include symtab.h.
2260 (Output_section_incremental_inputs): New class.
2261 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2262 new incremental info sections.
2263 (Sized_incremental_binary::do_check_inputs): Likewise.
2264 (Incremental_inputs::report_archive): Remove.
2265 (Incremental_inputs::report_archive_begin): New function.
2266 (Incremental_inputs::report_archive_end): New function.
2267 (Incremental_inputs::report_object): New function.
2268 (Incremental_inputs::finalize_inputs): Remove.
2269 (Incremental_inputs::report_input_section): New function.
2270 (Incremental_inputs::report_script): Rewrite.
2271 (Incremental_inputs::finalize): Do nothing but finalize string table.
2272 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2273 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2274 (Incremental_inputs::create_data_sections): New function.
2275 (Incremental_inputs::relocs_entsize): New function.
2276 (Output_section_incremental_inputs::set_final_data_size): New function.
2277 (Output_section_incremental_inputs::do_write): New function.
2278 (Output_section_incremental_inputs::write_header): New function.
2279 (Output_section_incremental_inputs::write_input_files): New function.
2280 (Output_section_incremental_inputs::write_info_blocks): New function.
2281 (Output_section_incremental_inputs::write_symtab): New function.
2282 * incremental.h (Incremental_script_entry): Forward declaration.
2283 (Incremental_object_entry): Forward declaration.
2284 (Incremental_archive_entry): Forward declaration.
2285 (Incremental_inputs): Forward declaration.
2286 (Incremental_inputs_header_data): Remove.
2287 (Incremental_inputs_header): Remove.
2288 (Incremental_inputs_header_write): Remove.
2289 (Incremental_inputs_entry_data): Remove.
2290 (Incremental_inputs_entry): Remove.
2291 (Incremental_inputs_entry_write): Remove.
2292 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2293 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2294 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2295 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2296 Likewise.
2297 (Incremental_input_entry): New class.
2298 (Incremental_script_entry): New class.
2299 (Incremental_object_entry): New class.
2300 (Incremental_archive_entry): New class.
2301 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2302 (Incremental_inputs::report_inputs): Remove.
2303 (Incremental_inputs::report_archive): Remove.
2304 (Incremental_inputs::report_archive_begin): New function.
2305 (Incremental_inputs::report_archive_end): New function.
2306 (Incremental_inputs::report_object): Change prototype.
2307 (Incremental_inputs::report_input_section): New function.
2308 (Incremental_inputs::report_script): Change prototype.
2309 (Incremental_inputs::get_reloc_count): New function.
2310 (Incremental_inputs::set_reloc_count): New function.
2311 (Incremental_inputs::create_data_sections): New function.
2312 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2313 (Incremental_inputs::inputs_section): New function.
2314 (Incremental_inputs::symtab_section): New function.
2315 (Incremental_inputs::relocs_section): New function.
2316 (Incremental_inputs::get_stringpool): Add const.
2317 (Incremental_inputs::command_line): Add const.
2318 (Incremental_inputs::inputs): Remove.
2319 (Incremental_inputs::command_line_key): New function.
2320 (Incremental_inputs::input_file_count): New function.
2321 (Incremental_inputs::input_files): New function.
2322 (Incremental_inputs::relocs_entsize): New function.
2323 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2324 (Incremental_inputs::finalize_inputs): Remove.
2325 (Incremental_inputs::Input_info): Remove.
2326 (Incremental_inputs::lock_): Remove.
2327 (Incremental_inputs::inputs_): Change type.
2328 (Incremental_inputs::inputs_map_): Remove.
2329 (Incremental_inputs::current_object_entry_): New data member.
2330 (Incremental_inputs::inputs_section_): New data member.
2331 (Incremental_inputs::symtab_section_): New data member.
2332 (Incremental_inputs::relocs_section_): New data member.
2333 (Incremental_inputs::reloc_count_): New data member.
2334 (Incremental_inputs_reader): New class.
2335 (Incremental_symtab_reader): New class.
2336 (Incremental_relocs_reader): New class.
2337 * layout.cc (Layout::finalize): Move finalization of incremental info
2338 and creation of incremental info sections to follow finalization of
2339 symbol table. Set offsets for postprocessing sections.
2340 (Layout::create_incremental_info_sections): Call
2341 Incremental_inputs::create_data_sections. Add incremental symtab
2342 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2343 sections to layout after input sections.
2344 * layout.h (struct Timespec): Forward declaration.
2345 (Layout::incremental_inputs): Add const.
2346 (Layout::create_incremental_info_sections): Add parameter.
2347 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2348 * object.cc: Include incremental.h.
2349 (Relobj::finalize_incremental_relocs): New function.
2350 (Sized_relobj::do_layout): Record input sections in incremental info.
2351 * object.h (Object::output_section): New function.
2352 (Object::output_section_offset): Moved from Relobj.
2353 (Object::get_incremental_reloc_base): New function.
2354 (Object::get_incremental_reloc_count): New function.
2355 (Object::do_output_section): New function.
2356 (Object::do_output_section_offset): Moved from Relobj.
2357 (Object::do_get_incremental_reloc_base): New function.
2358 (Object::do_get_incremental_reloc_count): New function.
2359 (Object::Object): Initialize new data members.
2360 (Relobj::output_section): Renamed do_output_section and moved to
2361 protected.
2362 (Relobj::output_section_offset): Moved to Object.
2363 (Relobj::do_get_incremental_reloc_base): New function.
2364 (Relobj::do_get_incremental_reloc_count): New function.
2365 (Relobj::allocate_incremental_reloc_counts): New function.
2366 (Relobj::count_incremental_reloc): New function.
2367 (Relobj::finalize_incremental_relocs): New function.
2368 (Relobj::next_incremental_reloc_index): New function.
2369 (Relobj::reloc_counts_): New data member.
2370 (Relobj::reloc_bases_): New data member.
2371 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2372 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2373 (Sized_relobj::incremental_relocs_scan): New function.
2374 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2375 (Sized_relobj::incremental_relocs_write): New function.
2376 (Sized_relobj::incremental_relocs_write_reltype): New function.
2377 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2378 incremental link.
2379 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2380 archives and object files elsewhere.
2381 (Add_symbols::run): Report object files here.
2382 (Finish_group::run): Report end of archive at end of group.
2383 * reloc.cc: Include layout.h, incremental.h.
2384 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2385 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2386 (Sized_relobj::incremental_relocs_scan): New function.
2387 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2388 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2389 (Sized_relobj::incremental_relocs_write): New function.
2390 (Sized_relobj::incremental_relocs_write_reltype): New function.
2391 * script.cc (read_input_script): Rewrite test for incremental link.
2392 Change call to Incremental_inputs::report_script.
2393 * symtab.h (Symbol_table::first_global_index): New function.
2394 (Symbol_table::output_count): New function.
2395
ce0d1972
DK
23962010-08-12 Doug Kwan <dougkwan@google.com>
2397
2398 * arm.cc (Target_arm::merge_object_attributes): Check command line
2399 options --no-wchar-size-warning and --no-enum-size-warning.
2400 * options.h (General_options): Add ld-compatible options
2401 --no-enum-size-warning and --no-wchar-size-warning.
2402
6e5710ce
ILT
24032010-08-04 Ian Lance Taylor <iant@google.com>
2404
2405 * x86_64.cc (Target_x86_64::Scan::local): Use
2406 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2407 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2408 (Target_x86_64::Scan::global): Likewise.
2409 (Target_x86_64::Relocate::relocate): Likewise.
2410 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2411 Likewise.
2412
fef830db
CC
24132010-08-03 Cary Coutant <ccoutant@google.com>
2414
2415 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2416 to reserve space in merged_strings vector. Keep total input size
2417 for stats.
2418 (Output_merge_string::do_print_merge_stats): Print total input size.
2419 * merge.h (Output_merge_string): Add input_size_ field.
2420 * stringpool.cc (Stringpool_template::string_length): Move
2421 implementations out of Stringpool_template class and place in
2422 stringpool.h.
2423 * stringpool.h (string_length): Move out of Stringpool_template.
2424
1e3811b0
ILT
24252010-08-03 Ian Lance Taylor <iant@google.com>
2426
2427 PR 11712
2428 * layout.cc (relaxation_loop_body): If address of load segment is
2429 set, adjust address to include headers if possible.
2430
7af0c620
ILT
24312010-08-03 Ian Lance Taylor <iant@google.com>
2432
2433 * version.cc (version_string): Bump to 1.10.
2434
22f0da72
ILT
24352010-08-03 Ian Lance Taylor <iant@google.com>
2436
2437 PR 11805
2438 * layout.h (enum Output_section_order): Define.
2439 (class Layout): Update declarations.
2440 * layout.cc (Layout::get_output_section): Add order parameter.
2441 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2442 is_first_non_relro parameters. Change all callers.
2443 (Layout::choose_output_section): Likewise.
2444 (Layout::add_output_section_data): Likewise.
2445 (Layout::make_output_section): Likewise. Set order.
2446 (Layout::default_section_order): New function.
2447 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2448 * output.cc (Output_section::Output_section): Initialize order_.
2449 Don't initialize deleted fields.
2450 (Output_segment::Output_segment): Don't initialize deleted
2451 fields.
2452 (Output_segment::add_output_section_to_load): New function
2453 replacing add_output_section. Change all callers to call this or
2454 add_output_section_to_nonload.
2455 (Output_segment::add_output_section_to_nonload): New function.
2456 (Output_segment::remove_output_section): Rewrite.
2457 (Output_segment::add_initial_output_data): Likewise.
2458 (Output_segment::has_any_data_sections): Likewise.
2459 (Output_segment::is_first_section_relro): Likewise.
2460 (Output_segment::maximum_alignment): Likewise.
2461 (Output_segment::has_dynamic_reloc): New function replacing
2462 dynamic_reloc_count. Change all callers.
2463 (Output_segment::has_dynamic_reloc_list): New function replacing
2464 dynamic_reloc_count_list. Change all callers.
2465 (Output_segment::set_section_addresses): Rewrite.
2466 (Output_segment::set_offset): Rewrite.
2467 (Output_segment::find_first_and_last_list): Remove.
2468 (Output_segment::set_tls_offsets): Rewrite.
2469 (Output_segment::first_section_load_address): Likewise.
2470 (Output_segment::output_section_count): Likewise.
2471 (Output_segment::section_with_lowest_load_address): Likewise.
2472 (Output_segment::write_section_headers): Likewise.
2473 (Output_segment::print_sections_to_map): Likewise.
2474 * output.h (class Output_data): Remove dynamic_reloc_count_
2475 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2476 (Output_data::add_dynamic_reloc): Rewrite.
2477 (Output_data::has_dynamic_reloc): New function.
2478 (Output_data::dynamic_reloc_count): Remove.
2479 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2480 is_last_relro_, is_first_non_relro_, is_interp_,
2481 is_dynamic_linker_section_ fields. Add order and set_order
2482 functions. Remove is_relro_local, set_is_relro_local,
2483 is_last_relro, set_is_last_relro, is_first_non_relro,
2484 set_is_first_non_relro functions, is_interp, set_is_interp,
2485 is_dynamic_linker_section, and set_is_dynamic_linker_section
2486 functions.
2487 (class Output_segment): Change Output_data_list from std::list to
2488 std:;vector. Add output_lists_ field. Remove output_data_ and
2489 output_bss_ fields. Update declarations.
2490
3ff2ccb0
ILT
24912010-08-02 Ian Lance Taylor <iant@google.com>
2492
2493 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2494 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2495 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2496
88a4108b
ILT
24972010-08-02 Ian Lance Taylor <iant@google.com>
2498
2499 PR 11855
2500 * script.cc (Script_options::Script_options): Initialize
2501 symbol_definitions_ and symbol_references_.
2502 (Script_options::add_symbol_assignment): Update
2503 symbol_definitions_ and symbol_references_.
2504 (Script_options::add_symbol_reference): New function.
2505 (script_symbol): New function.
2506 * script.h (class Script_options): Add symbol_definitions_ and
2507 symbol_references_ fields.
2508 (Script_options::referenced_const_iterator): New type.
2509 (Script_options::referenced_begin): New function.
2510 (Script_options::referenced_end): New function.
2511 (Script_options::is_referenced): New function.
2512 (Script_options::any_unreferenced): New function.
2513 * script-c.h (script_symbol): Declare.
2514 * yyscript.y (exp): Call script_symbol.
2515 * symtab.cc: Include "script.h".
2516 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2517 Change all callers. Check symbols referenced by scripts.
2518 (Symbol_table::add_undefined_symbols_from_command_line): Add
2519 layout parameter. Change all callers.
2520 (Symbol_table::do_add_undefined_symbols_from_command_line):
2521 Likewise. Break out loop body. Check symbols referenced by
2522 scripts.
2523 (Symbol_table::add_undefined_symbol_from_command_line): New
2524 function broken out of
2525 do_add_undefined_symbols_from_command_line.
2526 * symtab.h (class Symbol_table): Update declarations.
2527 * archive.cc: Include "layout.h".
2528 (Archive::should_include_member): Add layout parameter. Change
2529 all callers. Check for symbol mentioned in expression.
2530 * archive.h (class Archive): Update declaration.
2531 * object.cc (Sized_relobj::do_should_include_member): Add layout
2532 parameter.
2533 * object.h (Object::should_include_member): Add layout parameter.
2534 Change all callers.
2535 (Object::do_should_include_member): Add layout parameter.
2536 (class Sized_relobj): Update declaration.
2537 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2538 parameter.
2539 * dynobj.h (class Sized_dynobj): Update declaration.
2540 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2541 layout parameter.
2542 * plugin.h (class Sized_pluginobj): Update declaration.
2543
5f1ab67a
ILT
25442010-08-02 Ian Lance Taylor <iant@google.com>
2545
2546 PR 11866
2547 * output.cc (Output_segment::set_offset): Search for the first and
2548 last sections rather than assuming that the list is in order.
2549 (Output_segment::find_first_and_last_list): New function.
2550 * output.h (class Output_segment): Update declarations.
2551 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2552 (relro_strip_test_SOURCES): New variable.
2553 (relro_strip_test_DEPENDENCIES): New variable.
2554 (relro_strip_test_LDFLAGS): New variable.
2555 (relro_strip_test_LDADD): New variable.
2556 (relro_strip_test.so): New target.
2557
a8df5856
ILT
25582010-08-02 Ian Lance Taylor <iant@google.com>
2559
2560 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2561 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2562 (Target_i386::got_tlsdesc_section): New function.
2563 (Target_i386::got_section): Create space for GOT entries for
2564 TLSDESC relocations.
2565 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2566 R_386_TLS_GOTDESC.
2567 (Target_i386::Scan::global): Likewise.
2568 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2569 using TLSDESC GOT.
2570 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2571 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2572 (Target_x86_64::got_tlsdesc_section): New function.
2573 (Target_x86_64::got_section): Create space for GOT entries for
2574 TLSDESC relocations.
2575 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2576 R_386_TLS_GOTDESC.
2577 (Target_x86_64::Scan::global): Likewise.
2578 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2579 using TLSDESC GOT.
2580
0c10a0a6
ILT
25812010-08-02 Ian Lance Taylor <iant@google.com>
2582
2583 * testsuite/final_layout.sh: Use dc to convert from hex to
2584 decimal.
2585
41cbeecc
ST
25862010-07-29 Sriraman Tallam <tmsriram@google.com>
2587
2588 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2589 paramter to the call to gold::gc_process_relocs.
2590 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2591 paramter to the call to gold::gc_process_relocs.
2592 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2593 parameter to the call to gold::gc_process_relocs.
2594 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2595 template parameter to the call to gold::gc_process_relocs.
2596 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2597 paramter to the call to gold::gc_process_relocs.
2598 * gc.h (get_embedded_addend_size): New function.
2599 (gc_process_relocs): Save the size of the reloc for use by ICF.
2600 * icf.cc (get_section_contents): Get the addend from the text section
2601 for SHT_REL relocation sections.
2602 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2603 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2604 * int_encoding.h (read_from_pointer): New overloaded function.
2605 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2606 * testsuite/icf_sht_rel_addend_test.sh: New file.
2607 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2608 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2609
6ea55b82
RW
26102010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2611
2612 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2613 * Makefile.in: Regenerate.
2614 * testsuite/Makefile.in: Regenerate.
2615
9691462b
ILT
26162010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2617
2618 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2619 * gold/testsuite/debug_msg.cc: Likewise.
2620 * gold/testsuite/odr_violation1.cc
2621 * gold/testsuite/odr_violation2.cc
2622
76897331
CC
26232010-07-21 Cary Coutant <ccoutant@google.com>
2624
2625 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2626 string, and length fields.
2627 (Output_merge_string::Merged_strings_list): New type.
2628 (Output_merge_string::Merged_strings_lists): New typedef.
2629 (Output_merge_string): Replace merged_strings_ with
2630 merged_strings_lists_.
2631 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2632 Merged_strings_list per input object and section. Don't store pointer
2633 to the string. Don't store length with each merged string entry.
2634 (Output_merge_string::finalize_merged_data): Loop over list of merged
2635 strings lists. Recompute length of each merged string.
2636
78384e8f
CC
26372010-07-15 Cary Coutant <ccoutant@google.com>
2638
2639 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2640 here.
2641
783659f9
ILT
26422010-07-14 Ian Lance Taylor <iant@google.com>
2643
2644 * descriptors.cc (Descriptors::open): Report correct name in error
2645 message.
2646
131687b4
DK
26472010-07-13 Doug Kwan <dougkwan@google.com>
2648
2649 * arm.cc (Arm_input_section::Arm_input_section): For a
2650 SHT_ARM_EXIDX section, always keeps the input sections.
2651 (Arm_input_section::set_exidx_section_link): New method.
2652 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
2653 has_errors_ to false.
2654 (Arm_exidx_input_section::has_errors,
2655 Arm_exidx_input_section::set_has_errors): New methods.
2656 (Arm_exidx_input_section::has_errors_): New data member.
2657 (Arm_relobj::get_exidx_shndx_list): New method.
2658 (Arm_output_section::append_text_sections_to_list): Do not skip
2659 section without SHF_EXECINSTR.
2660 (Arm_output_section::fix_exidx_coverage): Skip input sections with
2661 errors.
2662 (Arm_relobj::make_exidx_input_section): Add new parameter for text
2663 section header. Make error messages more verbose. Check for
2664 a non-executable section linked to an EXIDX section.
2665 (Arm_relobj::do_read_symbols): Remove error checking, which has been
2666 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
2667 check that there is no deferred EXIDX section if we exit early.
2668 Instead of not making an EXIDX section in case of an error, make one
2669 and set the has_errors flag of it.
2670 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
2671 in a relocatable link.
2672 (Target_arm::do_relax): Look for the EXIDX output section instead of
2673 assuming that it is called .ARM.exidx.
2674 (Target_arm::fix_exidx_coverage): Add a new parameter for input
2675 section list. Do not check for SHF_EXECINSTR section flags but
2676 skip any input section with errors.
2677 * output.cc (Output_section::Output_section): Initialize
2678 always_keeps_input_sections_ to false.
2679 (Output_section::add_input_section): Check for
2680 always_keeps_input_sections_.
2681 * output.h (Output_section::always_keeps_input_sections,
2682 Output_section::set_always_keeps_input_sections): New methods.
2683 (Output_section::always_keeps_input_sections): New data member.
2684
69517287
RÁE
26852010-07-13 Rafael Espindola <espindola@google.com>
2686
2687 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
2688 * fileread.h (Input_file): Add try_extra_search_path and find_file.
2689
82742395
ILT
26902010-07-13 Philip Herron <herron.philip@googlemail.com>
2691 Ian Lance Taylor <iant@google.com>
2692
2693 * output.h (Output_section_lookup_maps::add_merge_section):
2694 Correct check of whether value was inserted.
2695 (Output_section_lookup_maps::add_merge_input_section): Likewise.
2696 (Output_section_lookup_maps::add_relaxed_input_section):
2697 Likewise.
2698 * arm.cc (Target_arm::got_section): Remove used local os.
2699 * i386.cc (Target_i386::got_section): Likewise.
2700 * x86_64.cc (Target_x86_64::got_section): Likewise.
2701 * sparc.cc (Target_sparc::got_section): Likewise.
2702 (Target_sparc::relocate): Remove unused local have_got_offset.
2703 * powerpc.cc (Target_powerpc::relocate): Likewise.
2704
f2d707b5
ILT
27052010-07-13 Ian Lance Taylor <iant@google.com>
2706
241531d6
ILT
2707 * compressed_output.cc (zlib_decompress): Fix signature in
2708 !HAVE_ZLIB_H case.
2709
f2d707b5
ILT
2710 * archive.cc (Archive::include_member): Unlock an external member
2711 of a thin archive. Don't bother to delete an object we know is
2712 NULL.
2713
a2e47362
CC
27142010-07-12 Cary Coutant <ccoutant@google.com>
2715
2716 * compressed_output.cc (zlib_decompress): New function.
2717 (get_uncompressed_size): New function.
2718 (decompress_input_section): New function.
2719 * compressed_output.h (get_uncompressed_size): New function.
2720 (decompress_input_section): New function.
2721 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
2722 Handle compressed debug sections.
2723 * layout.cc (is_compressed_debug_section): New function.
2724 (Layout::output_section_name): Map compressed section names to
2725 canonical names.
2726 * layout.h (is_compressed_debug_section): New function.
2727 (is_debug_info_section): Recognize compressed debug sections.
2728 * merge.cc: Include compressed_output.h.
2729 (Output_merge_data::do_add_input_section): Handle compressed
2730 debug sections.
2731 (Output_merge_string::do_add_input_section): Handle compressed
2732 debug sections.
2733 * object.cc: Include compressed_output.h.
2734 (Sized_relobj::Sized_relobj): Initialize new data members.
2735 (build_compressed_section_map): New function.
2736 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
2737 * object.h (Object::section_is_compressed): New method.
2738 (Object::do_section_is_compressed): New method.
2739 (Sized_relobj::Compressed_section_map): New type.
2740 (Sized_relobj::do_section_is_compressed): New method.
2741 (Sized_relobj::compressed_sections_): New data member.
2742 * output.cc (Output_section::add_input_section): Handle compressed
2743 debug sections.
2744 * reloc.cc: Include compressed_output.h.
2745 (Sized_relobj::write_sections): Handle compressed debug sections.
2746
ce279a62
CC
27472010-07-08 Cary Coutant <ccoutant@google.com>
2748
2749 * resolve.cc (Symbol_table::resolve): Remember whether undef was
2750 weak when resolving to a dynamic def.
2751 (Symbol_table::should_override): Add adjust_dyndef flag; set it
2752 for weak undef/dynamic def cases. Adjust callers.
2753 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
2754 undef_binding_weak_.
2755 (Symbol_table::sized_write_globals): Adjust symbol binding.
2756 (Symbol_table::sized_write_symbol): Add binding parameter.
2757 * symtab.h (Symbol::set_undef_binding): New method.
2758 (Symbol::is_undef_binding_weak): New method.
2759 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
2760 (Symbol_table::should_override): Add new parameter.
2761 (Symbol_table::sized_write_symbol): Add new parameter.
2762
2763 * testsuite/weak_undef_file1.cc: Add new test case.
2764 * testsuite/weak_undef_file2.cc: Fix header comment.
2765 * testsuite/weak_undef_test.cc: Add new test case.
2766
b2286c10
DK
27672010-06-29 Doug Kwan <dougkwan@google.com>
2768
2769 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
2770 Initialize USE_SYMBOL_.
2771 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
2772 definition.
2773 (Arm_reloc_property::uses_symbol_): New data member declaration.
2774 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
2775 uses symbol value and symbol is undefined but not weakly undefined.
2776
4802450a
RÁE
27772010-06-28 Rafael Espindola <espindola@google.com>
2778
2779 * plugin.cc (Plugin::load): Use dlerror.
2780
e5ca47ba
ILT
27812010-06-26 Jeffrey Yaskin <jyasskin@google.com>
2782
2783 * symtab.cc (detect_odr_violations): When reporting an ODR
2784 violation, report an object where the symbol is defined.
2785
8a75a161
DK
27862010-06-25 Doug Kwan <dougkwan@google.com>
2787
2788 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
2789 (Target_arm::section_may_have_icf_unsafe_pointers): New method
2790 definition.
2791 (Target_arm::Scan::local_reloc_may_be_function_pointer,
2792 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
2793 target hook to detect function points.
2794 (Target_arm::Scan::possible_function_pointer_reloc): New method.
2795 * icf.h (Icf::check_section_for_function_pointers): Change type of
2796 parameter SECTION_NAME to const reference to std::string. Use
2797 target hook to determine if section may have unsafe pointers.
2798 * target.h (Target::section_may_have_icf_unsafe_pointers): New
2799 method definition.
2800
42218b9f
RÁE
28012010-06-21 Rafael Espindola <espindola@google.com>
2802
2803 * fileread.cc (Input_file::find_fie): New
2804 (Input_file::open): Use Input_file::find_fie.
2805 * fileread.h (Input_file::find_fie): New
2806 * plugin.cc (set_extra_library_path): New.
2807 (Plugin::load): Add set_extra_library_path to the transfer vector.
2808 (Plugin_manager::set_extra_library_path): New.
2809 (Plugin_manager::add_input_file): Use the extra search path if set.
2810 (set_extra_library_path(): New.
2811 * plugin.h (Plugin_manager): Add set_extra_library_path and
2812 extra_search_path_.
2813
a0506cca
CC
28142010-06-19 Cary Coutant <ccoutant@google.com>
2815
2816 * layout.cc (gdb_sections): Add .debug_types.
2817 (lines_only_debug_sections): Likewise.
2818
6508b958
RÁE
28192010-06-18 Rafael Espindola <espindola@google.com>
2820
2821 * plugin.cc (add_input_file,add_input_library)
2822 (Plugin_manager::add_input_file): Make filename arguments const.
2823 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
2824 const.
2825
3e235302
DK
28262010-06-16 Doug Kwan <dougkwan@google.com>
2827
2828 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
2829 .ARM.attributes section if we have not merged any input
2830 attributes sections.
2831
106e8a6c
DK
28322010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2833
2834 * arm.cc: Allow combining objects with no EABI version
2835 information.
2836
91ff43fe
RÁE
28372010-06-15 Rafael Espindola <espindola@google.com>
2838
2839 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
2840
68ed838c
ILT
28412010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2842
2843 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
2844 (struct iovec): Correct !HAVE_READV definition.
2845
f3a2388f
CC
28462010-06-10 Cary Coutant <ccoutant@google.com>
2847
2848 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
2849 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
2850 reloc sections.
2851 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
2852
2853 PR 11683
2854 * symtab.h (Symbol::is_placeholder): New member function.
2855 * target-reloc.h (relocate_section): Check for placeholder symbols.
2856
2857 * testsuite/Makefile.am (plugin_test_8): New test.
2858 (plugin_test_9): New test.
2859 * testsuite/Makefile.in: Regenerate.
2860
e1df38aa
NC
28612010-06-09 Nick Clifton <nickc@redhat.com>
2862
2863 * yyscript.y (input_list_element): Allow strings prefixed with
2864 the '-' character. Treat these as libraries.
2865 * script.cc (script_add_library): New function. Adds a library
2866 specified by "-l<name>" found in an input script.
2867 * script-c.h: Add prototype for script_add_library.
2868
25bbe950
DK
28692010-06-07 Doug Kwan <dougkwan@google.com>
2870
2871 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
2872 Restrict stub-group size to be within long conditional branch
2873 range when working around cortex-A8 erratum.
2874
0f32ea4c
ILT
28752010-06-07 Damien Diederen <dd@crosstwine.com>
2876
2877 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
2878 #ifdef typo.
2879
8fe2a369
ST
28802010-06-03 Sriraman Tallam <tmsriram@google.com>
2881
2882 PR gold/11658
2883 * output.cc
2884 (Output_section::Input_section_sort_entry::compare_section_ordering):
2885 Change to return non-zero correctly.
2886 (Output_section::Input_section_sort_section_order_index_compare
2887 ::operator()): Change to fix ambiguity in comparisons.
2888
6e9ba2ca
ST
28892010-06-01 Sriraman Tallam <tmsriram@google.com>
2890
2891 * gold.h (is_wildcard_string): New function.
2892 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
2893 (Layout::layout_eh_frame): Ditto.
2894 (Layout::find_section_order_index): New method.
2895 (Layout::read_layout_from_file): New method.
2896 * layout.h (Layout::find_section_order_index): New method.
2897 (Layout::read_layout_from_file): New method.
2898 (Layout::input_section_position_): New private member.
2899 (Layout::input_section_glob_): New private member.
2900 * main.cc (main): Call read_layout_from_file here.
2901 * options.h (--section-ordering-file): New option.
2902 * output.cc (Output_section::input_section_order_specified_): New
2903 member.
2904 (Output_section::Output_section): Initialize new member.
2905 (Output_section::add_input_section): Add new parameter.
2906 Keep input sections when --section-ordering-file is used.
2907 (Output_section::set_final_data_size): Sort input sections when
2908 section ordering file is specified.
2909 (Output_section::Input_section_sort_entry): Add new parameter.
2910 Check sorting type.
2911 (Output_section::Input_section_sort_entry::compare_section_ordering):
2912 New method.
2913 (Output_section::Input_section_sort_compare::operator()): Change to
2914 consider section_order_index.
2915 (Output_section::Input_section_sort_init_fini_compare::operator()):
2916 Change to consider section_order_index.
2917 (Output_section::Input_section_sort_section_order_index_compare
2918 ::operator()): New method.
2919 (Output_section::sort_attached_input_sections): Change to sort
2920 according to section order when specified.
e1df38aa
NC
2921 (Output_section::add_input_section<32, true>): Add new parameter.
2922 (Output_section::add_input_section<64, true>): Add new parameter.
2923 (Output_section::add_input_section<32, false>): Add new parameter.
2924 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
2925 * output.h (Output_section::add_input_section): Add new parameter.
2926 (Output_section::input_section_order_specified): New
2927 method.
2928 (Output_section::set_input_section_order_specified): New method.
2929 (Input_section::Input_section): Initialize section_order_index_.
2930 (Input_section::section_order_index): New method.
2931 (Input_section::set_section_order_index): New method.
2932 (Input_section::section_order_index_): New member.
2933 (Input_section::Input_section_sort_section_order_index_compare): New
2934 struct.
2935 (Output_section::input_section_order_specified_): New member.
2936 * script-sections.cc (is_wildcard_string): Delete and move modified
2937 method to gold.h.
2938 (Output_section_element_input::Output_section_element_input): Modify
2939 call to is_wildcard_string.
2940 (Output_section_element_input::Input_section_pattern
2941 ::Input_section_pattern): Ditto.
2942 (Output_section_element_input::Output_section_element_input): Ditto.
2943 * testsuite/Makefile.am (final_layout): New test case.
2944 * testsuite/Makefile.in: Regenerate.
2945 * testsuite/final_layout.cc: New file.
2946 * testsuite/final_layout.sh: New file.
2947
3537c84b
RÁE
29482010-06-01 Rafael Espindola <espindola@google.com>
2949
2950 * plugin.cc (Plugin::load): Pass the output name to the plugin.
2951
105b6afd
RÁE
29522010-06-01 Rafael Espindola <espindola@google.com>
2953
2954 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
2955 visibility of symbols.
2956
29e11421
DK
29572010-05-27 Doug Kwan <dougkwan@google.com>
2958
2959 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
2960 from start of output section instead of address for a local symbol
2961 in a merged or relaxed section when doing a relocatable link.
2962
5e0f337e
RÁE
29632010-05-26 Rafael Espindola <espindola@google.com>
2964
2965 PR 11604
2966 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
2967 adding sections the garbage collector removed.
2968 * gold/testsuite/Makefile.am: Add test.
2969 * gold/testsuite/Makefile.in: Regenerate.
2970 * gold/testsuite/plugin_test_7.sh: New.
2971 * gold/testsuite/plugin_test_7_1.c: New.
2972 * gold/testsuite/plugin_test_7_2.c: New.
2973
f4187277
RÁE
29742010-05-26 Rafael Espindola <espindola@google.com>
2975
2976 * script-sections.cc (Output_section_definition::set_section_addresses):
2977 Check for --section-start.
2978
5c388529
DK
29792010-05-26 Doug Kwan <dougkwan@google.com>
2980
2981 * arm.cc (Arm_scan_relocatable_relocs): New class.
2982 (Target_arm::relocate_special_relocatable): New method.
2983 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
2984 (Arm_relocate_functions::thumb_branch_common): Same.
2985 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
2986 instead of Default_scan_relocatable_relocs.
2987 * target-reloc.h (relocate_for_relocatable): Let target handle
2988 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
2989 * target.h (Sized_target::relocate_special_relocatable): New method.
2990
bca1c3ae
ILT
29912010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2992
2993 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
2994
0439c796
DK
29952010-05-23 Doug Kwan <dougkwan@google.com>
2996
2997 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
2998 instead of a cast.
2999 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3000 with a direct branch, not a conditional branch, to a stub.
3001 * merge.cc (Output_merge_base::record_input_section): New method
3002 defintion.
3003 (Output_merge_data::do_add_input_section): Record input section if
3004 keeps-input-sections flag is set.
3005 (Output_merge_string::do_add_input_section): Ditto.
3006 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3007 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3008 INPUT_SECTIONS_.
3009 (Output_merge_base::keeps_input_sections,
3010 Output_merge_base::set_keeps_input_sections,
3011 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3012 method definitions.
3013 (Output_merge_base::Input_sections): New type declaration.
3014 (Output_merge_base::input_sections_begin,
3015 Output_merge_base::input_sections_end,
3016 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3017 (Output_merge_base::bool keeps_input_sections_,
3018 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3019 Output_merge_base::input_sections_): New data members.
3020 (Output_merge_data::do_set_keeps_input_sections): New method
3021 defintion.
3022 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3023 * output.cc (Output_section::Input_section::relobj): Move method
3024 defintion from class declaration to here and handle merge sections.
3025 (Output_section::Input_section::shndx): Ditto.
3026 (Output_section::Output_section): Remove initializations of removed
3027 data members and initialize new data member LOOKUP_MAPS_.
3028 (Output_section::add_input_section): Set keeps-input-sections flag
3029 for a newly created merge output section as appropriate. Adjust code
3030 to use Output_section_lookup_maps class.
3031 (Output_section::add_relaxed_input_section): Adjst code for lookup
3032 maps code refactoring.
3033 (Output_section::add_merge_input_section): Add a new parameter
3034 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3035 class. If adding input section to a newly created merge output
3036 section fails, remove the new merge section.
3037 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3038 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3039 (Output_section::find_merge_section): Ditto.
3040 (Output_section::build_lookup_maps): New method defintion.
3041 (Output_section::find_relaxed_input_section): Adjust code to use
3042 Output_section_lookup_maps class.
3043 (Output_section::get_input_sections): Export merge sections. Adjust
3044 code to use Output_section_lookup_maps class.
3045 (Output_section:::add_script_input_section): Adjust code to use
3046 Output_section_lookup_maps class. Update lookup maps for merge
3047 sections also.
3048 (Output_section::discard_states): Use Output_section_lookup_maps.
3049 (Output_section::restore_states): Same.
3050 * output.h (Merge_section_properties): Move class defintion out of
3051 Output_section.
3052 (Output_section_lookup_maps): New class.
3053 (Output_section::Input_section::is_merge_section): New method
3054 defintion.
3055 (Output_section::Input_section::relobj): Move defintion out of class
3056 defintion. Declare method only.
3057 (Output_section::Input_section::shndx): Ditto.
3058 (Output_section::Input_section::output_merge_base): New method defintion.
3059 (Output_section::Input_section::u2_.pomb): New union field.
3060 (Output_section::Merge_section_by_properties_map,
3061 Output_section::Output_section_data_by_input_section_map,
3062 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3063 Remove types.
3064 (Output_section::add_merge_input_section): Add new parameter
3065 KEEPS_INPUT_SECTIONS.
3066 (Output_section::build_lookup_maps): New method declaration.
3067 (Output_section::merge_section_map_,
3068 Output_section::merge_section_by_properties_map_,
3069 Output_section::relaxed_input_section_map_,
3070 Output_section::is_relaxed_input_section_map_valid_): Remove data
3071 members.
3072 (Output_section::lookup_maps_): New data member.
3073
76295588
L
30742010-05-21 Doug Kwan <dougkwan@google.com>
3075
3076 PR gold/11619
3077 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3078 avoid a compilation error.
3079
d103a984
RÁE
30802010-05-19 Rafael Espindola <espindola@google.com>
3081
3082 * script-sections.cc (Output_section_definition::allocate_to_segment):
3083 Update the phdrs_list even when the output section is NULL.
3084 * testsuite/Makefile.am: Add test.
3085 * testsuite/Makefile.in: Regenerate.
3086 * testsuite/script_test_9.cc: New.
3087 * testsuite/script_test_9.sh: New.
3088 * testsuite/script_test_9.t: New.
3089
6625d24e
DK
30902010-05-19 Doug Kwan <dougkwan@google.com>
3091
3092 * arm.cc (Arm_input_section::original_size): New method.
3093 (Arm_input_section::do_addralign): Add a cast.
3094 (Arm_input_section::do_output_offset): Remove static cast.
3095 (Arm_input_section::original_addralign,
3096 Arm_input_section::original_size_): Change type to uint32_t.
3097 (Arm_input_section::init): Add safe casts for section alignment
3098 and size.
3099 (Arm_input_section::set_final_data_size): Do not set address and
3100 offset of stub table.
3101 (Arm_output_section::fix_exidx_coverage): Change use of of
3102 Output_section::Simple_input_section to that of
3103 Output_section::Input_section.
3104 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3105 except for the first pass.
3106 * output.cc (Output_section::get_input_sections): Change type of
3107 input_sections to std::list<Input_section>.
3108 (Output_section::add_script_input_section): Rename from
3109 Output_section::add_simple_input_section. Change type of SIS
3110 parameter from Simple_input_section to Input_section.
3111 * output.h (Output_section::Simple_input_section): Remove class.
3112 (Output_section::Input_section): Change class visibility to public.
3113 (Output_section::Input_section::addralign): Use stored alignments
3114 for special input sections if set.
3115 (Output_section::Input_section::set_addralign): New method.
3116 (Output_section::get_input_sections): Change parameter type from
3117 list of Simple_input_section to list of Input_section.
3118 (Output_section::add_script_input_section): Rename from
3119 Output_section::add_simple_input_section. Change first parameter's
3120 type from Simple_input_section to Input_section and remove the
3121 second and third parameters.
3122 * script-sections.cc (Input_section::Input_section_list): Change
3123 type to list of Output_section::Input_section/
3124 (Input_section_info::Input_section_info): Change parameter type of
3125 INPUT_SECTION to Output_section::Input_section.
3126 (Input_section_info::input_section): Change return type.
3127 (Input_section_info::input_section_): Change type to
3128 Output_section::Input_section.
3129 (Output_section_element_input::set_section_addresses): Adjust code
3130 to use Output_section::Input_section instead of
3131 Output_section::Simple_input_section. Adjust code for renaming
3132 of Output_section::add_simple_input_section.
3133 (Orphan_output_section::set_section_addresses): Ditto.
3134
e1e82ea4
RW
31352010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3136
3137 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3138 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3139
91e75c8a
RÁE
31402010-05-18 Rafael Espindola <espindola@google.com>
3141
3142 * options.cc (General_options::finalize): Handle -nostdlib.
3143 * options.h (nostdlib): New option.
3144 * script.cc (script_add_search_dir): Handle -nostdlib.
3145
da59ad79
DK
31462010-05-12 Doug Kwan <dougkwan@google.com>
3147
3148 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3149 attributes section only if there no attributes section after merging.
3150 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3151 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3152 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3153 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3154 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3155 and arm_attr_merge_7.stdout.
3156 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3157 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3158 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3159 arm_attr_merge_7b.o): New rules.
3160 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3161 arm_attr_merge_7
3162 * testsuite/Makefile.in: Regenerate.
3163 * testsuite/arm_attr_merge.sh: New file.
3164 * testsuite/arm_attr_merge_[67][ab].s: Same.
3165
3e01a7fd
NC
31662010-05-05 Nick Clifton <nickc@redhat.com>
3167
3168 * po/es.po: Updated Spanish translation.
3169
7ad2014a
L
31702010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3171
3172 * Makefile.am (install-exec-local): Properly install gold as
3173 default cross linker.
3174 * Makefile.in: Regenerated.
3175
4fda8867
NC
31762010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3177 Nick Clifton <nickc@redhat.com>
3178
3179 * configure.ac (install_as_default): Define and set to false
3180 unless --enable-gold or --enable-gold=both/gold has been
3181 specified.
3182 * configure: Regenerate.
3183
3184 * Makefile.am (install-exec-local): Install the executable as
3185 'ld.gold'. If install_as_default is true then also install it as
3186 'ld'.
3187 * Makefile.in: Regenerated.
3188
bd288ea2
ILT
31892010-04-24 Ian Lance Taylor <iant@google.com>
3190
3191 * layout.cc (Layout::layout_reloc): In relocatable link don't
3192 combine reloc sections for grouped sections.
3193
ef38fd8a
ST
31942010-04-23 Sriraman Tallam <tmsriram@google.com>
3195
3196 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3197 sections that are not ordinary to icf.
3198 * icf.cc (get_section_contents): Handle relocation pointing to section
3199 with no object or shndx information.
3200 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3201 * testsuite/Makefile.in: Regenerate.
3202 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3203 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3204
f6973bdc
ILT
32052010-04-22 Ian Lance Taylor <iant@google.com>
3206
3207 * expression.cc (Expression::Expression_eval_info): Add
3208 result_alignment_pointer field.
3209 (Expression::eval_with_dot): Add result_alignment_pointer
3210 parameter. Change all callers.
3211 (Expression::eval_maybe_dot): Likewise.
3212 (class Binary_expression): Add alignment_pointer parameter to
3213 left_value and right_value. Change all callers.
3214 (BINARY_EXPRESSION): Set result alignment.
3215 (class Trinary_expression): Add alignment_pointer parameter to
3216 arg2_value and arg3_value. Change all callers.
3217 (Trinary_cond::value): Set result alignment.
3218 (Max_expression::value, Min_expression::value): Likewise.
3219 (Align_expression::value): Likewise.
3220 * script-sections.cc (class Sections_element): Add dot_alignment
3221 parameter to set_section_addresses virtual function. Update
3222 instantiations.
3223 (class Output_section_element): Likewise.
3224 (Script_sections::create_segments): Add dot_alignment parameter.
3225 Change all callers.
3226 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3227 (Script_sections::set_phdrs_clause_addresses): Likewise.
3228 * script-sections.h: Update declarations.
3229 * script.h: Update declarations.
3230 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3231 min_p_align.
3232 * testsuite/script_test_3.t: Set large alignment.
3233 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3234 segment has expected alignment.
3235
9c9c98a5
NC
32362010-04-22 Nick Clifton <nickc@redhat.com>
3237
3238 * po/gold.pot: Updated by the Translation project.
3239 * po/vi.po: Updated Vietnamese translation.
3240
2253bfba
L
32412010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3242
3243 * testsuite/Makefile.am (check_PROGRAMS): Add
3244 icf_virtual_function_folding_test.
3245 * testsuite/Makefile.in: Regenerated.
3246
85fdf906
AH
32472010-04-15 Andrew Haley <aph@redhat.com>
3248
3249 * options.h (merge_exidx_entries): New option.
3250 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3251 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3252 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3253 (Target_arm::merge_exidx_entries): New function.
3254 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3255 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3256 to Arm_exidx_fixup constructor.
3257 Add new arg, merge_exidx_entries.
3258 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3259 Arm_output_section::fix_exidx_coverage.
3260
ce97fa81
ST
32612010-04-18 Sriraman Tallam <tmsriram@google.com>
3262
3263 * icf.cc (get_section_contents): Check for preemptible functions.
3264 Ignore addend when appropriate.
3265 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3266 section folded.
3267 (add_from_relobj): Check for section folded.
3268 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3269 * symtab.h (should_add_dynsym_entry): Add new parameter.
3270 * target-reloc.h (scan_relocs): Check for section folded.
3271 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3272 Check reloc types for function pointers in shared objects.
3273 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3274 case.
3275 (icf_preemptible_functions_test): New test case.
3276 (icf_string_merge_test): New test case.
3277 * testsuite.Makefile.in: Regenerate.
3278 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3279 bar_glob. Refactor code.
3280 * testsuite/icf_preemptible_functions_test.cc: New file.
3281 * testsuite/icf_preemptible_functions_test.sh: New file.
3282 * testsuite/icf_string_merge_test.cc: New file.
3283 * testsuite/icf_string_merge_test.sh: New file.
3284 * testsuite/icf_virtual_function_folding_test.cc: New file.
3285 * testsuite/icf_virtual_function_folding_test.sh: New file.
3286
04ceb17c
DK
32872010-04-14 Doug Kwan <dougkwan@google.com>
3288
3289 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3290 for local symbol recounting if we remove a section due to ICF.
3291 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3292 there are no regular objects in input.
3293
153e7da4
DK
32942010-04-13 Doug Kwan <dougkwan@google.com>
3295
3296 * arm.cc (Arm_input_section::set_final_data_size): Compute
3297 accurate final data size instead of using current data size.
3298
4dbd9faf
DK
32992010-04-09 Doug Kwan <dougkwan@google.com>
3300
3301 * layout.cc (Layout::choose_output_section): Handle script section
3302 types.
3303 (Layout::make_output_section_for_script): Add section type parameter.
3304 Handle script section types.
3305 * layout.h (Layout::make_output_section_for_script): Add section
3306 type parameter.
3307 * output.cc (Output_section::Output_section): Initialize data member
3308 is_noload_.
3309 (Output_section::do_reset_address_and_file_offset): Do not set address
3310 to 0 if section is a NOLOAD section.
3311 * output.h (Output_section::is_noload): New method.
3312 (Output_section::set_is_noload): Ditto.
3313 (Output_section::is_noload_): New data member.
3314 * script-c.h (Script_section_type): New enum type.
3315 (struct Parser_output_section_header): Add new file section_type.
3316 * script-sections.cc (Sections_element::output_section_name): Add
3317 parameter for returning script section type.
3318 (Output_section_definition::output_section_name): Ditto.
3319 (Output_section_definition::section_type)P; New method.
3320 (Output_section_definiton::script_section_type_name): Ditto.
3321 (Output_section_definition::script_section_type_): New data member.
3322 (Output_section_definition::Output_section_definition): Initialize
3323 data member Output_section_definition::script_section_type_.
3324 (Output_section_definition::create_sections): Pass script section type
3325 to Layout::make_output_section_for_script.
3326 (Output_section_definition::output_section_name): Return script
3327 section type to caller.
3328 (Output_section_definition::set_section_address): Do not advance
3329 dot value and load address if section type is NOLOAD. Set address
3330 of NOLOAD sections regardless of section flags.
3331 (Output_section_definition::print): Print section type if it is
3332 not SCRIPT_SECTION_TYPE_NONE.
3333 (Output_section_definition::section_type): New method.
3334 (Output_section_definition::script_section_type_name): Ditto.
3335 (Script_sections::output_section_name): Add new parameter
3336 PSECTION_TYPE for returning script section type. Pass it to
3337 section elements. Handle discard sections.
3338 (Sort_output_sections::operator()): Handle NOLOAD sections.
3339 * script-sections.h (Script_sections::Section_type): New enum type.
3340 (Script_sections::output_section_name): Add a new parameter for
3341 returning script section type.
3342 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3343 INFO and NOLOAD.
3344 * yyscript.y (union): Add new field SECTION_TYPE.
3345 (COPY, DSECT, INFO, NOLOAD): New tokens.
3346 (opt_address_and_section_type): Change type to output_section_header.
3347 (section_type): New non-terminal
3348 (section_header): Handle section type.
2253bfba 3349 (opt_address_and_section_type): Return section type value.
4dbd9faf 3350
721ea635
L
33512010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3352
3353 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3354 * testsuite/plugin_common_test_2.c (foo): Likewise.
3355
6bf924b0
DK
33562010-04-08 Doug Kwan <dougkwan@google.com>
3357
3358 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3359 Output_merge_data.
3360 * output.cc (Output_section::add_merge_input_section): Simplify
3361 code and return status of Output_merge_base::add_input_section.
e1df38aa 3362 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3363 returns true.
3364
24af6f92
DK
33652010-04-07 Doug Kwan <dougkwan@google.com>
3366
3367 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3368 if section is marked as containing instructions but has no mapping
3369 symbols.
3370 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3371 correct section index.
3372 (Arm_relobj::find_linked_text_section): Ditto.
3373
00698fc5
CC
33742010-04-07 Cary Coutant <ccoutant@google.com>
3375
3376 * archive.cc (include_member): Destroy Read_symbols_data object before
3377 releasing file.
3378 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3379 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3380 (Read_symbols_data::~Read_symbols_data) New destructor.
3381 (Section_relocs::Section_relocs) New constructor.
3382 (Section_relocs::~Section_relocs) New destructor.
3383 (Read_relocs_data::Read_relocs_data) New constructor.
3384 (Read_relocs_data::~Read_relocs_data) New destructor.
3385 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3386 pointers to NULL after deleting.
3387
7296d933
DK
33882010-04-07 Doug Kwan <dougkwan@google.com>
3389
3390 * arm.cc: Replace "endianity" with "endianness" in comments.
3391 (Arm_exidx_cantunwind): Ditto.
3392 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3393 (Arm_relobj::merge_flags_and_attributes): New method.
3394 (Arm_relobj::merge_flags_and_attributes_): New data member.
3395 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3396 (Arm_relobj::scan_sections_for_stubs): Ditto.
3397 (Arm_relobj::do_read_symbols): Check to see if we really want to
3398 merge processor-specific flags and attributes. Exit early if
3399 an object is empty except for section names and the undefined symbol.
3400 (Target_arm::do_finalize_sections): Move check for ELF format to
3401 Arm_relobj::do_read_symbols. Merge processor specific flags and
3402 attributes from a regular object only when we have determined that
3403 it is aapropriate. Do not create an .ARM.attributes section in
3404 output if there is no regular input object.
3405 (Target_arm::merge_processor_specific_flags): Check
3406 --warn-mismatch before printing any error.
3407 (Target_arm::merge_object_attributes): Ditto.
3408 * gold.cc (queue_middle_tasks): Handle the case in which there is
3409 no regular object in input.
3410 * options.cc (General_options::parse_EB): New method.
3411 (General_options::parse_EL): Same.
3412 (General_options::General_options): Initialize endianness_.
3413 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3414 New options.
3415 (General_options::Endianness): New enum.
3416 (General_options::endianness): New method.
3417 (General_options::endianness_): New data member.
3418 * parameters.cc (Parameters::set_options): Check target endianness.
3419 (Parameters::set_target_once): Ditto.
3420 (Parameters::check_target_endianness): New method.
3421 (parameters_force_valid_target): If either -EL or -EB is specified,
3422 use it to define endianness of default target.
3423 * parameters.h (Parameters::check_target_endianness): New method
3424 declaration.
3425 * target.h (class Target): Change "endianity" to "endianness"
3426 in comments.
3427
efc8d4f2
RW
34282010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3429
3430 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3431 * configure: Regenerate.
3432 * Makefile.in: Regenerate.
3433 * testsuite/Makefile.in: Regenerate.
3434
be234d88
CC
34352010-04-06 Cary Coutant <ccoutant@google.com>
3436
3437 gcc PR lto/42757
3438 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3439 prevailing definitions of common symbols.
3440 * testsuite/plugin_test_6.sh: New test case.
3441 * testsuite/plugin_common_test_1.c: New test case.
3442 * testsuite/plugin_common_test_2.c: New test case.
3443 * testsuite/Makefile.am (plugin_test_6): New test case.
3444 * testsuite/Makefile.in: Regenerate.
3445
bd32c6bd
NC
34462010-04-06 Nick Clifton <nickc@redhat.com>
3447
3448 * po/vi.po: New Vietnamese translation.
3449
323c532f
DK
34502010-03-30 Doug Kwan <dougkwan@google.com>
3451
3452 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3453
4fcd97eb
DK
34542010-03-25 Doug Kwan <dougkwan@google.com>
3455
3456 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3457 to avoid a conversion warning on a 32-bit host.
3458
4ebf39db
ILT
34592010-03-24 Ian Lance Taylor <iant@google.com>
3460
3461 * testsuite/script_test_3.t: Add a TLS segment.
3462 * testsuite/Makefile.am (check_PROGRAMS): Add
3463 tls_phdrs_script_test.
3464 (tls_phdrs_script_test_SOURCES): Define.
3465 (tls_phdrs_script_test_DEPENDENCIES): Define.
3466 (tls_phdrs_script_test_LDFLAGS): Define.
3467 (tls_phdrs_script_test_LDADD): Define.
3468 * testsuite/Makefile.in: Rebuild.
3469
4a599bdd
CC
34702010-03-23 Cary Coutant <ccoutant@google.com>
3471
3472 * fileread.cc (find_or_make_view): Fix comment.
3473
6c93b22c
ILT
34742010-03-23 Ian Lance Taylor <iant@google.com>
3475
3476 * script-sections.cc (class Orphan_section_placement): Define
3477 PLACE_TLS and PLACE_TLS_BSS.
3478 (Orphan_section_placement::Orphan_section_placement): Initialize
3479 new places.
3480 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3481 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3482 (tls_script_test_SOURCES): Define.
3483 (tls_script_test_DEPENDENCIES): Define.
3484 (tls_script_test_LDFLAGS): Define.
3485 (tls_script_test_LDADD): Define.
3486 * testsuite/Makefile.in: Rebuild.
3487
a2c7281b
DK
34882010-03-22 Doug Kwan <dougkwan@google.com>
3489
3490 * arm.cc (Arm_relocate_functions::abs8,
3491 Arm_relocate_functions::abs16): Use correct check for overflow
3492 specified in the ARM ELF specs.
3493 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3494 target of a BLX instruction specially.
3495 (Reloc_stub::stub_type_for_reloc): Ditto.
3496 (Relocate::relocate): Use symbolic names instead of numeric relocation
3497 codes to report error.
3498 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3499 workaround.
3500 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3501 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3502 thumb2_blx_out_of_range.stdout
3503 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3504 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3505 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3506 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3507 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3508 thumb2_blx_in_range, thumb2_blx_in_range.o,
3509 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3510 thumb2_blx_out_of_range.o): New rules.
3511 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3512 thumb2_blx_in_range and thumb2_blx_out_of_range.
3513 * testsuite/Makefile.in: Regenerate.
3514 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3515 * testsuite/thumb_blx_in_range.s: New file.
3516 * testsuite/thumb_blx_out_of_range.s: New file.
3517
b0193076
RÁE
35182010-03-22 Rafael Espindola <espindola@google.com>
3519
3520 * archive.cc (Should_include): Move to archive.h.
3521 (should_include_member): Make it a member of Archive.
3522 (Lib_group): New.
3523 (Add_lib_group_symbols): New.
3524 * archive.h: Include options.h.
3525 (Archive_member): Moved from Archive.
3526 (Should_include): Moved from archive.cc.
3527 (Lib_group): New.
3528 (Add_lib_group_symbols): New.
3529 * dynobj.cc (do_should_include_member): New.
3530 * dynobj.h (do_should_include_member): New.
3531 * gold.cc (queue_initial_tasks): Update call to queue.
3532 * main.cc (main): Print lib group stats.
3533 * object.cc (do_should_include_member): New.
3534 * object.h: Include archive.h.
3535 (Object::should_include_member): New.
3536 (Object::do_should_include_member): New.
3537 (Sized_relobj::do_should_include_member): New.
3538 * options.cc (General_options::parse_start_lib): New.
3539 (General_options::parse_end_lib): New.
3540 (Input_arguments::add_file): Handle lib groups.
3541 (Input_arguments::start_group): Check we are not in a lib.
3542 (Input_arguments::start_lib): New.
3543 (Input_arguments::end_lib): New.
3544 * options.h (General_options): Add start_lib and end_lib.
3545 (Input_argument::lib_): New.
3546 (Input_argument::lib): New.
3547 (Input_argument::is_lib): New.
3548 (Input_file_lib): New.
3549 (Input_arguments::in_lib_): New.
3550 (Input_arguments::in_lib): New.
3551 (Input_arguments::start_lib): New.
3552 (Input_arguments::end_lib_): New.
3553 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3554 in unused members as preempted.
3555 (Sized_pluginobj::do_should_include_member): New.
3556 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3557 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3558 return the blocker.
3559 (Read_symbols::do_whole_lib_group): New.
3560 (Read_symbols::do_lib_group): New.
3561 (Read_symbols::do_read_symbols): Handle lib groups.
3562 (Read_symbols::get_name): Handle lib groups.
3563 * readsyms.h (Read_symbols): Add an archive member pointer.
3564 (Read_symbols::do_whole_lib_group): New.
3565 (Read_symbols::do_lib_group): New.
3566 (Read_symbols::member_): New.
3567 * script.cc (read_input_script): Update call to queue_soon.
3568
d099120c
DK
35692010-03-19 Doug Kwan <dougkwan@google.com>
3570
3571 * arm.cc (Stub_table::Stub_table): Initialize new data members
3572 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3573 (Stub_table::add_reloc_stub): Assign stub offset and update
3574 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3575 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3576 New data members.
3577 (Stub_table::update_data_size_and_addralign): Use
3578 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3579 instead of going over all reloc stubs.
3580 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3581 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3582 Stringpool_template::offset_ to size of Stringpool_char.
3583 (Stringpool_template::new_key_offset): Remove code to initialize
3584 Stringpool_template::offset_.
3585 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3586 Stringpool_template::offset_ to zero.
3587
1aa37384
DK
35882010-03-15 Doug Kwan <dougkwan@google.com>
3589
3590 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3591 offset_.
3592 (Stringpool_template::new_key_offset): New method.
3593 (Stringpool_template::add_string): Assign offsets when adding new
3594 strings.
3595 (Stringpool_template::set_string_offsets): Do not set string offsets
3596 when not optimizing.
3597 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3598 member size_.
3599 (Chunked_vector::clear): Clear size_.
3600 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3601 (Chunked_vector::size): Return size_.
3602 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3603 (Chunked_vector::size_): New data member.
1aa37384
DK
3604 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3605 (Stringpool_template::new_key_offset): New method declaration.
3606 (Stringpool_template::offset_): New data member.
3607
b672b057
RÁE
36082010-03-15 Rafael Espindola <espindola@google.com>
3609
3610 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3611 Add_symbols' constructor.
3612 * readsyms.h (Add_symbols): Remove the input_group member.
3613
b6848d3c
ILT
36142010-03-10 Ian Lance Taylor <iant@google.com>
3615
3616 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3617 target to ask whether a reference to a symbol requires a stack
3618 split.
3619 * target.h (Target::is_call_to_non_split): New function.
3620 (Target::do_is_call_to_non_split): Declare virtual function.
3621 * target.cc: Include "symtab.h".
3622 (Target::do_is_call_to_non_split): New function.
3623 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3624
a2a5469e
CC
36252010-03-10 Cary Coutant <ccoutant@google.com>
3626
3627 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3628 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3629 (File_read::open[2]): Add whole_file_view_ to list of views.
3630 (File_read::make_view): Remove test of whole_file_view_.
3631 (File_read::find_or_make_view): Create whole_file_view_ if
3632 necessary.
3633 (File_read::clear_views): Replace bool parameter with enum;
3634 adjust all callers. Don't delete views with permanent data;
3635 do delete cached views and views from archives if
3636 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3637 if clearing the corresponding view.
3638 * fileread.h (File_read::Clear_views_mode): New enum.
3639 (File_read::View::is_permanent_view): New method.
3640 (File_read::clear_views): Replace bool parameter
3641 with enum; adjust all callers.
3642 * options.h (General_options): Change keep_files_mapped option;
3643 add map_whole_files.
3644 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3645 releasing the file.
3646 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3647 the file.
3648
8861f32b
DM
36492010-03-10 David S. Miller <davem@davemloft.net>
3650
3651 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
3652
d62d0f5f
ST
36532010-03-09 Sriraman Tallam <tmsriram@google.com>
3654
3655 * icf.cc (get_section_contents): Add '@' marker after processing the
3656 merge reloc.
3657
9177756d
DK
36582010-03-08 Doug Kwan <dougkwan@google.com>
3659
3660 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
3661 due to a conversion warning.
3662 (Arm_relobj::update_output_local_symbol_count): Check for local
3663 symbol with unset output index.
3664
9e9e071b
ILT
36652010-03-05 Ian Lance Taylor <iant@google.com>
3666
3667 * options.h (class General_options): Add --spare-dynamic-tags.
3668 * output.cc (Output_data_dynamic::set_final_data_size): Implement
3669 --spare-dynamic-tags.
3670
a81ee015
ILT
36712010-03-05 Ian Lance Taylor <iant@google.com>
3672
3673 * incremental.cc: Include "libiberty.h".
3674
44ec90b9
RO
36752010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3676
3677 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
3678 function, is_info_ member.
3679 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
3680 (Versions::Versions): Update caller.
3681 (Versions::define_base_version): Likewise.
3682 (Versions::add_def): Likewise.
3683
0897ed3b
ST
36842010-03-03 Sriraman Tallam <tmsriram@google.com>
3685
3686 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
3687 (Scan::possible_function_pointer_reloc): New function.
3688 (Scan::local_reloc_may_be_function_pointer): Change to call
3689 possible_function_pointer_reloc.
3690 (Scan::global_reloc_may_be_function_pointer): Ditto.
3691 * icf.h (Icf::check_section_for_function_pointers): Change to reject
3692 relocations in ".data.rel.ro._ZTV" section.
3693 * testsuite/icf_safe_so_test.sh: Change to pass i386.
3694 * testsuite/icf_safe_so_test.cc: Ditto.
3695 * testsuite/icf_safe_test.cc: Ditto.
3696 * testsuite/icf_safe_test.sh: Ditto.
3697
d3bbad62
ILT
36982010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3699 Ian Lance Taylor <iant@google.com>
3700
3701 * target-reloc.h (relocate_section): Check the symbol table index
3702 for -1U before setting the local symbol index.
3703 (scan_relocatable_relocs): If copying the relocation, record that
3704 the local symbol is required.
3705 * object.h (Symbol_value::is_output_symtab_index_set): New
3706 function.
3707 (Symbol_value::may_be_discarded_from_output_symtab): New
3708 function.
3709 (Symbol_value::has_output_symtab_entry): New function.
3710 (Symbol_value::needs_output_symtab_entry): Remove.
3711 (Symbol_value::output_symtab_index): Make sure the symbol index is
3712 set.
3713 (Symbol_value::set_output_symtab_index): Make sure the symbol
3714 index is not set. Make sure the new index is valid.
3715 (Symbol_value::set_must_have_output_symtab_entry): New function.
3716 (Symbol_value::has_output_dynsym_entry): New function.
3717 (Symbol_value::set_output_dynsym_index): Make sure the new index
3718 is valid.
3719 (Sized_relobj::set_must_have_output_symtab_entry): New function.
3720 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
3721 local symbol if permitted.
3722 (Sized_relobj::do_finalize_local_symbols): Call
3723 is_output_symtab_index_set rather than needs_output_symtab_entry.
3724 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
3725 rather than needs_output_symtab_entry. Call
3726 has_output_dynsym_entry rather than needs_output_dynsym_entry.
3727 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
3728 is_output_symtab_index_set rather than needs_output_symtab_entry.
3729 * testsuite/discard_locals_relocatable_test.c: New file.
3730 * testsuite/discard_locals_test.sh: Test -r.
3731 * testsuite/Makefile.am (check_DATA): Add
3732 discard_locals_relocatable_test1.syms,
3733 discard_local_relocatable_test2.syms.
3734 (MOSTLYCLEANFILES): Likewise. Also add
3735 discard_locals_relocatable_test1.lout and
3736 discard_locals_relocatable_test2.out.
3737 (discard_locals_relocatable_test1.syms): New target.
3738 (discard_locals_relocatable_test.o): New target.
3739 (discard_locals_relocatable_test1.out): New target.
3740 (discard_locals_relocatable_test2.syms): New target.
3741 (discard_locals_relocatable_test2.out): New target.
3742 (various): Add missing ../ld-new dependencies.
3743 * testsuite/Makefile.in: Rebuild.
3744
7e8ccf26
NC
37452010-03-03 Nick Clifton <nickc@redhat.com>
3746
3747 * po/fi.po: New Finnish translation.
3748
2a0ff005
DK
37492010-03-01 Doug Kwan <dougkwan@google.com>
3750
3751 * layout.cc (Layout::Layout): Force section types of .init_array*,
3752 .preinit_array* and .fini_array* sections.
3753 * output.cc (Output_section::Input_section_sort_entry::has_priority):
3754 Fix check of return value of std::string::find.().
3755 (Output_section::Input_section_sort_compare::operator()): Remove
3756 comment about .init_array.
3757 (Output_section::Input_section_sort_init_fini_compare::operator()):
3758 New method.
3759 (Output_section::sort_attached_input_sections): Handle .init_array
3760 and .fini_array specially.
3761 * output.h (Output_section::Inut_section_sort_compare): Update
3762 comment.
3763 (Output_section::Input_section_sort_init_fini_compare): New struct.
3764
c3e4ae29
DK
37652010-02-26 Doug Kwan <dougkwan@google.com>
3766
3767 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
3768 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
3769 * testsuite/debug_msg.sh: Avoid matching source line number for
3770 use of global variable undef_int.
3771
2fd9ae7a
DK
37722010-02-26 Doug Kwan <dougkwan@google.com>
3773
3774 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
3775 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
3776 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
3777 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
3778 * options.cc (General_options::General_options): Initialize member
3779 fix_v4bx_.
3780 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
3781 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
3782 and rm_no_fix_v4bx.stdout
3783 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
3784 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
3785 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
3786 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
3787 and arm_no_fix_v4bx.
3788 * Makefile.in: Regenerate.
3789 * testsuite/arm_fix_v4bx.s: New file.
3790 * testsuite/arm_fix_v4bx.sh: Ditto.
3791
67ec7d0b
DK
37922010-02-24 Doug Kwan <dougkwan@google.com>
3793
3794 * arm.cc (Target_arm::got_section): Make the .got section the first
3795 non RELRO section in the data segment.
3796 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
3797 suffixes of section names.
3798
10165461
DK
37992010-02-24 Doug Kwan <dougkwan@google.com>
3800
3801 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
3802 flags and attributes merging if an input file is a binary file.
3803 * fileread.cc (Input_file::open): Record format of original file.
3804 * fileread.h (Input_file::Format): New enum type.
3805 (Input_file::Input_file): Initialize data member format_.
3806 (Input_file::format): New method definition.
3807 (Input_file::format_):: New data member.
3808
4a54abbb
DK
38092010-02-24 Doug Kwan <dougkwan@google.com>
3810
3811 * arm.cc (Arm_output_data_got): New class.
3812 (ARM_TCB_SIZE): New constant
3813 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
3814 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
3815 If user uses a script with a SECTIONS clause, issue only a warning
3816 for a misplaced EXIDX input section. Otherwise, issue an error.
3817 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
3818 garbage collection.
3819 (Target_arm::got_mode_index_entry): Handle static linking.
3820 (Target_arm::Scan::local): Ditto.
3821 (Target_arm::Scan::global): Ditto.
3822 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
3823 all incorrectly implemented relocations.
e1df38aa 3824 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
3825 Arm_output_section::fix_exidx_coverage.
3826 * layout.cc (Layout::section_name_mapping): Remove trailing dots
3827 from ".ARM.exidx." and ".ARM.extab.".
3828
ca419a6f
ILT
38292010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3830
3831 * arm.cc (Target_arm::do_finalize_sections): Create attribute
3832 section if it does not already exist.
3833 * attributes.cc (Attributes_section_data::Attributes_section_data):
3834 Don't crash if size is zero.
3835
135b9c78
ILT
38362010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3837 Ian Lance Taylor <iant@google.com>
3838
3839 * gold.cc (queue_middle_tasks): If no input files were opened,
3840 exit.
3841 * workqueue.h (Task_function::Task_function): Assert that there is
3842 a blocker.
3843
bb0bfe4f
DK
38442010-02-22 Doug Kwan <dougkwan@google.com>
3845
3846 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
3847 * icf.cc (get_section_contents): Cast snprintf arguments to long long
3848 types to avoid warnings due to different uint64_t implementations
3849 on different hosts.
3850
2a2b6d42
DK
38512010-02-21 Doug Kwan <dougkwan@google.com>
3852
3853 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
3854 handling of the maximum backward branch offset.
3855 (Arm_relocate_functions::thumb_branch_common): Ditto.
3856 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
3857 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 3858 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
3859 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
3860 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
3861 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
3862 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
3863 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
3864 thumb_bl_out_of_range thumb_bl_out_of_range.o,
3865 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
3866 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
3867 thumb2_bl_out_of_range.o): New rules.
3868 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
3869 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
3870 thumb2_bl_out_of_range
3871 * testsuite/Makefile.in: Regenerate.
3872 * testsuite/arm_bl_in_range.s: New file.
3873 * testsuite/arm_bl_out_of_range.s: Ditto.
3874 * testsuite/arm_branch_in_range.sh: Ditto.
3875 * testsuite/arm_branch_range.t: Ditto.
3876 * testsuite/thumb2_branch_range.t: Ditto.
3877 * testsuite/thumb_bl_in_range.s: Ditto.
3878 * testsuite/thumb_bl_out_of_range.s: Ditto.
3879 * testsuite/thumb_branch_range.t: Ditto.
3880
b487ad64
ST
38812010-02-20 Sriraman Tallam <tmsriram@google.com>
3882
3883 * gc.h (gc_process_relocs): Change vectors to point to the new list.
3884 Add reloc offset information.
3885 * icf.cc (get_section_contents): Change iterators to point to the new
3886 vectors. Add reloc offset information to the contents.
3887 * icf.h (Icf::Sections_reachable_info): New typedef.
3888 (Icf::Sections_reachable_list): New typedef.
3889 (Icf::Offset_info): New typedef.
3890 (Icf::Reloc_info): New struct typedef.
3891 (Icf::Reloc_info_list): New typedef.
3892 (Icf::symbol_reloc_list): Delete method.
3893 (Icf::addend_reloc_list): Delete method.
3894 (Icf::section_reloc_list): Delete method.
3895 (Icf::reloc_info_list): New method.
3896 (Icf::reloc_info_list_): New member.
3897
f96accdf
DK
38982010-02-19 Doug Kwan <dougkwan@google.com>
3899
3900 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
3901 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
3902 * arm.cc (Arm_relocation_functions): New forward declaration.
3903 (Target_arm::Target_arm): Initialize new data members
3904 got_mod_index_offset_ and tls_base_symbol_defined_.
3905 (Target_arm::Relocate::relocate_tls): New method.
3906 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
3907 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
3908 New methods.
3909 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
3910 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
3911 (Target_arm::got_mod_index_offset_,
3912 Target_arm::tls_base_symbol_defined_): New data members.
3913 (Target_arm::Scan::local, Target::Scan::global,
3914 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
3915 relocations.
3916
c8761b9a
DK
39172010-02-18 Doug Kwan <dougkwan@google.com>
3918
3919 * arm.cc (Arm_relobj::find_linked_text_section): New method.
3920 (Arm_relobj::make_exidx_input_section): Pass section index of linked
3921 text section as a parameter becuase some broken tools may not set
3922 the link in section header.
3923 (Target_arm::has_got_section): New method.
3924 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
3925 without any mapping symbol as data only. Remove warning.
3926 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
3927 link in its section header, try to discover the link by inspecting the
3928 REL31 relocation at the beginning of the section.
3929 (Target_arm::Scan::check_non_pic): Report name of offending relocation
3930 in error message.
3931 (Target_arm::Scan::global): Treat any reference to the symbol
3932 _GLOBAL_OFFSET_TABLE_ as a GOT access.
3933
21bb3914
ST
39342010-02-12 Sriraman Tallam <tmsriram@google.com>
3935
3936 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
3937 (Scan::global_reloc_may_be_function_pointer): New function.
3938 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3939 (Scan::global_reloc_may_be_function_pointer): New function.
3940 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3941 (Scan::global_reloc_may_be_function_pointer): New function.
3942 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
3943 (Scan::global_reloc_may_be_function_pointer): New function.
3944 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
3945 (Scan::global_reloc_may_be_function_pointer): New function.
3946 (Scan::possible_function_pointer_reloc): New function.
3947 (Target_x86_64::can_check_for_function_pointers): New function.
3948 * gc.h (gc_process_relocs): Scan relocation types to determine if
3949 function pointers were taken for targets that support it.
3950 * icf.cc (Icf::find_identical_sections): Include functions for
3951 folding in safe ICF whose pointer is not taken.
3952 * icf.h (Secn_fptr_taken_set): New typedef.
3953 (fptr_section_id_): New member.
3954 (section_has_function_pointers): New function.
3955 (set_section_has_function_pointers): New function.
3956 (check_section_for_function_pointers): New function.
3957 * options.h: Fix comment for safe ICF option.
3958 * target.h (can_check_for_function_pointers): New function.
3959 * testsuite/Makefile.am: Add icf_safe_so_test test case.
3960 Modify icf_safe_test for X86-64.
3961 * testsuite/Makefile.in: Regenerate.
3962 * testsuite/icf_safe_so_test.cc: New file.
3963 * testsuite/icf_safe_so_test.sh: New file.
3964 * testsuite/icf_safe_test.cc (kept_func_3): New function.
3965 (main): Change to take pointer to function kept_func_3.
3966 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
3967 folding is done correctly for X86-64.
3968
0da6fa6c
DM
39692010-02-12 David S. Miller <davem@davemloft.net>
3970
3971 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
3972 is_symbolless parameter.
3973 (Output_reloc<SHT_REL>::is_symbolless): New.
3974 (Output_reloc<SHT_REL>::is_symbolless_): New.
3975 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
3976 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
3977 (Output_reloc<SHT_RELA>::is_symbolless): New.
3978 (Output_data_reloc::add_global): Handle is_symbolless.
3979 (Output_data_reloc::add_global_relative): Likewise.
3980 (Output_data_reloc::add_local): Likewise.
3981 (Output_data_reloc::add_local_relative): Likewise.
3982 (Output_data_reloc::add_symbolless_global_addend): New.
3983 (Output_data_reloc::add_symbolless_local_addend): New.
3984 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
3985 is_symbolless.
3986 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
3987 instead of ->is_relative_
3988 (Output_reloc::write): Likewise.
3989 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
3990 (Output_reloc::write_rel): Simplify.
3991
3992 * sparc.cc (Target_sparc::Scan::local): Use
3993 ->add_symbolless_local_addend as needed.
3994 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
3995 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
3996 based upon relocation offset.
3997
e4782e83
DK
39982010-02-11 Doug Kwan <dougkwan@google.com>
3999
4000 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4001 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4002 beginning of function.
4003 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4004 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4005 parameter is_32bit in calls to should_apply_static_reloc.
4006 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4007 (check_DATA): Add arm_abs_global.stdout.
4008 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4009 arm_abs_global.stdout): New rules.
4010 (MOSTLLYCLEANFILES): Add arm_abs_global
4011 * Makefile.in: Regenerate.
4012 * testsuite/arm_abs_global.s: New file.
4013 * testsuite/arm_abs_global.sh: Ditto.
4014 * testsuite/arm_abs_lib.s: Ditto.
4015
93ceb764
ILT
40162010-02-11 Ian Lance Taylor <iant@google.com>
4017
4018 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4019 Read_relocs task.
4020 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4021 Allocate_commons_task first.
4022 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4023 task, rather than symtab_lock_.
4024 (Gc_process_relocs::~Gc_process_relocs): New function.
4025 (Gc_process_relocs::is_runnable): Check this_blocker_.
4026 (Gc_process_relocs::locks): Use next_blocker_ rather than
4027 blocker_.
4028 (Scan_relocs::~Scan_relocs): New function.
4029 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4030 symtab_lock_.
4031 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4032 next_blocker_.
4033 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4034 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4035 constructor accordingly.
4036 (class Gc_process_relocs): Likewise.
4037 (class Scan_relocs): Likewise.
4038 * common.h (class Allocate_commons_task): Remove symtab_lock_
4039 field, and corresponding constructor parameter.
4040 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4041 symtab_lock_.
4042 (Allocate_commons_task::locks): Likewise.
4043
114dfbe1
ILT
40442010-02-11 Ian Lance Taylor <iant@google.com>
4045
4046 * gold-threads.h (class Once): Define.
4047 (class Initialize_lock): Rewrite as child of Once.
4048 * gold-threads.cc (class Once_initialize): Define.
4049 (once_pointer_control): New static variable.
4050 (once_pointer, once_arg): New static variables.
4051 (c_run_once): New static function.
4052 (Once::Once, Once::run_once, Once::internal_run): New functions.
4053 (class Initialize_lock_once): Remove.
4054 (initialize_lock_control): Remove.
4055 (initialize_lock_pointer): Remove.
4056 (initialize_lock_once): Remove.
4057 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4058 (Initialize_lock::initialize): Rewrite.
4059 (Initialize_lock::do_run_once): New function.
4060 * archive.cc (Archive::interpret_header): Only clear name if it is
4061 not already empty.
4062 * fileread.cc: Include "gold-threads.h"
4063 (file_counts_lock): New static variable.
4064 (file_counts_initialize_lock): Likewise.
4065 (File_read::release): Only increment counts when using --stats.
4066 Use a lock around the increment.
4067 * parameters.cc (class Set_parameters_target_once): Define.
4068 (set_parameters_target_once): New static variable.
4069 (Parameters::Parameters): Move here from parameters.h.
4070 (Parameters::set_target): Rewrite.
4071 (Parameters::set_target_once): New function.
4072 (Parameters::clear_target): Move here and rewrite.
4073 * parameters.h (class Parameters): Update declarations. Add
4074 set_parameters_target_once_ field.
4075 (Parameters::Parameters): Move to parameters.cc.
4076 (Parameters::clear_target): Likewise.
4077 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4078 task.
4079 (Start_group::~Start_group): New function.
4080 (Start_group::is_runnable): New function.
4081 (Start_group::locks, Start_group::run): New functions.
4082 (Finish_group::run): Change saw_undefined to size_t.
4083 * readsyms.h (class Start_group): Define.
4084 (class Finish_group): Change saw_undefined_ field to size_t.
4085 (Finish_group::Finish_group): Remove saw_undefined and
4086 this_blocker parameters. Change all callers.
4087 (Finish_group::set_saw_undefined): New function.
4088 (Finish_group::set_blocker): New function.
4089 * symtab.h (class Symbol_table): Change saw_undefined to return
4090 size_t. Change saw_undefined_ field to size_t.
4091 * target-select.cc (Set_target_once::do_run_once): New function.
4092 (Target_selector::Target_selector): Initialize set_target_once_
4093 field. Don't initialize lock_ and initialize_lock_ fields.
4094 (Target_selector::instantiate_target): Rewrite.
4095 (Target_selector::set_target): New function.
4096 * target-select.h (class Set_target_once): Define.
4097 (class Target_selector): Update declarations. Make
4098 Set_target_once a friend. Remove lock_ and initialize_lock_
4099 fields. Add set_target_once_ field.
4100
fa17a3f4
ILT
41012010-02-10 Ian Lance Taylor <iant@google.com>
4102
4103 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4104 queueing any tasks.
4105 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4106 (queue_middle_tasks): Add all blockers before queueing any tasks.
4107 (queue_final_tasks): Likewise.
4108 * token.h (Task_token::add_blockers): New function.
4109 * object.h (Input_objects::number_of_relobjs): New function.
4110
c7177d31
ILT
41112010-02-10 Ian Lance Taylor <iant@google.com>
4112
5de0e392
ILT
4113 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4114 shared, not if not position independent.
4115 * x86_64.cc (Relocate::relocate_tls): Likewise.
4116 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4117 (tls_pie_pic_test): New target.
4118 * testsuite/Makefile.in: Rebuild.
4119
c7177d31
ILT
4120 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4121 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4122 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4123 * testsuite/Makefile.in: Rebuild.
4124
684b268a
DM
41252010-02-09 David S. Miller <davem@davemloft.net>
4126
4127 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4128 R_SPARC_RELATIVE using ->add_local_relative().
4129 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4130
612a8d3d
DM
4131 * output.h (Output_data_dynamic::add_section_size): New method
4132 that takes two Output_data objects.
4133 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4134 entry param. Handle it in initializers.
4135 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4136 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4137 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4138 arg.
4139 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4140 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4141 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4142 for dynrel_includes_plt.
4143 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4144 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4145 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4146 before .rela.plt
4147 (Target_sparc::do_finalize_sections): Update to pass true for
4148 dynrel_includes_plt.
4149 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4150 output before .rela.plt
4151 (Target_powerpc::do_finalize_sections): Update to pass true for
4152 dynrel_includes_plt when 32-bit.
4153
cb1be87e
DK
41542010-02-08 Doug Kwan <dougkwan@google.com>
4155
4156 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4157 method.
4158 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4159 Arm_relobj::scan_section_for_cortex_a8_stubs,
4160 Arm_relobj::do_relocation_section): Instead of calling
4161 Output_section::output_address, use faster
4162 Arm_relobj::simple_input_section_output_address.
4163
705b5121
DM
41642010-02-08 David S. Miller <davem@davemloft.net>
4165
4166 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4167 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4168 relocation helper function.
4169
024c4466
DM
4170 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4171 just like R_SPARC_GOT{10,13,22}.
4172 (Target_sparc::Scan::local): Likewise.
4173 (Target_sparc::Relocate:relocate): Likewise.
4174
9109c078
ILT
41752010-02-06 Ian Lance Taylor <iant@google.com>
4176
4177 * configure.ac: Rewrite targetobjs duplicate removal code to use
4178 only shell constructs.
4179 * configure: Rebuild.
4180
cf846138
DK
41812010-02-05 Doug Kwan <dougkwan@google.com>
4182
4183 PR 11247
4184 * arm.cc (Arm_relobj::section_is_scannable): New method.
4185 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4186 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4187
6cfaf60b
DK
41882010-02-04 Doug Kwan <dougkwan@google.com>
4189
4190 PR 11247
4191 * arm-reloc-property.cc (cstdio): Include.
4192 * configure.ac (targetobjs): Remove duplicates.
4193 * configure: Regenerate.
4194 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4195 big and little endian version for a given address size.
4196
5c57f1be
DK
41972010-02-03 Doug Kwan <dougkwan@google.com>
4198
4199 * arm-reloc-property.cc
4200 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4201 definition.
4202 * arm-reloc-property.h
4203 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4204 New method definition.
4205 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4206 declaration.
4207 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4208 overflow to N.
4209 (GOT_PREL): Change implemented to Y.
4210 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4211 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4212 (Arm_relocate_functions::movw_abs_nc): Remove method.
4213 (Arm_relocate_functions::movt_abs): Ditto.
4214 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4215 (Arm_relocate_functions::thm_movt_abs): Ditto.
4216 (Arm_relocate_functions::movw_rel_nc): Ditto.
4217 (Arm_relocate_functions::movw_rel): Ditto.
4218 (Arm_relocate_functions::movt_rel): Ditto.
4219 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4220 (Arm_relocate_functions:thm_movw_rel): Ditto.
4221 (Arm_relocate_functions:thm_movt_rel): Ditto.
4222 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4223 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4224 New method definitions.
4225 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4226 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4227 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4228 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4229 (Target_arm::Relocate::relocate): Check for non-static or
4230 unimplemented relocation code and exit early. Change calls to
4231 Target_arm::reloc_uses_thumb_bit and
4232 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4233 instead. Refactor code to handle similar relocations to increase
4234 code sharing. Remove check for unsupported relocation code in switch
4235 statement.
4236 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4237 relocation property table to find out size. Change error message to
4238 print out the name of a relocation code instead of the numeric value.
4239 (Target_arm::scan_reloc_for_stub): Use relocation property table
4240 instead of calling Target_arm::reloc_uses_thumb_bit().
4241
218c5831
DK
42422010-02-02 Doug Kwan <dougkwan@google.com>
4243
4244 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4245 types of relaxed input section.
4246
0d31c79d
DK
42472010-02-02 Doug Kwan <dougkwan@google.com>
4248
4249 * Makefile.am (HFILES): Add arm-reloc-property.h.
4250 (DEFFILES): New.
4251 (TARGETSOURCES): Add arm-reloc-property.cc
4252 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4253 (libgold_a_SOURCES): $(DEFFILES)
4254 * Makefile.in: Regenerate.
4255 * arm-reloc-property.cc: New file.
4256 * arm-reloc-property.h: New file.
4257 * arm-reloc.def: New file.
4258 * arm.cc: Update comments.
4259 (arm-reloc-property.h): New included header.
4260 (arm_reloc_property_table): New global variable.
4261 (Target_arm::do_select_as_default_target): New method definition.
4262 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4263 arm-reloc-property to targ_extra_obj.
4264 * parameters.cc (set_parameters_target): Call
4265 Target::select_as_default_target().
4266 * target.h (Target::select_as_default_target): New method definition.
4267 (Target::do_select_as_default_target): Same.
4268
546c7457
DK
42692010-02-01 Doug Kwan <dougkwan@google.com>
4270
4271 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4272 first_output_text_section_.
4273 (Arm_exidx_fixup::first_output_text_section): New method definition.
4274 (Arm_exidx_fixup::first_output_text_section_): New data member.
4275 (Arm_exidx_fixup::process_exidx_section): Record the first text
4276 output section seen.
4277 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4278 and entsize in output section header.
4279
11b861d5
DK
42802010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4281
4282 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4283 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4284 (Arm_relocate_functions::thm_alu11): New Method.
4285 (Arm_relocate_functions::thm_pc8): New Method.
4286 (Arm_relocate_functions::thm_pc12): New Method.
4287 (Target_arm::Scan::local): Handle the relocations.
4288 (Target_arm::Scan::global): Likewise.
4289 (Target_arm::Relocate::relocate): Likewise.
4290 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4291
c9a2c125
DK
42922010-01-29 Doug Kwan <dougkwan@google.com>
4293
4294 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4295 of relocation types as ld.
4296
1521477a
DK
42972010-01-29 Doug Kwan <dougkwan@google.com>
4298
4299 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4300 to public.
4301 (Arm_relocate_functions::thumb_branch_common): Ditto.
4302 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4303 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4304 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4305 Arm_relocate_functions::jump24): Remove.
4306 (Target_arm::Relocate::relocate): Adjust code to call
4307 Arm_relocation_functions::arm_branch_common and
4308 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4309 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4310
e7eca48c
DK
43112010-01-29 Doug Kwan <dougkwan@google.com>
4312
4313 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4314 output_local_symbol_count_needs_update_.
4315 (Arm_relobj::output_local_symbol_count_needs_update,
4316 Arm_relobj::set_output_local_symbol_count_needs_update,
4317 Arm_relobj::update_output_local_symbol_count): New methods.
4318 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4319 member.
4320 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4321 of pointed function as in a R_ARM_PREL31 relocation.
4322 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4323 for output local symbol count updating.
4324 (Target_arm::do_relax): Update output local symbol counts in objects
4325 if necessary.
4326 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4327
02961d7e
ILT
43282010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4329
4330 * arm.cc: Added support for the ARM relocations:
4331 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4332 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4333 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4334 movw_prel_nc).
4335 (Arm_relocate_functions::movw_rel): New method.
4336 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4337 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4338 thm_movw_prel_nc).
4339 (Arm_relocate_functions::thm_movw_rel): New method.
4340 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4341 thm_movt_prel).
4342 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4343 relocations.
4344 (Target_arm::Scan::global): Likewise.
4345 (Target_arm::Relocate::relocate): Likewise.
4346 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4347 Likewise.
4348
b10d2873
ILT
43492010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4350
4351 * arm.cc: Added support for ARM group relocations.
4352 (Target_arm::reloc_needs_sym_origin): New method.
4353 (Arm_relocate_functions::calc_grp_kn): New method.
4354 (Arm_relocate_functions::calc_grp_residual): New method.
4355 (Arm_relocate_functions::calc_grp_gn): New method.
4356 (Arm_relocate_functions::arm_grp_alu): New Method.
4357 (Arm_relocate_functions::arm_grp_ldr): New Method.
4358 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4359 (Arm_relocate_functions::arm_grp_ldc): New Method.
4360 (Target_arm::Scan::local): Handle the ARM group relocations.
4361 (Target_arm::Scan::global): Likewise.
4362 (Target_arm::Relocate::relocate): Likewise.
4363 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4364 Likewise.
4365
2b328d4e
DK
43662010-01-26 Doug Kwan <dougkwan@google.com>
4367
4368 * arm.cc (set): Include.
4369 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4370 pointer type.
4371 (Arm_output_section::Text_section_list): New type.
4372 (Arm_output_section::append_text_sections_to_list): New method.
4373 (Arm_output_section::fix_exidx_coverage): Ditto.
4374 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4375 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4376 Relobj::set_section_offset() instead of
4377 Sized_relobj::invalidate_section_offset().
4378 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4379 parameter for section headers. Ignore relocation sections for
4380 unallocated sections and EXIDX sections.
4381 (Target_arm::fix_exidx_coverage): New method.
4382 (Target_arm::output_section_address_less_than): New type.
4383 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4384 linked text section instead of the EXIDX section.
4385 (Arm_output_section::create_stub_group): Add an assertion to check
4386 that this is not an EXIDX output section.
4387 (Arm_output_section::append_text_sections_to_list): New method.
4388 (Arm_output_section::fix_exidx_coverage): Ditto.
4389 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4390 Arm_relobj::section_needs_reloc_stub_scanning.
4391 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4392 first pass.
4393 (Target_arm::fix_exidx_coverage): New method.
4394 * object.h (Relobj::set_output_section): New method.
4395 (Sized_relobj::invalidate_section_offset): Remove method.
4396 (Sized_relobj::do_invalidate_section_offset): Remove method.
4397 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4398
c7f3c371
DK
43992010-01-25 Doug Kwan <dougkwan@google.com>
4400
4401 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4402 Fix warning due to signed and unsigned comparison on a 32-bit host.
4403
8923b24c
DK
44042010-01-22 Doug Kwan <dougkwan@google.com>
4405
4406 * arm.cc (Target_arm::do_relax): Record an output section for section
4407 offset adjustment it contains any stub table that has changed.
4408 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4409 offsets in an output section if necessary.
4410 * output.cc (Output_section::Output_section): Initialize
4411 section_offsets_need_adjustments_.
4412 (Output_section::add_input_section_for_script): Renamed to
4413 Output_section::add_simple_input_section.
4414 (Output_section::save_states): Add a comment.
4415 (Output_section::discard_states): New method defintion.
4416 (Output_section::adjust_section_offsets): Same.
4417 * output.h (Output_section::add_input_section_for_script): Renamed to
4418 Output_section::add_simple_input_section.
4419 (Output_section::discard_states): New method declaration.
4420 (Output_section::adjust_section_offsets): Same.
4421 (Output_section::section_offsets_need_adjustment,
4422 Output_section::set_section_offsets_need_adjustment): New method
4423 definitions.
4424 (Output_section::section_offsets_need_adjustment_): New data member.
4425 * script-sections.cc
4426 (Output_section_element_input::set_section_address): Adjust code for
4427 renaming of Output_section::add_input_section_for_script.
4428 (Orphan_output_section::set_section_address): Same.
4429
9b2fd367
DK
44302010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4431
4432 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4433 Fix_v4bx enum values .
4434 * gold/options.h (General_options): New option definitions.
4435 (General_options::fix_v4bx): New method.
4436 (General_options::Fix_v4bx): New enum.
4437 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4438 (General_options::parse_fix_v4bx_interworking): New method.
4439
80d0d023
DK
44402010-01-22 Doug Kwan <dougkwan@google.com>
4441
4442 * arm.cc (Arm_exidx_fixup): New class.
4443
af2cdeae
DK
44442010-01-21 Doug Kwan <dougkwan@google.com>
4445
4446 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4447 classes.
4448 (Arm_exidx_section_offset_map): New type.
4449
993d07c1
DK
44502010-01-21 Doug Kwan <dougkwan@google.com>
4451
4452 * arm.cc (Arm_exidx_input_section): New class.
4453 (Arm_relobj::exidx_input_section_by_link,
4454 Arm_relobj::exidx_input_section_by_shndx,
4455 Arm_relobj::make_exidx_input_section): New methods.
4456 (read_arm_attributes_section): Remove.
4457 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4458 information about them.
4459 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4460 to here.
4461
5ac169d4
DK
44622010-01-20 Doug Kwan <dougkwan@google.com>
4463
4464 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4465 Input_section_specifier to Section_id.
4466 (Target_arm::new_arm_input_section: Adjust code for change of key
4467 type.
4468 (Target_arm::find_arm_input_section): Ditto.
4469 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4470 (Section_id): Remove.
4471 (Garbage_collection::Section_id_hash): Remove.
4472 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4473 (Section_id): Remove.
4474 (Icf::Section_id_hash): Remove.
4475 * object.h (Section_id, Const_section_id, Section_id_hash,
4476 Const_section_id_hash): New type definitions.
4477 * output.cc (Output_section::add_relaxed_input_section): Change to
4478 use Const_section_id instead of Input_section_specifier as key type.
4479 (Output_section::add_merge_input_section): Ditto.
4480 (Output_section::build_relaxation_map): Change to use Section_id
4481 instead of Input_section_specifier as key type.
4482 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4483 Ditto.
4484 (Output_section::convert_input_sections_to_relaxed_sections): Change
4485 to use Const_section_id instead of Input_section_specifier as key type.
4486 (Output_section::find_merge_section): Ditto.
4487 (Output_section::find_relaxed_input_section): Ditto.
4488 * output.h (Input_section_specifier): Remove class.
4489 (Output_section::Output_section_data_by_input_section_map): Change
4490 key type to Const_section_id.
4491 (Output_section::Output_relaxed_input_section_by_input_section_map):
4492 Ditto.
4493 (Output_section::Relaxation_map): Change key type to Section_id.
4494
a2162063
ILT
44952010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4496
4497 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4498 (class Arm_v4bx_stub): New class.
4499 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4500 (Stub_factory::make_arm_v4bx_stub): New method.
4501 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4502 (Stub_table::empty): Handle v4bx stubs.
4503 (Stub_table::add_arm_v4bx_stub): New method.
4504 (Stub_table::find_arm_v4bx_stub): New method.
4505 (Arm_relocate_functions::v4bx): New method.
4506 (Target_arm::fix_v4bx): New method.
4507 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4508 (Stub_table::relocate_stubs): Likewise.
4509 (Stub_table::do_write): Likewise.
4510 (Stub_table::update_data_size_and_addralign): Likewise.
4511 (Stub_table::finalize_stubs): Likewise.
4512 (Target_arm::Scan::local): Likewise.
4513 (Target_arm::Scan::global): Likewise.
4514 (Target_arm::do_finalize_sections): Likewise.
4515 (Target_arm::Relocate::relocate): Likewise.
4516 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4517 Likewise.
4518 (Target_arm::scan_reloc_for_stub): Likewise.
4519 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4520
5696ab0b
ILT
45212010-01-19 Ian Lance Taylor <iant@google.com>
4522
4523 * output.cc (Output_section_headers::do_sized_write): Write large
4524 segment count to sh_info field.
4525 (Output_file_header::do_sized_write): For large segment count,
4526 write PN_XNUM to e_phnum field.
4527
800d0f56
ILT
45282010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4529
4530 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4531 (Arm_relocate_functions::thm_jump8): New function.
4532 (Arm_relocate_functions::thm_jump11): New function.
4533 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4534 R_ARM_THM_JUMP11.
4535 (Target_arm::Scan::global): Likewise.
4536 (Target_arm::Relocate::relocate): Likewise.
4537 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4538 Likewise.
4539
41263c05
DK
45402010-01-14 Doug Kwan <dougkwan@google.com>
4541
4542 * arm.cc (map, utility): Include headers.
4543 (Target_arm::apply_cortex_a8_workaround): New method.
4544 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4545 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4546 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4547 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4548 the --[no-]fix-cortex-a8 command line options.
4549 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4550 (Target_arm::relocate_stub): Use addend in instruction template.
4551 * options.h (DEFINE_bool): Set the user-set flag.
4552 (General_options): Add --[no-]-fix-cortex options.
4553 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4554 : Update fast look-up map after conversion.
41263c05 4555
459e9b03
ST
45562010-01-14 Sriraman Tallam <tmsriram@google.com>
4557
4558 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4559 in the first pass of do_layout.
4560
b521dfe4
DK
45612010-01-13 Doug Kwan <dougkwan@google.com>
4562
4563 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4564 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4565 apparent compiler problem of not folding static constant integral
4566 data members of elfcpp::Elf_sizes<32>.
4567
44272192
DK
45682010-01-13 Doug Kwan <dougkwan@google.com>
4569
4570 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4571 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4572 Arm_relobj::scan_section_for_cortex_a8_erratum,
4573 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4574 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4575 sections to scan for relocation stubs into a new method
4576 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4577 relocation and Cortex-A8 stub scanning.
4578 (Target_arm::do_relax): Force stubs to be after stubbed sections
4579 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4580 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4581 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4582
44b71ece
ILT
45832010-01-12 Ian Lance Taylor <iant@google.com>
4584
4585 * target-reloc.h (visibility_error): New inline function.
4586 (relocate_section): Call visibility_error.
4587 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4588 (MOSTLYCLEANFILES): Likewise.
4589 (protected_4_pic.o, protected_3.err): New targets.
4590 * testsuite/protected_4.cc: New file.
4591
a120bc7f
DK
45922010-01-12 Doug Kwan <dougkwan@google.com>
4593
4594 * arm.cc (Cortex_a8_reloc): New class.
4595 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4596 and cortex_a8_relocs_info_.
4597 (Target_arm::fix_cortex_a8): New method definition.
4598 (Target_arm::Cortex_a8_relocs_info): New type.
4599 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4600 New data member declarations.
4601 (Target_arm::scan_reloc_for_stub): Record information about
4602 relocations for THUMB branches that might be exempted from the
4603 Cortex-A8 workaround.
4604 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4605 at the beginning of a relaxation pass.
4606
20138696
DK
46072010-01-12 Doug Kwan <dougkwan@google.com>
4608
4609 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4610 (Arm_relobj::Mapping_symbol_position,
4611 Arm_reloj::Mapping_symbol_position_less,
4612 Arm_relobj::Mapping_symbols_info): New types.
4613 (Target_arm::is_mapping_symbol_name): New method definition.
4614 (Arm_relobj::do_count_local_symbols): Save information about mapping
4615 symbols.
4616
089d69dc
DK
46172010-01-11 Doug Kwan <dougkwan@google.com>
4618
4619 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4620 Arm_relocate_functions::thumb32_branch_upper,
4621 Arm_relocate_functions::thumb32_branch_lower,
4622 Arm_relocate_functions::thumb32_cond_branch_offset,
4623 Arm_relocate_functions::thumb32_cond_branch_upper,
4624 Arm_relocate_functions::thumb32_cond_branch_lower,
4625 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4626 branch offset encoding.
4627 (Arm_relocate_functions::thumb_branch_common): Use new branch
4628 offset encoding methods to avoid code duplication.
4629 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4630 (Stub_addend_reader::operator()): Use new branch encoding method
4631 to avoid code duplication.
4632
99e5bff2
DK
46332010-01-11 Doug Kwan <dougkwan@google.com>
4634
4635 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4636 (Target_arm::do_finalize_sections): Define special EXIDX section
4637 symbols only if referenced.
4638 * gc.h (Garbage_collection::add_reference): New method.
4639 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4640 code duplication.
4641
98e090bd
ILT
46422010-01-11 Ian Lance Taylor <iant@google.com>
4643
d0a91bd8
ILT
4644 * script.cc (Version_script_info::build_expression_list_lookup):
4645 Change complaing about duplicate wildcard match from error to
4646 warning.
4647
98e090bd
ILT
4648 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4649 of 2009-12-30.
4650 (Version_script_info::Version_script_info): Initialize globs_,
4651 default_version_, default_is_global_, and exact_. Don't
4652 initialize globals_ or locals_.
4653 (Version_script_info::build_lookup_tables): Build local symbols
4654 first.
4655 (Version_script_info::unquote): New function.
4656 (Version_script_info::add_exact_match): New function.
4657 (Version_script_info::build_expression_list_lookup): Remove lookup
4658 parameter. Add is_global parameter. Change all callers. Handle
4659 wildcard pattern specially. Unquote pattern. Call
4660 add_exact_match.
4661 (Version_script_info::get_name_to_match): New function.
4662 (Version_script_info::get_symbol_version): New function.
4663 (Version_script_info::get_symbol_version_helper): Remove.
4664 (Version_script_info::check_unmatched_names): Call unquote.
4665 * script.h (class Version_script_info): Change get_symbol_version
4666 to be non-inline and add is_global parameter; change all callers.
4667 Rewrite symbol_is_local. Update declarations. Define struct
4668 Version_tree_match, Exact, Globs. Don't define struct Lookup.
4669 Remove globals_ and locals_ members. Add exact_, globs_,
4670 default_version_, is_global_.
4671 (Version_script_info::Glob): Remove pattern, add expression and
4672 is_global. Update constructor. Change all callers.
4673 * dynobj.cc (Versions::finalize): Mark the version symbol as the
4674 default version.
4675 (Versions::symbol_section_contents): If a symbol is undefined, or
4676 defined in a dynamic object, set the version index to
4677 VER_NDX_LOCAL.
4678 * symtab.cc (Symbol_table::add_from_relobj): Don't call
4679 symbol_is_local.
4680 (Symbol_table::add_from_pluginobj): Likewise.
4681 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
4682
d56962d3
DK
46832010-01-11 Doug Kwan <dougkwan@google.com>
4684
4685 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
4686 (incremental_dump_LDADD): Add linking option for libintl.
4687 * Makefile.in: Regenerate.
4688
94e6ee91
L
46892010-01-11 H.J. Lu <hongjiu.lu@intel.com>
4690
4691 PR gold/11144
4692 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
4693 instead of -Ds.
4694 * testsuite/Makefile.in: Regenerated.
4695
e96c574b
DK
46962010-01-10 Doug Kwan <dougkwan@google.com>
4697
4698 * options.h (DEFINE_var): Use parentheses around argument varname__
4699 in macro body to avoid any unintended subsequent substitutions.
4700
7198066b
ILT
47012010-01-10 Ian Lance Taylor <iant@google.com>
4702
ba4d53bf
ILT
4703 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
4704 candidates before doing symbol resolution.
4705
7198066b
ILT
4706 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
4707 ODR candidates if only one is weak.
4708
a2beed37
ILT
47092010-01-08 Ian Lance Taylor <iant@google.com>
4710
4711 * script.cc (Version_script_info::build_expression_list_lookup):
4712 Don't warn about ambiguous version, just record the ambiguity.
4713 (Version_script_info::get_symbol_version_helper): Give error if
4714 version is ambiguous.
4715
2fb7225c
DK
47162010-01-08 Doug Kwan <dougkwan@google.com>
4717
4718 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
4719 prev_data_size_ and prev_addralign_. Remove initializer for
4720 deleted data member has_been_changed_.
4721 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
4722 to determine if the table is empty.
4723 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
4724 Remove.
4725 (Stub_table::add_reloc_stub): Define method in class definition
4726 instead of just declaring it there.
4727 (Stub_table::add_cortex_a8_stub): New method definition.
4728 (Stub_table::update_data_size_and_addralign): Ditto.
4729 (Stub_table::finalize_stubs): Ditto.
4730 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
4731 (Stub_table::do_addralign_): Return address alignment in the
4732 (Stub_table::do_reset_address_and_file_offset): Define method in
4733 class definition instead of declaring it there. Set current data
4734 size to be the data size of the previous pass.
4735 (Stub_table::set_final_data_size): Use current data size as the
4736 final data size.
4737 (Stub_table::relocate_stub): Change parameter type of stub from
4738 Reloc_stub pointer to Stub pointer.
4739 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
4740 (Stub_table::Cortex_a8_stub_list): New typedef.
4741 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
4742 Stub_table::prev_addralign_): New data member.
4743 (Arm_relobj::Arm_relobj): Initialize data member
4744 section_has_cortex_a8_workaround_.
4745 (Arm_relobj::section_has_cortex_a8_workaround,
4746 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
4747 definitions.
4748 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
4749 declarations.
4750 (Target_arm::relocate_stub): Change parameter type of stub from
4751 Reloc_stub pointer to Stub pointer.
4752 (Insn_template::size, Insn_template::alignment): Handle
4753 THUMB16_SPECIAL_TYPE.
4754 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
4755 Stub_table::update_data_size_and_addralign,
4756 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
4757 definitions.
4758 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
4759 (Stub_table::do_write): Ditto.
4760 (Target_arm::do_relax): Adjust code for changes in Stub_table.
4761
880cd20d
ILT
47622010-01-08 Ian Lance Taylor <iant@google.com>
4763
4764 PR 11108
4765 * symtab.h (class Symbol): Remove fields is_target_special_ and
4766 has_plt_offset_. Add field is_defined_in_discarded_section_.
4767 (Symbol::is_defined_in_discarded_section): New function.
4768 (Symbol::set_is_defined_in_discarded_section): New function.
4769 (Symbol::has_plt_offset): Rewrite.
4770 (Symbol::set_plt_offset): Verify that new offset is not -1U.
4771 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
4772 Don't initialize is_target_special_ or has_plt_offset_.
4773 Initialize is_defined_in_discarded_section_.
4774 (Symbol_table::add_from_relobj): If appropriate, set
4775 is_defined_in_discarded_section.
4776 * resolve.cc (Symbol::override_base_with_special): Don't test
4777 is_target_special_. Change has_plt_offset_ to has_plt_offset().
4778 * target-reloc.h (relocate_section): Do special handling for
4779 symbols defined in discarded sections for global symbols as well
4780 as local symbols.
4781
2703e3eb
ILT
47822010-01-08 Ian Lance Taylor <iant@google.com>
4783
4784 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
4785 the SHT_SYMTAB case.
4786
339d40a3
ILT
47872010-01-08 Ian Lance Taylor <iant@google.com>
4788
4789 * object.cc (Sized_relobj::do_layout): Don't get confused if
4790 layout_eh_frame returns NULL.
4791
abecea76
ILT
47922010-01-08 Ian Lance Taylor <iant@google.com>
4793
4794 PR 11084
4795 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
4796 dynamic symbol table, use the normal symbol table.
4797 (Sized_dynobj::do_read_symbols): Remove assertion about type of
4798 symbol table.
4799
6b7dd3f3
ILT
48002010-01-08 Ian Lance Taylor <iant@google.com>
4801
4802 PR 11072
4803 * layout.cc (Layout::include_section): Remove .gnu_debuglink
4804 sections.
4805
36c50e63
L
48062010-01-08 H.J. Lu <hongjiu.lu@intel.com>
4807
4808 * version.cc (print_version): Change to "Copyright 2010".
4809
e291e7b9
ILT
48102010-01-08 Ian Lance Taylor <iant@google.com>
4811
4812 PR 10287
4813 PR 11063
4814 * i386.cc (class Target_i386): Change return type of plt_section
4815 to be non-const.
4816 (class Output_data_plt_i386): Add tls_desc_rel_ field.
4817 (Output_data_plt_i386::Output_data_plt_i386): Initialize
4818 tls_desc_rel_ field.
4819 (Output_data_plt_i386::rel_tls_desc): New function.
4820 (Target_i386::rel_tls_desc_section): New function.
4821 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
4822 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
4823 R_386_TLS_DESC reloc in rel_tls_desc_section.
4824 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
4825 Define struct Tlsdesc_info.
4826 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
4827 (Target_x86_64::do_reloc_symbol_index): New function.
4828 (Target_x86_64::add_tlsdesc_info): New function.
4829 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
4830 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
4831 tlsdesc_rel_ field.
4832 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
4833 all callers.
4834 (Output_data_plt_x86_64::rela_tlsdesc): New function.
4835 (Target_x86_64::rela_tlsdesc_section): New function.
4836 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
4837 handling.
4838 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
4839 (Target_x86_64::do_reloc_addend): New function.
4840 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
4841 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
4842 declarations. Define TARGET_CODE. Add arg field to u1_ union.
4843 (Output_reloc::type): New function.
4844 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
4845 (Output_reloc::is_target_specific): New function.
4846 (Output_reloc::target_arg): New function.
4847 (class Output_reloc) [SHT_RELA]: Add four new constructors for
4848 absolute relocs and target specific relocs.
4849 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
4850 add_target_specific.
4851 (class Output_data_reloc) [SHT_RELA]: Likewise.
4852 * output.cc (Output_reloc::Output_reloc): Add four new versions
4853 for absolute relocs and target specific relocs.
4854 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
4855 (Output_reloc::get_symbol_index): Likewise.
4856 (Output_reloc::local_section_offset): Check that local_sym_index_
4857 is not TARGET_CODE or 0.
4858 (Output_reloc::symbol_value): Likewise.
4859 (Output_reloc::write) [SHT_RELA]: Call target for target specific
4860 reloc.
4861 * target.h (class Target): Add reloc_symbol_index and reloc_addend
4862 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
4863 functions.
4864 * layout.cc (add_target_dynamic_tags): Use output section for
4865 DT_PLTRELSZ and DT_JMPREL.
4866
3a44184e
ILT
48672010-01-07 Ian Lance Taylor <iant@google.com>
4868
4869 PR 11061
4870 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
4871 function.
4872 (class Output_data_reloc_generic): Define.
4873 (class Output_data_reloc_base): Change base class to
4874 Output_data_reloc_generic. Change add() method to call
4875 bump_relative_reloc_count for a relative reloc. Remove
4876 sort_relocs_ field.
4877 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
4878 to sort_relocs().
4879 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
4880 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
4881 appropriate.
4882 * layout.h (class Layout): Update declaration.
4883
ea715a34
ILT
48842010-01-07 Ian Lance Taylor <iant@google.com>
4885
4886 * output.h (class Output_data): Add const version of
4887 output_section and do_output_section.
4888 (class Output_section_data): Add const version of
4889 do_output_section.
4890 (class Output_section): Likewise.
4891 * layout.cc (Layout::add_target_dynamic_tags): New function.
4892 * layout.h (class Layout): Update declarations.
4893 * arm.cc (Target_arm::do_finalize_sections): Use
4894 add_target_dynamic_tags.
4895 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4896 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4897 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4898 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4899
659948a4
ILT
49002010-01-07 Ian Lance Taylor <iant@google.com>
4901
4902 PR 11042
4903 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
4904 object as needed.
4905
9d3b86f6
ILT
49062010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
4907 Ian Lance Taylor <iant@google.com>
4908
4909 PR 11019
4910 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
4911 Xindex::read_symtab_xindex.
4912
bb0d3eb0
DK
49132010-01-07 Doug Kwan <dougkwan@google.com>
4914
4915 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
4916 (Insn_template::thumb16_bcond_insn): New method declaration.
4917 (Insn_template): Fix spelling.
4918 (Stub::thumb16_special): New method declaration.
4919 (Stub::do_write): Define virtual method which was previously pure
4920 virtual.
4921 (Stub::do_thumb16_special): New method declaration.
4922 (Stub::do_fixed_endian_write): New template member.
4923 (Reloc_stub::do_write): Remove.
4924 (Reloc_stub::do_fixed_endian_write): Remove.
4925 (Cortex_a8_stub): New class definition.
4926 (Stub_factory::make_cortex_a8_stub): New method definition.
4927 (Stub_factory::Stub_factory): Add missing static storage class
4928 qualifier for elf32_arm_stub_a8_veneer_blx.
4929
ffeef7df
ILT
49302010-01-07 Ian Lance Taylor <iant@google.com>
4931
dc3f80fe
ILT
4932 PR 10980
4933 * options.h (class General_options): Add --warn-unresolved-symbols
4934 and --error-unresolved-symbols.
4935 * errors.cc (Errors::undefined_symbol): Implement
4936 --warn-unresolved-symbols.
4937
ffeef7df
ILT
4938 * options.h (class General_options): Add -z text and -z textoff.
4939 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
4940
f1ec9ded
ST
49412010-01-06 Sriraman Tallam <tmsriram@google.com>
4942
4943 * gc.h (Garbage_collection::Cident_section_map): New typedef.
4944 (Garbage_collection::cident_sections): New function.
4945 (Garbage_collection::add_cident_section): New function.
4946 (Garbage_collection::cident_sections_): New member.
4947 (gc_process_relocs): Add references to sections whose names are C
4948 identifiers.
4949 * gold.h (cident_section_start_prefix): New constant.
4950 (cident_section_stop_prefix): New constant.
4951 (is_cident): New function.
4952 * layout.cc (Layout::define_section_symbols): Replace string constants
4953 with the newly defined constants.
4954 * object.cc (Sized_relobj::do_layout): Track sections whose names are
4955 C identifiers.
4956 * testsuite/Makefile.am: Add gc_orphan_section_test.
4957 * testsuite/Makefile.in: Regenerate.
4958 * testsuite/gc_orphan_section_test.cc: New file.
4959 * testsuite/gc_orphan_section_test.sh: New file.
4960
6eda8c29
ILT
49612010-01-06 Ian Lance Taylor <iant@google.com>
4962
b9674e17
ILT
4963 PR 10980
4964 * options.h (class General_options): Add --warn-shared-textrel.
4965 * layout.cc (Layout::finish_dynamic_section): Implement
4966 --warn-shared-textrel.
4967
6eda8c29
ILT
4968 PR 10980
4969 * options.h (class General_options): Add --warn-multiple-gp.
4970
32dcd44e
ILT
49712010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4972
4973 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
4974 $(THREADSLIB) and $(LIBDL).
4975 * Makefile.in: Rebuild.
4976
a192ba05
ILT
49772010-01-06 Ian Lance Taylor <iant@google.com>
4978
4979 PR 10980
4980 * options.cc (General_options::parse_section_start): New function.
4981 (General_options::section_start): New function.
4982 (General_options::General_options): Initialize all members.
4983 * options.h: Include <map>
4984 (class General_options): Add --section-start. Add section_starts_
4985 member.
4986 * layout.cc (Layout::attach_allocated_section_to_segment): If
4987 --section-start was used, set the address of the segment. Remove
4988 local sort_sections.
4989 (Layout::relaxation_loop_body): If the address of the load segment
4990 has been set by --section-start, don't use it.
4991 * output.h (Output_segment::update_flags_for_output_section): New
4992 function.
4993 * output.cc (Output_segment::add_output_section): Call
4994 update_flags_for_output_section.
4995
dde3f402
ILT
49962010-01-05 Ian Lance Taylor <iant@google.com>
4997
62dfdd4d
ILT
4998 PR 10980
4999 * options.h (class General_options): Add --undefined-version.
5000 * script.cc (struct Version_expression): Add was_matched_by_symbol
5001 field.
5002 (Version_script_info::matched_symbol): New function.
5003 (Version_script_info::get_symbol_version_helper): Call
5004 matched_symbol.
5005 (Version_script_info::check_unmatched_names): New function.
5006 * script.h (class Version_script_info): Update declarations.
5007 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5008
9c4ae156
ILT
5009 * options.h (class General_options): Use DEFINE_bool_alias for
5010 allow_multiple_definition.
5011 * resolve.cc (Symbol_table::should_override): Don't test
5012 allow_multiple_definition.
5013
dde3f402
ILT
5014 PR 10980
5015 * options.h (class General_options): Add --cref.
5016 * main.cc (main): Print cref table if --cref. Don't close mapfile
5017 until after printing cref table.
5018 * cref.cc: Include "symtab.h".
5019 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5020 (Cref_table_compare::operator()): New function.
5021 (Cref_inputs::gather_cref): New function.
5022 (filecol): New static const.
5023 (Cref_inputs::print_cref): New function.
5024 (Cref::print_cref): New function.
5025 * cref.h: Include <cstdio>.
5026 (class Cref): Update declarations.
5027 * mapfile.h (Mapfile::file): New function.
5028 * object.h (class Object): Define Symbols. Declare virtual
5029 do_get_global_symbols.
5030 (Object::get_global_symbols): New function.
5031 * object.cc (Input_objects::add_object): Pass object to cref_ if
5032 --cref.
5033 (Input_objects::archive_start): Likewise.
5034 (Input_objects::archive_stop): Likewise.
5035 (Input_objects::print_cref): New function.
5036 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5037 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5038 --cref.
5039 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5040 function.
5041 * plugin.h (class Sized_pluginobj): Update declarations.
5042
8781f709
ILT
50432010-01-05 Ian Lance Taylor <iant@google.com>
5044
5045 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5046 to is_default_version. Rename insdef to insdefault.
5047 (Symbol_table::add_from_relobj): Rename def to is_default_version
5048 and local to is_forced_local.
5049 (Symbol_table::add_from_pluginobj): Likewise.
5050 (Symbol_table::add_from_dynobj): Likewise.
5051 (Symbol_table::define_special_symbol): Rename insdef to
5052 insdefault.
5053
fe35d28d
ILT
50542010-01-04 Ian Lance Taylor <iant@google.com>
5055
30bc8c46
ILT
5056 PR 10980
5057 * options.h (class General_options): Add
5058 --allow-multiple-definition and -z muldefs.
5059 * resolve.cc (Symbol_table::should_override): Don't warn about a
5060 multiple symbol definition if --allow-multiple-definition or -z
5061 muldefs.
5062
7eaea549
ILT
5063 PR 10980
5064 * options.h (class General_options): Add --add-needed and
5065 --copy-dt-needed-entries. Tweak --as-needed help entry.
5066 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5067 error if --copy-dt-needed-entries aka --add-needed is used and
5068 would cause a change in behaviour.
5069
fe35d28d
ILT
5070 PR 10980
5071 * options.h (class General_options): Add -G as a short version of
5072 --shared. Add no-op options -assert, -g, and -i.
5073
55a2bb35
ST
50742010-01-04 Sriraman Tallam <tmsriram@google.com>
5075
5076 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5077 check for .text or .gnu.linkonce.t sections.
5078 * icf.cc (Icf::find_identical_sections): Ditto.
5079 Change the detection for mangled function name within the section
5080 name.
5081 * icf.h (is_section_foldable_candidate): New function.
5082
719328e1
ILT
50832009-12-30 Ian Lance Taylor <iant@google.com>
5084
5085 PR 10980
5086 * options.h (class General_options): Permit two dashes with
5087 --retain-symbols-file.
5088
d7bb5745
ILT
50892009-12-30 Ian Lance Taylor <iant@google.com>
5090
403a15dd
ILT
5091 PR 10979
5092 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5093 don't put the file header and segment headers in the text
5094 segment.
5095
eda294df
ILT
5096 PR 10979
5097 * common.cc (Sort_commons::operator()): Stabilize sort when both
5098 entries are NULL.
5099 (Symbol_table::do_allocate_commons_list): When allocating common
5100 symbols, skip a symbol which is no longer common.
5101 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5102 an object before checking its type.
5103 * testsuite/common_test_2.c: New file.
5104 * testsuite/common_test_3.c: New file.
5105 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5106 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5107 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5108 (common_test_2_pic.o, common_test_2.so): New targets.
5109 (common_test_3_pic.o, common_test_3.so): New targets.
5110 * testsuite/Makefile.in: Rebuild.
5111
d7bb5745
ILT
5112 PR 10979
5113 * script.cc (read_input_script): If we see a new SECTIONS clause,
5114 and we have added an input section, give an error.
5115 * layout.h (class Layout): Add have_added_input_section function.
5116 Add have_added_input_section_ field.
5117 * layout.cc (Layout::Layout): Initialize
5118 have_added_input_section_.
5119 (Layout::layout): Set have_added_input_section_.
5120 (Layout::layout_eh_frame): Likewise.
5121
fc59c572
ILT
51222009-12-30 Ian Lance Taylor <iant@google.com>
5123
5124 PR 10931
5125 * options.h (class General_options): Add --sort-common option.
5126 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5127 * common.cc (Sort_common): Add sort_order parameter to
5128 constructor. Add sort_order_ field.
5129 (Sort_commons::operator): Check sort_order_.
5130 (Symbol_table::allocate_commons): Determine the sort order.
5131 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5132 Change all callers.
5133 (Symbol_table::do_allocate_commons_list): Likewise.
5134
1c74fab0
ILT
51352009-12-30 Ian Lance Taylor <iant@google.com>
5136
5137 PR 10916
5138 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5139 symbols from this object, don't change the visibility of an
5140 undefined symbol.
5141 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5142
6affe781
ILT
51432009-12-30 Ian Lance Taylor <iant@google.com>
5144
5145 PR 10861
5146 * script.h (class Version_script_info): Define Language enum.
5147 Update declarations. Define Glob, Exact, and Lookup types. Add
5148 new fields globals_, locals_, and is_finalized_.
5149 * script.cc: Various formatting fixes.
5150 (class Parser_closure): Change language_stack_ from a vector of
5151 std::string to one of Version_script_info::Language. Adjust all
5152 uses accordingly.
5153 (class Lazy_demangler): Remove.
5154 (struct Version_expression): Change language from std::string to
5155 Version_script_info::Language.
5156 (Version_script_info::Version_script_info): New function.
5157 (Version_script_info::~Version_script_info): Don't call clear.
5158 (Version_script_info::finalize): New function.
5159 (Version_script_info::build_lookup_tables): New function.
5160 (Version_script_info::build_expression_list_lookup): New
5161 function.
5162 (Version_script_info::get_symbol_version_helper): Rewrite to use
5163 lookup tables.
5164 (Version_script_info::print_expression_list): Adjust to use
5165 Version_script_info::Language.
5166 (script_push_lex_into_version_mode): Check that the version script
5167 has not been finalized.
5168 (version_script_push_lang): Change language string to
5169 Version_script_info::Language.
5170 * options.cc (Command_line::version_script): New function.
5171 * options.h (class General_options): Add finalize_dynamic_list
5172 function. Change version_script from declaration to definition.
5173 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5174 * testsuite/version_script.map: Remove duplicate def of foo.
5175 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5176 version_script.map.
5177 * testsuite/Makefile.in: Rebuild.
5178
818bf354
ILT
51792009-12-30 Ian Lance Taylor <iant@google.com>
5180
5181 PR 10843
5182 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5183 if the input symbol index is 0, make the output symbol index 0.
5184
ebcc8304
ILT
51852009-12-30 Ian Lance Taylor <iant@google.com>
5186
5187 PR 10670
5188 * options.h (class General_options): Add -x/--discard-all.
5189 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5190 --discard-all. If the local symbol needs a dynamic entry, check
5191 that before handling --discard-locals.
5192
176fe33f
ILT
51932009-12-30 Ian Lance Taylor <iant@google.com>
5194
bb321bb1
ILT
5195 PR 10450
5196 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5197 flags to PF_R.
5198 (Output_segment::add_output_section): Don't change the flags if
5199 the type is PT_TLS.
5200
176fe33f
ILT
5201 PR 10450
5202 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5203 GNU hash table if they need a dynamic value. Otherwise, don't add
5204 them if they are defined in a dynamic object or are forced local.
5205
e8cd95c7
ILT
52062009-12-29 Ian Lance Taylor <iant@google.com>
5207
1b81fb71
ILT
5208 PR 10450
5209 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5210 .gnu.hash table for a 32-bit target.
5211
8d6d383d
ILT
5212 PR 10450
5213 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5214 regular and a dynamic object only needs a dynamic symbol table
5215 entry if it is externally visible.
5216
e785ec03
ILT
5217 PR 10450
5218 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5219 constructor. Add global_offset_table_ field.
5220 (Target_i386::got_section): Set global_offset_table_.
5221 (Target_i386::do_finalize_sections): Set global_offset_table_
5222 size.
5223 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5224 in constructor. Add global_offset_table_ field.
5225 (Target_x86_64::got_section): Set global_offset_table_.
5226 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5227 size.
5228
1a2dff53
ILT
5229 * layout.cc (Layout::Layout): Initialize increase_relro_.
5230 (Layout::get_output_section): Add is_relro, is_last_relro, and
5231 is_first_non_relro parameters. Change all callers.
5232 (Layout::choose_output_section): Likewise.
5233 (Layout::add_output_section_data): Likewise.
5234 (Layout::make_output_section): Likewise.
5235 (Layout::set_segment_offsets): Clear increase_relro when using a
5236 linker script.
5237 * layout.h (class Layout): Add increase_relro method. Add
5238 increase_relro_ field. Update declarations.
5239 * output.cc (Output_section::Output_section): Initialize
5240 is_last_relro_ and is_first_non_relro_.
5241 (Output_segment::add_output_section): Group relro sections is
5242 do_sort is true. Handle is_last_relro and is_first_non_relro.
5243 (Output_segment::maximum_alignment): Remove relro handling.
5244 (Output_segment::set_section_addresses): Add increase_relro
5245 parameter. Change all callers. Add initial alignment to align
5246 relro sections on separate page. Remove old relro handling.
5247 (Output_segment::set_section_list_addresses): Remove in_relro
5248 parameter. Change all callers.
5249 (Output_segment::set_offset): Add increase parameter. Change all
5250 callers. Remove old relro handling.
5251 * output.h (class Output_section): Add new methods: is_last_relro,
5252 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5253 Add is_last_relro_ and is_first_non_relro_ fields.
5254 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5255 Create separate .got.plt section. Call increase_relro.
5256 * x86_64.cc (Target_x86_64::got_section): Likewise.
5257 * testsuite/relro_script_test.t: Add .got.plt.
5258
f0ba79e2
ILT
5259 PR 10450
5260 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5261 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5262 (Layout::finalize): Call set_dynamic_symbol_size.
5263 (Layout::set_dynamic_symbol_size): New function.
5264 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5265 set_dynamic_symbol_size.
5266
e8cd95c7
ILT
5267 PR 10450
5268 * output.h (class Output_section): Add is_entsize_zero_ field.
5269 * output.cc (Output_section::Output_section): Initialize
5270 is_entsize_zero_.
5271 (Output_section::set_entsize): If two different entsizes are
5272 requested, force it to zero.
5273 (Output_section::add_input_section): Set flags for .debug_str
5274 before updating section flags. Set entsize.
5275 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5276 and SHF_STRING if all input sections have those flags.
5277
3e1b9a8a
RÁE
52782009-12-29 Rafael Espindola <espindola@google.com>
5279
5280 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5281 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5282 reporting.
3e1b9a8a 5283
3dcad376
ST
52842009-12-29 Sriraman Tallam <tmsriram@google.com>
5285
5286 * options.cc (General_options::parse_version): Allow -v to exit
5287 without an error if there is nothing to link.
5288
084e2665
ILT
52892009-12-29 Ian Lance Taylor <iant@google.com>
5290
5291 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5292 using a version of gcc before 4.1.
5293 * configure: Rebuild.
5294
250acde3
CD
52952009-12-28 Chris Demetriou <cgd@google.com>
5296
5297 * attributes.cc (Output_attributes_section_data::do_write): Use
5298 std::vector::front rather than std::vector::data.
5299
99fff23b
ILT
53002009-12-28 Ian Lance Taylor <iant@google.com>
5301
5302 * symtab.h (class Symbol_table): Add enum Defined.
5303 * resolve.cc (Symbol_table::should_override): Add defined
5304 parameter. Change all callers. Test whether object is NULL
5305 before calling a method on it.
5306 (Symbol_table::report_resolve_problem): Add defined parameter.
5307 Change all callers.
5308 (Symbol_table::should_override_with_special): Likewise.
5309 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5310 parameter. Change all callers.
5311 (Symbol_table::do_define_in_output_data): Likewise.
5312 (Symbol_table::define_in_output_segment): Likewise.
5313 (Symbol_table::do_define_in_output_segment): Likewise.
5314 (Symbol_table::define_as_constant): Likewise.
5315 (Symbol_table::do_define_as_constant): Likewise.
5316 * script.h (class Symbol_assignment): Add is_defsym parameter to
5317 constructor; change all callers.
5318 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5319 parameter. Change all callers. Add is_defsym_ field.
5320 (class Parser_closure): Add parsing_defsym parameter to
5321 constructor; change all callers. Add parsing_defsym accessor
5322 function. Add parsing_defsym_ field.
5323
556bd683
ILT
53242009-12-28 Ian Lance Taylor <iant@google.com>
5325
5326 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5327 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5328
1782c879
ILT
53292009-12-23 Ian Lance Taylor <iant@google.com>
5330
5331 * i386.cc (Target_i386::do_calls_non_split): Recognize
5332 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5333 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5334 -fsplit-stack prologue when using %r11.
1782c879 5335
329ca2b1
ST
53362009-12-21 Sriraman Tallam <tmsriram@google.com>
5337
5338 * options.cc (General_options::parse_version): Make -v continue and do
5339 the link like GNU ld does.
5340
d675ff46
RÁE
53412009-12-17 Rafael Avila de Espindola <espindola@google.com>
5342
5343 * Makefile.am (CCFILES): Add timer.cc.
5344 (HFILES): Add timer.h.
5345 * configure.ac: Check for sysconf and times.
5346 * main.cc: include timer.h.
5347 (main): Use Timer instead of get_run_time.
5348 * timer.cc: New.
5349 * timer.h: New.
5350 * workqueue.cc: include timer.h.
5351 (Workqueue::find_and_run_task):
5352 Report user, sys and wall time.
5353 * Makefile.in: Regenerate.
5354 * config.in: Regenerate.
5355 * configure: Regenerate.
5356
d6344fb5
DK
53572009-12-16 Doug Kwan <dougkwan@google.com>
5358
5359 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5360 sections.
5361 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5362 relaxed input sections.
5363 * output.cc (Output_section::find_relaxed_input_section): Change
5364 return type to Output_relaxed_input_section pointer. Adjust code
5365 for new type of relaxed_input_section_map_.
5366 * output.h (Output_section::find_relaxed_input_section): Change
5367 return type to Output_relaxed_input_section pointer.
5368 (Output_section::Output_relaxed_input_section_by_input_section_map):
5369 New type.
5370 (Output_section::relaxed_input_section_map_): Change type to
5371 Output_section::Output_relaxed_input_section_by_input_section_map.
5372 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5373 input section.
5374
0e0d5469
ILT
53752009-12-15 Ian Lance Taylor <iant@google.com>
5376
5377 * layout.cc (Layout::create_shstrtab): Only write out after input
5378 sections if we are compressing debug sections.
5379
0649a889
ILT
53802009-12-15 Ian Lance Taylor <iant@google.com>
5381
5382 * archive.cc (Archive::add_symbols): Only look up a symbol without
5383 a version if there is, in fact, a version.
5384
2ea97941
ILT
53852009-12-14 Ian Lance Taylor <iant@google.com>
5386
5387 Revert -Wshadow changes, all changes from:
5388 2009-12-11 Doug Kwan <dougkwan@google.com>
5389 2009-12-11 Nick Clifton <nickc@redhat.com>
5390 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5391
b0eec2cc
DK
53922009-12-11 Doug Kwan <dougkwan@google.com>
5393
5394 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5395 due to -Wshadow.
5396 * attributes.cc (Object_attribute::size): Ditto.
5397 (Attributes_section_data::size): Ditto.
5398 (Attributes_section_data::Attributes_section_data): Ditto.
5399 (Output_attributes_section_data::do_write): Ditto.
5400 * attributes.h (Object_attribute::set_type): Ditto.
5401 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5402
91d6fa6a
NC
54032009-12-11 Nick Clifton <nickc@redhat.com>
5404
5405 * archive.cc: Fix shadowed variable warnings.
5406 * arm.cc: Likewise.
5407 * compressed_output.cc: Likewise.
5408 * compressed_output.h: Likewise.
5409 * configure: Likewise.
5410 * dwarf_reader.cc: Likewise.
5411 * dynobj.cc: Likewise.
5412 * dynobj.h: Likewise.
5413 * ehframe.cc: Likewise.
5414 * ehframe.h: Likewise.
5415 * errors.cc: Likewise.
5416 * expression.cc: Likewise.
5417 * fileread.cc: Likewise.
5418 * fileread.h: Likewise.
5419 * freebsd.h: Likewise.
5420 * i386.cc: Likewise.
5421 * icf.cc: Likewise.
5422 * incremental.h: Likewise.
5423 * layout.cc: Likewise.
5424 * layout.h: Likewise.
5425 * mapfile.cc: Likewise.
5426 * merge.cc: Likewise.
5427 * merge.h: Likewise.
5428 * object.cc: Likewise.
5429 * object.h: Likewise.
5430 * options.h: Likewise.
5431 * output.cc: Likewise.
5432 * output.h: Likewise.
5433 * parameters.cc: Likewise.
5434 * plugin.cc: Likewise.
5435 * powerpc.cc: Likewise.
5436 * reduced_debug_output.cc: Likewise.
5437 * reduced_debug_output.h: Likewise.
5438 * reloc.cc: Likewise.
5439 * reloc.h: Likewise.
5440 * resolve.cc: Likewise.
5441 * script-sections.cc: Likewise.
5442 * script.cc: Likewise.
5443 * script.h: Likewise.
5444 * sparc.cc: Likewise.
5445 * symtab.cc: Likewise.
5446 * symtab.h: Likewise.
5447 * target-select.cc: Likewise.
5448 * target-select.h: Likewise.
5449 * token.h: Likewise.
5450 * workqueue.cc: Likewise.
5451 * workqueue.h: Likewise.
5452 * x86_64.cc: Likewise.
5453
a0351a69
DK
54542009-12-10 Doug Kwan <dougkwan@google.com>
5455
5456 * arm.cc (attributes.h): New include.
5457 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5458 (Arm_relobj::~Arm_relobj): Delete object pointed by
5459 attributes_section_data_.
5460 (Arm_relobj::attributes_section_data): New method definition.
5461 (Arm_relobj::attributes_section_data_): New data member declaration.
5462 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5463 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5464 attributes_section_data_.
5465 (Arm_dynobj::attributes_section_data): New method definition.
5466 (Arm_dynobj::attributes_section_data_): New data member declaration.
5467 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5468 initialization value of may_use_blx_ to false.
5469 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5470 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5471 object attributes to compute results instead of hard-coding.
5472 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5473 Target_arm::get_secondary_compatible_arch,
5474 Target_arm::set_secondary_compatible_arch
5475 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5476 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5477 New method declarations.
5478 (Target_arm::get_aeabi_object_attribute): New method definition.
5479 (Target_arm::attributes_section_data_): New data member declaration.
5480 (read_arm_attributes_section): New template definition.
5481 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5482 (Arm_dynobj::do_read_symbols): Ditto.
5483 (Target_arm::do_finalize_sections): Merge attributes sections from
5484 input. Check for BLX use after attributes section merging.
5485 Fix __exidx_start and __exidx_end visibility. Create an
5486 .ARM.attributes section if necessary.
5487 (Target_arm::get_secondary_compatible_arch,
5488 Target_arm::set_secondary_compatible_arch,
5489 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5490 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5491 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5492 New method definitions.
5493
b59befec
ILT
54942009-12-09 Ian Lance Taylor <iant@google.com>
5495
5496 * plugin.cc (Plugin::load): Don't cast from void* to a function
5497 pointer.
5498
1276bc89
ILT
54992009-12-09 Ian Lance Taylor <iant@google.com>
5500
5501 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5502 information fields.
5503
2f2de248
L
55042009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5505
5506 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5507 Replace two_file_shared_1.so with two_file_shared_2.so.
5508 * testsuite/Makefile.in: Regenerated.
5509
4f787271
DK
55102009-12-08 Doug Kwan <dougkwan@google.com>
5511
5512 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5513 (HFILES): Add attributes.h and int_encoding.h.
5514 * Makefile.in: Regenerate.
5515 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5516 function definitions to int_encoding.cc
5517 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5518 prototypes to int_encoding.h
5519 * reduced_debug_output.cc (int_encoding.h): New include.
5520 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5521 function definitions to int_encoding.cc
5522 (insert_into_vector, read_from_pointer): Move template definitions to
5523 int_encoding.h
5524 * attributes.cc: New file.
5525 * attributes.h: New file.
5526 * int_encoding.cc: New file.
5527 * int_encoding.h: New file.
5528
20b52f1a
RÁE
55292009-12-07 Rafael Avila de Espindola <espindola@google.com>
5530
5531 PR gold/11055
5532 * incremental-dump.cc (dump_incremental_inputs): New.
5533 (main): Use dump_incremental_inputs.
5534
53d7974c
L
55352009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5536
5537 PR gold/10893
5538 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5539 checking elfcpp::STT_FUNC.
5540 (Target_i386::Relocate::relocate): Likewise.
5541 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5542
5543 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5544 symbols from shared libraries into normal FUNC symbols.
5545
5546 * symtab.h (Symbol): Add is_func and use it.
5547
05a352e6
DK
55482009-12-05 Doug Kwan <dougkwan@google.com>
5549
5550 * arm.cc (Target_arm::arm_info): Initialize new fields
5551 attributes_section and attributes_vendor.
5552 * i386.cc (Target_i386::i386_info): Same.
5553 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5554 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5555 fields attributes_section and attributes_vendor.
53d7974c 5556 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5557 * target.h (Target::attributes_section, Target::attributes_vendor,
5558 Target::is_attributes_section, Target::attribute_arg_type,
5559 Target::attributes_order): New method definitions.
5560 (Target::Target_info::attributes_section,
5561 Target::Target_info::attributes_vendor): New fields.
5562 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5563 virtual method definitions.
5564 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5565 attributes_section and attributes_vendor.
5566 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5567
f4e5969c
DK
55682009-12-05 Doug Kwan <dougkwan@google.com>
5569
5570 * arm.cc: Update comments about interworking and stub generation.
5571 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5572 considered as non-PIC.
5573 (Arm_relocate_functions::base_abs): Fix formatting.
5574 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5575 of function to use GOT entry address instead of offset.
5576 (Target_arm::Scan::global): Issue an error if a symbol would need a
5577 PLT does not get one because it is untyped. Remove code to create
5578 dynamic symbols for relative branches.
5579 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5580 takes unsigned integer instead of boolean.
5581
1abce4a6
L
55822009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5583
5584 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5585 (two_file_test_LDADD): Likewise.
5586 (common_test_1_LDADD): Likewise.
5587 (exception_test_LDADD) Likewise.
5588 (weak_test_LDADD): Likewise.
5589 (many_sections_test_LDADD): Likewise.
5590 (initpri1_LDADD): Likewise.
5591 (script_test_1_LDADD): Likewise.
5592 (script_test_2_LDADD): Likewise.
5593 (justsyms_LDADD): Likewise.
5594 (binary_test_LDADD): Likewise.
5595 (large_LDADD): Likewise.
5596 * testsuite/Makefile.in: Regenerated.
5597
adcf2816 55982009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5599
adcf2816
L
5600 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5601 (Symbol_table::override_with_special): Likewise.
5602 (Symbol_table::add_from_object): Likewise.
5603
28e67f5d
RÁE
56042009-12-04 Rafael Avila de Espindola <espindola@google.com>
5605
5606 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5607 Don't set the data_offset twice.
5608
ae10a101
RÁE
56092009-12-04 Rafael Avila de Espindola <espindola@google.com>
5610
5611 * testsuite/Makefile.in: Regenerate.
5612
f59f41f3
DK
56132009-12-03 Doug Kwan <dougkwan@google.com>
5614
5615 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5616 (Target_arm::do_finalize_sections): Add parameter for symbol table
5617 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5618 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5619 parameter for symbol table pointer.
5620 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5621 an additional parameter for a pointer to symbol table.
5622 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5623 parameter for a symbol table pointer.
5624 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5625 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5626 Ditto.
5627 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5628 parameter for a symbol table pointer.
5629
ca55d848
RÁE
56302009-12-03 Rafael Avila de Espindola <espindola@google.com>
5631
5632 * incremental.cc (Incremental_inputs_header)
5633 (Incremental_inputs_header_write, Incremental_inputs_entry)
5634 (Incremental_inputs_entry_write): Move ...
5635 * incremental.h (Incremental_inputs_header)
5636 (Incremental_inputs_header_write, Incremental_inputs_entry)
5637 (Incremental_inputs_entry_write): here.
5638
3aec4f9c
RÁE
56392009-12-02 Rafael Avila de Espindola <espindola@google.com>
5640
5641 * incremental.cc (make_sized_incremental_binary): Set the target.
5642 Error if it is incompatible.
5643 * output.h (Output_file): Add filename method.
5644
9c0ae74d
RÁE
56452009-12-02 Rafael Avila de Espindola <espindola@google.com>
5646
5647 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5648 from the get_* methods.
5649
a45500ae
RÁE
56502009-12-02 Rafael Avila de Espindola <espindola@google.com>
5651
5652 * incremental-dump.cc (main): Check that the offeset of a script is 0.
5653 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5654 Write 0 for the data_offset of scripts.
5655
325e6408
RÁE
56562009-12-02 Rafael Avila de Espindola <espindola@google.com>
5657
5658 * testsuite/Makefile.am: Add the incremental_test.sh test.
5659 * testsuite/incremental_test.sh: New.
5660 * testsuite/incremental_test_1.c: New.
5661 * testsuite/incremental_test_2.c: New.
5662
954c3e2e
RÁE
56632009-12-01 Rafael Avila de Espindola <espindola@google.com>
5664
5665 * incremental-dump.cc (main): Fix typos.
5666
f8086623
RÁE
56672009-11-27 Rafael Avila de Espindola <espindola@google.com>
5668
5669 PR gold/11025
5670 * incremental-dump.cc (main): Use llu to print 64 bit values.
5671
3b0dd6ac
L
56722009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
5673 H.J. Lu <hongjiu.lu@intel.com>
5674
5675 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
5676 $(LIBDL).
5677 (incremental_dump_LDADD): Likewise.
5678 * Makefile.in: Regenerated.
5679
a6d1ef57 56802009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 5681
a6d1ef57
DK
5682 Revert:
5683
5684 2009-11-25 Doug Kwan <dougkwan@google.com>
5685
5686 * arm.cc (Target_arm::Target_arm): Move method definition
5687 outside of class definition. Add code to handle
5688 --target1-rel, --target1-abs and --target2= options.
5689 (Target_arm::get_reloc_reloc_type): Change method to be
5690 non-static and const.
5691 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
5692 New data member declaration.
5693 (Target_arm::Scan::local, Target_arm::Scan::global,
5694 Target_arm::Relocate::relocate,
5695 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5696 Adjust call to Target_arm::get_real_reloc_type.
5697 (Target_arm::get_real_reloc_type): Use command line options
5698 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5699 * options.h (--target1-rel, --target1-abs, --target2): New
5700 ARM-only options.
5701
50aeb7d4
DK
57022009-11-25 Doug Kwan <dougkwan@google.com>
5703
5704 * arm.cc (Target_arm::Target_arm): Move method definition outside of
5705 class definition. Add code to handle --target1-rel, --target1-abs
5706 and --target2= options.
5707 (Target_arm::get_reloc_reloc_type): Change method to be non-static
5708 and const.
5709 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
5710 member declaration.
5711 (Target_arm::Scan::local, Target_arm::Scan::global,
5712 Target_arm::Relocate::relocate,
5713 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
5714 call to Target_arm::get_real_reloc_type.
5715 (Target_arm::get_real_reloc_type): Use command line options to
5716 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5717 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
5718 options.
5719
51938283
DK
57202009-11-25 Doug Kwan <dougkwan@google.com>
5721
5722 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
5723 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
5724 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
5725 formatting.
5726 (Arm_relocate_functions::thm_call): Replace body with a call to
5727 Arm_relocate_functions::thumb_branch_common.
5728 (Arm_relocate_functions::thm_jump24,
5729 Arm_relocate_functions::thm_xpc22): New method definitions.
5730 (Arm_relocate_functions::thumb_branch_common): New method definition.
5731 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
5732 operator.
5733 (Target_arm::Relocate::relocate): Adjust call to thm_call.
5734 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
5735
e2b8f3c4
RÁE
57362009-11-24 Rafael Avila de Espindola <espindola@google.com>
5737
5738 * Makefile.am: Build incremental-dump
5739 * Makefile.in: Regenerate.
5740 * incremental-dump.cc: New.
5741 * incremental.cc (Incremental_inputs_header_data,
5742 Incremental_inputs_entry_data): Move to incremental.h
5743 * incremental.h: (Incremental_inputs_header_data,
5744 Incremental_inputs_entry_data): Move from incremental.cc
5745
bcba9aec
RÁE
57462009-11-24 Rafael Avila de Espindola <espindola@google.com>
5747
5748 * incremental.cc (Incremental_inputs_header,
5749 Incremental_inputs_header_write, Incremental_inputs_entry,
5750 Incremental_inputs_entry_write): Add a typedef with the data type.
5751
7c3afe08
RÁE
57522009-11-24 Rafael Avila de Espindola <espindola@google.com>
5753
5754 * incremental.cc (Incremental_inputs_header,
5755 Incremental_inputs_header_write, Incremental_inputs_entry,
5756 Incremental_inputs_entry_write): Update comment about which
5757 type has the filed descriptions.
5758
d204b6e9
DK
57592009-11-15 Doug Kwan <dougkwan@google.com>
5760
5761 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
5762 (Arm_relocate_functions::arm_branch_common): Change method defintion
5763 in class definition to a method declaration and update list of formal
5764 parameters.
5765 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
5766 Arm_relocation_functions::jump24): Adjust call to
5767 Arm_relocate_functions::arm_branch_common. Update list of formal
5768 parameters.
5769 (Arm_relocate_functions::xpc25): New method definition.
5770 (Arm_relocate_functions::arm_branch_common): Move method defintion
5771 out from class definition. Use stubs for mode-switching and extending
5772 branch ranges.
5773 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
5774 specially. Change code to enable use of stubs in ARM branches.
5775
43d12afe
DK
57762009-11-10 Doug Kwan <dougkwan@google.com>
5777
5778 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
5779 in method declaration.
5780 (Target_arm::relocate_stub): New method declaration.
5781 (Target_arm::default_target): Change to return a pointer instead of
5782 a const reference.
5783 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
5784 Target_arm::default_target.
5785 (Arm_Relobj::do_relocate_sections): Remove options paramater in
5786 method definition.
5787 (Target_arm::relocate_section): Adjust view.
5788 (Target_arm::relocate_stub): New method definition.
5789
ac33a407
DK
57902009-11-10 Doug Kwan <dougkwan@google.com>
5791
5792 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
5793 a format warning.
5794 * incremental.cc (open_incremental_binary): Initialized local
5795 variables to avoid warnings.
5796 * object.cc (make_elf_object): Ditto.
5797 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
5798 a format warning.
e1df38aa 5799
88ee28e9
L
5800009-11-09 H.J. Lu <hongjiu.lu@intel.com>
5801
5802 PR gold/10930
5803 * testsuite/plugin_test.c: Include "config.h".
5804
2daedcd6
DK
58052009-11-09 Doug Kwan <dougkwan@google.com>
5806
5807 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
5808 (arm_symbol_value): Remove.
5809 (Arm_relocate_functions::arm_branch_common,
5810 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
5811 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
5812 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
5813 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
5814 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
5815 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
5816 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
5817 Arm_relocate_functions::thm_mobw_abs_nc,
5818 Arm_relocate_functions::thm_mov_abs,
5819 Arm_relocate_functions::movw_prel_nc,
5820 Arm_relocate_functions::thm_movt_abs,
5821 Arm_relocate_functions::movt_prel,
5822 Arm_relocate_functions::thm_movw_prel_nc,
5823 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
5824 (Target_arm::Relocate::relocate): Only decompose address into two
5825 parts if relocation type uses the thumb-bit and pass the actual
5826 bit instead of a flag indicating that the thumb-bit is used. Adjust
5827 calls to methods in Arm_relocate_functions for this change.
5828
1276bc89 58292009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
5830
5831 PR 10925
5832 * reloc.cc: Instantiate
5833 Sized_relobj::initialize_input_to_output_maps and
5834 Sized_relobj:free_input_to_output_maps.
5835
e53ad1b5
ILT
58362009-11-06 Ian Lance Taylor <iant@google.com>
5837
5838 PR 10876
5839 * defstd.cc (in_segment): Set only_if_ref true for "end".
5840
eb44217c
DK
58412009-11-06 Doug Kwan <dougkwan@google.com>
5842
5843 * arm.cc (class Reloc_stub): Correct a comment.
5844 (Target_arm::Target_arm): Initialize arm_input_section_map_.
5845 (Target_arm::scan_section_for_stubs): New method declaration.
5846 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
5847 Change methods from private to protected.
5848 (Target_arm::do_may_relax): New method definition.
5849 (Target_arm::do_relax, Target_arm::group_sections,
5850 Target_arm::scan_reloc_for_stub,
5851 Target_arm::scan_reloc_section_for_stubs): New method declarations.
5852 (Target_arm::arm_input_section_map_): New data member declaration.
5853 (Target_arm::scan_reloc_for_stub,
5854 Target_arm::scan_reloc_section_for_stubs,
5855 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
5856 Target_arm::do_relax): New method definitions.
5857
5d329b7d
ILT
58582009-11-06 Mikolaj Zalewski <mikolaj@google.com>
5859
5860 * configure.ac: Check for (struct stat)::st_mtim
5861 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
5862 * config.in: Regenerate.
5863 * configure: Regenerate.
5864
96a0d71b
ILT
58652009-11-05 Ian Lance Taylor <iant@google.com>
5866
5867 PR 10910
5868 * output.cc (Output_segment::add_output_section): Add missing
5869 return statement.
5870
594c8e5e
ILT
58712009-11-04 Ian Lance Taylor <iant@google.com>
5872
5873 PR 10880
5874 * object.h (class Object): Add is_needed and set_is_needed
5875 methods. Add is_needed_ field. Make bool fields into bitfields.
5876 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
5877 defined in a dynamic object and referenced by a regular object,
5878 set is_needed for the dynamic object.
5879 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
5880 if the file is marked with as_needed and it is not needed.
5881
22b127cc
ILT
58822009-11-04 Ian Lance Taylor <iant@google.com>
5883
5884 PR 10887
5885 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
5886 tags if data is discarded by linker script.
5887 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5888 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5889 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5890 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5891
f5c870d2
ILT
58922009-11-04 Ian Lance Taylor <iant@google.com>
5893
5894 * layout.cc (Layout::get_output_section): Add is_interp and
5895 is_dynamic_linker_section parameters. Change all callers.
5896 (Layout::choose_output_section): Likewise.
5897 (Layout::make_output_section): Likewise.
5898 (Layout::add_output_section_data): Add is_dynamic_linker_section
5899 parameter. Change all callers.
5900 * layout.h (class Layout): Update declarations.
5901 * output.h (class Output_section): Add is_interp, set_is_interp,
5902 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
5903 Add is_interp_, is_dynamic_linker_section_ fields. Change
5904 generate_code_fills_at_write_ to a bitfield.
5905 * output.cc (Output_section::Output_sections): Initialize new
5906 fields.
5907 (Output_segment::add_output_section): Add do_sort parameter.
5908 Change all callers.
5909
1ae4d23b
ILT
59102009-11-03 Ian Lance Taylor <iant@google.com>
5911
5912 PR 10860
5913 * options.h (class General_options): Add --warn-common.
5914 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
5915 merging two common symbols.
5916 (Symbol_table::should_override): Handle --warn-common when merging
5917 a common symbol with a defined symbol. Use report_resolve_problem
5918 for multiple definitions.
5919 (Symbol_table::report_resolve_problem): New function.
5920 * symtab.h (class Symbol_table): Declare report_resolve_problem.
5921
55da9579
DK
59222009-11-03 Doug Kwan <dougkwan@google.com>
5923
5924 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
5925 stub_factory_.
5926 (Target_arm::stub_factory): New method definition.
5927 (Target_arm::new_arm_input_section,
5928 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
5929 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 5930 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
5931 New type definitions.
5932 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
5933 member declarations.
5934 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
5935 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
5936 New method definitions.
5937
37a9ac43
ILT
59382009-11-03 Ian Lance Taylor <iant@google.com>
5939
5940 * options.h (class General_options): Add --warn_constructors.
5941
b3d6a3d4
ILT
59422009-11-03 Ian Lance Taylor <iant@google.com>
5943
5944 PR 10893
5945 * defstd.cc (in_section): Add entries for __rel_iplt_start,
5946 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
5947
934b01dd
ILT
59482009-11-03 Ian Lance Taylor <iant@google.com>
5949
5950 PR 10895
5951 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
5952 --msgid-bugs-address.
5953 (install-pdf): New target.
5954 (install-data_yes): Look up one directory to find mkinstalldirs.
5955
03c1939b
L
59562009-11-03 H.J. Lu <hongjiu.lu@intel.com>
5957
5958 * po/Make-in (.po.gmo): Don't generate .gmo files in source
5959 tree.
5960
ebd95253
DK
59612009-10-30 Doug Kwan <dougkwan@google.com>
5962
5963 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
5964
e9bbb538
DK
59652009-10-30 Doug Kwan <dougkwan@google.com>
5966
5967 * arm.cc (Stub_addend_reader): New struct template definition
5968 and partial specializations.
5969 (Stub_addend_reader::operator()): New method definition for a
5970 partially specialized template.
5971
d5b40221
DK
59722009-10-30 Doug Kwan <dougkwan@google.com>
5973
5974 * arm.cc (Arm_relobj::processor_specific_flags): New method
5975 definition.
5976 (Arm_relobj::do_read_symbols): New method declaration.
5977 (Arm_relobj::processor_specific_flags_): New data member declaration.
5978 (Arm_dynobj): New class definition.
5979 (Target_arm::do_finalize_sections): Add input_objects parameter.
5980 (Target_arm::do_adjust_elf_header): New method declaration.
5981 (Target_arm::are_eabi_versions_compatible,
5982 (Target_arm::merge_processor_specific_flags): New method declaration.
5983 (Target_arm::do_make_elf_object): New overloaded method definitions
5984 and declaration.
5985 (Arm_relobj::do_read_symbols): New method definition.
5986 (Arm_dynobj::do_read_symbols): Ditto.
5987 (Target_arm::do_finalize_sections): Add input_objects parameters.
5988 Merge processor-specific flags from all input objects.
5989 (Target_arm::are_eabi_versions_compatible,
5990 Target_arm::merge_processor_specific_flags,
5991 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
5992 New method definitions.
5993 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
5994 Input_objects pointer type parameter.
5995 * layout.cc (Layout::finalize): Pass input objects to target's.
5996 finalize_sections function.
5997 * output.cc (Output_file_header::do_sized_write): Set ELF file
5998 header's processor-specific flags.
5999 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6000 Input_objects pointer type parameter.
6001 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6002 * target.h (Input_objects): New forward class declaration.
6003 (Target::processor_specific_flags,
6004 Target::are_processor_specific_flags_sect): New method definitions.
6005 (Target::finalize_sections): Add input_objects parameter.
6006 (Target::Target): Initialize processor_specific_flags_ and
6007 are_processor_specific_flags_set_.
6008 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6009 parameter.
6010 (Target::set_processor_specific_flags): New method definition.
6011 (Target::processor_specific_flags_,
6012 Target::are_processor_specific_flags_set_): New data member
6013 declarations.
6014 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6015 Input_objects pointer type parameter.
6016
ebabffbd
DK
60172009-10-30 Doug Kwan <dougkwan@google.com>
6018
6019 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6020
ad0f2072
ILT
60212009-10-28 Ian Lance Taylor <iant@google.com>
6022
6023 * object.h (class Relobj): Drop options parameter from
6024 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6025 do_scan_relocs, do_relocate. Change all callers.
6026 (class Sized_relobj): Drop options parameters from
6027 do_gc_process_relocs, do_scan_relocs, do_relocate,
6028 do_relocate_sections, relocate_sections, emit_relocs_scan,
6029 emit_relocs_scan_reltype. Change all callers.
6030 (struct Relocate_info): Remove options field and all references to
6031 it.
6032 * reloc.h (class Read_relocs): Remove options constructor
6033 parameter and options_ field. Change all callers.
6034 (class Gc_process_relocs, class Scan_relocs): Likewise.
6035 (class Relocate_task): Likewise.
6036 * target-reloc.h (scan_relocs): Remove options parameter. Change
6037 all callers.
6038 (scan_relocatable_relocs): Likewise.
6039 * target.h (class Sized_target): Remove options parameter from
6040 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6041 all callers.
6042 * gc.h (gc_process_relocs): Remove options parameter. Change all
6043 callers.
6044 * arm.cc: Update functions to remove options parameters.
6045 * i386.cc: Likewise.
6046 * powerpc.cc: Likewise.
6047 * sparc.cc: Likewise.
6048 * x86_64.cc: Likewise.
6049 * testsuite/testfile.cc: Likewise.
6050
8ffa3667
DK
60512009-10-28 Doug Kwan <dougkwan@google.com>
6052
6053 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6054 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6055 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6056 New method definitions.
6057
40f36857
CC
60582009-10-28 Cary Coutant <ccoutant@google.com>
6059
6060 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6061 (Plugin::cleanup_done_): New member.
6062 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6063 (Plugin_manager::cleanup_done_): Remove.
6064 (Plugin_manager::add_input_file): Edit error message.
6065 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6066 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6067
2c849493
ILT
60682009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6069
6070 * fileread.cc: (File_read::View::~View): Use the new
6071 data_ownership_ filed.
6072 (File_read::~File_read): Dispose the new whole_file_view_.
6073 (File_read::open): Mmap the whole file if needed.
6074 (File_read::open): Use whole_file_view_ instead of contents_.
6075 (File_read::find_view): Use whole_file_view_ if applicable.
6076 (File_read::do_read): Use whole_file_view_ instead of contents_.
6077 (File_read::make_view): Use whole_file_view_ instead of contents_,
6078 update File_read::View::View call.
6079 (File_read::find_or_make_view): Update File_read::View::View
6080 call.
6081 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6082 remove contents_
6083 (File_read::View::Data_ownership): New enum.
6084 (File_read::View::View): Replace bool mapped_ with Data_ownership
6085 argument.
6086 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6087 (File_read::View::data_ownership_): New field.
6088 (File_read::contents_): Remove (replaced by whole_file_view_).
6089 (File_read::whole_file_view_): New field.
6090 * options.h (class General_options): Add --keep-files-mapped.
6091
24998053
CC
60922009-10-27 Cary Coutant <ccoutant@google.com>
6093
6094 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6095 * testsuite/Makefile.am (plugin_test_5): New test case.
6096 * testsuite/Makefile.in: Regenerate.
6097
72adc4fa
DK
60982009-10-25 Doug Kwan <dougkwan@google.com>
6099
6100 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6101 from private to protected to allow access by child class.
6102 (Sized_relobj::do_relocate_sections): New method declaration.
6103 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6104 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6105 Sized_relobj::relocate_sections. Instantiate template explicitly
6106 for different target sizes and endianity.
6107
07f508a2
DK
61082009-10-24 Doug Kwan <dougkwan@google.com>
6109
6110 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6111 (Arm_input_section::as_arm_input_section): New method.
6112 (Arm_output_section): New class definition.
6113 (Arm_output_section::create_stub_group,
6114 Arm_output_section::group_sections): New method definitions.
6115
10ad9fe5
DK
61162009-10-22 Doug Kwan <dougkwan@google.com>
6117
6118 * arm.cc (Arm_input_section): New class definition.
6119 (Arm_input_section::init, Arm_input_section:do_write,
6120 Arm_input_section::set_final_data_size,
6121 Arm_input_section::do_reset_address_and_file_offset): New method
6122 definitions.
6123
56ee5e00
DK
61242009-10-21 Doug Kwan <dougkwan@google.com>
6125
6126 * arm.cc (Stub_table, Arm_input_section): New forward class
6127 declarations.
6128 (Stub_table): New class defintion.
6129 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6130 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6131 New method definition.
6132
b569affa
DK
61332009-10-21 Doug Kwan <dougkwan@google.com>
6134
6135 * arm.cc: Update copyright comments.
6136 (Target_arm): New forward class template declaration.
6137 (Arm_address): New type.
6138 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6139 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6140 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6141 constants.
6142 (Insn_template): Same.
6143 (DEF_STUBS): New macro.
6144 (Stub_type): New enum type.
6145 (Stub_template): New class definition.
6146 (Stub): Same.
6147 (Reloc_stub): Same.
6148 (Stub_factory): Same.
6149 (Target_arm::Target_arm): Initialize may_use_blx_ and
6150 should_force_pic_veneer_.
6151 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6152 Target_arm::should_force_pic_veneer,
6153 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6154 Target_arm::using_thumb_only, Target_arm:;default_target): New
6155 method defintions.
6156 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6157 New data member declarations.
6158 (Insn_template::size, Insn_template::alignment): New method defintions.
6159 (Stub_template::Stub_template): New method definition.
6160 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6161 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6162 (Stub_factory::Stub_factory): New method definition.
6163 * gold.h (string_hash): New template.
6164 * output.h (Input_section_specifier::hash_value): Use
6165 gold::string_hash.
6166 (Input_section_specifier::string_hash): Remove.
6167 * stringpool.cc (Stringpool_template::string_hash): Use
6168 gold::string_hash.
6169
6c172549
DK
61702009-10-20 Doug Kwan <dougkwan@google.com>
6171
6172 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6173 symbols of relaxed input sections.
6174 * output.h (Output_section::find_relaxed_input_section): Make
6175 method public.
6176
c5617f2f
DK
61772009-10-16 Doug Kwan <dougkwan@google.com>
6178
6179 * dynobj.cc (Versions::Versions): Initialize version_script_.
6180 Only insert base version symbol definition for a shared object
6181 if version script defines any version versions.
6182 (Versions::define_base_version): New method definition.
6183 (Versions::add_def): Check that base version is not needed.
6184 (Versions::add_need): Define base version lazily.
6185 * dynobj.h (Versions::define_base_version): New method declaration.
6186 (Versions::needs_base_version_): New data member declaration.
6187 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6188 (check_DATA): Add no_version_test.stdout.
6189 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6190 New make rules.
6191 * testsuite/Makefile.in: Regenerate.
6192 * testsuite/no_version_test.c: New file.
6193 * testsuite/no_version_test.sh: Ditto.
6194
3c12dcdb
DK
61952009-10-16 Doug Kwan <dougkwan@google.com>
6196
6197 * expression.cc (class Segment_start_expression): New class definition.
6198 (Segment_start_expression::value): New method definition.
6199 (script_exp_function_segment_start): Return a new
6200 Segment_start_expression.
6201 * gold/script-c.h (script_saw_segment_start_expression): New function
6202 prototype.
6203 * script-sections.cc (Script_sections::Script_sections): Initialize
6204 SAW_SEGMENT_START_EXPRESSION_ to false.
6205 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6206 and -Tbbs options to specify section addresses if given in
6207 command line and no SEGMENT_START expression is seen in a script.
6208 * script-sections.h (Script_sections::saw_segment_start_expression,
6209 Script_sections::set_saw_segment_start_expression): New method
6210 definition.
6211 (Script_sections::saw_segment_start_expression_): New data member
6212 declaration.
6213 * script.cc (script_saw_segment_start_expression): New function.
6214 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6215 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6216 script_test_7.sh and script_test_8.sh.
6217 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6218 script_test_8.stdout.
6219 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6220 (script_test_6, script_test_6.stdout, script_test_7,
6221 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6222 * Makefile.in: Regenerate.
6223 * testsuite/script_test_6.sh: New file.
6224 * testsuite/script_test_6.t: Same.
6225 * testsuite/script_test_7.sh: Same.
6226 * testsuite/script_test_7.t: Same.
6227 * testsuite/script_test_8.sh: Same.
6228
64b1ae37
DK
62292009-10-16 Doug Kwan <dougkwan@google.com>
6230
6231 * output.cc (Output_segment::set_section_list_address): Cast
6232 expressions to unsigned long long type to avoid format warnings.
6233
661be1e2
ILT
62342009-10-15 Ian Lance Taylor <iant@google.com>
6235
12edd763 6236 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6237 dot assignment to script_sections_.
12edd763
ILT
6238 * script-sections.cc (Script_sections::add_dot_assignment):
6239 Initialize if necessary.
6240
68b6574b
ILT
6241 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6242 program headers with no load segment if there is a linker script.
6243
661be1e2
ILT
6244 * layout.cc (Layout::set_segment_offsets): Align the file offset
6245 to the segment aligment for -N or -n with no load segment.
6246 * output.cc (Output_segment::add_output_section): Don't crash if
6247 the first section is a TLS section.
6248 (Output_segment::set_section_list_addresses): Print an error
6249 message if the address moves backward in a linker script.
6250 * script-sections.cc
6251 (Output_section_element_input::set_section_addresses): Don't
6252 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6253 (Orphan_output_section::set_section_addresses): Likewise.
6254
f15f61a7
DK
62552009-10-15 Doug Kwan <dougkwan@google.com>
6256
6257 * layout.cc (Layout::finish_dynamic_section): Generate tags
6258 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6259 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6260 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6261
82bb573a
ILT
62622009-10-14 Ian Lance Taylor <iant@google.com>
6263
6264 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6265 fields.
6266 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6267 data_shdr fields of relinfo.
6268 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6269 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6270 R_386_TLS_LDO_32, adjust based on section flags.
6271 (Target_i386::Relocate::fix_up_ldo): Remove.
6272
374ad285
ILT
62732009-10-13 Ian Lance Taylor <iant@google.com>
6274
6275 Add support for -pie.
6276 * options.h (class General_options): Add -pie and
6277 --pic-executable.
6278 (General_options::output_is_position_independent): Test -pie.
6279 (General_options::output_is_executable): Return true if not shared
6280 and not relocatable.
6281 (General_options::output_is_pie): Remove.
6282 * options.cc (General_options::finalize): Reject incompatible uses
6283 of -pie.
6284 * gold.cc (queue_middle_tasks): A -pie link is not static.
6285 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6286 * symtab.cc (Symbol::final_value_is_known): Return false if
6287 output_is_position_independent.
6288 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6289 output_is_position_independent.
6290 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6291 output_is_position_independent.
6292 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6293 output_is_position_independent.
6294 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6295 two_file_pie_test.
6296 (basic_pie_test.o, basic_pie_test): New targets.
6297 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6298 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6299 (two_file_pie_test): New target.
6300 * testsuite/Makefile.in: Rebuild.
6301 * README: Remove note saying that -pie is not supported.
6302
c6585162
ILT
63032009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6304
6305 * options.h (class General_options): Add -init and -fini.
6306 * layout.cc (Layout::finish_dynamic_section): Emit
6307 given init and fini functions.
6308
032ce4e9
ST
63092009-10-13 Sriraman Tallam <tmsriram@google.com>
6310
6311 * gc.h (gc_process_relocs): Check if icf is enabled using new
6312 function.
6313 * gold.cc (queue_initial_tasks): Likewise.
6314 (queue_middle_tasks): Likewise.
6315 * object.cc (do_layout): Likewise.
6316 * symtab.cc (is_section_folded): Likewise.
6317 * main.cc (main): Likewise.
6318 * reloc.cc (Read_relocs::run): Likewise.
6319 (Sized_relobj::do_scan_relocs): Likewise.
6320 * icf.cc (is_function_ctor_or_dtor): New function.
6321 (Icf::find_identical_sections): Check if function is ctor or dtor when
6322 safe icf is chosen.
6323 * options.h (General_options::icf): Change option to be an enum.
6324 (Icf_status): New enum.
6325 (icf_enabled): New method.
6326 (icf_safe_folding): New method.
6327 (set_icf_status): New method.
6328 (icf_status_): New variable.
6329 * (options.cc) (General_options::finalize): Set icf_status_.
6330 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6331 icf_test and icf_keep_unique_test to use the --icf enum flag.
6332 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6333 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6334
f345227a
ST
63352009-10-12 Sriraman Tallam <tmsriram@google.com>
6336
6337 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6338 includes to gc.h and icf.h.
6339 * arm.cc: Include gc.h.
6340 * gold.cc: Likewise.
6341 * i386.cc: Likewise.
6342 * powerpc.cc: Likewise.
6343 * sparc.cc: Likewise.
6344 * x86_64.cc: Likewise.
6345 * gc.h: Include icf.h.
6346
1c7814ed
ILT
63472009-10-11 Ian Lance Taylor <iant@google.com>
6348
6349 * plugin.cc: Include "gold.h" before other header files.
6350
ae3b5189
CD
63512009-10-10 Chris Demetriou <cgd@google.com>
6352
6353 * options.h (Input_file_argument::Input_file_type): New enum.
6354 (Input_file_argument::is_lib_): Replace with...
6355 (Input_file_argument::type_): New member.
6356 (Input_file_argument::Input_file_argument): Take Input_file_type
6357 'type' rather than boolean 'is_lib' as second argument.
6358 (Input_file_argument::is_lib): Use type_.
6359 (Input_file_argument::is_searched_file): New function.
6360 (Input_file_argument::may_need_search): Handle is_searched_file.
6361 * options.cc (General_options::parse_library): Support -l:filename.
6362 (General_options::parse_just_symbols): Update for Input_file_argument
6363 changes.
6364 (Command_line::process): Likewise.
6365 * archive.cc (Archive::get_file_and_offset): Likewise.
6366 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6367 * script.cc (read_script_file, script_add_file): Likewise.
6368 * fileread.cc (Input_file::Input_file): Likewise.
6369 (Input_file::will_search_for): Handle is_searched_file.
6370 (Input_file::open): Likewise.
6371 * readsyms.cc (Read_symbols::get_name): Likewise.
6372 * testsuite/Makefile.am (searched_file_test): New test.
6373 * testsuite/Makefile.in: Regenerate.
6374 * testsuite/searched_file_test.cc: New file.
6375 * testsuite/searched_file_test_lib.cc: New file.
6376
f3048a1d
ILT
63772009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6378 Ian Lance Taylor <iant@google.com>
6379
6380 * descriptor.cc: Include <cstdio> and "binary-io.h".
6381 (Descriptors::open): Open the files in binary mode always.
6382 * script.cc (Lex::get_token): Treat \r as whitespace.
6383
d4780e57
ILT
63842009-10-09 Ian Lance Taylor <iant@google.com>
6385
6386 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6387
d9a893b8
ILT
63882009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6389 Ian Lance Taylor <iant@google.com>
6390
6391 * configure.ac: Check for readv function also.
6392 * fileread.cc (readv): Define if not HAVE_READV.
6393 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6394 does not exist.
6395 * config.in: Regenerate.
6396 * configure: Regenerate.
6397
c0a62865
DK
63982009-10-09 Doug Kwan <dougkwan@google.com>
6399
6400 * layout.cc (Layout::make_output_section): Call target hook to make
6401 ordinary output section.
6402 (Layout::finalize): Adjust parameter list of call the
6403 Target::may_relax().
6404 * layout.h (class Layout::section_list): New method.
6405 * merge.h (Output_merge_base::entsize): Change visibility to public.
6406 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6407 New methods.
6408 (Output_merge_string::do_is_string): New method.
6409 * object.cc (Sized_relobj::do_setup): renamed from
6410 Sized_relobj::set_up.
6411 * object.h (Sized_relobj::adjust_shndx,
6412 Sized_relobj::initializ_input_to_output_maps,
6413 Sized_relobj::free_input_to_output_maps): Change visibilities to
6414 protected.
6415 (Sized_relobj::setup): Virtualize.
6416 (Sized_relobj::do_setup): New method declaration.
6417 (Sized_relobj::invalidate_section_offset,
6418 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6419 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6420 * options.cc (parse_int): New function.
6421 * options.h (parse_int): New declaration.
6422 (DEFINE_int): New macro.
6423 (stub_group_size): New option.
6424 * output.cc (Output_section::Output_section): Initialize memebers
6425 merge_section_map_, merge_section_by_properties_map_,
6426 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6427 (Output_section::add_input_section): Handled deferred code-fill
6428 generation and remove an old comment.
6429 (Output_section::add_relaxed_input_section): New method definition.
6430 (Output_section::add_merge_input_section): Use merge section by
6431 properties map to speed to search. Update merge section maps
6432 as appropriate.
6433 (Output_section::build_relaxation_map): New method definition.
6434 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6435 Same.
6436 (Output_section::relax_input_section): Renamed to
6437 Output_section::convert_input_sections_to_relaxed_sections and change
6438 interface to take a vector of pointers to relaxed sections.
6439 (Output_section::find_merge_section,
6440 Output_section::find_relaxed_input_section): New method definitions.
6441 (Output_section::is_input_address_mapped,
6442 Output_section::output_offset, Output_section::output_address):
6443 Use output section data maps to speed up searching.
6444 (Output_section::find_starting_output_address): Add comments.
6445 (Output_section::do_write,
6446 Output_section::write_to_postprocessing_buffer): Do code-fill
6447 generation as appropriate.
6448 (Output_section::get_input_sections): Invalidate relaxed input section
6449 map.
6450 (Output_section::restore_states): Adjust type of checkpoint .
6451 Invalidate relaxed input section map.
6452 * output.h (Output_merge_base): New class declaration.
6453 (Input_section_specifier): New class defintion.
6454 (class Output_relaxed_input_section) Change base class to
6455 Output_section_data_build.
6456 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6457 base class initializer.
6458 (Output_section::add_relaxed_input_section): New method declaration.
6459 (Output_section::Input_section): Change visibility to protected.
6460 (Output_section::Input_section::relobj,
6461 Output_section::Input_section::shndx): Handle relaxed input sections.
6462 Output_section::input_sections) Change visibility to protected. Also
6463 define overload to return a non-const pointer.
6464 (Output_section::Merge_section_properties): New class defintion.
6465 (Output_section::Merge_section_by_properties_map,
6466 Output_section::Output_section_data_by_input_section_map,
6467 Output_section::Relaxation_map): New types.
6468 (Output_section::relax_input_section): Rename method to
6469 Output_section::convert_input_sections_to_relaxed_sections and change
6470 interface to take a vector of relaxed section pointers.
6471 (Output_section::find_merge_section,
6472 Output_section::find_relaxed_input_section,
6473 Output_section::build_relaxation_map,
6474 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6475 New method declarations.
6476 (Output_section::merge_section_map_
6477 Output_section::merge_section_by_properties_map_,
6478 Output_section::relaxed_input_section_map_,
6479 Output_section::is_relaxed_input_section_map_valid_,
6480 Output_section::generate_code_fills_at_write_): New data members.
6481 * script-sections.cc
6482 (Output_section_element_input::set_section_addresses): Call
6483 current_data_size and addralign methods of relaxed input sections.
6484 (Orphan_output_section::set_section_addresses): Call current_data_size
6485 and addralign methods of relaxed input sections.
6486 * symtab.cc (Symbol_table::compute_final_value): Extract template
6487 from the body of Symbol_table::sized_finalize_symbol.
6488 (Symbol_table::sized_finalized_symbol): Call
6489 Symbol_table::compute_final_value.
6490 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6491 (Symbol_table::compute_final_value): New templated method declaration.
6492 * target.cc (Target::do_make_output_section): New method defintion.
6493 * target.h (Target::make_output_section): New method declaration.
6494 (Target::relax): Add more parameters for input objects, symbol table
6495 and layout. Adjust call to do_relax.
6496 (Target::do_make_output_section): New method declaration.
6497 (Target::do_relax): Add parameters for input objects, symbol table
6498 and layout.
6499
d446d6c4
ILT
65002009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6501
6502 * pread.c: Include stdio.h.
6503
bc06c745
ILT
65042009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6505
6506 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6507 defined.
6508
75aea3d0
ILT
65092009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6510
6511 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6512 Change read_shndx type to unsigned int.
6513 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6514 int.
6515 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6516 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6517 Change read_shndx type to unsigned int.
6518 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6519 int.
6520 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6521 * layout.cc (Layout::create_symtab_sections): Cast the result of
6522 local_symcount * symsize to off_t in the gold_assert.
6523
be8fcb75
ILT
65242009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6525
6526 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6527 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6528 R_ARM_BASE_ABS.
6529 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6530 (Arm_relocate_functions::thm_abs5): New function.
6531 (Arm_relocate_functions::abs12): New function.
6532 (Arm_relocate_functions::abs16): New function.
6533 (Arm_relocate_functions::base_abs): New function.
6534 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6535 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6536 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6537 R_ARM_BASE_ABS.
6538 (Scan::global): Likewise.
6539 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6540 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6541 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6542 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6543 R_ARM_BASE_ABS.
6544
c2a122b6
ILT
65452009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6546
6547 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6548 (Arm_relocate_functions::movt_prel): New function.
6549 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6550 (Arm_relocate_functions::thm_movt_prel): New function.
6551 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6552 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6553 (Scan::global, Relocate::relocate): Likewise.
6554 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6555
c4aa1e2d
ILT
65562009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6557
6558 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6559 Incremental_checker.
6560 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6561 unsigned int.
6562 (class Incremental_inputs_header): New class.
6563 (Incremental_inputs_header_writer): Edit comment.
6564 (Incremental_inputs_entry): New class.
6565 (Incremental_inputs_entry_writer): Edit comment.
6566 (Sized_incremental_binary::do_find_incremental_inputs_section):
6567 Add *strtab_shndx parameter, fill it.
6568 (Sized_incremental_binary::do_check_inputs): New method.
6569 (Incremental_checker::can_incrementally_link_output_file): Use
6570 Sized_incremental_binary::check_inputs.
6571 (Incremental_inputs::report_command_line): Save command line in
6572 command_line_.
6573 * incremental.h:
6574 (Incremental_binary::find_incremental_inputs_section): New
6575 method.
6576 (Incremental_binary::do_find_incremental_inputs_section): Add
6577 strtab_shndx parameter.
6578 (Incremental_binary::do_check_inputs): New pure virtual method.
6579 (Sized_incremental_binary::do_check_inputs): Declare.
6580 (Incremental_checker::Incremental_checker): Add incremental_inputs
6581 parameter, use it to initialize incremental_inputs_.
6582 (Incremental_checker::incremental_inputs_): New field.
6583 (Incremental_checker::command_line): New method.
6584 (Incremental_checker::inputs): New method.
6585 (Incremental_checker::command_line_): New field.
6586
c549a694
ILT
65872009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6588
6589 * incremental.cc: Include <cstdarg> and "target-select.h".
6590 (vexplain_no_incremental): New function.
6591 (explain_no_incremental): New function.
6592 (Incremental_binary::error): New method.
6593 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6594 method.
6595 (make_sized_incremental_binary): New function.
6596 (open_incremental_binary): New function.
6597 (can_incrementally_link_file): Add checks if output is ELF and has
6598 inputs section.
6599 * incremental.h: Include "elfcpp_file.h" and "output.h".
6600 (Incremental_binary): New class.
6601 (Sized_incremental_binary): New class.
6602 (open_incremental_binary): Declare.
6603 * object.cc (is_elf_object): Use
6604 elfcpp::Elf_recognizer::is_elf_file.
6605 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6606 * output.h (Output_file::filesize): New method.
6607
fd3c5f0b
ILT
66082009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6609
6610 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6611 New function.
6612 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6613 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6614 function.
6615 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6616 function.
6617 (Arm_relocate_functions::movw_abs_nc): New function.
6618 (Arm_relocate_functions::movt_abs): New function.
6619 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6620 (Arm_relocate_functions::thm_movt_abs): New function.
6621 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6622 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6623 (Scan::global): Likewise.
6624 (Relocate::relocate): Likewise.
6625 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6626
7f5309a5
ILT
66272009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6628
6629 * arm.cc (Arm_relocate_functions::got_prel) New function.
6630 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6631 (Relocate::relocate): Likewise.
6632 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6633
364c7fa5
ILT
66342009-10-06 Ian Lance Taylor <iant@google.com>
6635
6636 * options.h (class General_options): Define
6637 split_stack_adjust_size parameter.
6638 * object.h (class Object): Add uses_split_stack_ and
6639 has_no_split_stack_ fields. Add uses_split_stack and
6640 has_no_split_stack accessor functions. Declare
6641 handle_split_stack_section.
6642 (class Reloc_symbol_changes): Define.
6643 (class Sized_relobj): Define Function_offsets. Declare
6644 split_stack_adjust, split_stack_adjust_reltype, and
6645 find_functions.
6646 * object.cc (Object::handle_split_stack_section): New function.
6647 (Sized_relobj::do_layout): Call handle_split_stack_section.
6648 * dynobj.cc (Sized_dynobj::do_layout): Call
6649 handle_split_stack_section.
6650 * reloc.cc (Sized_relobj::relocate_sections): Call
6651 split_stack_adjust for executable sections in split_stack
6652 objects. Pass reloc_map to relocate_section.
6653 (Sized_relobj::split_stack_adjust): New function.
6654 (Sized_relobj::split_stack_adjust_reltype): New function.
6655 (Sized_relobj::find_functions): New function.
6656 * target-reloc.h: Include "object.h".
6657 (relocate_section): Add reloc_symbol_changes parameter. Change
6658 all callers.
6659 * target.h (class Target): Add calls_non_split method. Declare
6660 do_calls_non_split virtual method. Declare match_view and
6661 set_view_to_nop.
6662 * target.cc: Include "elfcpp.h".
6663 (Target::do_calls_non_split): New function.
6664 (Target::match_view): New function.
6665 (Target::set_view_to_nop): New function.
6666 * gold.cc (queue_middle_tasks): Give an error if mixing
6667 split-stack and non-split-stack objects with -r.
6668 * i386.cc (Target_i386::relocate_section): Add
6669 reloc_symbol_changes parameter.
6670 (Target_i386::do_calls_non_split): New function.
6671 * x86_64.cc (Target_x86_64::relocate_section): Add
6672 reloc_symbol_changes parameter.
6673 (Target_x86_64::do_calls_non_split): New function.
6674 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
6675 parameter.
6676 * powerpc.cc (Target_powerpc::relocate_section): Add
6677 reloc_symbol_changes parameter.
6678 * sparc.cc (Target_sparc::relocate_section): Add
6679 reloc_symbol_changes parameter.
6680 * configure.ac: Call AM_CONDITIONAL for the default target.
6681 * configure: Rebuild.
6682 * testsuite/Makefile.am (TEST_AS): New variable.
6683 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
6684 (check_DATA): Add split_i386 and split_x86_64 files.
6685 (SPLIT_DEFSYMS): Define.
6686 (split_i386_[1234n].o): New targets.
6687 (split_i386_[124]): New targets.
6688 (split_i386_[1234r].stdout): New targets.
6689 (split_x86_64_[1234n].o): New targets.
6690 (split_x86_64_[124]): New targets.
6691 (split_x86_64_[1234r].stdout): New targets.
6692 (MOSTLYCLEANFILES): Add new executables.
6693 * testsuite/split_i386.sh: New file.
6694 * testsuite/split_x86_64.sh: New file.
6695 * testsuite/split_i386_1.s: New file.
6696 * testsuite/split_i386_2.s: New file.
6697 * testsuite/split_i386_3.s: New file.
6698 * testsuite/split_i386_4.s: New file.
6699 * testsuite/split_i386_n.s: New file.
6700 * testsuite/split_x86_64_1.s: New file.
6701 * testsuite/split_x86_64_2.s: New file.
6702 * testsuite/split_x86_64_3.s: New file.
6703 * testsuite/split_x86_64_4.s: New file.
6704 * testsuite/split_x86_64_n.s: New file.
6705 * testsuite/testfile.cc (Target_test): Update relocation_section
6706 function.
6707 * testsuite/Makefile.in: Rebuild.
6708
e8a9fcda
ILT
67092009-10-06 Ian Lance Taylor <iant@google.com>
6710
6711 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
6712 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
6713 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
6714 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
6715 the address on ldo_addrs_.
6716 (Target_i386::Relocate::fix_up_ldo): New function.
6717
e99daf92
ILT
67182009-10-06 Rafael Espindola <espindola@google.com>
6719
6720 * plugin.cc (add_input_library): New.
6721 (Plugin::load): Add add_input_library to tv.
6722 (Plugin_manager::add_input_file): Add the is_lib argument.
6723 (add_input_file): Update call to Plugin_manager::add_input_file.
6724 (add_input_library): New.
6725 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
6726
966d4097
DK
67272009-09-30 Doug Kwan <dougkwan@google.com>
6728
6729 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
6730 symbol and call Symbol::may_need_copy_reloc to determine if
6731 a copy reloc is needed.
6732 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
6733 nocopyreloc is given in command line.
6734 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
6735 given in command line.
6736 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
6737 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
6738 of the removed Target_i386::may_need_copy_reloc.
6739 * options.h (copyreloc): New option with default value false.
6740 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6741 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
6742 instead of the removed Target_powerpc::may_need_copy_reloc.
6743 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6744 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
6745 instead of the removed Target_sparc::may_need_copy_reloc.
6746 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
6747 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
6748 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
6749 instead of the removed Target_x86_64::may_need_copy_reloc.
6750
029ba973
ILT
67512009-09-30 Ian Lance Taylor <iant@google.com>
6752
6753 * object.h (class Object): Remove target_ field, and target,
6754 sized_target, and set_target methods.
6755 (Object::sized_target): Remove.
6756 (class Sized_relobj): Update declarations. Remove sized_target.
6757 * object.cc (Sized_relobj::setup): Remove target parameter.
6758 Change all callers.
6759 (Input_objects::add_object): Don't do anything with the target.
6760 (make_elf_sized_object): Add punconfigured parameter. Change all
6761 callers. Set or test parameter target.
6762 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
6763 Change all callers.
6764 * parameters.cc (Parameters::set_target): Change parameter type to
6765 be non-const.
6766 (Parameters::default_target): Remove.
6767 (set_parameters_target): Change parameter type to be non-const.
6768 (parameters_force_valid_target): New function.
6769 (parameters_clear_target): New function.
6770 * parameters.h (class Parameters): Update declarations. Remove
6771 default_target method. Add sized_target and clear_target
6772 methods. Change target_ to be non-const.
6773 (set_parameters_target): Update declaration.
6774 (parameters_force_valid_target): Declare.
6775 (parameters_clear_target): Declare.
6776 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
6777 as NULL if we aren't searching.
6778 (Add_symbols::run): Don't check for compatible target.
6779 * fileread.cc (Input_file::open_binary): Call
6780 parameters_force_valid_target.
6781 * gold.cc (queue_middle_tasks): Likewise.
6782 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
6783 set_target on object.
6784 * dynobj.h (class Sized_dynobj): Update declarations.
6785 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
6786 make_elf_object returns NULL.
6787 (Archive::include_member): Don't check whether object target is
6788 compatible.
6789 * output.cc (Output_section::add_input_section): Get target from
6790 parameters.
6791 (Output_section::relax_input_section): Likewise.
6792 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
6793 parameters.
6794 (Sized_relobj::do_scan_relocs): Likewise.
6795 (Sized_relobj::relocate_sections): Likewise.
6796 * resolve.cc (Symbol_table::resolve): Likewise.
6797 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
6798 parameter. Change all callers.
6799 (Symbol_table::add_from_object): Get target from parameters.
6800 (Symbol_table::add_from_relobj): Don't check object target.
6801 (Symbol_table::add_from_dynobj): Likewise.
6802 (Symbol_table::define_special_symbol): Get target from
6803 parameters.
6804 * symtab.h (class Symbol_table): Update declaration.
6805 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
6806 parameter. Change all callers. Clear parameter target.
6807 (Binary_test): Test target here.
6808 * testsuite/object_unittest.cc (gold_testsuite): Remove
6809 target_test_pointer parameter. Change all callers.
6810 (Object_test): Test target here.
6811
a6a22b83
ILT
68122009-09-26 Ian Lance Taylor <iant@google.com>
6813
6814 * testsuite/initpri1.c: Don't try to use constructor priorities if
6815 compiling with gcc before 4.3.
6816
6a8f49fe
ILT
68172009-09-22 Mikolaj Zalewski <mikolajz@google.com>
6818
6819 * testsuite/retain_symbols_file_test.sh (check_present): Change
6820 output file name to retain_symbols_file_test.stdout.
6821 (check_absent): Likewise.
6822
8c604651
CS
68232009-09-18 Craig Silverstein <csilvers@google.com>
6824
6825 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
6826 * options.cc: Include <cerrno> and <fstream>.
6827 (General_options::finalize): Parse -retain-symbols-file tag.
6828 * options.h: New flag.
6829 (General_options): New method should_retain_symbol, new
6830 variable symbols_to_retain.
6831 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
6832 should_retain_symbol map.
6833 * testsuite/Makefile.am (retain_symbols_file_test): New test.
6834 * testsuite/Makefile.in: Regenerate.
6835 * testsuite/retain_symbols_file_test.sh: New file.
6836
ca58b19f
NC
68372009-09-18 Nick Clifton <nickc@redhat.com>
6838
6839 * po/es.po: Updated Spanish translation.
6840
20e6d0d6
DK
68412009-09-17 Doug Kwan <dougkwan@google.com>
6842
6843 * debug.h (DEBUG_RELAXATION): New constant.
6844 (DEBUG_ALL): Add DEBUG_RELAXATION.
6845 (debug_string_to_enum): Add relaxation debug option.
6846 * layout.cc
6847 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
6848 Layout::Relaxation_debug_check::read_sections,
6849 Layout::Relaxation_debug_check::read_sections): New method definitions.
6850 (Layout::Layout): Initialize data members
6851 record_output_section_data_from_scrips_,
6852 script_output_section_data_list_ and relaxation_debug_check_.
6853 (Layout::save_segments, Layout::restore_segments,
6854 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6855 Layout::relaxation_loop_body): New method definitions.
6856 (Layout::finalize): Support relaxation. Move section layout code to
6857 Layout::relaxation_loop_body.
6858 (Layout::set_asection_address_from_script): Move code for orphan
6859 section placement out.
6860 (Layout::place_orphan_sections_in_script): New method definition.
6861 * layout.h (Output_segment_headers, Output_file_header):
6862 New forward class declarations.
6863 (Layout::~Layout): Define.
6864 (Layout::new_output_section_data_from_script): New method definition.
6865 (Layout::place_orphan_sections_in_script): New method declaration.
6866 (Layout::Segment_states): New type declaration.
6867 (Layout::save_segments, Layout::restore_segments,
6868 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6869 Layout::relaxation_loop_body): New method declarations.
6870 (Layout::Output_section_data_list): New type declaration.
6871 (Layout::Relaxation_debug_check): New class definition.
6872 (Layout::record_output_section_data_from_script_,
6873 Layout::script_output_section_data_list_, Layout::segment_states_,
6874 Layout::relaxation_debug_check_): New data members.
6875 * output.cc: (Output_section_headers::do_size): New method definition.
6876 (Output_section_headers::Output_section_headers): Move size
6877 computation to Output_section_headers::do_size.
6878 (Output_segment_headers::do_size): New method definition.
e1df38aa 6879 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
6880 Output_file_header::do_size and call it.
6881 (Output_file_header::do_size): New method definition.
6882 (Output_data_group::Output_data_group): Adjust call to
6883 Output_section_data.
6884 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
6885 (Output_symtab_xindex::do_write): Add array bound check.
6886 (Output_section::Input_section::print_to_mapfile): Handle
6887 RELAXED_INPUT_SECTION_CODE.
6888 (Output_section::Output_section): Initialize data member checkpoint_.
6889 (Output_section::~Output_section): Delete checkpoint object pointed
6890 by checkpoint_.
6891 (Output_section::add_input_section): Always add an Input_section if
6892 relaxing.
6893 (Output_section::add_merge_input_section): Add assert.
6894 (Output_section::relax_input_section): New method definition.
6895 (Output_section::set_final_data_size): Set load address to zero for
6896 an unallocated section.
6897 (Output_section::do_address_and_file_offset_have_reset_values):
6898 New method definition.
6899 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
6900 Handle relaxed input section.
6901 (Output_section::sort_attached_input_sections): Checkpoint input
6902 section list lazily.
6903 (Output_section::get_input_sections): Change type of input_sections to
6904 list of Simple_input_section pointers. Checkpoint input section list
6905 lazily. Also handle relaxed input sections.
6906 (Output_section::add_input_section_for_script): Take a reference to
6907 a Simple_input_section object instead of Relobj pointer and section
6908 index as parameter. Handle relaxed input sections.
6909 (Output_section::save_states, Output_section::restore_states): New
6910 method definitions.
6911 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
6912 (Output_data::is_data_size_fixed): New method definition.
6913 (Output_data::reset_addresss_and_file_offset): Do not reset data size
6914 if it is fixed.
6915 (Output_data::address_and_file_offset_have_reset_values): New method
6916 definition.
6917 (Output_data::do_address_and_file_offset_have_reset_values): New method
6918 definition.
6919 (Output_data::set_data_size): Check that data size is not fixed.
6920 (Output_data::fix_data_size): New method definition.
6921 (Output_data::is_data_size_fixed_): New data member.
6922 (Output_section_headers::set_final_data_size): New method definition.
6923 (Output_section_headers::do_size): New method declaration.
6924 (Output_segment_headers::set_final_data_size): New method definition.
6925 (Output_segment_headers::do_size): New method declaration.
6926 (Output_file_header::set_final_data_size)::New method definition.
6927 (Output_file_header::do_size)::New method declaration.
6928 (Output_section_data::Output_section_data): Add new parameter
6929 is_data_size_fixed and use it to fix data size.
6930 (Output_data_const::Output_data_const): Adjust call to base class
6931 constructor and fix data size.
6932 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
6933 base class constructor and fix data size.
6934 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
6935 base class constructor and fix data size.
6936 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
6937 class constructor and fix data size.
6938 (Output_data_group::set_final_data_size): New method definition.
6939 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
6940 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
6941 class constructor and fix data size.
6942 (Output_relaxed_input_section): New class definition.
6943 (Output_section::Simple_input_section): New class definition.
6944 (Output_section::get_input_sections): Adjust parameter list.
6945 (Output_section::add_input_section_for_script): Same.
6946 (Output_section::save_states, Output_section::restore_states,
6947 Output_section::do_address_and_file_offset_have_reset_values,
6948 (Output_section::Input_section::Input_section): Handle
6949 RELAXED_INPUT_SECTION_CODE. Add new overload for
6950 Output_relaxed_input_section.
6951 (Output_section::Input_section::is_input_section,
6952 Output_section::Input_section::set_output_section): Handle relaxed
6953 input section.
6954 (Output_section::Input_section::is_relaxed_input_section,
6955 Output_section::Input_section::output_section_data,
6956 Output_section::Input_section::relaxed_input_section): New method
6957 definitions.
6958 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
6959 value.
6960 (Output_section::Input_section::u1_): Update comments.
6961 (Output_section::Input_section::u2_): Add new union member poris.
6962 (Output_section::Checkpoint_output_section): New classs definition.
6963 (Output_section::relax_input_section): New method declaration.
6964 (Output_section::checkpoint_): New data member.
6965 (Output_segment): Update comments.
6966 (Output_segment::Output_segment): Un-privatize copy constructor.
6967 (Output_segment::operator=): Un-privatize.
6968 * script-sections.cc (Output_section_element::Input_section_list):
6969 Change element type to Output_section::Simple_input_section.
6970 (Output_section_element_dot_assignment::set_section_addresses):
6971 Register output section data for relaxation clean up.
6972 (Output_data_exression::Output_data_expression): Adjust call to base
6973 constructor to fix data size.
6974 (Output_section_element_data::set_section_addresses): Register
6975 Output_data_expression object for relaxation clean up.
6976 (struct Input_section_info): Replace Relobj pointer and section index
6977 pair with Output_section::Simple_input_section and Convert struct to a
6978 class.
6979 (Input_section_sorter::operator()): Adjust access to
e1df38aa 6980 Input_section_info data member to use accessors.
20e6d0d6
DK
6981 (Output_section_element_input::set_section_addresses): Use layout
6982 parameter. Adjust code to use Output_section::Simple_input_section
6983 and Input_secction_info classes. Register filler for relaxation
6984 clean up.
6985 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
6986 and section index pair with Output_section::Simple_input_section
6987 class. Adjust code accordingly.
6988 (Phdrs_element::release_segment): New method definition.
6989 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
6990 segment list.
6991 (Script_sections::release_segments): New method definition.
6992 * gold/script-sections.h (Script_sections::release_segments): New
6993 method declaration.
6994 * gold/target.h (Target::may_relax, Target::relax,
6995 Target::do_may_relax, Target::do_relax): New method definitions.
6996
5e445df6
ILT
69972009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6998
6999 * arm.cc (has_signed_unsigned_overflow): New function.
7000 (Arm_relocate_functions::abs8): New function.
7001 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7002 (Target_arm::Scan::global): Likewise.
7003 (Target_arm::relocate::relocate): Likewise.
7004 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7005 Likewise.
7006
8c604651 70072009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7008
7009 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7010 * testsuite/Makefile.in: Regenerate.
7011
1e9cc1c2
NC
70122009-09-11 Nick Clifton <nickc@redhat.com>
7013
7014 * po/gold.pot: Updated by the Translation project.
7015
6a89f575
CC
70162009-09-08 Cary Coutant <ccoutant@google.com>
7017
7018 * output.cc (Output_file::open): Add execute permission to empty file.
7019 * testsuite/Makefile.am (permission_test): New test.
7020 * testsuite/Makefile.in: Regenerate.
7021
fdcac5af
ILT
70222009-09-02 Ian Lance Taylor <iant@google.com>
7023
7024 * output.cc (Output_file::resize): Call map_no_anonymous rather
7025 than map.
7026
44453f85
ILT
70272009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7028
7029 * gold.cc: Include "incremental.h".
7030 (queue_initial_tasks): Call Incremental_checker methods.
7031 * incremental.cc: Include "output.h".
7032 (Incremental_checker::can_incrementally_link_output_file): New
7033 method.
7034 * incremental.h (Incremental_checker): New class.
7035
7036 * output.cc (Output_file::open_for_modification): New method.
7037 (Output_file::map_anonymous): Changed return type to bool. Record
7038 map in base_ field.
7039 (Output_file::map_no_anonymous): New method, broken out of map.
7040 (Output_file::map): Use map_no_anonymous and map_anonymous.
7041 * output.h (class Output_file): Update declarations.
7042
293c1386
CC
70432009-08-24 Cary Coutant <ccoutant@google.com>
7044
7045 * options.h (Command_line::Pre_options): New class.
7046 (Command_line::pre_options): New member.
7047 * options.cc (gold::options::ready_to_register): New variable.
7048 (One_option::register_option): Do nothing if not registering options.
7049 Assert if same short option registered twice.
7050 (General_options::General_options): Turn off option registration when
7051 done constructing.
7052 (Command_line::Pre_options::Pre_options): New constructor.
7053
f773f3d2
CC
70542009-08-24 Cary Coutant <ccoutant@google.com>
7055
06a73cfe
CC
7056 * options.h (General_options::no_keep_memory): Remove incorrect
7057 short option.
f773f3d2 7058
a15af8e2
RW
70592009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7060
7061 * Makefile.am (am__skiplex, am__skipyacc): New.
7062 * Makefile.in: Regenerate.
7063
c462b41b
RW
70642009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7065
14ec8efd
RW
7066 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7067 (INCLUDES): ... this.
7068 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7069 (AM_CPPFLAGS): Renamed from ...
7070 (INCLUDE): ... this.
7071 * Makefile.in, testsuite/Makefile.in: Regenerate.
7072
81ecdfbb
RW
7073 * Makefile.in: Regenerate.
7074 * aclocal.m4: Likewise.
7075 * config.in: Likewise.
7076 * configure: Likewise.
7077 * testsuite/Makefile.in: Likewise.
7078
c462b41b
RW
7079 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7080 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7081 * Makefile.in: Regenerate.
7082 * testsuite/Makefile.in: Regenerate.
7083
2da73f13
CC
70842009-08-19 Cary Coutant <ccoutant@google.com>
7085
7086 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7087 symbols in shared libraries overridden by hidden or internal symbols
7088 in the main program.
7089
2db70501
CD
70902009-08-19 Chris Demetriou <cgd@google.com>
7091
7092 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7093 checking source file names in error messages.
7094
f733487b
DK
70952009-08-18 Doug Kwan <dougkwan@google.com>
7096
7097 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7098 an elcpp::Ehdr as parameter. Adjust call to set_target.
7099 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7100 an elfcpp::Ehdr as parameter.
7101 * object.cc (Object::set_target): Remove the version that looks up
7102 a target and sets it.
7103 (Sized_relobj::setup): Take a Target object instead of
7104 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7105 (make_elf_sized_object): Find target and ask target to
7106 make an ELF object.
7107 * object.h: (Object::set_target): Remove the version that looks up
7108 a target and sets it.
7109 (Sized_relobj::setup): Take a Target object instead of
7110 an elfcpp:Ehdr as parameter.
7111 * target.cc: Include dynobj.h.
7112 (Target::do_make_elf_object_implementation): New.
7113 (Target::do_make_elf_object): New.
7114 * target.h (Target::make_elf_object): New template declaration.
7115 (Target::do_make_elf_object): New method declarations.
7116 (Target::do_make_elf_object_implementation): New template declaration.
7117
cc70f101
ILT
71182009-08-14 Ian Lance Taylor <iant@google.com>
7119
7120 * gold.h (FUNCTION_NAME): Define.
7121 (gold_unreachable): Use FUNCTION_NAME.
7122
ef5e0cb1
ST
71232009-08-12 Sriraman Tallam <tmsriram@google.com>
7124
7125 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7126 symbol in the --keep-unique list is not found.
7127
48c187ce
ST
71282009-08-12 Sriraman Tallam <tmsriram@google.com>
7129
7130 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7131 been maked as --keep-unique.
7132 (Icf::unfold_section): New function.
7133 * icf.h (Icf::unfold_section): New function.
7134 * options.h (General_options::keep_unique): New option.
7135 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7136 * testsuite/Makefile.in: Regenerate.
7137 * testsuite/icf_keep_unique_test.sh: New file.
7138 * testsuite/icf_keep_unique_test.cc: New file.
7139
645afe0c
CC
71402009-08-12 Cary Coutant <ccoutant@google.com>
7141
7142 PR 10471
7143 * resolve.cc (Symbol_table::resolve): Check for references from
7144 dynamic objects to hidden and internal symbols.
7145 * testsuite/Makefile.am (hidden_test.sh): New test.
7146 * testsuite/Makefile.in: Regenerate.
7147 * testsuite/hidden_test.sh: New script.
7148 * testsuite/hidden_test_1.c: New test source.
7149 * testsuite/hidden_test_main.c: New test source.
7150
11af873f
DK
71512009-08-11 Doug Kwan <dougkwan@google.com>
7152
7153 * arm.cc: Update comments.
7154 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7155 segment to locate the .ARM.exidx section if present.
7156
b9f7d72d
DK
71572009-08-09 Doug Kwan <dougkwan@google.com>
7158
7159 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7160 patch.
7161
ddd3c53c
ST
71622009-08-07 Sriraman Tallam <tmsriram@google.com>
7163 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7164 compiler warnings.
7165
27721062
ST
71662009-08-06 Sriraman Tallam <tmsriram@google.com>
7167
7168 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7169 valid tls_segment only for non-debug-section relocations.
7170 * testsuite/Makefile.am: Add gc_tls_test.
7171 * testsuite/Makefile.in: Regenerate.
7172 * testsuite/gc_tls_test.cc: New file.
7173 * testsuite/gc_tls_test.sh: New file.
7174
ef15dade 71752009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7176
ef15dade
ST
7177 * icf.cc: New file.
7178 * icf.h: New file.
7179 * Makefile.am (CCFILES): Add icf.cc.
7180 (HFILES): Add icf.h
7181 * Makefile.in: Regenerate.
7182 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7183 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7184 section, symbol and addend information for the relocs.
7185 * gold.cc (queue_middle_tasks): Call identical code folding.
7186 * gold.h: Add defines for multimap.
7187 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7188 to the call of finalize_local_symbols.
7189 * main.cc (main): Create object of class Icf.
7190 * object.cc (Sized_relobj::do_layout): Allow this function to be
7191 called twice during icf.
7192 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7193 to sections marked as identical by icf.
7194 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7195 when available.
7196 (Sized_relobj::do_section_entsize): New function.
7197 * object.h (Object::section_entsize): New function.
7198 (Object::do_section_entsize): New pure virtual function.
7199 (Relobj::finalize_local_symbols): Add new parameter.
7200 (Relobj::do_section_entsize): New function.
7201 * options.h (General_options::icf): New option.
7202 (General_options::icf_iterations): New option.
7203 (General_options::print_icf_sections): New option.
7204 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7205 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7206 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7207 icf.
7208 * symtab.cc (Symbol_table::is_section_folded): New function.
7209 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7210 to sections marked as identical by icf.
7211 * symtab.h (Symbol_table::set_icf): New function.
7212 (Symbol_table::icf): New function.
7213 (Symbol_table::is_section_folded): New function.
7214 (Symbol_table::icf_): New data member.
7215 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7216 * testsuite/Makefile.am: Add commands to build icf_test.
7217 * testsuite/Makefile.in: Regenerate.
7218 * testsuite/icf_test.sh: New file.
7219 * testsuite/icf_test.cc: New file.
7220
c3b65ac4
CD
72212009-07-24 Chris Demetriou <cgd@google.com>
7222
7223 * layout.cc (is_compressible_debug_section): Fix incorrect
7224 comment about compressed section names.
7225
1caf2c51
ILT
72262009-07-20 Ian Lance Taylor <ian@airs.com>
7227
7228 PR 10419
7229 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7230
1ef4d87f
ILT
72312009-07-16 Ian Lance Taylor <iant@google.com>
7232
7233 PR 10400
7234 * layout.h: #include <map>.
7235 (class Kept_section): Change from struct to class. Add accessors
7236 and setters. Add section size to Comdat_group mapping. Change
7237 Comdat_group to std::map. Add is_comdat_ field. Add
7238 linkonce_size field in union.
7239 (class Layout): Update declaration of find_or_add_kept_section.
7240 Don't declare find_kept_object.
7241 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7242 parameter. Add object, shndx, is_comdat, and is_group_name
7243 parameters. Change all callers. Adjust for new Kept_section.
7244 (Layout::find_kept_object): Remove.
7245 * object.cc (Sized_relobj::include_section_group): Update use of
7246 Kept_section. Rename secnum to shndx. Only record
7247 Kept_comdat_section if sections are the same size.
7248 (Sized_relobj::include_linkonce_section): Update use of
7249 Kept_section. Only record Kept_comdat_section if sections are the
7250 same size. Set size of linkonce section.
7251 (Sized_relobj::map_to_kept_section): Update call to
7252 get_kept_comdat_section.
7253 * object.h (class Sized_relobj): Rename fields in
7254 Kept_comdat_section to drop trailing underscores; change object
7255 field to Relobj*. Change Kept_comdat_section_table to store
7256 struct rather than pointer.
7257 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7258 Add kept_object and kept_shndx parameters. Change all callers.
7259 (Sized_relobj::get_kept_comdat_section): Change return type to
7260 bool. Add kept_object and kept_shndx parameters. Change all
7261 callers.
7262 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7263 Layout::find_or_add_kept_section.
7264
37c3b7b0
ILT
72652009-07-09 Ian Lance Taylor <iant@google.com>
7266
7267 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7268 Reserve space in the hash table.
7269
98fa85cb
ILT
72702009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7271
7272 * fileread.cc (File_read::get_mtime): New method.
7273 * fileread.h (Timespec): New structure.
7274 (File_read::get_mtime): New method.
7275 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7276 Renamed from timestamp_nsec.
7277 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7278 Elf_Xword.
e1df38aa 7279 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7280 timestamp_nsec.
e1df38aa 7281 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7282 (Incremental_inputs::report_obejct): Save mtime; style fix.
7283 (Incremental_inputs::report_script): Save mtime; style fix.
7284 (Incremental_inputs::finalize_inputs): Style fix.
7285 (Incremental_inputs::finalize): Style fix.
7286 (Incremental_inputs::create_input_section_data): Store inputs
7287 mtime.
7288 * incremental.h (Incremental_inputs::report_script): Add mtime
7289 argument.
7290 (Incremental_inputs::Input_info::Input_info): Intialize only one
7291 union member.
7292 (Incremental_inputs::Input_info::archive): Move to nameless
7293 union.
7294 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7295 (Incremental_inputs::Input_info::script): Move to nameless union.
7296 (Incremental_inputs::mtime): New field.
7297 * script.cc (read_input_script): Pass file mtime to
7298 Incremental_input.
7299 * script.h (Script_info::inputs): Style fix.
7300
c9d70757
ILT
73012009-07-01 Ian Lance Taylor <ian@airs.com>
7302
7303 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7304 instead of 32.
7305
9c547ec3
ILT
73062009-06-24 Ian Lance Taylor <iant@google.com>
7307
7308 PR 10156
7309 * layout.cc (Layout::choose_output_section): If we find an
7310 existing section, update the flags.
7311 (Layout::create_notes): New function, broken out of
7312 Layout::finalize.
7313 (Layout::finalize): Don't create note sections.
7314 (Layout::create_note): Don't crash if linker script discards
7315 section.
7316 (Layout::create_gold_note): Likewise.
7317 (Layout::create_build_id): Likewise. Don't set
7318 after_input_sections on the section.
7319 (Layout::create_executable_stack_info): Remove target parameter.
7320 Change caller.
7321 * layout.h (class Layout): Declare create_notes. Update
7322 declaration of create_executable_stack_info.
7323 * gold.cc (queue_middle_tasks): Call create_notes.
7324 * output.cc (Output_section::update_flags_for_input_section): Move
7325 here from output.h. If SHF_ALLOC flag is newly set, mark address
7326 invalid.
7327 * output.h (Output_data::mark_address_invalid): New function.
7328 (class Output_section): Only declare, not define,
7329 update_flags_for_input_section. Remove set_flags.
7330
55458500
ILT
73312009-06-24 Ian Lance Taylor <iant@google.com>
7332
7333 * script-sections.cc (Output_section_definition::
7334 set_section_addresses): Rename shadowing local load_address to
7335 laddr.
7336
1307d6cd
ILT
73372009-06-24 Ian Lance Taylor <iant@google.com>
7338
7339 PR 10244
7340 * reloc.cc (relocate_sections): Skip empty relocation sections.
7341
ec3f783e
ILT
73422009-06-23 Ian Lance Taylor <iant@google.com>
7343
7344 PR 10156
7345 * layout.cc (Layout::create_note): Use choose_output_section
7346 rather than make_output_section.
7347
459c9f1c
ILT
73482009-06-23 Ian Lance Taylor <iant@google.com>
7349
7350 PR 10237
7351 * options.cc (General_options::parse_V): Set printed_version_.
7352 (General_options::General_options): Initialize printed_version_.
7353 * options.h (class General_options): Add printed_version_ field.
7354 * gold.cc (queue_initial_tasks): If there are no input files,
7355 don't give a fatal error if we printed the version information.
7356 (queue_middle_tasks): If using -r with a shared object, give a
7357 fatal error rather than an ordinary error.
7358
1518dc8f
ILT
73592009-06-23 Ian Lance Taylor <iant@google.com>
7360
7361 PR 10219
7362 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7363 (Layout::make_output_section): Set have_stabstr_section_ if we see
7364 a .stab*str section.
7365 (Layout::finalize): Call link_stabs_sections.
7366 (Layout::link_stabs_sections): New file.
7367 * layout.h (class Layout): Add have_stabstr_section_ field.
7368 Declare link_stabs_sections.
7369
3d857b98
DK
73702009-06-23 Doug Kwan <dougkwan@google.com>
7371
7372 * Makefile.am (libgold_a_LIBADD): New.
7373 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7374 * Makefile.in: Regenerate.
7375 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7376 * configure: Regenerate.
7377 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7378 * fileread.cc: Include sys/state.h
7379 * gold.h: Declare memmem and strndup if found missing.
7380 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7381
0639a6f6
ILT
73822009-06-23 Ian Lance Taylor <iant@google.com>
7383
7384 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7385 * configure: Rebuild.
7386
8d63875c
ILT
73872009-06-23 Ian Lance Taylor <iant@google.com>
7388
7389 PR 10147
7390 * object.cc (Object::section_contents): Don't try to get a view if
7391 the section has length zero.
7392 (Object::handle_gnu_warning_section): If the section is empty, use
7393 the name of the section as the warning.
7394
f7c8a183
ILT
73952009-06-23 Ian Lance Taylor <iant@google.com>
7396
7397 PR 10133
7398 * stringpool.h (class Stringpool_template): Add optimize_ field.
7399 (Stringpool_template::set_optimize): New function.
7400 * stringpool.cc (Stringpool_template::Stringpool_template):
7401 Initialize optimize_ field.
7402 (Stringpool_template::set_string_offsets): Test local optimize
7403 fild rather than parameter.
7404 * layout.cc (Layout::Layout): Call set_optimize on the section
7405 name stringpool.
7406
e6a307ba
ILT
74072009-06-22 Ian Lance Taylor <iant@google.com>
7408
7409 PR 10030
7410 * yyscript.y: Parse TARGET.
7411 * script.cc (script_set_target): New function.
7412 * script-c.h (script_set_target): Declare.
7413 * options.cc (General_options::string_to_object_format): Rename
7414 from string_to_object_format in anonymous namespace. Change
7415 callers.
7416 * options.h (class General_options): Declare
7417 string_to_object_format.
7418
3ee173de
ILT
74192009-06-22 Ian Lance Taylor <iant@google.com>
7420
7421 * script-sections.cc (Script_sections::create_segments): Don't put
7422 program headers in a PT_LOAD segment if -n or -N.
7423
74242009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7425
7426 PR 10141
7427 * options.h (class General_options): Add -z lazy and -z now. Sort
7428 -z options into alphabetical order.
7429 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7430
cd6739a1 74312009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7432
7433 * layout.cc (Layout::make_output_section): Call
7434 Target::new_output_section.
7435 (Layout::attach_allocated_section_to_segment): Put large section
7436 sections in a separate load segment with the large segment flag
7437 set.
7438 (Layout::segment_precedes): Sort large data segments after other
7439 load segments.
7440 (align_file_offset): New static function.
7441 (Layout::set_segment_offsets): Use align_file_offset.
7442 * output.h (class Output_section): Add is_small_section_ and
7443 is_large_section_ fields.
7444 (Output_section::is_small_section): New function.
7445 (Output_section::set_is_small_section): New function.
7446 (Output_section::is_large_section): New function.
7447 (Output_section::set_is_large_section): New function.
7448 (Output_section::is_large_data_section): New function.
7449 (class Output_segment): Add is_large_data_segment_ field.
7450 (Output_segment::is_large_data_segment): New function.
7451 (Output_segment::set_is_large_data_segment): New function.
7452 * output.cc (Output_section::Output_section): Initialize new
7453 fields.
7454 (Output_segment::Output_segment): Likewise.
7455 (Output_segment::add_output_section): Add assertion that large
7456 data sections always go in large data segments. Force small data
7457 sections to the end of the list of data sections. Force small BSS
7458 sections to the start of the list of BSS sections. For large BSS
7459 sections to the end of the list of BSS sections.
7460 * symtab.h (class Symbol): Declare is_common_shndx.
7461 (Symbol::is_defined): Check Symbol::is_common_shndx.
7462 (Symbol::is_common): Likewise.
7463 (class Symbol_table): Define enum Commons_section_type. Update
7464 declarations. Add small_commons_ and large_commons_ fields.
7465 * symtab.cc (Symbol::is_common_shndx): New function.
7466 (Symbol_table::Symbol_table): Initialize new fields.
7467 (Symbol_table::add_from_object): Put small and large common
7468 symbols in the right list.
7469 (Symbol_table::sized_finalized_symbol): Check
7470 Symbol::is_common_shndx.
7471 (Symbol_table::sized_write_globals): Likewise.
7472 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7473 common symbol lists. Don't call do_allocate_commons_list if the
7474 list is empty.
7475 (Symbol_table::do_allocate_commons_list): Remove is_tls
7476 parameter. Add comons_section_type parameter. Change all
7477 callers. Handle small and large common symbols.
7478 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7479 Symbol::is_common_shndx.
7480 * resolve.cc (symbol_to_bits): Likewise.
7481 * target.h (Target::small_common_shndx): New function.
7482 (Target::small_common_section_flags): New function.
7483 (Target::large_common_shndx): New function.
7484 (Target::large_common_section_flags): New function.
7485 (Target::new_output_section): New function.
7486 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7487 small_common_section_flags, and large_common_section_flags
7488 fields.
7489 (Target::do_new_output_section): New virtual function.
7490 * arm.cc (Target_arm::arm_info): Initialize new fields.
7491 * i386.cc (Target_i386::i386_info): Likewise.
7492 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7493 Likewise.
7494 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7495 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7496 (Target_x86_64::do_new_output_section): New function.
7497 * configure.ac: Define conditional MCMODEL_MEDIUM.
7498 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7499 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7500 (large_LDFLAGS): Define.
7501 * testsuite/large.c: New file.
7502 * testsuite/testfile.cc (Target_test::test_target_info):
7503 Initialize new fields.
7504 * configure, testsuite/Makefile.in: Rebuild.
7505
bb04269c
DK
75062009-06-05 Doug Kwan <dougkwan@google.com>
7507
7508 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7509 * Makefile.in: Regenerate.
bb04269c
DK
7510 * i386.cc (class Target_i386): Define new virtual method to
7511 override do_is_local_label_name in parent.
7512 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7513 local symbols if --discard-locals or -X is given.
7514 * options.h (class General_options): Declare new options
7515 '--discard-locals' and '-X' for discarding locals.
7516 * target.h (class Target): Define new methods is_local_label_name.
7517 Declare new virtual method do_is_local_label_name.
7518 * target.cc: New file.
7519 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7520 (check_SCRIPTS): Add discard_locals_test.sh.
7521 (check_DATA): Add discard_local_tests.syms.
7522 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7523 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7524 * testsuite/Makefile.in: Regenerate.
7525 * testsuite/discard_locals_test.c: New file.
7526 * testsuite/discard_locals_test.sh: Same.
7527
805bb01c
DK
75282009-06-05 Doug Kwan <dougkwan@google.com>
7529
7530 * object.cc (Sized_relobj::Sized_relobj): Initialize
7531 discarded_eh_frame_shndx_ to -1U.
7532 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7533 section.
7534 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7535 a discarded .eh_frame section.
7536 (Sized_relobj::do_finalize_local_symbols): Ditto.
7537 * object.h (class Sized_relobj): Declare new member
7538 discarded_eh_frame_shndx_.
7539 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7540 (local_labels_test.o, local_labels_test): New rules.
7541 * testsuite/Makefile.in: Regenerate.
7542
1dcd334d
DK
75432009-06-04 Doug Kwan <dougkwan@google.com>
7544
7545 * layout.cc (Layout::section_name_mapping): Add mapping for
7546 special ARM sections.
7547
96d49306
DK
75482009-06-03 Doug Kwan <dougkwan@google.com>
7549
7550 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7551 (utils::has_overflow): Same.
7552
dff16297
ILT
75532009-06-03 Ian Lance Taylor <iant@google.com>
7554
7555 * layout.cc (Layout::section_name_mapping): New array, replacing
7556 Layout::linkonce_mapping.
7557 (Layout::section_name_mapping_count): New variable, replacing
7558 Layout::linkonce_mapping_count.
7559 (Layout::linkonce_output_name): Remove.
7560 (Layout::output_section_name): Rewrite.
7561 * layout.h (class Layout): Rename Linkonce_mapping to
7562 Section_name_mapping, linkonce_mapping to section_name_mapping,
7563 linkonce_mapping_count to section_name_mapping_count. Don't
7564 declare linkonce_output_name.
7565
c121c671
DK
75662009-06-03 Doug Kwan <dougkwan@google.com>
7567
7568 * gold/arm.cc (namespace utils): New.
7569 (Target_arm::reloc_is_non_pic): Define new method.
7570 (class Arm_relocate_functions): New.
7571 (Target_arm::Relocate::relocate): Handle relocation types used by
7572 Android.
7573
07800fab
ILT
75742009-06-03 Ian Lance Taylor <iant@google.com>
7575
7576 * arm.cc (Target_arm::scan::global): Use || instead of |.
7577
c121c671
DK
75782009-06-02 Doug Kwan <dougkwan@google.com>
7579
7580 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7581 issued_non_pic_error_.
7582 (class Target_arm::Scan): Declare new method check_non_pic.
7583 Define new method symbol_needs_plt_entry.
7584 Declare new data member issued_non_pic_error_.
7585 (class Target_arm::Relocate): Declare new method
7586 should_apply_static_reloc.
7587 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7588 (Target_arm::Scan::check_non_pic): Define new method.
7589 (Target_arm::Scan::local): Handle a small subset of reloc types used
7590 by Android.
7591 (Target_arm::Scan::local): Same.
7592 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7593
b19b0c6d
ILT
75942009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7595
7596 * incremental.cc (Incremental_inputs::report_command_line): Filter
7597 out --incremental-* options.
7598
94cdfcff
DK
75992009-05-29 Doug Kwan <dougkwan@google.com>
7600
7601 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7602 template class.
7603 (class Target_arm): Update comment.
7604 (Target_arm::Target_arm): Initialize new data members GOT_,
7605 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7606 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7607 and Target_arm::rel_dyn_section.
7608 Declare new_enum Target_arm::Got_type.
7609 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7610 and DYNBSS_.
7611 Update commments for member do_dynsym_value.
7612 (Target_arm::got_size, Target_arm::plt_section,
7613 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7614 new methods inside class defintion.
7615 (Target_arm::got_section): Define new method.
7616 (Target_arm::rel_dyn_section): Same.
7617 (Output_data_plt_arm): New template class.
7618 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7619 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7620 (Output_data_plt_arm::add_entry): Same.
7621 (Output_data_plt_arm::first_plt_entry): Define new
7622 static data member for PLT instruction template.
7623 (Output_data_plt_arm::plt_entry): Same.
7624 (Output_data_plt_arm::do_write): Define new method.
7625 (Target_arm::make_plt_entry): Same.
7626 (Target_arm::do_finalize_sections): Same.
7627 (Target_arm::do_dynsym_value): Same.
7628
4a657b0d
DK
76292009-05-28 Doug Kwan <dougkwan@google.com>
7630
7631 * Makefile.am (TARGETSOURCES): Add arm.cc.
7632 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7633 * Makefile.in: Regenerate.
7634 * arm.cc: New file.
7635 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7636
e7ae8c36
DK
76372009-05-26 Doug Kwan <dougkwan@google.com>
7638
7639 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7640 (General_options::check_excluded_libs): Strip off directories in
7641 archive name before matching like GNU ld does.
7642 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7643 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7644 (exclude_libs_test_LDFLAGS): Add linker option
7645 -Wl,--exclude-libs,libexclude_libs_test_3
7646 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7647 an explicit archive without using -l.
7648 (alt/libexclude_libs_test_3.a): New make rule.
7649 * testsuite/Makefile.in: Regenerate.
7650 * testsuite/exclude_libs_test.c : Declare lib3_default().
7651 (main): Call it.
7652 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
7653 * exclude_libs_test_3.c: New file.
7654
f12e7348
NC
76552009-05-26 Nick Clifton <nickc@redhat.com>
7656
7657 * po/id.po: New Indonesian translation.
7658 * po/gold.pot: Updated template file.
7659
4daadc0d
ST
76602009-05-22 Sriraman Tallam <tmsriram@google.com>
7661
e1df38aa 7662 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
7663 gc_comdat_test files. Add -Wl,--gc-sections to build
7664 gc_comdat_test.
7665 * testsuite/Makefile.in: Regenerate.
7666 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
7667
531813ad
ST
76682009-05-21 Sriraman Tallam <tmsriram@google.com>
7669
7670 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
7671 kept comdat section was garbage collected.
7672 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
7673 * testsuite/Makefile.in: Regenerate.
7674 * testsuite/gc_comdat_test.sh: New file.
7675 * testsuite/gc_comdat_test_1.cc: New file.
7676 * testsuite/gc_comdat_test_2.cc: New file.
7677
65514900
CC
76782009-05-19 Doug Kwan <dougkwan@google.com>
7679
7680 * archive.cc (Archive::Archive): Move constructor from archive.h
7681 to here. Initialize no_export_.
7682 (Archive::get_elf_object_for_member): Set no_export flag of object.
7683 * archive.h (Archive::Archive): Move constructor body to
7684 archive.cc.
7685 (Archive::no_export): New method.
7686 (Archive::no_export_): New field.
7687 * object.h (Object::Object): Initialize no_export_ to false.
7688 (Object::no_export, Object::set_no_export): New methods.
7689 (Object::no_export_): New field.
7690 * options.cc (General_options::parse_exclude_libs): New method.
7691 (General_options::check_excluded_libs) Same.
7692 * options.h (exclude_libs): New option.
7693 (General_options::check_excluded_libs): New method declaration.
7694 (General_options::excluded_libs_): New field.
7695 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
7696 default or protected visibility if an object has no-export flag set.
7697 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
7698 (check_SCRIPTS): Add exclude_libs_test.sh.
7699 (check_DATA): Add exclude_libs_test.syms.
7700 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
7701 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
7702 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
7703 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
7704 (exclude_libs_test.syms, libexclude_libs_test_1.a,
7705 libexclude_libs_test_2.a): New rules.
7706 * testsuite/Makefile.in: Regenerate.
7707 * testsuite/exclude_libs_test.c: New file.
7708 * testsuite/exclude_libs_test.sh: Ditto.
7709 * testsuite/exclude_libs_test_1.c: Ditto.
7710 * testsuite/exclude_libs_test_2.c: Ditto.
7711
1b77ea50
ILT
77122009-05-15 Ian Lance Taylor <iant@google.com>
7713
7714 * configure.ac: Check for declarations for cases where libiberty.h
7715 checks HAVE_DECL_xxx.
7716 * configure, config.in: Rebuild.
7717
072fe7ce
ILT
77182009-05-15 Mikolaj Zalewski <mikolajz@google.com>
7719
7720 * gold.h (Incremental_argument_list): Remove (invalid) forward
7721 declaration.
7722 * incremental.cc (Incremental_inputs::report_achive): New method.
7723 (Incremental_inputs::report_object): New method.
7724 (Incremental_inputs::report_script): New method.
7725 (Incremental_inputs::finalize_inputs): New method.
7726 (Incremental_inputs::finalize): Call finalize_inputs().
7727 (Incremental_inputs::sized_create_incremental_inputs_section_data):
7728 Create inputs entries.
7729 * incremental.h (Incremental_input_type): New enum.
7730 (Incremental_inputs::Incremental_input): Initialize new fields.
7731 (Incremental_inputs::report_inputs): New method.
7732 (Incremental_inputs::report_achive): New method.
7733 (Incremental_inputs::report_object): New method.
7734 (Incremental_inputs::report_script): New method.
7735 (Incremental_inputs::finalize_inputs): New method.
7736 (Incremental_inputs::Input_info): New struct.
7737 (Incremental_inputs::Input_info_map): New typedef.
7738 (Incremental_inputs::lock_): New field.
7739 (Incremental_inputs::Inputs_): New field.
7740 (Incremental_inputs::Inputs_map): New field.
7741 * main.cc (main): Call Incremental_input::report_inputs.
7742 * options.h (Input_argument_list): Typedef moved from
7743 Input_arguments.
7744 (Input_file_group::Files): Remove, use ::Input_argument_list.
7745 (Input_file_group::Input_argument_list): Remove, use
7746 ::Input_argument_list.
7747 * plugin.cc (Plugin_manager::add_input_file): Add error in
7748 incremental build.
7749 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
7750 functions.
7751 * script.cc (read_input_script): Call
7752 Incremental_input::report_script.
7753 * script.h (Script_info): New class.
7754
b0481b0b
ILT
77552009-04-27 Ian Lance Taylor <iant@google.com>
7756
7757 * x86_64.cc (do_adjust_output_section): Set entsize to
7758 plt_entry_size.
7759
b22a5a41 77602009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
7761
7762 * output.cc (Output_file::close): After short writes, continue
7763 writing from the correct offset in the buffer being written.
7764
40fde488
CD
77652009-04-23 Chris Demetriou <cgd@google.com>
7766
7767 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
7768 * configure: Regenerate.
7769 * config.in: Regenerate.
7770 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
7771 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
7772
3ce2c28e
ILT
77732009-04-21 Mikolaj Zalewski <mikolajz@google.com>
7774
7775 * incremental.cc (Incremental_inputs_header_data): Renamed from
7776 Incremental_input_header_data.
7777 (Incremental_inputs_header_data::data_size): New field.
7778 (Incremental_inputs_header_data::put_input_file_count): Renamed
7779 from input_file_count.
7780 (Incremental_inputs_header_data::put_command_line_offset): Renamed
7781 from command_line_offset.
7782 (Incremental_inputs_header_data::put_reserved): Renamed from
7783 put_reserved.
7784 (Incremental_inputs_entry_data): Renamed from
7785 Incremental_input_entry_data.
7786 (Incremental_inputs_entry_data::data_size): New field.
7787 (Incremental_inputs::report_command_line): New method.
7788 (Incremental_inputs::finalize): New method.
7789 (Incremental_inputs::create_incremental_inputs_data): New method.
7790 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
7791 * incremental.h: New file.
7792 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
7793 (Layout::finalize): Create incremental inputs section in
7794 incremental builds.
7795 (Layout::create_incremental_info_sections): New method.
7796 * layout.h (Layout::incremental_inputs): New method.
7797 (Layout::create_incremental_info_sections): New method.
7798 (Layout::incremental_inputs_): New field.
7799 * main.cc (main): Notify Incremental_input of the command line.
7800
e55bde5e
ILT
78012009-04-01 Ian Lance Taylor <iant@google.com>
7802 Mikolaj Zalewski <mikolajz@google.com>
7803
7804 * gold.h (reserve_unordered_map): Define, three versions, one for
7805 each version of Unordered_map.
7806 * layout.cc (Layout::Layout): Remove options parameter. Add
7807 number_of_input_files parameter. Don't initialize options_.
7808 Initialize number_of_input_files_ and resized_signatures_. Move
7809 sections_are_attached_.
7810 (Layout::layout_group): Reserve space for group_signatures_.
7811 (Layout::find_or_add_kept_section): Change name parameter to be a
7812 reference. Resize signatures_ map when it gets large enough.
7813 (Layout::layout_eh_frame): Use parameters->options() instead of
7814 this->options_.
7815 (Layout::make_output_section): Likewise.
7816 (Layout::attach_allocated_section_to_segment): Likewise.
7817 (Layout::finalize, Layout::create_executable_stack): Likewise.
7818 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
7819 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
7820 * layout.h (class Layout): Update declarations. Remove options_
7821 field. Add number_of_input_files_ and resized_signatures_
7822 fields. Move sections_are_attached_ field.
7823 * main.cc (main): Pass number of input files to Layout
7824 constructor. Don't pass options.
7825
154b857c
ILT
78262009-03-30 Ian Lance Taylor <iant@google.com>
7827
7828 * ffsll.c (ffsll): Correct implementation.
7829
2f35ab9b
ILT
78302009-03-27 Ian Lance Taylor <iant@google.com>
7831
fd03461a
ILT
7832 * ffsll.c: New file.
7833 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
7834 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
7835 * ftruncate.c (ftruncate): Declare before definition.
7836 * mremap.c (mremap): Likewise.
7837 * pread.c (pread): Likewise.
7838 * configure, Makefile.in, config.in: Rebuild.
7839
2f35ab9b
ILT
7840 * mremap.c: New file.
7841 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
7842 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
7843 (mremap): Declare if HAVE_MREMAP is not defined.
7844 * configure, Makefile.in, config.in: Rebuild.
7845
33aea2fd
CC
78462009-03-27 Cary Coutant <ccoutant@google.com>
7847
7848 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
7849 position independent.
7850 * sparc.cc (Target_sparc::check_non_pic): Likewise.
7851 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
7852
6d479619
CC
78532009-03-24 Cary Coutant <ccoutant@google.com>
7854
7855 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
7856 an executable.
7857 (needs_dynamic_reloc): Likewise.
7858
afc06bb8
ILT
78592009-03-24 Ian Lance Taylor <iant@google.com>
7860
7861 * yyscript.y (file_cmd): Recognize EXTERN.
7862 (extern_name_list, extern_name_list_body): New nonterminals.
7863 * script.cc (script_add_extern): Define.
7864 * script-c.h (script_add_extern): Declare.
7865
f6060a4d
ILT
78662009-03-24 Rafael Avila de Espindola <espindola@google.com>
7867
7868 * object.cc (is_elf_object): Define.
7869 * object.h (is_elf_object): Declare.
7870 * archive.cc (Archive::get_elf_object_for_member): Call
7871 is_elf_object.
33aea2fd 7872 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 7873
26736d8e
ILT
78742009-03-24 Elliott Hughes <enh@google.com>
7875
7876 * output.cc (Output_file::map_anonymous): Define.
7877 (Output_file::map): Use map_anonymous. If the regular mmap fails,
7878 try an anonymous one. Report the size if the mmap fails.
7879 * output.h (class Output_file): Declare map_anonymous.
7880
22fd9730
ILT
78812009-03-24 Ian Lance Taylor <iant@google.com>
7882
7883 * target-select.cc (instantiate_target): Don't acquire the lock if
7884 the instantiated_target_ field has already been set.
7885
cb010894
ILT
78862009-03-23 Ian Lance Taylor <iant@google.com>
7887
7f055c20
ILT
7888 * gold-threads.h (class Initialize_lock): Define.
7889 * gold-threads.cc (class Initialize_lock_once): Define.
7890 (initialize_lock_control): New static variable.
7891 (initialize_lock_pointer): New static variable.
7892 (initialize_lock_once): New static function.
7893 (Initialize_lock::Initialize_lock): Define.
7894 (Initialize_lock::initialize): Define.
7895 * target-select.h: Include "gold-threads.h".
7896 (class Target_selector): Add lock_ and initialize_lock_ fields.
7897 Don't define instantiate_target, just declare it.
7898 * target-select.cc (Target_selector::Target_selector): Initialize
7899 new fields.
7900 (Target_selector::instantiate_target): Define.
7901 * descriptors.h: Include "gold-threads.h".
7902 (class Descriptors): Add initialize_lock_ field.
7903 * descriptors.cc (Descriptors::Descriptors): Initialize new
7904 field.
7905 (Descriptors::open): Use initialize_lock_ field
7906 * errors.h (class Errors): Add initialize_lock_ field.
7907 * errors.cc (Errors::Errors): Initialize new field.
7908 (Errors::initialize_lock): Use initialize_lock_ field.
7909 * powerpc.cc (class Target_selector_powerpc): Remove
7910 instantiated_target_ field. In do_recognize call
7911 instantiate_target rather than do_instantiate_target. In
7912 do_instantiate_target just allocate a new target.
7913 * sparc.cc (class Target_selector_sparc): Likewise.
7914
36959681
ILT
7915 * freebsd.h: New file.
7916 * i386.cc: Include "freebsd.h".
7917 (Target_i386): Derive from Target_freebsd rather than
7918 Sized_target.
7919 (Target_selector_i386): Derive from Target_selector_freebsd rather
7920 than Target_selector.
7921 * x86_64.cc: Include "freebsd.h".
7922 (Target_x86_64): Derive from Target_freebsd rather than
7923 Sized_target.
7924 (Target_selector_x86_64): Derive from Target_selector_freebsd
7925 rather than Target_selector.
7926 * target.h (class Target): Add adjust_elf_header and
7927 do_adjust_elf_header.
7928 * output.cc (Output_file_header:: do_sized_write): Call target
7929 adjust_elf_header routine.
7930 * configure.tgt: Set targ_osabi.
7931 * configure.ac: Define GOLD_DEFAULT_OSABI.
7932 * parameters.cc (Parameters::default_target): Pass
7933 GOLD_DEFAULT_OSABI to select_target.
7934 * target-select.h (class Target_selector): Make instantiate_target
7935 protected rather than private.
7936 * Makefile.am (HFILES): Add freebsd.h.
7937 * configure, Makefile.in, config.in: Rebuild.
7938
cb010894
ILT
7939 * merge.cc (do_add_input_section): Correct pend value. Change
7940 message about last entry not being null terminated from error to
7941 warning.
7942
0e879927
ILT
79432009-03-20 Mikolaj Zalewski <mikolajz@google.com>
7944
7945 * incremental.cc: New file.
7946 * Makefile.am (CCFILES): Add incremental.cc.
7947 * Makefile.in: Rebuild.
7948
41105937
PP
79492009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
7950
7951 * layout.cc (Layout::output_section_name): Preserve names
7952 of '.note.' sections.
e1df38aa 7953
60439920
ILT
79542009-03-19 Ian Lance Taylor <iant@google.com>
7955
7956 * descriptors.cc (Descriptors::open): Check that the options are
7957 valid before using them.
7958
0d371ad3
ILT
79592009-03-18 Ian Lance Taylor <iant@google.com>
7960
7961 * script-sections.h: Include <list>.
7962 (class Script_sections): Change Sections_elements from std::vector
7963 to std::list. Typedef public Elements_iterator. Add
7964 orphan_section_placement_, data_segment_align_start_, and
7965 saw_data_segment_align_ fields. Remove data_segment_align_index_
7966 field.
7967 * script-sections.cc (class Orphan_section_placement): New class.
7968 (class Sections_element): Add virtual functions is_relro and
7969 orphan_section_init. Remove virtual function place_orphan_here.
7970 (class Output_section_definition): Add is_relro and
7971 orphan_section_init. Remove place_orphan_here.
7972 (class Orphan_output_section): Likewise.
7973 (Script_sections::Script_sections): Update for field changes.
7974 (Script_sections::data_segment_align): Set saw_data_segment_align_
7975 and data_segment_align_start_, not data_segment_align_index.
7976 (Script_sections::data_segment_relro_end): Check
7977 saw_data_segment_align_. Use data_segment_align_start_ rather
7978 than data_segment_align_index_.
7979 (Script_sections::place_orphan): Rewrite to use
7980 Orphan_section_placement.
7981
9201d894
ILT
79822009-03-17 Ian Lance Taylor <iant@google.com>
7983
9c5b8369
ILT
7984 * archive.cc (Archive::add_symbols): Check for a version attached
7985 to the symbol name in the archive map.
7986 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
7987 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
7988 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
7989 (ver_test_11.a): New target.
7990 * testsuite/Makefile.in: Rebuild.
7991
9201d894
ILT
7992 * configure.ac: Check for chsize and posix_fallocate. Replace
7993 ftruncate.
7994 * ftruncate.c: New file, from gnulib.
7995 * output.cc (posix_fallocate): Define dummy version if not
7996 HAVE_POSIX_FALLOCATE.
7997 (Output_file::map): Call posix_fallocate rather than lseek and
7998 write.
7999 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8000 * configure, Makefile.in, config.in: Rebuild.
8001
ef4ab7a8 80022009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8003
ef4ab7a8
PP
8004 * layout.h (Layout::create_note): Add section_name parameter.
8005 * layout.cc (Layout::create_note): Likewise.
8006 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8007
8c500701
ILT
80082009-03-17 Ian Lance Taylor <iant@google.com>
8009
e85b18e1
ILT
8010 * descriptors.cc: Include "options.h".
8011 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8012 (Descriptors::open): Always use O_CLOEXEC when opening a new
8013 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8014 then set FD_CLOEXEC.
8015
9efe6174
ILT
8016 * sparc.cc (class Target_sparc): Add has_got_section.
8017 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8018 make sure we have a GOT section.
8019
8020 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8021 (Target_sparc::Scan::local): Likewise.
8022 (Target_sparc::Scan::global): Likewise.
8023 (Target_sparc::Relocate::relocate): Likewise.
8024 (Target_sparc::Relocate::relocate_tls): Likewise.
8025
8c500701
ILT
8026 * symtab.cc (Symbol_table::define_default_version): New function,
8027 broken out of add_from_object.
8028 (Symbol_table::add_from_object): Call define_default_version.
8029 (Symbol_table::define_special_symbol): Add resolve_oldsym
8030 parameter. Change all callers. If the version for a symbol comes
8031 from a version script, resolve it with the symbol with the same
8032 name with no version. Also add the symbol without a version if
8033 appropriate.
8034 (do_define_in_output_data): If resolving with oldsym, don't delete
8035 sym.
8036 (do_define_in_output_segment): Likewise.
8037 (do_define_as_constant): Likewise.
8038 * symtab.h (class Symbol_table): Update declarations.
8039
f1ed28fb
ILT
80402009-03-13 Ian Lance Taylor <iant@google.com>
8041
15f8229b
ILT
8042 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8043 (Read_symbols::requeue): New function.
8044 (Read_symbols::do_read_symbols): If make_elf_object fails because
8045 the target type is not configured, and the file was searched for,
8046 issue a warning and retry with the next directory.
8047 (Add_symbols::run): If the file has an incompatible format, and
8048 it was searched for, requeue the Read_symbols task. On error,
8049 release the object.
8050 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8051 dirindex parameter to constructor. Change all callers. Declare
8052 incompatible_warning and requeue.
8053 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8054 input_argument_ and input_group_ fields. Add them to
8055 constructor. Change all callers.
8056 (class Read_script): Add dirindex_ field. Add it to constructor.
8057 Change all callers.
8058 * archive.cc (Archive::setup): Remove input_objects parameter.
8059 Change all callers.
8060 (Archive::get_file_and_offset): Likewise.
8061 (Archive::read_all_symbols): Likewise.
8062 (Archive::read_symbols): Likewise.
8063 (Archive::get_elf_object_for_member): Remove input_objects
8064 parameter. Add punconfigured parameter. Change all callers.
8065 (Archive::add_symbols): Change return type to bool. Check return
8066 value of include_member.
8067 (Archive::include_all_members): Likewise.
8068 (Archive::include_member): Change return type to bool. Return
8069 false if first included object has incompatible target. Set
8070 included_member_ field.
8071 (Add_archive_symbols::run): If add_symbols returns false, requeue
8072 Read_symbols task.
8073 * archive.h (class Archive): Add included_member_ field.
8074 Initialize it in constructor. Add input_file and searched_for
8075 methods. Update declarations.
8076 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8077 input_argument_ fields. Add them to constructor. Change all
8078 callers.
8079 * script.cc: Include "target-select.h".
8080 (class Parser_closure): Add skip_on_incompatible_target_ and
8081 found_incompatible_target_ fields. Add
8082 skip_on_incompatible_target parameter to constructor. Change all
8083 callers. Add methods skip_on_incompatible_target,
8084 clear_skip_on_incompatible_target, found_incompatible_target, and
8085 set_found_incompatible_target.
8086 (read_input_script): Add dirindex parameter. Change all callers.
8087 If parser finds an incompatible target, requeue Read_symbols
8088 task.
8089 (script_set_symbol): Clear skip_on_incompatible_target in
8090 closure.
8091 (script_add_assertion, script_parse_option): Likewise.
8092 (script_start_sections, script_add_phdr): Likewise.
8093 (script_check_output_format): New function.
8094 * script.h (read_input_script): Update declaration.
8095 * script-c.h (script_check_output_format): Declare.
8096 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8097 (ignore_cmd): Remove OUTPUT_FORMAT.
8098 * fileread.cc (Input_file::Input_file): Add explicit this.
8099 (Input_file::will_search_for): New function.
8100 (Input_file::open): Add pindex parameter. Change all callers.
8101 * fileread.h (class Input_file): Add input_file_argument method.
8102 Declare will_search_for. Update declarations.
8103 * object.cc (make_elf_object): Add punconfigured parameter.
8104 Change all callers.
8105 * object.h (class Object): Make input_file public. Add
8106 searched_for method.
8107 (make_elf_object): Update declaration.
8108 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8109 restart search.
8110 * dirsearch.h (class Dirsearch): Update declaration.
8111 * options.h (class General_options): Add --warn-search-mismatch.
8112 * parameters.cc (Parameters::is_compatible_target): New function.
8113 * parameters.h (class Parameters): Declare is_compatible_target.
8114 * workqueue.cc (Workqueue::add_blocker): New function.
8115 * workqueue.h (class Workqueue): Declare add_blocker.
8116
f1ed28fb
ILT
8117 * fileread.cc (Input_file::open): Remove options parameter.
8118 Change all callers.
8119 (Input_file::open_binary): Likewise.
8120 * script.cc (read_input_script): Likewise.
8121 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8122 options parameter from constructor. Change all callers.
8123 (class Read_script): Likewise.
8124 * fileread.h (class Input_file): Update declarations.
8125 * script.h (read_input_script): Update declaration.
8126
34dd024a
NC
81272009-03-10 Nick Clifton <nickc@redhat.com>
8128
8129 * po/es.po: New Spanish translation.
8130
6d71b17c
CC
81312009-03-06 Cary Coutant <ccoutant@google.com>
8132
8133 * options.cc (parse_short_option): Keep dash_z from registering itself.
8134
031cdbed
ILT
81352009-03-03 Ian Lance Taylor <iant@google.com>
8136
8137 PR 9918
8138 * target-reloc.h (relocate_section): Pass output_section to
8139 relocate.
8140 * i386.cc (Target_i386::should_apply_static_reloc): Add
8141 output_section parameter. Change all callers.
8142 (Target_i386::Relocate::relocate): Add output_section parameter.
8143 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8144 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8145 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8146 * testsuite/two_file_shared.sh: New script.
8147 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8148 (check_DATA): Add two_file_shared.dbg.
8149 (two_file_shared.dbg): New target.
8150 * testsuite/Makefile.in: Rebuild.
8151
15d5fa16
ILT
81522009-03-01 Ian Lance Taylor <iant@google.com>
8153
8154 * configure.ac: Check for byteswap.h.
8155 * configure: Rebuild.
8156 * config.in: Rebuild.
8157
8a4c0b0d
ILT
81582009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8159
8160 * layout.cc (Layout::find_or_add_kept_section): New function.
8161 (Layout::add_comdat): Removed.
8162 * layout.h (struct Kept_section): Move out of class Layout.
8163 Remove trailing underscores from field names. Add group_sections
8164 field. Rename group_ field to is_group. Change all uses.
8165 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8166 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8167 comdat_groups_ field.
8168 (Sized_relobj::include_section_group): Use
8169 find_or_add_kept_section and Kept_section::group_sections.
8170 (Sized_relobj::include_linkonce_section): Likewise.
8171 * object.cc (class Sized_relobj): Don't define Comdat_group or
8172 Comdat_group_table. Remove find_comdat_group and
8173 add_comdat_group. Remove comdat_groups_ field.
8174 * plugin.cc (include_comdat_group): Use
8175 Layout::find_or_add_kept_section.
8176
b4ecf66b
ILT
81772009-02-28 Ian Lance Taylor <iant@google.com>
8178
14359ca0
ILT
8179 * README: --gc-sections and map files are now supported. Document
8180 some build requirements.
8181
b4ecf66b
ILT
8182 PR 6992
8183 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8184 relocatable link set the value of the section symbol to zero.
8185 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8186 relocatable link don't include the section address in the local
8187 symbol value.
8188
0602e05a
ILT
81892009-02-27 Ian Lance Taylor <iant@google.com>
8190
fd9d194f
ILT
8191 PR 6811
8192 * options.h (class Search_directory): Add is_system_directory.
8193 (class General_options): Declare is_in_system_directory.
8194 * options.cc (get_relative_sysroot): Make static.
8195 (get_default_sysroot): Make static.
8196 (General_optoins::is_in_system_directory): New function.
8197 * fileread.cc (Input_file::is_in_system_directory): New function.
8198 * fileread.h (class Input_file): Declare is_in_system_directory.
8199 * object.h (class Object): Add is_in_system_directory.
8200 (class Input_objects): Remove system_library_directory_ field.
8201 * object.cc (Input_objects::add_object): Don't set
8202 system_library_directory_.
8203 (input_objects::found_in_system_library_directory): Remove.
8204 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8205 parameter. Change all callers.
8206 (Symbol_table::sized_write_globals): Likewise.
8207 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8208 Call Object::is_in_system_directory.
8209 * symtab.h (class Symbol_table): Update declarations.
8210
61edd21f
ILT
8211 PR 5990
8212 * descriptors.h (Open_descriptor): Add is_on_stack field.
8213 * descriptors.cc (Descriptors::open): If the descriptor is on the
8214 top of the stack, remove it. Initialize is_on_stack field.
8215 (Descriptors::release): Only add pod to stack if it is not on the
8216 stack already.
8217 (Descriptors::close_some_descriptor): Clear stack_next and
8218 is_on_stack fields.
8219
e29e076a
ILT
8220 PR 7091
8221 * output.cc (Output_section::find_starting_output_address): Rename
8222 from starting_output_address; add PADDR parameter; change return
8223 type.
8224 * output.h (class Output_section): Declare
8225 find_starting_output_address instead of starting_output_address.
8226 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8227 section symbol for which we can't find a merge section.
8228
0602e05a
ILT
8229 PR 9836
8230 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8231 hidden or internal, force the symbol to be local.
8232 * resolve.cc (Symbol::override_visibility): Define.
8233 (Symbol::override_base): Use override_visibility.
8234 (Symbol_table::resolve): Likewise.
8235 (Symbol::override_base_with_special): Likewise.
8236 (Symbol_table::override_with_special): If the visibility is hidden
8237 or internal, force the symbol to be local.
8238 * symtab.h (class Symbol): Add set_visibility and
8239 override_visibility.
8240 * testsuite/ver_test_1.sh: New file.
8241 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8242 (check_DATA): Add ver_test_1.syms.
8243 (ver_test_1.syms): New target.
8244 * testsuite/Makefile.in: Rebuild.
8245
401a9a73
CC
82462009-02-25 Cary Coutant <ccoutant@google.com>
8247
8248 * layout.cc (Layout::choose_output_section): Don't rename sections
8249 when using a linker script that has a SECTIONS clause.
8250 * Makefile.in: Regenerate.
8251
8252 * testsuite/Makefile.am (script_test_5.sh): New test case.
8253 * testsuite/Makefile.in: Regenerate.
8254 * testsuite/script_test_5.cc: New file.
8255 * testsuite/script_test_5.sh: New file.
8256 * testsuite/script_test_5.t: New file.
8257
f488e4b0
CC
82582009-02-13 Rafael Avila de Espindola <espindola@google.com>
8259
8260 * archive.cc (Archive::include_member): Update calls to add_symbols.
8261 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8262 the Layout argument.
8263 * dynobj.h (do_add_symbols): Add the Layout argument.
8264 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8265 Layout argument.
8266 * object.h (Object::add_symbols): Add the Layout argument.
8267 (Object::do_add_symbols): Add the Layout argument.
8268 (Sized_relobj::do_add_symbols): Add the Layout argument.
8269 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8270 Unify the two versions.
8271 (Add_plugin_symbols): Remove.
8272 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8273 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8274 (Add_plugin_symbols): Remove.
8275 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8276 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8277 (Add_symbols::run): Make it work with Pulginobj.
8278
89dd1680
ILT
82792009-02-06 Ian Lance Taylor <iant@google.com>
8280
8281 * object.cc (Sized_relobj::do_layout): Make info message start
8282 with lower case letter.
8283
266d0a74
ILT
82842009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8285
602b464e
ILT
8286 * binary.cc: Fix file comment.
8287
266d0a74
ILT
8288 * options.h (enum Incremental_disposition): Define.
8289 (class General_options): Add new options: --incremental,
8290 --incremental_changed, --incremental_unchanged,
8291 --incremental_unknown. Add incremental_disposition_ and
8292 implicit_incremental_ fields.
8293 (General_options::incremental_disposition): New function.
8294 (class Position_dependent_options): Add incremental_disposition
8295 option.
8296 (Position_dependent_options::copy_from_options): Set incremental
8297 dispositions.
8298 * options.cc (General_options::parse_incremental_changed): New
8299 function.
8300 (General_options::parse_incremental_unchanged): New function.
8301 (General_options::parse_incremental_unknown): New function.
8302 (General_options::General_options): Initialize new fields
8303 incremental_disposition_ and implicit_incremental_.
8304 (General_options::finalize): Check for uasge of --incremental-*
8305 without --incremental.
8306
f073bbf7
CD
83072009-02-06 Chris Demetriou <cgd@google.com>
8308
8309 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8310 pointer and to report location as the file name associated with
8311 the symbol.
8312 (gold_undefined_symbol_at_location): New function to replace the
8313 old gold_undefined_symbol functionality.
8314 * target-reloc.h (relocate_section): Update to use
8315 gold_undefined_symbol_at_location.
8316 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8317 Call gold_undefined_symbol function rather than gold_error.
8318 * errors.h (Errors::undefined_symbol): Take location as a
8319 string, rather than calculating it from a relocation.
8320 * errors.cc (Errors::fatal): Print "fatal error:" before the
8321 formatted message.
8322 (Errors::error, Errors::error_at_location): Print "error: "
8323 before the formatted message.
8324 (Errors::undefined_symbol): Take location as a string, rather
8325 than calculating it from a relocation.
8326 (gold_undefined_symbol_at_location): New function akin to
8327 old gold_undefined_symbol, calculates location from relocation.
8328 (gold_undefined_symbol): Change to take only a Symbol pointer
8329 and to report location as the file name associated with the symbol.
8330 * testsuite/debug_msg.sh: Update for changed error messages.
8331 * testsuite/undef_symbol.sh: Likewise.
8332
8e94a90c
ILT
83332009-02-04 Duncan Sands <baldrick@free.fr>
8334
8335 PR 9812
8336 * reduced_debug_output.h
8337 (Output_reduced_debug_abbrev_section::failed): Use format for
8338 gold_warning.
8339 (Output_reduced_debug_info_section::faild): Likewise.
8340
88a0e15b
ILT
83412009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8342
8343 * script.cc (Lazy_demangler): New class.
8344 (Version_script_info::get_symbol_version_helper): Demangle a
8345 symbol only once.
8346
5efc7cd2
CC
83472009-01-29 Cary Coutant <ccoutant@google.com>
8348
8349 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8350 to __tls_get_addr.
8351 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8352
e0ebcf42
ILT
83532009-01-28 Ian Lance Taylor <iant@google.com>
8354
5efc7cd2 8355 * version.cc (version_string): Bump to 1.9.
75fe7426 8356
e0ebcf42
ILT
8357 * gold.h: Include <cstring> and <stdint.h>.
8358 * version.cc: Include <cstdio>.
8359 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8360 warning.
8361 * reduced_debug_output.cc (insert_into_vector): Rename from
8362 Insert_into_vector; change all callers. Use Swap_unaligned to
8363 avoid aliasing issue; remove union since it is unnecessary.
8364
8e2813be 83652009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8366
8367 * Makefile.am (CCFILES): Add gc.cc.
8368 (HFILES): Add gc.h.
8369 * Makefile.in: Regenerate.
8370 * gold.cc (Gc_runner): New class.
8371 (queue_initial_tasks): Call garbage collection related tasks
8372 when corresponding options are invoked.
8373 (queue_middle_gc_tasks): New function.
8374 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8375 processed early before laying out sections during garbage collection.
8376 * gold.h (queue_middle_gc_tasks): New function.
8377 (is_prefix_of): Move from "layout.cc".
8378 * i386.cc (Target_i386::gc_process_relocs): New function.
8379 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8380 * main.cc (main): Create object of class "Garbage_collection".
8381 * object.cc (Relobj::copy_symbols_data): New function.
8382 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8383 (Sized_relobj::do_layout): Allow this function to be called twice
8384 during garbage collection and defer layout of section during the
6d03d481
ST
8385 first call.
8386 * object.h (Relobj::get_symbols_data): New function.
8387 (Relobj::is_section_name_included): New function.
8388 (Relobj::copy_symbols_data): New function.
8389 (Relobj::set_symbols_data): New function.
8390 (Relobj::get_relocs_data): New function.
8391 (Relobj::set_relocs_data): New function.
8392 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8393 (Relobj::gc_process_relocs): New function.
8394 (Relobj::do_gc_process_relocs): New pure virtual function.
8395 (Relobj::sd_): New data member.
8396 (Sized_relobj::is_output_section_offset_invalid): New function.
8397 (Sized_relobj::do_gc_process_relocs): New function.
8398 * options.h (General_options::gc_sections): Modify to not be a no-op.
8399 (General_options::print_gc_sections): New option.
8400 * plugin.cc (Plugin_finish::run): Remove function call to
8401 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8402 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8403 * reloc.cc (Read_relocs::run): Add task to process relocs and
8404 determine unreferenced sections when doing garbage collection.
8405 (Gc_process_relocs): New class.
8406 (Sized_relobj::do_gc_process_relocs): New function.
8407 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8408 sections that are garbage collected.
8409 * reloc.h (Gc_process_relocs): New class.
8410 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8411 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8412 symbols whose corresponding sections are garbage collected.
8413 (Symbol_table::Symbol_table): Add new parameter for the garbage
8414 collection object.
8415 (Symbol_table::gc_mark_undef_symbols): New function.
8416 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8417 (Symbol_table::gc_mark_dyn_syms): New function.
8418 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8419 as garbage.
8420 (Symbol_table::add_from_object): Likewise.
8421 (Symbol_table::add_from_relobj): When building shared objects, do not
8422 treat externally visible symbols as garbage.
8423 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8424 table information for static and relocatable links.
8425 * symtab.h (Symbol_table::set_gc): New function.
8426 (Symbol_table::gc): New function.
8427 (Symbol_table::gc_mark_undef_symbols): New function.
8428 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8429 (Symbol_table::gc_mark_dyn_syms): New function.
8430 (Symbol_table::gc_): New data member.
e1df38aa 8431 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8432 function.
8433 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8434 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8435
3b293544
CF
84362009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8437
8438 * options.h (General_options::gc_sections): Define as a no-op for now.
8439 (General_options::no_keep_memory): Ditto.
8440 (General_options::Bshareable): Define.
8441 * options.cc (General_options::finalize): Honor -Bshareable.
8442
83d22aa8
AS
84432009-01-20 Andreas Schwab <schwab@suse.de>
8444
8445 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8446 read the value in the contents, since we don't use it. Use the
8447 template endianness when writing.
8448 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8449
cd536b21
AS
84502009-01-19 Andreas Schwab <schwab@suse.de>
8451
8452 * configure.tgt (powerpc64-*): Fix targ_obj.
8453
99e9a495
ILT
84542009-01-15 Ian Lance Taylor <iant@google.com>
8455
8456 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8457 local symbols when stripping all symbols.
8458
bbbfea06
CC
84592009-01-14 Cary Coutant <ccoutant@google.com>
8460
99e9a495 8461 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8462
0f7c0701
CC
84632009-01-14 Cary Coutant <ccoutant@google.com>
8464
8465 * archive.cc (Archive::get_elf_object_for_member): Remove call
8466 to File_read::claim_for_plugin.
8467 * descriptors.cc (Descriptors::open): Remove reference to
8468 is_claimed.
8469 (Descriptors::claim_for_plugin): Remove.
8470 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8471 (Descriptors::is_claimed): Remove.
8472 (claim_descriptor_for_plugin): Remove.
8473 * fileread.cc (File_read::claim_for_plugin): Remove.
8474 * fileread.h (File_read::claim_for_plugin): Remove.
8475 (File_read::descriptor): Reopen descriptor if necessary.
8476 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8477 (Plugin_manager::all_symbols_read): Add task parameter. Change
8478 all callers.
8479 (Plugin_manager::get_input_file): New function.
8480 (Plugin_manager::release_input_file): New function.
8481 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8482 corresponding data member.
8483 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8484 and pass to base constructor. Change all callers.
8485 (get_input_file, release_input_file): New functions.
8486 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8487 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8488 (Plugin_manager::all_symbols_read): Add task parameter.
8489 (Plugin_manager::get_input_file): New function.
8490 (Plugin_manager::release_input_file): New function.
8491 (Plugin_manager::task_): New data member.
8492 (Pluginobj::Pluginobj): Add filesize parameter.
8493 (Pluginobj::filename): New function.
8494 (Pluginobj::descriptor): New function.
8495 (Pluginobj::filesize): New function.
8496 (Pluginobj::filesize_): New data member.
8497 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8498 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8499 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8500
8501 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8502 with archive libraries.
8503 * testsuite/Makefile.in: Regenerate.
8504 * testsuite/plugin_test.c (struct sym_info): New type.
8505 (get_input_file, release_input_file): New static variables.
8506 (onload): Capture new transfer vector entries.
8507 (claim_file_hook): Stop reading at end of file according to filesize.
8508 Factor out parsing of readelf output into separate function.
8509 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8510 APIs and get the source file name from the symbol table. Convert
8511 source file name to corresponding object file name. Print info
8512 message when adding new input files.
8513 (parse_readelf_line): New function.
8514 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8515 * testsuite/plugin_test_2.sh: Likewise.
8516 * testsuite/plugin_test_3.sh: Likewise.
8517 * testsuite/plugin_test_4.sh: New test case.
8518
62a6d109
ILT
85192009-01-07 Ian Lance Taylor <iant@google.com>
8520
8521 * version.cc (version_string): Bump to 1.8.
8522
483620e8
CC
85232008-12-23 Cary Coutant <ccoutant@google.com>
8524
8525 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8526 * plugin.cc (Plugin_manager::finish): Rename as
8527 layout_deferred_objects. Move cleanup to separate function.
8528 (Plugin_manager::cleanup): New function.
8529 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8530 separately.
8531 * plugin.h (Plugin_manager::finish): Rename as
8532 layout_deferred_objects.
8533 (Plugin_manager::cleanup): New function.
8534 (Plugin_manager::cleanup_done): New field.
8535
d66a9eb3
CC
85362008-12-23 Cary Coutant <ccoutant@google.com>
8537
8538 * plugin.cc (is_visible_from_outside): New function.
8539 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8540 so we don't return "IR only" status for exported symbols or -r links.
8541
8542 * testsuite/Makefile.am (plugin_test_3): New test case.
8543 * testsuite/Makefile.in: Regenerate.
8544 * testsuite/plugin_test_3.sh: New file.
8545
5995b570
CC
85462008-12-22 Cary Coutant <ccoutant@google.com>
8547
8548 * object.cc (Sized_relobj::layout_section): New function.
8549 (Sized_relobj::do_layout): Defer layout of input sections until after
8550 plugin has provided replacement files.
8551 (Sized_relobj::do_layout_deferred_sections): New function.
8552 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8553 (Relobj::layout_deferred_sections): New function.
8554 (Relobj::do_layout_deferred_sections): New function.
8555 (Sized_relobj::do_layout_deferred_sections): New function.
8556 (Sized_relobj::layout_section): New function.
8557 (Sized_relobj::Deferred_layout): New structure.
8558 (Sized_relobj::deferred_layout_): New field.
8559 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8560 Change all callers. Layout deferred sections.
8561 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8562 references.
8563 (Plugin_hook::run): Move code from do_plugin_hook inline.
8564 (Plugin_hook::do_plugin_hook): Remove.
8565 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8566 (Plugin_manager::finish): Renamed, was cleanup.
8567 (Plugin_manager::should_defer_layout): New function.
8568 (Plugin_manager::add_deferred_layout_object): New function.
8569 (Plugin_manager::Deferred_layout_list): New type.
8570 (Plugin_manager::deferred_layout_objects_): New field.
8571 (Plugin_hook::do_plugin_hook): Remove.
8572
ee769c88
ILT
85732008-12-17 Ian Lance Taylor <iant@google.com>
8574
8575 * options.h (class General_options): Add --no case for
8576 --export-dynamic.
8577
abc8dcba
CC
85782008-12-16 Cary Coutant <ccoutant@google.com>
8579
8580 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8581 vector.
8582 (Plugin_manager::claim_file): Create plugin object even if
8583 plugin did not call the add_symbols callback.
8584 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8585 asking for more symbols than were added.
8586 * testsuite/Makefile.am (plugin_test_1): Add test case with
8587 no global symbols.
8588 (empty.syms): New target.
8589 * testsuite/Makefile.in: Regenerate.
8590 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8591 message. Don't call add_symbols if no globals.
8592 (all_symbols_read_hook): Don't provide replacement for empty
8593 claimed file.
8594
b0074644
ILT
85952008-12-12 Ian Lance Taylor <iant@google.com>
8596
68943102
ILT
8597 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8598 r_type == 0 for a local symbol with r_sym == 0.
8599 (scan_relocatable_relocs): Pass r_sym to
8600 local_non_section_strategy.
8601 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8602 r_sym parameter.
8603
b0074644
ILT
8604 * configure.ac: Update test for TLS descriptors: they are
8605 supported as of glibc 2.9.
8606 * configure: Rebuild.
8607
c2508178
ILT
86082008-12-11 Ian Lance Taylor <iant@google.com>
8609
8610 PR 7091
8611 * target-reloc.h (Default_scan_relocatable_relocs): For each
8612 function, map r_type == 0 to RELOC_DISCARD.
8613
2756a258
CC
86142008-12-10 Cary Coutant <ccoutant@google.com>
8615
8616 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8617 object to override a kept COMDAT group from a plugin object.
8618
bb6f53d3
ILT
86192008-12-09 Ian Lance Taylor <iant@google.com>
8620
fbc558e1
ILT
8621 PR 7088
8622 * yyscript.y (file_cmd): Handle INPUT.
8623
bb6f53d3
ILT
8624 * testsuite/initpri1.c: Change all declarations to be full
8625 prototypes by adding void, to avoid compiler warnings.
8626
4674ecfc
CC
86272008-12-05 Rafael Avila de Espindola <espindola@google.com>
8628
8629 * options.cc (General_options::parse_plugin_opt): New.
8630 (General_options::add_plugin): The argument now is just the filename.
8631 (General_options::add_plugin_option): New.
8632 * options.h (plugin_opt): New.
8633 (add_plugin): Change argument name.
8634 (add_plugin_option): New.
8635 * plugin.cc (Plugin::load): Don't parse the plugin option.
8636 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8637 (Plugin::add_option): New.
8638 (Plugin::args_): Change type.
8639 (Plugin::filename_): New.
8640 (Plugin_manager::add_plugin_option): New.
8641 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8642 * testsuite/Makefile.in: Regenerate.
8643
fd06b4aa
CC
86442008-12-05 Cary Coutant <ccoutant@google.com>
8645
8646 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8647 Handle --strip-lto-sections option.
8648 * options.h (strip_lto_sections): New option.
8649
6c52134c
CC
86502008-12-01 Cary Coutant <ccoutant@google.com>
8651
8652 * plugin.cc (ld_plugin_message): Change format parameter to const.
8653 Fix mismatch between new[] and delete.
8654
a45248e0
CC
86552008-11-14 Cary Coutant <ccoutant@google.com>
8656
8657 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
8658 instead of -1U.
8659
c82fbeee
CS
86602008-11-05 Craig Silverstein <csilvers@google.com>
8661
8662 * options.cc (General_options::parse_dynamic_list): New function.
8663 * options.h (General_options): New flags dynamic_list,
8664 dynamic_list_data, dynamic_list_cpp_new, and
8665 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
8666 (General_options::in_dynamic_list): New function.
8667 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
8668 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
8669 (Lex::can_continue_name): Likewise.
8670 (yylex): Likewise.
8671 (read_script_file): New parameter script_options.
8672 (read_dynamic_list): New function.
8673 (Script_options::define_dynamic_list): New function.
8674 (dynamic_list_keyword_parsecodes): New variable.
8675 (dynamic_list_keywords): New variable.
8676 * script.h (Script_options::define_dynamic_list): New function
8677 prototype.
8678 (read_dynamic_list): New function prototype.
8679 * symtab.cc (strprefix): New macro.
8680 (Symbol::should_add_dynsym_entry): Support dynamic_list,
8681 dynamic_list_data, dynamic_list_cpp_new, and
8682 dynamic_list_cpp_typeinfo.
8683 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
8684 (dynamic_list_expr): New rule.
8685 (dynamic_list_nodes): Likewise.
8686 (dynamic_list_node): Likewise.
8687 * testsuite/Makefile.am (dynamic_list): New test.
8688 * testsuite/Makefile.in: Regenerated.
8689 * testsuite/dynamic_list.t: New file.
8690 * testsuite/dynamic_list.sh: New file.
8691
e0bb29a5
CS
86922008-11-05 Craig Silverstein <csilvers@google.com>
8693
8694 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
8695 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
8696 (t11_last): Likewise.
8697 * testsuite/ver_test_6.c (main): Likewise.
8698
4e1e25e0
CC
86992008-10-07 Cary Coutant <ccoutant@google.com>
8700
8701 * options.c (General_options::finalize): Add check for -static and
8702 -shared.
8703 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
8704 is not empty.
8705
92f03fcb
CC
87062008-10-02 Cary Coutant <ccoutant@google.com>
8707
8708 * plugin.cc (make_sized_plugin_object): Fix conditional
8709 compilation to work when not all targets are enabled.
8710
fbd8a257
CC
87112008-09-29 Cary Coutant <ccoutant@google.com>
8712
8713 * archive.cc (Archive::get_file_and_offset): Use filename instead
8714 of name to get library path.
8715 (Archive::include_member): Unlock external member of a thin archive.
8716
8717 * testsuite/Makefile.am (TEST_AR): New variable.
8718 (thin_archive_test_1): New test.
8719 (thin_archive_test_2): New test.
81636b3f
CC
8720 * testsuite/Makefile.in: Regenerate.
8721 * testsuite/thin_archive_main.cc: New file.
8722 * testsuite/thin_archive_test_1.cc: New file.
8723 * testsuite/thin_archive_test_2.cc: New file.
8724 * testsuite/thin_archive_test_3.cc: New file.
8725 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 8726
eff45813
CC
87272008-09-29 Cary Coutant <ccoutant@google.com>
8728
8729 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
8730 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
8731 instead of -1U.
8732 (Sized_relobj::do_finalize_local_symbols): Likewise.
8733 (Sized_relobj::map_to_kept_section): Likewise.
8734 * object.h (Sized_relobj::invalid_address): New constant.
8735 (Sized_relobj::do_output_section_offset): Check for invalid_address
8736 and return -1ULL.
8737 * output.cc (Output_reloc::local_section_offset): Use constant
8738 invalid_address instead of -1U.
8739 (Output_reloc::get_address): Likewise.
8740 (Output_section::output_address): Change -1U to -1ULL.
8741 * output.h (Output_reloc::invalid_address): New constant.
8742 * reloc.cc (Sized_relobj::write_sections): Use constant
8743 invalid_address instead of -1U.
8744 (Sized_relobj::relocate_sections): Likewise.
8745 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
8746 values for merge sections.
8747 * target-reloc.h (relocate_for_relocatable): Use constant
8748 invalid_address instead of -1U.
8749
89fc3421
CC
87502008-09-19 Cary Coutant <ccoutant@google.com>
8751
8752 Add plugin functionality for link-time optimization (LTO).
8753 * configure.ac (plugins): Add --enable-plugins option.
8754 * configure: Regenerate.
8755 * config.in: Regenerate.
8756 * Makefile.am (LIBDL): New variable.
8757 (CCFILES): Add plugin.cc.
8758 (HFILES): Add plugin.h.
8759 (ldadd_var): Add LIBDL.
8760 * Makefile.in: Regenerate.
8761
8762 * archive.cc: Include "plugin.h".
8763 (Archive::setup): Don't preread archive symbols when using a plugin.
8764 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
8765 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
8766 files.
8767 (Archive::include_member): Add symbols from plugin objects.
8768 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
8769 * descriptors.cc (Descriptors::open): Check for file descriptors
8770 abandoned by plugins.
8771 (Descriptors::claim_for_plugin): New function.
8772 * descriptors.h (Descriptors::claim_for_plugin): New function.
8773 (Open_descriptor::is_claimed): New field.
8774 (claim_descriptor_for_plugin): New function.
8775 * fileread.cc (File_read::claim_for_plugin): New function.
8776 * fileread.h (File_read::claim_for_plugin): New function.
8777 (File_read::descriptor): New function.
8778 * gold.cc: Include "plugin.h".
8779 (queue_initial_tasks): Add task to call plugin hooks for generating
8780 new object files.
8781 * main.cc: Include "plugin.h".
8782 (main): Load plugin libraries.
8783 * object.h (Pluginobj): Declare.
8784 (Object::pluginobj): New function.
8785 (Object::do_pluginobj): New function.
8786 (Object::set_target): New function.
8787 * options.cc: Include "plugin.h".
8788 (General_options::parse_plugin): New function.
8789 (General_options::General_options): Initialize plugins_ field.
8790 (General_options::add_plugin): New function.
8791 * options.h (Plugin_manager): Declare.
8792 (General_options): Add --plugin option.
8793 (General_options::has_plugins): New function.
8794 (General_options::plugins): New function.
8795 (General_options::add_plugin): New function.
8796 (General_options::plugins_): New field.
8797 * plugin.cc: New file.
8798 * plugin.h: New file.
8799 * readsyms.cc: Include "plugin.h".
8800 (Read_symbols::do_read_symbols): Check for archive before checking
8801 for ELF file. Call plugin hooks to claim files.
8802 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
8803 from a real object file; force override when processing replacement
8804 files.
8805 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
8806 (Symbol::init_base_object): Likewise.
8807 (Symbol::init_base_output_data): Likewise.
8808 (Symbol::init_base_output_segment): Likewise.
8809 (Symbol::init_base_constant): Likewise.
8810 (Symbol::init_base_undefined): Likewise.
8811 (Symbol::output_section): Assert that object is not a plugin.
8812 (Symbol_table::add_from_pluginobj): New function.
8813 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
8814 undefined.
8815 (Symbol_table::sized_write_globals): Likewise.
8816 (Symbol_table::add_from_pluginobj): Instantiate template.
8817 * symtab.h (Sized_pluginobj): Declare.
8818 (Symbol::in_real_elf): New function.
8819 (Symbol::set_in_real_elf): New function.
8820 (Symbol::in_real_elf_): New field.
8821 (Symbol_table::add_from_pluginobj): New function.
8822
8823 * testsuite/Makefile.am (AM_CFLAGS): New variable.
8824 (LIBDL): New variable.
8825 (LDADD): Add LIBDL.
8826 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
8827 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
8828 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
8829 (MOSTLYCLEANFILES): Likewise.
8830 * testsuite/Makefile.in: Regenerate.
8831 * testsuite/plugin_test.c: New file.
8832 * testsuite/plugin_test_1.sh: New file.
8833 * testsuite/plugin_test_2.sh: New file.
8834
de31bda5
ILT
88352008-09-16 Ian Lance Taylor <iant@google.com>
8836
9c2d0ef9
ILT
8837 * target-reloc.h (relocate_section): Check whether a symbol is
8838 defined by the ABI before reporting an undefined symbol error.
8839 * target.h (Target::is_defined_by_abi): Make parameter const.
8840 (Target::do_is_defined_by_abi): Likewise.
8841 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
8842 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
8843 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
8844 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
8845 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
8846 * testsuite/Makefile.in: Rebuild.
8847
de31bda5
ILT
8848 * fileread.cc (make_view): Add casts to avoid warning.
8849
9fa33bee
AO
88502008-09-16 Alexandre Oliva <aoliva@redhat.com>
8851
8852 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
8853 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8854
183fd0e3
AO
88552008-09-16 Alexandre Oliva <aoliva@redhat.com>
8856
8857 * options.h (General_options::output_is_executable): New.
8858 (General_options::output_is_pie): New.
8859 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
8860 for shared libraries.
8861 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8862
7be8330a
CD
88632008-09-11 Chris Demetriou <cgd@google.com>
8864
8865 * options.h (origin): New -z option.
8866 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
8867 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
8868 in DT_FLAGS_1.
8869
a9caad02
CC
88702008-09-05 Cary Coutant <ccoutant@google.com>
8871
8872 * fileread.cc (File_read::make_view): Add check for attempt to map
8873 beyond end of file.
8874
ae6dce4d
CC
88752008-09-05 Cary Coutant <ccoutant@google.com>
8876
8877 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
8878 explicit instantiations.
8879
d7ab2a47
KVH
88802008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
8881
8882 PR gold/6858
8883 * options.cc (General_options::finalize): Allow undefined symbols
8884 in shlibs if linking -shared.
8885
8886 PR gold/6859
8887 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
8888 symbols as not needing a dynsym entry.
8889
1e52a9c1
CS
88902008-08-20 Craig Silverstein <csilvers@google.com>
8891
8892 * fileread.cc (File_read::open): Do not lock the file unless it
8893 was successfully opened.
8894
d85c80a3
CC
88952008-08-14 Cary Coutant <ccoutant@google.com>
8896
8897 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
8898 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
8899 * testsuite/tls_test.cc (struct int128): 128-bit struct
8900 for testing TLS relocs with non-zero addend.
8901 (v12): New TLS variable.
8902 (t12): New test.
8903 (t_last): Add check for v12.
8904 * testsuite/tls_test.h (t12): New function.
8905 * testsuite/tls_test_main.cc (thread_routine): Call new test.
8906
2d924fd9
ILT
89072008-08-13 Ian Lance Taylor <iant@google.com>
8908
8909 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
8910 set tls_segment_ or relro_segment_.
8911 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
8912 when appropriate.
8913 * output.h (Output_section::clear_is_relro): New function.
8914 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
8915 sections specially even when output_data_ is empty.
8916 (Output_segment::maximum_alignment): When first section is relro,
8917 only force alignment for PT_LOAD segments.
8918 * script.cc (script_data_segment_align): New function.
8919 (script_data_segment_relro_end): New function.
8920 * script-c.h (script_data_segment_align): Declare.
8921 (script_data_segment_relro_end): Declare.
8922 * script-sections.h (class Script_sections): Declare
8923 data_segment_align and data_segment_relro_end. Add fields
8924 segment_align_index_ and saw_relro_end_.
8925 * script-sections.cc (class Sections_element): Add set_is_relro
8926 virtual function. Add new bool* parameter to place_orphan_here.
8927 Add get_output_section virtual function.
8928 (class Output_section_definition): Add set_is_relro. Add new
8929 bool* parameter to place_orphan_here. Add get_output_section.
8930 Add is_relro_ field.
8931 (Output_section_definition::Output_section_definition): Initialize
8932 evaluated_address_, evaluated_load_address, evaluated_addralign_,
8933 and is_relro_ fields.
8934 (Output_section_definition::place_orphan_here): Add is_relro
8935 parameter.
8936 (Output_section_definition::set_section_addresses): Set relro for
8937 output section.
8938 (Output_section_definition::alternate_constraint): Likewise.
8939 (class Orphan_output_section): Add new bool* parameter to
8940 place_orphan_here. Add get_output_section.
8941 (Orphan_output_section::place_orphan_here): Add is_relro
8942 parameter.
8943 (Script_sections::Script_sections): Initialize
8944 data_segment_align_index_ and saw_relro_end_.
8945 (Script_sections::data_segment_align): New function.
8946 (Script_sections::data_segment_relro_end): New function.
8947 (Script_sections::place_orphan): Set or clear is_relro.
8948 (Script_sections::set_section_addresses): Force alignment of first
8949 TLS section.
8950 * yyscript.y (exp): Call script_data_segment_align and
8951 script_data_segment_relro_end.
8952 * testsuite/relro_script_test.t: New file.
8953 * testsuite/relro_test.cc (using_script): Declare.
8954 (t1, t2): Test using_script.
8955 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
8956 (relro_script_test_SOURCES): Define.
8957 (relro_script_test_DEPENDENCIES): Define.
8958 (relro_script_test_LDFLAGS): Define.
8959 (relro_script_test_LDADD): Define.
8960 (relro_script_test.so): New target.
8961 * testsuite/Makefile.in: Rebuild.
8962
f827c9a9
CC
89632008-08-06 Cary Coutant <ccoutant@google.com>
8964
8965 * archive.cc (Archive::total_archives, Archive::total_members)
8966 (Archive::total_members_loaded): New variables.
8967 (Archive::setup): Add parameter. Add option to preread
8968 archive symbols.
8969 (Archive::read_armap): Add counter.
8970 (Archive::get_file_and_offset): New function.
8971 (Archive::get_elf_object_for_member): New function.
8972 (Archive::read_all_symbols): New function.
8973 (Archive::read_symbols): New function.
8974 (Archive::add_symbols): Add counters.
8975 (Archive::include_all_members): Use armap to find members if it's
8976 already built.
8977 (Archive::include_member): Skip reading symbols if already read.
8978 Factored code into Archive::get_file_and_offset and
8979 Archive::get_elf_object_for_member. Changed call to
8980 Mapfile::report_include_archive_member.
8981 (Archive::print_stats): New function.
8982 * archive.h: Declare Object and Read_symbols_data classes.
8983 (Archive::Archive): Add initializers for new members.
8984 (Archive::setup): Add parameter.
8985 (Archive::print_stats): New function.
8986 (Archive::total_archives, Archive::total_members)
8987 (Archive::total_members_loaded): New variables.
8988 (Archive::get_file_and_offset): New function.
8989 (Archive::get_elf_object_for_member): New function.
8990 (Archive::read_all_symbols): New function.
8991 (Archive::read_symbols): New function.
8992 (Archive::Archive_member): New class.
8993 (Archive::members_): New member.
8994 (Archive::num_members_): New member.
8995 * main.cc: Include archive.h.
8996 (main): Call Archive::print_stats.
8997 * mapfile.cc (Mapfile::report_include_archive_member): Delete
8998 archive parameter; member_name is now the fully-decorated name.
8999 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9000 * options.h: (General_options): Add --preread-archive-symbols option.
9001 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9002 Archive::setup.
9003
de4c45bd
ILT
90042008-08-04 Ian Lance Taylor <iant@google.com>
9005
9006 * symtab.h (Symbol::use_plt_offset): New function.
9007 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9008 * powerpc.cc (Relocate::relocate): Likewise.
9009 * sparc.cc (Relocate::relocate): Likewise.
9010 * x86_64.cc (Relocate::relocate): Likewise.
9011 * testsuite/weak_plt.sh: New test.
9012 * testsuite/weak_plt_main.cc: New test.
9013 * testsuite/weak_plt_shared.cc: New test.
9014 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9015 (check_PROGRAMS): Add weak_plt.
9016 (check_DATA): Add weak_plt_shared.so.
9017 (weak_plt_main_pic.o, weak_plt): New targets.
9018 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9019 * testsuite/Makefile.in: Rebuild.
9020
9021 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9022 gcctestdir/ld.
9023 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9024 * testsuite/Makefile.in: Rebuild.
9025
323ee3f4
AM
90262008-08-04 Alan Modra <amodra@bigpond.net.au>
9027
9028 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9029 * Makefile.in: Regenerate.
9030 * po/POTFILES.in: Regenerate.
9031
7c07ecec
ILT
90322008-07-29 Ian Lance Taylor <iant@google.com>
9033
9034 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9035 symbols before other symbols.
9036 * testsuite/script_test_2.cc (test_addr): Declare.
9037 (test_addr_alias): Declare.
9038 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9039 values.
7c07ecec
ILT
9040 * testsuite/script_test_2.t: Define test_addr_alias and
9041 test_addr.
9042
5778530e
ILT
90432008-07-24 Ian Lance Taylor <iant@google.com>
9044
2a00e4fb
ILT
9045 PR 5990
9046 * descriptors.cc: New file.
9047 * descriptors.h: New file.
9048 * gold-threads.h (class Hold_optional_lock): New class.
9049 * fileread.cc: Include "descriptors.h".
9050 (File_read::~File_read): Release descriptor rather than closing
9051 it.
9052 (File_read::open) [file]: Call open_descriptor rather than open.
9053 Set is_descriptor_opened_.
9054 (File_read::open) [memory]: Assert that descriptor is not open.
9055 (File_read::reopen_descriptor): New function.
9056 (File_read::release): Release descriptor.
9057 (File_read::do_read): Make non-const. Reopen descriptor.
9058 (File_read::read): Make non-const.
9059 (File_read::make_view): Reopen descriptor.
9060 (File_read::do_readv): Likewise.
9061 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9062 Update declarations.
9063 * layout.cc: Include "descriptors.h".
9064 (Layout::create_build_id): Use open_descriptor rather than open.
9065 * output.cc: Include "descriptors.h".
9066 (Output_file::open): Use open_descriptor rather than open.
9067 * archive.cc (Archive::const_iterator): Change Archive to be
9068 non-const.
9069 (Archive::begin, Archive::end): Make non-const.
9070 (Archive::count_members): Likewise.
9071 * archive.h (class Archive): Update declarations.
9072 * object.h (Object::read): Make non-const.
9073 * Makefile.am (CCFILES): Add descriptors.cc.
9074 (HFILES): Add descriptors.h.
9075 * Makefile.in: Rebuild.
9076
801647d1
ILT
9077 PR 6716
9078 * gold.h: Always include <clocale>. Add Solaris workarounds
9079 following code in binutils/sysdep.h.
9080
5edd166e
ILT
9081 PR 6048
9082 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9083 this->eh_frame_hdr_ is NULL before using it.
9084
c89ad728
ILT
9085 * dynobj.cc (Versions::Versions): Update comment.
9086
aa86f06b
ILT
9087 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9088 the base version name.
9089
5778530e
ILT
9090 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9091 array size plus one.
9092 (Stringpool_template::set_string_offsets): Subtract one from key
9093 before using it as an array index.
9094 (Stringpool_template::get_offset_with_length): Likewise.
9095 (Stringpool_template::write_to_buffer): Likewise.
9096 * stringpool.h (Stringpool_template::get_offset_from_key):
9097 Likewise.
9098
057ead22
ILT
90992008-07-23 Ian Lance Taylor <iant@google.com>
9100
7f649c59
ILT
9101 PR 6658
9102 * object.h (Merged_symbol_value::value): Do our best to handle a
9103 negative addend.
9104
057ead22
ILT
9105 PR 6647
9106 * script.cc (Version_script_info::get_versions): Don't add empty
9107 version tag to return value.
9108 (Version_script_info::get_symbol_version_helper): Change return
9109 type to bool. Add pversion parameter. Change all callers.
9110 (script_register_vers_node): Don't require a non-NULL tag.
9111 * script.h (class Version_script_info): Update declarations.
9112 (Version_script_info::get_symbol_version): Change return type to
9113 bool. Add version parameter. Change all callers.
9114 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9115 handling. Handle an empty version from a version script.
9116 (Symbol_table::define_special_symbol): Likewise.
9117 * testsuite/ver_test_10.script: New file.
9118 * testsuite/ver_test_10.sh: New file.
9119 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9120 (check_DATA): Add ver_test_10.syms.
9121 (ver_test_10.syms, ver_test_10.so): New target.
9122 * testsuite/Makefile.in: Rebuild.
9123
58e54ac2
CD
91242008-07-23 Simon Baldwin <simonb@google.com>
9125
9126 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9127 to zero for undefined symbols from dynamic libraries.
9128
95d14cd3
ILT
91292008-07-23 Ian Lance Taylor <iant@google.com>
9130
9131 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9132 Change all callers.
9133 * symtab.h (class Symbol_table): Update declaration.
9134 * testsuite/ver_test_9.cc: New file.
9135 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9136 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9137 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9138 (ver_test_9.so, ver_test_9.o): New targets.
9139 * testsuite/Makefile.in: Rebuild.
9140
92de84a6
ILT
91412008-07-22 Ian Lance Taylor <iant@google.com>
9142
34810851
ILT
9143 * options.h (class General_options): Define --check-sections.
9144 * layout.cc (Layout::set_segment_offsets): Handle
9145 --check-sections.
9146
af6156ef
ILT
9147 * options.h (class General_options): Define -n/--nmagic and
9148 -N/--omagic.
9149 * options.cc (General_options::finalize): For -n/--nmagic or
9150 -N/--omagic, set -static.
9151 * layout.cc (Layout::attach_allocated_section_to_segment): If
9152 -N/--omagic, don't put read-only and read-write sections in
9153 different segments.
9154 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9155 finding a read-only segment.
9156 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9157 don't set the minimum segment alignment to the common page size,
9158 and don't set the file offset to the address modulo the page size.
9159 * script-sections.cc (Script_sections::create_segments): If
9160 -n/--omagic, don't put read-only and read-write sections in
9161 different segments.
9162
92de84a6
ILT
9163 * cref.cc: New file.
9164 * cref.h: New file.
9165 * options.h (class General_options): Add --print-symbol-counts.
9166 * main.cc (main): Issue defined symbol report if requested.
9167 * archive.cc (Archive::interpret_header): Make into a const member
9168 function.
9169 (Archive::add_symbols): Call Input_objects::archive_start and
9170 archive_stop.
9171 (Archive::const_iterator): Define new class.
9172 (Archive::begin, Archive::end): New functions.
9173 (Archive::include_all_members): Rewrite to use iterator.
9174 (Archive::count_members): New function.
9175 * archive.h (class Archive): Update declarations.
9176 (Archive::filename): New function.
9177 * object.cc: Include "cref.h".
9178 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9179 (Sized_relobj::do_get_global_symbol_counts): New function.
9180 (Input_objects::add_object): Add object to cross-referencer.
9181 (Input_objects::archive_start): New function.
9182 (Input_objects::archive_stop): New function.
9183 (Input_objects::print_symbol_counts): New function.
9184 * object.h: Declare Cref and Archive.
9185 (Object::get_global_symbol_counts): New function.
9186 (Object::do_get_global_symbol_counts): New pure virtual function.
9187 (class Sized_relobj): Add defined_count_ field. Update
9188 declarations.
9189 (class Input_objects): Add cref_ field. Update constructor.
9190 Update declarations.
9191 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9192 defined_count_.
9193 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9194 symbol counts.
9195 (Sized_dynobj::do_get_global_symbol_counts): New function.
9196 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9197 defined_count_. Update declarations. Define Symbols typedef.
9198 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9199 parameter. Change all callers.
9200 (Symbol_table::add_from_dynobj): Add sympointers and defined
9201 parameters. Change all callers.
9202 * symtab.h (class Symbol_table): Update declarations.
9203 * Makefile.am (CCFILES): Add cref.cc.
9204 (HFILES): Add cref.h.
9205 * Makefile.in: Rebuild.
9206
3f7c5e1d
CD
92072008-07-22 Simon Baldwin <simonb@google.com>
9208
9209 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9210 to zero when writing undefined symbols.
9211
e0b64032
ILT
92122008-07-22 Ian Lance Taylor <iant@google.com>
9213
9214 * output.cc (Output_section::add_input_section): Don't try to
9215 merge empty merge sections.
9216
096b02cf
CS
92172008-07-21 Craig Silverstein <csilvers@google.com>
9218
9219 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9220 Include symbol version in error message.
cd536b21 9221
1d1f116d
CD
92222008-07-20 Chris Demetriou <cgd@google.com>
9223
cd536b21 9224 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9225 (RANDOM_SEED_CFLAGS): New substituted variable.
9226 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9227 * configure: Rebuild.
9228 * Makefile.in: Likewise.
9229 * testsuite/Makefile.in: Likewise.
9230
a18f591e
ILT
92312008-07-18 Ian Lance Taylor <iant@google.com>
9232
9233 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9234 where we see NAME/NULL and NAME/VERSION as separate symbols.
9235 * testsuite/ver_test_main.cc (main): Call t4.
9236 (t4, t4_2a): Define.
9237 * testsuite/ver_test_2.cc (t4_2): Define.
9238 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9239 * testsuite/ver_test_4.cc (t4_2a): Define.
9240 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9241 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9242
c6e3f6ed
ILT
92432008-07-17 Ian Lance Taylor <iant@google.com>
9244
9245 * dynobj.cc (Versions::add_def): If we give an error about a
9246 missing version, go ahead and create the version anyhow.
9247
ef9beddf
ILT
92482008-07-10 Ian Lance Taylor <iant@google.com>
9249
9250 Handle output sections with more than 0x7fffffff bytes.
9251 * object.h (class Relobj): Change map_to_output_ to
9252 output_sections_, and just keep a section pointer. Change all
9253 uses. Move comdat group support to Sized_relobj.
9254 (Relobj::is_section_specially_mapped): Remove.
9255 (Relobj::output_section): Remove poff parameter. Change all
9256 callers.
9257 (Relobj::output_section_offset): New function.
9258 (Relobj::set_section_offset): Rewrite.
9259 (Relobj::map_to_output): Remove.
9260 (Relobj::output_sections): New function.
9261 (Relobj::do_output_section_offset): New pure virtual function.
9262 (Relobj::do_set_section_offset): Likewise.
9263 (class Sized_relobj): Add section_offsets_ field. Add comdat
9264 group support from Relobj. Update declarations.
9265 (Sized_relobj::get_output_section_offset): New function.
9266 (Sized_relobj::do_output_section_offset): New function.
9267 (Sized_relobj::do_set_section_offset): New function.
9268 * object.cc (Relobj::output_section_address): Remove.
9269 (Sized_relobj::Sized_relobj): Initialize new fields.
9270 (Sized_relobj::include_section_group): Cast find_kept_object to
9271 Sized_relobj.
9272 (Sized_relobj::include_linkonce_section): Likewise.
9273 (Sized_relobj::do_layout): Use separate arrays for output section
9274 and output offset.
9275 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9276 output_sections.
9277 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9278 output_sections and section_offsets.
9279 (Sized_relobj::write_local_symbols): Likewise.
9280 (map_to_kept_section): Compute output address directly.
9281 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9282 output_sections and section_offsets.
9283 (Sized_relobj::write_sections): Likewise.
9284 (Sized_relobj::relocate_sections): Likewise.
9285 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9286 * output.h (class Output_reloc): Update declarations. Change
9287 u2_.relobj to Sized_relobj*.
9288 (class Output_data_reloc): Change add functions to use
9289 Sized_relobj*.
9290 * output.cc (Output_reloc::Output_reloc): Change relobj to
9291 Sized_relobj*.
9292 (Output_reloc::local_section_offset): Change return type to
9293 Elf_Addr. Use get_output_section_offset.
9294 (Output_reloc::get_address): Likewise.
9295 (Output_section::is_input_address_mapped): Don't call
9296 is_section_specially_mapped.
9297 (Output_section::output_offset): Likewise.
9298 (Output_section::output_address): Likewise.
9299 (Output_section::starting_output_address): Likewise.
9300 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9301 parameter to Sized_relobj*.
9302 (Copy_relocs::need_copy_reloc): Likewise.
9303 (Copy_relocs::save): Likewise.
9304 * copy-relocs.h (class Copy_relocs): Update declarations.
9305 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9306 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9307 * target-reloc.h (relocate_for_relocatable): Change
9308 offset_in_output_section type to Elf_Addr. Change code that uses
9309 it as well.
9310 * layout.cc (Layout::layout): Always set *off.
9311 * mapfile.cc (Mapfile::print_input_section): Use
9312 output_section_offset.
9313 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9314 Sized_relobj*.
9315 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9316 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9317 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9318
5cb66f97
ILT
93192008-07-03 Ian Lance Taylor <iant@google.com>
9320
9321 * layout.cc (Layout::include_section): Do not discard unrecognized
9322 SHT_STRTAB sections.
9323
afe47622
CS
93242008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9325
9326 * script.cc (Lex::can_continue_name): Make '?' allowable in
9327 version-script names.
9328 * testsuite/version_script.map: Change glob pattern to use '?'
9329
5adf9721
ILT
93302008-06-30 Manish Singh <yosh@gimp.org>
9331
9332 PR 6585
9333 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9334 Correct typo.
9335
e6fde208
ILT
93362008-06-30 Ian Lance Taylor <iant@google.com>
9337
9338 PR 6660
9339 PR 6682
9340 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9341 versions]: Don't try to read the value in the contents, since we
9342 don't use it. Use the template endianness when writing.
9343
3f2e6a2d
CC
93442008-06-25 Cary Coutant <ccoutant@google.com>
9345
9346 * fileread.cc (File_read::make_view): Assert on zero-length view.
9347 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9348 symbol table when there are no symbols to read.
9349
c43d3a48
CS
93502008-06-23 Craig Silverstein <csilvers@google.com>
9351
9352 * version.cc (version_string): Bump to 1.7
9353
5f494ea0
CS
93542008-06-18 Craig Silverstein <csilvers@google.com>
9355
9356 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9357 constant 0xFFFF to type Valtype.
9358 (Powerpc_relocate_functions::rel16_ha): Likewise.
9359
c42e122e
ILT
93602008-06-17 Ian Lance Taylor <iant@google.com>
9361
f34787f8
ILT
9362 * output.h (Output_section::Input_section): Initialize p2align_ to
9363 zero for Output_section_data constructors.
9364 (Output_section::Input_section::addralign): If not an input
9365 section, return the alignment of the Output_section_data.
9366 * testsuite/copy_test.cc: New file.
9367 * testsuite/copy_test_1.cc: New file.
9368 * testsuite/copy_test_2.cc: New file.
9369 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9370 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9371 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9372 (copy_test_1_pic.o, copy_test_1.so): New targets.
9373 (copy_test_2_pic.o, copy_test_2.so): New targets.
9374 * testsuite/Makefile.in: Rebuild.
9375
c42e122e
ILT
9376 * script-sections.cc (Script_sections::place_orphan): Initialize
9377 local variable exact.
9378
ce3ac18a
DE
93792008-06-13 David Edelsohn <edelsohn@gnu.org>
9380
9381 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9382
42cacb20
DE
93832008-06-12 David Edelsohn <edelsohn@gnu.org>
9384 David S. Miller <davem@davemloft.net>
9385
9386 * powerpc.cc: New file.
9387 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9388 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9389 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9390 * Makefile.in: Rebuild.
9391
7b308235
ILT
93922008-06-09 Ian Lance Taylor <iant@google.com>
9393
9394 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9395 <exception>.
9396 (throwing, orig_terminate): New static variables.
9397 (terminate_handler): New static function.
9398 (t2): Set terminate handler.
9399
f0b886e3
ILT
94002008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9401
9402 PR 6584
cd536b21 9403 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9404 alignment.
9405
3e90f135
CC
94062008-05-30 Cary Coutant <ccoutant@google.com>
9407
9408 * archive.cc (Archive::include_all_members) Correct to step
9409 over symbol table and extended name table in thin archives.
9410
e09ad04a
ILT
94112008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9412
9413 PR 6407
9414 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9415 calculation.
9416
62b01cb5
ILT
94172008-05-28 Caleb Howe <cshowe@google.com>
9418
9419 * reduced_debug_output.cc: New file.
9420 * reduced_debug_output.h: New file.
92de84a6 9421 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9422 * options.cc (General_options::finalize): Add strip_debug_non_line
9423 to the strip heirarchy.
9424 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9425 fields.
9426 * layout.cc: Include "reduced_debug_output.h".
9427 (Layout::Layout): Initialize new fields.
9428 (line_only_debug_sections): New static array.
9429 (is_lines_only_debug_sections): New static inline function.
9430 (Layout::include_section): Handle --strip-debug-non-line.
9431 (Layout::make_output_section): If --strip-debug-non-line, build
9432 new output sections for .debug_abbrev and .debug_info.
9433 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9434 gold. Warn about possible overflow.
9435 (read_signed_LEB_128): Likewise.
9436 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9437 (read_signed_LEB_128): Declare.
9438 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9439 (HFILES): Add reduced_debug_output.h.
9440 * Makefile.in: Rebuild.
9441
7d9e3d98
ILT
94422008-05-21 Ian Lance Taylor <iant@google.com>
9443
9444 * mapfile.cc: New file.
9445 * mapfile.h: New file.
9446 * options.h (class General_options): Add -M/--print-map and -Map.
9447 * options.cc (General_options::finalize): Make -M equivalent to
9448 -Map -.
9449 * main.cc: Include <cstdio> and "mapfile.h".
9450 (main): Open mapfile if requested.
9451 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9452 constructor. Change caller.
9453 (queue_initial_tasks): Add mapfile parameter. Change caller.
9454 (queue_middle_tasks): Likewise.
9455 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9456 declarations.
9457 * archive.cc: Include "mapfile.h".
9458 (Archive::add_symbols): Add mapfile parameter. Change all
9459 callers. Pass mapfile, symbol, and reason to include_member.
9460 (Archive::include_all_members): Add mapfile parameter. Change all
9461 callers.
9462 (Archive::include_member): Add mapfile, sym, and why parameters.
9463 Change all callers. Report inclusion to map file.
9464 * archive.h: Include "fileread.h".
9465 (class Archive): Update declarations.
9466 (Archive::file): New const method.
9467 (class Add_archive_symbols): Add mapfile_ field. Update
9468 constructor. Change all callers.
9469 * readsyms.h (class Read_symbols): Likewise.
9470 (class Finish_group): Likewise.
9471 (class Read_script): Likewise.
9472 * common.cc: Include "mapfile.h".
9473 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9474 all callers.
9475 (Symbol_table::do_allocate_commons): Likewise.
9476 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9477 symbol allocation to mapfile.
9478 * common.h (class Allocate_commons_task): Add mapfile_ field.
9479 Update constructor. Change all callers.
9480 * symtab.h (class Symbol_table): Update declarations.
9481 * layout.cc: Include "mapfile.h".
9482 (Layout_task_runner::run): Print information to mapfile.
9483 (Layout::create_gold_note): Change Output_data_fixed_space to
9484 Output_data_zero_fill.
9485 (Layout::create_build_id): Likewise.
9486 (Layout::print_to_mapfile): New function.
9487 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9488 constructor. Change caller.
9489 (class Layout): Declare print_to_mapfile.
9490 * output.cc (Output_section::Input_section::print_to_mapfile): New
9491 function.
9492 (Output_section::add_input_section): If producing a map, always
9493 add to input_sections_ list.
9494 (Output_section::do_print_to_mapfile): New function.
9495 (Output_segment::print_sections_to_mapfile): New function.
9496 (Output_segment::print_section_list_to_mapfile): New function.
9497 * output.h: Include "mapfile.h".
9498 (Output_data::print_to_mapfile): New function.
9499 (Output_data::do_print_to_mapfile): New virtual function.
9500 (Output_segment_headers::do_print_to_mapfile): New function.
9501 (Output_file_header::do_print_to_mapfile): New function.
9502 (Output_data_const::do_print_to_mapfile): New function.
9503 (class Output_data_const_buffer): Add map_name_ field. Update
9504 constructor. Change all callers. Add do_print_to_mapfile
9505 function.
9506 (class Output_data_fixed_space): Likewise.
9507 (class Output_data_space): Likewise.
9508 (class Output_data_zero_fill): New class.
9509 (Output_data_strtab::do_print_to_mapfile): New function.
9510 (Output_data_reloc_base::do_print_to_mapfile): New function.
9511 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9512 (Output_data_group::do_print_to_mapfile): New function.
9513 (Output_data_got::do_print_to_mapfile): New function.
9514 (Output_data_dynamic::do_print_to_mapfile): New function.
9515 (Output_symtab_xindex::do_print_to_mapfile): New function.
9516 (class Output_section): Declare do_print_to_mapflie. Declare
9517 print_to_mapfile in Input_section.
9518 (class Output_segment): Declare new functions.
9519 * object.h (Sized_relobj::symbol_count): New function.
9520 * script-sections.cc
9521 (Output_section_element_dot_assignment::set_section_addresses):
9522 Change Output_data_fixed_space to Output_data_zero_fill.
9523 (Output_data_expression::do_print_to_mapfile): New function.
9524 * script.cc (read_input_script): Add mapfile parameter. Change
9525 all callers.
9526 * script.h (read_input_script): Update declaration.
9527 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9528 (Eh_frame::do_print_to_mapfile): New function.
9529 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9530 (Output_merge_string::do_print_to_mapfile): New function.
9531 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9532 function.
9533 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9534 function.
9535 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9536 function.
9537 * Makefile.am (CCFILES): Add mapfile.cc.
9538 (HFILES): Add mapfile.h.
9539 * Makefile.in: Rebuild.
9540
9f1d377b
ILT
95412008-05-19 Ian Lance Taylor <iant@google.com>
9542
9543 * options.h (class General_options): Add -z relro.
9544 * layout.cc (Layout::Layout): Initialize relro_segment_.
9545 (Layout::add_output_section_data): Return the output section.
9546 (Layout::make_output_section): Rcognize relro sections and mark
9547 them appropriately.
9548 (Layout::attach_allocated_section_to_segment): Put relro sections
9549 in a PT_GNU_RELRO segment.
9550 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9551 section as relro.
9552 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9553 PT_TLS segments.
9554 (Layout::linkonce_mapping): Map d.rel.ro.local to
9555 .data.rel.ro.local.
9556 (Layout::output_section_name): Us .data.rel.ro.local for any
9557 section which begins with that.
9558 * layout.h (class Layout): Update add_output_section_data
9559 declaration. Add relro_segment_ field.
9560 * output.cc (Output_section::Output_section): Initialize is_relro_
9561 and is_relro_local_ fields.
9562 (Output_segment::add_output_section): Group relro sections.
9563 (Output_segment::is_first_section_relro): New function.
9564 (Output_segment::maximum_alignment): If there is a relro section,
9565 align the segment to the common page size.
9566 (Output_segment::set_section_addresses): Track whether we are
9567 looking at relro sections. If the last section is a relro
9568 section, align to the common page size.
9569 (Output_segment::set_section_list_addresses): Add in_relro
9570 parameter. Change all callers. Align to the page size when
9571 moving from relro to non-relro section.
9572 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9573 segment.
9574 * output.h (class Output_section): Add is_relro_ and
9575 is_relro_local_ fields.
9576 (Output_section::is_relro): New function.
9577 (Output_section::set_is_relro): New function.
9578 (Output_section::is_relro_local): New function.
9579 (Output_section::set_is_relro_local): New function.
9580 (class Output_segment): Update declarations.
9581 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9582 * sparc.cc (Target_sparc::got_section): Likewise.
9583 * x86_64.cc (Target_x86_64::got_section): Likewise.
9584 * testsuite/relro_test_main.cc: New file.
9585 * testsuite/relro_test.cc: New file.
9586 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9587 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9588 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9589 (relro_test.so, relro_test_pic.o): New targets.
9590 * testsuite/Makefile.in: Rebuild.
9591
a984ee1d
ILT
95922008-05-16 Ian Lance Taylor <iant@google.com>
9593
01676dcd
ILT
9594 * output.cc (Output_segment::add_output_section): Remove front
9595 parameter.
9596 * output.h (class Output_segment): Remove
9597 add_initial_output_section and overloaded add_output_section.
9598 Update declaration of remaining add_output_section.
9599 * layout.cc (Layout::create_interp): Call add_output_section
9600 rather than add_initial_output_section.
9601 (Layout::finish_dynamic_section): Likewise.
9602
497897f9
ILT
9603 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9604 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9605 know the dynamic type.
9606 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9607 field. Initialize it in constructor.
9608 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9609 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9610 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9611 reloc.
9612
a984ee1d
ILT
9613 * output.cc (Output_reloc::get_address): Change return type to
9614 Elf_Addr.
9615 * output.h (class Output_reloc): Update get_address declaration.
9616 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9617 for section addresses.
9618
55ba0940
ILT
96192008-05-09 Ian Lance Taylor <iant@google.com>
9620
9621 PR 6493
9622 * gold.cc (gold_nomem): Use return value of write.
9623
75517b77
ILT
96242008-05-08 Ian Lance Taylor <iant@google.com>
9625
9626 * symtab.c (Symbol::init_base_output_data): Add version
9627 parameter. Change all callers.
9628 (Symbol::init_base_output_segment): Likewise.
9629 (Symbol::init_base_constant): Likewise.
9630 (Symbol::init_base_undefined): Likewise.
9631 (Sized_symbol::init_output_data): Likewise.
9632 (Sized_symbol::init_output_segment): Likewise.
9633 (Sized_symbol::init_constant): Likewise.
9634 (Sized_symbol::init_undefined): Likewise.
9635 (Symbol_table::do_define_in_output_data): If the new symbol has a
9636 version, mark it as the default.
9637 (Symbol_table::do_define_in_output_segment): Likewise.
9638 (Symbol_table::do_define_as_constant): Likewise.
9639 * symtab.h (class Symbol): Update declarations.
9640 (class Sized_symbol): Likewise.
9641 * resolve.cc (Symbol::override_version): New function.
c42e122e 9642 (Symbol::override_base): Call override_version.
75517b77
ILT
9643 (Symbol::override_base_with_special): Likewise.
9644 * testsuite/ver_script_8.script: New file.
9645 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9646 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9647 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9648 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9649
f1f70eae
ILT
96502008-05-06 Ian Lance Taylor <iant@google.com>
9651
f3e9c5c5
ILT
9652 PR 6049
9653 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
9654 functions.
9655 (class General_options): Remove existing --undefined, and add
9656 --no-undefined instead. Add new --undefined as synonym for -u.
9657 * archive.cc (Archive::add_symbols): Check whether symbol was
9658 named with -u.
9659 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
9660 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
9661 all uses. Add IS_UNDEFINED. Update declarations to split
9662 different versions of init_base. Declare init_base_undefined.
9663 (Symbol::is_defined): Handle IS_UNDEFINED.
9664 (Symbol::is_undefined): Likewise.
9665 (Symbol::is_weak_undefined): Call is_undefined.
9666 (Symbol::is_absolute): Handle IS_CONSTANT.
9667 (class Sized_symbol): Update declarations to split different
9668 versions of init. Declare init_undefined.
9669 (class Symbol_table): Declare new functions.
9670 * symtab.cc (Symbol::init_base_object): Rename from init_base.
9671 Change all callers.
9672 (Symbol::init_base_output_data): Likewise.
9673 (Symbol::init_base_output_segment): Likewise.
9674 (Symbol::init_base_constant): Likewise.
9675 (Symbol::init_base_undefined): New function.
9676 (Sized_symbol::init_object): Rename from init. Change all
9677 callers.
9678 (Sized_symbol::init_output_data): Likewise.
9679 (Sized_symbol::init_output_segment): Likewise.
9680 (Sized_symbol::init_constant): Likewise.
9681 (Sized_symbol::init_undefined): New function.
9682 (Symbol_table::add_undefined_symbols_from_command_line): New
9683 function.
9684 (Symbol_table::do_add_undefined_symbols_from_command_line): New
9685 function.
9686 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
9687 (Symbol::output_section): Likewise.
9688 (Symbol::set_output_section): Likewise.
9689 (Symbol_table::sized_finalize_symbol): Likewise.
9690 (Symbol_table::sized_write_globals): Likewise.
9691 * resolve.cc (Symbol_table::should_override): Likewise.
9692 (Symbol::override_base_with_special): Likewise.
9693
8bdcdf2c
ILT
9694 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
9695 symbol, change it to have default visibility.
9696 * testsuite/protected_1.cc: New file.
9697 * testsuite/protected_2.cc: New file.
9698 * testsuite/protected_3.cc: New file.
9699 * testsuite/protected_main_1.cc: New file.
9700 * testsuite/protected_main_2.cc: New file.
9701 * testsuite/protected_main_3.cc: New file.
9702 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
9703 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
9704 (protected_1_LDFLAGS, protected_1_LDADD): Define.
9705 (protected_1.so): New target.
9706 (protected_1_pic.o, protected_2_pic.o): New targets.
9707 (protected_3_pic.o): New target.
9708 (check_PROGRAMS): Add protected_2.
9709 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
9710 (protected_2_LDFLAGS, protected_2_LDADD): Define.
9711 * testsuite/Makefile.in: Rebuild.
9712
2b706932
ILT
9713 * options.h (DEFINE_var): Add set_user_set_##varname__.
9714 (DEFINE_bool_alias): New macro.
9715 (class General_options): Define -Bstatic using DEFINE_bool_alias
9716 rather than DEFINE_special. Add --undefined as an alias for -z
9717 defs.
9718 * options.cc (General_options::parse_Bstatic): Remove.
9719
d82a5bcc
ILT
9720 * options.h (class General_options): Add --fatal-warnings.
9721 * main.cc (main): Implement --fatal-warnings.
9722 * errors.h (Errors::warning_count): New function.
9723
f1f70eae
ILT
9724 * options.h (class General_options): Add -Bsymbolic-functions.
9725 * symtab.h (Symbol::is_preemptible): Check for
9726 -Bsymbolic-functions.
9727
8825ac63
ILT
97282008-05-05 Ian Lance Taylor <iant@google.com>
9729
d98bc257
ILT
9730 * options.h (DEFINE_bool): For DASH_Z, create the negative option
9731 as noVARNAME rather than no-VARNAME.
9732 (class General_options): Add option -z combreloc.
9733 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
9734 get_address.
9735 (Output_reloc::sort_before) [SHT_REL]: New function.
9736 (Output_reloc::sort_before) [SHT_RELA]: New function.
9737 (class Output_data_reloc_base): Add sort_relocs_ field. Define
9738 Sort_relocs_comparison.
9739 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
9740 parameter. Change all callers.
9741 (Output_data_reloc::Output_data_reloc) [both versions]: Add
9742 sort_relocs parameter. Change all callers.
9743 * output.cc (Output_reloc::get_address): New function, broken out
9744 of write_rel.
9745 (Output_reloc::write_rel): Call it.
9746 (Output_reloc::compare): New function.
9747 (Output_data_reloc_base::do_write): Optionally sort relocs.
9748
60b2b4e7
ILT
9749 * configure.ac: If targ_extra_obj is set, link it in.
9750 * configure.tgt: Initialize all variables.
9751 (x86_64*): Set targ_extra_obj and targ_extra_size.
9752 * configure: Rebuild.
9753
8825ac63
ILT
9754 * object.cc (Sized_relobj::include_section_group): Adjust section
9755 indexes read from group data. Build vector to pass to
9756 layout_group.
9757 * layout.cc (Layout::layout_group): Add flags and shndxes
9758 parameters. Remove contents parameter. Change caller. Update
9759 explicit instantiations.
9760 * layout.h (class Layout): Update layout_group declaration.
9761 * output.cc (Output_data_group::Output_data_group): Add flags and
9762 input_shndxes parameters. Remove contents parameter. Change
9763 caller.
9764 (Output_data_group::do_write): Change input_sections_ to
9765 input_shndxes_.
9766 * output.h (class Output_data_group): Update constructor
9767 declaration. Rename input_sections_ to input_shndxes_.
9768 * testsuite/many_sections_test.cc: Add template.
9769
e94cf127
CC
97702008-04-30 Cary Coutant <ccoutant@google.com>
9771
4418b2d5
CC
9772 * target-reloc.h (relocate_section): Fix dead-pointer bug.
9773
e94cf127
CC
9774 * layout.cc (Layout::include_section): Refactored check for debug
9775 info section.
9776 (Layout::add_comdat): Add new parameters. Change type
9777 of signature parameter. Add object and shndx to signatures table.
9778 (Layout::find_kept_object): New function.
9779 * layout.h: Include <cstring>.
9780 (Layout::is_debug_info_section): New function.
9781 (Layout::add_comdat): Add new parameters.
9782 (Layout::find_kept_object): New function.
9783 (Layout::Kept_section): New struct.
9784 (Layout::Signatures): Change type of map range.
9785 * object.cc (Relobj::output_section_address): New function.
9786 (Sized_relobj::include_section_group): Add new parameters. Change
9787 calls to Layout::add_comdat. Change to build table of kept comdat
9788 groups and table mapping discarded sections to kept sections.
9789 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
9790 (Sized_relobj::do_layout): Change calls to include_section_group and
9791 include_linkonce_section.
9792 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
9793 value to zero when section is discarded.
9794 (Sized_relobj::map_to_kept_section): New function.
9795 * object.h (Relobj::output_section_address): New function.
9796 (Relobj::Comdat_group): New type.
9797 (Relobj::find_comdat_group): New function.
9798 (Relobj::Comdat_group_table): New type.
9799 (Relobj::Kept_comdat_section): New type.
9800 (Relobj::Kept_comdat_section_table): New type.
9801 (Relobj::add_comdat_group): New function.
9802 (Relobj::set_kept_comdat_section): New function.
9803 (Relobj::get_kept_comdat_section): New function.
9804 (Relobj::comdat_groups_): New field.
9805 (Relobj::kept_comdat_sections_): New field.
9806 (Symbol_value::input_value): Update comment.
9807 (Sized_relobj::map_to_kept_section) New function.
9808 (Sized_relobj::include_linkonce_section): Add new parameter.
9809 * target-reloc.h (Comdat_behavior): New type.
9810 (get_comdat_behavior): New function.
9811 (relocate_section): Add code to map a discarded section to the
9812 corresponding kept section when applying a relocation.
9813
e4e5049b
CS
98142008-04-30 Craig Silverstein <csilvers@google.com>
9815
9816 * dwarf_reader.cc (next_generation_count): New static var.
9817 (Addr2line_cache_entry): New struct.
9818 (addr2line_cache): New static var.
9819 (Dwarf_line_info::one_addr2line): Added caching.
9820 (Dwarf_line_info::clear_addr2line_cache): New function.
9821 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
9822 cache-size parameter.
9823 (Dwarf_line_info::one_addr2line_cache): New function.
9824 * symtab.cc (Symbol_table::detect_odr_violations): Pass
9825 new cache-size argument to one_addr2line(), and clear cache.
9826
d09e9154
CC
98272008-04-28 Cary Coutant <ccoutant@google.com>
9828
9829 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
9830 R_386_PC8 relocations.
9831
7ef73768
ILT
98322008-04-23 Ian Lance Taylor <iant@google.com>
9833
55438702
ILT
9834 * object.cc (Sized_relobj::include_section_group): Check for
9835 invalid section group.
9836
c165fb93
ILT
9837 * object.cc (make_elf_object): Correct test for 64-bit ELF file
9838 header size.
9839
7ef73768
ILT
9840 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
9841 than read for file header.
9842 * archive.cc (Archive::include_member): Likewise.
9843
6194aaab
L
98442008-04-23 Paolo Bonzini <bonzini@gnu.org>
9845
9846 * aclocal.m4: Regenerate.
9847 * configure: Regenerate.
9848
d491d34e
ILT
98492008-04-19 Ian Lance Taylor <iant@google.com>
9850
5ea2bac6
ILT
9851 * version.cc (version_string): Bump to 1.6.
9852
7bc3e21a
ILT
9853 * testsuite/Makefile.am (many_sections_r_test): New target.
9854 (many_sections_r_test_SOURCES): Remove.
9855 (many_sections_r_test_DEPENDENCIES): Remove.
9856 (many_sections_r_test_LDFLAGS): Remove.
9857 (many_sections_r_test_LDADD): Remove.
9858
7fcd3aa9
ILT
9859 * object.cc (Sized_relobj::do_add_symbols): Always pass
9860 local_symbol_count_ to add_from_relobj.
9861
4c94d6ae
ILT
9862 * testsuite/Makefile.am (many_sections_check.h): Only check one in
9863 every thousand variables.
9864 * testsuite/Makefile.in: Rebuild.
9865
d491d34e
ILT
9866 * object.cc (Xindex::initialize_symtab_xindex): New function.
9867 (Xindex::read_symtab_xindex): New function.
9868 (Xindex::sym_xindex_to_shndx): New function.
9869 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
9870 available.
9871 (Sized_relobj::do_initialize_xindex): New function.
9872 (Sized_relobj::do_read_symbols): Adjust section links.
9873 (Sized_relobj::symbol_section_and_value): Add is_ordinary
9874 parameter. Change all callers.
9875 (Sized_relobj::include_section_group): Adjust section links and
9876 symbol section indexes.
9877 (Sized_relobj::do_layout): Adjust section links.
9878 (Sized_relobj::do_count_local_symbols): Adjust section links and
9879 symbol section indexes.
9880 (Sized_relobj::do_finalize_local_symbols): Distinguish between
9881 ordinary and special symbols.
9882 (Sized_relobj::write_local_symbols): Add symtab_xindex and
9883 dynsym_xindex parameters. Change all callers. Adjust section
9884 links. Use SHN_XINDEX when needed.
9885 (Sized_relobj::get_symbol_location_info): Adjust section links.
9886 Don't get fooled by special symbols.
9887 * object.h (class Xindex): Define.
9888 (class Object): Add xindex_ parameter. Declare virtual functoin
9889 do_initialize_xindex.
9890 (Object::adjust_sym_shndx): New function.
9891 (Object::set_xindex): New protected function.
9892 (class Symbol_value): Add is_ordinary_shndx_ field.
9893 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
9894 (Symbol_value::value): Assert ordinary section.
9895 (Symbol_value::initialize_input_to_output_map): Likewise.
9896 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
9897 Change all callers.
9898 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
9899 all callers.
9900 (class Sized_relobj): Update declarations.
9901 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
9902 parameter. Change all callers.
9903 (Sized_relobj::adjust_shndx): New function.
9904 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
9905 field.
9906 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
9907 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
9908 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
9909 (Sized_dynobj::read_dynsym_section): Adjust section links.
9910 (Sized_dynobj::read_dynamic): Likewise.
9911 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
9912 section links.
9913 (Sized_dynobj::do_initialize_xindex): New function.
9914 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
9915 do_initialize_xindex.
9916 (Sized_dynobj::adjust_shndx): New function.
9917 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
9918 dynsym_xindex_ fields.
9919 (Layout::finalize): Add a call to set_section_indexes before
9920 creating the symtab sections.
9921 (Layout::set_section_indexes): Don't do anything if the section
9922 already has a section index.
9923 (Layout::create_symtab_sections): Add shnum parameter. Change
9924 caller. Create .symtab_shndx section if needed.
9925 (Layout::create_shdrs): Add shstrtab_section parameter. Change
9926 caller.
9927 (Layout::allocated_output_section_count): New function.
9928 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
9929 needed.
9930 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
9931 fields. Update declarations.
9932 (Layout::symtab_xindex): New function.
9933 (Layout::dynsym_xindex): New function.
9934 (class Write_symbols_task): Add layout_ field.
9935 (Write_symbols_task::Write_symbols_task): Add layout parameter.
9936 Change caller.
9937 * output.cc (Output_section_headers::Output_section_headers): Add
9938 shstrtab_section parameter. Change all callers.
9939 (Output_section_headers::do_sized_write): Store overflow values
9940 for section count and section string table section index in
9941 section header zero.
9942 (Output_file_header::do_sized_write): Check for overflow of
9943 section count and section string table section index.
9944 (Output_symtab_xindex::do_write): New function.
9945 (Output_symtab_xindex::endian_do_write): New function.
9946 * output.h (class Output_section_headers): Add shstrtab_section_.
9947 Update declarations.
9948 (class Output_symtab_xindex): Define.
9949 (Output_section::has_out_shndx): New function.
9950 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
9951 field.
9952 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
9953 Change all callers.
9954 (Sized_symbol::init): Likewise.
9955 (Symbol::output_section): Check for ordinary symbol.
9956 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
9957 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
9958 callers.
9959 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
9960 Change all callers. Simplify handling of symbols from sections
9961 not included in the link.
9962 (Symbol_table::add_from_dynobj): Handle ordinary symbol
9963 distinction.
9964 (Weak_alias_sorter::operator()): Assert that symbols are
9965 ordinary.
9966 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
9967 distinction.
9968 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
9969 parameters. Change all callers.
9970 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
9971 symbol distinction. Use SHN_XINDEX when needed.
9972 (Symbol_table::write_section_symbol): Add symtab_xindex
9973 parameter. Change all callers.
9974 (Symbol_table::sized_write_section_symbol): Likewise. Use
9975 SHN_XINDEX when needed.
9976 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
9977 declarations.
9978 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
9979 (Symbol::is_defined): Check is_ordinary.
9980 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
9981 (Symbol::is_absolute, Symbol::is_common): Likewise.
9982 (class Sized_symbol): Update declarations.
9983 (class Symbol_table): Update declarations.
9984 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
9985 parameters. Change all callers.
9986 (Sized_symbol::override): Likewise.
9987 (Symbol_table::override): Likewise.
9988 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
9989 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
9990 is_ordinary, and orig_st_shndx parameters. Change all callers.
9991 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
9992 to be in an ordinary section.
9993 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
9994 object and is_ordinary parameters. Change all callers.
9995 (Sized_dwarf_line_info::read_relocs): Add object parameter.
9996 Change all callers. Don't add undefined or non-ordinary symbols
9997 to reloc_map_.
9998 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
9999 Change all callers.
10000 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10001 declarations.
10002 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10003 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10004 (Sized_relobj::relocate_sections): Likewise.
10005 * target-reloc.h (scan_relocs): Adjust section symbol index.
10006 (scan_relocatable_relocs): Likewise.
10007 * i386.cc (Scan::local): Check for ordinary symbols.
10008 * sparc.cc (Scan::local): Likewise.
10009 * x86_64.cc (Scan::local): Likewise.
10010 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10011 to symbol_section_and_value.
10012 * testsuite/many_sections_test.cc: New file.
10013 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10014 (check_PROGRAMS): Add many_sections_test.
10015 (many_sections_test_SOURCES): Define.
10016 (many_sections_test_DEPENDENCIES): Define.
10017 (many_sections_test_LDFLAGS): Define.
10018 (BUILT_SOURCES): Add many_sections_define.h.
10019 (many_sections_define.h): New target.
10020 (BUILT_SOURCES): Add many_sections_check.h.
10021 (many_sections_check.h): New target.
10022 (check_PROGRAMS): Add many_sections_r_test.
10023 (many_sections_r_test_SOURCES): Define.
10024 (many_sections_r_test_DEPENDENCIES): Define.
10025 (many_sections_r_test_LDFLAGS): Define.
10026 (many_sections_r_test_LDADD): Define.
10027 (many_sections_r_test.o): New target.
10028 * testsuite/Makefile.in: Rebuild.
10029
c5818ff1
CC
100302008-04-17 Cary Coutant <ccoutant@google.com>
10031
10032 * errors.cc (Errors::info): New function.
10033 (gold_info): New function.
10034 * errors.h (Errors::info): New function.
10035 * gold.h (gold_info): New function.
10036 * object.cc (Input_objects::add_object): Print trace output.
10037 * options.cc (options::parse_set): New function.
10038 (General_options::parse_wrap): Deleted.
10039 (General_options::General_options): Deleted initializer.
10040 * options.h (options::String_set): New typedef.
10041 (options::parse_set): New function.
10042 (DEFINE_set): New macro.
10043 (General_options::wrap): Changed to use DEFINE_set. Changed
10044 callers of any_wrap_symbols and is_wrap_symbol.
10045 (General_options::trace, General_options::trace_symbol):
10046 New options.
10047 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10048 (General_options::wrap_symbols_): Deleted.
10049 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10050
b5be4a7c
DM
100512008-04-17 David S. Miller <davem@davemloft.net>
10052
10053 * options.cc (General_options::parse_V): New function.
10054 * options.h: Add entries for -V and -Qy.
10055
155a0dd7
ILT
100562008-04-17 Ian Lance Taylor <iant@google.com>
10057
10058 * common.cc (Symbol_table::allocate_commons): Remove options
10059 parameter. Change caller.
10060 (Symbol_table::do_allocate_commons): Remove options parameter.
10061 Change caller. Just call do_allocate_commons_list twice.
10062 (Symbol_table::do_allocate_commons_list): New function, broken out
10063 of do_allocate_commons.
10064 * common.h (class Allocate_commons_task): Remove options_ field.
10065 Update constructor.
10066 * symtab.cc (Symbol_table::Symbol_table): Initialize
10067 tls_commons_.
10068 (Symbol_table::add_from_object): Put TLS common symbols on
10069 tls_commons_ list.
10070 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10071 which are IN_OUTPUT_DATA.
10072 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10073 allocate_commons and do_allocate_commons declarations. Declare
10074 do_allocate_commons_list.
10075 * gold.cc (queue_middle_tasks): Update creation of
10076 Allocate_commons_task to not pass options.
10077 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10078 (TLS_TEST_C_FLAGS): New variable.
10079 (tls_test_c_pic.o): New target.
10080 (tls_test_shared.so): Link in tls_test_c_pic.o.
10081 (tls_test_c_pic_ie.o): New target.
10082 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10083 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10084 (tls_test_c.o): New target.
10085 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10086 (tls_pic_test_LDADD): Likewise.
10087 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10088 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10089 (tls_test_c_gnu2.o): New target.
10090 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10091 tls_test_c_gnu2.o.
10092 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10093 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10094 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10095 * testsuite/tls_test.cc: Include "config.h".
10096 (t_last): Call t11_last.
10097 * testsuite/tls_test.h (t11, t11_last): Declare.
10098 * testsuite/tls_test_c.c: New file.
10099 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10100 * configure.ac: Check for OpenMP support.
10101 * configure, config.in, Makefile.in: Rebuild.
10102 * testsuite/Makefile.in: Rebuild.
10103
edfbb029
CC
101042008-04-16 Cary Coutant <ccoutant@google.com>
10105
10106 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10107 (Target_i386::tls_base_symbol_defined_): New field.
10108 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10109 (Target_i386::Scan::global): Likewise.
10110 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10111 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10112 (Target_x86_64::tls_base_symbol_defined_): New field.
10113 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10114 (Target_x86_64::Scan::global): Likewise.
10115
f3c69fca
CC
101162008-04-16 Cary Coutant <ccoutant@google.com>
10117
10118 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10119 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10120 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10121 building shared libraries.
10122 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10123 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10124 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10125 * testsuite/Makefile.in: Rebuild.
10126 * testsuite/weak_undef.h: New file.
10127 * testsuite/weak_undef_file1.cc: Add extra test cases.
10128 * testsuite/weak_undef_file2.cc: Likewise.
10129 * testsuite/weak_undef_test.cc: Likewise.
10130
7c414435
DM
101312008-04-16 David S. Miller <davem@davemloft.net>
10132
32b769e1
DM
10133 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10134 Add issued_non_pic_error_ field. Declare check_non_pic.
10135 (Target_sparc::Scan::check_non_pic): New function.
10136 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10137 (Target_sparc::Scan::global): Likewise.
10138
11936fb1
DM
10139 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10140 * configure: Rebuild.
10141
7c414435
DM
10142 * options.h (DEFINE_enable): New macro.
10143 (new_dtags): New enable option.
10144 (initfirst, interpose, loadfltr, nodefaultlib,
10145 nodelete, nodlopen, nodump): New -z options.
10146 * layout.cc (Layout:finish_dynamic_section): If new
10147 dtags enabled, emit DT_RUNPATH. Also, emit a
10148 DT_FLAGS_1 containing any specified -z flags.
10149
85c7bf8b
ILT
101502008-04-16 Ian Lance Taylor <iant@google.com>
10151
12c0daef
ILT
10152 * copy-relocs.cc: New file.
10153 * copy-relocs.h: New file.
10154 * reloc.cc: Remove Copy_relocs code.
10155 * reloc.h: Likewise.
10156 * reloc-types.h (struct Reloc_types) [both versions]: Add
10157 get_reloc_addend_noerror.
10158 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10159 variants of add_global which take an addend which must be zero.
10160 * i386.cc: Include "copy-relocs.h".
10161 (class Target_i386): Change type of copy_relocs_ to variable,
10162 update initializer.
10163 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10164 Change all callers.
10165 (Target_i386::do_finalize_sections): Change handling of
10166 copy_relocs_.
10167 * sparc.cc: Include "copy-relocs.h".
10168 (class Target_sparc): Change type of copy_relocs_ to variable,
10169 update initializer.
10170 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10171 Change all callers.
10172 (Target_sparc::do_finalize_sections): Change handling of
10173 copy_relocs_.
10174 * x86_64.cc: Include "copy-relocs.h".
10175 (class Target_x86_64): Change type of copy_relocs_ to variable,
10176 update initializer.
10177 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10178 class. Change all callers.
10179 (Target_x86_64::do_finalize_sections): Change handling of
10180 copy_relocs_.
10181 * Makefile.am (CCFILES): Add copy-relocs.cc.
10182 (HFILES): Add copy-relocs.h.
10183
4f4995b6
ILT
10184 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10185
85c7bf8b
ILT
10186 * testsuite/script_test_4.sh: Permit leading zeroes.
10187
4f2a9edd
ILT
101882008-04-15 Ian Lance Taylor <iant@google.com>
10189
e6188289
ILT
10190 * script-sections.cc (Script_sections::create_segments): Use
10191 header_size_adjustment even when there is enough room for the
10192 headers.
10193 * testsuite/script_test_4.sh: New file.
10194 * testsuite/script_test_4.t: New file.
10195 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10196 (check_DATA): Add script_test_4.stdout.
10197 (MOSTLYCLEANFILES): Likewise.
10198 (script_test_4): New target.
10199 (script_test_4.stdout): New target.
10200 * testsuite/Makefile.in: Rebuild.
10201
4f2a9edd
ILT
10202 * sparc.cc: Add definitions for Output_data_plt_sparc class
10203 constants.
10204
f5314dd5
DM
102052008-04-14 David S. Miller <davem@davemloft.net>
10206
10207 * sparc.cc: New file.
10208 * Makefile.am (TARGETSOURCES): Add sparc.cc
10209 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10210 * configure.tgt: Document targ_extra_size and
10211 targ_extra_big_endian. Add entries for sparc-* and
10212 sparc64-*.
10213 * configure.ac: Handle targ_extra_size and
10214 targ_extra_big_endian.
10215 * Makefile.in: Rebuild.
10216 * configure: Likewise.
10217 * po/POTFILES.in: Likewise.
10218 * po/gold.pot: Likewise.
10219
154e0e9a
ILT
102202008-04-14 Ian Lance Taylor <iant@google.com>
10221
10222 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10223 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10224 in the name/type/flags to section mapping. Don't call
10225 allocate_output_section.
10226 (Layout::choose_output_section): Change parameter from adjust_name
10227 to is_input_section. Don't permit input sections after sections
10228 are attached to segments. Don't call allocate_output_section.
10229 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10230 not write_enable_output_section.
10231 (Layout::make_output_section): Don't push to
10232 unattached_section_list_ nor call attach_to_segment. Call
10233 attach_section_to_segment if sections are attached.
10234 (Layout::attach_sections_to_segments): New function.
10235 (Layout::attach_section_to_segment): New function.
10236 (Layout::attach_allocated_section_to_segment): Rename from
10237 attach_to_segment. Remove flags parameter.
10238 (Layout::allocate_output_section): Remove function.
10239 (Layout::write_enable_output_section): Remove function.
10240 * layout.h (class Layout): Update for above changes. Add new
10241 field sections_are_attached_.
10242 * output.h (Output_section::update_flags_for_input_section): New
10243 function.
10244 * output.cc (Output_section::add_input_section): Call
10245 update_flags_for_input_section.
10246 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10247
009a67a2
CC
102482008-04-11 Cary Coutant <ccoutant@google.com>
10249
10250 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10251 thought unnecessary.
10252 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10253
759b1a24
ILT
102542008-04-11 Ian Lance Taylor <iant@google.com>
10255
10256 * output.h (class Output_section_data): Remove inline definition
10257 of set_addralign.
10258 * output.cc (Output_section_data::set_addralign): New function.
10259
c2b45e22
CC
102602008-04-11 Cary Coutant <ccoutant@google.com>
10261
10262 Add support for TLS descriptors for i386 and x86_64.
10263 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10264 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10265 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10266 GOT_TYPE_TLS_DESC.
10267 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10268 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10269 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10270 relocations.
10271 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10272 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10273 Fix problem with initial-exec relocations.
10274 (Target_i386::Relocate::relocate_tls): Likewise.
10275 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10276 relaxation.
10277 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10278 support for section-plus-offset dynamic table entries.
10279 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10280 (Output_data_dynamic::Dynamic_entry): Add support for
10281 section-plus-offset dynamic table entries.
10282 (Output_data_dynamic::Classification): Likewise.
10283 (Output_data_dynamic::classification_): Renamed offset_.
10284 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10285 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10286 (Target_x86_64::make_plt_section): New function.
10287 (Target_x86_64::reserve_tlsdesc_entries): New function.
10288 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10289 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10290 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10291 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10292 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10293 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10294 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10295 add extra PLT entry for TLS descriptors.
10296 (Output_data_plt_x86_64::got_): New field.
10297 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10298 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10299 fields.
10300 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10301 descriptors.
10302 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10303 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10304 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10305 R_386_TLS_DESC_CALL relocations.
10306 (Target_x86_64::Scan::global): Likewise.
10307 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10308 for TLS descriptors.
10309 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10310 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10311 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10312 GD-to-IE relaxation.
10313 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10314 and TLS_DESCRIPTORS.
10315 * Makefile.in: Rebuild.
10316 * configure: Rebuild.
10317 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10318 (tls_test_shared2.so): New target.
10319 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10320 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10321 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10322 (tls_shared_gd_to_ie_test_LDADD): New variable.
10323 (tls_shared_gnu2_gd_to_ie_test): New target.
10324 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10325 New targets.
10326 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10327 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10328 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10329 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10330 (tls_shared_gnu2_test): New target.
10331 (tls_test_gnu2_shared.so): New target.
10332 (tls_shared_gnu2_test_SOURCES): New variable.
10333 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10334 (tls_shared_gnu2_test_LDFLAGS): New variable.
10335 (tls_shared_gnu2_test_LDADD): New variable.
10336 * testsuite/Makefile.in: Rebuild.
10337 * testsuite/Makefile.
10338
83bfb6b7
ILT
103392008-04-11 Ian Lance Taylor <iant@google.com>
10340
10341 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10342 justsyms.t.
10343 * testsuite/Makefile.in: Rebuild.
10344
10345 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10346 long.
10347 * testsuite/script_test_2.cc (main): Adjust test.
10348
706e1f5e
ILT
103492008-04-11 David S. Miller <davem@davemloft.net>
10350 Ian Lance Taylor <iant@google.com>
10351
10352 * options.h (General_options): Add entries for '-Y' and
10353 '-relax'.
10354 * options.cc (General_options:finalize): If -Y was used, add those
10355 entries to the library path instead of the default "/lib" and
10356 "/usr/lib".
10357
7c98e6bb
DM
103582008-04-11 David S. Miller <davem@davemloft.net>
10359
10360 * testsuite/justsyms.t: Start at 0x100.
10361 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10362 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10363 long.
10364 * testsuite/script_test_2.cc: Adjust string and section length
10365 checks.
7c98e6bb 10366
99a37bfd
ILT
103672008-04-09 Ian Lance Taylor <iant@google.com>
10368
2cefc357
ILT
10369 PR gold/5996
10370 * script-sections.cc (Sections_element::allocate_to_segment): Add
10371 orphan parameter.
10372 (Output_section_definition::allocate_to_segment): Likewise.
10373 (Orphan_output_section::allocate_to_segment): Likewise.
10374 (Script_sections::attach_sections_using_phdrs_clause): Don't
10375 propagate non-PT_LOAD segments to orphan sections.
10376 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10377 readelf rather than objdump.
10378 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10379 .interp section and PT_INTERP segment are the same size.
10380 * testsuite/Makefile.in: Rebuild.
10381
99a37bfd
ILT
10382 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10383 aliases for symbols defined in the same object.
10384 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10385 (weak_alias_test_SOURCES): New variable.
10386 (weak_alias_test_DEPENDENCIES): New variable.
10387 (weak_alias_test_LDFLAGS): New variable.
10388 (weak_alias_test_LDADD): New variable.
10389 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10390 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10391 (weak_alias_test_3.o): New target.
10392 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10393 * testsuite/weak_alias_test_main.cc: New file.
10394 * testsuite/weak_alias_test_1.cc: New file.
10395 * testsuite/weak_alias_test_2.cc: New file.
10396 * testsuite/weak_alias_test_3.cc: New file.
10397
780e49c5
ILT
103982008-04-08 Ian Lance Taylor <iant@google.com>
10399
cdb0b8f5
ILT
10400 * options.h (class General_options): Add --noinhibit-exec option.
10401 * main.cc (main): Check --noinhibit-exec.
10402
0864d551
ILT
10403 * options.h (class General_options): Define --wrap as a special
10404 option. Add wrap_symbols_ field.
10405 (General_options::any_wrap_symbols): New function.
10406 (General_options::is_wrap_symbol): New function.
10407 * options.cc (General_options::parse_wrap): New function.
10408 (General_options::General_options): Initialize wrap_symbols_.
10409 * symtab.cc (Symbol_table::wrap_symbol): New function.
10410 (Symbol_table::add_from_object): Handle --wrap.
10411 * symtab.h (class Symbol_table): Declare wrap_symbol.
10412 * target.h (Target::wrap_char): New function.
10413 (Target::Target_info): Add wrap_char field.
10414 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10415 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10416 * testsuite/testfile.cc (Target_test::test_target_info):
10417 Likewise.
10418
789aa6de
ILT
10419 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10420 there is one.
10421
2c38906f
ILT
10422 * layout.h (class Layout): Add added_eh_frame_data_ field.
10423 * layout.cc (Layout::Layout): Initialize new field.
10424 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10425 output section until we find a section we merged successfully.
10426 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10427 that the size be non-zero.
10428
780e49c5
ILT
10429 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10430 qualifier.
10431
7fcd0256
ILT
104322008-04-08 Craig Silverstein <csilvers@google.com>
10433
10434 * configure.ac: Export new conditional variable HAVE_ZLIB.
10435 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10436 on HAVE_ZLIB.
10437 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10438 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10439
6835af53
ILT
104402008-04-07 Ian Lance Taylor <iant@google.com>
10441
e24f324c
ILT
10442 * version.cc (version_string): Set to "1.5".
10443
a036edd8
ILT
10444 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10445 Add issued_non_pic_error_ field. Declare check_non_pic.
10446 (Target_x86_64::Scan::check_non_pic): New function.
10447 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10448 (Target_x86_64::Scan::global): Likewise.
10449
624f8810
ILT
10450 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10451 addend parameter. Change caller. Handle merge sections.
10452 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10453 Address to Addend. Don't add in the result of
10454 local_section_offset, pass down the addend and use the returned
10455 value.
10456 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10457 Update declarations of local_section_offset and symbol_value.
10458 * testsuite/two_file_test_1.cc (t18): New function.
10459 * testsuite/two_file_test_2.cc (f18): New function.
10460 * testsuite/two_file_test_main.cc (main): Call t18.
10461 * testsuite/two_file_test.h (t18, f18): Declare.
10462
6835af53
ILT
10463 * configure.ac: Don't test for objdump, c++filt, or readelf.
10464 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10465 conditionals.
10466 (TEST_READELF): New variable.
10467 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10468 (check_PROGRAMS): Add two_file_strip_test.
10469 (two_file_strip_test): New target.
10470 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10471 (two_file_same_shared_strip_test_SOURCES): New variable.
10472 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10473 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10474 (two_file_same_shared_strip_test_LDADD): New variable.
10475 (two_file_shared_strip.so): New target.
10476 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10477 (ver_test_5.syms, ver_test_7.syms): Likewise.
10478 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10479 (strip_test_3.stdout): Use TEST_OBJDUMP.
10480 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10481
86925eef
CC
104822008-04-04 Cary Coutant <ccoutant@google.com>
10483
10484 * symtab.h (Symbol::is_weak_undefined): New function.
10485 (Symbol::is_strong_undefined): New function.
10486 (Symbol::is_absolute): New function.
10487 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10488 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10489 absolute symbols.
10490 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10491 (weak_undef_test): New target.
10492 * testsuite/Makefile.in: Rebuild.
10493 * testsuite/weak_undef_file1.cc: New file.
10494 * testsuite/weak_undef_file2.cc: New file.
10495 * testsuite/weak_undef_test.cc: New file.
10496
126f3ece
ILT
104972008-04-03 Craig Silverstein <csilvers@google.com>
10498
10499 * compressed_output.h (class Output_compressed_section): Use
10500 unsigned buffer.
10501 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10502 add zlib header.
10503 (zlib_compressed_suffix): Removed.
10504 (Output_compressed_section::set_final_data_size): Use unsigned
10505 buffers.
10506 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10507 Fix linker invocation.
10508 (flagstest_o_specialfile_and_compress_debug_sections):
10509 Likewise.
10510 * testsuite/Makefile.in: Regenerated.
10511
deae2a14
DM
105122008-04-02 David S. Miller <davem@davemloft.net>
10513
10514 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10515 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10516
70752818
ILT
105172008-04-02 Craig Silverstein <csilvers@google.com>
10518
10519 * TODO: New file.
10520
39d0cb0e
ILT
105212008-04-02 Ian Lance Taylor <iant@google.com>
10522
10523 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10524 parameters. Update for new key type to views_. Change all
10525 callers.
10526 (File_read::read): Adjust for byteshift in returned view.
10527 (File_read::add_view): New function, broken out of
10528 find_and_make_view.
10529 (File_read::make_view): New function, broken out of
10530 find_and_make_view.
10531 (File_read::find_or_make_view): Add offset and aligned
10532 parameters. Rewrite accordingly. Change all callers.
10533 (File_read::get_view): Add offset and aligned parameters. Adjust
10534 for byteshift in return value.
10535 (File_read::get_lasting_view): Likewise.
10536 * fileread.h (class File_read): Update declarations.
10537 (class File_read::View): Add byteshift_ field. Add byteshift to
10538 constructor. Add byteshift method.
10539 * archive.h (Archive::clear_uncached_views): New function.
10540 (Archive::get_view): Add aligned parameter. Change all callers.
10541 * object.h (Object::get_view): Add aligned parameter. Change all
10542 callers.
10543 (Object::get_lasting_view): Likewise.
10544
10545 * fileread.cc (File_read::release): Don't call clear_views if
10546 there are multiple objects.
10547 * fileread.h (File_read::clear_uncached_views): New function.
10548 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10549 on the archive.
10550
a1207466
CC
105512008-03-31 Cary Coutant <ccoutant@google.com>
10552
10553 Add thin archive support.
10554 * archive.cc (Archive::armagt): New const.
10555 (Archive::setup): Remove task parameter and calls to unlock.
10556 (Archive::unlock_nested_archives): New function.
10557 (Archive::read_header): Add nested_off parameter. Change
10558 all callers.
10559 (Archive::interpret_header): Likewise.
10560 (Archive::include_all_members): Change to handle thin
10561 archives.
10562 (Archive::include_member): Likewise.
10563 * archive.h (Archive::Archive): Add new parameters and
10564 initializers.
10565 (Archive::armagt): New const.
10566 (Archive::setup): Remove task parameter.
10567 (Archive::unlock_nested_archives): New function.
10568 (Archive::read_header): Add nested_off parameter.
10569 (Archive::interpret_header): Likewise.
10570 (Archive::Nested_archive_table): New typedef.
10571 (Archive::is_thin_archive_): New field.
10572 (Archive::nested_archives_): New field.
10573 (Archive::options_): New field.
10574 (Archive::dirpath_): New field.
10575 (Archive::task_): New field.
10576 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10577 for thin archives. Pass additional parameters to
10578 Archive::Archive. Unlock the archive file after calling
10579 Archive::setup.
cd536b21 10580
479f6503
ILT
105812008-03-29 Ian Lance Taylor <iant@google.com>
10582
686c8caf
ILT
10583 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10584 version symbol to be local.
10585 * testsuite/ver_test_4.sh: New file.
10586 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10587 (check_DATA): Add ver_test_4.syms.
10588 (ver_test_4.syms): New target.
10589 * testsuite/Makefile.in: Rebuild.
10590
ab794b6b
ILT
10591 * output.cc
10592 (Output_section::Input_section_sort_entry::has_priority): New
10593 function.
10594 (Output_section::Input_section_sort_entry::match_file_name): New
10595 function.
10596 (Output_section::Input_section_sort_entry::match_section_name):
10597 Remove.
10598 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10599 Remove.
10600 (Output_section::Input_section_sort_entry::match_section_file):
10601 Remove.
10602 (Output_section::Input_section_sort_compare::operator()): Rewrite
10603 using new Input_section_sort_entry functions. Sort crtbegin and
10604 crtend first. Sort sections with no priority before sections with
10605 a priority.
10606 * testsuite/initpri1.c (d3): Check j != 4.
10607 (cd5): New constructor/destructor function.
10608 (main): Check j != 2.
10609
479f6503
ILT
10610 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10611 new symbol when resolving, don't call set_is_default.
10612 * testsuite/ver_test_7.cc: New file.
10613 * testsuite/ver_test_7.sh: New file.
10614 * testsuite/Makefile.am (ver_test_7.so): New target.
10615 (ver_test_7.o): New target.
10616 (check_SCRIPTS): Add ver_test_7.sh.
10617 (check_DATA): Add ver_test_7.syms.
10618 (ver_test_7.syms): New target.
10619
2fd32231
ILT
106202008-03-28 Ian Lance Taylor <iant@google.com>
10621
10622 * layout.cc (Layout::layout): If we see an input section with a
10623 name that needs sorting, set the must_sort flag for the output
10624 section.
10625 (Layout::make_output_section): If the name of the output section
10626 indicates that it might require sorting, set the may_sort flag.
10627 * output.h (Output_section::may_sort_attached_input_sections): New
10628 function.
10629 (Output_section::set_may_sort_attached_input_sections): New
10630 function.
10631 (Output_section::must_sort_attached_input_sections): New
10632 function.
10633 (Output_section::set_must_sort_attached_input_sections): New
10634 function.
10635 (class Output_section): Declare Input_section_sort_entry. Define
10636 Input_section_sort_compare. Declare
10637 sort_attached_input_sections. Add new fields:
10638 may_sort_attached_input_sections_,
10639 must_sort_attached_input_sections_,
10640 attached_input_sections_are_sorted_.
10641 * output.cc (Output_section::Output_section): Initialize new
10642 fields.
10643 (Output_section::add_input_section): Add an entry to
10644 input_sections_ if may_sort or must_sort are true.
10645 (Output_section::set_final_data_size): Call
10646 sort_attached_input_sections if necessary.
10647 (Output_section::Input_section_sort_entry): Define new class.
10648 (Output_section::Input_section_sort_compare::operator()): New
10649 function.
10650 (Output_section::sort_attached_input_sections): New function.
10651 * configure.ac: Check whether the compiler supports constructor
10652 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
10653 * testsuite/initpri1.c: New file.
10654 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
10655 CONSTRUCTOR_PRIORITY.
10656 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
10657 (initpri1_LDFLAGS): New variable.
10658 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10659
18e6b24e
ILT
106602008-03-27 Ian Lance Taylor <iant@google.com>
10661
49bdd526
ILT
10662 * common.cc (Sort_commons::operator): Correct sorting algorithm.
10663 * testsuite/common_test_1.c: New file.
10664 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
10665 (common_test_1_SOURCES): New variable.
10666 (common_test_1_DEPENDENCIES): New variable.
10667 (common_test_1_LDFLAGS): New variable.
10668
18e6b24e
ILT
10669 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
10670 and commons_ correctly when NAME/VERSION does not override
10671 NAME/NULL.
10672 * testsuite/ver_test_6.c: New file.
10673 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
10674 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
10675 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
10676
04bf7072
ILT
106772008-03-26 Ian Lance Taylor <iant@google.com>
10678
5871526f
ILT
10679 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
10680 of an undefined symbol from a version script.
10681 * testsuite/Makefile.am (ver_test_5.so): New target.
10682 (ver_test_5.o): New target.
10683 (check_SCRIPTS): Add ver_test_5.sh.
10684 (check_DATA): Add ver_test_5.syms.
10685 (ver_test_5.syms): New target.
10686 * testsuite/ver_test_5.cc: New file.
10687 * testsuite/ver_test_5.script: New file.
10688 * testsuite/ver_test_5.sh: New file.
10689 * Makefile.in, testsuite/Makefile.in: Rebuild.
10690
04bf7072
ILT
10691 PR gold/5986
10692 Fix problems building gold with gcc 4.3.0.
10693 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
10694 (gold_error_at_location, gold_warning_at_location): Use it.
10695 * configure.ac: Check whether we can compile and use a template
10696 function with a printf attribute.
10697 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
10698 when jumping over bytes.
10699 * object.cc: Instantiate Object::read_section_data.
10700 * debug.h: Include <cstring>
10701 * dwarf_reader.cc: Include <algorithm>
10702 * main.cc: Include <cstring>.
10703 * options.cc: Include <cstring>.
10704 * output.cc: Include <cstring>.
10705 * script.cc: Include <cstring>.
10706 * script.h: Include <string>.
10707 * symtab.cc: Include <cstring> and <algorithm>.
10708 * target-select.cc: Include <cstring>.
10709 * version.cc: Include <string>.
10710 * testsuite/testmain.cc: Include <cstdlib>.
10711 * configure, config.in: Rebuild.
10712
874c5b28
ILT
107132008-03-25 Ian Lance Taylor <iant@google.com>
10714
819d6c3a
ILT
10715 * options.cc: Include "../bfd/bfdver.h".
10716 (options::help): Print bug reporting address.
10717
f4b2c6f5
ILT
10718 * version.cc (print_version): Adjust output for current value of
10719 BFD_VERSION_STRING.
10720
10721 * NEWS: New file.
10722
e96caa79
ILT
10723 * options.cc (options::help): Print list of supported targets.
10724 * target-select.h: Include <vector>.
10725 (class Target_selector): Make machine_, size_, and is_big_endian_
10726 fields const. Add bfd_name_ and instantiated_target_ fields.
10727 (Target_selector::Target_selector): Add bfd_name parameter.
10728 (Target_selector::recognize): Make non-virtual, call
10729 do_recognize.
10730 (Target_selector::recognize_by_name): Make non-virtual, call
10731 do_recognize_by_name.
10732 (Target_selector::supported_names): New function.
10733 (Target_selector::bfd_name): New function.
10734 (Target_selector::do_instantiate_target): New pure virtual
10735 function.
10736 (Target_selector::do_recognize): New virtual function.
10737 (Target_selector::do_recognize_by_name): New virtual function.
10738 (Target_selector::instantiate_target): New private function.
10739 (supported_target_names): Declare.
10740 * target-select.cc (Target_selector::Target_selector): Update for
10741 new parameter and fields.
10742 (select_target_by_name): Check that the name matches before
10743 calling recognize_by_name.
10744 (supported_target_names): New function.
10745 * i386.cc (class Target_selector_i386): Update Target_selector
10746 constructor call. Remove recognize and recognize_by_name. Add
10747 do_instantiate_target.
10748 * x86_64.cc (class Target_selector_x86_64): Likewise.
10749 * testsuite/testfile.cc (class Target_selector_test): Update for
10750 changes to Target_selector.
10751
874c5b28
ILT
10752 * README: Rewrite, with some notes on unsupported features.
10753
0a65a3a7
CC
107542008-03-24 Cary Coutant <ccoutant@google.com>
10755
10756 * i386.cc (Target_i386::Got_type): New enum declaration.
10757 (Target_i386::Scan::local): Updated callers of Output_data_got
10758 member functions.
10759 (Target_i386::Scan::global): Likewise.
10760 (Target_i386::Relocate::relocate): Likewise.
10761 (Target_i386::Relocate::relocate_tls): Likewise.
10762 * object.h (Got_offset_list): New class.
10763 (Sized_relobj::local_has_got_offset): Added got_type parameter.
10764 (Sized_relobj::local_got_offset): Likewise.
10765 (Sized_relobj::set_local_got_offset): Likewise.
10766 (Sized_relobj::local_has_tls_got_offset): Removed.
10767 (Sized_relobj::local_tls_got_offset): Removed.
10768 (Sized_relobj::set_local_tls_got_offset): Removed.
10769 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
10770 * output.cc (Output_data_got::add_global): Added got_type parameter.
10771 (Output_data_got::add_global_with_rel): Likewise.
10772 (Output_data_got::add_global_with_rela): Likewise.
10773 (Output_data_got::add_global_pair_with_rel): New function.
10774 (Output_data_got::add_global_pair_with_rela): New function.
10775 (Output_data_got::add_local): Added got_type parameter.
10776 (Output_data_got::add_local_with_rel): Likewise.
10777 (Output_data_got::add_local_with_rela): Likewise.
10778 (Output_data_got::add_local_pair_with_rel): New function.
10779 (Output_data_got::add_local_pair_with_rela): New function.
10780 (Output_data_got::add_global_tls): Removed.
10781 (Output_data_got::add_global_tls_with_rel): Removed.
10782 (Output_data_got::add_global_tls_with_rela): Removed.
10783 (Output_data_got::add_local_tls): Removed.
10784 (Output_data_got::add_local_tls_with_rel): Removed.
10785 (Output_data_got::add_local_tls_with_rela): Removed.
10786 * output.h (Output_data_got::add_global): Added got_type parameter.
10787 (Output_data_got::add_global_with_rel): Likewise.
10788 (Output_data_got::add_global_with_rela): Likewise.
10789 (Output_data_got::add_global_pair_with_rel): New function.
10790 (Output_data_got::add_global_pair_with_rela): New function.
10791 (Output_data_got::add_local): Added got_type parameter.
10792 (Output_data_got::add_local_with_rel): Likewise.
10793 (Output_data_got::add_local_with_rela): Likewise.
10794 (Output_data_got::add_local_pair_with_rel): New function.
10795 (Output_data_got::add_local_pair_with_rela): New function.
10796 (Output_data_got::add_global_tls): Removed.
10797 (Output_data_got::add_global_tls_with_rel): Removed.
10798 (Output_data_got::add_global_tls_with_rela): Removed.
10799 (Output_data_got::add_local_tls): Removed.
10800 (Output_data_got::add_local_tls_with_rel): Removed.
10801 (Output_data_got::add_local_tls_with_rela): Removed.
10802 * resolve.cc (Symbol::override_base_with_special): Removed
10803 reference to has_got_offset_ field.
10804 * symtab.cc (Symbol::init_fields): Replaced initialization
10805 of got_offset_ with got_offsets_. Removed initialization
10806 of has_got_offset_
53fcba31 10807 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
10808 (Symbol::got_offset): Likewise.
10809 (Symbol::set_got_offset): Likewise.
10810 (Symbol::has_tls_got_offset): Removed.
10811 (Symbol::tls_got_offset): Removed.
10812 (Symbol::set_tls_got_offset): Removed.
10813 (Symbol::got_offset_): Removed.
10814 (Symbol::tls_mod_got_offset_): Removed.
10815 (Symbol::tls_pair_got_offset_): Removed.
10816 (Symbol::got_offsets_): New field.
10817 (Symbol::has_got_offset): Removed.
10818 (Symbol::has_tls_mod_got_offset): Removed.
10819 (Symbol::has_tls_pair_got_offset): Removed.
10820 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
10821 (Target_x86_64::Scan::local): Updated callers of Output_data_got
10822 member functions.
10823 (Target_x86_64::Scan::global): Likewise.
10824 (Target_x86_64::Relocate::relocate): Likewise.
10825 (Target_x86_64::Relocate::relocate_tls): Likewise.
10826
bd52eafb
BE
108272008-03-25 Ben Elliston <bje@au.ibm.com>
10828
10829 * yyscript.y: Fix spelling error in comment.
10830
8b105e34
ILT
108312008-03-24 Ian Lance Taylor <iant@google.com>
10832
8ed814a9
ILT
10833 * options.h (class General_options): Define build_id option.
10834 * layout.h (class Layout): Declare write_build_id, create_note,
10835 create_build_id. Add build_id_note_ member.
10836 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
10837 "libiberty.h", "md5.h", "sha1.h".
10838 (Layout::Layout): Initialize eh_frame_data_,
10839 eh_frame_hdr_section_, and build_id_note_.
10840 (Layout::finalize): Call create_build_id.
10841 (Layout::create_note): New function, broken out of
10842 Layout::create_gold_note.
10843 (Layout::create_gold_note): Call create_note.
10844 (Layout::create_build_id): New function.
10845 (Layout::write_build_id): New function.
10846 (Close_task_runner::run): Call write_build_id.
10847
8b105e34
ILT
10848 * x86_64.cc: Correct license to GPLv3.
10849
086a1841
ILT
108502008-03-23 Ian Lance Taylor <iant@google.com>
10851
10852 * options.cc: Include "demangle.h".
10853 (parse_optional_string): New function.
10854 (parse_long_option): Handle takes_optional_argument.
10855 (parse_short_option): Update dash_z initializer. Handle
10856 takes_optional_argument.
10857 (General_options::General_options): Initialize do_demangle_.
10858 (General_options::finalize): Set do_demangle_. Handle demangling
10859 style.
10860 * options.h (parse_optional_string): Declare.
10861 (struct One_option): Add optional_arg field. Update constructor.
10862 Update call constructor calls. Add takes_optional_argument
10863 function.
10864 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
10865 (DEFINE_optional_string): Define.
10866 (General_options::demangle): Change from DEFINE_bool to
10867 DEFINE_optional_string.
10868 (General_options::no_demangle): New function.
10869 (General_options::do_demangle): New function.
10870 (General_options::set_do_demangle): New function.
10871 (General_options::execstack_status_): Move definition to end of
10872 class definition.
10873 (General_options::static_): Likewise.
10874 (General_options::do_demangle_): New field.
10875 * object.cc (big_endian>::get_symbol_location_info): Call
10876 Options::do_demangle, not Options::demangle.
10877 * symtab.cc (demangle): Likewise.
10878
cbb93e63
ILT
108792008-03-22 Ian Lance Taylor <iant@google.com>
10880
10881 * gold.h: Include <cstddef> and <sys/types.h>
10882 * options.h: Include <cstring>.
10883
ec531623
ILT
108842008-03-21 Ian Lance Taylor <iant@google.com>
10885
10886 * Added source code to GNU binutils.
This page took 0.662682 seconds and 4 git commands to generate.