*** empty log message ***
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
41d0ab5f
ILT
12011-05-27 Ian Lance Taylor <iant@google.com>
2
3 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
4 (ver_test_9.so): Likewise.
5 * testsuite/Makefile.in: Rebuild.
6
89d8a36b
CC
72011-05-26 Cary Coutant <ccoutant@google.com>
8
9 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
10 * incremental.cc (Incremental_inputs::report_input_section): Fix
11 comment, indentation.
12 (Incremental_inputs::report_comdat_group): New function.
13 (Output_section_incremental_inputs::set_final_data_size): Adjust size
14 of data for incremental input file entry.
15 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
16 group count, COMDAT group signatures.
17 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
18 an unchanged input file.
19 * incremental.h (Incremental_object_entry::Incremental_object_entry):
20 Initialize new data member.
21 (Incremental_object_entry::add_comdat_group): New function.
22 (Incremental_object_entry::get_comdat_group_count): New function.
23 (Incremental_object_entry::get_comdat_signature_key): New function.
24 (Incremental_object_entry::groups_): New data member.
25 (Incremental_inputs::report_comdat_group): New function.
26 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
27 data for incremental input file entry.
28 (Incremental_input_entry_reader::get_comdat_group_count): New function.
29 (Incremental_input_entry_reader::get_input_section): Adjust size of
30 data for incremental input file entry.
31 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
32 (Incremental_input_entry_reader::get_comdat_group_signature): New
33 function.
34 * object.cc (Sized_relobj::include_section_group): Report kept
35 COMDAT groups for incremental links.
36
1706a06f
ILT
372011-05-24 David Meyer <pdox@google.com>
38
39 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
40 with name parameter. Add found_name parameter.
41 * fileread.cc (Input_file::find_file): Adjust code accordingly.
42 * dirsearch.h (class Dirsearch): Update declaration.
43
a10ae760
ILT
442011-05-24 Ian Lance Taylor <iant@google.com>
45
46 * archive.cc (Library_base::should_include_member): Pull in object
47 from archive if it defines the entry symbol.
48 * parameters.cc (Parameters::entry): New function.
49 * parameters.h (class Parameters): Declare entry.
50 * output.h (class Output_file_header): Remove entry_ field.
51 * output.cc (Output_file_header::Output_file_header): Remove entry
52 parameter. Change all callers.
53 (Output_file_header::entry): Use parameters->entry.
54 * gold.cc (queue_middle_tasks): Likewise.
55 * plugin.cc (Plugin_hook::run): Likewise.
56
aa92d6ed
CC
572011-05-24 Cary Coutant <ccoutant@google.com>
58
59 * gold.cc (queue_initial_tasks): Pass incremental base filename
60 to Output_file::open_base_file; don't print error message.
61 * incremental-dump.cc (main): Adjust call to
62 Output_file::open_for_modification.
63 * incremental-dump.cc (main): Likewise.
64 * incremental.cc (Incremental_inputs::report_command_line):
65 Ignore --incremental-base option when comparing command lines.
66 Ignore parameter when given as separate argument.
67 * options.h (class General_options): Add --incremental-base.
68 * output.cc (Output_file::Output_file):
69 (Output_file::open_base_file): Add base_name and writable parameters;
70 read base file into new file; print error message here.
71 (Output_file::map_no_anonymous): Add writable parameter; adjust all
72 callers.
73 * output.h (Output_file::open_for_modification): Rename to...
74 (Output_file::open_base_file): ...this; add base_name and
75 writable parameters; adjust all callers.
76 (Output_file::map_no_anonymous): Add writable parameter; adjust all
77 callers.
78 * testsuite/Makefile.am (incremental_test_4): Test
79 --incremental-base.
80 * testsuite/Makefile.in: Regenerate.
81
2eedd706
CC
822011-05-24 Cary Coutant <ccoutant@google.com>
83
84 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
85 incremental_test_4.
86 * testsuite/Makefile.in: Regenerate.
87 * testsuite/two_file_test_1_v1.cc: New test source file.
88 * testsuite/two_file_test_1b_v1.cc: New test source file.
89 * testsuite/two_file_test_2_v1.cc: New test source file.
90
0f1c85a6
CC
912011-05-24 Cary Coutant <ccoutant@google.com>
92
93 * dynobj.h (Dynobj::do_dynobj): New function.
94 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
95 flag and soname for shared objects.
96 * incremental.cc (Incremental_inputs::report_object): Make
97 either Incremental_object_entry or Incremental_dynobj_entry; add
98 soname to string table.
99 (Incremental_inputs::report_input_section): Add assertion.
100 (Output_section_incremental_inputs::set_final_data_size): Adjust
101 type of input file entry for shared libraries; adjust size of
102 shared library info entry.
103 (Output_section_incremental_inputs::write_input_files): Write
104 as_needed flag for shared libraries.
105 (Output_section_incremental_inputs::write_info_blocks): Adjust type
106 of input file entry for shared libraries; write soname.
107 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
108 soname from incremental info.
109 * incremental.h (enum Incremental_input_flags): Add
110 INCREMENTAL_INPUT_AS_NEEDED.
111 (Incremental_input_entry::Incremental_input_entry): Initialize new
112 data member.
113 (Incremental_input_entry::set_as_needed): New function.
114 (Incremental_input_entry::as_needed): New function.
115 (Incremental_input_entry::do_dynobj_entry): New function.
116 (Incremental_input_entry::as_needed_): New data member.
117 (Incremental_object_entry::Incremental_object_entry): Don't check
118 for shared library.
119 (Incremental_object_entry::do_type): Likewise.
120 (class Incremental_dynobj_entry): New class.
121 (Incremental_input_entry_reader::as_needed): New function.
122 (Incremental_input_entry_reader::get_soname): New function.
123 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
124 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
125 size of shared library info entry.
126 * layout.cc (Layout::finish_dynamic_section): Don't test for
127 incremental link when adding DT_NEEDED entries.
128 * object.h (Object::Object): Initialize new data member.
129 (Object::dynobj): New function.
130 (Object::set_as_needed): New function.
131 (Object::as_needed): New function.
132 (Object::do_dynobj): New function.
133 (Object::as_needed_): New data member.
134
6fa2a40b
CC
1352011-05-24 Cary Coutant <ccoutant@google.com>
136
137 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
138 info; adjust display of GOT entries.
139 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
140 vector of input objects; remove file_status_.
141 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
142 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
143 got_plt reader; call target hooks to reserve GOT entries.
144 (Output_section_incremental_inputs::set_final_data_size): Adjust size
145 of input file info header and GOT info entry.
146 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
147 relocation info.
148 (Got_plt_view_info::got_descriptor): Remove.
149 (Got_plt_view_info::sym_index): New data member.
150 (Got_plt_view_info::input_index): New data member.
151 (Local_got_offset_visitor::visit): Write input file index.
152 (Global_got_offset_visitor::visit): Write 0 for input file index.
153 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
154 with sym_index and input_index.
155 (Output_section_incremental_inputs::write_got_plt): Adjust size of
156 incremental info GOT entry; replace got_descriptor with input_index.
157 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
158 map from input file index to object.
159 (Sized_relobj_incr::do_layout): Replace direct data member reference
160 with accessor function.
161 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
162 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
163 Adjust size of input file info header.
164 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
165 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
166 (Incremental_input_entry_reader::get_input_section): Adjust size of
167 input file info header.
168 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
169 of incremental info GOT entry.
170 (Incremental_got_plt_reader::get_got_desc): Remove.
171 (Incremental_got_plt_reader::get_got_symndx): New function.
172 (Incremental_got_plt_reader::get_got_input_index): New function.
173 (Sized_incremental_binary::Sized_incremental_binary): Remove
174 file_status_; add input_objects_.
175 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
176 (Sized_incremental_binary::set_file_is_unchanged): Remove.
177 (Sized_incremental_binary::file_is_unchanged): Remove.
178 (Sized_incremental_binary::set_input_object): New function.
179 (Sized_incremental_binary::input_object): New function.
180 (Sized_incremental_binary::file_status_): Remove.
181 (Sized_incremental_binary::input_objects_): New data member.
182 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
183 references.
184 (Sized_relobj_incr::invalid_address): Move to base class.
185 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
186 class.
187 (Sized_relobj_incr::do_output_section_offset): Likewise.
188 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
189 (Sized_relobj_incr::section_offsets_): Likewise.
190 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
191 function.
192 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
193 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
194 with accessor function.
195 (Sized_relobj_file::do_layout): Likewise.
196 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
197 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
198 (Sized_relobj_file::compute_final_local_value): Replace refs to
199 section_offsets_ with accessor function.
200 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
201 * object.h (Relobj::Relobj): Initialize new data members.
202 (Relobj::add_dyn_reloc): New function.
203 (Relobj::first_dyn_reloc): New function.
204 (Relobj::dyn_reloc_count): New function.
205 (Relobj::first_dyn_reloc_): New data member.
206 (Relobj::dyn_reloc_count_): New data member.
207 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
208 references.
209 (Sized_relobj::Address): New typedef.
210 (Sized_relobj::invalid_address): Move here from child class.
211 (Sized_relobj::Sized_relobj): Initialize new data members.
212 (Sized_relobj::sized_relobj): New function.
213 (Sized_relobj::is_output_section_offset_invalid): Move here from
214 child class.
215 (Sized_relobj::get_output_section_offset): Likewise.
216 (Sized_relobj::local_has_got_offset): Likewise.
217 (Sized_relobj::local_got_offset): Likewise.
218 (Sized_relobj::set_local_got_offset): Likewise.
219 (Sized_relobj::do_for_all_local_got_entries): Likewise.
220 (Sized_relobj::clear_got_offsets): New function.
221 (Sized_relobj::section_offsets): Move here from child class.
222 (Sized_relobj::do_output_section_offset): Likewise.
223 (Sized_relobj::do_set_section_offset): Likewise.
224 (Sized_relobj::Local_got_offsets): Likewise.
225 (Sized_relobj::local_got_offsets_): Likewise.
226 (Sized_relobj::section_offsets_): Likewise.
227 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
228 references.
229 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
230 class.
231 (Sized_relobj_file::sized_relobj): New function
232 (Sized_relobj_file::local_has_got_offset): Move to base class.
233 (Sized_relobj_file::local_got_offset): Likewise.
234 (Sized_relobj_file::set_local_got_offset): Likewise.
235 (Sized_relobj_file::get_output_section_offset): Likewise.
236 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
237 (Sized_relobj_file::do_output_section_offset): Likewise.
238 (Sized_relobj_file::do_set_section_offset): Likewise.
239 (Sized_relobj_file::Local_got_offsets): Likewise.
240 (Sized_relobj_file::local_got_offsets_): Likewise.
241 (Sized_relobj_file::section_offsets_): Likewise.
242 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
243 (all constructors).
244 (set_needs_dynsym_index): Convert relobj to derived class pointer.
245 (Output_reloc::get_symbol_index): Likewise.
246 (Output_reloc::local_section_offset): Likewise.
247 (Output_reloc::get_address): Likewise.
248 (Output_reloc::symbol_value): Likewise.
249 (Output_data_got::reserve_slot): Move to class definition.
250 (Output_data_got::reserve_local): New function.
251 (Output_data_got::reserve_slot_for_global): Remove.
252 (Output_data_got::reserve_global): New function.
253 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
254 (all constructors, two instantiations).
255 (Output_reloc::get_relobj): New function (two instantiations).
256 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
257 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
258 (Output_data_reloc::add_global): Adjust type of relobj.
259 (Output_data_reloc::add_global_relative): Likewise.
260 (Output_data_reloc::add_symbolless_global_addend): Likewise.
261 (Output_data_reloc::add_local): Likewise.
262 (Output_data_reloc::add_local_relative): Likewise.
263 (Output_data_reloc::add_symbolless_local_addend): Likewise.
264 (Output_data_reloc::add_local_section): Likewise.
265 (Output_data_reloc::add_output_section): Likewise.
266 (Output_data_reloc::add_absolute): Likewise.
267 (Output_data_reloc::add_target_specific): Likewise.
268 (Output_data_got::reserve_slot): Move definition here.
269 (Output_data_got::reserve_local): New function.
270 (Output_data_got::reserve_global): New function.
271 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
272 section_offsets_ with accessor function.
273 (Sized_relobj_file::write_sections): Likewise.
274 (Sized_relobj_file::do_relocate_sections): Likewise.
275 * target.h (Sized_target::reserve_local_got_entry): New function.
276 (Sized_target::reserve_global_got_entry): New function.
277 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
278 (Target_x86_64::reserve_global_got_entry): New function.
279 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
280
4829d394
CC
2812011-05-23 Cary Coutant <ccoutant@google.com>
282
283 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
284 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
285 bit when checking got_type.
286 * incremental.cc (Sized_incremental_binary::setup_readers):
287 Store symbol table and string table locations; initialize bit vector
288 of file status flags.
289 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
290 unchanged files.
291 (Sized_incremental_binary::do_process_got_plt): New function.
292 (Sized_incremental_binary::get_symtab_view): Use stored locations.
293 (Output_section_incremental_inputs::set_final_data_size): Record
294 file index for each input file.
295 (Output_section_incremental_inputs::write_got_plt): Store file index
296 instead of input entry offset for each GOT entry.
297 * incremental.h
298 (Incremental_input_entry::Incremental_input_entry): Initialize new
299 data member.
300 (Incremental_input_entry::set_offset): Store file index.
301 (Incremental_input_entry::get_file_index): New function.
302 (Incremental_input_entry::file_index_): New data member.
303 (Incremental_binary::process_got_plt): New function.
304 (Incremental_binary::do_process_got_plt): New function.
305 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
306 data members.
307 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
308 (Sized_incremental_binary::set_file_is_unchanged): New function.
309 (Sized_incremental_binary::file_is_unchanged): New function.
310 (Sized_incremental_binary::do_process_got_plt): New function.
311 (Sized_incremental_binary::file_status_): New data member.
312 (Sized_incremental_binary::main_symtab_loc_): New data member.
313 (Sized_incremental_binary::main_strtab_loc_): New data member.
314 * output.cc (Output_data_got::Got_entry::write): Add case
315 RESERVED_CODE.
316 (Output_data_got::add_global): Call add_got_entry.
317 (Output_data_got::add_global_plt): Likewise.
318 (Output_data_got::add_global_with_rel): Likewise.
319 (Output_data_got::add_global_with_rela): Likewise.
320 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
321 (Output_data_got::add_global_pair_with_rela): Likewise.
322 (Output_data_got::add_local): Call add_got_entry.
323 (Output_data_got::add_local_plt): Likewise.
324 (Output_data_got::add_local_with_rel): Likewise.
325 (Output_data_got::add_local_with_rela): Likewise.
326 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
327 (Output_data_got::add_local_pair_with_rela): Likewise.
328 (Output_data_got::reserve_slot): New function.
329 (Output_data_got::reserve_slot_for_global): New function.
330 (Output_data_got::add_got_entry): New function.
331 (Output_data_got::add_got_entry_pair): New function.
332 (Output_section::add_output_section_data): Edit FIXME.
333 * output.h
334 (Output_section_data_build::Output_section_data_build): New
335 constructor with size parameter.
336 (Output_data_space::Output_data_space): Likewise.
337 (Output_data_got::Output_data_got): Initialize new data member; new
338 constructor with size parameter.
339 (Output_data_got::add_constant): Call add_got_entry.
340 (Output_data_got::reserve_slot): New function.
341 (Output_data_got::reserve_slot_for_global): New function.
342 (class Output_data_got::Got_entry): Add RESERVED_CODE.
343 (Output_data_got::add_got_entry): New function.
344 (Output_data_got::add_got_entry_pair): New function.
345 (Output_data_got::free_list_): New data member.
346 * target.h (Sized_target::init_got_plt_for_update): New function.
347 (Sized_target::register_global_plt_entry): New function.
348 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
349 Initialize new data member; call init; add constructor with PLT count.
350 (Output_data_plt_x86_64::init): New function.
351 (Output_data_plt_x86_64::add_relocation): New function.
352 (Output_data_plt_x86_64::reserve_slot): New function.
353 (Output_data_plt_x86_64::free_list_): New data member.
354 (Target_x86_64::init_got_plt_for_update): New function.
355 (Target_x86_64::register_global_plt_entry): New function.
356 (Output_data_plt_x86_64::add_entry): Allocate from free list for
357 incremental updates.
358 (Output_data_plt_x86_64::add_relocation): New function.
359 * testsuite/object_unittest.cc (Object_test): Set default options.
360
ec69d6da
ILT
3612011-05-16 Ian Lance Taylor <iant@google.com>
362
363 * options.h (class General_options): Make -i a synonym for -r.
364
732e31de
ILT
3652011-05-16 Ian Lance Taylor <iant@google.com>
366
367 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
368
403676b5
CC
3692011-05-10 Cary Coutant <ccoutant@google.com>
370
371 * object.cc (Sized_relobj::do_count_local_symbols): Check for
372 strip_all (-s).
373
5b7b7d6e
ILT
3742011-05-06 Ian Lance Taylor <iant@google.com>
375
376 * layout.cc (Layout::layout): If the output section flags change,
377 update the ordering.
378
f0f9babf
CC
3792011-04-25 Cary Coutant <ccoutant@google.com>
380
381 * incremental-dump.cc (dump_incremental_inputs): Print local
382 symbol info for each input file.
383 * incremental.cc
384 (Output_section_incremental_inputs::set_final_data_size): Add local
385 symbol info to input file entries in incremental info.
386 (Output_section_incremental_inputs::write_info_blocks): Likewise.
387 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
388 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
389 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
390 implementation.
391 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
392 (Sized_incr_relobj::do_relocate): Write the local symbols.
393 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
394 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
395 Adjust size of input file header.
396 (Incremental_inputs_reader::get_local_symbol_offset): New function.
397 (Incremental_inputs_reader::get_local_symbol_count): New function.
398 (Incremental_inputs_reader::get_input_section): Adjust size of input
399 file header.
400 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
401 (Sized_incr_relobj::This): New typedef.
402 (Sized_incr_relobj::sym_size): New const data member.
403 (Sized_incr_relobj::Local_symbol): New struct.
404 (Sized_incr_relobj::do_output_local_symbol_count): New function.
405 (Sized_incr_relobj::do_local_symbol_offset): New function.
406 (Sized_incr_relobj::local_symbol_count_): New data member.
407 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
408 (Sized_incr_relobj::local_symbol_index_): New data member.
409 (Sized_incr_relobj::local_symbol_offset_): New data member.
410 (Sized_incr_relobj::local_dynsym_offset_): New data member.
411 (Sized_incr_relobj::local_symbols_): New data member.
412 * object.h (Relobj::output_local_symbol_count): New function.
413 (Relobj::local_symbol_offset): New function.
414 (Relobj::do_output_local_symbol_count): New function.
415 (Relobj::do_local_symbol_offset): New function.
416 (Sized_relobj::do_output_local_symbol_count): New function.
417 (Sized_relobj::do_local_symbol_offset): New function.
418
d0a9ace3
ILT
4192011-04-22 Vladimir Simonov <sv@sw.ru>
420
421 * descriptors.cc (set_close_on_exec): New function.
422 (Descriptors::open): Use set_close_on_exec.
423 * output.cc (S_ISLNK): Define if not defined.
424
94a3fc8b
CC
4252011-04-22 Cary Coutant <ccoutant@google.com>
426
427 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
428 global symbol map.
429 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
430 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
431 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
432 relocations.
433 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
434 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
435 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
436 * incremental.h
437 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
438 function.
439 (Incremental_binary::apply_incremental_relocs): New function.
440 (Incremental_binary::do_apply_incremental_relocs): New function.
441 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
442 data member.
443 (Sized_incremental_binary::add_global_symbol): New function.
444 (Sized_incremental_binary::global_symbol): New function.
445 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
446 (Sized_incremental_binary::symbol_map_): New data member.
447 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
448 * target.h (Sized_target::apply_relocation): New function.
449 * target-reloc.h (apply_relocation): New function.
450 * x86_64.cc (Target_x86_64::apply_relocation): New function.
451
c87e4302
DK
4522011-04-22 Doug Kwan <dougkwan@google.com>
453
454 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
455 flag of a SHT_ARM_EXIDX section.
456 * testsuite/Makefile.am (arm_exidx_test): New test rules.
457 * testsuite/Makefile.in: Regenerate.
458 * testsuite/arm_exidx_test.s: New file.
459 * testsuite/arm_exidx_test.sh: Same.
460
e7782cf6
CC
4612011-04-20 Cary Coutant <ccoutant@google.com>
462
463 PR gold/12689
464 * archive.h (Incremental_archive_entry::Archive_member):
465 Initialize arg_serial_ (second constructor).
466
308ecdc7
ILT
4672011-04-17 Ian Lance Taylor <iant@google.com>
468
469 * object.cc (Relocate_info::location): Simplify location string.
470 * errors.cc (Errors::error_at_location): Don't print program
471 name.
472 (Errors::warning_at_location): Likewise.
473 (Errors::undefined_symbol): Likewise.
474 * testsuite/debug_msg.sh: Update accordingly.
475
bec5b579
CC
4762011-04-14 Cary Coutant <ccoutant@google.com>
477
478 * gold/layout.cc (Layout::symtab_section_offset): New function.
479 * gold/layout.h (Layout::symtab_section_offset): New function.
480 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
481
88597d34
ILT
4822011-04-12 Ian Lance Taylor <iant@google.com>
483
484 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
485 with MREMAP_MAYMOVE.
486 * output.h (class Output_file): Add map_is_allocated_ field.
487 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
488 not available, provide stubs. If mremap is not available, #define
489 it to gold_mremap.
490 (MREMAP_MAYMOVE): Define if not defined.
491 (Output_file::Output_file): Initialize map_is_allocated_.
492 (Output_file::resize): Check map_is_allocated_.
493 (Output_file::map_anonymous): If mmap fails, use malloc.
494 (Output_file::unmap): Don't do anything for an anonymous map.
495 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
496 is not available, provide stubs.
497 (File_read::View::~View): Use free rather than delete[].
498 (File_read::make_view): Use malloc rather than new[]. If mmap
499 fails, use malloc.
500 (File_read::find_or_make_view): Use malloc rather than new[].
501 * gold.h: Remove HAVE_REMAP code.
502 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
503 exists. Rename mremap to gold_mremap. If mmap is not available
504 don't do anything.
505 * configure, config.in: Rebuild.
506
11e361bc
ILT
5072011-04-11 Ian Lance Taylor <iant@google.com>
508
509 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
510 initialize local variable v.
511
cdc29364
CC
5122011-04-11 Cary Coutant <ccoutant@google.com>
513
514 * archive.cc (Archive::include_member): Adjust call to
515 report_object.
516 (Add_archive_symbols::run): Track argument serial numbers.
517 (Lib_group::include_member): Likewise.
518 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
519 * archive.h (Incremental_archive_entry::Archive_member):
520 Initialize arg_serial_.
521 (Archive_member::arg_serial_): New data member.
522 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
523 (Sized_dynobj::do_add_symbols): Track symbols when doing an
524 incremental link.
525 (Sized_dynobj::do_for_all_local_got_entries): New function.
526 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
527 function.
528 * fileread.cc (get_mtime): New function.
529 * fileread.h (get_mtime): New function.
530 * gold.cc (queue_initial_tasks): Check for incremental update.
531 (process_incremental_input): New function.
532 (queue_middle_tasks): Don't force valid target for incremental
533 update.
534 * incremental-dump.cc (find_input_containing_global): Adjust
535 size of symbol info entry.
536 (dump_incremental_inputs): Dump argument serial number and
537 in_system_directory flag; bias shndx by 1; print symbol names
538 when dumping per-file symbol lists; use new symbol info readers.
539 * incremental.cc
540 (Output_section_incremental_inputs:update_data_size): New function.
541 (Sized_incremental_binary::setup_readers): Setup input readers
542 for each input file; build maps for files added from libraries
543 and scripts.
544 (Sized_incremental_binary::check_input_args): New function.
545 (Sized_incremental_binary::do_check_inputs): Build map of argument
546 serial numbers to input arguments.
547 (Sized_incremental_binary::do_file_has_changed): Rename
548 do_file_is_unchanged to this; compare file modification times.
549 (Sized_incremental_binary::do_init_layout): New function.
550 (Sized_incremental_binary::do_reserve_layout): New function.
551 (Sized_incremental_binary::do_get_input_reader): Remove.
552 (Sized_incremental_binary::get_symtab_view): New function.
553 (Incremental_checker::can_incrementally_link_output_file): Remove.
554 (Incremental_inputs::report_command_line): Exclude --debug options.
555 (Incremental_inputs::report_archive_begin): Add parameter; track
556 argument serial numbers; don't put input file entry for archive
557 before archive members.
558 (Incremental_inputs::report_archive_end): Put input file entry
559 for archive after archive members.
560 (Incremental_inputs::report_object): Add parameter; track argument
561 serial numbers and in_system_directory flag.
562 (Incremental_inputs::report_script): Add parameter; track argument
563 serial numbers.
564 (Output_section_incremental_inputs::set_final_data_size): Adjust
565 size of symbol info entry; check for forwarding symbols.
566 (Output_section_incremental_inputs::write_input_files): Write
567 in_system_directory flag and argument serial number.
568 (Output_section_incremental_inputs::write_info_blocks): Map section
569 indices between incremental info and original input file; store
570 input section index for each symbol.
571 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
572 change operator() to visit().
573 (class Global_got_offset_visitor): Likewise.
574 (class Global_symbol_visitor_got_plt):
575 (Output_section_incremental_inputs::write_got_plt): Use new visitor
576 classes.
577 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
578 (Sized_incr_relobj::do_read_symbols): New function.
579 (Sized_incr_relobj::do_layout): New function.
580 (Sized_incr_relobj::do_layout_deferred_sections): New function.
581 (Sized_incr_relobj::do_add_symbols): New function.
582 (Sized_incr_relobj::do_should_include_member): New function.
583 (Sized_incr_relobj::do_for_all_global_symbols): New function.
584 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
585 (Sized_incr_relobj::do_section_size): New function.
586 (Sized_incr_relobj::do_section_name): New function.
587 (Sized_incr_relobj::do_section_contents): New function.
588 (Sized_incr_relobj::do_section_flags): New function.
589 (Sized_incr_relobj::do_section_entsize): New function.
590 (Sized_incr_relobj::do_section_address): New function.
591 (Sized_incr_relobj::do_section_type): New function.
592 (Sized_incr_relobj::do_section_link): New function.
593 (Sized_incr_relobj::do_section_info): New function.
594 (Sized_incr_relobj::do_section_addralign): New function.
595 (Sized_incr_relobj::do_initialize_xindex): New function.
596 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
597 (Sized_incr_relobj::do_read_relocs): New function.
598 (Sized_incr_relobj::do_gc_process_relocs): New function.
599 (Sized_incr_relobj::do_scan_relocs): New function.
600 (Sized_incr_relobj::do_count_local_symbols): New function.
601 (Sized_incr_relobj::do_finalize_local_symbols): New function.
602 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
603 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
604 (Sized_incr_relobj::do_relocate): New function.
605 (Sized_incr_relobj::do_set_section_offset): New function.
606 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
607 (Sized_incr_dynobj::do_read_symbols): New function.
608 (Sized_incr_dynobj::do_layout): New function.
609 (Sized_incr_dynobj::do_add_symbols): New function.
610 (Sized_incr_dynobj::do_should_include_member): New function.
611 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
612 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
613 (Sized_incr_dynobj::do_section_size): New function.
614 (Sized_incr_dynobj::do_section_name): New function.
615 (Sized_incr_dynobj::do_section_contents): New function.
616 (Sized_incr_dynobj::do_section_flags): New function.
617 (Sized_incr_dynobj::do_section_entsize): New function.
618 (Sized_incr_dynobj::do_section_address): New function.
619 (Sized_incr_dynobj::do_section_type): New function.
620 (Sized_incr_dynobj::do_section_link): New function.
621 (Sized_incr_dynobj::do_section_info): New function.
622 (Sized_incr_dynobj::do_section_addralign): New function.
623 (Sized_incr_dynobj::do_initialize_xindex): New function.
624 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
625 (make_sized_incremental_object): New function.
626 (Incremental_library::copy_unused_symbols): New function.
627 (Incremental_library::do_for_all_unused_symbols): New function.
628 * incremental.h (enum Incremental_input_flags): New type.
629 (class Incremental_checker): Remove.
630 (Incremental_input_entry::Incremental_input_entry): Add argument
631 serial number.
632 (Incremental_input_entry::arg_serial): New function.
633 (Incremental_input_entry::set_is_in_system_directory): New function.
634 (Incremental_input_entry::is_in_system_directory): New function.
635 (Incremental_input_entry::arg_serial_): New data member.
636 (Incremental_input_entry::is_in_system_directory_): New data member.
637 (class Script_info): Move here from script.h.
638 (Script_info::Script_info): Add filename parameter.
639 (Script_info::filename): New function.
640 (Script_info::filename_): New data member.
641 (Incremental_script_entry::Incremental_script_entry): Add argument
642 serial number.
643 (Incremental_object_entry::Incremental_object_entry): Likewise.
644 (Incremental_object_entry::add_input_section): Build list of input
645 sections with map to original shndx.
646 (Incremental_object_entry::get_input_section_index): New function.
647 (Incremental_object_entry::shndx_): New data member.
648 (Incremental_object_entry::name_key_): Rename; adjust all refs.
649 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
650 (Incremental_archive_entry::Incremental_archive_entry): Add argument
651 serial number.
652 (Incremental_inputs::report_archive_begin): Likewise.
653 (Incremental_inputs::report_object): Likewise.
654 (Incremental_inputs::report_script): Likewise.
655 (class Incremental_global_symbol_reader): New class.
656 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
657 and store flags and input file type.
658 (Incremental_input_entry_reader::arg_serial): New function.
659 (Incremental_input_entry_reader::type): Extract type from flags.
660 (Incremental_input_entry_reader::is_in_system_directory): New function.
661 (Incremental_input_entry_reader::get_input_section_count): Call
662 accessor function for type.
663 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
664 function for type; adjust size of global symbol entry.
665 (Incremental_input_entry_reader::get_global_symbol_count): Call
666 accessor function for type.
667 (Incremental_input_entry_reader::get_object_count): Likewise.
668 (Incremental_input_entry_reader::get_object_offset): Likewise.
669 (Incremental_input_entry_reader::get_member_count): Likewise.
670 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
671 (Incremental_input_entry_reader::get_member_offset): Likewise.
672 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
673 (Incremental_input_entry_reader::Global_symbol_info): Remove.
674 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
675 (Incremental_input_entry_reader::get_global_symbol_reader): New
676 function.
677 (Incremental_input_entry_reader::get_output_symbol_index): New
678 function.
679 (Incremental_input_entry_reader::type_): Remove.
680 (Incremental_input_entry_reader::flags_): New data member.
681 (Incremental_inputs_reader::input_file_offset): New function.
682 (Incremental_inputs_reader::input_file_index): New function.
683 (Incremental_inputs_reader::input_file): Call input_file_offset.
684 (Incremental_inputs_reader::input_file_at_offset): New function.
685 (Incremental_relocs_reader::get_r_type): Reformat.
686 (Incremental_relocs_reader::get_r_shndx): Reformat.
687 (Incremental_relocs_reader::get_r_offset): Reformat.
688 (Incremental_relocs_reader::data): New function.
689 (Incremental_binary::Incremental_binary): Initialize new data members.
690 (Incremental_binary::check_inputs): Add cmdline parameter.
691 (Incremental_binary::file_is_unchanged): Remove.
692 (Input_reader::arg_serial): New function.
693 (Input_reader::get_unused_symbol_count): New function.
694 (Input_reader::get_unused_symbol): New function.
695 (Input_reader::do_arg_serial): New function.
696 (Input_reader::do_get_unused_symbol_count): New function.
697 (Input_reader::do_get_unused_symbol): New function.
698 (Incremental_binary::input_file_count): New function.
699 (Incremental_binary::get_input_reader): Change signature to use
700 index instead of filename.
701 (Incremental_binary::file_has_changed): New function.
702 (Incremental_binary::get_input_argument): New function.
703 (Incremental_binary::get_library): New function.
704 (Incremental_binary::get_script_info): New function.
705 (Incremental_binary::init_layout): New function.
706 (Incremental_binary::reserve_layout): New function.
707 (Incremental_binary::output_file): New function.
708 (Incremental_binary::do_check_inputs): New function.
709 (Incremental_binary::do_file_is_unchanged): Remove.
710 (Incremental_binary::do_file_has_changed): New function.
711 (Incremental_binary::do_init_layout): New function.
712 (Incremental_binary::do_reserve_layout): New function.
713 (Incremental_binary::do_input_file_count): New function.
714 (Incremental_binary::do_get_input_reader): Change signature.
715 (Incremental_binary::input_args_map_): New data member.
716 (Incremental_binary::library_map_): New data member.
717 (Incremental_binary::script_map_): New data member.
718 (Sized_incremental_binary::Sized_incremental_binary): Initialize
719 new data members.
720 (Sized_incremental_binary::output_section): New function.
721 (Sized_incremental_binary::inputs_reader): Add const.
722 (Sized_incremental_binary::symtab_reader): Add const.
723 (Sized_incremental_binary::relocs_reader): Add const.
724 (Sized_incremental_binary::got_plt_reader): Add const.
725 (Sized_incremental_binary::get_symtab_view): New function.
726 (Sized_incremental_binary::Inputs_reader): New typedef.
727 (Sized_incremental_binary::Input_entry_reader): New typedef.
728 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
729 (Sized_incremental_binary::do_file_is_unchanged): Remove.
730 (Sized_incremental_binary::do_file_has_changed): New function.
731 (Sized_incremental_binary::do_init_layout): New function.
732 (Sized_incremental_binary::do_reserve_layout): New function.
733 (Sized_input_reader::Inputs_reader): Remove.
734 (Sized_input_reader::Input_entry_reader): Remove.
735 (Sized_input_reader::do_arg_serial): New function.
736 (Sized_input_reader::do_get_unused_symbol_count): New function.
737 (Sized_input_reader::do_get_unused_symbol): New function.
738 (Sized_incremental_binary::do_input_file_count): New function.
739 (Sized_incremental_binary::do_get_input_reader): Change signature;
740 use index instead of filename.
741 (Sized_incremental_binary::section_map_): New data member.
742 (Sized_incremental_binary::input_entry_readers_): New data member.
743 (class Sized_incr_relobj): New class.
744 (class Sized_incr_dynobj): New class.
745 (make_sized_incremental_object): New function.
746 (class Incremental_library): New class.
747 * layout.cc (Free_list::num_lists): New static data member.
748 (Free_list::num_nodes): New static data member.
749 (Free_list::num_removes): New static data member.
750 (Free_list::num_remove_visits): New static data member.
751 (Free_list::num_allocates): New static data member.
752 (Free_list::num_allocate_visits): New static data member.
753 (Free_list::init): New function.
754 (Free_list::remove): New function.
755 (Free_list::allocate): New function.
756 (Free_list::dump): New function.
757 (Free_list::print_stats): New function.
758 (Layout_task_runner::run): Resize output file for incremental updates.
759 (Layout::Layout): Initialize new data members.
760 (Layout::set_incremental_base): New function.
761 (Layout::init_fixed_output_section): New function.
762 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
763 incremental updates.
764 (Layout::create_gold_note): Do not create gold note section for
765 incremental updates.
766 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
767 for incremental updates.
768 (Layout::set_section_offsets): For incremental updates, allocate space
769 from free list.
770 (Layout::create_symtab_sections): Layout with offsets relative to
771 start of section; for incremental updates, allocate space from free
772 list.
773 (Layout::create_shdrs): For incremental updates, allocate space from
774 free list.
775 (Layout::finish_dynamic_section): For incremental updates, do not
776 check --as-needed (fixed in subsequent patch).
777 * layout.h (class Free_list): New class.
778 (Layout::set_incremental_base): New function.
779 (Layout::incremental_base): New function.
780 (Layout::init_fixed_output_section): New function.
781 (Layout::allocate): New function.
782 (Layout::incremental_base_): New data member.
783 (Layout::free_list_): New data member.
784 * main.cc (main): Print Free_list statistics.
785 * object.cc (Relobj::finalize_incremental_relocs): Add
786 clear_counts parameter; clear counts only when clear_counts is set.
787 (Sized_relobj::Sized_relobj): Initialize new base class.
788 (Sized_relobj::do_layout): Don't report special sections.
789 (Sized_relobj::do_for_all_local_got_entries): New function.
790 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
791 symtab_off to all symbol table offsets.
792 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
793 * object.h (class Got_offset_list): Move to top of file.
794 (Object::Object): Allow case where input_file == NULL.
795 (Object::~Object): Likewise.
796 (Object::input_file): Assert that input_file != NULL.
797 (Object::lock): Allow case where input_file == NULL.
798 (Object::unlock): Likewise.
799 (Object::is_locked): Likewise.
800 (Object::token): Likewise.
801 (Object::release): Likewise.
802 (Object::is_incremental): New function.
803 (Object::get_mtime): New function.
804 (Object::for_all_local_got_entries): New function.
805 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
806 (Object::set_is_in_system_directory): New function.
807 (Object::is_in_system_directory): New function.
808 (Object::do_is_incremental): New function.
809 (Object::do_get_mtime): New function.
810 (Object::do_for_all_local_got_entries): New function.
811 (Object::is_in_system_directory_): New data member.
812 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
813 (class Sized_relobj_base): New class.
814 (class Sized_relobj): Derive from Sized_relobj_base.
815 (class Sized_relobj::Symbols): Redeclare from base class.
816 (class Sized_relobj::local_got_offset_list): Remove.
817 (class Sized_relobj::Output_sections): Redeclare from base class.
818 (class Sized_relobj::do_for_all_local_got_entries): New function.
819 (class Sized_relobj::write_local_symbols): Add offset parameter.
820 (class Sized_relobj::local_symbol_offset_): Update comment.
821 (class Sized_relobj::local_dynsym_offset_): Update comment.
822 * options.cc (Input_arguments::add_file): Remove const.
823 * options.h (Input_file_argument::Input_file_argument):
824 Initialize arg_serial_ (all constructors).
825 (Input_file_argument::set_arg_serial): New function.
826 (Input_file_argument::arg_serial): New function.
827 (Input_file_argument::arg_serial_): New data member.
828 (Input_arguments::Input_arguments): Initialize file_count_.
829 (Input_arguments::add_file): Remove const.
830 (Input_arguments::number_of_input_files): New function.
831 (Input_arguments::file_count_): New data member.
832 (Command_line::number_of_input_files): Call
833 Input_arguments::number_of_input_files.
834 * output.cc (Output_segment_headers::Output_segment_headers):
835 Set current size.
836 (Output_section::Input_section::current_data_size): New function.
837 (Output_section::Output_section): Initialize new data members.
838 (Output_section::add_input_section): Don't do merge sections for
839 an incremental link; allocate space from free list for an
840 incremental update.
841 (Output_section::add_output_section_data): Allocate space from
842 free list for an incremental update.
843 (Output_section::update_data_size): New function.
844 (Output_section::set_fixed_layout): New function.
845 (Output_section::reserve): New function.
846 (Output_segment::set_section_addresses): Remove const.
847 (Output_segment::set_section_list_addresses): Remove const; allocate
848 space from free list for an incremental update.
849 (Output_segment::set_offset): Adjust size of RELRO segment for an
850 incremental update.
851 * output.h (Output_data::current_data_size): Move here from
852 child classes.
853 (Output_data::pre_finalize_data_size): New function.
854 (Output_data::update_data_size): New function.
855 (Output_section_headers::update_data_size): new function.
856 (Output_section_data_build::current_data_size): Move to Output_data.
857 (Output_data_strtab::update_data_size): New function.
858 (Output_section::current_data_size): Move to Output_data.
859 (Output_section::set_fixed_layout): New function.
860 (Output_section::has_fixed_layout): New function.
861 (Output_section::reserve): New function.
862 (Output_section::update_data_size): New function.
863 (Output_section::has_fixed_layout_): New data member.
864 (Output_section::free_list_): New data member.
865 (Output_segment::set_section_addresses): Remove const.
866 (Output_segment::set_section_list_addresses): Remove const.
867 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
868 New function.
869 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
870 New function.
871 * readsyms.cc (Read_symbols::do_read_symbols): Add library
872 parameter when calling Add_symbols constructor; store argument
873 serial number for members of a lib group.
874 (Add_symbols::locks): Allow case where token == NULL.
875 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
876 (Read_member::~Read_member): New function.
877 (Read_member::is_runnable): New function.
878 (Read_member::locks): New function.
879 (Read_member::run): New function.
880 (Check_script::~Check_script): New function.
881 (Check_script::is_runnable): New function.
882 (Check_script::locks): New function.
883 (Check_script::run): New function.
884 (Check_library::~Check_library): New function.
885 (Check_library::is_runnable): New function.
886 (Check_library::locks): New function.
887 (Check_library::run): New function.
888 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
889 (Add_symbols::library_): New data member.
890 (class Read_member): New class.
891 (class Check_script): New class.
892 (class Check_library): New class.
893 * reloc.cc (Read_relocs::is_runnable): Allow case where
894 token == NULL.
895 (Read_relocs::locks): Likewise.
896 (Scan_relocs::locks): Likewise.
897 (Relocate_task::locks): Likewise.
898 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
899 to clear counters.
900 (Sized_relobj::incremental_relocs_scan): Fix comment.
901 (Sized_relobj::do_relocate): Pass output file offset to
902 write_local_symbols.
903 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
904 from class declaration.
905 * script.cc (read_input_script): Allocate Script_info; pass
906 argument serial number to report_script.
907 * script.h (class Script_info): Move to incremental.h.
908 * symtab.cc (Symbol_table::add_from_incrobj): New function.
909 * symtab.h (Symbol_table::add_from_incrobj): New function.
910 (Symbol_table::set_file_offset): New function.
911
b961d0d7
CC
9122011-04-05 Cary Coutant <ccoutant@google.com>
913
914 * incremental-dump.cc (dump_incremental_inputs): Change signature
915 to take a Sized_incremental_binary; change caller. Use readers
916 in Sized_incremental_binary.
917 * incremental.cc
918 (Sized_incremental_binary::find_incremental_inputs_sections):
919 Rename do_find_incremental_inputs_sections to this.
920 (Sized_incremental_binary::setup_readers): New function.
921 (Sized_incremental_binary::do_check_inputs): Check
922 has_incremental_info_ flag; move setup code to setup_readers;
923 use input readers.
924 (Sized_incremental_binary::do_file_is_unchanged): New function.
925 (Sized_incremental_binary::do_get_input_reader): New function.
926 * incremental.h (class Incremental_binary): Move to end of file.
927 (Incremental_binary::file_is_unchanged): New function.
928 (Incremental_binary::do_file_is_unchanged): New function.
929 (Incremental_binary::Input_reader): New class.
930 (Incremental_binary::get_input_reader): New function.
931 (class Sized_incremental_binary): Move to end of file.
932 (Sized_incremental_binary::Sized_incremental_binary): Setup the
933 input section reader classes.
934 (Sized_incremental_binary::has_incremental_info): New function.
935 (Sized_incremental_binary::inputs_reader): New function.
936 (Sized_incremental_binary::symtab_reader): New function.
937 (Sized_incremental_binary::relocs_reader): New function.
938 (Sized_incremental_binary::got_plt_reader): New function.
939 (Sized_incremental_binary::do_file_is_unchanged): New function.
940 (Sized_incremental_binary::Sized_input_reader): New class.
941 (Sized_incremental_binary::get_input_reader): New function.
942 (Sized_incremental_binary::find_incremental_inputs_sections):
943 Rename do_find_incremental_inputs_sections to this.
944 (Sized_incremental_binary::setup_readers): New function.
945 (Sized_incremental_binary::has_incremental_info_): New data member.
946 (Sized_incremental_binary::inputs_reader_): New data member.
947 (Sized_incremental_binary::symtab_reader_): New data member.
948 (Sized_incremental_binary::relocs_reader_): New data member.
949 (Sized_incremental_binary::got_plt_reader_): New data member.
950 (Sized_incremental_binary::current_input_file_): New data member.
951
a869183f
PP
9522011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
953
954 PR gold/12640
955 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
956 violation.
957
9582011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
959
960 * archive.cc (Archive::include_member): Adjust call to report_object.
961 (Add_archive_symbols::run): Add script_info to call to
962 report_archive_begin.
963 (Lib_group::include_member): Adjust call to report_object.
964 (Add_lib_group_symbols::run): Adjust call to report_object.
965 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
966 blocks. Add object count for script input files.
967 * incremental.cc (Incremental_inputs::report_archive_begin): Add
968 script_info parameter; change all callers.
969 (Incremental_inputs::report_object): Add script_info parameter;
970 change all callers.
971 (Incremental_inputs::report_script): Store backpointer to
972 incremental info entry.
973 (Output_section_incremental_inputs::set_final_data_size): Record
974 additional information for scripts.
975 (Output_section_incremental_inputs::write_info_blocks): Likewise.
976 * incremental.h (Incremental_script_entry::add_object): New function.
977 (Incremental_script_entry::get_object_count): New function.
978 (Incremental_script_entry::get_object): New function.
979 (Incremental_script_entry::objects_): New data member; adjust
980 constructor.
981 (Incremental_inputs::report_archive_begin): Add script_info parameter.
982 (Incremental_inputs::report_object): Add script_info parameter.
983 (Incremental_inputs_reader::get_object_count): New function.
984 (Incremental_inputs_reader::get_object_offset): New function.
985 * options.cc (Input_arguments::add_file): Return reference to
986 new input argument.
987 * options.h (Input_argument::set_script_info): New function.
988 (Input_argument::script_info): New function.
989 (Input_argument::script_info_): New data member; adjust all
990 constructors.
991 (Input_file_group::add_file): Return reference to new input argument.
992 (Input_file_lib::add_file): Likewise.
993 (Input_arguments::add_file): Likewise.
994 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
995 * script.cc (Parser_closure::Parser_closure): Add script_info
996 parameter; adjust all callers.
997 (Parser_closure::script_info): New function.
998 (Parser_closure::script_info_): New data member.
999 (read_input_script): Report scripts earlier to incremental info.
1000 (script_add_file): Set script_info in Input_argument.
1001 (script_add_library): Likewise.
1002 * script.h (Script_options::Script_info): Rewrite class.
1003
a869183f 10042011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
1005
1006 * archive.cc (Library_base::should_include_member): Move
1007 method here from class Archive.
1008 (Archive::Archive): Initialize base class.
1009 (Archive::should_include_member): Move to base class.
1010 (Archive::do_for_all_unused_symbols): New function.
1011 (Add_archive_symbols::run): Remove redundant access to
1012 incremental_inputs.
1013 (Lib_group::Lib_group): Initialize base class.
1014 (Lib_group::do_filename): New function.
1015 (Lib_group::include_member): Pass pointer to Lib_group to
1016 report_object.
1017 (Lib_group::do_for_all_unused_symbols): New function.
1018 (Add_lib_group_symbols::run): Report archive information for
1019 incremental links.
1020 * archive.h (class Library_base): New base class.
1021 (class Archive): Derive from Library_base.
1022 (Archive::filename): Move to base class.
1023 (Archive::set_incremental_info): Likewise.
1024 (Archive::incremental_info): Likewise.
1025 (Archive::Should_include): Likewise.
1026 (Archive::should_include_member): Likewise.
1027 (Archive::Armap_entry): Remove.
1028 (Archive::Unused_symbol_iterator): Remove.
1029 (Archive::unused_symbols_begin): Remove.
1030 (Archive::unused_symbols_end): Remove.
1031 (Archive::do_filename): New function.
1032 (Archive::do_get_mtime): New function.
1033 (Archive::do_for_all_unused_symbols): New function.
1034 (Archive::task_): Move to base class.
1035 (Archive::incremental_info_): Likewise.
1036 (class Lib_group): Derive from Library_base.
1037 (Lib_group::do_filename): New function.
1038 (Lib_group::do_get_mtime): New function.
1039 (Lib_group::do_for_all_unused_symbols): New function.
1040 (Lib_group::task_): Move to base class.
1041 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1042 function.
1043 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1044 function.
1045 * incremental.cc (Incremental_inputs::report_archive_begin):
1046 Use Library_base; call library's get_mtime; add incremental inputs
1047 entry before members.
1048 (class Unused_symbol_visitor): New class.
1049 (Incremental_inputs::report_archive_end): Use Library_base; use
1050 visitor class to record unused symbols; don't add incremental inputs
1051 entry after members.
1052 (Incremental_inputs::report_object): Use Library_base.
1053 * incremental.h
1054 (Incremental_archive_entry::Incremental_archive_entry): Remove
1055 unused Archive parameter.
1056 (Incremental_inputs::report_archive_begin): Use Library_base.
1057 (Incremental_inputs::report_archive_end): Likewise.
1058 (Incremental_inputs::report_object): Likewise.
1059 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1060 function.
1061 * object.h (Object::for_all_global_symbols): New function.
1062 (Object::do_for_all_global_symbols): New function.
1063 (Sized_relobj::do_for_all_global_symbols): New function.
1064 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1065 function.
1066 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1067 function.
1068
61ab3e40
ILT
10692011-03-27 Ian Lance Taylor <iant@google.com>
1070
1071 * archive.cc (Archive::interpret_header): Return -1 if something
1072 goes wrong. Change callers accordingly.
1073
30e1f9e6
CC
10742011-03-25 Cary Coutant <ccoutant@google.com>
1075
1076 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1077 * testsuite/Makefile.in: Regenerate.
1078
9c793f14
RÁE
10792010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1080
1081 * plugin.cc (get_view): New.
1082 (Plugin::load): Pass get_view to the plugin.
1083 (Plugin_manager::get_view): New.
1084
9312bb0a
ILT
10852011-03-21 Ian Lance Taylor <iant@google.com>
1086
1087 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1088 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1089
7e12ba9e
ST
10902011-03-21 Sriraman Tallam <tmsriram@google.com>
1091
1092 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1093 Change == to -eq.
1094 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1095 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1096 Change == to -eq.
1097 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1098 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1099
fd7a005d
ILT
11002011-03-14 Ian Lance Taylor <iant@google.com>
1101
1102 * script-sections.cc (Sort_output_sections::script_compare):
1103 Rename from is_before, change return type.
1104 (Sort_output_sections::operator()): Adjust accordingly.
1105
ed16fd1b
ILT
11062011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1107
1108 PR gold/12572
1109 * testsuite/odr_violation2.cc: Add comment to make all error line
1110 numbers double digits.
1111 * testsuite/debug_msg.sh: Adjust expected errors.
1112
71ff8986
ILT
11132011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1114
1115 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1116 but mark earlier ones as non-canonical
1117 (offset_to_iterator): Update search target and example
1118 (do_addr2line): Return extra lines in a vector*
1119 (format_file_lineno): Extract from do_addr2line
1120 (one_addr2line): Add vector* out-param
1121 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1122 when a lineno entry appeared last for its instruction
1123 (Dwarf_line_info): Add vector* out-param
1124 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1125 * symtab.cc (Odr_violation_compare): Include the lineno in the
1126 comparison again.
1127 (linenos_from_loc): New. Combine the canonical line for an
1128 address with its other lines.
1129 (True_if_intersect): New. Helper functor to make
1130 std::set_intersection a query.
1131 (detect_odr_violations): Compare sets of lines instead of just
1132 one line for each function. This became less deterministic, but
1133 has fewer false positives.
1134 * symtab.h: Declarations.
1135 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1136 mix an optimized and non-optimized object in the same binary
1137 (odr_violation2.so): Same.
1138 * testsuite/Makefile.in: Regenerate from Makefile.am.
1139 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1140 * testsuite/debug_msg.sh: Update line numbers and add
1141 assertions.
1142 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1143 non-optimized context.
1144 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1145 isn't inlined, and use OdrDerived in an optimized context.
1146 * testsuite/odr_header1.h: Defines OdrDerived, where
1147 optimization will change the
1148 first-instruction-in-the-destructor's file and line number.
1149 * testsuite/odr_header2.h: Defines OdrBase.
1150
a19fefdc
ILT
11512011-03-09 Ian Lance Taylor <iant@google.com>
1152
1153 * fileread.cc (File_read::clear_views): Don't delete the whole
1154 file view.
1155
ecb351e9
ILT
11562011-03-08 Ian Lance Taylor <iant@google.com>
1157
1158 PR gold/12525
1159 * fileread.cc: #include <climits>.
1160 (GOLD_IOV_MAX): Define.
1161 (File_read::read_multiple): Limit number of entries by iov_max.
1162 * fileread.h (class File_read): Always set max_readv_entries to
1163 128.
1164
b821d13c
ILT
11652011-03-07 Ian Lance Taylor <iant@google.com>
1166
1167 PR gold/12525
1168 * options.h (class General_options): Add -dy and -dn.
1169
89243142
CC
11702011-03-02 Cary Coutant <ccoutant@google.com>
1171
1172 * testsuite/script_test_9.t: Add TLS segment.
1173
d0773f31
ILT
11742011-03-02 Simon Baldwin <simonb@google.com>
1175
1176 * configure.ac: Add check for gnu_indirect_function support in
1177 the toolchain building binutils.
1178 * configure: Rebuild.
1179
badc8139
RÁE
11802010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1181
1182 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1183 plugin only symbols.
1184 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1185 in plugin files as not needed in the symbol table.
1186
4cf7a849
ST
11872011-02-11 Sriraman Tallam <tmsriram@google.com>
1188
1189 * output.cc (Output_section::add_input_section): Delay fill
1190 generation for section ordering.
1191
b578bd7d
ILT
11922011-02-09 Ian Lance Taylor <iant@google.com>
1193
1194 PR gold/12316
1195 * object.h (class Sized_relobj): Remove clear_local_symbols.
1196 * reloc.cc (Sized_relobj::do_relocate): Don't call
1197 clear_local_symbols.
1198
84ced98a
RÁE
11992010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1200
1201 * plugin.cc (is_visible_from_outside): Return true for symbols
1202 in the -u option.
1203
55382fb7
ILT
12042011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1205
1206 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1207 filename.
1208
4e271fff
ST
12092011-02-02 Sriraman Tallam <tmsriram@google.com>
1210
1211 * icf.h (is_section_foldable_candidate): Change type of parameter
1212 to std::string.
1213 * icf.cc (Icf::find_identical_sections): Change type of local variable
1214 section_name to be std::string.
1215 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1216
d433c3ac
ILT
12172011-01-25 Ian Lance Taylor <iant@google.com>
1218
1219 * script.cc (script_add_extern): Rewrite to use
1220 add_symbol_reference.
1221
880473a6
DK
12222011-01-25 Doug Kwan <dougkwan@google.com>
1223
d433c3ac 1224 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1225
f30f86fa
ILT
12262011-01-24 Ian Lance Taylor <iant@google.com>
1227
1228 * options.h (class General_options): Accept
1229 --no-detect-odr-violations.
1230
8e51a0b9
ILT
12312011-01-24 Ian Lance Taylor <iant@google.com>
1232
1233 * version.cc (version_string): Bump to 1.11.
1234
0f3b89d8
ILT
12352011-01-24 Ian Lance Taylor <iant@google.com>
1236
1237 * plugin.cc (class Plugin_rescan): Define new class.
1238 (Plugin_manager::claim_file): Set any_claimed_.
1239 (Plugin_manager::save_archive): New function.
1240 (Plugin_manager::save_input_group): New function.
1241 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1242 necessary.
1243 (Plugin_manager::new_undefined_symbol): New function.
1244 (Plugin_manager::rescan): New function.
1245 (Plugin_manager::rescannable_defines): New function.
1246 (Plugin_manager::add_input_file): Set any_added_.
1247 * plugin.h (class Plugin_manager): define new fields rescannable_,
1248 undefined_symbols_, any_claimed_, and any_added_. Declare
1249 Plugin_rescan as friend. Declare new functions.
1250 (Plugin_manager::Rescannable): Define type.
1251 (Plugin_manager::Rescannable_list): Define type.
1252 (Plugin_manager::Undefined_symbol_list): Define type.
1253 (Plugin_manager::Plugin_manager): Initialize new fields.
1254 * archive.cc (Archive::defines_symbol): New function.
1255 (Add_archive_symbols::run): Pass archive to plugins if any.
1256 * archive.h (class Archive): Declare defines_symbol.
1257 * readsyms.cc (Input_group::~Input_group): New function.
1258 (Finish_group::run): Pass input_group to plugins if any.
1259 * readsyms.h (class Input_group): Declare destructor.
1260 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1261 any.
1262
3bb951e5
ILT
12632011-01-10 Ian Lance Taylor <iant@google.com>
1264
1265 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1266 section as relro.
1267 (Layout::set_segment_offsets): Reset increase_relro before calling
1268 set_section_addresses a second time.
1269
0aa45fac
CC
12702011-01-04 Cary Coutant <ccoutant@google.com>
1271
1272 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1273 sections before NOBITS sections.
1274
0db46eb4
L
12752011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1276
1277 * version.cc (print_version): Update copyright to 2011.
1278
829c9745
CC
12792010-12-23 Cary Coutant <ccoutant@google.com>
1280
1281 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1282 of OS to this->add. Add OD parameter to second form of the function.
1283
7500420b
ILT
12842010-12-20 Ian Lance Taylor <iant@google.com>
1285
1286 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1287 second of two consecutive entries with same offset.
1288
f8e9a930
RW
12892010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1290
1291 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1292 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1293 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1294 to avoid unneeded links against $(LDADD).
1295 * testsuite/Makefile.in: Regenerate.
1296
2fbb4320
ILT
12972010-12-15 Ian Lance Taylor <iant@google.com>
1298
1299 PR gold/12324
1300 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1301 for R_X86_64_32 and R_X86_64_PC32.
1302 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1303 ver_matching_def_pic.o.
1304 (ver_matching_def_pic.o): New target.
1305
fedb228d
RW
13062010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1307
1308 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1309 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1310 Move definition before File_read::View member definitions.
1311 (File_read::View::~View): Initialize and hold lock before
1312 updating current_mapped_bytes.
1313
9b547ce6
RW
13142010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1315
1316 * dwarf_reader.cc: Remove outdated comment.
1317 * gold-threads.cc: Fix typo in error message.
1318 * archive.cc: Fix typos in comments.
1319 * archive.h: Likewise.
1320 * arm-reloc-property.cc: Likewise.
1321 * arm-reloc-property.h: Likewise.
1322 * arm-reloc.def: Likewise.
1323 * arm.cc: Likewise.
1324 * attributes.h: Likewise.
1325 * cref.cc: Likewise.
1326 * ehframe.cc: Likewise.
1327 * fileread.h: Likewise.
1328 * gold.h: Likewise.
1329 * i386.cc: Likewise.
1330 * icf.cc: Likewise.
1331 * incremental.h: Likewise.
1332 * int_encoding.cc: Likewise.
1333 * layout.h: Likewise.
1334 * main.cc: Likewise.
1335 * merge.h: Likewise.
1336 * object.cc: Likewise.
1337 * object.h: Likewise.
1338 * options.cc: Likewise.
1339 * readsyms.cc: Likewise.
1340 * reduced_debug_output.cc: Likewise.
1341 * reloc.cc: Likewise.
1342 * script-sections.cc: Likewise.
1343 * sparc.cc: Likewise.
1344 * symtab.h: Likewise.
1345 * target-reloc.h: Likewise.
1346 * target.cc: Likewise.
1347 * target.h: Likewise.
1348 * timer.cc: Likewise.
1349 * timer.h: Likewise.
1350 * x86_64.cc: Likewise.
1351
83e17bd5
CC
13522010-12-09 Cary Coutant <ccoutant@google.com>
1353
1354 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1355 stack.
1356 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1357 parameter; change all callers.
1358 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1359 * options.h (warn_execstack): New option.
1360
017257f8
DK
13612010-12-07 Doug Kwan <dougkwan@google.com>
1362
1363 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1364 like function call relocations.
1365
c20cbc06
ILT
13662010-12-07 Ian Lance Taylor <iant@google.com>
1367
1368 * archive.cc (Archive::get_elf_object_for_member): Permit
1369 punconfigured to be NULL.
1370 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1371 (Archive::include_member): Pass NULL to get_elf_object_for_member
1372 if we searched for the archive and this is the first included
1373 object.
1374
4dbfafcc
ILT
13752010-12-01 Ian Lance Taylor <iant@google.com>
1376
1377 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1378 track_relocs_type_ field.
1379 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1380 Set track_relocs_type_.
1381 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1382 contents when using RELA relocs.
1383 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1384 reloc_map_.
1385 * reloc.cc (Track_relocs::next_addend): New function.
1386 * reloc.h (class Track_relocs): Declare next_addend.
1387
e5e19edd
ILT
13882010-12-01 Ian Lance Taylor <iant@google.com>
1389
1390 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1391 virtual destructor.
1392
9a5ce24c
ILT
13932010-12-01 Ian Lance Taylor <iant@google.com>
1394
1395 * README: Update compilers known to work and fail.
1396
c7791212
NC
13972010-11-23 Matthias Klose <doko@ubuntu.com>
1398
1399 * configure.in: For --enable-gold, handle value `default' instead of
1400 `both*'. Always install ld as ld.bfd, install as ld if gold is
1401 not the default.
1402 * configure: Regenerate.
1403
0ad220c9
DK
14042010-11-18 Doug Kwan <dougkwan@google.com>
1405
1406 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1407 and right_alignment to be zero. Store result alignment only if it is
1408 greater than existing alignment.
1409
ab8056e0
CC
14102010-11-16 Cary Coutant <ccoutant@google.com>
1411
1412 PR gold/12220
1413 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1414 Check for ".zdebug_line".
1415
fd064a5b
CC
14162010-11-16 Doug Kwan <dougkwan@google.com>
1417 Cary Coutant <ccoutant@google.com>
1418
1419 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1420 by reference; adjust all callers.
1421 * output.cc (Output_segment::set_section_addresses): Adjust references
1422 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1423 list is empty.
1424 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1425 end at page boundary.
1426
6fc6ea19
CC
14272010-11-16 Cary Coutant <ccoutant@google.com>
1428
1429 PR gold/12220
1430 * layout.cc (Layout::choose_output_section): Transform names of
1431 compressed sections even when using a script with a SECTIONS clause.
1432 (Layout::output_section_name): Remove code to transform
1433 compressed debug section names.
1434 * output.cc (Output_section::add_input_section): Use uncompressed
1435 section size when tracking input sections.
1436
95a2c8d6
RS
14372010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1438
1439 * symtab.h (Symbol::NON_PIC_REF): Remove.
1440 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1441 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1442 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1443 (Symbol::use_plt_offset): Take a flags argument and pass it
1444 directly to needs_dynamic_reloc. Restrict check for undefined
1445 weak symbols to function calls.
1446 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1447 (Target_arm::Scan::global): Use it.
1448 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1449 (Target_arm::Relocate::relocate): Likewise.
1450 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1451 parameter with an r_type parameter. Use get_reference_flags
1452 to get the flags.
1453 (Target_arm::Relocate::relocate): Update accordingly.
1454 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1455 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1456 (Target_i386::Scan::global): Likewise.
1457 (Target_i386::Relocate::relocate): Likewise.
1458 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1459 parameter with an r_type parameter. Use get_reference_flags
1460 to get the flags.
1461 (Target_i386::Relocate::relocate): Update accordingly.
1462 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1463 (Target_powerpc::Scan::global): Use it.
1464 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1465 (Target_powerpc::Relocate::relocate): Likewise.
1466 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1467 (Target_sparc::Scan::global): Use it.
1468 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1469 (Target_sparc::Relocate::relocate): Likewise.
1470 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1471 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1472 (Target_x86_64::Scan::global): Likewise.
1473 (Target_x86_64::Relocate::relocate): Likewise.
1474
f625ae50
DK
14752010-11-08 Doug Kwan <dougkwan@google.com>
1476 Cary Coutant <ccoutant@google.com>
1477
1478 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1479 (Arm_exidx_merge_section::section_contents_): New data member.
1480 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1481 (Arm_input_section::~Arm_input_section): De-allocate memory.
1482 (Arm_input_section::original_contents_): New data member.
1483 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1484 in parameters instead of calling Object::section_contents without
1485 locking.
1486 (Arm_output_section::group_section): New parameter TASK. Pass it
1487 to callees that need locking objects.
1488 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1489 to lock EXIDX input sections. Fix a formatting issue. Call
1490 Arm_exidx_merged_section::build_contents to create merged section
1491 contents.
1492 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1493 to lock object of stub table owner.
1494 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1495 TEXT_SIZE to initialize data member TEXT_SIZE_.
1496 (Arm_exidx_input_section::addralign): Fix typo in comment.
1497 (Arm_exidx_input_section::text_size): New method.
1498 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1499 that require locking objects. Lock objects before scanning for stubs
1500 and updating local symbols.
1501 (Arm_input_section<big_endian>::init): Copy contents of original
1502 input section.
1503 (Arm_input_section<big_endian>::do_write): Use saved contents of
1504 original input section instead of calling Object::section_contents
1505 without locking.
1506 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1507 size without calling Object::section_size().
1508 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1509 for size. Allocate a buffer for merged EXIDX entries.
1510 (Arm_exidx_merged_section::build_contents): New method.
1511 (Arm_exidx_merged_section::do_write): Move merge section contents
1512 building code to Arm_exidx_merged_section::build_contetns. Write
1513 out contetns in buffer instead of building it on the fly.
1514 (Arm_relobj::make_exidx_input_section): Also pass text section size
1515 to Arm_exidx_input_section constructor.
1516 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1517 (Arm_dynobj::do_read_symbols): Fix memory leak.
1518 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1519 * target.h: (class Task): Add forward declaration.
1520 (Target::relax): Add new parameter TASK and pass it to
1521 Target::do_relax().
1522 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1523
5f9bcf58
CC
15242010-11-05 Cary Coutant <ccoutant@google.com>
1525
1526 PR gold/10708
1527 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1528 object when reading from the file.
1529 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1530 second layout pass.
1531 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1532 when reading section contents.
1533 (get_section_contents): Likewise.
1534 (icf::find_identical_sections): Likewise.
1535 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1536 object when reading from the file.
1537 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1538 the object when doing deferred section layout.
1539
e597fa08
NC
15402010-11-03 Nick Clifton <nickc@redhat.com>
1541
1542 PR gold/12001
1543 * script.h (class Symbol_assignment: name): New member. Returns
1544 the name of the symbol.
1545 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1546 Returns true if the given symbol name is on the list of
1547 assignments wating to be processed.
1548 * archive.cc (should_incldue_member): If the symbol is undefined,
1549 check to see if it is on the list of symbols pending assignment.
1550
3f9a3278
ILT
15512010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1552
1553 * script-sections.cc (Script_sections::find_memory_region): Check
1554 for a NULL output section pointer.
1555
d06fb4d1
DK
15562010-10-29 Doug Kwan <dougkwan@google.com>
1557
1558 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1559 Output_section::add_relaxed_input_section.
1560 * output.cc (Output_section::add_relaxed_input_section): Add new
1561 arguments LAYOUT and NAME. Set section order index.
1562 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1563 Copy section order index.
1564 * output.h (Output_section::add_relaxed_input_section): Add new
1565 arguments LAYOUT and NAME.
1566
90e24de5
ILT
15672010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1568
1569 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1570 NATIVE_OR_CROSS_LINKER.
1571 * testsuite/Makefile.in: Regenerate.
1572
c9484ea5
DK
15732010-10-20 Doug Kwan <dougkwan@google.com>
1574
1575 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1576 without SHF_LINK_ORDER flags.
1577 * layout.cc (Layout::choose_output_section): Do not filter
1578 SHF_LINK_ORDER flag in a relocatable link.
1579
5bc2f5be
CC
15802010-10-17 Cary Coutant <ccoutant@google.com>
1581
1582 * output.h (Output_segment::set_section_addresses): Change function
1583 signature. Update all callers.
1584 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1585 sections.
1586 (Output_segment::set_section_addresses): Align after last TLS
1587 section. Add padding before last relro section instead of after.
1588
0c91cf04
DK
15892010-10-17 Doug Kwan <dougkwan@google.com>
1590
1591 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1592 GOT output section to be writable.
1593
8c21d9d3
CC
15942010-10-14 Cary Coutant <ccoutant@google.com>
1595
1596 * debug.h (DEBUG_INCREMENTAL): New flag.
1597 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1598 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1599 mode.
1600 * incremental.cc (report_command_line): Ignore all forms of
1601 --incremental.
1602 * layout.cc (Layout::Layout): Check parameters for incremental link
1603 mode.
1604 * options.cc (General_options::parse_incremental): New function.
1605 (General_options::parse_no_incremental): New function.
1606 (General_options::parse_incremental_full): New function.
1607 (General_options::parse_incremental_update): New function.
1608 (General_options::incremental_mode_): New data member.
1609 (General_options::finalize): Check incremental_mode_.
1610 * options.h (General_options): Update help text for --incremental.
1611 Add --no-incremental, --incremental-full, --incremental-update.
1612 (General_options::Incremental_mode): New enum type.
1613 (General_options::incremental_mode): New function.
1614 (General_options::incremental_mode_): New data member.
1615 * parameters.cc (Parameters::incremental_mode_): New data member.
1616 (Parameters::set_options): Set incremental_mode_.
1617 (Parameters::set_incremental_full): New function.
1618 (Parameters::incremental): New function.
1619 (Parameters::incremental_update): New function.
1620 (set_parameters_incremental_full): New function.
1621 * parameters.h (Parameters::set_incremental_full): New function.
1622 (Parameters::incremental): New function.
1623 (Parameters::incremental_update): New function.
1624 (Parameters::incremental_mode_): New data member.
1625 (set_parameters_incremental_full): New function.
1626 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1627 incremental link mode.
1628 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1629 (Sized_relobj::do_relocate_sections): Likewise.
1630 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1631 option.
1632 * testsuite/Makefile.in: Regenerate.
1633 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1634
bb32aa18 16352010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1636
1637 * script-sections.h (class Script_sections): Make
1638 Sections_elements typedef public.
1639 * script-sections.cc (class Sort_output_sections): Add elements_
1640 field. Add constructor which sets it; change all callers.
1641 (Sort_output_sections::is_before): New function.
1642 (Sort_output_sections::operator()): Call is_before.
1643 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1644 conditional.
1645 * testsuite/script_test_10.sh: New test. Test script section
1646 order.
1647 * testsuite/script_test_10.t: Likewise.
1648 * testsuite/script_test_10.s: Likewise.
1649 * testsuite/Makefile.am: Wrap the cross linker tests and the
1650 common tests into NATIVE_OR_CROSS_LINKER.
1651 (check_SCRIPTS): Add script_test_10.sh.
1652 (check_DATA): Add script_test_10.stdout.
1653 (script_test_10.o, script_test_10): New targets.
1654 (script_test_10.stdout): New target.
1655 * configure, testsuite/Makefile.in: Regenerate.
1656
3cef7179
ILT
16572010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1658
1659 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
1660 error for the deprecated relocations.
1661 (Target_arm::Scan::global): Likewise.
1662 (Target_arm::Relocate::relocate): Likewise.
1663
7411e9a8
RS
16642010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
1665
1666 * fileread.cc (Input_file::find_file): Initialize *found_name
1667 and *namep when using the fallback search for case 4.
1668
6a9da32a
CC
16692010-10-11 Cary Coutant <ccoutant@google.com>
1670
1671 * options.h (class General_options): Redefine -z lazy as an alias for
1672 the negation of -z now.
1673
ac897c20
ILT
16742010-10-11 Ian Lance Taylor <iant@google.com>
1675
1676 * resolve.cc (symbol_to_bits): Report the value of the unsupported
1677 binding.
1678
ea5cae92
NC
16792010-10-06 Nick Clifton <nickc@redhat.com>
1680
1681 * script-sections.cc(class Memory_region): Remove
1682 current_lma_offset_ field. Rename current_vma_offset_ to
1683 current_offset_. Add last_section_ field.
1684 (Memory_region::get_current_vma_address): Rename to
1685 get_current_address.
1686 (Memory_region::get_current_lma_address): Delete.
1687 (Memory_region::increment_vma_offset): Rename to
1688 increment_offset.
1689 (Memory_region::increment_lma_offset): Delete.
1690 (Memory_region::attributes_compatible): New method. Returns
1691 true if the provided section is compatible with the region.
1692 (Memory_region::get_last_section): New method. Returns the last
1693 section to use the region.
1694 (Memory_region::set_last_section): New method. Stores the last
1695 section to use the region.
1696 (Script_sections::block_in_region): New method. Returns true if
1697 a block of memory is contained within a region.
1698 (Script_sections::find_memory_region): New method. Locates a
1699 memory region to be used to set a VMA or LMA address.
1700 (Output_section_definition::set_section_addresses): Add code to
1701 check for addresses set by memory regions.
1702 (Output_segment::set_section_addresses): Remove memory region
1703 walking code.
1704 (Script_sections::create_segment): Add a warning if a header
1705 segment is created outside of any region.
1706 * script-sections.h (class Script_sections): Add prototypes for
1707 find_memory_region and block_in_region methods.
1708 * testsuite/memory_test.s: Use .long instead of .word.
1709 * testsuite/memory_test.t: Add some more output sections.
1710 * testsuite/memory_test.sh: Update expected output.
1711
a9bfd952
DK
17122010-10-02 Doug Kwan <dougkwan@google.com>
1713
1714 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
1715 defintion to symtab.h
1716 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
1717 declaration to defintion.
1718
bacff3ab
NC
17192010-10-01 Nick Clifton <nickc@redhat.com>
1720
1721 * expression.cc (eval): Replace dummy argument with NULL.
1722 (eval_maybe_dot): Check for a NULL result section pointer.
1723 (Symbol_expression::value): Likewise.
1724 (Dot_expression::value): Likewise.
1725 (BINARY_EXPRESSION): Likewise.
1726 (Max_expression::value): Likewise.
1727 (Min_expression::value): Likewise.
1728 (Absolute_expression::value): Likewise.
1729 (Addr_expression::value_from_output_section): Likewise.
1730 (Loaddddr_expression::value_from_output_section): Likewise.
1731 (Segment_start_expression::value): Likewise.
1732 * script-sections.cc
1733 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
1734 argument with NULL.
1735 (Sections_elememt_dot_assignment::set_section_addresses):
1736 Likewise.
1737 (Output_data_expression::do_write_to_buffer): Likewise.
1738 (Output_section_definition::finalize_symbols): Likewise.
1739 (Output_section_definition::set_section_addresses): Likewise.
1740
f81bc8b5
DK
17412010-09-30 Doug Kwan <dougkwan@google.com>
1742
1743 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
1744
c95e9f27
ST
17452010-09-28 Sriraman Tallam <tmsriram@google.com>
1746
1747 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 1748 function.
c95e9f27
ST
1749 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
1750 virtual function.
1751 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
1752 virtual function.
1753 * icf.cc (get_section_contents): Inline merge sections only when
1754 target allows it.
1755
3cac54d2
RW
17562010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1757
1758 * configure: Regenerate.
1759
2904037a
ILT
17602010-09-17 Ian Lance Taylor <iant@google.com>
1761
1762 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
1763 * testsuite/Makefile.am (memory_test.o): New target.
1764 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
1765 memory_test.t.
1766 * testsuite/Makefile.in: Rebuild.
2904037a 1767
bca7fb63
DK
17682010-09-17 Doug Kwan <dougkwan@google.com>
1769
1770 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
1771 defintion if relocation uses GOT entries of the symbol.
1772 * testsuite/icf_safe_test.sh: Fix test.
1773 * testsuite/icf_safe_so_test.sh: Fix test.
1774
4ef28648
CC
17752010-09-16 Cary Coutant <ccoutant@google.com>
1776
1777 * script_sections.cc (class Memory_region): Remove "NULL" from
1778 vector initializations.
1779
793990de
CC
17802010-09-15 Cary Coutant <ccoutant@google.com>
1781
1782 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
1783 Resolve forwarding symbols.
1784
81e015e2
DK
17852010-09-15 Doug Kwan <dougkwan@google.com>
1786
1787 * gold/testsuite/script_test_3.t: Add ARM special sections.
1788 * gold/testsuite/script_test_4.t: Same.
1789 * gold/testsuite/script_test_5.t: Same.
1790 * gold/testsuite/script_test_6.t: Same.
1791 * gold/testsuite/script_test_7.t: Same.
1792 * gold/testsuite/script_test_7.t: Same.
1793 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
1794
36171d64
CC
17952010-09-14 Cary Coutant <ccoutant@google.com>
1796
1797 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
1798 (Target_x86_64::Relocate::relocate_tls): Replace check for
1799 saw_tls_block_reloc_ with test for executable section.
1800
d89051bd
CC
18012010-09-12 Cary Coutant <ccoutant@google.com>
1802
1803 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
1804 position-independent executables to shared libraries need dynamic
1805 relocations.
1806 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
1807 position-independent executables.
1808 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
1809 * testsuite/Makefile.in: Regenerate.
1810
fca41f0f
NC
18112010-09-10 Nick Clifton <nickc@redhat.com>
1812
1813 PR gold/11997
1814 * testsuite/memory_test.t: Discard any sections that are not
1815 needed.
1816
6695e4b3
L
18172010-09-09 H.J. Lu <hongjiu.lu@intel.com>
1818
1819 PR gold/11996
1820 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
1821 "This::" to work around a bug in gcc 4.2.
1822
1823 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
1824
0f72bf6f
RÁE
18252010-09-09 Rafael Espindola <espindola@google.com>
1826
1827 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
1828 sections with different PF_X flags in the same segment.
1829 (Layout::find_first_load_seg): Search all segments to find the first
1830 one.
1831 * options.h (rosegment): New.
1832
18332010-09-08 Rafael Espindola <espindola@google.com>
a6577478 1834
05a79166 1835 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 1836
aa98ff75
DK
18372010-09-08 Doug Kwan <dougkwan@google.com>
1838
1839 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
1840 (Arm_relobj::do_relocate_sections): Add new parameter for output
1841 file to match the parent.
1842 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
1843 of local symbols instead of input values. Update code to track
1844 changes in gold::relocate_section.
1845 * object.cc (Sized_relobj::compute_final_local_value): New methods.
1846 (Sized_relobj::compute_final_local_value_internal): New methods.
1847 (Sized_relobj::do_finalize_local_symbols): Move code from loop
1848 body into private version of Sized_relobj::compute_final_local_value.
1849 Call the inline method.
1850 * object.h (Symbol_value::Symbol_value): Define destructor. Free
1851 merged symbol value if there is one.
1852 (Symbol_value::has_output_value): New method defintiion.
1853 (Sized_relobj::Compute_final_local_value_status): New enum type.
1854 (Sized_relobj::compute_final_local_value): New methods.
1855 (Sized_relobj::compute_final_local_value_internal): New methods.
1856 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
1857 and arm_cortex_a8.sh.
1858 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
1859 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
1860 New tests.
1861 * Makefile.in: Regenerate.
1862 * testsuite/arm_bl_out_of_range.s: Update test.
1863 * testsuite/thumb_bl_out_of_range.s: Ditto.
1864 * testsuite/thumb_blx_out_of_range.s: Ditto.
1865 * testsuite/arm_branch_out_of_range.sh: New file.
1866 * testsuite/arm_cortex_a8.sh: Ditto.
1867 * testsuite/arm_cortex_a8_b.s: Ditto.
1868 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
1869 * testsuite/arm_cortex_a8_b_local.s: Ditto.
1870 * testsuite/arm_cortex_a8_bl.s: Ditto.
1871 * testsuite/arm_cortex_a8_blx.s: Ditto.
1872 * testsuite/arm_cortex_a8_local.s: Ditto.
1873 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
1874 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
1875
05a79166
L
18762010-09-08 Rafael Espindola <espindola@google.com>
1877
1878 * Makefile.am (memory_test.stdout): Run readelf with -W.
1879 * Makefile.in: Regenerate.
1880 * testsuite/memory_test.sh: Make the regexps accept both 32 and
1881 64 bit output.
1882
33dbc701
RÁE
18832010-09-08 Rafael Espindola <espindola@google.com>
1884
1885 * script-sections.cc (Script_sections::add_memory_region): Convert
1886 field precision to int.
1887 * script.cc (script_set_section_region, script_set_section_region):
1888 Convert field precision to int.
1889
731ca54a
RÁE
18902010-09-08 Rafael Espindola <espindola@google.com>
1891
1892 * arm.cc (do_finalize_sections): Create the __exidx_start and
1893 __exdix_end symbols even when the section is missing.
1894
7f8cd844
NC
18952010-09-08 Nick Clifton <nickc@redhat.com>
1896
1897 * README: Remove claim that MEMORY is not supported.
1898 * expression.cc (script_exp_function_origin)
1899 (script_exp_function_length): Move from here to ...
1900 * script.cc: ... here.
1901 (script_set_section_region, script_add_memory)
1902 (script_parse_memory_attr, script_include_directive): New
1903 functions.
1904 * script-sections.cc
1905 (class Memory_region): New class.
1906 (class Output_section_definition): Add set_memory_region,
1907 set_section_vma, set_section_lma and get_section_name methods.
1908 (class Script_Sections): Add add_memory_region,
1909 find_memory_region, find_memory_region_origin,
1910 find_memory_region_length and set_memory_region methods.
1911 Have set_section_addresses method walk the list of set memory
1912 regions.
1913 Extend the print methos to display memory regions.
1914 * script-sections.h: Add prototypes for new methods.
1915 Add enum for MEMORY region attributes.
1916 * yyscript.y: Add support for parsing MEMORY regions.
1917 * script-c.h: Add prototypes for new functions.
1918 * testsuite/Makefile.am: Add test of MEMORY region functionality.
1919 * testsuite/Makefile.in: Regenerate.
1920 * testsuite/memory_test.sh: New script.
1921 * testsuite/memory_test.s: New assembler source file.
1922 * testsuite/memory_test.t: New linker script.
1923
a4649286
DK
19242010-08-27 Doug Kwan <dougkwan@google.com>
1925
1926 * gold/resolve.cc (Symbol_table::should_override): Let a weak
1927 reference override an existing dynamic weak reference.
1928 * testsuite/Makefile.am: Add new test dyn_weak_ref.
1929 * testsuite/Makefile.in: Regenerate.
1930 * testsuite/dyn_weak_ref.sh: New file.
1931 * testsuite/dyn_weak_ref_1.c: Ditto.
1932 * testsuite/dyn_weak_ref_2.c: Ditto.
1933
b56648ad
ILT
19342010-08-27 Ian Lance Taylor <iant@google.com>
1935
1936 * incremental.h (class Incremental_input_entry): Add virtual
1937 destructor.
1938
809313cb
ILT
19392010-08-27 Ian Lance Taylor <iant@google.com>
1940
1941 * testsuite/start_lib_test_3.c: Mark t3 as used.
1942
11e32464
NC
19432010-08-27 Nick Clifton <nickc@redhat.com>
1944
1945 * options.cc (version_script): Fix small typo in previous
1946 whitespace tidyup.
1947
ca09d69a
NC
19482010-08-25 Nick Clifton <nickc@redhat.com>
1949
1950 * archive.cc: Formatting fixes: Remove whitespace between
1951 typename and following asterisk. Remove whitespace between
1952 function name and opening parenthesis.
1953 * archive.h: Likewise.
1954 * arm.cc: Likewise.
1955 * attributes.cc: Likewise.
1956 * attributes.h: Likewise.
1957 * common.cc: Likewise.
1958 * copy-relocs.cc: Likewise.
1959 * dirsearch.h: Likewise.
1960 * dynobj.cc: Likewise.
1961 * ehframe.cc: Likewise.
1962 * ehframe.h: Likewise.
1963 * expression.cc: Likewise.
1964 * fileread.cc: Likewise.
1965 * fileread.h: Likewise.
1966 * gc.h: Likewise.
1967 * gold-threads.cc: Likewise.
1968 * gold.cc: Likewise.
1969 * i386.cc: Likewise.
1970 * icf.h: Likewise.
1971 * incremental-dump.cc: Likewise.
1972 * incremental.cc: Likewise.
1973 * layout.cc: Likewise.
1974 * layout.h: Likewise.
1975 * main.cc: Likewise.
1976 * merge.cc: Likewise.
1977 * merge.h: Likewise.
1978 * object.cc: Likewise.
1979 * object.h: Likewise.
1980 * options.cc: Likewise.
1981 * options.h: Likewise.
1982 * output.cc: Likewise.
1983 * output.h: Likewise.
1984 * plugin.cc: Likewise.
1985 * plugin.h: Likewise.
1986 * powerpc.cc: Likewise.
1987 * reloc.cc: Likewise.
1988 * script-c.h: Likewise.
1989 * script-sections.cc: Likewise.
1990 * script.cc: Likewise.
1991 * stringpool.cc: Likewise.
1992 * symtab.cc: Likewise.
1993 * symtab.h: Likewise.
1994 * target.cc: Likewise.
1995 * timer.cc: Likewise.
1996 * timer.h: Likewise.
1997 * version.cc: Likewise.
1998 * x86_64.cc: Likewise.
1999
b8fa8750
NC
20002010-08-24 Nick Clifton <nickc@redhat.com>
2001
2002 PR 11899
2003 * layout.cc (segment_precedes): Sort segments by their physical
2004 addresses, if they have been set.
2005
9919d93b
CC
20062010-08-23 Cary Coutant <ccoutant@google.com>
2007
2008 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2009 symbols data.
2010 (Lib_group::include_member): Unlock object after deleting its
2011 symbols data.
2012 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2013 the bug fixed here.
2014
97b4be1c
CC
20152010-08-19 Neil Vachharajani <nvachhar@google.com>
2016 Cary Coutant <ccoutant@google.com>
2017
2018 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2019 constructor, and set_blocker.
2020 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2021 readsyms_blocker_.
2022 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2023 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2024 * testsuite/Makefile.am (start_lib_test): New test case.
2025 * testsuite/Makefile.in: Regenerate.
2026 * testsuite/start_lib_test_main.c: New file.
2027 * testsuite/start_lib_test_1.c: New file.
2028 * testsuite/start_lib_test_2.c: New file.
2029 * testsuite/start_lib_test_3.c: New file.
2030
dd0b1884
ILT
20312010-08-19 Ian Lance Taylor <iant@google.com>
2032
2033 * Makefile.in: Rebuild with automake 1.11.1.
2034 * aclocal.m4: Likewise.
2035 * testsuite/Makefile.in: Likewise.
2036
7223e9ca
ILT
20372010-08-19 Ian Lance Taylor <iant@google.com>
2038
2039 PR 10893
2040 * i386.cc (class Output_data_plt_i386): Update declarations.
2041 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2042 local_ifuncs_ fields.
2043 (Target_i386::do_plt_section_for_global): New function.
2044 (Target_i386::do_plt_section_for_local): New function.
2045 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2046 parameter; change all callers. Initialize global_ifuncs_ and
2047 local_ifuncs_. If doing a static link define __rel_iplt_start and
2048 __rel_iplt_end.
2049 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2050 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2051 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2052 symbols.
2053 (Target_i386::make_plt_section): New function, broken out of
2054 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2055 (Target_i386::make_plt_entry): Call make_plt_section.
2056 (Target_i386::make_local_ifunc_plt_entry): New function.
2057 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2058 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2059 R_386_IRELATIVE to switch.
2060 (Target_i386::Scan::global): Likewise.
2061 (Target_i386::Relocate::relocate): Likewise.
2062 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2063 switch.
2064 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2065 (Target_x86_64::do_plt_section_for_global): New function.
2066 (Target_x86_64::do_plt_section_for_local): New function.
2067 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2068 parameter; change all callers. If doing a static link define
2069 __rela_iplt_start and __rela_iplt_end.
2070 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2071 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2072 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2073 to point to .plt.
2074 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2075 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2076 switch.
2077 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2078 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2079 R_X86_64_IRELATIVE to switch.
2080 (Target_x86_64::Scan::global): Likewise.
2081 (Target_x86_64::Relocate::relocate): Likewise.
2082 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2083 switch.
2084 * target.h (class Target): Add plt_section_for_global and
2085 plt_section_for_local functions. Add do_plt_section_for_global
2086 and do_plt_section_for_local virtual functions.
2087 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2088 clarifying comments.
2089 (Symbol::use_plt_offset): Handle IFUNC symbol.
2090 * object.cc (Sized_relobj::Sized_relobj): Initialize
2091 local_plt_offsets_.
2092 (Sized_relobj::local_has_plt_offset): New function.
2093 (Sized_relobj::local_plt_offset): New function.
2094 (Sized_relobj::set_local_plt_offset): New function.
2095 (Sized_relobj::do_count): Handle IFUNC symbol.
2096 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2097 a bit away from input_shndx_ field. Add set_is_func_symbol and
2098 is_ifunc_symbol functions.
2099 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2100 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2101 local_plt_offsets_ field.
2102 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2103 * output.h (class Output_section_data): Add non-const
2104 output_section function.
2105 (class Output_data_got): Update declarations.
2106 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2107 Add use_plt_offset parameter to global and local constructors.
2108 Change all callers. Change local_sym_index_ field to 31 bits.
2109 Change GSYM_CODE and CONSTANT_CODE accordingly.
2110 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2111 doing a static link don't set sh_link field.
2112 (Output_data_got::Got_entry::write): Use PLT offset if
2113 appropriate.
2114 (Output_data_got::add_global_plt): New function.
2115 (Output_data_got::add_local_plt): New function.
2116 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2117 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2118 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2119 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2120 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2121 IFUNC conditional.
2122 * testsuite/ifunc-sel.h: New file.
2123 * testsuite/ifuncmain1.c: New file.
2124 * testsuite/ifuncmain1vis.c: New file.
2125 * testsuite/ifuncmod1.c: New file.
2126 * testsuite/ifuncdep2.c: New file.
2127 * testsuite/ifuncmain2.c: New file.
2128 * testsuite/ifuncmain3.c: New file.
2129 * testsuite/ifuncmod3.c: New file.
2130 * testsuite/ifuncmain4.c: New file.
2131 * testsuite/ifuncmain5.c: New file.
2132 * testsuite/ifuncmod5.c: New file.
2133 * testsuite/ifuncmain6pie.c: New file.
2134 * testsuite/ifuncmod6.c: New file.
2135 * testsuite/ifuncmain7.c: New file.
2136 * configure, testsuite/Makefile.in: Rebuild.
2137
56f75c03
ILT
21382010-08-18 Ian Lance Taylor <iant@google.com>
2139
2140 * incremental.cc
2141 (Output_section_incremental_inputs::write_input_files): Add cast
2142 to avoid signed/unsigned comparison warning.
2143 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2144
55455f89
CC
21452010-08-12 Cary Coutant <ccoutant@google.com>
2146
2147 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2148
e2054bcb
ILT
21492010-08-13 Ian Lance Taylor <iant@google.com>
2150
2151 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2152
74f67560
DK
21532010-08-12 Cary Coutant <ccoutant@google.com>
2154 Doug Kwan <dougkwan@google.com>
2155
2156 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2157 defintion overrides non-weak undef, remember that the original undef
2158 is not weak.
2159 * symtab.cc (Symbol_table::sized_write_global): For undef without
2160 an original weak binding, set binding to global in output.
2161 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2162 * testsuite/Makefile.in: Regenerate.
2163 * testsuite/strong_ref_weak_def.sh: New file.
2164 * testsuite/strong_ref_weak_def_1.c: Ditto.
2165 * testsuite/strong_ref_weak_def_2.c: Ditto.
2166
d1238d12
CC
21672010-08-12 Cary Coutant <ccoutant@google.com>
2168
2169 * testsuite/incremental_test.sh: Rewrite.
2170 * testsuite/incremental_test_1.c: Rewrite.
2171 * testsuite/incremental_test_2.c: Rewrite.
2172
0e70b911
CC
21732010-08-12 Cary Coutant <ccoutant@google.com>
2174
2175 * arm.cc (Target_arm::got_size): Add const.
2176 (Target_arm::got_entry_count): New function.
2177 (Target_arm::plt_entry_count): New function.
2178 (Target_arm::first_plt_entry_offset): New function.
2179 (Target_arm::plt_entry_size): New function.
2180 (Output_data_plt_arm::entry_count): New function.
2181 (Output_data_plt_arm::first_plt_entry_offset): New function.
2182 (Output_data_plt_arm::get_plt_entry_size): New function.
2183 * i386.cc (Target_i386::got_size): Add const.
2184 (Target_i386::got_entry_count): New function.
2185 (Target_i386::plt_entry_count): New function.
2186 (Target_i386::first_plt_entry_offset): New function.
2187 (Target_i386::plt_entry_size): New function.
2188 (Output_data_plt_i386::entry_count): New function.
2189 (Output_data_plt_i386::first_plt_entry_offset): New function.
2190 (Output_data_plt_i386::get_plt_entry_size): New function.
2191 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2192 find_incremental_inputs_sections. Dump incremental_got_plt section.
2193 * incremental.cc: Include target.h.
2194 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2195 parameter. Adjust all callers. Find incremental_got_plt section.
2196 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2197 section.
2198 (Output_section_incremental_inputs::set_final_data_size): Calculate
2199 size of incremental_got_plt section.
2200 (Output_section_incremental_inputs::do_write): Write the
2201 incremental_got_plt section.
2202 (Got_plt_view_info): New struct.
2203 (Local_got_offset_visitor): New class.
2204 (Global_got_offset_visitor): New class.
2205 (Global_symbol_visitor_got_plt): New class.
2206 (Output_section_incremental_inputs::write_got_plt): New function.
2207 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2208 Add parameter. Adjust all callers.
2209 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2210 (Incremental_inputs::got_plt_section): New function.
2211 (Incremental_inputs::got_plt_section_): New data member.
2212 (Incremental_got_plt_reader): New class.
2213 * layout.cc (Layout::create_incremental_info_sections): Add the
2214 incremental_got_plt section.
2215 * object.h (Got_offset_list::get_list): New function.
2216 (Got offset_list::for_all_got_offsets): New function.
2217 (Sized_relobj::local_got_offset_list): New function.
2218 * powerpc.cc (Target_powerpc::got_size): Add const.
2219 (Target_powerpc::got_entry_count): New function.
2220 (Target_powerpc::plt_entry_count): New function.
2221 (Target_powerpc::first_plt_entry_offset): New function.
2222 (Target_powerpc::plt_entry_size): New function.
2223 (Output_data_plt_powerpc::entry_count): New function.
2224 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2225 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2226 * sparc.cc (Target_sparc::got_size): Add const.
2227 (Target_sparc::got_entry_count): New function.
2228 (Target_sparc::plt_entry_count): New function.
2229 (Target_sparc::first_plt_entry_offset): New function.
2230 (Target_sparc::plt_entry_size): New function.
2231 (Output_data_plt_sparc::entry_count): New function.
2232 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2233 (Output_data_plt_sparc::get_plt_entry_size): New function.
2234 * symtab.h (Symbol::got_offset_list): New function.
2235 (Symbol_table::for_all_symbols): New function.
2236 * target.h (Sized_target::got_entry_count): New function.
2237 (Sized_target::plt_entry_count): New function.
2238 (Sized_target::plt_entry_size): New function.
2239 * x86_64.cc (Target_x86_64::got_size): Add const.
2240 (Target_x86_64::got_entry_count): New function.
2241 (Target_x86_64::plt_entry_count): New function.
2242 (Target_x86_64::first_plt_entry_offset): New function.
2243 (Target_x86_64::plt_entry_size): New function.
2244 (Output_data_plt_x86_64::entry_count): New function.
2245 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2246 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2247
09ec0418
CC
22482010-08-12 Cary Coutant <ccoutant@google.com>
2249
2250 * archive.cc: Include incremental.h.
2251 (Archive::Archive): Initialize incremental_info_.
2252 (Archive::include_member): Record archive members in incremental info.
2253 (Add_archive_symbols::run): Record begin and end of an archive in
2254 incremental info.
2255 (Lib_group::include_member): Record objects in incremental info.
2256 * archive.h (Incremental_archive_entry): Forward declaration.
2257 (Archive::set_incremental_info): New member function.
2258 (Archive::incremental_info): New member function.
2259 (Archive::Unused_symbol_iterator): New class.
2260 (Archive::unused_symbols_begin): New member function.
2261 (Archive::unused_symbols_end): New member function.
2262 (Archive::incremental_info_): New data member.
2263 * incremental-dump.cc (find_input_containing_global): New function.
2264 (dump_incremental_inputs): Dump new incremental info sections.
2265 * incremental.cc: Include symtab.h.
2266 (Output_section_incremental_inputs): New class.
2267 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2268 new incremental info sections.
2269 (Sized_incremental_binary::do_check_inputs): Likewise.
2270 (Incremental_inputs::report_archive): Remove.
2271 (Incremental_inputs::report_archive_begin): New function.
2272 (Incremental_inputs::report_archive_end): New function.
2273 (Incremental_inputs::report_object): New function.
2274 (Incremental_inputs::finalize_inputs): Remove.
2275 (Incremental_inputs::report_input_section): New function.
2276 (Incremental_inputs::report_script): Rewrite.
2277 (Incremental_inputs::finalize): Do nothing but finalize string table.
2278 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2279 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2280 (Incremental_inputs::create_data_sections): New function.
2281 (Incremental_inputs::relocs_entsize): New function.
2282 (Output_section_incremental_inputs::set_final_data_size): New function.
2283 (Output_section_incremental_inputs::do_write): New function.
2284 (Output_section_incremental_inputs::write_header): New function.
2285 (Output_section_incremental_inputs::write_input_files): New function.
2286 (Output_section_incremental_inputs::write_info_blocks): New function.
2287 (Output_section_incremental_inputs::write_symtab): New function.
2288 * incremental.h (Incremental_script_entry): Forward declaration.
2289 (Incremental_object_entry): Forward declaration.
2290 (Incremental_archive_entry): Forward declaration.
2291 (Incremental_inputs): Forward declaration.
2292 (Incremental_inputs_header_data): Remove.
2293 (Incremental_inputs_header): Remove.
2294 (Incremental_inputs_header_write): Remove.
2295 (Incremental_inputs_entry_data): Remove.
2296 (Incremental_inputs_entry): Remove.
2297 (Incremental_inputs_entry_write): Remove.
2298 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2299 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2300 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2301 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2302 Likewise.
2303 (Incremental_input_entry): New class.
2304 (Incremental_script_entry): New class.
2305 (Incremental_object_entry): New class.
2306 (Incremental_archive_entry): New class.
2307 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2308 (Incremental_inputs::report_inputs): Remove.
2309 (Incremental_inputs::report_archive): Remove.
2310 (Incremental_inputs::report_archive_begin): New function.
2311 (Incremental_inputs::report_archive_end): New function.
2312 (Incremental_inputs::report_object): Change prototype.
2313 (Incremental_inputs::report_input_section): New function.
2314 (Incremental_inputs::report_script): Change prototype.
2315 (Incremental_inputs::get_reloc_count): New function.
2316 (Incremental_inputs::set_reloc_count): New function.
2317 (Incremental_inputs::create_data_sections): New function.
2318 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2319 (Incremental_inputs::inputs_section): New function.
2320 (Incremental_inputs::symtab_section): New function.
2321 (Incremental_inputs::relocs_section): New function.
2322 (Incremental_inputs::get_stringpool): Add const.
2323 (Incremental_inputs::command_line): Add const.
2324 (Incremental_inputs::inputs): Remove.
2325 (Incremental_inputs::command_line_key): New function.
2326 (Incremental_inputs::input_file_count): New function.
2327 (Incremental_inputs::input_files): New function.
2328 (Incremental_inputs::relocs_entsize): New function.
2329 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2330 (Incremental_inputs::finalize_inputs): Remove.
2331 (Incremental_inputs::Input_info): Remove.
2332 (Incremental_inputs::lock_): Remove.
2333 (Incremental_inputs::inputs_): Change type.
2334 (Incremental_inputs::inputs_map_): Remove.
2335 (Incremental_inputs::current_object_entry_): New data member.
2336 (Incremental_inputs::inputs_section_): New data member.
2337 (Incremental_inputs::symtab_section_): New data member.
2338 (Incremental_inputs::relocs_section_): New data member.
2339 (Incremental_inputs::reloc_count_): New data member.
2340 (Incremental_inputs_reader): New class.
2341 (Incremental_symtab_reader): New class.
2342 (Incremental_relocs_reader): New class.
2343 * layout.cc (Layout::finalize): Move finalization of incremental info
2344 and creation of incremental info sections to follow finalization of
2345 symbol table. Set offsets for postprocessing sections.
2346 (Layout::create_incremental_info_sections): Call
2347 Incremental_inputs::create_data_sections. Add incremental symtab
2348 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2349 sections to layout after input sections.
2350 * layout.h (struct Timespec): Forward declaration.
2351 (Layout::incremental_inputs): Add const.
2352 (Layout::create_incremental_info_sections): Add parameter.
2353 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2354 * object.cc: Include incremental.h.
2355 (Relobj::finalize_incremental_relocs): New function.
2356 (Sized_relobj::do_layout): Record input sections in incremental info.
2357 * object.h (Object::output_section): New function.
2358 (Object::output_section_offset): Moved from Relobj.
2359 (Object::get_incremental_reloc_base): New function.
2360 (Object::get_incremental_reloc_count): New function.
2361 (Object::do_output_section): New function.
2362 (Object::do_output_section_offset): Moved from Relobj.
2363 (Object::do_get_incremental_reloc_base): New function.
2364 (Object::do_get_incremental_reloc_count): New function.
2365 (Object::Object): Initialize new data members.
2366 (Relobj::output_section): Renamed do_output_section and moved to
2367 protected.
2368 (Relobj::output_section_offset): Moved to Object.
2369 (Relobj::do_get_incremental_reloc_base): New function.
2370 (Relobj::do_get_incremental_reloc_count): New function.
2371 (Relobj::allocate_incremental_reloc_counts): New function.
2372 (Relobj::count_incremental_reloc): New function.
2373 (Relobj::finalize_incremental_relocs): New function.
2374 (Relobj::next_incremental_reloc_index): New function.
2375 (Relobj::reloc_counts_): New data member.
2376 (Relobj::reloc_bases_): New data member.
2377 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2378 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2379 (Sized_relobj::incremental_relocs_scan): New function.
2380 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2381 (Sized_relobj::incremental_relocs_write): New function.
2382 (Sized_relobj::incremental_relocs_write_reltype): New function.
2383 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2384 incremental link.
2385 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2386 archives and object files elsewhere.
2387 (Add_symbols::run): Report object files here.
2388 (Finish_group::run): Report end of archive at end of group.
2389 * reloc.cc: Include layout.h, incremental.h.
2390 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2391 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2392 (Sized_relobj::incremental_relocs_scan): New function.
2393 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2394 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2395 (Sized_relobj::incremental_relocs_write): New function.
2396 (Sized_relobj::incremental_relocs_write_reltype): New function.
2397 * script.cc (read_input_script): Rewrite test for incremental link.
2398 Change call to Incremental_inputs::report_script.
2399 * symtab.h (Symbol_table::first_global_index): New function.
2400 (Symbol_table::output_count): New function.
2401
ce0d1972
DK
24022010-08-12 Doug Kwan <dougkwan@google.com>
2403
2404 * arm.cc (Target_arm::merge_object_attributes): Check command line
2405 options --no-wchar-size-warning and --no-enum-size-warning.
2406 * options.h (General_options): Add ld-compatible options
2407 --no-enum-size-warning and --no-wchar-size-warning.
2408
6e5710ce
ILT
24092010-08-04 Ian Lance Taylor <iant@google.com>
2410
2411 * x86_64.cc (Target_x86_64::Scan::local): Use
2412 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2413 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2414 (Target_x86_64::Scan::global): Likewise.
2415 (Target_x86_64::Relocate::relocate): Likewise.
2416 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2417 Likewise.
2418
fef830db
CC
24192010-08-03 Cary Coutant <ccoutant@google.com>
2420
2421 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2422 to reserve space in merged_strings vector. Keep total input size
2423 for stats.
2424 (Output_merge_string::do_print_merge_stats): Print total input size.
2425 * merge.h (Output_merge_string): Add input_size_ field.
2426 * stringpool.cc (Stringpool_template::string_length): Move
2427 implementations out of Stringpool_template class and place in
2428 stringpool.h.
2429 * stringpool.h (string_length): Move out of Stringpool_template.
2430
1e3811b0
ILT
24312010-08-03 Ian Lance Taylor <iant@google.com>
2432
2433 PR 11712
2434 * layout.cc (relaxation_loop_body): If address of load segment is
2435 set, adjust address to include headers if possible.
2436
7af0c620
ILT
24372010-08-03 Ian Lance Taylor <iant@google.com>
2438
2439 * version.cc (version_string): Bump to 1.10.
2440
22f0da72
ILT
24412010-08-03 Ian Lance Taylor <iant@google.com>
2442
2443 PR 11805
2444 * layout.h (enum Output_section_order): Define.
2445 (class Layout): Update declarations.
2446 * layout.cc (Layout::get_output_section): Add order parameter.
2447 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2448 is_first_non_relro parameters. Change all callers.
2449 (Layout::choose_output_section): Likewise.
2450 (Layout::add_output_section_data): Likewise.
2451 (Layout::make_output_section): Likewise. Set order.
2452 (Layout::default_section_order): New function.
2453 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2454 * output.cc (Output_section::Output_section): Initialize order_.
2455 Don't initialize deleted fields.
2456 (Output_segment::Output_segment): Don't initialize deleted
2457 fields.
2458 (Output_segment::add_output_section_to_load): New function
2459 replacing add_output_section. Change all callers to call this or
2460 add_output_section_to_nonload.
2461 (Output_segment::add_output_section_to_nonload): New function.
2462 (Output_segment::remove_output_section): Rewrite.
2463 (Output_segment::add_initial_output_data): Likewise.
2464 (Output_segment::has_any_data_sections): Likewise.
2465 (Output_segment::is_first_section_relro): Likewise.
2466 (Output_segment::maximum_alignment): Likewise.
2467 (Output_segment::has_dynamic_reloc): New function replacing
2468 dynamic_reloc_count. Change all callers.
2469 (Output_segment::has_dynamic_reloc_list): New function replacing
2470 dynamic_reloc_count_list. Change all callers.
2471 (Output_segment::set_section_addresses): Rewrite.
2472 (Output_segment::set_offset): Rewrite.
2473 (Output_segment::find_first_and_last_list): Remove.
2474 (Output_segment::set_tls_offsets): Rewrite.
2475 (Output_segment::first_section_load_address): Likewise.
2476 (Output_segment::output_section_count): Likewise.
2477 (Output_segment::section_with_lowest_load_address): Likewise.
2478 (Output_segment::write_section_headers): Likewise.
2479 (Output_segment::print_sections_to_map): Likewise.
2480 * output.h (class Output_data): Remove dynamic_reloc_count_
2481 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2482 (Output_data::add_dynamic_reloc): Rewrite.
2483 (Output_data::has_dynamic_reloc): New function.
2484 (Output_data::dynamic_reloc_count): Remove.
2485 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2486 is_last_relro_, is_first_non_relro_, is_interp_,
2487 is_dynamic_linker_section_ fields. Add order and set_order
2488 functions. Remove is_relro_local, set_is_relro_local,
2489 is_last_relro, set_is_last_relro, is_first_non_relro,
2490 set_is_first_non_relro functions, is_interp, set_is_interp,
2491 is_dynamic_linker_section, and set_is_dynamic_linker_section
2492 functions.
2493 (class Output_segment): Change Output_data_list from std::list to
2494 std:;vector. Add output_lists_ field. Remove output_data_ and
2495 output_bss_ fields. Update declarations.
2496
3ff2ccb0
ILT
24972010-08-02 Ian Lance Taylor <iant@google.com>
2498
2499 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2500 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2501 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2502
88a4108b
ILT
25032010-08-02 Ian Lance Taylor <iant@google.com>
2504
2505 PR 11855
2506 * script.cc (Script_options::Script_options): Initialize
2507 symbol_definitions_ and symbol_references_.
2508 (Script_options::add_symbol_assignment): Update
2509 symbol_definitions_ and symbol_references_.
2510 (Script_options::add_symbol_reference): New function.
2511 (script_symbol): New function.
2512 * script.h (class Script_options): Add symbol_definitions_ and
2513 symbol_references_ fields.
2514 (Script_options::referenced_const_iterator): New type.
2515 (Script_options::referenced_begin): New function.
2516 (Script_options::referenced_end): New function.
2517 (Script_options::is_referenced): New function.
2518 (Script_options::any_unreferenced): New function.
2519 * script-c.h (script_symbol): Declare.
2520 * yyscript.y (exp): Call script_symbol.
2521 * symtab.cc: Include "script.h".
2522 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2523 Change all callers. Check symbols referenced by scripts.
2524 (Symbol_table::add_undefined_symbols_from_command_line): Add
2525 layout parameter. Change all callers.
2526 (Symbol_table::do_add_undefined_symbols_from_command_line):
2527 Likewise. Break out loop body. Check symbols referenced by
2528 scripts.
2529 (Symbol_table::add_undefined_symbol_from_command_line): New
2530 function broken out of
2531 do_add_undefined_symbols_from_command_line.
2532 * symtab.h (class Symbol_table): Update declarations.
2533 * archive.cc: Include "layout.h".
2534 (Archive::should_include_member): Add layout parameter. Change
2535 all callers. Check for symbol mentioned in expression.
2536 * archive.h (class Archive): Update declaration.
2537 * object.cc (Sized_relobj::do_should_include_member): Add layout
2538 parameter.
2539 * object.h (Object::should_include_member): Add layout parameter.
2540 Change all callers.
2541 (Object::do_should_include_member): Add layout parameter.
2542 (class Sized_relobj): Update declaration.
2543 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2544 parameter.
2545 * dynobj.h (class Sized_dynobj): Update declaration.
2546 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2547 layout parameter.
2548 * plugin.h (class Sized_pluginobj): Update declaration.
2549
5f1ab67a
ILT
25502010-08-02 Ian Lance Taylor <iant@google.com>
2551
2552 PR 11866
2553 * output.cc (Output_segment::set_offset): Search for the first and
2554 last sections rather than assuming that the list is in order.
2555 (Output_segment::find_first_and_last_list): New function.
2556 * output.h (class Output_segment): Update declarations.
2557 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2558 (relro_strip_test_SOURCES): New variable.
2559 (relro_strip_test_DEPENDENCIES): New variable.
2560 (relro_strip_test_LDFLAGS): New variable.
2561 (relro_strip_test_LDADD): New variable.
2562 (relro_strip_test.so): New target.
2563
a8df5856
ILT
25642010-08-02 Ian Lance Taylor <iant@google.com>
2565
2566 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2567 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2568 (Target_i386::got_tlsdesc_section): New function.
2569 (Target_i386::got_section): Create space for GOT entries for
2570 TLSDESC relocations.
2571 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2572 R_386_TLS_GOTDESC.
2573 (Target_i386::Scan::global): Likewise.
2574 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2575 using TLSDESC GOT.
2576 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2577 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2578 (Target_x86_64::got_tlsdesc_section): New function.
2579 (Target_x86_64::got_section): Create space for GOT entries for
2580 TLSDESC relocations.
2581 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2582 R_386_TLS_GOTDESC.
2583 (Target_x86_64::Scan::global): Likewise.
2584 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2585 using TLSDESC GOT.
2586
0c10a0a6
ILT
25872010-08-02 Ian Lance Taylor <iant@google.com>
2588
2589 * testsuite/final_layout.sh: Use dc to convert from hex to
2590 decimal.
2591
41cbeecc
ST
25922010-07-29 Sriraman Tallam <tmsriram@google.com>
2593
2594 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2595 paramter to the call to gold::gc_process_relocs.
2596 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2597 paramter to the call to gold::gc_process_relocs.
2598 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2599 parameter to the call to gold::gc_process_relocs.
2600 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2601 template parameter to the call to gold::gc_process_relocs.
2602 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2603 paramter to the call to gold::gc_process_relocs.
2604 * gc.h (get_embedded_addend_size): New function.
2605 (gc_process_relocs): Save the size of the reloc for use by ICF.
2606 * icf.cc (get_section_contents): Get the addend from the text section
2607 for SHT_REL relocation sections.
2608 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2609 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2610 * int_encoding.h (read_from_pointer): New overloaded function.
2611 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2612 * testsuite/icf_sht_rel_addend_test.sh: New file.
2613 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2614 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2615
6ea55b82
RW
26162010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2617
2618 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2619 * Makefile.in: Regenerate.
2620 * testsuite/Makefile.in: Regenerate.
2621
9691462b
ILT
26222010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2623
2624 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2625 * gold/testsuite/debug_msg.cc: Likewise.
2626 * gold/testsuite/odr_violation1.cc
2627 * gold/testsuite/odr_violation2.cc
2628
76897331
CC
26292010-07-21 Cary Coutant <ccoutant@google.com>
2630
2631 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2632 string, and length fields.
2633 (Output_merge_string::Merged_strings_list): New type.
2634 (Output_merge_string::Merged_strings_lists): New typedef.
2635 (Output_merge_string): Replace merged_strings_ with
2636 merged_strings_lists_.
2637 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2638 Merged_strings_list per input object and section. Don't store pointer
2639 to the string. Don't store length with each merged string entry.
2640 (Output_merge_string::finalize_merged_data): Loop over list of merged
2641 strings lists. Recompute length of each merged string.
2642
78384e8f
CC
26432010-07-15 Cary Coutant <ccoutant@google.com>
2644
2645 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2646 here.
2647
783659f9
ILT
26482010-07-14 Ian Lance Taylor <iant@google.com>
2649
2650 * descriptors.cc (Descriptors::open): Report correct name in error
2651 message.
2652
131687b4
DK
26532010-07-13 Doug Kwan <dougkwan@google.com>
2654
2655 * arm.cc (Arm_input_section::Arm_input_section): For a
2656 SHT_ARM_EXIDX section, always keeps the input sections.
2657 (Arm_input_section::set_exidx_section_link): New method.
2658 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
2659 has_errors_ to false.
2660 (Arm_exidx_input_section::has_errors,
2661 Arm_exidx_input_section::set_has_errors): New methods.
2662 (Arm_exidx_input_section::has_errors_): New data member.
2663 (Arm_relobj::get_exidx_shndx_list): New method.
2664 (Arm_output_section::append_text_sections_to_list): Do not skip
2665 section without SHF_EXECINSTR.
2666 (Arm_output_section::fix_exidx_coverage): Skip input sections with
2667 errors.
2668 (Arm_relobj::make_exidx_input_section): Add new parameter for text
2669 section header. Make error messages more verbose. Check for
2670 a non-executable section linked to an EXIDX section.
2671 (Arm_relobj::do_read_symbols): Remove error checking, which has been
2672 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
2673 check that there is no deferred EXIDX section if we exit early.
2674 Instead of not making an EXIDX section in case of an error, make one
2675 and set the has_errors flag of it.
2676 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
2677 in a relocatable link.
2678 (Target_arm::do_relax): Look for the EXIDX output section instead of
2679 assuming that it is called .ARM.exidx.
2680 (Target_arm::fix_exidx_coverage): Add a new parameter for input
2681 section list. Do not check for SHF_EXECINSTR section flags but
2682 skip any input section with errors.
2683 * output.cc (Output_section::Output_section): Initialize
2684 always_keeps_input_sections_ to false.
2685 (Output_section::add_input_section): Check for
2686 always_keeps_input_sections_.
2687 * output.h (Output_section::always_keeps_input_sections,
2688 Output_section::set_always_keeps_input_sections): New methods.
2689 (Output_section::always_keeps_input_sections): New data member.
2690
69517287
RÁE
26912010-07-13 Rafael Espindola <espindola@google.com>
2692
2693 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
2694 * fileread.h (Input_file): Add try_extra_search_path and find_file.
2695
82742395
ILT
26962010-07-13 Philip Herron <herron.philip@googlemail.com>
2697 Ian Lance Taylor <iant@google.com>
2698
2699 * output.h (Output_section_lookup_maps::add_merge_section):
2700 Correct check of whether value was inserted.
2701 (Output_section_lookup_maps::add_merge_input_section): Likewise.
2702 (Output_section_lookup_maps::add_relaxed_input_section):
2703 Likewise.
2704 * arm.cc (Target_arm::got_section): Remove used local os.
2705 * i386.cc (Target_i386::got_section): Likewise.
2706 * x86_64.cc (Target_x86_64::got_section): Likewise.
2707 * sparc.cc (Target_sparc::got_section): Likewise.
2708 (Target_sparc::relocate): Remove unused local have_got_offset.
2709 * powerpc.cc (Target_powerpc::relocate): Likewise.
2710
f2d707b5
ILT
27112010-07-13 Ian Lance Taylor <iant@google.com>
2712
241531d6
ILT
2713 * compressed_output.cc (zlib_decompress): Fix signature in
2714 !HAVE_ZLIB_H case.
2715
f2d707b5
ILT
2716 * archive.cc (Archive::include_member): Unlock an external member
2717 of a thin archive. Don't bother to delete an object we know is
2718 NULL.
2719
a2e47362
CC
27202010-07-12 Cary Coutant <ccoutant@google.com>
2721
2722 * compressed_output.cc (zlib_decompress): New function.
2723 (get_uncompressed_size): New function.
2724 (decompress_input_section): New function.
2725 * compressed_output.h (get_uncompressed_size): New function.
2726 (decompress_input_section): New function.
2727 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
2728 Handle compressed debug sections.
2729 * layout.cc (is_compressed_debug_section): New function.
2730 (Layout::output_section_name): Map compressed section names to
2731 canonical names.
2732 * layout.h (is_compressed_debug_section): New function.
2733 (is_debug_info_section): Recognize compressed debug sections.
2734 * merge.cc: Include compressed_output.h.
2735 (Output_merge_data::do_add_input_section): Handle compressed
2736 debug sections.
2737 (Output_merge_string::do_add_input_section): Handle compressed
2738 debug sections.
2739 * object.cc: Include compressed_output.h.
2740 (Sized_relobj::Sized_relobj): Initialize new data members.
2741 (build_compressed_section_map): New function.
2742 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
2743 * object.h (Object::section_is_compressed): New method.
2744 (Object::do_section_is_compressed): New method.
2745 (Sized_relobj::Compressed_section_map): New type.
2746 (Sized_relobj::do_section_is_compressed): New method.
2747 (Sized_relobj::compressed_sections_): New data member.
2748 * output.cc (Output_section::add_input_section): Handle compressed
2749 debug sections.
2750 * reloc.cc: Include compressed_output.h.
2751 (Sized_relobj::write_sections): Handle compressed debug sections.
2752
ce279a62
CC
27532010-07-08 Cary Coutant <ccoutant@google.com>
2754
2755 * resolve.cc (Symbol_table::resolve): Remember whether undef was
2756 weak when resolving to a dynamic def.
2757 (Symbol_table::should_override): Add adjust_dyndef flag; set it
2758 for weak undef/dynamic def cases. Adjust callers.
2759 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
2760 undef_binding_weak_.
2761 (Symbol_table::sized_write_globals): Adjust symbol binding.
2762 (Symbol_table::sized_write_symbol): Add binding parameter.
2763 * symtab.h (Symbol::set_undef_binding): New method.
2764 (Symbol::is_undef_binding_weak): New method.
2765 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
2766 (Symbol_table::should_override): Add new parameter.
2767 (Symbol_table::sized_write_symbol): Add new parameter.
2768
2769 * testsuite/weak_undef_file1.cc: Add new test case.
2770 * testsuite/weak_undef_file2.cc: Fix header comment.
2771 * testsuite/weak_undef_test.cc: Add new test case.
2772
b2286c10
DK
27732010-06-29 Doug Kwan <dougkwan@google.com>
2774
2775 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
2776 Initialize USE_SYMBOL_.
2777 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
2778 definition.
2779 (Arm_reloc_property::uses_symbol_): New data member declaration.
2780 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
2781 uses symbol value and symbol is undefined but not weakly undefined.
2782
4802450a
RÁE
27832010-06-28 Rafael Espindola <espindola@google.com>
2784
2785 * plugin.cc (Plugin::load): Use dlerror.
2786
e5ca47ba
ILT
27872010-06-26 Jeffrey Yaskin <jyasskin@google.com>
2788
2789 * symtab.cc (detect_odr_violations): When reporting an ODR
2790 violation, report an object where the symbol is defined.
2791
8a75a161
DK
27922010-06-25 Doug Kwan <dougkwan@google.com>
2793
2794 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
2795 (Target_arm::section_may_have_icf_unsafe_pointers): New method
2796 definition.
2797 (Target_arm::Scan::local_reloc_may_be_function_pointer,
2798 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
2799 target hook to detect function points.
2800 (Target_arm::Scan::possible_function_pointer_reloc): New method.
2801 * icf.h (Icf::check_section_for_function_pointers): Change type of
2802 parameter SECTION_NAME to const reference to std::string. Use
2803 target hook to determine if section may have unsafe pointers.
2804 * target.h (Target::section_may_have_icf_unsafe_pointers): New
2805 method definition.
2806
42218b9f
RÁE
28072010-06-21 Rafael Espindola <espindola@google.com>
2808
2809 * fileread.cc (Input_file::find_fie): New
2810 (Input_file::open): Use Input_file::find_fie.
2811 * fileread.h (Input_file::find_fie): New
2812 * plugin.cc (set_extra_library_path): New.
2813 (Plugin::load): Add set_extra_library_path to the transfer vector.
2814 (Plugin_manager::set_extra_library_path): New.
2815 (Plugin_manager::add_input_file): Use the extra search path if set.
2816 (set_extra_library_path(): New.
2817 * plugin.h (Plugin_manager): Add set_extra_library_path and
2818 extra_search_path_.
2819
a0506cca
CC
28202010-06-19 Cary Coutant <ccoutant@google.com>
2821
2822 * layout.cc (gdb_sections): Add .debug_types.
2823 (lines_only_debug_sections): Likewise.
2824
6508b958
RÁE
28252010-06-18 Rafael Espindola <espindola@google.com>
2826
2827 * plugin.cc (add_input_file,add_input_library)
2828 (Plugin_manager::add_input_file): Make filename arguments const.
2829 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
2830 const.
2831
3e235302
DK
28322010-06-16 Doug Kwan <dougkwan@google.com>
2833
2834 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
2835 .ARM.attributes section if we have not merged any input
2836 attributes sections.
2837
106e8a6c
DK
28382010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2839
2840 * arm.cc: Allow combining objects with no EABI version
2841 information.
2842
91ff43fe
RÁE
28432010-06-15 Rafael Espindola <espindola@google.com>
2844
2845 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
2846
68ed838c
ILT
28472010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2848
2849 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
2850 (struct iovec): Correct !HAVE_READV definition.
2851
f3a2388f
CC
28522010-06-10 Cary Coutant <ccoutant@google.com>
2853
2854 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
2855 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
2856 reloc sections.
2857 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
2858
2859 PR 11683
2860 * symtab.h (Symbol::is_placeholder): New member function.
2861 * target-reloc.h (relocate_section): Check for placeholder symbols.
2862
2863 * testsuite/Makefile.am (plugin_test_8): New test.
2864 (plugin_test_9): New test.
2865 * testsuite/Makefile.in: Regenerate.
2866
e1df38aa
NC
28672010-06-09 Nick Clifton <nickc@redhat.com>
2868
2869 * yyscript.y (input_list_element): Allow strings prefixed with
2870 the '-' character. Treat these as libraries.
2871 * script.cc (script_add_library): New function. Adds a library
2872 specified by "-l<name>" found in an input script.
2873 * script-c.h: Add prototype for script_add_library.
2874
25bbe950
DK
28752010-06-07 Doug Kwan <dougkwan@google.com>
2876
2877 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
2878 Restrict stub-group size to be within long conditional branch
2879 range when working around cortex-A8 erratum.
2880
0f32ea4c
ILT
28812010-06-07 Damien Diederen <dd@crosstwine.com>
2882
2883 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
2884 #ifdef typo.
2885
8fe2a369
ST
28862010-06-03 Sriraman Tallam <tmsriram@google.com>
2887
2888 PR gold/11658
2889 * output.cc
2890 (Output_section::Input_section_sort_entry::compare_section_ordering):
2891 Change to return non-zero correctly.
2892 (Output_section::Input_section_sort_section_order_index_compare
2893 ::operator()): Change to fix ambiguity in comparisons.
2894
6e9ba2ca
ST
28952010-06-01 Sriraman Tallam <tmsriram@google.com>
2896
2897 * gold.h (is_wildcard_string): New function.
2898 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
2899 (Layout::layout_eh_frame): Ditto.
2900 (Layout::find_section_order_index): New method.
2901 (Layout::read_layout_from_file): New method.
2902 * layout.h (Layout::find_section_order_index): New method.
2903 (Layout::read_layout_from_file): New method.
2904 (Layout::input_section_position_): New private member.
2905 (Layout::input_section_glob_): New private member.
2906 * main.cc (main): Call read_layout_from_file here.
2907 * options.h (--section-ordering-file): New option.
2908 * output.cc (Output_section::input_section_order_specified_): New
2909 member.
2910 (Output_section::Output_section): Initialize new member.
2911 (Output_section::add_input_section): Add new parameter.
2912 Keep input sections when --section-ordering-file is used.
2913 (Output_section::set_final_data_size): Sort input sections when
2914 section ordering file is specified.
2915 (Output_section::Input_section_sort_entry): Add new parameter.
2916 Check sorting type.
2917 (Output_section::Input_section_sort_entry::compare_section_ordering):
2918 New method.
2919 (Output_section::Input_section_sort_compare::operator()): Change to
2920 consider section_order_index.
2921 (Output_section::Input_section_sort_init_fini_compare::operator()):
2922 Change to consider section_order_index.
2923 (Output_section::Input_section_sort_section_order_index_compare
2924 ::operator()): New method.
2925 (Output_section::sort_attached_input_sections): Change to sort
2926 according to section order when specified.
e1df38aa
NC
2927 (Output_section::add_input_section<32, true>): Add new parameter.
2928 (Output_section::add_input_section<64, true>): Add new parameter.
2929 (Output_section::add_input_section<32, false>): Add new parameter.
2930 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
2931 * output.h (Output_section::add_input_section): Add new parameter.
2932 (Output_section::input_section_order_specified): New
2933 method.
2934 (Output_section::set_input_section_order_specified): New method.
2935 (Input_section::Input_section): Initialize section_order_index_.
2936 (Input_section::section_order_index): New method.
2937 (Input_section::set_section_order_index): New method.
2938 (Input_section::section_order_index_): New member.
2939 (Input_section::Input_section_sort_section_order_index_compare): New
2940 struct.
2941 (Output_section::input_section_order_specified_): New member.
2942 * script-sections.cc (is_wildcard_string): Delete and move modified
2943 method to gold.h.
2944 (Output_section_element_input::Output_section_element_input): Modify
2945 call to is_wildcard_string.
2946 (Output_section_element_input::Input_section_pattern
2947 ::Input_section_pattern): Ditto.
2948 (Output_section_element_input::Output_section_element_input): Ditto.
2949 * testsuite/Makefile.am (final_layout): New test case.
2950 * testsuite/Makefile.in: Regenerate.
2951 * testsuite/final_layout.cc: New file.
2952 * testsuite/final_layout.sh: New file.
2953
3537c84b
RÁE
29542010-06-01 Rafael Espindola <espindola@google.com>
2955
2956 * plugin.cc (Plugin::load): Pass the output name to the plugin.
2957
105b6afd
RÁE
29582010-06-01 Rafael Espindola <espindola@google.com>
2959
2960 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
2961 visibility of symbols.
2962
29e11421
DK
29632010-05-27 Doug Kwan <dougkwan@google.com>
2964
2965 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
2966 from start of output section instead of address for a local symbol
2967 in a merged or relaxed section when doing a relocatable link.
2968
5e0f337e
RÁE
29692010-05-26 Rafael Espindola <espindola@google.com>
2970
2971 PR 11604
2972 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
2973 adding sections the garbage collector removed.
2974 * gold/testsuite/Makefile.am: Add test.
2975 * gold/testsuite/Makefile.in: Regenerate.
2976 * gold/testsuite/plugin_test_7.sh: New.
2977 * gold/testsuite/plugin_test_7_1.c: New.
2978 * gold/testsuite/plugin_test_7_2.c: New.
2979
f4187277
RÁE
29802010-05-26 Rafael Espindola <espindola@google.com>
2981
2982 * script-sections.cc (Output_section_definition::set_section_addresses):
2983 Check for --section-start.
2984
5c388529
DK
29852010-05-26 Doug Kwan <dougkwan@google.com>
2986
2987 * arm.cc (Arm_scan_relocatable_relocs): New class.
2988 (Target_arm::relocate_special_relocatable): New method.
2989 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
2990 (Arm_relocate_functions::thumb_branch_common): Same.
2991 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
2992 instead of Default_scan_relocatable_relocs.
2993 * target-reloc.h (relocate_for_relocatable): Let target handle
2994 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
2995 * target.h (Sized_target::relocate_special_relocatable): New method.
2996
bca1c3ae
ILT
29972010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2998
2999 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
3000
0439c796
DK
30012010-05-23 Doug Kwan <dougkwan@google.com>
3002
3003 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
3004 instead of a cast.
3005 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3006 with a direct branch, not a conditional branch, to a stub.
3007 * merge.cc (Output_merge_base::record_input_section): New method
3008 defintion.
3009 (Output_merge_data::do_add_input_section): Record input section if
3010 keeps-input-sections flag is set.
3011 (Output_merge_string::do_add_input_section): Ditto.
3012 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3013 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3014 INPUT_SECTIONS_.
3015 (Output_merge_base::keeps_input_sections,
3016 Output_merge_base::set_keeps_input_sections,
3017 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3018 method definitions.
3019 (Output_merge_base::Input_sections): New type declaration.
3020 (Output_merge_base::input_sections_begin,
3021 Output_merge_base::input_sections_end,
3022 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3023 (Output_merge_base::bool keeps_input_sections_,
3024 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3025 Output_merge_base::input_sections_): New data members.
3026 (Output_merge_data::do_set_keeps_input_sections): New method
3027 defintion.
3028 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3029 * output.cc (Output_section::Input_section::relobj): Move method
3030 defintion from class declaration to here and handle merge sections.
3031 (Output_section::Input_section::shndx): Ditto.
3032 (Output_section::Output_section): Remove initializations of removed
3033 data members and initialize new data member LOOKUP_MAPS_.
3034 (Output_section::add_input_section): Set keeps-input-sections flag
3035 for a newly created merge output section as appropriate. Adjust code
3036 to use Output_section_lookup_maps class.
3037 (Output_section::add_relaxed_input_section): Adjst code for lookup
3038 maps code refactoring.
3039 (Output_section::add_merge_input_section): Add a new parameter
3040 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3041 class. If adding input section to a newly created merge output
3042 section fails, remove the new merge section.
3043 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3044 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3045 (Output_section::find_merge_section): Ditto.
3046 (Output_section::build_lookup_maps): New method defintion.
3047 (Output_section::find_relaxed_input_section): Adjust code to use
3048 Output_section_lookup_maps class.
3049 (Output_section::get_input_sections): Export merge sections. Adjust
3050 code to use Output_section_lookup_maps class.
3051 (Output_section:::add_script_input_section): Adjust code to use
3052 Output_section_lookup_maps class. Update lookup maps for merge
3053 sections also.
3054 (Output_section::discard_states): Use Output_section_lookup_maps.
3055 (Output_section::restore_states): Same.
3056 * output.h (Merge_section_properties): Move class defintion out of
3057 Output_section.
3058 (Output_section_lookup_maps): New class.
3059 (Output_section::Input_section::is_merge_section): New method
3060 defintion.
3061 (Output_section::Input_section::relobj): Move defintion out of class
3062 defintion. Declare method only.
3063 (Output_section::Input_section::shndx): Ditto.
3064 (Output_section::Input_section::output_merge_base): New method defintion.
3065 (Output_section::Input_section::u2_.pomb): New union field.
3066 (Output_section::Merge_section_by_properties_map,
3067 Output_section::Output_section_data_by_input_section_map,
3068 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3069 Remove types.
3070 (Output_section::add_merge_input_section): Add new parameter
3071 KEEPS_INPUT_SECTIONS.
3072 (Output_section::build_lookup_maps): New method declaration.
3073 (Output_section::merge_section_map_,
3074 Output_section::merge_section_by_properties_map_,
3075 Output_section::relaxed_input_section_map_,
3076 Output_section::is_relaxed_input_section_map_valid_): Remove data
3077 members.
3078 (Output_section::lookup_maps_): New data member.
3079
76295588
L
30802010-05-21 Doug Kwan <dougkwan@google.com>
3081
3082 PR gold/11619
3083 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3084 avoid a compilation error.
3085
d103a984
RÁE
30862010-05-19 Rafael Espindola <espindola@google.com>
3087
3088 * script-sections.cc (Output_section_definition::allocate_to_segment):
3089 Update the phdrs_list even when the output section is NULL.
3090 * testsuite/Makefile.am: Add test.
3091 * testsuite/Makefile.in: Regenerate.
3092 * testsuite/script_test_9.cc: New.
3093 * testsuite/script_test_9.sh: New.
3094 * testsuite/script_test_9.t: New.
3095
6625d24e
DK
30962010-05-19 Doug Kwan <dougkwan@google.com>
3097
3098 * arm.cc (Arm_input_section::original_size): New method.
3099 (Arm_input_section::do_addralign): Add a cast.
3100 (Arm_input_section::do_output_offset): Remove static cast.
3101 (Arm_input_section::original_addralign,
3102 Arm_input_section::original_size_): Change type to uint32_t.
3103 (Arm_input_section::init): Add safe casts for section alignment
3104 and size.
3105 (Arm_input_section::set_final_data_size): Do not set address and
3106 offset of stub table.
3107 (Arm_output_section::fix_exidx_coverage): Change use of of
3108 Output_section::Simple_input_section to that of
3109 Output_section::Input_section.
3110 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3111 except for the first pass.
3112 * output.cc (Output_section::get_input_sections): Change type of
3113 input_sections to std::list<Input_section>.
3114 (Output_section::add_script_input_section): Rename from
3115 Output_section::add_simple_input_section. Change type of SIS
3116 parameter from Simple_input_section to Input_section.
3117 * output.h (Output_section::Simple_input_section): Remove class.
3118 (Output_section::Input_section): Change class visibility to public.
3119 (Output_section::Input_section::addralign): Use stored alignments
3120 for special input sections if set.
3121 (Output_section::Input_section::set_addralign): New method.
3122 (Output_section::get_input_sections): Change parameter type from
3123 list of Simple_input_section to list of Input_section.
3124 (Output_section::add_script_input_section): Rename from
3125 Output_section::add_simple_input_section. Change first parameter's
3126 type from Simple_input_section to Input_section and remove the
3127 second and third parameters.
3128 * script-sections.cc (Input_section::Input_section_list): Change
3129 type to list of Output_section::Input_section/
3130 (Input_section_info::Input_section_info): Change parameter type of
3131 INPUT_SECTION to Output_section::Input_section.
3132 (Input_section_info::input_section): Change return type.
3133 (Input_section_info::input_section_): Change type to
3134 Output_section::Input_section.
3135 (Output_section_element_input::set_section_addresses): Adjust code
3136 to use Output_section::Input_section instead of
3137 Output_section::Simple_input_section. Adjust code for renaming
3138 of Output_section::add_simple_input_section.
3139 (Orphan_output_section::set_section_addresses): Ditto.
3140
e1e82ea4
RW
31412010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3142
3143 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3144 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3145
91e75c8a
RÁE
31462010-05-18 Rafael Espindola <espindola@google.com>
3147
3148 * options.cc (General_options::finalize): Handle -nostdlib.
3149 * options.h (nostdlib): New option.
3150 * script.cc (script_add_search_dir): Handle -nostdlib.
3151
da59ad79
DK
31522010-05-12 Doug Kwan <dougkwan@google.com>
3153
3154 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3155 attributes section only if there no attributes section after merging.
3156 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3157 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3158 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3159 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3160 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3161 and arm_attr_merge_7.stdout.
3162 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3163 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3164 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3165 arm_attr_merge_7b.o): New rules.
3166 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3167 arm_attr_merge_7
3168 * testsuite/Makefile.in: Regenerate.
3169 * testsuite/arm_attr_merge.sh: New file.
3170 * testsuite/arm_attr_merge_[67][ab].s: Same.
3171
3e01a7fd
NC
31722010-05-05 Nick Clifton <nickc@redhat.com>
3173
3174 * po/es.po: Updated Spanish translation.
3175
7ad2014a
L
31762010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3177
3178 * Makefile.am (install-exec-local): Properly install gold as
3179 default cross linker.
3180 * Makefile.in: Regenerated.
3181
4fda8867
NC
31822010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3183 Nick Clifton <nickc@redhat.com>
3184
3185 * configure.ac (install_as_default): Define and set to false
3186 unless --enable-gold or --enable-gold=both/gold has been
3187 specified.
3188 * configure: Regenerate.
3189
3190 * Makefile.am (install-exec-local): Install the executable as
3191 'ld.gold'. If install_as_default is true then also install it as
3192 'ld'.
3193 * Makefile.in: Regenerated.
3194
bd288ea2
ILT
31952010-04-24 Ian Lance Taylor <iant@google.com>
3196
3197 * layout.cc (Layout::layout_reloc): In relocatable link don't
3198 combine reloc sections for grouped sections.
3199
ef38fd8a
ST
32002010-04-23 Sriraman Tallam <tmsriram@google.com>
3201
3202 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3203 sections that are not ordinary to icf.
3204 * icf.cc (get_section_contents): Handle relocation pointing to section
3205 with no object or shndx information.
3206 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3207 * testsuite/Makefile.in: Regenerate.
3208 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3209 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3210
f6973bdc
ILT
32112010-04-22 Ian Lance Taylor <iant@google.com>
3212
3213 * expression.cc (Expression::Expression_eval_info): Add
3214 result_alignment_pointer field.
3215 (Expression::eval_with_dot): Add result_alignment_pointer
3216 parameter. Change all callers.
3217 (Expression::eval_maybe_dot): Likewise.
3218 (class Binary_expression): Add alignment_pointer parameter to
3219 left_value and right_value. Change all callers.
3220 (BINARY_EXPRESSION): Set result alignment.
3221 (class Trinary_expression): Add alignment_pointer parameter to
3222 arg2_value and arg3_value. Change all callers.
3223 (Trinary_cond::value): Set result alignment.
3224 (Max_expression::value, Min_expression::value): Likewise.
3225 (Align_expression::value): Likewise.
3226 * script-sections.cc (class Sections_element): Add dot_alignment
3227 parameter to set_section_addresses virtual function. Update
3228 instantiations.
3229 (class Output_section_element): Likewise.
3230 (Script_sections::create_segments): Add dot_alignment parameter.
3231 Change all callers.
3232 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3233 (Script_sections::set_phdrs_clause_addresses): Likewise.
3234 * script-sections.h: Update declarations.
3235 * script.h: Update declarations.
3236 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3237 min_p_align.
3238 * testsuite/script_test_3.t: Set large alignment.
3239 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3240 segment has expected alignment.
3241
9c9c98a5
NC
32422010-04-22 Nick Clifton <nickc@redhat.com>
3243
3244 * po/gold.pot: Updated by the Translation project.
3245 * po/vi.po: Updated Vietnamese translation.
3246
2253bfba
L
32472010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3248
3249 * testsuite/Makefile.am (check_PROGRAMS): Add
3250 icf_virtual_function_folding_test.
3251 * testsuite/Makefile.in: Regenerated.
3252
85fdf906
AH
32532010-04-15 Andrew Haley <aph@redhat.com>
3254
3255 * options.h (merge_exidx_entries): New option.
3256 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3257 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3258 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3259 (Target_arm::merge_exidx_entries): New function.
3260 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3261 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3262 to Arm_exidx_fixup constructor.
3263 Add new arg, merge_exidx_entries.
3264 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3265 Arm_output_section::fix_exidx_coverage.
3266
ce97fa81
ST
32672010-04-18 Sriraman Tallam <tmsriram@google.com>
3268
3269 * icf.cc (get_section_contents): Check for preemptible functions.
3270 Ignore addend when appropriate.
3271 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3272 section folded.
3273 (add_from_relobj): Check for section folded.
3274 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3275 * symtab.h (should_add_dynsym_entry): Add new parameter.
3276 * target-reloc.h (scan_relocs): Check for section folded.
3277 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3278 Check reloc types for function pointers in shared objects.
3279 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3280 case.
3281 (icf_preemptible_functions_test): New test case.
3282 (icf_string_merge_test): New test case.
3283 * testsuite.Makefile.in: Regenerate.
3284 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3285 bar_glob. Refactor code.
3286 * testsuite/icf_preemptible_functions_test.cc: New file.
3287 * testsuite/icf_preemptible_functions_test.sh: New file.
3288 * testsuite/icf_string_merge_test.cc: New file.
3289 * testsuite/icf_string_merge_test.sh: New file.
3290 * testsuite/icf_virtual_function_folding_test.cc: New file.
3291 * testsuite/icf_virtual_function_folding_test.sh: New file.
3292
04ceb17c
DK
32932010-04-14 Doug Kwan <dougkwan@google.com>
3294
3295 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3296 for local symbol recounting if we remove a section due to ICF.
3297 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3298 there are no regular objects in input.
3299
153e7da4
DK
33002010-04-13 Doug Kwan <dougkwan@google.com>
3301
3302 * arm.cc (Arm_input_section::set_final_data_size): Compute
3303 accurate final data size instead of using current data size.
3304
4dbd9faf
DK
33052010-04-09 Doug Kwan <dougkwan@google.com>
3306
3307 * layout.cc (Layout::choose_output_section): Handle script section
3308 types.
3309 (Layout::make_output_section_for_script): Add section type parameter.
3310 Handle script section types.
3311 * layout.h (Layout::make_output_section_for_script): Add section
3312 type parameter.
3313 * output.cc (Output_section::Output_section): Initialize data member
3314 is_noload_.
3315 (Output_section::do_reset_address_and_file_offset): Do not set address
3316 to 0 if section is a NOLOAD section.
3317 * output.h (Output_section::is_noload): New method.
3318 (Output_section::set_is_noload): Ditto.
3319 (Output_section::is_noload_): New data member.
3320 * script-c.h (Script_section_type): New enum type.
3321 (struct Parser_output_section_header): Add new file section_type.
3322 * script-sections.cc (Sections_element::output_section_name): Add
3323 parameter for returning script section type.
3324 (Output_section_definition::output_section_name): Ditto.
3325 (Output_section_definition::section_type)P; New method.
3326 (Output_section_definiton::script_section_type_name): Ditto.
3327 (Output_section_definition::script_section_type_): New data member.
3328 (Output_section_definition::Output_section_definition): Initialize
3329 data member Output_section_definition::script_section_type_.
3330 (Output_section_definition::create_sections): Pass script section type
3331 to Layout::make_output_section_for_script.
3332 (Output_section_definition::output_section_name): Return script
3333 section type to caller.
3334 (Output_section_definition::set_section_address): Do not advance
3335 dot value and load address if section type is NOLOAD. Set address
3336 of NOLOAD sections regardless of section flags.
3337 (Output_section_definition::print): Print section type if it is
3338 not SCRIPT_SECTION_TYPE_NONE.
3339 (Output_section_definition::section_type): New method.
3340 (Output_section_definition::script_section_type_name): Ditto.
3341 (Script_sections::output_section_name): Add new parameter
3342 PSECTION_TYPE for returning script section type. Pass it to
3343 section elements. Handle discard sections.
3344 (Sort_output_sections::operator()): Handle NOLOAD sections.
3345 * script-sections.h (Script_sections::Section_type): New enum type.
3346 (Script_sections::output_section_name): Add a new parameter for
3347 returning script section type.
3348 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3349 INFO and NOLOAD.
3350 * yyscript.y (union): Add new field SECTION_TYPE.
3351 (COPY, DSECT, INFO, NOLOAD): New tokens.
3352 (opt_address_and_section_type): Change type to output_section_header.
3353 (section_type): New non-terminal
3354 (section_header): Handle section type.
2253bfba 3355 (opt_address_and_section_type): Return section type value.
4dbd9faf 3356
721ea635
L
33572010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3358
3359 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3360 * testsuite/plugin_common_test_2.c (foo): Likewise.
3361
6bf924b0
DK
33622010-04-08 Doug Kwan <dougkwan@google.com>
3363
3364 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3365 Output_merge_data.
3366 * output.cc (Output_section::add_merge_input_section): Simplify
3367 code and return status of Output_merge_base::add_input_section.
e1df38aa 3368 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3369 returns true.
3370
24af6f92
DK
33712010-04-07 Doug Kwan <dougkwan@google.com>
3372
3373 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3374 if section is marked as containing instructions but has no mapping
3375 symbols.
3376 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3377 correct section index.
3378 (Arm_relobj::find_linked_text_section): Ditto.
3379
00698fc5
CC
33802010-04-07 Cary Coutant <ccoutant@google.com>
3381
3382 * archive.cc (include_member): Destroy Read_symbols_data object before
3383 releasing file.
3384 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3385 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3386 (Read_symbols_data::~Read_symbols_data) New destructor.
3387 (Section_relocs::Section_relocs) New constructor.
3388 (Section_relocs::~Section_relocs) New destructor.
3389 (Read_relocs_data::Read_relocs_data) New constructor.
3390 (Read_relocs_data::~Read_relocs_data) New destructor.
3391 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3392 pointers to NULL after deleting.
3393
7296d933
DK
33942010-04-07 Doug Kwan <dougkwan@google.com>
3395
3396 * arm.cc: Replace "endianity" with "endianness" in comments.
3397 (Arm_exidx_cantunwind): Ditto.
3398 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3399 (Arm_relobj::merge_flags_and_attributes): New method.
3400 (Arm_relobj::merge_flags_and_attributes_): New data member.
3401 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3402 (Arm_relobj::scan_sections_for_stubs): Ditto.
3403 (Arm_relobj::do_read_symbols): Check to see if we really want to
3404 merge processor-specific flags and attributes. Exit early if
3405 an object is empty except for section names and the undefined symbol.
3406 (Target_arm::do_finalize_sections): Move check for ELF format to
3407 Arm_relobj::do_read_symbols. Merge processor specific flags and
3408 attributes from a regular object only when we have determined that
3409 it is aapropriate. Do not create an .ARM.attributes section in
3410 output if there is no regular input object.
3411 (Target_arm::merge_processor_specific_flags): Check
3412 --warn-mismatch before printing any error.
3413 (Target_arm::merge_object_attributes): Ditto.
3414 * gold.cc (queue_middle_tasks): Handle the case in which there is
3415 no regular object in input.
3416 * options.cc (General_options::parse_EB): New method.
3417 (General_options::parse_EL): Same.
3418 (General_options::General_options): Initialize endianness_.
3419 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3420 New options.
3421 (General_options::Endianness): New enum.
3422 (General_options::endianness): New method.
3423 (General_options::endianness_): New data member.
3424 * parameters.cc (Parameters::set_options): Check target endianness.
3425 (Parameters::set_target_once): Ditto.
3426 (Parameters::check_target_endianness): New method.
3427 (parameters_force_valid_target): If either -EL or -EB is specified,
3428 use it to define endianness of default target.
3429 * parameters.h (Parameters::check_target_endianness): New method
3430 declaration.
3431 * target.h (class Target): Change "endianity" to "endianness"
3432 in comments.
3433
efc8d4f2
RW
34342010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3435
3436 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3437 * configure: Regenerate.
3438 * Makefile.in: Regenerate.
3439 * testsuite/Makefile.in: Regenerate.
3440
be234d88
CC
34412010-04-06 Cary Coutant <ccoutant@google.com>
3442
3443 gcc PR lto/42757
3444 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3445 prevailing definitions of common symbols.
3446 * testsuite/plugin_test_6.sh: New test case.
3447 * testsuite/plugin_common_test_1.c: New test case.
3448 * testsuite/plugin_common_test_2.c: New test case.
3449 * testsuite/Makefile.am (plugin_test_6): New test case.
3450 * testsuite/Makefile.in: Regenerate.
3451
bd32c6bd
NC
34522010-04-06 Nick Clifton <nickc@redhat.com>
3453
3454 * po/vi.po: New Vietnamese translation.
3455
323c532f
DK
34562010-03-30 Doug Kwan <dougkwan@google.com>
3457
3458 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3459
4fcd97eb
DK
34602010-03-25 Doug Kwan <dougkwan@google.com>
3461
3462 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3463 to avoid a conversion warning on a 32-bit host.
3464
4ebf39db
ILT
34652010-03-24 Ian Lance Taylor <iant@google.com>
3466
3467 * testsuite/script_test_3.t: Add a TLS segment.
3468 * testsuite/Makefile.am (check_PROGRAMS): Add
3469 tls_phdrs_script_test.
3470 (tls_phdrs_script_test_SOURCES): Define.
3471 (tls_phdrs_script_test_DEPENDENCIES): Define.
3472 (tls_phdrs_script_test_LDFLAGS): Define.
3473 (tls_phdrs_script_test_LDADD): Define.
3474 * testsuite/Makefile.in: Rebuild.
3475
4a599bdd
CC
34762010-03-23 Cary Coutant <ccoutant@google.com>
3477
3478 * fileread.cc (find_or_make_view): Fix comment.
3479
6c93b22c
ILT
34802010-03-23 Ian Lance Taylor <iant@google.com>
3481
3482 * script-sections.cc (class Orphan_section_placement): Define
3483 PLACE_TLS and PLACE_TLS_BSS.
3484 (Orphan_section_placement::Orphan_section_placement): Initialize
3485 new places.
3486 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3487 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3488 (tls_script_test_SOURCES): Define.
3489 (tls_script_test_DEPENDENCIES): Define.
3490 (tls_script_test_LDFLAGS): Define.
3491 (tls_script_test_LDADD): Define.
3492 * testsuite/Makefile.in: Rebuild.
3493
a2c7281b
DK
34942010-03-22 Doug Kwan <dougkwan@google.com>
3495
3496 * arm.cc (Arm_relocate_functions::abs8,
3497 Arm_relocate_functions::abs16): Use correct check for overflow
3498 specified in the ARM ELF specs.
3499 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3500 target of a BLX instruction specially.
3501 (Reloc_stub::stub_type_for_reloc): Ditto.
3502 (Relocate::relocate): Use symbolic names instead of numeric relocation
3503 codes to report error.
3504 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3505 workaround.
3506 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3507 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3508 thumb2_blx_out_of_range.stdout
3509 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3510 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3511 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3512 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3513 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3514 thumb2_blx_in_range, thumb2_blx_in_range.o,
3515 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3516 thumb2_blx_out_of_range.o): New rules.
3517 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3518 thumb2_blx_in_range and thumb2_blx_out_of_range.
3519 * testsuite/Makefile.in: Regenerate.
3520 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3521 * testsuite/thumb_blx_in_range.s: New file.
3522 * testsuite/thumb_blx_out_of_range.s: New file.
3523
b0193076
RÁE
35242010-03-22 Rafael Espindola <espindola@google.com>
3525
3526 * archive.cc (Should_include): Move to archive.h.
3527 (should_include_member): Make it a member of Archive.
3528 (Lib_group): New.
3529 (Add_lib_group_symbols): New.
3530 * archive.h: Include options.h.
3531 (Archive_member): Moved from Archive.
3532 (Should_include): Moved from archive.cc.
3533 (Lib_group): New.
3534 (Add_lib_group_symbols): New.
3535 * dynobj.cc (do_should_include_member): New.
3536 * dynobj.h (do_should_include_member): New.
3537 * gold.cc (queue_initial_tasks): Update call to queue.
3538 * main.cc (main): Print lib group stats.
3539 * object.cc (do_should_include_member): New.
3540 * object.h: Include archive.h.
3541 (Object::should_include_member): New.
3542 (Object::do_should_include_member): New.
3543 (Sized_relobj::do_should_include_member): New.
3544 * options.cc (General_options::parse_start_lib): New.
3545 (General_options::parse_end_lib): New.
3546 (Input_arguments::add_file): Handle lib groups.
3547 (Input_arguments::start_group): Check we are not in a lib.
3548 (Input_arguments::start_lib): New.
3549 (Input_arguments::end_lib): New.
3550 * options.h (General_options): Add start_lib and end_lib.
3551 (Input_argument::lib_): New.
3552 (Input_argument::lib): New.
3553 (Input_argument::is_lib): New.
3554 (Input_file_lib): New.
3555 (Input_arguments::in_lib_): New.
3556 (Input_arguments::in_lib): New.
3557 (Input_arguments::start_lib): New.
3558 (Input_arguments::end_lib_): New.
3559 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3560 in unused members as preempted.
3561 (Sized_pluginobj::do_should_include_member): New.
3562 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3563 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3564 return the blocker.
3565 (Read_symbols::do_whole_lib_group): New.
3566 (Read_symbols::do_lib_group): New.
3567 (Read_symbols::do_read_symbols): Handle lib groups.
3568 (Read_symbols::get_name): Handle lib groups.
3569 * readsyms.h (Read_symbols): Add an archive member pointer.
3570 (Read_symbols::do_whole_lib_group): New.
3571 (Read_symbols::do_lib_group): New.
3572 (Read_symbols::member_): New.
3573 * script.cc (read_input_script): Update call to queue_soon.
3574
d099120c
DK
35752010-03-19 Doug Kwan <dougkwan@google.com>
3576
3577 * arm.cc (Stub_table::Stub_table): Initialize new data members
3578 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3579 (Stub_table::add_reloc_stub): Assign stub offset and update
3580 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3581 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3582 New data members.
3583 (Stub_table::update_data_size_and_addralign): Use
3584 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3585 instead of going over all reloc stubs.
3586 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3587 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3588 Stringpool_template::offset_ to size of Stringpool_char.
3589 (Stringpool_template::new_key_offset): Remove code to initialize
3590 Stringpool_template::offset_.
3591 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3592 Stringpool_template::offset_ to zero.
3593
1aa37384
DK
35942010-03-15 Doug Kwan <dougkwan@google.com>
3595
3596 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3597 offset_.
3598 (Stringpool_template::new_key_offset): New method.
3599 (Stringpool_template::add_string): Assign offsets when adding new
3600 strings.
3601 (Stringpool_template::set_string_offsets): Do not set string offsets
3602 when not optimizing.
3603 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3604 member size_.
3605 (Chunked_vector::clear): Clear size_.
3606 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3607 (Chunked_vector::size): Return size_.
3608 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3609 (Chunked_vector::size_): New data member.
1aa37384
DK
3610 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3611 (Stringpool_template::new_key_offset): New method declaration.
3612 (Stringpool_template::offset_): New data member.
3613
b672b057
RÁE
36142010-03-15 Rafael Espindola <espindola@google.com>
3615
3616 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3617 Add_symbols' constructor.
3618 * readsyms.h (Add_symbols): Remove the input_group member.
3619
b6848d3c
ILT
36202010-03-10 Ian Lance Taylor <iant@google.com>
3621
3622 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3623 target to ask whether a reference to a symbol requires a stack
3624 split.
3625 * target.h (Target::is_call_to_non_split): New function.
3626 (Target::do_is_call_to_non_split): Declare virtual function.
3627 * target.cc: Include "symtab.h".
3628 (Target::do_is_call_to_non_split): New function.
3629 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3630
a2a5469e
CC
36312010-03-10 Cary Coutant <ccoutant@google.com>
3632
3633 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3634 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3635 (File_read::open[2]): Add whole_file_view_ to list of views.
3636 (File_read::make_view): Remove test of whole_file_view_.
3637 (File_read::find_or_make_view): Create whole_file_view_ if
3638 necessary.
3639 (File_read::clear_views): Replace bool parameter with enum;
3640 adjust all callers. Don't delete views with permanent data;
3641 do delete cached views and views from archives if
3642 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3643 if clearing the corresponding view.
3644 * fileread.h (File_read::Clear_views_mode): New enum.
3645 (File_read::View::is_permanent_view): New method.
3646 (File_read::clear_views): Replace bool parameter
3647 with enum; adjust all callers.
3648 * options.h (General_options): Change keep_files_mapped option;
3649 add map_whole_files.
3650 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3651 releasing the file.
3652 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3653 the file.
3654
8861f32b
DM
36552010-03-10 David S. Miller <davem@davemloft.net>
3656
3657 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
3658
d62d0f5f
ST
36592010-03-09 Sriraman Tallam <tmsriram@google.com>
3660
3661 * icf.cc (get_section_contents): Add '@' marker after processing the
3662 merge reloc.
3663
9177756d
DK
36642010-03-08 Doug Kwan <dougkwan@google.com>
3665
3666 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
3667 due to a conversion warning.
3668 (Arm_relobj::update_output_local_symbol_count): Check for local
3669 symbol with unset output index.
3670
9e9e071b
ILT
36712010-03-05 Ian Lance Taylor <iant@google.com>
3672
3673 * options.h (class General_options): Add --spare-dynamic-tags.
3674 * output.cc (Output_data_dynamic::set_final_data_size): Implement
3675 --spare-dynamic-tags.
3676
a81ee015
ILT
36772010-03-05 Ian Lance Taylor <iant@google.com>
3678
3679 * incremental.cc: Include "libiberty.h".
3680
44ec90b9
RO
36812010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
3682
3683 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
3684 function, is_info_ member.
3685 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
3686 (Versions::Versions): Update caller.
3687 (Versions::define_base_version): Likewise.
3688 (Versions::add_def): Likewise.
3689
0897ed3b
ST
36902010-03-03 Sriraman Tallam <tmsriram@google.com>
3691
3692 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
3693 (Scan::possible_function_pointer_reloc): New function.
3694 (Scan::local_reloc_may_be_function_pointer): Change to call
3695 possible_function_pointer_reloc.
3696 (Scan::global_reloc_may_be_function_pointer): Ditto.
3697 * icf.h (Icf::check_section_for_function_pointers): Change to reject
3698 relocations in ".data.rel.ro._ZTV" section.
3699 * testsuite/icf_safe_so_test.sh: Change to pass i386.
3700 * testsuite/icf_safe_so_test.cc: Ditto.
3701 * testsuite/icf_safe_test.cc: Ditto.
3702 * testsuite/icf_safe_test.sh: Ditto.
3703
d3bbad62
ILT
37042010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3705 Ian Lance Taylor <iant@google.com>
3706
3707 * target-reloc.h (relocate_section): Check the symbol table index
3708 for -1U before setting the local symbol index.
3709 (scan_relocatable_relocs): If copying the relocation, record that
3710 the local symbol is required.
3711 * object.h (Symbol_value::is_output_symtab_index_set): New
3712 function.
3713 (Symbol_value::may_be_discarded_from_output_symtab): New
3714 function.
3715 (Symbol_value::has_output_symtab_entry): New function.
3716 (Symbol_value::needs_output_symtab_entry): Remove.
3717 (Symbol_value::output_symtab_index): Make sure the symbol index is
3718 set.
3719 (Symbol_value::set_output_symtab_index): Make sure the symbol
3720 index is not set. Make sure the new index is valid.
3721 (Symbol_value::set_must_have_output_symtab_entry): New function.
3722 (Symbol_value::has_output_dynsym_entry): New function.
3723 (Symbol_value::set_output_dynsym_index): Make sure the new index
3724 is valid.
3725 (Sized_relobj::set_must_have_output_symtab_entry): New function.
3726 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
3727 local symbol if permitted.
3728 (Sized_relobj::do_finalize_local_symbols): Call
3729 is_output_symtab_index_set rather than needs_output_symtab_entry.
3730 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
3731 rather than needs_output_symtab_entry. Call
3732 has_output_dynsym_entry rather than needs_output_dynsym_entry.
3733 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
3734 is_output_symtab_index_set rather than needs_output_symtab_entry.
3735 * testsuite/discard_locals_relocatable_test.c: New file.
3736 * testsuite/discard_locals_test.sh: Test -r.
3737 * testsuite/Makefile.am (check_DATA): Add
3738 discard_locals_relocatable_test1.syms,
3739 discard_local_relocatable_test2.syms.
3740 (MOSTLYCLEANFILES): Likewise. Also add
3741 discard_locals_relocatable_test1.lout and
3742 discard_locals_relocatable_test2.out.
3743 (discard_locals_relocatable_test1.syms): New target.
3744 (discard_locals_relocatable_test.o): New target.
3745 (discard_locals_relocatable_test1.out): New target.
3746 (discard_locals_relocatable_test2.syms): New target.
3747 (discard_locals_relocatable_test2.out): New target.
3748 (various): Add missing ../ld-new dependencies.
3749 * testsuite/Makefile.in: Rebuild.
3750
7e8ccf26
NC
37512010-03-03 Nick Clifton <nickc@redhat.com>
3752
3753 * po/fi.po: New Finnish translation.
3754
2a0ff005
DK
37552010-03-01 Doug Kwan <dougkwan@google.com>
3756
3757 * layout.cc (Layout::Layout): Force section types of .init_array*,
3758 .preinit_array* and .fini_array* sections.
3759 * output.cc (Output_section::Input_section_sort_entry::has_priority):
3760 Fix check of return value of std::string::find.().
3761 (Output_section::Input_section_sort_compare::operator()): Remove
3762 comment about .init_array.
3763 (Output_section::Input_section_sort_init_fini_compare::operator()):
3764 New method.
3765 (Output_section::sort_attached_input_sections): Handle .init_array
3766 and .fini_array specially.
3767 * output.h (Output_section::Inut_section_sort_compare): Update
3768 comment.
3769 (Output_section::Input_section_sort_init_fini_compare): New struct.
3770
c3e4ae29
DK
37712010-02-26 Doug Kwan <dougkwan@google.com>
3772
3773 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
3774 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
3775 * testsuite/debug_msg.sh: Avoid matching source line number for
3776 use of global variable undef_int.
3777
2fd9ae7a
DK
37782010-02-26 Doug Kwan <dougkwan@google.com>
3779
3780 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
3781 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
3782 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
3783 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
3784 * options.cc (General_options::General_options): Initialize member
3785 fix_v4bx_.
3786 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
3787 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
3788 and rm_no_fix_v4bx.stdout
3789 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
3790 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
3791 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
3792 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
3793 and arm_no_fix_v4bx.
3794 * Makefile.in: Regenerate.
3795 * testsuite/arm_fix_v4bx.s: New file.
3796 * testsuite/arm_fix_v4bx.sh: Ditto.
3797
67ec7d0b
DK
37982010-02-24 Doug Kwan <dougkwan@google.com>
3799
3800 * arm.cc (Target_arm::got_section): Make the .got section the first
3801 non RELRO section in the data segment.
3802 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
3803 suffixes of section names.
3804
10165461
DK
38052010-02-24 Doug Kwan <dougkwan@google.com>
3806
3807 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
3808 flags and attributes merging if an input file is a binary file.
3809 * fileread.cc (Input_file::open): Record format of original file.
3810 * fileread.h (Input_file::Format): New enum type.
3811 (Input_file::Input_file): Initialize data member format_.
3812 (Input_file::format): New method definition.
3813 (Input_file::format_):: New data member.
3814
4a54abbb
DK
38152010-02-24 Doug Kwan <dougkwan@google.com>
3816
3817 * arm.cc (Arm_output_data_got): New class.
3818 (ARM_TCB_SIZE): New constant
3819 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
3820 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
3821 If user uses a script with a SECTIONS clause, issue only a warning
3822 for a misplaced EXIDX input section. Otherwise, issue an error.
3823 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
3824 garbage collection.
3825 (Target_arm::got_mode_index_entry): Handle static linking.
3826 (Target_arm::Scan::local): Ditto.
3827 (Target_arm::Scan::global): Ditto.
3828 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
3829 all incorrectly implemented relocations.
e1df38aa 3830 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
3831 Arm_output_section::fix_exidx_coverage.
3832 * layout.cc (Layout::section_name_mapping): Remove trailing dots
3833 from ".ARM.exidx." and ".ARM.extab.".
3834
ca419a6f
ILT
38352010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3836
3837 * arm.cc (Target_arm::do_finalize_sections): Create attribute
3838 section if it does not already exist.
3839 * attributes.cc (Attributes_section_data::Attributes_section_data):
3840 Don't crash if size is zero.
3841
135b9c78
ILT
38422010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3843 Ian Lance Taylor <iant@google.com>
3844
3845 * gold.cc (queue_middle_tasks): If no input files were opened,
3846 exit.
3847 * workqueue.h (Task_function::Task_function): Assert that there is
3848 a blocker.
3849
bb0bfe4f
DK
38502010-02-22 Doug Kwan <dougkwan@google.com>
3851
3852 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
3853 * icf.cc (get_section_contents): Cast snprintf arguments to long long
3854 types to avoid warnings due to different uint64_t implementations
3855 on different hosts.
3856
2a2b6d42
DK
38572010-02-21 Doug Kwan <dougkwan@google.com>
3858
3859 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
3860 handling of the maximum backward branch offset.
3861 (Arm_relocate_functions::thumb_branch_common): Ditto.
3862 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
3863 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 3864 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
3865 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
3866 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
3867 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
3868 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
3869 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
3870 thumb_bl_out_of_range thumb_bl_out_of_range.o,
3871 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
3872 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
3873 thumb2_bl_out_of_range.o): New rules.
3874 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
3875 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
3876 thumb2_bl_out_of_range
3877 * testsuite/Makefile.in: Regenerate.
3878 * testsuite/arm_bl_in_range.s: New file.
3879 * testsuite/arm_bl_out_of_range.s: Ditto.
3880 * testsuite/arm_branch_in_range.sh: Ditto.
3881 * testsuite/arm_branch_range.t: Ditto.
3882 * testsuite/thumb2_branch_range.t: Ditto.
3883 * testsuite/thumb_bl_in_range.s: Ditto.
3884 * testsuite/thumb_bl_out_of_range.s: Ditto.
3885 * testsuite/thumb_branch_range.t: Ditto.
3886
b487ad64
ST
38872010-02-20 Sriraman Tallam <tmsriram@google.com>
3888
3889 * gc.h (gc_process_relocs): Change vectors to point to the new list.
3890 Add reloc offset information.
3891 * icf.cc (get_section_contents): Change iterators to point to the new
3892 vectors. Add reloc offset information to the contents.
3893 * icf.h (Icf::Sections_reachable_info): New typedef.
3894 (Icf::Sections_reachable_list): New typedef.
3895 (Icf::Offset_info): New typedef.
3896 (Icf::Reloc_info): New struct typedef.
3897 (Icf::Reloc_info_list): New typedef.
3898 (Icf::symbol_reloc_list): Delete method.
3899 (Icf::addend_reloc_list): Delete method.
3900 (Icf::section_reloc_list): Delete method.
3901 (Icf::reloc_info_list): New method.
3902 (Icf::reloc_info_list_): New member.
3903
f96accdf
DK
39042010-02-19 Doug Kwan <dougkwan@google.com>
3905
3906 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
3907 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
3908 * arm.cc (Arm_relocation_functions): New forward declaration.
3909 (Target_arm::Target_arm): Initialize new data members
3910 got_mod_index_offset_ and tls_base_symbol_defined_.
3911 (Target_arm::Relocate::relocate_tls): New method.
3912 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
3913 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
3914 New methods.
3915 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
3916 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
3917 (Target_arm::got_mod_index_offset_,
3918 Target_arm::tls_base_symbol_defined_): New data members.
3919 (Target_arm::Scan::local, Target::Scan::global,
3920 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
3921 relocations.
3922
c8761b9a
DK
39232010-02-18 Doug Kwan <dougkwan@google.com>
3924
3925 * arm.cc (Arm_relobj::find_linked_text_section): New method.
3926 (Arm_relobj::make_exidx_input_section): Pass section index of linked
3927 text section as a parameter becuase some broken tools may not set
3928 the link in section header.
3929 (Target_arm::has_got_section): New method.
3930 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
3931 without any mapping symbol as data only. Remove warning.
3932 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
3933 link in its section header, try to discover the link by inspecting the
3934 REL31 relocation at the beginning of the section.
3935 (Target_arm::Scan::check_non_pic): Report name of offending relocation
3936 in error message.
3937 (Target_arm::Scan::global): Treat any reference to the symbol
3938 _GLOBAL_OFFSET_TABLE_ as a GOT access.
3939
21bb3914
ST
39402010-02-12 Sriraman Tallam <tmsriram@google.com>
3941
3942 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
3943 (Scan::global_reloc_may_be_function_pointer): New function.
3944 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3945 (Scan::global_reloc_may_be_function_pointer): New function.
3946 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
3947 (Scan::global_reloc_may_be_function_pointer): New function.
3948 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
3949 (Scan::global_reloc_may_be_function_pointer): New function.
3950 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
3951 (Scan::global_reloc_may_be_function_pointer): New function.
3952 (Scan::possible_function_pointer_reloc): New function.
3953 (Target_x86_64::can_check_for_function_pointers): New function.
3954 * gc.h (gc_process_relocs): Scan relocation types to determine if
3955 function pointers were taken for targets that support it.
3956 * icf.cc (Icf::find_identical_sections): Include functions for
3957 folding in safe ICF whose pointer is not taken.
3958 * icf.h (Secn_fptr_taken_set): New typedef.
3959 (fptr_section_id_): New member.
3960 (section_has_function_pointers): New function.
3961 (set_section_has_function_pointers): New function.
3962 (check_section_for_function_pointers): New function.
3963 * options.h: Fix comment for safe ICF option.
3964 * target.h (can_check_for_function_pointers): New function.
3965 * testsuite/Makefile.am: Add icf_safe_so_test test case.
3966 Modify icf_safe_test for X86-64.
3967 * testsuite/Makefile.in: Regenerate.
3968 * testsuite/icf_safe_so_test.cc: New file.
3969 * testsuite/icf_safe_so_test.sh: New file.
3970 * testsuite/icf_safe_test.cc (kept_func_3): New function.
3971 (main): Change to take pointer to function kept_func_3.
3972 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
3973 folding is done correctly for X86-64.
3974
0da6fa6c
DM
39752010-02-12 David S. Miller <davem@davemloft.net>
3976
3977 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
3978 is_symbolless parameter.
3979 (Output_reloc<SHT_REL>::is_symbolless): New.
3980 (Output_reloc<SHT_REL>::is_symbolless_): New.
3981 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
3982 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
3983 (Output_reloc<SHT_RELA>::is_symbolless): New.
3984 (Output_data_reloc::add_global): Handle is_symbolless.
3985 (Output_data_reloc::add_global_relative): Likewise.
3986 (Output_data_reloc::add_local): Likewise.
3987 (Output_data_reloc::add_local_relative): Likewise.
3988 (Output_data_reloc::add_symbolless_global_addend): New.
3989 (Output_data_reloc::add_symbolless_local_addend): New.
3990 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
3991 is_symbolless.
3992 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
3993 instead of ->is_relative_
3994 (Output_reloc::write): Likewise.
3995 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
3996 (Output_reloc::write_rel): Simplify.
3997
3998 * sparc.cc (Target_sparc::Scan::local): Use
3999 ->add_symbolless_local_addend as needed.
4000 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
4001 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
4002 based upon relocation offset.
4003
e4782e83
DK
40042010-02-11 Doug Kwan <dougkwan@google.com>
4005
4006 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4007 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4008 beginning of function.
4009 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4010 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4011 parameter is_32bit in calls to should_apply_static_reloc.
4012 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4013 (check_DATA): Add arm_abs_global.stdout.
4014 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4015 arm_abs_global.stdout): New rules.
4016 (MOSTLLYCLEANFILES): Add arm_abs_global
4017 * Makefile.in: Regenerate.
4018 * testsuite/arm_abs_global.s: New file.
4019 * testsuite/arm_abs_global.sh: Ditto.
4020 * testsuite/arm_abs_lib.s: Ditto.
4021
93ceb764
ILT
40222010-02-11 Ian Lance Taylor <iant@google.com>
4023
4024 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4025 Read_relocs task.
4026 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4027 Allocate_commons_task first.
4028 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4029 task, rather than symtab_lock_.
4030 (Gc_process_relocs::~Gc_process_relocs): New function.
4031 (Gc_process_relocs::is_runnable): Check this_blocker_.
4032 (Gc_process_relocs::locks): Use next_blocker_ rather than
4033 blocker_.
4034 (Scan_relocs::~Scan_relocs): New function.
4035 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4036 symtab_lock_.
4037 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4038 next_blocker_.
4039 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4040 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4041 constructor accordingly.
4042 (class Gc_process_relocs): Likewise.
4043 (class Scan_relocs): Likewise.
4044 * common.h (class Allocate_commons_task): Remove symtab_lock_
4045 field, and corresponding constructor parameter.
4046 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4047 symtab_lock_.
4048 (Allocate_commons_task::locks): Likewise.
4049
114dfbe1
ILT
40502010-02-11 Ian Lance Taylor <iant@google.com>
4051
4052 * gold-threads.h (class Once): Define.
4053 (class Initialize_lock): Rewrite as child of Once.
4054 * gold-threads.cc (class Once_initialize): Define.
4055 (once_pointer_control): New static variable.
4056 (once_pointer, once_arg): New static variables.
4057 (c_run_once): New static function.
4058 (Once::Once, Once::run_once, Once::internal_run): New functions.
4059 (class Initialize_lock_once): Remove.
4060 (initialize_lock_control): Remove.
4061 (initialize_lock_pointer): Remove.
4062 (initialize_lock_once): Remove.
4063 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4064 (Initialize_lock::initialize): Rewrite.
4065 (Initialize_lock::do_run_once): New function.
4066 * archive.cc (Archive::interpret_header): Only clear name if it is
4067 not already empty.
4068 * fileread.cc: Include "gold-threads.h"
4069 (file_counts_lock): New static variable.
4070 (file_counts_initialize_lock): Likewise.
4071 (File_read::release): Only increment counts when using --stats.
4072 Use a lock around the increment.
4073 * parameters.cc (class Set_parameters_target_once): Define.
4074 (set_parameters_target_once): New static variable.
4075 (Parameters::Parameters): Move here from parameters.h.
4076 (Parameters::set_target): Rewrite.
4077 (Parameters::set_target_once): New function.
4078 (Parameters::clear_target): Move here and rewrite.
4079 * parameters.h (class Parameters): Update declarations. Add
4080 set_parameters_target_once_ field.
4081 (Parameters::Parameters): Move to parameters.cc.
4082 (Parameters::clear_target): Likewise.
4083 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4084 task.
4085 (Start_group::~Start_group): New function.
4086 (Start_group::is_runnable): New function.
4087 (Start_group::locks, Start_group::run): New functions.
4088 (Finish_group::run): Change saw_undefined to size_t.
4089 * readsyms.h (class Start_group): Define.
4090 (class Finish_group): Change saw_undefined_ field to size_t.
4091 (Finish_group::Finish_group): Remove saw_undefined and
4092 this_blocker parameters. Change all callers.
4093 (Finish_group::set_saw_undefined): New function.
4094 (Finish_group::set_blocker): New function.
4095 * symtab.h (class Symbol_table): Change saw_undefined to return
4096 size_t. Change saw_undefined_ field to size_t.
4097 * target-select.cc (Set_target_once::do_run_once): New function.
4098 (Target_selector::Target_selector): Initialize set_target_once_
4099 field. Don't initialize lock_ and initialize_lock_ fields.
4100 (Target_selector::instantiate_target): Rewrite.
4101 (Target_selector::set_target): New function.
4102 * target-select.h (class Set_target_once): Define.
4103 (class Target_selector): Update declarations. Make
4104 Set_target_once a friend. Remove lock_ and initialize_lock_
4105 fields. Add set_target_once_ field.
4106
fa17a3f4
ILT
41072010-02-10 Ian Lance Taylor <iant@google.com>
4108
4109 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4110 queueing any tasks.
4111 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4112 (queue_middle_tasks): Add all blockers before queueing any tasks.
4113 (queue_final_tasks): Likewise.
4114 * token.h (Task_token::add_blockers): New function.
4115 * object.h (Input_objects::number_of_relobjs): New function.
4116
c7177d31
ILT
41172010-02-10 Ian Lance Taylor <iant@google.com>
4118
5de0e392
ILT
4119 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4120 shared, not if not position independent.
4121 * x86_64.cc (Relocate::relocate_tls): Likewise.
4122 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4123 (tls_pie_pic_test): New target.
4124 * testsuite/Makefile.in: Rebuild.
4125
c7177d31
ILT
4126 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4127 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4128 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4129 * testsuite/Makefile.in: Rebuild.
4130
684b268a
DM
41312010-02-09 David S. Miller <davem@davemloft.net>
4132
4133 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4134 R_SPARC_RELATIVE using ->add_local_relative().
4135 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4136
612a8d3d
DM
4137 * output.h (Output_data_dynamic::add_section_size): New method
4138 that takes two Output_data objects.
4139 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4140 entry param. Handle it in initializers.
4141 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4142 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4143 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4144 arg.
4145 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4146 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4147 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4148 for dynrel_includes_plt.
4149 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4150 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4151 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4152 before .rela.plt
4153 (Target_sparc::do_finalize_sections): Update to pass true for
4154 dynrel_includes_plt.
4155 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4156 output before .rela.plt
4157 (Target_powerpc::do_finalize_sections): Update to pass true for
4158 dynrel_includes_plt when 32-bit.
4159
cb1be87e
DK
41602010-02-08 Doug Kwan <dougkwan@google.com>
4161
4162 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4163 method.
4164 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4165 Arm_relobj::scan_section_for_cortex_a8_stubs,
4166 Arm_relobj::do_relocation_section): Instead of calling
4167 Output_section::output_address, use faster
4168 Arm_relobj::simple_input_section_output_address.
4169
705b5121
DM
41702010-02-08 David S. Miller <davem@davemloft.net>
4171
4172 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4173 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4174 relocation helper function.
4175
024c4466
DM
4176 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4177 just like R_SPARC_GOT{10,13,22}.
4178 (Target_sparc::Scan::local): Likewise.
4179 (Target_sparc::Relocate:relocate): Likewise.
4180
9109c078
ILT
41812010-02-06 Ian Lance Taylor <iant@google.com>
4182
4183 * configure.ac: Rewrite targetobjs duplicate removal code to use
4184 only shell constructs.
4185 * configure: Rebuild.
4186
cf846138
DK
41872010-02-05 Doug Kwan <dougkwan@google.com>
4188
4189 PR 11247
4190 * arm.cc (Arm_relobj::section_is_scannable): New method.
4191 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4192 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4193
6cfaf60b
DK
41942010-02-04 Doug Kwan <dougkwan@google.com>
4195
4196 PR 11247
4197 * arm-reloc-property.cc (cstdio): Include.
4198 * configure.ac (targetobjs): Remove duplicates.
4199 * configure: Regenerate.
4200 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4201 big and little endian version for a given address size.
4202
5c57f1be
DK
42032010-02-03 Doug Kwan <dougkwan@google.com>
4204
4205 * arm-reloc-property.cc
4206 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4207 definition.
4208 * arm-reloc-property.h
4209 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4210 New method definition.
4211 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4212 declaration.
4213 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4214 overflow to N.
4215 (GOT_PREL): Change implemented to Y.
4216 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4217 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4218 (Arm_relocate_functions::movw_abs_nc): Remove method.
4219 (Arm_relocate_functions::movt_abs): Ditto.
4220 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4221 (Arm_relocate_functions::thm_movt_abs): Ditto.
4222 (Arm_relocate_functions::movw_rel_nc): Ditto.
4223 (Arm_relocate_functions::movw_rel): Ditto.
4224 (Arm_relocate_functions::movt_rel): Ditto.
4225 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4226 (Arm_relocate_functions:thm_movw_rel): Ditto.
4227 (Arm_relocate_functions:thm_movt_rel): Ditto.
4228 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4229 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4230 New method definitions.
4231 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4232 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4233 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4234 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4235 (Target_arm::Relocate::relocate): Check for non-static or
4236 unimplemented relocation code and exit early. Change calls to
4237 Target_arm::reloc_uses_thumb_bit and
4238 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4239 instead. Refactor code to handle similar relocations to increase
4240 code sharing. Remove check for unsupported relocation code in switch
4241 statement.
4242 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4243 relocation property table to find out size. Change error message to
4244 print out the name of a relocation code instead of the numeric value.
4245 (Target_arm::scan_reloc_for_stub): Use relocation property table
4246 instead of calling Target_arm::reloc_uses_thumb_bit().
4247
218c5831
DK
42482010-02-02 Doug Kwan <dougkwan@google.com>
4249
4250 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4251 types of relaxed input section.
4252
0d31c79d
DK
42532010-02-02 Doug Kwan <dougkwan@google.com>
4254
4255 * Makefile.am (HFILES): Add arm-reloc-property.h.
4256 (DEFFILES): New.
4257 (TARGETSOURCES): Add arm-reloc-property.cc
4258 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4259 (libgold_a_SOURCES): $(DEFFILES)
4260 * Makefile.in: Regenerate.
4261 * arm-reloc-property.cc: New file.
4262 * arm-reloc-property.h: New file.
4263 * arm-reloc.def: New file.
4264 * arm.cc: Update comments.
4265 (arm-reloc-property.h): New included header.
4266 (arm_reloc_property_table): New global variable.
4267 (Target_arm::do_select_as_default_target): New method definition.
4268 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4269 arm-reloc-property to targ_extra_obj.
4270 * parameters.cc (set_parameters_target): Call
4271 Target::select_as_default_target().
4272 * target.h (Target::select_as_default_target): New method definition.
4273 (Target::do_select_as_default_target): Same.
4274
546c7457
DK
42752010-02-01 Doug Kwan <dougkwan@google.com>
4276
4277 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4278 first_output_text_section_.
4279 (Arm_exidx_fixup::first_output_text_section): New method definition.
4280 (Arm_exidx_fixup::first_output_text_section_): New data member.
4281 (Arm_exidx_fixup::process_exidx_section): Record the first text
4282 output section seen.
4283 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4284 and entsize in output section header.
4285
11b861d5
DK
42862010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4287
4288 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4289 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4290 (Arm_relocate_functions::thm_alu11): New Method.
4291 (Arm_relocate_functions::thm_pc8): New Method.
4292 (Arm_relocate_functions::thm_pc12): New Method.
4293 (Target_arm::Scan::local): Handle the relocations.
4294 (Target_arm::Scan::global): Likewise.
4295 (Target_arm::Relocate::relocate): Likewise.
4296 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4297
c9a2c125
DK
42982010-01-29 Doug Kwan <dougkwan@google.com>
4299
4300 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4301 of relocation types as ld.
4302
1521477a
DK
43032010-01-29 Doug Kwan <dougkwan@google.com>
4304
4305 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4306 to public.
4307 (Arm_relocate_functions::thumb_branch_common): Ditto.
4308 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4309 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4310 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4311 Arm_relocate_functions::jump24): Remove.
4312 (Target_arm::Relocate::relocate): Adjust code to call
4313 Arm_relocation_functions::arm_branch_common and
4314 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4315 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4316
e7eca48c
DK
43172010-01-29 Doug Kwan <dougkwan@google.com>
4318
4319 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4320 output_local_symbol_count_needs_update_.
4321 (Arm_relobj::output_local_symbol_count_needs_update,
4322 Arm_relobj::set_output_local_symbol_count_needs_update,
4323 Arm_relobj::update_output_local_symbol_count): New methods.
4324 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4325 member.
4326 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4327 of pointed function as in a R_ARM_PREL31 relocation.
4328 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4329 for output local symbol count updating.
4330 (Target_arm::do_relax): Update output local symbol counts in objects
4331 if necessary.
4332 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4333
02961d7e
ILT
43342010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4335
4336 * arm.cc: Added support for the ARM relocations:
4337 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4338 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4339 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4340 movw_prel_nc).
4341 (Arm_relocate_functions::movw_rel): New method.
4342 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4343 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4344 thm_movw_prel_nc).
4345 (Arm_relocate_functions::thm_movw_rel): New method.
4346 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4347 thm_movt_prel).
4348 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4349 relocations.
4350 (Target_arm::Scan::global): Likewise.
4351 (Target_arm::Relocate::relocate): Likewise.
4352 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4353 Likewise.
4354
b10d2873
ILT
43552010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4356
4357 * arm.cc: Added support for ARM group relocations.
4358 (Target_arm::reloc_needs_sym_origin): New method.
4359 (Arm_relocate_functions::calc_grp_kn): New method.
4360 (Arm_relocate_functions::calc_grp_residual): New method.
4361 (Arm_relocate_functions::calc_grp_gn): New method.
4362 (Arm_relocate_functions::arm_grp_alu): New Method.
4363 (Arm_relocate_functions::arm_grp_ldr): New Method.
4364 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4365 (Arm_relocate_functions::arm_grp_ldc): New Method.
4366 (Target_arm::Scan::local): Handle the ARM group relocations.
4367 (Target_arm::Scan::global): Likewise.
4368 (Target_arm::Relocate::relocate): Likewise.
4369 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4370 Likewise.
4371
2b328d4e
DK
43722010-01-26 Doug Kwan <dougkwan@google.com>
4373
4374 * arm.cc (set): Include.
4375 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4376 pointer type.
4377 (Arm_output_section::Text_section_list): New type.
4378 (Arm_output_section::append_text_sections_to_list): New method.
4379 (Arm_output_section::fix_exidx_coverage): Ditto.
4380 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4381 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4382 Relobj::set_section_offset() instead of
4383 Sized_relobj::invalidate_section_offset().
4384 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4385 parameter for section headers. Ignore relocation sections for
4386 unallocated sections and EXIDX sections.
4387 (Target_arm::fix_exidx_coverage): New method.
4388 (Target_arm::output_section_address_less_than): New type.
4389 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4390 linked text section instead of the EXIDX section.
4391 (Arm_output_section::create_stub_group): Add an assertion to check
4392 that this is not an EXIDX output section.
4393 (Arm_output_section::append_text_sections_to_list): New method.
4394 (Arm_output_section::fix_exidx_coverage): Ditto.
4395 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4396 Arm_relobj::section_needs_reloc_stub_scanning.
4397 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4398 first pass.
4399 (Target_arm::fix_exidx_coverage): New method.
4400 * object.h (Relobj::set_output_section): New method.
4401 (Sized_relobj::invalidate_section_offset): Remove method.
4402 (Sized_relobj::do_invalidate_section_offset): Remove method.
4403 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4404
c7f3c371
DK
44052010-01-25 Doug Kwan <dougkwan@google.com>
4406
4407 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4408 Fix warning due to signed and unsigned comparison on a 32-bit host.
4409
8923b24c
DK
44102010-01-22 Doug Kwan <dougkwan@google.com>
4411
4412 * arm.cc (Target_arm::do_relax): Record an output section for section
4413 offset adjustment it contains any stub table that has changed.
4414 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4415 offsets in an output section if necessary.
4416 * output.cc (Output_section::Output_section): Initialize
4417 section_offsets_need_adjustments_.
4418 (Output_section::add_input_section_for_script): Renamed to
4419 Output_section::add_simple_input_section.
4420 (Output_section::save_states): Add a comment.
4421 (Output_section::discard_states): New method defintion.
4422 (Output_section::adjust_section_offsets): Same.
4423 * output.h (Output_section::add_input_section_for_script): Renamed to
4424 Output_section::add_simple_input_section.
4425 (Output_section::discard_states): New method declaration.
4426 (Output_section::adjust_section_offsets): Same.
4427 (Output_section::section_offsets_need_adjustment,
4428 Output_section::set_section_offsets_need_adjustment): New method
4429 definitions.
4430 (Output_section::section_offsets_need_adjustment_): New data member.
4431 * script-sections.cc
4432 (Output_section_element_input::set_section_address): Adjust code for
4433 renaming of Output_section::add_input_section_for_script.
4434 (Orphan_output_section::set_section_address): Same.
4435
9b2fd367
DK
44362010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4437
4438 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4439 Fix_v4bx enum values .
4440 * gold/options.h (General_options): New option definitions.
4441 (General_options::fix_v4bx): New method.
4442 (General_options::Fix_v4bx): New enum.
4443 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4444 (General_options::parse_fix_v4bx_interworking): New method.
4445
80d0d023
DK
44462010-01-22 Doug Kwan <dougkwan@google.com>
4447
4448 * arm.cc (Arm_exidx_fixup): New class.
4449
af2cdeae
DK
44502010-01-21 Doug Kwan <dougkwan@google.com>
4451
4452 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4453 classes.
4454 (Arm_exidx_section_offset_map): New type.
4455
993d07c1
DK
44562010-01-21 Doug Kwan <dougkwan@google.com>
4457
4458 * arm.cc (Arm_exidx_input_section): New class.
4459 (Arm_relobj::exidx_input_section_by_link,
4460 Arm_relobj::exidx_input_section_by_shndx,
4461 Arm_relobj::make_exidx_input_section): New methods.
4462 (read_arm_attributes_section): Remove.
4463 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4464 information about them.
4465 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4466 to here.
4467
5ac169d4
DK
44682010-01-20 Doug Kwan <dougkwan@google.com>
4469
4470 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4471 Input_section_specifier to Section_id.
4472 (Target_arm::new_arm_input_section: Adjust code for change of key
4473 type.
4474 (Target_arm::find_arm_input_section): Ditto.
4475 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4476 (Section_id): Remove.
4477 (Garbage_collection::Section_id_hash): Remove.
4478 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4479 (Section_id): Remove.
4480 (Icf::Section_id_hash): Remove.
4481 * object.h (Section_id, Const_section_id, Section_id_hash,
4482 Const_section_id_hash): New type definitions.
4483 * output.cc (Output_section::add_relaxed_input_section): Change to
4484 use Const_section_id instead of Input_section_specifier as key type.
4485 (Output_section::add_merge_input_section): Ditto.
4486 (Output_section::build_relaxation_map): Change to use Section_id
4487 instead of Input_section_specifier as key type.
4488 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4489 Ditto.
4490 (Output_section::convert_input_sections_to_relaxed_sections): Change
4491 to use Const_section_id instead of Input_section_specifier as key type.
4492 (Output_section::find_merge_section): Ditto.
4493 (Output_section::find_relaxed_input_section): Ditto.
4494 * output.h (Input_section_specifier): Remove class.
4495 (Output_section::Output_section_data_by_input_section_map): Change
4496 key type to Const_section_id.
4497 (Output_section::Output_relaxed_input_section_by_input_section_map):
4498 Ditto.
4499 (Output_section::Relaxation_map): Change key type to Section_id.
4500
a2162063
ILT
45012010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4502
4503 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4504 (class Arm_v4bx_stub): New class.
4505 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4506 (Stub_factory::make_arm_v4bx_stub): New method.
4507 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4508 (Stub_table::empty): Handle v4bx stubs.
4509 (Stub_table::add_arm_v4bx_stub): New method.
4510 (Stub_table::find_arm_v4bx_stub): New method.
4511 (Arm_relocate_functions::v4bx): New method.
4512 (Target_arm::fix_v4bx): New method.
4513 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4514 (Stub_table::relocate_stubs): Likewise.
4515 (Stub_table::do_write): Likewise.
4516 (Stub_table::update_data_size_and_addralign): Likewise.
4517 (Stub_table::finalize_stubs): Likewise.
4518 (Target_arm::Scan::local): Likewise.
4519 (Target_arm::Scan::global): Likewise.
4520 (Target_arm::do_finalize_sections): Likewise.
4521 (Target_arm::Relocate::relocate): Likewise.
4522 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4523 Likewise.
4524 (Target_arm::scan_reloc_for_stub): Likewise.
4525 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4526
5696ab0b
ILT
45272010-01-19 Ian Lance Taylor <iant@google.com>
4528
4529 * output.cc (Output_section_headers::do_sized_write): Write large
4530 segment count to sh_info field.
4531 (Output_file_header::do_sized_write): For large segment count,
4532 write PN_XNUM to e_phnum field.
4533
800d0f56
ILT
45342010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4535
4536 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4537 (Arm_relocate_functions::thm_jump8): New function.
4538 (Arm_relocate_functions::thm_jump11): New function.
4539 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4540 R_ARM_THM_JUMP11.
4541 (Target_arm::Scan::global): Likewise.
4542 (Target_arm::Relocate::relocate): Likewise.
4543 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4544 Likewise.
4545
41263c05
DK
45462010-01-14 Doug Kwan <dougkwan@google.com>
4547
4548 * arm.cc (map, utility): Include headers.
4549 (Target_arm::apply_cortex_a8_workaround): New method.
4550 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4551 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4552 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4553 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4554 the --[no-]fix-cortex-a8 command line options.
4555 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4556 (Target_arm::relocate_stub): Use addend in instruction template.
4557 * options.h (DEFINE_bool): Set the user-set flag.
4558 (General_options): Add --[no-]-fix-cortex options.
4559 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4560 : Update fast look-up map after conversion.
41263c05 4561
459e9b03
ST
45622010-01-14 Sriraman Tallam <tmsriram@google.com>
4563
4564 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4565 in the first pass of do_layout.
4566
b521dfe4
DK
45672010-01-13 Doug Kwan <dougkwan@google.com>
4568
4569 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4570 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4571 apparent compiler problem of not folding static constant integral
4572 data members of elfcpp::Elf_sizes<32>.
4573
44272192
DK
45742010-01-13 Doug Kwan <dougkwan@google.com>
4575
4576 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4577 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4578 Arm_relobj::scan_section_for_cortex_a8_erratum,
4579 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4580 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4581 sections to scan for relocation stubs into a new method
4582 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4583 relocation and Cortex-A8 stub scanning.
4584 (Target_arm::do_relax): Force stubs to be after stubbed sections
4585 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4586 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4587 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4588
44b71ece
ILT
45892010-01-12 Ian Lance Taylor <iant@google.com>
4590
4591 * target-reloc.h (visibility_error): New inline function.
4592 (relocate_section): Call visibility_error.
4593 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4594 (MOSTLYCLEANFILES): Likewise.
4595 (protected_4_pic.o, protected_3.err): New targets.
4596 * testsuite/protected_4.cc: New file.
4597
a120bc7f
DK
45982010-01-12 Doug Kwan <dougkwan@google.com>
4599
4600 * arm.cc (Cortex_a8_reloc): New class.
4601 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4602 and cortex_a8_relocs_info_.
4603 (Target_arm::fix_cortex_a8): New method definition.
4604 (Target_arm::Cortex_a8_relocs_info): New type.
4605 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4606 New data member declarations.
4607 (Target_arm::scan_reloc_for_stub): Record information about
4608 relocations for THUMB branches that might be exempted from the
4609 Cortex-A8 workaround.
4610 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4611 at the beginning of a relaxation pass.
4612
20138696
DK
46132010-01-12 Doug Kwan <dougkwan@google.com>
4614
4615 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4616 (Arm_relobj::Mapping_symbol_position,
4617 Arm_reloj::Mapping_symbol_position_less,
4618 Arm_relobj::Mapping_symbols_info): New types.
4619 (Target_arm::is_mapping_symbol_name): New method definition.
4620 (Arm_relobj::do_count_local_symbols): Save information about mapping
4621 symbols.
4622
089d69dc
DK
46232010-01-11 Doug Kwan <dougkwan@google.com>
4624
4625 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4626 Arm_relocate_functions::thumb32_branch_upper,
4627 Arm_relocate_functions::thumb32_branch_lower,
4628 Arm_relocate_functions::thumb32_cond_branch_offset,
4629 Arm_relocate_functions::thumb32_cond_branch_upper,
4630 Arm_relocate_functions::thumb32_cond_branch_lower,
4631 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4632 branch offset encoding.
4633 (Arm_relocate_functions::thumb_branch_common): Use new branch
4634 offset encoding methods to avoid code duplication.
4635 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4636 (Stub_addend_reader::operator()): Use new branch encoding method
4637 to avoid code duplication.
4638
99e5bff2
DK
46392010-01-11 Doug Kwan <dougkwan@google.com>
4640
4641 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4642 (Target_arm::do_finalize_sections): Define special EXIDX section
4643 symbols only if referenced.
4644 * gc.h (Garbage_collection::add_reference): New method.
4645 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4646 code duplication.
4647
98e090bd
ILT
46482010-01-11 Ian Lance Taylor <iant@google.com>
4649
d0a91bd8
ILT
4650 * script.cc (Version_script_info::build_expression_list_lookup):
4651 Change complaing about duplicate wildcard match from error to
4652 warning.
4653
98e090bd
ILT
4654 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4655 of 2009-12-30.
4656 (Version_script_info::Version_script_info): Initialize globs_,
4657 default_version_, default_is_global_, and exact_. Don't
4658 initialize globals_ or locals_.
4659 (Version_script_info::build_lookup_tables): Build local symbols
4660 first.
4661 (Version_script_info::unquote): New function.
4662 (Version_script_info::add_exact_match): New function.
4663 (Version_script_info::build_expression_list_lookup): Remove lookup
4664 parameter. Add is_global parameter. Change all callers. Handle
4665 wildcard pattern specially. Unquote pattern. Call
4666 add_exact_match.
4667 (Version_script_info::get_name_to_match): New function.
4668 (Version_script_info::get_symbol_version): New function.
4669 (Version_script_info::get_symbol_version_helper): Remove.
4670 (Version_script_info::check_unmatched_names): Call unquote.
4671 * script.h (class Version_script_info): Change get_symbol_version
4672 to be non-inline and add is_global parameter; change all callers.
4673 Rewrite symbol_is_local. Update declarations. Define struct
4674 Version_tree_match, Exact, Globs. Don't define struct Lookup.
4675 Remove globals_ and locals_ members. Add exact_, globs_,
4676 default_version_, is_global_.
4677 (Version_script_info::Glob): Remove pattern, add expression and
4678 is_global. Update constructor. Change all callers.
4679 * dynobj.cc (Versions::finalize): Mark the version symbol as the
4680 default version.
4681 (Versions::symbol_section_contents): If a symbol is undefined, or
4682 defined in a dynamic object, set the version index to
4683 VER_NDX_LOCAL.
4684 * symtab.cc (Symbol_table::add_from_relobj): Don't call
4685 symbol_is_local.
4686 (Symbol_table::add_from_pluginobj): Likewise.
4687 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
4688
d56962d3
DK
46892010-01-11 Doug Kwan <dougkwan@google.com>
4690
4691 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
4692 (incremental_dump_LDADD): Add linking option for libintl.
4693 * Makefile.in: Regenerate.
4694
94e6ee91
L
46952010-01-11 H.J. Lu <hongjiu.lu@intel.com>
4696
4697 PR gold/11144
4698 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
4699 instead of -Ds.
4700 * testsuite/Makefile.in: Regenerated.
4701
e96c574b
DK
47022010-01-10 Doug Kwan <dougkwan@google.com>
4703
4704 * options.h (DEFINE_var): Use parentheses around argument varname__
4705 in macro body to avoid any unintended subsequent substitutions.
4706
7198066b
ILT
47072010-01-10 Ian Lance Taylor <iant@google.com>
4708
ba4d53bf
ILT
4709 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
4710 candidates before doing symbol resolution.
4711
7198066b
ILT
4712 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
4713 ODR candidates if only one is weak.
4714
a2beed37
ILT
47152010-01-08 Ian Lance Taylor <iant@google.com>
4716
4717 * script.cc (Version_script_info::build_expression_list_lookup):
4718 Don't warn about ambiguous version, just record the ambiguity.
4719 (Version_script_info::get_symbol_version_helper): Give error if
4720 version is ambiguous.
4721
2fb7225c
DK
47222010-01-08 Doug Kwan <dougkwan@google.com>
4723
4724 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
4725 prev_data_size_ and prev_addralign_. Remove initializer for
4726 deleted data member has_been_changed_.
4727 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
4728 to determine if the table is empty.
4729 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
4730 Remove.
4731 (Stub_table::add_reloc_stub): Define method in class definition
4732 instead of just declaring it there.
4733 (Stub_table::add_cortex_a8_stub): New method definition.
4734 (Stub_table::update_data_size_and_addralign): Ditto.
4735 (Stub_table::finalize_stubs): Ditto.
4736 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
4737 (Stub_table::do_addralign_): Return address alignment in the
4738 (Stub_table::do_reset_address_and_file_offset): Define method in
4739 class definition instead of declaring it there. Set current data
4740 size to be the data size of the previous pass.
4741 (Stub_table::set_final_data_size): Use current data size as the
4742 final data size.
4743 (Stub_table::relocate_stub): Change parameter type of stub from
4744 Reloc_stub pointer to Stub pointer.
4745 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
4746 (Stub_table::Cortex_a8_stub_list): New typedef.
4747 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
4748 Stub_table::prev_addralign_): New data member.
4749 (Arm_relobj::Arm_relobj): Initialize data member
4750 section_has_cortex_a8_workaround_.
4751 (Arm_relobj::section_has_cortex_a8_workaround,
4752 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
4753 definitions.
4754 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
4755 declarations.
4756 (Target_arm::relocate_stub): Change parameter type of stub from
4757 Reloc_stub pointer to Stub pointer.
4758 (Insn_template::size, Insn_template::alignment): Handle
4759 THUMB16_SPECIAL_TYPE.
4760 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
4761 Stub_table::update_data_size_and_addralign,
4762 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
4763 definitions.
4764 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
4765 (Stub_table::do_write): Ditto.
4766 (Target_arm::do_relax): Adjust code for changes in Stub_table.
4767
880cd20d
ILT
47682010-01-08 Ian Lance Taylor <iant@google.com>
4769
4770 PR 11108
4771 * symtab.h (class Symbol): Remove fields is_target_special_ and
4772 has_plt_offset_. Add field is_defined_in_discarded_section_.
4773 (Symbol::is_defined_in_discarded_section): New function.
4774 (Symbol::set_is_defined_in_discarded_section): New function.
4775 (Symbol::has_plt_offset): Rewrite.
4776 (Symbol::set_plt_offset): Verify that new offset is not -1U.
4777 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
4778 Don't initialize is_target_special_ or has_plt_offset_.
4779 Initialize is_defined_in_discarded_section_.
4780 (Symbol_table::add_from_relobj): If appropriate, set
4781 is_defined_in_discarded_section.
4782 * resolve.cc (Symbol::override_base_with_special): Don't test
4783 is_target_special_. Change has_plt_offset_ to has_plt_offset().
4784 * target-reloc.h (relocate_section): Do special handling for
4785 symbols defined in discarded sections for global symbols as well
4786 as local symbols.
4787
2703e3eb
ILT
47882010-01-08 Ian Lance Taylor <iant@google.com>
4789
4790 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
4791 the SHT_SYMTAB case.
4792
339d40a3
ILT
47932010-01-08 Ian Lance Taylor <iant@google.com>
4794
4795 * object.cc (Sized_relobj::do_layout): Don't get confused if
4796 layout_eh_frame returns NULL.
4797
abecea76
ILT
47982010-01-08 Ian Lance Taylor <iant@google.com>
4799
4800 PR 11084
4801 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
4802 dynamic symbol table, use the normal symbol table.
4803 (Sized_dynobj::do_read_symbols): Remove assertion about type of
4804 symbol table.
4805
6b7dd3f3
ILT
48062010-01-08 Ian Lance Taylor <iant@google.com>
4807
4808 PR 11072
4809 * layout.cc (Layout::include_section): Remove .gnu_debuglink
4810 sections.
4811
36c50e63
L
48122010-01-08 H.J. Lu <hongjiu.lu@intel.com>
4813
4814 * version.cc (print_version): Change to "Copyright 2010".
4815
e291e7b9
ILT
48162010-01-08 Ian Lance Taylor <iant@google.com>
4817
4818 PR 10287
4819 PR 11063
4820 * i386.cc (class Target_i386): Change return type of plt_section
4821 to be non-const.
4822 (class Output_data_plt_i386): Add tls_desc_rel_ field.
4823 (Output_data_plt_i386::Output_data_plt_i386): Initialize
4824 tls_desc_rel_ field.
4825 (Output_data_plt_i386::rel_tls_desc): New function.
4826 (Target_i386::rel_tls_desc_section): New function.
4827 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
4828 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
4829 R_386_TLS_DESC reloc in rel_tls_desc_section.
4830 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
4831 Define struct Tlsdesc_info.
4832 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
4833 (Target_x86_64::do_reloc_symbol_index): New function.
4834 (Target_x86_64::add_tlsdesc_info): New function.
4835 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
4836 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
4837 tlsdesc_rel_ field.
4838 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
4839 all callers.
4840 (Output_data_plt_x86_64::rela_tlsdesc): New function.
4841 (Target_x86_64::rela_tlsdesc_section): New function.
4842 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
4843 handling.
4844 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
4845 (Target_x86_64::do_reloc_addend): New function.
4846 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
4847 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
4848 declarations. Define TARGET_CODE. Add arg field to u1_ union.
4849 (Output_reloc::type): New function.
4850 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
4851 (Output_reloc::is_target_specific): New function.
4852 (Output_reloc::target_arg): New function.
4853 (class Output_reloc) [SHT_RELA]: Add four new constructors for
4854 absolute relocs and target specific relocs.
4855 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
4856 add_target_specific.
4857 (class Output_data_reloc) [SHT_RELA]: Likewise.
4858 * output.cc (Output_reloc::Output_reloc): Add four new versions
4859 for absolute relocs and target specific relocs.
4860 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
4861 (Output_reloc::get_symbol_index): Likewise.
4862 (Output_reloc::local_section_offset): Check that local_sym_index_
4863 is not TARGET_CODE or 0.
4864 (Output_reloc::symbol_value): Likewise.
4865 (Output_reloc::write) [SHT_RELA]: Call target for target specific
4866 reloc.
4867 * target.h (class Target): Add reloc_symbol_index and reloc_addend
4868 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
4869 functions.
4870 * layout.cc (add_target_dynamic_tags): Use output section for
4871 DT_PLTRELSZ and DT_JMPREL.
4872
3a44184e
ILT
48732010-01-07 Ian Lance Taylor <iant@google.com>
4874
4875 PR 11061
4876 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
4877 function.
4878 (class Output_data_reloc_generic): Define.
4879 (class Output_data_reloc_base): Change base class to
4880 Output_data_reloc_generic. Change add() method to call
4881 bump_relative_reloc_count for a relative reloc. Remove
4882 sort_relocs_ field.
4883 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
4884 to sort_relocs().
4885 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
4886 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
4887 appropriate.
4888 * layout.h (class Layout): Update declaration.
4889
ea715a34
ILT
48902010-01-07 Ian Lance Taylor <iant@google.com>
4891
4892 * output.h (class Output_data): Add const version of
4893 output_section and do_output_section.
4894 (class Output_section_data): Add const version of
4895 do_output_section.
4896 (class Output_section): Likewise.
4897 * layout.cc (Layout::add_target_dynamic_tags): New function.
4898 * layout.h (class Layout): Update declarations.
4899 * arm.cc (Target_arm::do_finalize_sections): Use
4900 add_target_dynamic_tags.
4901 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4902 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4903 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4904 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4905
659948a4
ILT
49062010-01-07 Ian Lance Taylor <iant@google.com>
4907
4908 PR 11042
4909 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
4910 object as needed.
4911
9d3b86f6
ILT
49122010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
4913 Ian Lance Taylor <iant@google.com>
4914
4915 PR 11019
4916 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
4917 Xindex::read_symtab_xindex.
4918
bb0d3eb0
DK
49192010-01-07 Doug Kwan <dougkwan@google.com>
4920
4921 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
4922 (Insn_template::thumb16_bcond_insn): New method declaration.
4923 (Insn_template): Fix spelling.
4924 (Stub::thumb16_special): New method declaration.
4925 (Stub::do_write): Define virtual method which was previously pure
4926 virtual.
4927 (Stub::do_thumb16_special): New method declaration.
4928 (Stub::do_fixed_endian_write): New template member.
4929 (Reloc_stub::do_write): Remove.
4930 (Reloc_stub::do_fixed_endian_write): Remove.
4931 (Cortex_a8_stub): New class definition.
4932 (Stub_factory::make_cortex_a8_stub): New method definition.
4933 (Stub_factory::Stub_factory): Add missing static storage class
4934 qualifier for elf32_arm_stub_a8_veneer_blx.
4935
ffeef7df
ILT
49362010-01-07 Ian Lance Taylor <iant@google.com>
4937
dc3f80fe
ILT
4938 PR 10980
4939 * options.h (class General_options): Add --warn-unresolved-symbols
4940 and --error-unresolved-symbols.
4941 * errors.cc (Errors::undefined_symbol): Implement
4942 --warn-unresolved-symbols.
4943
ffeef7df
ILT
4944 * options.h (class General_options): Add -z text and -z textoff.
4945 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
4946
f1ec9ded
ST
49472010-01-06 Sriraman Tallam <tmsriram@google.com>
4948
4949 * gc.h (Garbage_collection::Cident_section_map): New typedef.
4950 (Garbage_collection::cident_sections): New function.
4951 (Garbage_collection::add_cident_section): New function.
4952 (Garbage_collection::cident_sections_): New member.
4953 (gc_process_relocs): Add references to sections whose names are C
4954 identifiers.
4955 * gold.h (cident_section_start_prefix): New constant.
4956 (cident_section_stop_prefix): New constant.
4957 (is_cident): New function.
4958 * layout.cc (Layout::define_section_symbols): Replace string constants
4959 with the newly defined constants.
4960 * object.cc (Sized_relobj::do_layout): Track sections whose names are
4961 C identifiers.
4962 * testsuite/Makefile.am: Add gc_orphan_section_test.
4963 * testsuite/Makefile.in: Regenerate.
4964 * testsuite/gc_orphan_section_test.cc: New file.
4965 * testsuite/gc_orphan_section_test.sh: New file.
4966
6eda8c29
ILT
49672010-01-06 Ian Lance Taylor <iant@google.com>
4968
b9674e17
ILT
4969 PR 10980
4970 * options.h (class General_options): Add --warn-shared-textrel.
4971 * layout.cc (Layout::finish_dynamic_section): Implement
4972 --warn-shared-textrel.
4973
6eda8c29
ILT
4974 PR 10980
4975 * options.h (class General_options): Add --warn-multiple-gp.
4976
32dcd44e
ILT
49772010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4978
4979 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
4980 $(THREADSLIB) and $(LIBDL).
4981 * Makefile.in: Rebuild.
4982
a192ba05
ILT
49832010-01-06 Ian Lance Taylor <iant@google.com>
4984
4985 PR 10980
4986 * options.cc (General_options::parse_section_start): New function.
4987 (General_options::section_start): New function.
4988 (General_options::General_options): Initialize all members.
4989 * options.h: Include <map>
4990 (class General_options): Add --section-start. Add section_starts_
4991 member.
4992 * layout.cc (Layout::attach_allocated_section_to_segment): If
4993 --section-start was used, set the address of the segment. Remove
4994 local sort_sections.
4995 (Layout::relaxation_loop_body): If the address of the load segment
4996 has been set by --section-start, don't use it.
4997 * output.h (Output_segment::update_flags_for_output_section): New
4998 function.
4999 * output.cc (Output_segment::add_output_section): Call
5000 update_flags_for_output_section.
5001
dde3f402
ILT
50022010-01-05 Ian Lance Taylor <iant@google.com>
5003
62dfdd4d
ILT
5004 PR 10980
5005 * options.h (class General_options): Add --undefined-version.
5006 * script.cc (struct Version_expression): Add was_matched_by_symbol
5007 field.
5008 (Version_script_info::matched_symbol): New function.
5009 (Version_script_info::get_symbol_version_helper): Call
5010 matched_symbol.
5011 (Version_script_info::check_unmatched_names): New function.
5012 * script.h (class Version_script_info): Update declarations.
5013 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5014
9c4ae156
ILT
5015 * options.h (class General_options): Use DEFINE_bool_alias for
5016 allow_multiple_definition.
5017 * resolve.cc (Symbol_table::should_override): Don't test
5018 allow_multiple_definition.
5019
dde3f402
ILT
5020 PR 10980
5021 * options.h (class General_options): Add --cref.
5022 * main.cc (main): Print cref table if --cref. Don't close mapfile
5023 until after printing cref table.
5024 * cref.cc: Include "symtab.h".
5025 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5026 (Cref_table_compare::operator()): New function.
5027 (Cref_inputs::gather_cref): New function.
5028 (filecol): New static const.
5029 (Cref_inputs::print_cref): New function.
5030 (Cref::print_cref): New function.
5031 * cref.h: Include <cstdio>.
5032 (class Cref): Update declarations.
5033 * mapfile.h (Mapfile::file): New function.
5034 * object.h (class Object): Define Symbols. Declare virtual
5035 do_get_global_symbols.
5036 (Object::get_global_symbols): New function.
5037 * object.cc (Input_objects::add_object): Pass object to cref_ if
5038 --cref.
5039 (Input_objects::archive_start): Likewise.
5040 (Input_objects::archive_stop): Likewise.
5041 (Input_objects::print_cref): New function.
5042 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5043 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5044 --cref.
5045 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5046 function.
5047 * plugin.h (class Sized_pluginobj): Update declarations.
5048
8781f709
ILT
50492010-01-05 Ian Lance Taylor <iant@google.com>
5050
5051 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5052 to is_default_version. Rename insdef to insdefault.
5053 (Symbol_table::add_from_relobj): Rename def to is_default_version
5054 and local to is_forced_local.
5055 (Symbol_table::add_from_pluginobj): Likewise.
5056 (Symbol_table::add_from_dynobj): Likewise.
5057 (Symbol_table::define_special_symbol): Rename insdef to
5058 insdefault.
5059
fe35d28d
ILT
50602010-01-04 Ian Lance Taylor <iant@google.com>
5061
30bc8c46
ILT
5062 PR 10980
5063 * options.h (class General_options): Add
5064 --allow-multiple-definition and -z muldefs.
5065 * resolve.cc (Symbol_table::should_override): Don't warn about a
5066 multiple symbol definition if --allow-multiple-definition or -z
5067 muldefs.
5068
7eaea549
ILT
5069 PR 10980
5070 * options.h (class General_options): Add --add-needed and
5071 --copy-dt-needed-entries. Tweak --as-needed help entry.
5072 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5073 error if --copy-dt-needed-entries aka --add-needed is used and
5074 would cause a change in behaviour.
5075
fe35d28d
ILT
5076 PR 10980
5077 * options.h (class General_options): Add -G as a short version of
5078 --shared. Add no-op options -assert, -g, and -i.
5079
55a2bb35
ST
50802010-01-04 Sriraman Tallam <tmsriram@google.com>
5081
5082 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5083 check for .text or .gnu.linkonce.t sections.
5084 * icf.cc (Icf::find_identical_sections): Ditto.
5085 Change the detection for mangled function name within the section
5086 name.
5087 * icf.h (is_section_foldable_candidate): New function.
5088
719328e1
ILT
50892009-12-30 Ian Lance Taylor <iant@google.com>
5090
5091 PR 10980
5092 * options.h (class General_options): Permit two dashes with
5093 --retain-symbols-file.
5094
d7bb5745
ILT
50952009-12-30 Ian Lance Taylor <iant@google.com>
5096
403a15dd
ILT
5097 PR 10979
5098 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5099 don't put the file header and segment headers in the text
5100 segment.
5101
eda294df
ILT
5102 PR 10979
5103 * common.cc (Sort_commons::operator()): Stabilize sort when both
5104 entries are NULL.
5105 (Symbol_table::do_allocate_commons_list): When allocating common
5106 symbols, skip a symbol which is no longer common.
5107 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5108 an object before checking its type.
5109 * testsuite/common_test_2.c: New file.
5110 * testsuite/common_test_3.c: New file.
5111 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5112 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5113 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5114 (common_test_2_pic.o, common_test_2.so): New targets.
5115 (common_test_3_pic.o, common_test_3.so): New targets.
5116 * testsuite/Makefile.in: Rebuild.
5117
d7bb5745
ILT
5118 PR 10979
5119 * script.cc (read_input_script): If we see a new SECTIONS clause,
5120 and we have added an input section, give an error.
5121 * layout.h (class Layout): Add have_added_input_section function.
5122 Add have_added_input_section_ field.
5123 * layout.cc (Layout::Layout): Initialize
5124 have_added_input_section_.
5125 (Layout::layout): Set have_added_input_section_.
5126 (Layout::layout_eh_frame): Likewise.
5127
fc59c572
ILT
51282009-12-30 Ian Lance Taylor <iant@google.com>
5129
5130 PR 10931
5131 * options.h (class General_options): Add --sort-common option.
5132 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5133 * common.cc (Sort_common): Add sort_order parameter to
5134 constructor. Add sort_order_ field.
5135 (Sort_commons::operator): Check sort_order_.
5136 (Symbol_table::allocate_commons): Determine the sort order.
5137 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5138 Change all callers.
5139 (Symbol_table::do_allocate_commons_list): Likewise.
5140
1c74fab0
ILT
51412009-12-30 Ian Lance Taylor <iant@google.com>
5142
5143 PR 10916
5144 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5145 symbols from this object, don't change the visibility of an
5146 undefined symbol.
5147 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5148
6affe781
ILT
51492009-12-30 Ian Lance Taylor <iant@google.com>
5150
5151 PR 10861
5152 * script.h (class Version_script_info): Define Language enum.
5153 Update declarations. Define Glob, Exact, and Lookup types. Add
5154 new fields globals_, locals_, and is_finalized_.
5155 * script.cc: Various formatting fixes.
5156 (class Parser_closure): Change language_stack_ from a vector of
5157 std::string to one of Version_script_info::Language. Adjust all
5158 uses accordingly.
5159 (class Lazy_demangler): Remove.
5160 (struct Version_expression): Change language from std::string to
5161 Version_script_info::Language.
5162 (Version_script_info::Version_script_info): New function.
5163 (Version_script_info::~Version_script_info): Don't call clear.
5164 (Version_script_info::finalize): New function.
5165 (Version_script_info::build_lookup_tables): New function.
5166 (Version_script_info::build_expression_list_lookup): New
5167 function.
5168 (Version_script_info::get_symbol_version_helper): Rewrite to use
5169 lookup tables.
5170 (Version_script_info::print_expression_list): Adjust to use
5171 Version_script_info::Language.
5172 (script_push_lex_into_version_mode): Check that the version script
5173 has not been finalized.
5174 (version_script_push_lang): Change language string to
5175 Version_script_info::Language.
5176 * options.cc (Command_line::version_script): New function.
5177 * options.h (class General_options): Add finalize_dynamic_list
5178 function. Change version_script from declaration to definition.
5179 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5180 * testsuite/version_script.map: Remove duplicate def of foo.
5181 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5182 version_script.map.
5183 * testsuite/Makefile.in: Rebuild.
5184
818bf354
ILT
51852009-12-30 Ian Lance Taylor <iant@google.com>
5186
5187 PR 10843
5188 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5189 if the input symbol index is 0, make the output symbol index 0.
5190
ebcc8304
ILT
51912009-12-30 Ian Lance Taylor <iant@google.com>
5192
5193 PR 10670
5194 * options.h (class General_options): Add -x/--discard-all.
5195 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5196 --discard-all. If the local symbol needs a dynamic entry, check
5197 that before handling --discard-locals.
5198
176fe33f
ILT
51992009-12-30 Ian Lance Taylor <iant@google.com>
5200
bb321bb1
ILT
5201 PR 10450
5202 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5203 flags to PF_R.
5204 (Output_segment::add_output_section): Don't change the flags if
5205 the type is PT_TLS.
5206
176fe33f
ILT
5207 PR 10450
5208 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5209 GNU hash table if they need a dynamic value. Otherwise, don't add
5210 them if they are defined in a dynamic object or are forced local.
5211
e8cd95c7
ILT
52122009-12-29 Ian Lance Taylor <iant@google.com>
5213
1b81fb71
ILT
5214 PR 10450
5215 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5216 .gnu.hash table for a 32-bit target.
5217
8d6d383d
ILT
5218 PR 10450
5219 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5220 regular and a dynamic object only needs a dynamic symbol table
5221 entry if it is externally visible.
5222
e785ec03
ILT
5223 PR 10450
5224 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5225 constructor. Add global_offset_table_ field.
5226 (Target_i386::got_section): Set global_offset_table_.
5227 (Target_i386::do_finalize_sections): Set global_offset_table_
5228 size.
5229 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5230 in constructor. Add global_offset_table_ field.
5231 (Target_x86_64::got_section): Set global_offset_table_.
5232 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5233 size.
5234
1a2dff53
ILT
5235 * layout.cc (Layout::Layout): Initialize increase_relro_.
5236 (Layout::get_output_section): Add is_relro, is_last_relro, and
5237 is_first_non_relro parameters. Change all callers.
5238 (Layout::choose_output_section): Likewise.
5239 (Layout::add_output_section_data): Likewise.
5240 (Layout::make_output_section): Likewise.
5241 (Layout::set_segment_offsets): Clear increase_relro when using a
5242 linker script.
5243 * layout.h (class Layout): Add increase_relro method. Add
5244 increase_relro_ field. Update declarations.
5245 * output.cc (Output_section::Output_section): Initialize
5246 is_last_relro_ and is_first_non_relro_.
5247 (Output_segment::add_output_section): Group relro sections is
5248 do_sort is true. Handle is_last_relro and is_first_non_relro.
5249 (Output_segment::maximum_alignment): Remove relro handling.
5250 (Output_segment::set_section_addresses): Add increase_relro
5251 parameter. Change all callers. Add initial alignment to align
5252 relro sections on separate page. Remove old relro handling.
5253 (Output_segment::set_section_list_addresses): Remove in_relro
5254 parameter. Change all callers.
5255 (Output_segment::set_offset): Add increase parameter. Change all
5256 callers. Remove old relro handling.
5257 * output.h (class Output_section): Add new methods: is_last_relro,
5258 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5259 Add is_last_relro_ and is_first_non_relro_ fields.
5260 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5261 Create separate .got.plt section. Call increase_relro.
5262 * x86_64.cc (Target_x86_64::got_section): Likewise.
5263 * testsuite/relro_script_test.t: Add .got.plt.
5264
f0ba79e2
ILT
5265 PR 10450
5266 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5267 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5268 (Layout::finalize): Call set_dynamic_symbol_size.
5269 (Layout::set_dynamic_symbol_size): New function.
5270 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5271 set_dynamic_symbol_size.
5272
e8cd95c7
ILT
5273 PR 10450
5274 * output.h (class Output_section): Add is_entsize_zero_ field.
5275 * output.cc (Output_section::Output_section): Initialize
5276 is_entsize_zero_.
5277 (Output_section::set_entsize): If two different entsizes are
5278 requested, force it to zero.
5279 (Output_section::add_input_section): Set flags for .debug_str
5280 before updating section flags. Set entsize.
5281 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5282 and SHF_STRING if all input sections have those flags.
5283
3e1b9a8a
RÁE
52842009-12-29 Rafael Espindola <espindola@google.com>
5285
5286 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5287 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5288 reporting.
3e1b9a8a 5289
3dcad376
ST
52902009-12-29 Sriraman Tallam <tmsriram@google.com>
5291
5292 * options.cc (General_options::parse_version): Allow -v to exit
5293 without an error if there is nothing to link.
5294
084e2665
ILT
52952009-12-29 Ian Lance Taylor <iant@google.com>
5296
5297 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5298 using a version of gcc before 4.1.
5299 * configure: Rebuild.
5300
250acde3
CD
53012009-12-28 Chris Demetriou <cgd@google.com>
5302
5303 * attributes.cc (Output_attributes_section_data::do_write): Use
5304 std::vector::front rather than std::vector::data.
5305
99fff23b
ILT
53062009-12-28 Ian Lance Taylor <iant@google.com>
5307
5308 * symtab.h (class Symbol_table): Add enum Defined.
5309 * resolve.cc (Symbol_table::should_override): Add defined
5310 parameter. Change all callers. Test whether object is NULL
5311 before calling a method on it.
5312 (Symbol_table::report_resolve_problem): Add defined parameter.
5313 Change all callers.
5314 (Symbol_table::should_override_with_special): Likewise.
5315 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5316 parameter. Change all callers.
5317 (Symbol_table::do_define_in_output_data): Likewise.
5318 (Symbol_table::define_in_output_segment): Likewise.
5319 (Symbol_table::do_define_in_output_segment): Likewise.
5320 (Symbol_table::define_as_constant): Likewise.
5321 (Symbol_table::do_define_as_constant): Likewise.
5322 * script.h (class Symbol_assignment): Add is_defsym parameter to
5323 constructor; change all callers.
5324 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5325 parameter. Change all callers. Add is_defsym_ field.
5326 (class Parser_closure): Add parsing_defsym parameter to
5327 constructor; change all callers. Add parsing_defsym accessor
5328 function. Add parsing_defsym_ field.
5329
556bd683
ILT
53302009-12-28 Ian Lance Taylor <iant@google.com>
5331
5332 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5333 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5334
1782c879
ILT
53352009-12-23 Ian Lance Taylor <iant@google.com>
5336
5337 * i386.cc (Target_i386::do_calls_non_split): Recognize
5338 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5339 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5340 -fsplit-stack prologue when using %r11.
1782c879 5341
329ca2b1
ST
53422009-12-21 Sriraman Tallam <tmsriram@google.com>
5343
5344 * options.cc (General_options::parse_version): Make -v continue and do
5345 the link like GNU ld does.
5346
d675ff46
RÁE
53472009-12-17 Rafael Avila de Espindola <espindola@google.com>
5348
5349 * Makefile.am (CCFILES): Add timer.cc.
5350 (HFILES): Add timer.h.
5351 * configure.ac: Check for sysconf and times.
5352 * main.cc: include timer.h.
5353 (main): Use Timer instead of get_run_time.
5354 * timer.cc: New.
5355 * timer.h: New.
5356 * workqueue.cc: include timer.h.
5357 (Workqueue::find_and_run_task):
5358 Report user, sys and wall time.
5359 * Makefile.in: Regenerate.
5360 * config.in: Regenerate.
5361 * configure: Regenerate.
5362
d6344fb5
DK
53632009-12-16 Doug Kwan <dougkwan@google.com>
5364
5365 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5366 sections.
5367 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5368 relaxed input sections.
5369 * output.cc (Output_section::find_relaxed_input_section): Change
5370 return type to Output_relaxed_input_section pointer. Adjust code
5371 for new type of relaxed_input_section_map_.
5372 * output.h (Output_section::find_relaxed_input_section): Change
5373 return type to Output_relaxed_input_section pointer.
5374 (Output_section::Output_relaxed_input_section_by_input_section_map):
5375 New type.
5376 (Output_section::relaxed_input_section_map_): Change type to
5377 Output_section::Output_relaxed_input_section_by_input_section_map.
5378 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5379 input section.
5380
0e0d5469
ILT
53812009-12-15 Ian Lance Taylor <iant@google.com>
5382
5383 * layout.cc (Layout::create_shstrtab): Only write out after input
5384 sections if we are compressing debug sections.
5385
0649a889
ILT
53862009-12-15 Ian Lance Taylor <iant@google.com>
5387
5388 * archive.cc (Archive::add_symbols): Only look up a symbol without
5389 a version if there is, in fact, a version.
5390
2ea97941
ILT
53912009-12-14 Ian Lance Taylor <iant@google.com>
5392
5393 Revert -Wshadow changes, all changes from:
5394 2009-12-11 Doug Kwan <dougkwan@google.com>
5395 2009-12-11 Nick Clifton <nickc@redhat.com>
5396 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5397
b0eec2cc
DK
53982009-12-11 Doug Kwan <dougkwan@google.com>
5399
5400 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5401 due to -Wshadow.
5402 * attributes.cc (Object_attribute::size): Ditto.
5403 (Attributes_section_data::size): Ditto.
5404 (Attributes_section_data::Attributes_section_data): Ditto.
5405 (Output_attributes_section_data::do_write): Ditto.
5406 * attributes.h (Object_attribute::set_type): Ditto.
5407 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5408
91d6fa6a
NC
54092009-12-11 Nick Clifton <nickc@redhat.com>
5410
5411 * archive.cc: Fix shadowed variable warnings.
5412 * arm.cc: Likewise.
5413 * compressed_output.cc: Likewise.
5414 * compressed_output.h: Likewise.
5415 * configure: Likewise.
5416 * dwarf_reader.cc: Likewise.
5417 * dynobj.cc: Likewise.
5418 * dynobj.h: Likewise.
5419 * ehframe.cc: Likewise.
5420 * ehframe.h: Likewise.
5421 * errors.cc: Likewise.
5422 * expression.cc: Likewise.
5423 * fileread.cc: Likewise.
5424 * fileread.h: Likewise.
5425 * freebsd.h: Likewise.
5426 * i386.cc: Likewise.
5427 * icf.cc: Likewise.
5428 * incremental.h: Likewise.
5429 * layout.cc: Likewise.
5430 * layout.h: Likewise.
5431 * mapfile.cc: Likewise.
5432 * merge.cc: Likewise.
5433 * merge.h: Likewise.
5434 * object.cc: Likewise.
5435 * object.h: Likewise.
5436 * options.h: Likewise.
5437 * output.cc: Likewise.
5438 * output.h: Likewise.
5439 * parameters.cc: Likewise.
5440 * plugin.cc: Likewise.
5441 * powerpc.cc: Likewise.
5442 * reduced_debug_output.cc: Likewise.
5443 * reduced_debug_output.h: Likewise.
5444 * reloc.cc: Likewise.
5445 * reloc.h: Likewise.
5446 * resolve.cc: Likewise.
5447 * script-sections.cc: Likewise.
5448 * script.cc: Likewise.
5449 * script.h: Likewise.
5450 * sparc.cc: Likewise.
5451 * symtab.cc: Likewise.
5452 * symtab.h: Likewise.
5453 * target-select.cc: Likewise.
5454 * target-select.h: Likewise.
5455 * token.h: Likewise.
5456 * workqueue.cc: Likewise.
5457 * workqueue.h: Likewise.
5458 * x86_64.cc: Likewise.
5459
a0351a69
DK
54602009-12-10 Doug Kwan <dougkwan@google.com>
5461
5462 * arm.cc (attributes.h): New include.
5463 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5464 (Arm_relobj::~Arm_relobj): Delete object pointed by
5465 attributes_section_data_.
5466 (Arm_relobj::attributes_section_data): New method definition.
5467 (Arm_relobj::attributes_section_data_): New data member declaration.
5468 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5469 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5470 attributes_section_data_.
5471 (Arm_dynobj::attributes_section_data): New method definition.
5472 (Arm_dynobj::attributes_section_data_): New data member declaration.
5473 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5474 initialization value of may_use_blx_ to false.
5475 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5476 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5477 object attributes to compute results instead of hard-coding.
5478 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5479 Target_arm::get_secondary_compatible_arch,
5480 Target_arm::set_secondary_compatible_arch
5481 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5482 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5483 New method declarations.
5484 (Target_arm::get_aeabi_object_attribute): New method definition.
5485 (Target_arm::attributes_section_data_): New data member declaration.
5486 (read_arm_attributes_section): New template definition.
5487 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5488 (Arm_dynobj::do_read_symbols): Ditto.
5489 (Target_arm::do_finalize_sections): Merge attributes sections from
5490 input. Check for BLX use after attributes section merging.
5491 Fix __exidx_start and __exidx_end visibility. Create an
5492 .ARM.attributes section if necessary.
5493 (Target_arm::get_secondary_compatible_arch,
5494 Target_arm::set_secondary_compatible_arch,
5495 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5496 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5497 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5498 New method definitions.
5499
b59befec
ILT
55002009-12-09 Ian Lance Taylor <iant@google.com>
5501
5502 * plugin.cc (Plugin::load): Don't cast from void* to a function
5503 pointer.
5504
1276bc89
ILT
55052009-12-09 Ian Lance Taylor <iant@google.com>
5506
5507 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5508 information fields.
5509
2f2de248
L
55102009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5511
5512 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5513 Replace two_file_shared_1.so with two_file_shared_2.so.
5514 * testsuite/Makefile.in: Regenerated.
5515
4f787271
DK
55162009-12-08 Doug Kwan <dougkwan@google.com>
5517
5518 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5519 (HFILES): Add attributes.h and int_encoding.h.
5520 * Makefile.in: Regenerate.
5521 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5522 function definitions to int_encoding.cc
5523 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5524 prototypes to int_encoding.h
5525 * reduced_debug_output.cc (int_encoding.h): New include.
5526 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5527 function definitions to int_encoding.cc
5528 (insert_into_vector, read_from_pointer): Move template definitions to
5529 int_encoding.h
5530 * attributes.cc: New file.
5531 * attributes.h: New file.
5532 * int_encoding.cc: New file.
5533 * int_encoding.h: New file.
5534
20b52f1a
RÁE
55352009-12-07 Rafael Avila de Espindola <espindola@google.com>
5536
5537 PR gold/11055
5538 * incremental-dump.cc (dump_incremental_inputs): New.
5539 (main): Use dump_incremental_inputs.
5540
53d7974c
L
55412009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5542
5543 PR gold/10893
5544 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5545 checking elfcpp::STT_FUNC.
5546 (Target_i386::Relocate::relocate): Likewise.
5547 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5548
5549 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5550 symbols from shared libraries into normal FUNC symbols.
5551
5552 * symtab.h (Symbol): Add is_func and use it.
5553
05a352e6
DK
55542009-12-05 Doug Kwan <dougkwan@google.com>
5555
5556 * arm.cc (Target_arm::arm_info): Initialize new fields
5557 attributes_section and attributes_vendor.
5558 * i386.cc (Target_i386::i386_info): Same.
5559 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5560 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5561 fields attributes_section and attributes_vendor.
53d7974c 5562 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5563 * target.h (Target::attributes_section, Target::attributes_vendor,
5564 Target::is_attributes_section, Target::attribute_arg_type,
5565 Target::attributes_order): New method definitions.
5566 (Target::Target_info::attributes_section,
5567 Target::Target_info::attributes_vendor): New fields.
5568 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5569 virtual method definitions.
5570 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5571 attributes_section and attributes_vendor.
5572 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5573
f4e5969c
DK
55742009-12-05 Doug Kwan <dougkwan@google.com>
5575
5576 * arm.cc: Update comments about interworking and stub generation.
5577 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5578 considered as non-PIC.
5579 (Arm_relocate_functions::base_abs): Fix formatting.
5580 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5581 of function to use GOT entry address instead of offset.
5582 (Target_arm::Scan::global): Issue an error if a symbol would need a
5583 PLT does not get one because it is untyped. Remove code to create
5584 dynamic symbols for relative branches.
5585 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5586 takes unsigned integer instead of boolean.
5587
1abce4a6
L
55882009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5589
5590 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5591 (two_file_test_LDADD): Likewise.
5592 (common_test_1_LDADD): Likewise.
5593 (exception_test_LDADD) Likewise.
5594 (weak_test_LDADD): Likewise.
5595 (many_sections_test_LDADD): Likewise.
5596 (initpri1_LDADD): Likewise.
5597 (script_test_1_LDADD): Likewise.
5598 (script_test_2_LDADD): Likewise.
5599 (justsyms_LDADD): Likewise.
5600 (binary_test_LDADD): Likewise.
5601 (large_LDADD): Likewise.
5602 * testsuite/Makefile.in: Regenerated.
5603
adcf2816 56042009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5605
adcf2816
L
5606 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5607 (Symbol_table::override_with_special): Likewise.
5608 (Symbol_table::add_from_object): Likewise.
5609
28e67f5d
RÁE
56102009-12-04 Rafael Avila de Espindola <espindola@google.com>
5611
5612 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5613 Don't set the data_offset twice.
5614
ae10a101
RÁE
56152009-12-04 Rafael Avila de Espindola <espindola@google.com>
5616
5617 * testsuite/Makefile.in: Regenerate.
5618
f59f41f3
DK
56192009-12-03 Doug Kwan <dougkwan@google.com>
5620
5621 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5622 (Target_arm::do_finalize_sections): Add parameter for symbol table
5623 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5624 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5625 parameter for symbol table pointer.
5626 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5627 an additional parameter for a pointer to symbol table.
5628 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5629 parameter for a symbol table pointer.
5630 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5631 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5632 Ditto.
5633 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5634 parameter for a symbol table pointer.
5635
ca55d848
RÁE
56362009-12-03 Rafael Avila de Espindola <espindola@google.com>
5637
5638 * incremental.cc (Incremental_inputs_header)
5639 (Incremental_inputs_header_write, Incremental_inputs_entry)
5640 (Incremental_inputs_entry_write): Move ...
5641 * incremental.h (Incremental_inputs_header)
5642 (Incremental_inputs_header_write, Incremental_inputs_entry)
5643 (Incremental_inputs_entry_write): here.
5644
3aec4f9c
RÁE
56452009-12-02 Rafael Avila de Espindola <espindola@google.com>
5646
5647 * incremental.cc (make_sized_incremental_binary): Set the target.
5648 Error if it is incompatible.
5649 * output.h (Output_file): Add filename method.
5650
9c0ae74d
RÁE
56512009-12-02 Rafael Avila de Espindola <espindola@google.com>
5652
5653 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5654 from the get_* methods.
5655
a45500ae
RÁE
56562009-12-02 Rafael Avila de Espindola <espindola@google.com>
5657
5658 * incremental-dump.cc (main): Check that the offeset of a script is 0.
5659 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5660 Write 0 for the data_offset of scripts.
5661
325e6408
RÁE
56622009-12-02 Rafael Avila de Espindola <espindola@google.com>
5663
5664 * testsuite/Makefile.am: Add the incremental_test.sh test.
5665 * testsuite/incremental_test.sh: New.
5666 * testsuite/incremental_test_1.c: New.
5667 * testsuite/incremental_test_2.c: New.
5668
954c3e2e
RÁE
56692009-12-01 Rafael Avila de Espindola <espindola@google.com>
5670
5671 * incremental-dump.cc (main): Fix typos.
5672
f8086623
RÁE
56732009-11-27 Rafael Avila de Espindola <espindola@google.com>
5674
5675 PR gold/11025
5676 * incremental-dump.cc (main): Use llu to print 64 bit values.
5677
3b0dd6ac
L
56782009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
5679 H.J. Lu <hongjiu.lu@intel.com>
5680
5681 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
5682 $(LIBDL).
5683 (incremental_dump_LDADD): Likewise.
5684 * Makefile.in: Regenerated.
5685
a6d1ef57 56862009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 5687
a6d1ef57
DK
5688 Revert:
5689
5690 2009-11-25 Doug Kwan <dougkwan@google.com>
5691
5692 * arm.cc (Target_arm::Target_arm): Move method definition
5693 outside of class definition. Add code to handle
5694 --target1-rel, --target1-abs and --target2= options.
5695 (Target_arm::get_reloc_reloc_type): Change method to be
5696 non-static and const.
5697 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
5698 New data member declaration.
5699 (Target_arm::Scan::local, Target_arm::Scan::global,
5700 Target_arm::Relocate::relocate,
5701 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5702 Adjust call to Target_arm::get_real_reloc_type.
5703 (Target_arm::get_real_reloc_type): Use command line options
5704 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5705 * options.h (--target1-rel, --target1-abs, --target2): New
5706 ARM-only options.
5707
50aeb7d4
DK
57082009-11-25 Doug Kwan <dougkwan@google.com>
5709
5710 * arm.cc (Target_arm::Target_arm): Move method definition outside of
5711 class definition. Add code to handle --target1-rel, --target1-abs
5712 and --target2= options.
5713 (Target_arm::get_reloc_reloc_type): Change method to be non-static
5714 and const.
5715 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
5716 member declaration.
5717 (Target_arm::Scan::local, Target_arm::Scan::global,
5718 Target_arm::Relocate::relocate,
5719 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
5720 call to Target_arm::get_real_reloc_type.
5721 (Target_arm::get_real_reloc_type): Use command line options to
5722 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
5723 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
5724 options.
5725
51938283
DK
57262009-11-25 Doug Kwan <dougkwan@google.com>
5727
5728 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
5729 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
5730 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
5731 formatting.
5732 (Arm_relocate_functions::thm_call): Replace body with a call to
5733 Arm_relocate_functions::thumb_branch_common.
5734 (Arm_relocate_functions::thm_jump24,
5735 Arm_relocate_functions::thm_xpc22): New method definitions.
5736 (Arm_relocate_functions::thumb_branch_common): New method definition.
5737 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
5738 operator.
5739 (Target_arm::Relocate::relocate): Adjust call to thm_call.
5740 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
5741
e2b8f3c4
RÁE
57422009-11-24 Rafael Avila de Espindola <espindola@google.com>
5743
5744 * Makefile.am: Build incremental-dump
5745 * Makefile.in: Regenerate.
5746 * incremental-dump.cc: New.
5747 * incremental.cc (Incremental_inputs_header_data,
5748 Incremental_inputs_entry_data): Move to incremental.h
5749 * incremental.h: (Incremental_inputs_header_data,
5750 Incremental_inputs_entry_data): Move from incremental.cc
5751
bcba9aec
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): Add a typedef with the data type.
5757
7c3afe08
RÁE
57582009-11-24 Rafael Avila de Espindola <espindola@google.com>
5759
5760 * incremental.cc (Incremental_inputs_header,
5761 Incremental_inputs_header_write, Incremental_inputs_entry,
5762 Incremental_inputs_entry_write): Update comment about which
5763 type has the filed descriptions.
5764
d204b6e9
DK
57652009-11-15 Doug Kwan <dougkwan@google.com>
5766
5767 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
5768 (Arm_relocate_functions::arm_branch_common): Change method defintion
5769 in class definition to a method declaration and update list of formal
5770 parameters.
5771 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
5772 Arm_relocation_functions::jump24): Adjust call to
5773 Arm_relocate_functions::arm_branch_common. Update list of formal
5774 parameters.
5775 (Arm_relocate_functions::xpc25): New method definition.
5776 (Arm_relocate_functions::arm_branch_common): Move method defintion
5777 out from class definition. Use stubs for mode-switching and extending
5778 branch ranges.
5779 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
5780 specially. Change code to enable use of stubs in ARM branches.
5781
43d12afe
DK
57822009-11-10 Doug Kwan <dougkwan@google.com>
5783
5784 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
5785 in method declaration.
5786 (Target_arm::relocate_stub): New method declaration.
5787 (Target_arm::default_target): Change to return a pointer instead of
5788 a const reference.
5789 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
5790 Target_arm::default_target.
5791 (Arm_Relobj::do_relocate_sections): Remove options paramater in
5792 method definition.
5793 (Target_arm::relocate_section): Adjust view.
5794 (Target_arm::relocate_stub): New method definition.
5795
ac33a407
DK
57962009-11-10 Doug Kwan <dougkwan@google.com>
5797
5798 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
5799 a format warning.
5800 * incremental.cc (open_incremental_binary): Initialized local
5801 variables to avoid warnings.
5802 * object.cc (make_elf_object): Ditto.
5803 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
5804 a format warning.
e1df38aa 5805
88ee28e9
L
5806009-11-09 H.J. Lu <hongjiu.lu@intel.com>
5807
5808 PR gold/10930
5809 * testsuite/plugin_test.c: Include "config.h".
5810
2daedcd6
DK
58112009-11-09 Doug Kwan <dougkwan@google.com>
5812
5813 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
5814 (arm_symbol_value): Remove.
5815 (Arm_relocate_functions::arm_branch_common,
5816 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
5817 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
5818 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
5819 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
5820 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
5821 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
5822 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
5823 Arm_relocate_functions::thm_mobw_abs_nc,
5824 Arm_relocate_functions::thm_mov_abs,
5825 Arm_relocate_functions::movw_prel_nc,
5826 Arm_relocate_functions::thm_movt_abs,
5827 Arm_relocate_functions::movt_prel,
5828 Arm_relocate_functions::thm_movw_prel_nc,
5829 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
5830 (Target_arm::Relocate::relocate): Only decompose address into two
5831 parts if relocation type uses the thumb-bit and pass the actual
5832 bit instead of a flag indicating that the thumb-bit is used. Adjust
5833 calls to methods in Arm_relocate_functions for this change.
5834
1276bc89 58352009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
5836
5837 PR 10925
5838 * reloc.cc: Instantiate
5839 Sized_relobj::initialize_input_to_output_maps and
5840 Sized_relobj:free_input_to_output_maps.
5841
e53ad1b5
ILT
58422009-11-06 Ian Lance Taylor <iant@google.com>
5843
5844 PR 10876
5845 * defstd.cc (in_segment): Set only_if_ref true for "end".
5846
eb44217c
DK
58472009-11-06 Doug Kwan <dougkwan@google.com>
5848
5849 * arm.cc (class Reloc_stub): Correct a comment.
5850 (Target_arm::Target_arm): Initialize arm_input_section_map_.
5851 (Target_arm::scan_section_for_stubs): New method declaration.
5852 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
5853 Change methods from private to protected.
5854 (Target_arm::do_may_relax): New method definition.
5855 (Target_arm::do_relax, Target_arm::group_sections,
5856 Target_arm::scan_reloc_for_stub,
5857 Target_arm::scan_reloc_section_for_stubs): New method declarations.
5858 (Target_arm::arm_input_section_map_): New data member declaration.
5859 (Target_arm::scan_reloc_for_stub,
5860 Target_arm::scan_reloc_section_for_stubs,
5861 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
5862 Target_arm::do_relax): New method definitions.
5863
5d329b7d
ILT
58642009-11-06 Mikolaj Zalewski <mikolaj@google.com>
5865
5866 * configure.ac: Check for (struct stat)::st_mtim
5867 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
5868 * config.in: Regenerate.
5869 * configure: Regenerate.
5870
96a0d71b
ILT
58712009-11-05 Ian Lance Taylor <iant@google.com>
5872
5873 PR 10910
5874 * output.cc (Output_segment::add_output_section): Add missing
5875 return statement.
5876
594c8e5e
ILT
58772009-11-04 Ian Lance Taylor <iant@google.com>
5878
5879 PR 10880
5880 * object.h (class Object): Add is_needed and set_is_needed
5881 methods. Add is_needed_ field. Make bool fields into bitfields.
5882 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
5883 defined in a dynamic object and referenced by a regular object,
5884 set is_needed for the dynamic object.
5885 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
5886 if the file is marked with as_needed and it is not needed.
5887
22b127cc
ILT
58882009-11-04 Ian Lance Taylor <iant@google.com>
5889
5890 PR 10887
5891 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
5892 tags if data is discarded by linker script.
5893 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5894 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5895 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5896 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5897
f5c870d2
ILT
58982009-11-04 Ian Lance Taylor <iant@google.com>
5899
5900 * layout.cc (Layout::get_output_section): Add is_interp and
5901 is_dynamic_linker_section parameters. Change all callers.
5902 (Layout::choose_output_section): Likewise.
5903 (Layout::make_output_section): Likewise.
5904 (Layout::add_output_section_data): Add is_dynamic_linker_section
5905 parameter. Change all callers.
5906 * layout.h (class Layout): Update declarations.
5907 * output.h (class Output_section): Add is_interp, set_is_interp,
5908 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
5909 Add is_interp_, is_dynamic_linker_section_ fields. Change
5910 generate_code_fills_at_write_ to a bitfield.
5911 * output.cc (Output_section::Output_sections): Initialize new
5912 fields.
5913 (Output_segment::add_output_section): Add do_sort parameter.
5914 Change all callers.
5915
1ae4d23b
ILT
59162009-11-03 Ian Lance Taylor <iant@google.com>
5917
5918 PR 10860
5919 * options.h (class General_options): Add --warn-common.
5920 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
5921 merging two common symbols.
5922 (Symbol_table::should_override): Handle --warn-common when merging
5923 a common symbol with a defined symbol. Use report_resolve_problem
5924 for multiple definitions.
5925 (Symbol_table::report_resolve_problem): New function.
5926 * symtab.h (class Symbol_table): Declare report_resolve_problem.
5927
55da9579
DK
59282009-11-03 Doug Kwan <dougkwan@google.com>
5929
5930 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
5931 stub_factory_.
5932 (Target_arm::stub_factory): New method definition.
5933 (Target_arm::new_arm_input_section,
5934 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
5935 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 5936 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
5937 New type definitions.
5938 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
5939 member declarations.
5940 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
5941 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
5942 New method definitions.
5943
37a9ac43
ILT
59442009-11-03 Ian Lance Taylor <iant@google.com>
5945
5946 * options.h (class General_options): Add --warn_constructors.
5947
b3d6a3d4
ILT
59482009-11-03 Ian Lance Taylor <iant@google.com>
5949
5950 PR 10893
5951 * defstd.cc (in_section): Add entries for __rel_iplt_start,
5952 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
5953
934b01dd
ILT
59542009-11-03 Ian Lance Taylor <iant@google.com>
5955
5956 PR 10895
5957 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
5958 --msgid-bugs-address.
5959 (install-pdf): New target.
5960 (install-data_yes): Look up one directory to find mkinstalldirs.
5961
03c1939b
L
59622009-11-03 H.J. Lu <hongjiu.lu@intel.com>
5963
5964 * po/Make-in (.po.gmo): Don't generate .gmo files in source
5965 tree.
5966
ebd95253
DK
59672009-10-30 Doug Kwan <dougkwan@google.com>
5968
5969 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
5970
e9bbb538
DK
59712009-10-30 Doug Kwan <dougkwan@google.com>
5972
5973 * arm.cc (Stub_addend_reader): New struct template definition
5974 and partial specializations.
5975 (Stub_addend_reader::operator()): New method definition for a
5976 partially specialized template.
5977
d5b40221
DK
59782009-10-30 Doug Kwan <dougkwan@google.com>
5979
5980 * arm.cc (Arm_relobj::processor_specific_flags): New method
5981 definition.
5982 (Arm_relobj::do_read_symbols): New method declaration.
5983 (Arm_relobj::processor_specific_flags_): New data member declaration.
5984 (Arm_dynobj): New class definition.
5985 (Target_arm::do_finalize_sections): Add input_objects parameter.
5986 (Target_arm::do_adjust_elf_header): New method declaration.
5987 (Target_arm::are_eabi_versions_compatible,
5988 (Target_arm::merge_processor_specific_flags): New method declaration.
5989 (Target_arm::do_make_elf_object): New overloaded method definitions
5990 and declaration.
5991 (Arm_relobj::do_read_symbols): New method definition.
5992 (Arm_dynobj::do_read_symbols): Ditto.
5993 (Target_arm::do_finalize_sections): Add input_objects parameters.
5994 Merge processor-specific flags from all input objects.
5995 (Target_arm::are_eabi_versions_compatible,
5996 Target_arm::merge_processor_specific_flags,
5997 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
5998 New method definitions.
5999 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
6000 Input_objects pointer type parameter.
6001 * layout.cc (Layout::finalize): Pass input objects to target's.
6002 finalize_sections function.
6003 * output.cc (Output_file_header::do_sized_write): Set ELF file
6004 header's processor-specific flags.
6005 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6006 Input_objects pointer type parameter.
6007 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6008 * target.h (Input_objects): New forward class declaration.
6009 (Target::processor_specific_flags,
6010 Target::are_processor_specific_flags_sect): New method definitions.
6011 (Target::finalize_sections): Add input_objects parameter.
6012 (Target::Target): Initialize processor_specific_flags_ and
6013 are_processor_specific_flags_set_.
6014 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6015 parameter.
6016 (Target::set_processor_specific_flags): New method definition.
6017 (Target::processor_specific_flags_,
6018 Target::are_processor_specific_flags_set_): New data member
6019 declarations.
6020 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6021 Input_objects pointer type parameter.
6022
ebabffbd
DK
60232009-10-30 Doug Kwan <dougkwan@google.com>
6024
6025 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6026
ad0f2072
ILT
60272009-10-28 Ian Lance Taylor <iant@google.com>
6028
6029 * object.h (class Relobj): Drop options parameter from
6030 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6031 do_scan_relocs, do_relocate. Change all callers.
6032 (class Sized_relobj): Drop options parameters from
6033 do_gc_process_relocs, do_scan_relocs, do_relocate,
6034 do_relocate_sections, relocate_sections, emit_relocs_scan,
6035 emit_relocs_scan_reltype. Change all callers.
6036 (struct Relocate_info): Remove options field and all references to
6037 it.
6038 * reloc.h (class Read_relocs): Remove options constructor
6039 parameter and options_ field. Change all callers.
6040 (class Gc_process_relocs, class Scan_relocs): Likewise.
6041 (class Relocate_task): Likewise.
6042 * target-reloc.h (scan_relocs): Remove options parameter. Change
6043 all callers.
6044 (scan_relocatable_relocs): Likewise.
6045 * target.h (class Sized_target): Remove options parameter from
6046 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6047 all callers.
6048 * gc.h (gc_process_relocs): Remove options parameter. Change all
6049 callers.
6050 * arm.cc: Update functions to remove options parameters.
6051 * i386.cc: Likewise.
6052 * powerpc.cc: Likewise.
6053 * sparc.cc: Likewise.
6054 * x86_64.cc: Likewise.
6055 * testsuite/testfile.cc: Likewise.
6056
8ffa3667
DK
60572009-10-28 Doug Kwan <dougkwan@google.com>
6058
6059 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6060 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6061 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6062 New method definitions.
6063
40f36857
CC
60642009-10-28 Cary Coutant <ccoutant@google.com>
6065
6066 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6067 (Plugin::cleanup_done_): New member.
6068 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6069 (Plugin_manager::cleanup_done_): Remove.
6070 (Plugin_manager::add_input_file): Edit error message.
6071 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6072 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6073
2c849493
ILT
60742009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6075
6076 * fileread.cc: (File_read::View::~View): Use the new
6077 data_ownership_ filed.
6078 (File_read::~File_read): Dispose the new whole_file_view_.
6079 (File_read::open): Mmap the whole file if needed.
6080 (File_read::open): Use whole_file_view_ instead of contents_.
6081 (File_read::find_view): Use whole_file_view_ if applicable.
6082 (File_read::do_read): Use whole_file_view_ instead of contents_.
6083 (File_read::make_view): Use whole_file_view_ instead of contents_,
6084 update File_read::View::View call.
6085 (File_read::find_or_make_view): Update File_read::View::View
6086 call.
6087 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6088 remove contents_
6089 (File_read::View::Data_ownership): New enum.
6090 (File_read::View::View): Replace bool mapped_ with Data_ownership
6091 argument.
6092 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6093 (File_read::View::data_ownership_): New field.
6094 (File_read::contents_): Remove (replaced by whole_file_view_).
6095 (File_read::whole_file_view_): New field.
6096 * options.h (class General_options): Add --keep-files-mapped.
6097
24998053
CC
60982009-10-27 Cary Coutant <ccoutant@google.com>
6099
6100 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6101 * testsuite/Makefile.am (plugin_test_5): New test case.
6102 * testsuite/Makefile.in: Regenerate.
6103
72adc4fa
DK
61042009-10-25 Doug Kwan <dougkwan@google.com>
6105
6106 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6107 from private to protected to allow access by child class.
6108 (Sized_relobj::do_relocate_sections): New method declaration.
6109 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6110 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6111 Sized_relobj::relocate_sections. Instantiate template explicitly
6112 for different target sizes and endianity.
6113
07f508a2
DK
61142009-10-24 Doug Kwan <dougkwan@google.com>
6115
6116 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6117 (Arm_input_section::as_arm_input_section): New method.
6118 (Arm_output_section): New class definition.
6119 (Arm_output_section::create_stub_group,
6120 Arm_output_section::group_sections): New method definitions.
6121
10ad9fe5
DK
61222009-10-22 Doug Kwan <dougkwan@google.com>
6123
6124 * arm.cc (Arm_input_section): New class definition.
6125 (Arm_input_section::init, Arm_input_section:do_write,
6126 Arm_input_section::set_final_data_size,
6127 Arm_input_section::do_reset_address_and_file_offset): New method
6128 definitions.
6129
56ee5e00
DK
61302009-10-21 Doug Kwan <dougkwan@google.com>
6131
6132 * arm.cc (Stub_table, Arm_input_section): New forward class
6133 declarations.
6134 (Stub_table): New class defintion.
6135 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6136 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6137 New method definition.
6138
b569affa
DK
61392009-10-21 Doug Kwan <dougkwan@google.com>
6140
6141 * arm.cc: Update copyright comments.
6142 (Target_arm): New forward class template declaration.
6143 (Arm_address): New type.
6144 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6145 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6146 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6147 constants.
6148 (Insn_template): Same.
6149 (DEF_STUBS): New macro.
6150 (Stub_type): New enum type.
6151 (Stub_template): New class definition.
6152 (Stub): Same.
6153 (Reloc_stub): Same.
6154 (Stub_factory): Same.
6155 (Target_arm::Target_arm): Initialize may_use_blx_ and
6156 should_force_pic_veneer_.
6157 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6158 Target_arm::should_force_pic_veneer,
6159 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6160 Target_arm::using_thumb_only, Target_arm:;default_target): New
6161 method defintions.
6162 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6163 New data member declarations.
6164 (Insn_template::size, Insn_template::alignment): New method defintions.
6165 (Stub_template::Stub_template): New method definition.
6166 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6167 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6168 (Stub_factory::Stub_factory): New method definition.
6169 * gold.h (string_hash): New template.
6170 * output.h (Input_section_specifier::hash_value): Use
6171 gold::string_hash.
6172 (Input_section_specifier::string_hash): Remove.
6173 * stringpool.cc (Stringpool_template::string_hash): Use
6174 gold::string_hash.
6175
6c172549
DK
61762009-10-20 Doug Kwan <dougkwan@google.com>
6177
6178 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6179 symbols of relaxed input sections.
6180 * output.h (Output_section::find_relaxed_input_section): Make
6181 method public.
6182
c5617f2f
DK
61832009-10-16 Doug Kwan <dougkwan@google.com>
6184
6185 * dynobj.cc (Versions::Versions): Initialize version_script_.
6186 Only insert base version symbol definition for a shared object
6187 if version script defines any version versions.
6188 (Versions::define_base_version): New method definition.
6189 (Versions::add_def): Check that base version is not needed.
6190 (Versions::add_need): Define base version lazily.
6191 * dynobj.h (Versions::define_base_version): New method declaration.
6192 (Versions::needs_base_version_): New data member declaration.
6193 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6194 (check_DATA): Add no_version_test.stdout.
6195 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6196 New make rules.
6197 * testsuite/Makefile.in: Regenerate.
6198 * testsuite/no_version_test.c: New file.
6199 * testsuite/no_version_test.sh: Ditto.
6200
3c12dcdb
DK
62012009-10-16 Doug Kwan <dougkwan@google.com>
6202
6203 * expression.cc (class Segment_start_expression): New class definition.
6204 (Segment_start_expression::value): New method definition.
6205 (script_exp_function_segment_start): Return a new
6206 Segment_start_expression.
6207 * gold/script-c.h (script_saw_segment_start_expression): New function
6208 prototype.
6209 * script-sections.cc (Script_sections::Script_sections): Initialize
6210 SAW_SEGMENT_START_EXPRESSION_ to false.
6211 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6212 and -Tbbs options to specify section addresses if given in
6213 command line and no SEGMENT_START expression is seen in a script.
6214 * script-sections.h (Script_sections::saw_segment_start_expression,
6215 Script_sections::set_saw_segment_start_expression): New method
6216 definition.
6217 (Script_sections::saw_segment_start_expression_): New data member
6218 declaration.
6219 * script.cc (script_saw_segment_start_expression): New function.
6220 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6221 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6222 script_test_7.sh and script_test_8.sh.
6223 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6224 script_test_8.stdout.
6225 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6226 (script_test_6, script_test_6.stdout, script_test_7,
6227 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6228 * Makefile.in: Regenerate.
6229 * testsuite/script_test_6.sh: New file.
6230 * testsuite/script_test_6.t: Same.
6231 * testsuite/script_test_7.sh: Same.
6232 * testsuite/script_test_7.t: Same.
6233 * testsuite/script_test_8.sh: Same.
6234
64b1ae37
DK
62352009-10-16 Doug Kwan <dougkwan@google.com>
6236
6237 * output.cc (Output_segment::set_section_list_address): Cast
6238 expressions to unsigned long long type to avoid format warnings.
6239
661be1e2
ILT
62402009-10-15 Ian Lance Taylor <iant@google.com>
6241
12edd763 6242 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6243 dot assignment to script_sections_.
12edd763
ILT
6244 * script-sections.cc (Script_sections::add_dot_assignment):
6245 Initialize if necessary.
6246
68b6574b
ILT
6247 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6248 program headers with no load segment if there is a linker script.
6249
661be1e2
ILT
6250 * layout.cc (Layout::set_segment_offsets): Align the file offset
6251 to the segment aligment for -N or -n with no load segment.
6252 * output.cc (Output_segment::add_output_section): Don't crash if
6253 the first section is a TLS section.
6254 (Output_segment::set_section_list_addresses): Print an error
6255 message if the address moves backward in a linker script.
6256 * script-sections.cc
6257 (Output_section_element_input::set_section_addresses): Don't
6258 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6259 (Orphan_output_section::set_section_addresses): Likewise.
6260
f15f61a7
DK
62612009-10-15 Doug Kwan <dougkwan@google.com>
6262
6263 * layout.cc (Layout::finish_dynamic_section): Generate tags
6264 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6265 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6266 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6267
82bb573a
ILT
62682009-10-14 Ian Lance Taylor <iant@google.com>
6269
6270 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6271 fields.
6272 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6273 data_shdr fields of relinfo.
6274 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6275 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6276 R_386_TLS_LDO_32, adjust based on section flags.
6277 (Target_i386::Relocate::fix_up_ldo): Remove.
6278
374ad285
ILT
62792009-10-13 Ian Lance Taylor <iant@google.com>
6280
6281 Add support for -pie.
6282 * options.h (class General_options): Add -pie and
6283 --pic-executable.
6284 (General_options::output_is_position_independent): Test -pie.
6285 (General_options::output_is_executable): Return true if not shared
6286 and not relocatable.
6287 (General_options::output_is_pie): Remove.
6288 * options.cc (General_options::finalize): Reject incompatible uses
6289 of -pie.
6290 * gold.cc (queue_middle_tasks): A -pie link is not static.
6291 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6292 * symtab.cc (Symbol::final_value_is_known): Return false if
6293 output_is_position_independent.
6294 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6295 output_is_position_independent.
6296 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6297 output_is_position_independent.
6298 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6299 output_is_position_independent.
6300 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6301 two_file_pie_test.
6302 (basic_pie_test.o, basic_pie_test): New targets.
6303 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6304 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6305 (two_file_pie_test): New target.
6306 * testsuite/Makefile.in: Rebuild.
6307 * README: Remove note saying that -pie is not supported.
6308
c6585162
ILT
63092009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6310
6311 * options.h (class General_options): Add -init and -fini.
6312 * layout.cc (Layout::finish_dynamic_section): Emit
6313 given init and fini functions.
6314
032ce4e9
ST
63152009-10-13 Sriraman Tallam <tmsriram@google.com>
6316
6317 * gc.h (gc_process_relocs): Check if icf is enabled using new
6318 function.
6319 * gold.cc (queue_initial_tasks): Likewise.
6320 (queue_middle_tasks): Likewise.
6321 * object.cc (do_layout): Likewise.
6322 * symtab.cc (is_section_folded): Likewise.
6323 * main.cc (main): Likewise.
6324 * reloc.cc (Read_relocs::run): Likewise.
6325 (Sized_relobj::do_scan_relocs): Likewise.
6326 * icf.cc (is_function_ctor_or_dtor): New function.
6327 (Icf::find_identical_sections): Check if function is ctor or dtor when
6328 safe icf is chosen.
6329 * options.h (General_options::icf): Change option to be an enum.
6330 (Icf_status): New enum.
6331 (icf_enabled): New method.
6332 (icf_safe_folding): New method.
6333 (set_icf_status): New method.
6334 (icf_status_): New variable.
6335 * (options.cc) (General_options::finalize): Set icf_status_.
6336 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6337 icf_test and icf_keep_unique_test to use the --icf enum flag.
6338 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6339 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6340
f345227a
ST
63412009-10-12 Sriraman Tallam <tmsriram@google.com>
6342
6343 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6344 includes to gc.h and icf.h.
6345 * arm.cc: Include gc.h.
6346 * gold.cc: Likewise.
6347 * i386.cc: Likewise.
6348 * powerpc.cc: Likewise.
6349 * sparc.cc: Likewise.
6350 * x86_64.cc: Likewise.
6351 * gc.h: Include icf.h.
6352
1c7814ed
ILT
63532009-10-11 Ian Lance Taylor <iant@google.com>
6354
6355 * plugin.cc: Include "gold.h" before other header files.
6356
ae3b5189
CD
63572009-10-10 Chris Demetriou <cgd@google.com>
6358
6359 * options.h (Input_file_argument::Input_file_type): New enum.
6360 (Input_file_argument::is_lib_): Replace with...
6361 (Input_file_argument::type_): New member.
6362 (Input_file_argument::Input_file_argument): Take Input_file_type
6363 'type' rather than boolean 'is_lib' as second argument.
6364 (Input_file_argument::is_lib): Use type_.
6365 (Input_file_argument::is_searched_file): New function.
6366 (Input_file_argument::may_need_search): Handle is_searched_file.
6367 * options.cc (General_options::parse_library): Support -l:filename.
6368 (General_options::parse_just_symbols): Update for Input_file_argument
6369 changes.
6370 (Command_line::process): Likewise.
6371 * archive.cc (Archive::get_file_and_offset): Likewise.
6372 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6373 * script.cc (read_script_file, script_add_file): Likewise.
6374 * fileread.cc (Input_file::Input_file): Likewise.
6375 (Input_file::will_search_for): Handle is_searched_file.
6376 (Input_file::open): Likewise.
6377 * readsyms.cc (Read_symbols::get_name): Likewise.
6378 * testsuite/Makefile.am (searched_file_test): New test.
6379 * testsuite/Makefile.in: Regenerate.
6380 * testsuite/searched_file_test.cc: New file.
6381 * testsuite/searched_file_test_lib.cc: New file.
6382
f3048a1d
ILT
63832009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6384 Ian Lance Taylor <iant@google.com>
6385
6386 * descriptor.cc: Include <cstdio> and "binary-io.h".
6387 (Descriptors::open): Open the files in binary mode always.
6388 * script.cc (Lex::get_token): Treat \r as whitespace.
6389
d4780e57
ILT
63902009-10-09 Ian Lance Taylor <iant@google.com>
6391
6392 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6393
d9a893b8
ILT
63942009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6395 Ian Lance Taylor <iant@google.com>
6396
6397 * configure.ac: Check for readv function also.
6398 * fileread.cc (readv): Define if not HAVE_READV.
6399 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6400 does not exist.
6401 * config.in: Regenerate.
6402 * configure: Regenerate.
6403
c0a62865
DK
64042009-10-09 Doug Kwan <dougkwan@google.com>
6405
6406 * layout.cc (Layout::make_output_section): Call target hook to make
6407 ordinary output section.
6408 (Layout::finalize): Adjust parameter list of call the
6409 Target::may_relax().
6410 * layout.h (class Layout::section_list): New method.
6411 * merge.h (Output_merge_base::entsize): Change visibility to public.
6412 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6413 New methods.
6414 (Output_merge_string::do_is_string): New method.
6415 * object.cc (Sized_relobj::do_setup): renamed from
6416 Sized_relobj::set_up.
6417 * object.h (Sized_relobj::adjust_shndx,
6418 Sized_relobj::initializ_input_to_output_maps,
6419 Sized_relobj::free_input_to_output_maps): Change visibilities to
6420 protected.
6421 (Sized_relobj::setup): Virtualize.
6422 (Sized_relobj::do_setup): New method declaration.
6423 (Sized_relobj::invalidate_section_offset,
6424 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6425 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6426 * options.cc (parse_int): New function.
6427 * options.h (parse_int): New declaration.
6428 (DEFINE_int): New macro.
6429 (stub_group_size): New option.
6430 * output.cc (Output_section::Output_section): Initialize memebers
6431 merge_section_map_, merge_section_by_properties_map_,
6432 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6433 (Output_section::add_input_section): Handled deferred code-fill
6434 generation and remove an old comment.
6435 (Output_section::add_relaxed_input_section): New method definition.
6436 (Output_section::add_merge_input_section): Use merge section by
6437 properties map to speed to search. Update merge section maps
6438 as appropriate.
6439 (Output_section::build_relaxation_map): New method definition.
6440 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6441 Same.
6442 (Output_section::relax_input_section): Renamed to
6443 Output_section::convert_input_sections_to_relaxed_sections and change
6444 interface to take a vector of pointers to relaxed sections.
6445 (Output_section::find_merge_section,
6446 Output_section::find_relaxed_input_section): New method definitions.
6447 (Output_section::is_input_address_mapped,
6448 Output_section::output_offset, Output_section::output_address):
6449 Use output section data maps to speed up searching.
6450 (Output_section::find_starting_output_address): Add comments.
6451 (Output_section::do_write,
6452 Output_section::write_to_postprocessing_buffer): Do code-fill
6453 generation as appropriate.
6454 (Output_section::get_input_sections): Invalidate relaxed input section
6455 map.
6456 (Output_section::restore_states): Adjust type of checkpoint .
6457 Invalidate relaxed input section map.
6458 * output.h (Output_merge_base): New class declaration.
6459 (Input_section_specifier): New class defintion.
6460 (class Output_relaxed_input_section) Change base class to
6461 Output_section_data_build.
6462 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6463 base class initializer.
6464 (Output_section::add_relaxed_input_section): New method declaration.
6465 (Output_section::Input_section): Change visibility to protected.
6466 (Output_section::Input_section::relobj,
6467 Output_section::Input_section::shndx): Handle relaxed input sections.
6468 Output_section::input_sections) Change visibility to protected. Also
6469 define overload to return a non-const pointer.
6470 (Output_section::Merge_section_properties): New class defintion.
6471 (Output_section::Merge_section_by_properties_map,
6472 Output_section::Output_section_data_by_input_section_map,
6473 Output_section::Relaxation_map): New types.
6474 (Output_section::relax_input_section): Rename method to
6475 Output_section::convert_input_sections_to_relaxed_sections and change
6476 interface to take a vector of relaxed section pointers.
6477 (Output_section::find_merge_section,
6478 Output_section::find_relaxed_input_section,
6479 Output_section::build_relaxation_map,
6480 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6481 New method declarations.
6482 (Output_section::merge_section_map_
6483 Output_section::merge_section_by_properties_map_,
6484 Output_section::relaxed_input_section_map_,
6485 Output_section::is_relaxed_input_section_map_valid_,
6486 Output_section::generate_code_fills_at_write_): New data members.
6487 * script-sections.cc
6488 (Output_section_element_input::set_section_addresses): Call
6489 current_data_size and addralign methods of relaxed input sections.
6490 (Orphan_output_section::set_section_addresses): Call current_data_size
6491 and addralign methods of relaxed input sections.
6492 * symtab.cc (Symbol_table::compute_final_value): Extract template
6493 from the body of Symbol_table::sized_finalize_symbol.
6494 (Symbol_table::sized_finalized_symbol): Call
6495 Symbol_table::compute_final_value.
6496 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6497 (Symbol_table::compute_final_value): New templated method declaration.
6498 * target.cc (Target::do_make_output_section): New method defintion.
6499 * target.h (Target::make_output_section): New method declaration.
6500 (Target::relax): Add more parameters for input objects, symbol table
6501 and layout. Adjust call to do_relax.
6502 (Target::do_make_output_section): New method declaration.
6503 (Target::do_relax): Add parameters for input objects, symbol table
6504 and layout.
6505
d446d6c4
ILT
65062009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6507
6508 * pread.c: Include stdio.h.
6509
bc06c745
ILT
65102009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6511
6512 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6513 defined.
6514
75aea3d0
ILT
65152009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6516
6517 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6518 Change read_shndx type to unsigned int.
6519 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6520 int.
6521 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6522 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6523 Change read_shndx type to unsigned int.
6524 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6525 int.
6526 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6527 * layout.cc (Layout::create_symtab_sections): Cast the result of
6528 local_symcount * symsize to off_t in the gold_assert.
6529
be8fcb75
ILT
65302009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6531
6532 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6533 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6534 R_ARM_BASE_ABS.
6535 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6536 (Arm_relocate_functions::thm_abs5): New function.
6537 (Arm_relocate_functions::abs12): New function.
6538 (Arm_relocate_functions::abs16): New function.
6539 (Arm_relocate_functions::base_abs): New function.
6540 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6541 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6542 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6543 R_ARM_BASE_ABS.
6544 (Scan::global): Likewise.
6545 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6546 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6547 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6548 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6549 R_ARM_BASE_ABS.
6550
c2a122b6
ILT
65512009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6552
6553 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6554 (Arm_relocate_functions::movt_prel): New function.
6555 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6556 (Arm_relocate_functions::thm_movt_prel): New function.
6557 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6558 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6559 (Scan::global, Relocate::relocate): Likewise.
6560 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6561
c4aa1e2d
ILT
65622009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6563
6564 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6565 Incremental_checker.
6566 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6567 unsigned int.
6568 (class Incremental_inputs_header): New class.
6569 (Incremental_inputs_header_writer): Edit comment.
6570 (Incremental_inputs_entry): New class.
6571 (Incremental_inputs_entry_writer): Edit comment.
6572 (Sized_incremental_binary::do_find_incremental_inputs_section):
6573 Add *strtab_shndx parameter, fill it.
6574 (Sized_incremental_binary::do_check_inputs): New method.
6575 (Incremental_checker::can_incrementally_link_output_file): Use
6576 Sized_incremental_binary::check_inputs.
6577 (Incremental_inputs::report_command_line): Save command line in
6578 command_line_.
6579 * incremental.h:
6580 (Incremental_binary::find_incremental_inputs_section): New
6581 method.
6582 (Incremental_binary::do_find_incremental_inputs_section): Add
6583 strtab_shndx parameter.
6584 (Incremental_binary::do_check_inputs): New pure virtual method.
6585 (Sized_incremental_binary::do_check_inputs): Declare.
6586 (Incremental_checker::Incremental_checker): Add incremental_inputs
6587 parameter, use it to initialize incremental_inputs_.
6588 (Incremental_checker::incremental_inputs_): New field.
6589 (Incremental_checker::command_line): New method.
6590 (Incremental_checker::inputs): New method.
6591 (Incremental_checker::command_line_): New field.
6592
c549a694
ILT
65932009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6594
6595 * incremental.cc: Include <cstdarg> and "target-select.h".
6596 (vexplain_no_incremental): New function.
6597 (explain_no_incremental): New function.
6598 (Incremental_binary::error): New method.
6599 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6600 method.
6601 (make_sized_incremental_binary): New function.
6602 (open_incremental_binary): New function.
6603 (can_incrementally_link_file): Add checks if output is ELF and has
6604 inputs section.
6605 * incremental.h: Include "elfcpp_file.h" and "output.h".
6606 (Incremental_binary): New class.
6607 (Sized_incremental_binary): New class.
6608 (open_incremental_binary): Declare.
6609 * object.cc (is_elf_object): Use
6610 elfcpp::Elf_recognizer::is_elf_file.
6611 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6612 * output.h (Output_file::filesize): New method.
6613
fd3c5f0b
ILT
66142009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6615
6616 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6617 New function.
6618 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6619 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6620 function.
6621 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6622 function.
6623 (Arm_relocate_functions::movw_abs_nc): New function.
6624 (Arm_relocate_functions::movt_abs): New function.
6625 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6626 (Arm_relocate_functions::thm_movt_abs): New function.
6627 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6628 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6629 (Scan::global): Likewise.
6630 (Relocate::relocate): Likewise.
6631 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6632
7f5309a5
ILT
66332009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6634
6635 * arm.cc (Arm_relocate_functions::got_prel) New function.
6636 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6637 (Relocate::relocate): Likewise.
6638 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6639
364c7fa5
ILT
66402009-10-06 Ian Lance Taylor <iant@google.com>
6641
6642 * options.h (class General_options): Define
6643 split_stack_adjust_size parameter.
6644 * object.h (class Object): Add uses_split_stack_ and
6645 has_no_split_stack_ fields. Add uses_split_stack and
6646 has_no_split_stack accessor functions. Declare
6647 handle_split_stack_section.
6648 (class Reloc_symbol_changes): Define.
6649 (class Sized_relobj): Define Function_offsets. Declare
6650 split_stack_adjust, split_stack_adjust_reltype, and
6651 find_functions.
6652 * object.cc (Object::handle_split_stack_section): New function.
6653 (Sized_relobj::do_layout): Call handle_split_stack_section.
6654 * dynobj.cc (Sized_dynobj::do_layout): Call
6655 handle_split_stack_section.
6656 * reloc.cc (Sized_relobj::relocate_sections): Call
6657 split_stack_adjust for executable sections in split_stack
6658 objects. Pass reloc_map to relocate_section.
6659 (Sized_relobj::split_stack_adjust): New function.
6660 (Sized_relobj::split_stack_adjust_reltype): New function.
6661 (Sized_relobj::find_functions): New function.
6662 * target-reloc.h: Include "object.h".
6663 (relocate_section): Add reloc_symbol_changes parameter. Change
6664 all callers.
6665 * target.h (class Target): Add calls_non_split method. Declare
6666 do_calls_non_split virtual method. Declare match_view and
6667 set_view_to_nop.
6668 * target.cc: Include "elfcpp.h".
6669 (Target::do_calls_non_split): New function.
6670 (Target::match_view): New function.
6671 (Target::set_view_to_nop): New function.
6672 * gold.cc (queue_middle_tasks): Give an error if mixing
6673 split-stack and non-split-stack objects with -r.
6674 * i386.cc (Target_i386::relocate_section): Add
6675 reloc_symbol_changes parameter.
6676 (Target_i386::do_calls_non_split): New function.
6677 * x86_64.cc (Target_x86_64::relocate_section): Add
6678 reloc_symbol_changes parameter.
6679 (Target_x86_64::do_calls_non_split): New function.
6680 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
6681 parameter.
6682 * powerpc.cc (Target_powerpc::relocate_section): Add
6683 reloc_symbol_changes parameter.
6684 * sparc.cc (Target_sparc::relocate_section): Add
6685 reloc_symbol_changes parameter.
6686 * configure.ac: Call AM_CONDITIONAL for the default target.
6687 * configure: Rebuild.
6688 * testsuite/Makefile.am (TEST_AS): New variable.
6689 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
6690 (check_DATA): Add split_i386 and split_x86_64 files.
6691 (SPLIT_DEFSYMS): Define.
6692 (split_i386_[1234n].o): New targets.
6693 (split_i386_[124]): New targets.
6694 (split_i386_[1234r].stdout): New targets.
6695 (split_x86_64_[1234n].o): New targets.
6696 (split_x86_64_[124]): New targets.
6697 (split_x86_64_[1234r].stdout): New targets.
6698 (MOSTLYCLEANFILES): Add new executables.
6699 * testsuite/split_i386.sh: New file.
6700 * testsuite/split_x86_64.sh: New file.
6701 * testsuite/split_i386_1.s: New file.
6702 * testsuite/split_i386_2.s: New file.
6703 * testsuite/split_i386_3.s: New file.
6704 * testsuite/split_i386_4.s: New file.
6705 * testsuite/split_i386_n.s: New file.
6706 * testsuite/split_x86_64_1.s: New file.
6707 * testsuite/split_x86_64_2.s: New file.
6708 * testsuite/split_x86_64_3.s: New file.
6709 * testsuite/split_x86_64_4.s: New file.
6710 * testsuite/split_x86_64_n.s: New file.
6711 * testsuite/testfile.cc (Target_test): Update relocation_section
6712 function.
6713 * testsuite/Makefile.in: Rebuild.
6714
e8a9fcda
ILT
67152009-10-06 Ian Lance Taylor <iant@google.com>
6716
6717 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
6718 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
6719 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
6720 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
6721 the address on ldo_addrs_.
6722 (Target_i386::Relocate::fix_up_ldo): New function.
6723
e99daf92
ILT
67242009-10-06 Rafael Espindola <espindola@google.com>
6725
6726 * plugin.cc (add_input_library): New.
6727 (Plugin::load): Add add_input_library to tv.
6728 (Plugin_manager::add_input_file): Add the is_lib argument.
6729 (add_input_file): Update call to Plugin_manager::add_input_file.
6730 (add_input_library): New.
6731 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
6732
966d4097
DK
67332009-09-30 Doug Kwan <dougkwan@google.com>
6734
6735 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
6736 symbol and call Symbol::may_need_copy_reloc to determine if
6737 a copy reloc is needed.
6738 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
6739 nocopyreloc is given in command line.
6740 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
6741 given in command line.
6742 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
6743 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
6744 of the removed Target_i386::may_need_copy_reloc.
6745 * options.h (copyreloc): New option with default value false.
6746 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6747 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
6748 instead of the removed Target_powerpc::may_need_copy_reloc.
6749 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
6750 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
6751 instead of the removed Target_sparc::may_need_copy_reloc.
6752 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
6753 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
6754 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
6755 instead of the removed Target_x86_64::may_need_copy_reloc.
6756
029ba973
ILT
67572009-09-30 Ian Lance Taylor <iant@google.com>
6758
6759 * object.h (class Object): Remove target_ field, and target,
6760 sized_target, and set_target methods.
6761 (Object::sized_target): Remove.
6762 (class Sized_relobj): Update declarations. Remove sized_target.
6763 * object.cc (Sized_relobj::setup): Remove target parameter.
6764 Change all callers.
6765 (Input_objects::add_object): Don't do anything with the target.
6766 (make_elf_sized_object): Add punconfigured parameter. Change all
6767 callers. Set or test parameter target.
6768 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
6769 Change all callers.
6770 * parameters.cc (Parameters::set_target): Change parameter type to
6771 be non-const.
6772 (Parameters::default_target): Remove.
6773 (set_parameters_target): Change parameter type to be non-const.
6774 (parameters_force_valid_target): New function.
6775 (parameters_clear_target): New function.
6776 * parameters.h (class Parameters): Update declarations. Remove
6777 default_target method. Add sized_target and clear_target
6778 methods. Change target_ to be non-const.
6779 (set_parameters_target): Update declaration.
6780 (parameters_force_valid_target): Declare.
6781 (parameters_clear_target): Declare.
6782 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
6783 as NULL if we aren't searching.
6784 (Add_symbols::run): Don't check for compatible target.
6785 * fileread.cc (Input_file::open_binary): Call
6786 parameters_force_valid_target.
6787 * gold.cc (queue_middle_tasks): Likewise.
6788 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
6789 set_target on object.
6790 * dynobj.h (class Sized_dynobj): Update declarations.
6791 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
6792 make_elf_object returns NULL.
6793 (Archive::include_member): Don't check whether object target is
6794 compatible.
6795 * output.cc (Output_section::add_input_section): Get target from
6796 parameters.
6797 (Output_section::relax_input_section): Likewise.
6798 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
6799 parameters.
6800 (Sized_relobj::do_scan_relocs): Likewise.
6801 (Sized_relobj::relocate_sections): Likewise.
6802 * resolve.cc (Symbol_table::resolve): Likewise.
6803 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
6804 parameter. Change all callers.
6805 (Symbol_table::add_from_object): Get target from parameters.
6806 (Symbol_table::add_from_relobj): Don't check object target.
6807 (Symbol_table::add_from_dynobj): Likewise.
6808 (Symbol_table::define_special_symbol): Get target from
6809 parameters.
6810 * symtab.h (class Symbol_table): Update declaration.
6811 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
6812 parameter. Change all callers. Clear parameter target.
6813 (Binary_test): Test target here.
6814 * testsuite/object_unittest.cc (gold_testsuite): Remove
6815 target_test_pointer parameter. Change all callers.
6816 (Object_test): Test target here.
6817
a6a22b83
ILT
68182009-09-26 Ian Lance Taylor <iant@google.com>
6819
6820 * testsuite/initpri1.c: Don't try to use constructor priorities if
6821 compiling with gcc before 4.3.
6822
6a8f49fe
ILT
68232009-09-22 Mikolaj Zalewski <mikolajz@google.com>
6824
6825 * testsuite/retain_symbols_file_test.sh (check_present): Change
6826 output file name to retain_symbols_file_test.stdout.
6827 (check_absent): Likewise.
6828
8c604651
CS
68292009-09-18 Craig Silverstein <csilvers@google.com>
6830
6831 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
6832 * options.cc: Include <cerrno> and <fstream>.
6833 (General_options::finalize): Parse -retain-symbols-file tag.
6834 * options.h: New flag.
6835 (General_options): New method should_retain_symbol, new
6836 variable symbols_to_retain.
6837 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
6838 should_retain_symbol map.
6839 * testsuite/Makefile.am (retain_symbols_file_test): New test.
6840 * testsuite/Makefile.in: Regenerate.
6841 * testsuite/retain_symbols_file_test.sh: New file.
6842
ca58b19f
NC
68432009-09-18 Nick Clifton <nickc@redhat.com>
6844
6845 * po/es.po: Updated Spanish translation.
6846
20e6d0d6
DK
68472009-09-17 Doug Kwan <dougkwan@google.com>
6848
6849 * debug.h (DEBUG_RELAXATION): New constant.
6850 (DEBUG_ALL): Add DEBUG_RELAXATION.
6851 (debug_string_to_enum): Add relaxation debug option.
6852 * layout.cc
6853 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
6854 Layout::Relaxation_debug_check::read_sections,
6855 Layout::Relaxation_debug_check::read_sections): New method definitions.
6856 (Layout::Layout): Initialize data members
6857 record_output_section_data_from_scrips_,
6858 script_output_section_data_list_ and relaxation_debug_check_.
6859 (Layout::save_segments, Layout::restore_segments,
6860 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6861 Layout::relaxation_loop_body): New method definitions.
6862 (Layout::finalize): Support relaxation. Move section layout code to
6863 Layout::relaxation_loop_body.
6864 (Layout::set_asection_address_from_script): Move code for orphan
6865 section placement out.
6866 (Layout::place_orphan_sections_in_script): New method definition.
6867 * layout.h (Output_segment_headers, Output_file_header):
6868 New forward class declarations.
6869 (Layout::~Layout): Define.
6870 (Layout::new_output_section_data_from_script): New method definition.
6871 (Layout::place_orphan_sections_in_script): New method declaration.
6872 (Layout::Segment_states): New type declaration.
6873 (Layout::save_segments, Layout::restore_segments,
6874 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
6875 Layout::relaxation_loop_body): New method declarations.
6876 (Layout::Output_section_data_list): New type declaration.
6877 (Layout::Relaxation_debug_check): New class definition.
6878 (Layout::record_output_section_data_from_script_,
6879 Layout::script_output_section_data_list_, Layout::segment_states_,
6880 Layout::relaxation_debug_check_): New data members.
6881 * output.cc: (Output_section_headers::do_size): New method definition.
6882 (Output_section_headers::Output_section_headers): Move size
6883 computation to Output_section_headers::do_size.
6884 (Output_segment_headers::do_size): New method definition.
e1df38aa 6885 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
6886 Output_file_header::do_size and call it.
6887 (Output_file_header::do_size): New method definition.
6888 (Output_data_group::Output_data_group): Adjust call to
6889 Output_section_data.
6890 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
6891 (Output_symtab_xindex::do_write): Add array bound check.
6892 (Output_section::Input_section::print_to_mapfile): Handle
6893 RELAXED_INPUT_SECTION_CODE.
6894 (Output_section::Output_section): Initialize data member checkpoint_.
6895 (Output_section::~Output_section): Delete checkpoint object pointed
6896 by checkpoint_.
6897 (Output_section::add_input_section): Always add an Input_section if
6898 relaxing.
6899 (Output_section::add_merge_input_section): Add assert.
6900 (Output_section::relax_input_section): New method definition.
6901 (Output_section::set_final_data_size): Set load address to zero for
6902 an unallocated section.
6903 (Output_section::do_address_and_file_offset_have_reset_values):
6904 New method definition.
6905 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
6906 Handle relaxed input section.
6907 (Output_section::sort_attached_input_sections): Checkpoint input
6908 section list lazily.
6909 (Output_section::get_input_sections): Change type of input_sections to
6910 list of Simple_input_section pointers. Checkpoint input section list
6911 lazily. Also handle relaxed input sections.
6912 (Output_section::add_input_section_for_script): Take a reference to
6913 a Simple_input_section object instead of Relobj pointer and section
6914 index as parameter. Handle relaxed input sections.
6915 (Output_section::save_states, Output_section::restore_states): New
6916 method definitions.
6917 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
6918 (Output_data::is_data_size_fixed): New method definition.
6919 (Output_data::reset_addresss_and_file_offset): Do not reset data size
6920 if it is fixed.
6921 (Output_data::address_and_file_offset_have_reset_values): New method
6922 definition.
6923 (Output_data::do_address_and_file_offset_have_reset_values): New method
6924 definition.
6925 (Output_data::set_data_size): Check that data size is not fixed.
6926 (Output_data::fix_data_size): New method definition.
6927 (Output_data::is_data_size_fixed_): New data member.
6928 (Output_section_headers::set_final_data_size): New method definition.
6929 (Output_section_headers::do_size): New method declaration.
6930 (Output_segment_headers::set_final_data_size): New method definition.
6931 (Output_segment_headers::do_size): New method declaration.
6932 (Output_file_header::set_final_data_size)::New method definition.
6933 (Output_file_header::do_size)::New method declaration.
6934 (Output_section_data::Output_section_data): Add new parameter
6935 is_data_size_fixed and use it to fix data size.
6936 (Output_data_const::Output_data_const): Adjust call to base class
6937 constructor and fix data size.
6938 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
6939 base class constructor and fix data size.
6940 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
6941 base class constructor and fix data size.
6942 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
6943 class constructor and fix data size.
6944 (Output_data_group::set_final_data_size): New method definition.
6945 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
6946 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
6947 class constructor and fix data size.
6948 (Output_relaxed_input_section): New class definition.
6949 (Output_section::Simple_input_section): New class definition.
6950 (Output_section::get_input_sections): Adjust parameter list.
6951 (Output_section::add_input_section_for_script): Same.
6952 (Output_section::save_states, Output_section::restore_states,
6953 Output_section::do_address_and_file_offset_have_reset_values,
6954 (Output_section::Input_section::Input_section): Handle
6955 RELAXED_INPUT_SECTION_CODE. Add new overload for
6956 Output_relaxed_input_section.
6957 (Output_section::Input_section::is_input_section,
6958 Output_section::Input_section::set_output_section): Handle relaxed
6959 input section.
6960 (Output_section::Input_section::is_relaxed_input_section,
6961 Output_section::Input_section::output_section_data,
6962 Output_section::Input_section::relaxed_input_section): New method
6963 definitions.
6964 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
6965 value.
6966 (Output_section::Input_section::u1_): Update comments.
6967 (Output_section::Input_section::u2_): Add new union member poris.
6968 (Output_section::Checkpoint_output_section): New classs definition.
6969 (Output_section::relax_input_section): New method declaration.
6970 (Output_section::checkpoint_): New data member.
6971 (Output_segment): Update comments.
6972 (Output_segment::Output_segment): Un-privatize copy constructor.
6973 (Output_segment::operator=): Un-privatize.
6974 * script-sections.cc (Output_section_element::Input_section_list):
6975 Change element type to Output_section::Simple_input_section.
6976 (Output_section_element_dot_assignment::set_section_addresses):
6977 Register output section data for relaxation clean up.
6978 (Output_data_exression::Output_data_expression): Adjust call to base
6979 constructor to fix data size.
6980 (Output_section_element_data::set_section_addresses): Register
6981 Output_data_expression object for relaxation clean up.
6982 (struct Input_section_info): Replace Relobj pointer and section index
6983 pair with Output_section::Simple_input_section and Convert struct to a
6984 class.
6985 (Input_section_sorter::operator()): Adjust access to
e1df38aa 6986 Input_section_info data member to use accessors.
20e6d0d6
DK
6987 (Output_section_element_input::set_section_addresses): Use layout
6988 parameter. Adjust code to use Output_section::Simple_input_section
6989 and Input_secction_info classes. Register filler for relaxation
6990 clean up.
6991 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
6992 and section index pair with Output_section::Simple_input_section
6993 class. Adjust code accordingly.
6994 (Phdrs_element::release_segment): New method definition.
6995 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
6996 segment list.
6997 (Script_sections::release_segments): New method definition.
6998 * gold/script-sections.h (Script_sections::release_segments): New
6999 method declaration.
7000 * gold/target.h (Target::may_relax, Target::relax,
7001 Target::do_may_relax, Target::do_relax): New method definitions.
7002
5e445df6
ILT
70032009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7004
7005 * arm.cc (has_signed_unsigned_overflow): New function.
7006 (Arm_relocate_functions::abs8): New function.
7007 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7008 (Target_arm::Scan::global): Likewise.
7009 (Target_arm::relocate::relocate): Likewise.
7010 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7011 Likewise.
7012
8c604651 70132009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7014
7015 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7016 * testsuite/Makefile.in: Regenerate.
7017
1e9cc1c2
NC
70182009-09-11 Nick Clifton <nickc@redhat.com>
7019
7020 * po/gold.pot: Updated by the Translation project.
7021
6a89f575
CC
70222009-09-08 Cary Coutant <ccoutant@google.com>
7023
7024 * output.cc (Output_file::open): Add execute permission to empty file.
7025 * testsuite/Makefile.am (permission_test): New test.
7026 * testsuite/Makefile.in: Regenerate.
7027
fdcac5af
ILT
70282009-09-02 Ian Lance Taylor <iant@google.com>
7029
7030 * output.cc (Output_file::resize): Call map_no_anonymous rather
7031 than map.
7032
44453f85
ILT
70332009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7034
7035 * gold.cc: Include "incremental.h".
7036 (queue_initial_tasks): Call Incremental_checker methods.
7037 * incremental.cc: Include "output.h".
7038 (Incremental_checker::can_incrementally_link_output_file): New
7039 method.
7040 * incremental.h (Incremental_checker): New class.
7041
7042 * output.cc (Output_file::open_for_modification): New method.
7043 (Output_file::map_anonymous): Changed return type to bool. Record
7044 map in base_ field.
7045 (Output_file::map_no_anonymous): New method, broken out of map.
7046 (Output_file::map): Use map_no_anonymous and map_anonymous.
7047 * output.h (class Output_file): Update declarations.
7048
293c1386
CC
70492009-08-24 Cary Coutant <ccoutant@google.com>
7050
7051 * options.h (Command_line::Pre_options): New class.
7052 (Command_line::pre_options): New member.
7053 * options.cc (gold::options::ready_to_register): New variable.
7054 (One_option::register_option): Do nothing if not registering options.
7055 Assert if same short option registered twice.
7056 (General_options::General_options): Turn off option registration when
7057 done constructing.
7058 (Command_line::Pre_options::Pre_options): New constructor.
7059
f773f3d2
CC
70602009-08-24 Cary Coutant <ccoutant@google.com>
7061
06a73cfe
CC
7062 * options.h (General_options::no_keep_memory): Remove incorrect
7063 short option.
f773f3d2 7064
a15af8e2
RW
70652009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7066
7067 * Makefile.am (am__skiplex, am__skipyacc): New.
7068 * Makefile.in: Regenerate.
7069
c462b41b
RW
70702009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7071
14ec8efd
RW
7072 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7073 (INCLUDES): ... this.
7074 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7075 (AM_CPPFLAGS): Renamed from ...
7076 (INCLUDE): ... this.
7077 * Makefile.in, testsuite/Makefile.in: Regenerate.
7078
81ecdfbb
RW
7079 * Makefile.in: Regenerate.
7080 * aclocal.m4: Likewise.
7081 * config.in: Likewise.
7082 * configure: Likewise.
7083 * testsuite/Makefile.in: Likewise.
7084
c462b41b
RW
7085 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7086 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7087 * Makefile.in: Regenerate.
7088 * testsuite/Makefile.in: Regenerate.
7089
2da73f13
CC
70902009-08-19 Cary Coutant <ccoutant@google.com>
7091
7092 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7093 symbols in shared libraries overridden by hidden or internal symbols
7094 in the main program.
7095
2db70501
CD
70962009-08-19 Chris Demetriou <cgd@google.com>
7097
7098 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7099 checking source file names in error messages.
7100
f733487b
DK
71012009-08-18 Doug Kwan <dougkwan@google.com>
7102
7103 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7104 an elcpp::Ehdr as parameter. Adjust call to set_target.
7105 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7106 an elfcpp::Ehdr as parameter.
7107 * object.cc (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. Adjust call to set_target.
7111 (make_elf_sized_object): Find target and ask target to
7112 make an ELF object.
7113 * object.h: (Object::set_target): Remove the version that looks up
7114 a target and sets it.
7115 (Sized_relobj::setup): Take a Target object instead of
7116 an elfcpp:Ehdr as parameter.
7117 * target.cc: Include dynobj.h.
7118 (Target::do_make_elf_object_implementation): New.
7119 (Target::do_make_elf_object): New.
7120 * target.h (Target::make_elf_object): New template declaration.
7121 (Target::do_make_elf_object): New method declarations.
7122 (Target::do_make_elf_object_implementation): New template declaration.
7123
cc70f101
ILT
71242009-08-14 Ian Lance Taylor <iant@google.com>
7125
7126 * gold.h (FUNCTION_NAME): Define.
7127 (gold_unreachable): Use FUNCTION_NAME.
7128
ef5e0cb1
ST
71292009-08-12 Sriraman Tallam <tmsriram@google.com>
7130
7131 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7132 symbol in the --keep-unique list is not found.
7133
48c187ce
ST
71342009-08-12 Sriraman Tallam <tmsriram@google.com>
7135
7136 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7137 been maked as --keep-unique.
7138 (Icf::unfold_section): New function.
7139 * icf.h (Icf::unfold_section): New function.
7140 * options.h (General_options::keep_unique): New option.
7141 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7142 * testsuite/Makefile.in: Regenerate.
7143 * testsuite/icf_keep_unique_test.sh: New file.
7144 * testsuite/icf_keep_unique_test.cc: New file.
7145
645afe0c
CC
71462009-08-12 Cary Coutant <ccoutant@google.com>
7147
7148 PR 10471
7149 * resolve.cc (Symbol_table::resolve): Check for references from
7150 dynamic objects to hidden and internal symbols.
7151 * testsuite/Makefile.am (hidden_test.sh): New test.
7152 * testsuite/Makefile.in: Regenerate.
7153 * testsuite/hidden_test.sh: New script.
7154 * testsuite/hidden_test_1.c: New test source.
7155 * testsuite/hidden_test_main.c: New test source.
7156
11af873f
DK
71572009-08-11 Doug Kwan <dougkwan@google.com>
7158
7159 * arm.cc: Update comments.
7160 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7161 segment to locate the .ARM.exidx section if present.
7162
b9f7d72d
DK
71632009-08-09 Doug Kwan <dougkwan@google.com>
7164
7165 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7166 patch.
7167
ddd3c53c
ST
71682009-08-07 Sriraman Tallam <tmsriram@google.com>
7169 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7170 compiler warnings.
7171
27721062
ST
71722009-08-06 Sriraman Tallam <tmsriram@google.com>
7173
7174 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7175 valid tls_segment only for non-debug-section relocations.
7176 * testsuite/Makefile.am: Add gc_tls_test.
7177 * testsuite/Makefile.in: Regenerate.
7178 * testsuite/gc_tls_test.cc: New file.
7179 * testsuite/gc_tls_test.sh: New file.
7180
ef15dade 71812009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7182
ef15dade
ST
7183 * icf.cc: New file.
7184 * icf.h: New file.
7185 * Makefile.am (CCFILES): Add icf.cc.
7186 (HFILES): Add icf.h
7187 * Makefile.in: Regenerate.
7188 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7189 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7190 section, symbol and addend information for the relocs.
7191 * gold.cc (queue_middle_tasks): Call identical code folding.
7192 * gold.h: Add defines for multimap.
7193 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7194 to the call of finalize_local_symbols.
7195 * main.cc (main): Create object of class Icf.
7196 * object.cc (Sized_relobj::do_layout): Allow this function to be
7197 called twice during icf.
7198 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7199 to sections marked as identical by icf.
7200 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7201 when available.
7202 (Sized_relobj::do_section_entsize): New function.
7203 * object.h (Object::section_entsize): New function.
7204 (Object::do_section_entsize): New pure virtual function.
7205 (Relobj::finalize_local_symbols): Add new parameter.
7206 (Relobj::do_section_entsize): New function.
7207 * options.h (General_options::icf): New option.
7208 (General_options::icf_iterations): New option.
7209 (General_options::print_icf_sections): New option.
7210 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7211 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7212 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7213 icf.
7214 * symtab.cc (Symbol_table::is_section_folded): New function.
7215 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7216 to sections marked as identical by icf.
7217 * symtab.h (Symbol_table::set_icf): New function.
7218 (Symbol_table::icf): New function.
7219 (Symbol_table::is_section_folded): New function.
7220 (Symbol_table::icf_): New data member.
7221 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7222 * testsuite/Makefile.am: Add commands to build icf_test.
7223 * testsuite/Makefile.in: Regenerate.
7224 * testsuite/icf_test.sh: New file.
7225 * testsuite/icf_test.cc: New file.
7226
c3b65ac4
CD
72272009-07-24 Chris Demetriou <cgd@google.com>
7228
7229 * layout.cc (is_compressible_debug_section): Fix incorrect
7230 comment about compressed section names.
7231
1caf2c51
ILT
72322009-07-20 Ian Lance Taylor <ian@airs.com>
7233
7234 PR 10419
7235 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7236
1ef4d87f
ILT
72372009-07-16 Ian Lance Taylor <iant@google.com>
7238
7239 PR 10400
7240 * layout.h: #include <map>.
7241 (class Kept_section): Change from struct to class. Add accessors
7242 and setters. Add section size to Comdat_group mapping. Change
7243 Comdat_group to std::map. Add is_comdat_ field. Add
7244 linkonce_size field in union.
7245 (class Layout): Update declaration of find_or_add_kept_section.
7246 Don't declare find_kept_object.
7247 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7248 parameter. Add object, shndx, is_comdat, and is_group_name
7249 parameters. Change all callers. Adjust for new Kept_section.
7250 (Layout::find_kept_object): Remove.
7251 * object.cc (Sized_relobj::include_section_group): Update use of
7252 Kept_section. Rename secnum to shndx. Only record
7253 Kept_comdat_section if sections are the same size.
7254 (Sized_relobj::include_linkonce_section): Update use of
7255 Kept_section. Only record Kept_comdat_section if sections are the
7256 same size. Set size of linkonce section.
7257 (Sized_relobj::map_to_kept_section): Update call to
7258 get_kept_comdat_section.
7259 * object.h (class Sized_relobj): Rename fields in
7260 Kept_comdat_section to drop trailing underscores; change object
7261 field to Relobj*. Change Kept_comdat_section_table to store
7262 struct rather than pointer.
7263 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7264 Add kept_object and kept_shndx parameters. Change all callers.
7265 (Sized_relobj::get_kept_comdat_section): Change return type to
7266 bool. Add kept_object and kept_shndx parameters. Change all
7267 callers.
7268 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7269 Layout::find_or_add_kept_section.
7270
37c3b7b0
ILT
72712009-07-09 Ian Lance Taylor <iant@google.com>
7272
7273 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7274 Reserve space in the hash table.
7275
98fa85cb
ILT
72762009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7277
7278 * fileread.cc (File_read::get_mtime): New method.
7279 * fileread.h (Timespec): New structure.
7280 (File_read::get_mtime): New method.
7281 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7282 Renamed from timestamp_nsec.
7283 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7284 Elf_Xword.
e1df38aa 7285 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7286 timestamp_nsec.
e1df38aa 7287 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7288 (Incremental_inputs::report_obejct): Save mtime; style fix.
7289 (Incremental_inputs::report_script): Save mtime; style fix.
7290 (Incremental_inputs::finalize_inputs): Style fix.
7291 (Incremental_inputs::finalize): Style fix.
7292 (Incremental_inputs::create_input_section_data): Store inputs
7293 mtime.
7294 * incremental.h (Incremental_inputs::report_script): Add mtime
7295 argument.
7296 (Incremental_inputs::Input_info::Input_info): Intialize only one
7297 union member.
7298 (Incremental_inputs::Input_info::archive): Move to nameless
7299 union.
7300 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7301 (Incremental_inputs::Input_info::script): Move to nameless union.
7302 (Incremental_inputs::mtime): New field.
7303 * script.cc (read_input_script): Pass file mtime to
7304 Incremental_input.
7305 * script.h (Script_info::inputs): Style fix.
7306
c9d70757
ILT
73072009-07-01 Ian Lance Taylor <ian@airs.com>
7308
7309 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7310 instead of 32.
7311
9c547ec3
ILT
73122009-06-24 Ian Lance Taylor <iant@google.com>
7313
7314 PR 10156
7315 * layout.cc (Layout::choose_output_section): If we find an
7316 existing section, update the flags.
7317 (Layout::create_notes): New function, broken out of
7318 Layout::finalize.
7319 (Layout::finalize): Don't create note sections.
7320 (Layout::create_note): Don't crash if linker script discards
7321 section.
7322 (Layout::create_gold_note): Likewise.
7323 (Layout::create_build_id): Likewise. Don't set
7324 after_input_sections on the section.
7325 (Layout::create_executable_stack_info): Remove target parameter.
7326 Change caller.
7327 * layout.h (class Layout): Declare create_notes. Update
7328 declaration of create_executable_stack_info.
7329 * gold.cc (queue_middle_tasks): Call create_notes.
7330 * output.cc (Output_section::update_flags_for_input_section): Move
7331 here from output.h. If SHF_ALLOC flag is newly set, mark address
7332 invalid.
7333 * output.h (Output_data::mark_address_invalid): New function.
7334 (class Output_section): Only declare, not define,
7335 update_flags_for_input_section. Remove set_flags.
7336
55458500
ILT
73372009-06-24 Ian Lance Taylor <iant@google.com>
7338
7339 * script-sections.cc (Output_section_definition::
7340 set_section_addresses): Rename shadowing local load_address to
7341 laddr.
7342
1307d6cd
ILT
73432009-06-24 Ian Lance Taylor <iant@google.com>
7344
7345 PR 10244
7346 * reloc.cc (relocate_sections): Skip empty relocation sections.
7347
ec3f783e
ILT
73482009-06-23 Ian Lance Taylor <iant@google.com>
7349
7350 PR 10156
7351 * layout.cc (Layout::create_note): Use choose_output_section
7352 rather than make_output_section.
7353
459c9f1c
ILT
73542009-06-23 Ian Lance Taylor <iant@google.com>
7355
7356 PR 10237
7357 * options.cc (General_options::parse_V): Set printed_version_.
7358 (General_options::General_options): Initialize printed_version_.
7359 * options.h (class General_options): Add printed_version_ field.
7360 * gold.cc (queue_initial_tasks): If there are no input files,
7361 don't give a fatal error if we printed the version information.
7362 (queue_middle_tasks): If using -r with a shared object, give a
7363 fatal error rather than an ordinary error.
7364
1518dc8f
ILT
73652009-06-23 Ian Lance Taylor <iant@google.com>
7366
7367 PR 10219
7368 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7369 (Layout::make_output_section): Set have_stabstr_section_ if we see
7370 a .stab*str section.
7371 (Layout::finalize): Call link_stabs_sections.
7372 (Layout::link_stabs_sections): New file.
7373 * layout.h (class Layout): Add have_stabstr_section_ field.
7374 Declare link_stabs_sections.
7375
3d857b98
DK
73762009-06-23 Doug Kwan <dougkwan@google.com>
7377
7378 * Makefile.am (libgold_a_LIBADD): New.
7379 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7380 * Makefile.in: Regenerate.
7381 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7382 * configure: Regenerate.
7383 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7384 * fileread.cc: Include sys/state.h
7385 * gold.h: Declare memmem and strndup if found missing.
7386 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7387
0639a6f6
ILT
73882009-06-23 Ian Lance Taylor <iant@google.com>
7389
7390 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7391 * configure: Rebuild.
7392
8d63875c
ILT
73932009-06-23 Ian Lance Taylor <iant@google.com>
7394
7395 PR 10147
7396 * object.cc (Object::section_contents): Don't try to get a view if
7397 the section has length zero.
7398 (Object::handle_gnu_warning_section): If the section is empty, use
7399 the name of the section as the warning.
7400
f7c8a183
ILT
74012009-06-23 Ian Lance Taylor <iant@google.com>
7402
7403 PR 10133
7404 * stringpool.h (class Stringpool_template): Add optimize_ field.
7405 (Stringpool_template::set_optimize): New function.
7406 * stringpool.cc (Stringpool_template::Stringpool_template):
7407 Initialize optimize_ field.
7408 (Stringpool_template::set_string_offsets): Test local optimize
7409 fild rather than parameter.
7410 * layout.cc (Layout::Layout): Call set_optimize on the section
7411 name stringpool.
7412
e6a307ba
ILT
74132009-06-22 Ian Lance Taylor <iant@google.com>
7414
7415 PR 10030
7416 * yyscript.y: Parse TARGET.
7417 * script.cc (script_set_target): New function.
7418 * script-c.h (script_set_target): Declare.
7419 * options.cc (General_options::string_to_object_format): Rename
7420 from string_to_object_format in anonymous namespace. Change
7421 callers.
7422 * options.h (class General_options): Declare
7423 string_to_object_format.
7424
3ee173de
ILT
74252009-06-22 Ian Lance Taylor <iant@google.com>
7426
7427 * script-sections.cc (Script_sections::create_segments): Don't put
7428 program headers in a PT_LOAD segment if -n or -N.
7429
74302009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7431
7432 PR 10141
7433 * options.h (class General_options): Add -z lazy and -z now. Sort
7434 -z options into alphabetical order.
7435 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7436
cd6739a1 74372009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7438
7439 * layout.cc (Layout::make_output_section): Call
7440 Target::new_output_section.
7441 (Layout::attach_allocated_section_to_segment): Put large section
7442 sections in a separate load segment with the large segment flag
7443 set.
7444 (Layout::segment_precedes): Sort large data segments after other
7445 load segments.
7446 (align_file_offset): New static function.
7447 (Layout::set_segment_offsets): Use align_file_offset.
7448 * output.h (class Output_section): Add is_small_section_ and
7449 is_large_section_ fields.
7450 (Output_section::is_small_section): New function.
7451 (Output_section::set_is_small_section): New function.
7452 (Output_section::is_large_section): New function.
7453 (Output_section::set_is_large_section): New function.
7454 (Output_section::is_large_data_section): New function.
7455 (class Output_segment): Add is_large_data_segment_ field.
7456 (Output_segment::is_large_data_segment): New function.
7457 (Output_segment::set_is_large_data_segment): New function.
7458 * output.cc (Output_section::Output_section): Initialize new
7459 fields.
7460 (Output_segment::Output_segment): Likewise.
7461 (Output_segment::add_output_section): Add assertion that large
7462 data sections always go in large data segments. Force small data
7463 sections to the end of the list of data sections. Force small BSS
7464 sections to the start of the list of BSS sections. For large BSS
7465 sections to the end of the list of BSS sections.
7466 * symtab.h (class Symbol): Declare is_common_shndx.
7467 (Symbol::is_defined): Check Symbol::is_common_shndx.
7468 (Symbol::is_common): Likewise.
7469 (class Symbol_table): Define enum Commons_section_type. Update
7470 declarations. Add small_commons_ and large_commons_ fields.
7471 * symtab.cc (Symbol::is_common_shndx): New function.
7472 (Symbol_table::Symbol_table): Initialize new fields.
7473 (Symbol_table::add_from_object): Put small and large common
7474 symbols in the right list.
7475 (Symbol_table::sized_finalized_symbol): Check
7476 Symbol::is_common_shndx.
7477 (Symbol_table::sized_write_globals): Likewise.
7478 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7479 common symbol lists. Don't call do_allocate_commons_list if the
7480 list is empty.
7481 (Symbol_table::do_allocate_commons_list): Remove is_tls
7482 parameter. Add comons_section_type parameter. Change all
7483 callers. Handle small and large common symbols.
7484 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7485 Symbol::is_common_shndx.
7486 * resolve.cc (symbol_to_bits): Likewise.
7487 * target.h (Target::small_common_shndx): New function.
7488 (Target::small_common_section_flags): New function.
7489 (Target::large_common_shndx): New function.
7490 (Target::large_common_section_flags): New function.
7491 (Target::new_output_section): New function.
7492 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7493 small_common_section_flags, and large_common_section_flags
7494 fields.
7495 (Target::do_new_output_section): New virtual function.
7496 * arm.cc (Target_arm::arm_info): Initialize new fields.
7497 * i386.cc (Target_i386::i386_info): Likewise.
7498 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7499 Likewise.
7500 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7501 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7502 (Target_x86_64::do_new_output_section): New function.
7503 * configure.ac: Define conditional MCMODEL_MEDIUM.
7504 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7505 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7506 (large_LDFLAGS): Define.
7507 * testsuite/large.c: New file.
7508 * testsuite/testfile.cc (Target_test::test_target_info):
7509 Initialize new fields.
7510 * configure, testsuite/Makefile.in: Rebuild.
7511
bb04269c
DK
75122009-06-05 Doug Kwan <dougkwan@google.com>
7513
7514 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7515 * Makefile.in: Regenerate.
bb04269c
DK
7516 * i386.cc (class Target_i386): Define new virtual method to
7517 override do_is_local_label_name in parent.
7518 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7519 local symbols if --discard-locals or -X is given.
7520 * options.h (class General_options): Declare new options
7521 '--discard-locals' and '-X' for discarding locals.
7522 * target.h (class Target): Define new methods is_local_label_name.
7523 Declare new virtual method do_is_local_label_name.
7524 * target.cc: New file.
7525 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7526 (check_SCRIPTS): Add discard_locals_test.sh.
7527 (check_DATA): Add discard_local_tests.syms.
7528 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7529 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7530 * testsuite/Makefile.in: Regenerate.
7531 * testsuite/discard_locals_test.c: New file.
7532 * testsuite/discard_locals_test.sh: Same.
7533
805bb01c
DK
75342009-06-05 Doug Kwan <dougkwan@google.com>
7535
7536 * object.cc (Sized_relobj::Sized_relobj): Initialize
7537 discarded_eh_frame_shndx_ to -1U.
7538 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7539 section.
7540 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7541 a discarded .eh_frame section.
7542 (Sized_relobj::do_finalize_local_symbols): Ditto.
7543 * object.h (class Sized_relobj): Declare new member
7544 discarded_eh_frame_shndx_.
7545 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7546 (local_labels_test.o, local_labels_test): New rules.
7547 * testsuite/Makefile.in: Regenerate.
7548
1dcd334d
DK
75492009-06-04 Doug Kwan <dougkwan@google.com>
7550
7551 * layout.cc (Layout::section_name_mapping): Add mapping for
7552 special ARM sections.
7553
96d49306
DK
75542009-06-03 Doug Kwan <dougkwan@google.com>
7555
7556 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7557 (utils::has_overflow): Same.
7558
dff16297
ILT
75592009-06-03 Ian Lance Taylor <iant@google.com>
7560
7561 * layout.cc (Layout::section_name_mapping): New array, replacing
7562 Layout::linkonce_mapping.
7563 (Layout::section_name_mapping_count): New variable, replacing
7564 Layout::linkonce_mapping_count.
7565 (Layout::linkonce_output_name): Remove.
7566 (Layout::output_section_name): Rewrite.
7567 * layout.h (class Layout): Rename Linkonce_mapping to
7568 Section_name_mapping, linkonce_mapping to section_name_mapping,
7569 linkonce_mapping_count to section_name_mapping_count. Don't
7570 declare linkonce_output_name.
7571
c121c671
DK
75722009-06-03 Doug Kwan <dougkwan@google.com>
7573
7574 * gold/arm.cc (namespace utils): New.
7575 (Target_arm::reloc_is_non_pic): Define new method.
7576 (class Arm_relocate_functions): New.
7577 (Target_arm::Relocate::relocate): Handle relocation types used by
7578 Android.
7579
07800fab
ILT
75802009-06-03 Ian Lance Taylor <iant@google.com>
7581
7582 * arm.cc (Target_arm::scan::global): Use || instead of |.
7583
c121c671
DK
75842009-06-02 Doug Kwan <dougkwan@google.com>
7585
7586 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7587 issued_non_pic_error_.
7588 (class Target_arm::Scan): Declare new method check_non_pic.
7589 Define new method symbol_needs_plt_entry.
7590 Declare new data member issued_non_pic_error_.
7591 (class Target_arm::Relocate): Declare new method
7592 should_apply_static_reloc.
7593 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7594 (Target_arm::Scan::check_non_pic): Define new method.
7595 (Target_arm::Scan::local): Handle a small subset of reloc types used
7596 by Android.
7597 (Target_arm::Scan::local): Same.
7598 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7599
b19b0c6d
ILT
76002009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7601
7602 * incremental.cc (Incremental_inputs::report_command_line): Filter
7603 out --incremental-* options.
7604
94cdfcff
DK
76052009-05-29 Doug Kwan <dougkwan@google.com>
7606
7607 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7608 template class.
7609 (class Target_arm): Update comment.
7610 (Target_arm::Target_arm): Initialize new data members GOT_,
7611 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7612 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7613 and Target_arm::rel_dyn_section.
7614 Declare new_enum Target_arm::Got_type.
7615 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7616 and DYNBSS_.
7617 Update commments for member do_dynsym_value.
7618 (Target_arm::got_size, Target_arm::plt_section,
7619 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7620 new methods inside class defintion.
7621 (Target_arm::got_section): Define new method.
7622 (Target_arm::rel_dyn_section): Same.
7623 (Output_data_plt_arm): New template class.
7624 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7625 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7626 (Output_data_plt_arm::add_entry): Same.
7627 (Output_data_plt_arm::first_plt_entry): Define new
7628 static data member for PLT instruction template.
7629 (Output_data_plt_arm::plt_entry): Same.
7630 (Output_data_plt_arm::do_write): Define new method.
7631 (Target_arm::make_plt_entry): Same.
7632 (Target_arm::do_finalize_sections): Same.
7633 (Target_arm::do_dynsym_value): Same.
7634
4a657b0d
DK
76352009-05-28 Doug Kwan <dougkwan@google.com>
7636
7637 * Makefile.am (TARGETSOURCES): Add arm.cc.
7638 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7639 * Makefile.in: Regenerate.
7640 * arm.cc: New file.
7641 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7642
e7ae8c36
DK
76432009-05-26 Doug Kwan <dougkwan@google.com>
7644
7645 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7646 (General_options::check_excluded_libs): Strip off directories in
7647 archive name before matching like GNU ld does.
7648 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7649 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7650 (exclude_libs_test_LDFLAGS): Add linker option
7651 -Wl,--exclude-libs,libexclude_libs_test_3
7652 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7653 an explicit archive without using -l.
7654 (alt/libexclude_libs_test_3.a): New make rule.
7655 * testsuite/Makefile.in: Regenerate.
7656 * testsuite/exclude_libs_test.c : Declare lib3_default().
7657 (main): Call it.
7658 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
7659 * exclude_libs_test_3.c: New file.
7660
f12e7348
NC
76612009-05-26 Nick Clifton <nickc@redhat.com>
7662
7663 * po/id.po: New Indonesian translation.
7664 * po/gold.pot: Updated template file.
7665
4daadc0d
ST
76662009-05-22 Sriraman Tallam <tmsriram@google.com>
7667
e1df38aa 7668 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
7669 gc_comdat_test files. Add -Wl,--gc-sections to build
7670 gc_comdat_test.
7671 * testsuite/Makefile.in: Regenerate.
7672 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
7673
531813ad
ST
76742009-05-21 Sriraman Tallam <tmsriram@google.com>
7675
7676 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
7677 kept comdat section was garbage collected.
7678 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
7679 * testsuite/Makefile.in: Regenerate.
7680 * testsuite/gc_comdat_test.sh: New file.
7681 * testsuite/gc_comdat_test_1.cc: New file.
7682 * testsuite/gc_comdat_test_2.cc: New file.
7683
65514900
CC
76842009-05-19 Doug Kwan <dougkwan@google.com>
7685
7686 * archive.cc (Archive::Archive): Move constructor from archive.h
7687 to here. Initialize no_export_.
7688 (Archive::get_elf_object_for_member): Set no_export flag of object.
7689 * archive.h (Archive::Archive): Move constructor body to
7690 archive.cc.
7691 (Archive::no_export): New method.
7692 (Archive::no_export_): New field.
7693 * object.h (Object::Object): Initialize no_export_ to false.
7694 (Object::no_export, Object::set_no_export): New methods.
7695 (Object::no_export_): New field.
7696 * options.cc (General_options::parse_exclude_libs): New method.
7697 (General_options::check_excluded_libs) Same.
7698 * options.h (exclude_libs): New option.
7699 (General_options::check_excluded_libs): New method declaration.
7700 (General_options::excluded_libs_): New field.
7701 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
7702 default or protected visibility if an object has no-export flag set.
7703 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
7704 (check_SCRIPTS): Add exclude_libs_test.sh.
7705 (check_DATA): Add exclude_libs_test.syms.
7706 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
7707 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
7708 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
7709 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
7710 (exclude_libs_test.syms, libexclude_libs_test_1.a,
7711 libexclude_libs_test_2.a): New rules.
7712 * testsuite/Makefile.in: Regenerate.
7713 * testsuite/exclude_libs_test.c: New file.
7714 * testsuite/exclude_libs_test.sh: Ditto.
7715 * testsuite/exclude_libs_test_1.c: Ditto.
7716 * testsuite/exclude_libs_test_2.c: Ditto.
7717
1b77ea50
ILT
77182009-05-15 Ian Lance Taylor <iant@google.com>
7719
7720 * configure.ac: Check for declarations for cases where libiberty.h
7721 checks HAVE_DECL_xxx.
7722 * configure, config.in: Rebuild.
7723
072fe7ce
ILT
77242009-05-15 Mikolaj Zalewski <mikolajz@google.com>
7725
7726 * gold.h (Incremental_argument_list): Remove (invalid) forward
7727 declaration.
7728 * incremental.cc (Incremental_inputs::report_achive): New method.
7729 (Incremental_inputs::report_object): New method.
7730 (Incremental_inputs::report_script): New method.
7731 (Incremental_inputs::finalize_inputs): New method.
7732 (Incremental_inputs::finalize): Call finalize_inputs().
7733 (Incremental_inputs::sized_create_incremental_inputs_section_data):
7734 Create inputs entries.
7735 * incremental.h (Incremental_input_type): New enum.
7736 (Incremental_inputs::Incremental_input): Initialize new fields.
7737 (Incremental_inputs::report_inputs): New method.
7738 (Incremental_inputs::report_achive): New method.
7739 (Incremental_inputs::report_object): New method.
7740 (Incremental_inputs::report_script): New method.
7741 (Incremental_inputs::finalize_inputs): New method.
7742 (Incremental_inputs::Input_info): New struct.
7743 (Incremental_inputs::Input_info_map): New typedef.
7744 (Incremental_inputs::lock_): New field.
7745 (Incremental_inputs::Inputs_): New field.
7746 (Incremental_inputs::Inputs_map): New field.
7747 * main.cc (main): Call Incremental_input::report_inputs.
7748 * options.h (Input_argument_list): Typedef moved from
7749 Input_arguments.
7750 (Input_file_group::Files): Remove, use ::Input_argument_list.
7751 (Input_file_group::Input_argument_list): Remove, use
7752 ::Input_argument_list.
7753 * plugin.cc (Plugin_manager::add_input_file): Add error in
7754 incremental build.
7755 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
7756 functions.
7757 * script.cc (read_input_script): Call
7758 Incremental_input::report_script.
7759 * script.h (Script_info): New class.
7760
b0481b0b
ILT
77612009-04-27 Ian Lance Taylor <iant@google.com>
7762
7763 * x86_64.cc (do_adjust_output_section): Set entsize to
7764 plt_entry_size.
7765
b22a5a41 77662009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
7767
7768 * output.cc (Output_file::close): After short writes, continue
7769 writing from the correct offset in the buffer being written.
7770
40fde488
CD
77712009-04-23 Chris Demetriou <cgd@google.com>
7772
7773 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
7774 * configure: Regenerate.
7775 * config.in: Regenerate.
7776 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
7777 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
7778
3ce2c28e
ILT
77792009-04-21 Mikolaj Zalewski <mikolajz@google.com>
7780
7781 * incremental.cc (Incremental_inputs_header_data): Renamed from
7782 Incremental_input_header_data.
7783 (Incremental_inputs_header_data::data_size): New field.
7784 (Incremental_inputs_header_data::put_input_file_count): Renamed
7785 from input_file_count.
7786 (Incremental_inputs_header_data::put_command_line_offset): Renamed
7787 from command_line_offset.
7788 (Incremental_inputs_header_data::put_reserved): Renamed from
7789 put_reserved.
7790 (Incremental_inputs_entry_data): Renamed from
7791 Incremental_input_entry_data.
7792 (Incremental_inputs_entry_data::data_size): New field.
7793 (Incremental_inputs::report_command_line): New method.
7794 (Incremental_inputs::finalize): New method.
7795 (Incremental_inputs::create_incremental_inputs_data): New method.
7796 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
7797 * incremental.h: New file.
7798 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
7799 (Layout::finalize): Create incremental inputs section in
7800 incremental builds.
7801 (Layout::create_incremental_info_sections): New method.
7802 * layout.h (Layout::incremental_inputs): New method.
7803 (Layout::create_incremental_info_sections): New method.
7804 (Layout::incremental_inputs_): New field.
7805 * main.cc (main): Notify Incremental_input of the command line.
7806
e55bde5e
ILT
78072009-04-01 Ian Lance Taylor <iant@google.com>
7808 Mikolaj Zalewski <mikolajz@google.com>
7809
7810 * gold.h (reserve_unordered_map): Define, three versions, one for
7811 each version of Unordered_map.
7812 * layout.cc (Layout::Layout): Remove options parameter. Add
7813 number_of_input_files parameter. Don't initialize options_.
7814 Initialize number_of_input_files_ and resized_signatures_. Move
7815 sections_are_attached_.
7816 (Layout::layout_group): Reserve space for group_signatures_.
7817 (Layout::find_or_add_kept_section): Change name parameter to be a
7818 reference. Resize signatures_ map when it gets large enough.
7819 (Layout::layout_eh_frame): Use parameters->options() instead of
7820 this->options_.
7821 (Layout::make_output_section): Likewise.
7822 (Layout::attach_allocated_section_to_segment): Likewise.
7823 (Layout::finalize, Layout::create_executable_stack): Likewise.
7824 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
7825 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
7826 * layout.h (class Layout): Update declarations. Remove options_
7827 field. Add number_of_input_files_ and resized_signatures_
7828 fields. Move sections_are_attached_ field.
7829 * main.cc (main): Pass number of input files to Layout
7830 constructor. Don't pass options.
7831
154b857c
ILT
78322009-03-30 Ian Lance Taylor <iant@google.com>
7833
7834 * ffsll.c (ffsll): Correct implementation.
7835
2f35ab9b
ILT
78362009-03-27 Ian Lance Taylor <iant@google.com>
7837
fd03461a
ILT
7838 * ffsll.c: New file.
7839 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
7840 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
7841 * ftruncate.c (ftruncate): Declare before definition.
7842 * mremap.c (mremap): Likewise.
7843 * pread.c (pread): Likewise.
7844 * configure, Makefile.in, config.in: Rebuild.
7845
2f35ab9b
ILT
7846 * mremap.c: New file.
7847 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
7848 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
7849 (mremap): Declare if HAVE_MREMAP is not defined.
7850 * configure, Makefile.in, config.in: Rebuild.
7851
33aea2fd
CC
78522009-03-27 Cary Coutant <ccoutant@google.com>
7853
7854 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
7855 position independent.
7856 * sparc.cc (Target_sparc::check_non_pic): Likewise.
7857 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
7858
6d479619
CC
78592009-03-24 Cary Coutant <ccoutant@google.com>
7860
7861 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
7862 an executable.
7863 (needs_dynamic_reloc): Likewise.
7864
afc06bb8
ILT
78652009-03-24 Ian Lance Taylor <iant@google.com>
7866
7867 * yyscript.y (file_cmd): Recognize EXTERN.
7868 (extern_name_list, extern_name_list_body): New nonterminals.
7869 * script.cc (script_add_extern): Define.
7870 * script-c.h (script_add_extern): Declare.
7871
f6060a4d
ILT
78722009-03-24 Rafael Avila de Espindola <espindola@google.com>
7873
7874 * object.cc (is_elf_object): Define.
7875 * object.h (is_elf_object): Declare.
7876 * archive.cc (Archive::get_elf_object_for_member): Call
7877 is_elf_object.
33aea2fd 7878 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 7879
26736d8e
ILT
78802009-03-24 Elliott Hughes <enh@google.com>
7881
7882 * output.cc (Output_file::map_anonymous): Define.
7883 (Output_file::map): Use map_anonymous. If the regular mmap fails,
7884 try an anonymous one. Report the size if the mmap fails.
7885 * output.h (class Output_file): Declare map_anonymous.
7886
22fd9730
ILT
78872009-03-24 Ian Lance Taylor <iant@google.com>
7888
7889 * target-select.cc (instantiate_target): Don't acquire the lock if
7890 the instantiated_target_ field has already been set.
7891
cb010894
ILT
78922009-03-23 Ian Lance Taylor <iant@google.com>
7893
7f055c20
ILT
7894 * gold-threads.h (class Initialize_lock): Define.
7895 * gold-threads.cc (class Initialize_lock_once): Define.
7896 (initialize_lock_control): New static variable.
7897 (initialize_lock_pointer): New static variable.
7898 (initialize_lock_once): New static function.
7899 (Initialize_lock::Initialize_lock): Define.
7900 (Initialize_lock::initialize): Define.
7901 * target-select.h: Include "gold-threads.h".
7902 (class Target_selector): Add lock_ and initialize_lock_ fields.
7903 Don't define instantiate_target, just declare it.
7904 * target-select.cc (Target_selector::Target_selector): Initialize
7905 new fields.
7906 (Target_selector::instantiate_target): Define.
7907 * descriptors.h: Include "gold-threads.h".
7908 (class Descriptors): Add initialize_lock_ field.
7909 * descriptors.cc (Descriptors::Descriptors): Initialize new
7910 field.
7911 (Descriptors::open): Use initialize_lock_ field
7912 * errors.h (class Errors): Add initialize_lock_ field.
7913 * errors.cc (Errors::Errors): Initialize new field.
7914 (Errors::initialize_lock): Use initialize_lock_ field.
7915 * powerpc.cc (class Target_selector_powerpc): Remove
7916 instantiated_target_ field. In do_recognize call
7917 instantiate_target rather than do_instantiate_target. In
7918 do_instantiate_target just allocate a new target.
7919 * sparc.cc (class Target_selector_sparc): Likewise.
7920
36959681
ILT
7921 * freebsd.h: New file.
7922 * i386.cc: Include "freebsd.h".
7923 (Target_i386): Derive from Target_freebsd rather than
7924 Sized_target.
7925 (Target_selector_i386): Derive from Target_selector_freebsd rather
7926 than Target_selector.
7927 * x86_64.cc: Include "freebsd.h".
7928 (Target_x86_64): Derive from Target_freebsd rather than
7929 Sized_target.
7930 (Target_selector_x86_64): Derive from Target_selector_freebsd
7931 rather than Target_selector.
7932 * target.h (class Target): Add adjust_elf_header and
7933 do_adjust_elf_header.
7934 * output.cc (Output_file_header:: do_sized_write): Call target
7935 adjust_elf_header routine.
7936 * configure.tgt: Set targ_osabi.
7937 * configure.ac: Define GOLD_DEFAULT_OSABI.
7938 * parameters.cc (Parameters::default_target): Pass
7939 GOLD_DEFAULT_OSABI to select_target.
7940 * target-select.h (class Target_selector): Make instantiate_target
7941 protected rather than private.
7942 * Makefile.am (HFILES): Add freebsd.h.
7943 * configure, Makefile.in, config.in: Rebuild.
7944
cb010894
ILT
7945 * merge.cc (do_add_input_section): Correct pend value. Change
7946 message about last entry not being null terminated from error to
7947 warning.
7948
0e879927
ILT
79492009-03-20 Mikolaj Zalewski <mikolajz@google.com>
7950
7951 * incremental.cc: New file.
7952 * Makefile.am (CCFILES): Add incremental.cc.
7953 * Makefile.in: Rebuild.
7954
41105937
PP
79552009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
7956
7957 * layout.cc (Layout::output_section_name): Preserve names
7958 of '.note.' sections.
e1df38aa 7959
60439920
ILT
79602009-03-19 Ian Lance Taylor <iant@google.com>
7961
7962 * descriptors.cc (Descriptors::open): Check that the options are
7963 valid before using them.
7964
0d371ad3
ILT
79652009-03-18 Ian Lance Taylor <iant@google.com>
7966
7967 * script-sections.h: Include <list>.
7968 (class Script_sections): Change Sections_elements from std::vector
7969 to std::list. Typedef public Elements_iterator. Add
7970 orphan_section_placement_, data_segment_align_start_, and
7971 saw_data_segment_align_ fields. Remove data_segment_align_index_
7972 field.
7973 * script-sections.cc (class Orphan_section_placement): New class.
7974 (class Sections_element): Add virtual functions is_relro and
7975 orphan_section_init. Remove virtual function place_orphan_here.
7976 (class Output_section_definition): Add is_relro and
7977 orphan_section_init. Remove place_orphan_here.
7978 (class Orphan_output_section): Likewise.
7979 (Script_sections::Script_sections): Update for field changes.
7980 (Script_sections::data_segment_align): Set saw_data_segment_align_
7981 and data_segment_align_start_, not data_segment_align_index.
7982 (Script_sections::data_segment_relro_end): Check
7983 saw_data_segment_align_. Use data_segment_align_start_ rather
7984 than data_segment_align_index_.
7985 (Script_sections::place_orphan): Rewrite to use
7986 Orphan_section_placement.
7987
9201d894
ILT
79882009-03-17 Ian Lance Taylor <iant@google.com>
7989
9c5b8369
ILT
7990 * archive.cc (Archive::add_symbols): Check for a version attached
7991 to the symbol name in the archive map.
7992 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
7993 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
7994 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
7995 (ver_test_11.a): New target.
7996 * testsuite/Makefile.in: Rebuild.
7997
9201d894
ILT
7998 * configure.ac: Check for chsize and posix_fallocate. Replace
7999 ftruncate.
8000 * ftruncate.c: New file, from gnulib.
8001 * output.cc (posix_fallocate): Define dummy version if not
8002 HAVE_POSIX_FALLOCATE.
8003 (Output_file::map): Call posix_fallocate rather than lseek and
8004 write.
8005 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8006 * configure, Makefile.in, config.in: Rebuild.
8007
ef4ab7a8 80082009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8009
ef4ab7a8
PP
8010 * layout.h (Layout::create_note): Add section_name parameter.
8011 * layout.cc (Layout::create_note): Likewise.
8012 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8013
8c500701
ILT
80142009-03-17 Ian Lance Taylor <iant@google.com>
8015
e85b18e1
ILT
8016 * descriptors.cc: Include "options.h".
8017 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8018 (Descriptors::open): Always use O_CLOEXEC when opening a new
8019 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8020 then set FD_CLOEXEC.
8021
9efe6174
ILT
8022 * sparc.cc (class Target_sparc): Add has_got_section.
8023 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8024 make sure we have a GOT section.
8025
8026 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8027 (Target_sparc::Scan::local): Likewise.
8028 (Target_sparc::Scan::global): Likewise.
8029 (Target_sparc::Relocate::relocate): Likewise.
8030 (Target_sparc::Relocate::relocate_tls): Likewise.
8031
8c500701
ILT
8032 * symtab.cc (Symbol_table::define_default_version): New function,
8033 broken out of add_from_object.
8034 (Symbol_table::add_from_object): Call define_default_version.
8035 (Symbol_table::define_special_symbol): Add resolve_oldsym
8036 parameter. Change all callers. If the version for a symbol comes
8037 from a version script, resolve it with the symbol with the same
8038 name with no version. Also add the symbol without a version if
8039 appropriate.
8040 (do_define_in_output_data): If resolving with oldsym, don't delete
8041 sym.
8042 (do_define_in_output_segment): Likewise.
8043 (do_define_as_constant): Likewise.
8044 * symtab.h (class Symbol_table): Update declarations.
8045
f1ed28fb
ILT
80462009-03-13 Ian Lance Taylor <iant@google.com>
8047
15f8229b
ILT
8048 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8049 (Read_symbols::requeue): New function.
8050 (Read_symbols::do_read_symbols): If make_elf_object fails because
8051 the target type is not configured, and the file was searched for,
8052 issue a warning and retry with the next directory.
8053 (Add_symbols::run): If the file has an incompatible format, and
8054 it was searched for, requeue the Read_symbols task. On error,
8055 release the object.
8056 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8057 dirindex parameter to constructor. Change all callers. Declare
8058 incompatible_warning and requeue.
8059 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8060 input_argument_ and input_group_ fields. Add them to
8061 constructor. Change all callers.
8062 (class Read_script): Add dirindex_ field. Add it to constructor.
8063 Change all callers.
8064 * archive.cc (Archive::setup): Remove input_objects parameter.
8065 Change all callers.
8066 (Archive::get_file_and_offset): Likewise.
8067 (Archive::read_all_symbols): Likewise.
8068 (Archive::read_symbols): Likewise.
8069 (Archive::get_elf_object_for_member): Remove input_objects
8070 parameter. Add punconfigured parameter. Change all callers.
8071 (Archive::add_symbols): Change return type to bool. Check return
8072 value of include_member.
8073 (Archive::include_all_members): Likewise.
8074 (Archive::include_member): Change return type to bool. Return
8075 false if first included object has incompatible target. Set
8076 included_member_ field.
8077 (Add_archive_symbols::run): If add_symbols returns false, requeue
8078 Read_symbols task.
8079 * archive.h (class Archive): Add included_member_ field.
8080 Initialize it in constructor. Add input_file and searched_for
8081 methods. Update declarations.
8082 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8083 input_argument_ fields. Add them to constructor. Change all
8084 callers.
8085 * script.cc: Include "target-select.h".
8086 (class Parser_closure): Add skip_on_incompatible_target_ and
8087 found_incompatible_target_ fields. Add
8088 skip_on_incompatible_target parameter to constructor. Change all
8089 callers. Add methods skip_on_incompatible_target,
8090 clear_skip_on_incompatible_target, found_incompatible_target, and
8091 set_found_incompatible_target.
8092 (read_input_script): Add dirindex parameter. Change all callers.
8093 If parser finds an incompatible target, requeue Read_symbols
8094 task.
8095 (script_set_symbol): Clear skip_on_incompatible_target in
8096 closure.
8097 (script_add_assertion, script_parse_option): Likewise.
8098 (script_start_sections, script_add_phdr): Likewise.
8099 (script_check_output_format): New function.
8100 * script.h (read_input_script): Update declaration.
8101 * script-c.h (script_check_output_format): Declare.
8102 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8103 (ignore_cmd): Remove OUTPUT_FORMAT.
8104 * fileread.cc (Input_file::Input_file): Add explicit this.
8105 (Input_file::will_search_for): New function.
8106 (Input_file::open): Add pindex parameter. Change all callers.
8107 * fileread.h (class Input_file): Add input_file_argument method.
8108 Declare will_search_for. Update declarations.
8109 * object.cc (make_elf_object): Add punconfigured parameter.
8110 Change all callers.
8111 * object.h (class Object): Make input_file public. Add
8112 searched_for method.
8113 (make_elf_object): Update declaration.
8114 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8115 restart search.
8116 * dirsearch.h (class Dirsearch): Update declaration.
8117 * options.h (class General_options): Add --warn-search-mismatch.
8118 * parameters.cc (Parameters::is_compatible_target): New function.
8119 * parameters.h (class Parameters): Declare is_compatible_target.
8120 * workqueue.cc (Workqueue::add_blocker): New function.
8121 * workqueue.h (class Workqueue): Declare add_blocker.
8122
f1ed28fb
ILT
8123 * fileread.cc (Input_file::open): Remove options parameter.
8124 Change all callers.
8125 (Input_file::open_binary): Likewise.
8126 * script.cc (read_input_script): Likewise.
8127 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8128 options parameter from constructor. Change all callers.
8129 (class Read_script): Likewise.
8130 * fileread.h (class Input_file): Update declarations.
8131 * script.h (read_input_script): Update declaration.
8132
34dd024a
NC
81332009-03-10 Nick Clifton <nickc@redhat.com>
8134
8135 * po/es.po: New Spanish translation.
8136
6d71b17c
CC
81372009-03-06 Cary Coutant <ccoutant@google.com>
8138
8139 * options.cc (parse_short_option): Keep dash_z from registering itself.
8140
031cdbed
ILT
81412009-03-03 Ian Lance Taylor <iant@google.com>
8142
8143 PR 9918
8144 * target-reloc.h (relocate_section): Pass output_section to
8145 relocate.
8146 * i386.cc (Target_i386::should_apply_static_reloc): Add
8147 output_section parameter. Change all callers.
8148 (Target_i386::Relocate::relocate): Add output_section parameter.
8149 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8150 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8151 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8152 * testsuite/two_file_shared.sh: New script.
8153 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8154 (check_DATA): Add two_file_shared.dbg.
8155 (two_file_shared.dbg): New target.
8156 * testsuite/Makefile.in: Rebuild.
8157
15d5fa16
ILT
81582009-03-01 Ian Lance Taylor <iant@google.com>
8159
8160 * configure.ac: Check for byteswap.h.
8161 * configure: Rebuild.
8162 * config.in: Rebuild.
8163
8a4c0b0d
ILT
81642009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8165
8166 * layout.cc (Layout::find_or_add_kept_section): New function.
8167 (Layout::add_comdat): Removed.
8168 * layout.h (struct Kept_section): Move out of class Layout.
8169 Remove trailing underscores from field names. Add group_sections
8170 field. Rename group_ field to is_group. Change all uses.
8171 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8172 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8173 comdat_groups_ field.
8174 (Sized_relobj::include_section_group): Use
8175 find_or_add_kept_section and Kept_section::group_sections.
8176 (Sized_relobj::include_linkonce_section): Likewise.
8177 * object.cc (class Sized_relobj): Don't define Comdat_group or
8178 Comdat_group_table. Remove find_comdat_group and
8179 add_comdat_group. Remove comdat_groups_ field.
8180 * plugin.cc (include_comdat_group): Use
8181 Layout::find_or_add_kept_section.
8182
b4ecf66b
ILT
81832009-02-28 Ian Lance Taylor <iant@google.com>
8184
14359ca0
ILT
8185 * README: --gc-sections and map files are now supported. Document
8186 some build requirements.
8187
b4ecf66b
ILT
8188 PR 6992
8189 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8190 relocatable link set the value of the section symbol to zero.
8191 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8192 relocatable link don't include the section address in the local
8193 symbol value.
8194
0602e05a
ILT
81952009-02-27 Ian Lance Taylor <iant@google.com>
8196
fd9d194f
ILT
8197 PR 6811
8198 * options.h (class Search_directory): Add is_system_directory.
8199 (class General_options): Declare is_in_system_directory.
8200 * options.cc (get_relative_sysroot): Make static.
8201 (get_default_sysroot): Make static.
8202 (General_optoins::is_in_system_directory): New function.
8203 * fileread.cc (Input_file::is_in_system_directory): New function.
8204 * fileread.h (class Input_file): Declare is_in_system_directory.
8205 * object.h (class Object): Add is_in_system_directory.
8206 (class Input_objects): Remove system_library_directory_ field.
8207 * object.cc (Input_objects::add_object): Don't set
8208 system_library_directory_.
8209 (input_objects::found_in_system_library_directory): Remove.
8210 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8211 parameter. Change all callers.
8212 (Symbol_table::sized_write_globals): Likewise.
8213 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8214 Call Object::is_in_system_directory.
8215 * symtab.h (class Symbol_table): Update declarations.
8216
61edd21f
ILT
8217 PR 5990
8218 * descriptors.h (Open_descriptor): Add is_on_stack field.
8219 * descriptors.cc (Descriptors::open): If the descriptor is on the
8220 top of the stack, remove it. Initialize is_on_stack field.
8221 (Descriptors::release): Only add pod to stack if it is not on the
8222 stack already.
8223 (Descriptors::close_some_descriptor): Clear stack_next and
8224 is_on_stack fields.
8225
e29e076a
ILT
8226 PR 7091
8227 * output.cc (Output_section::find_starting_output_address): Rename
8228 from starting_output_address; add PADDR parameter; change return
8229 type.
8230 * output.h (class Output_section): Declare
8231 find_starting_output_address instead of starting_output_address.
8232 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8233 section symbol for which we can't find a merge section.
8234
0602e05a
ILT
8235 PR 9836
8236 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8237 hidden or internal, force the symbol to be local.
8238 * resolve.cc (Symbol::override_visibility): Define.
8239 (Symbol::override_base): Use override_visibility.
8240 (Symbol_table::resolve): Likewise.
8241 (Symbol::override_base_with_special): Likewise.
8242 (Symbol_table::override_with_special): If the visibility is hidden
8243 or internal, force the symbol to be local.
8244 * symtab.h (class Symbol): Add set_visibility and
8245 override_visibility.
8246 * testsuite/ver_test_1.sh: New file.
8247 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8248 (check_DATA): Add ver_test_1.syms.
8249 (ver_test_1.syms): New target.
8250 * testsuite/Makefile.in: Rebuild.
8251
401a9a73
CC
82522009-02-25 Cary Coutant <ccoutant@google.com>
8253
8254 * layout.cc (Layout::choose_output_section): Don't rename sections
8255 when using a linker script that has a SECTIONS clause.
8256 * Makefile.in: Regenerate.
8257
8258 * testsuite/Makefile.am (script_test_5.sh): New test case.
8259 * testsuite/Makefile.in: Regenerate.
8260 * testsuite/script_test_5.cc: New file.
8261 * testsuite/script_test_5.sh: New file.
8262 * testsuite/script_test_5.t: New file.
8263
f488e4b0
CC
82642009-02-13 Rafael Avila de Espindola <espindola@google.com>
8265
8266 * archive.cc (Archive::include_member): Update calls to add_symbols.
8267 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8268 the Layout argument.
8269 * dynobj.h (do_add_symbols): Add the Layout argument.
8270 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8271 Layout argument.
8272 * object.h (Object::add_symbols): Add the Layout argument.
8273 (Object::do_add_symbols): Add the Layout argument.
8274 (Sized_relobj::do_add_symbols): Add the Layout argument.
8275 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8276 Unify the two versions.
8277 (Add_plugin_symbols): Remove.
8278 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8279 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8280 (Add_plugin_symbols): Remove.
8281 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8282 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8283 (Add_symbols::run): Make it work with Pulginobj.
8284
89dd1680
ILT
82852009-02-06 Ian Lance Taylor <iant@google.com>
8286
8287 * object.cc (Sized_relobj::do_layout): Make info message start
8288 with lower case letter.
8289
266d0a74
ILT
82902009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8291
602b464e
ILT
8292 * binary.cc: Fix file comment.
8293
266d0a74
ILT
8294 * options.h (enum Incremental_disposition): Define.
8295 (class General_options): Add new options: --incremental,
8296 --incremental_changed, --incremental_unchanged,
8297 --incremental_unknown. Add incremental_disposition_ and
8298 implicit_incremental_ fields.
8299 (General_options::incremental_disposition): New function.
8300 (class Position_dependent_options): Add incremental_disposition
8301 option.
8302 (Position_dependent_options::copy_from_options): Set incremental
8303 dispositions.
8304 * options.cc (General_options::parse_incremental_changed): New
8305 function.
8306 (General_options::parse_incremental_unchanged): New function.
8307 (General_options::parse_incremental_unknown): New function.
8308 (General_options::General_options): Initialize new fields
8309 incremental_disposition_ and implicit_incremental_.
8310 (General_options::finalize): Check for uasge of --incremental-*
8311 without --incremental.
8312
f073bbf7
CD
83132009-02-06 Chris Demetriou <cgd@google.com>
8314
8315 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8316 pointer and to report location as the file name associated with
8317 the symbol.
8318 (gold_undefined_symbol_at_location): New function to replace the
8319 old gold_undefined_symbol functionality.
8320 * target-reloc.h (relocate_section): Update to use
8321 gold_undefined_symbol_at_location.
8322 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8323 Call gold_undefined_symbol function rather than gold_error.
8324 * errors.h (Errors::undefined_symbol): Take location as a
8325 string, rather than calculating it from a relocation.
8326 * errors.cc (Errors::fatal): Print "fatal error:" before the
8327 formatted message.
8328 (Errors::error, Errors::error_at_location): Print "error: "
8329 before the formatted message.
8330 (Errors::undefined_symbol): Take location as a string, rather
8331 than calculating it from a relocation.
8332 (gold_undefined_symbol_at_location): New function akin to
8333 old gold_undefined_symbol, calculates location from relocation.
8334 (gold_undefined_symbol): Change to take only a Symbol pointer
8335 and to report location as the file name associated with the symbol.
8336 * testsuite/debug_msg.sh: Update for changed error messages.
8337 * testsuite/undef_symbol.sh: Likewise.
8338
8e94a90c
ILT
83392009-02-04 Duncan Sands <baldrick@free.fr>
8340
8341 PR 9812
8342 * reduced_debug_output.h
8343 (Output_reduced_debug_abbrev_section::failed): Use format for
8344 gold_warning.
8345 (Output_reduced_debug_info_section::faild): Likewise.
8346
88a0e15b
ILT
83472009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8348
8349 * script.cc (Lazy_demangler): New class.
8350 (Version_script_info::get_symbol_version_helper): Demangle a
8351 symbol only once.
8352
5efc7cd2
CC
83532009-01-29 Cary Coutant <ccoutant@google.com>
8354
8355 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8356 to __tls_get_addr.
8357 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8358
e0ebcf42
ILT
83592009-01-28 Ian Lance Taylor <iant@google.com>
8360
5efc7cd2 8361 * version.cc (version_string): Bump to 1.9.
75fe7426 8362
e0ebcf42
ILT
8363 * gold.h: Include <cstring> and <stdint.h>.
8364 * version.cc: Include <cstdio>.
8365 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8366 warning.
8367 * reduced_debug_output.cc (insert_into_vector): Rename from
8368 Insert_into_vector; change all callers. Use Swap_unaligned to
8369 avoid aliasing issue; remove union since it is unnecessary.
8370
8e2813be 83712009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8372
8373 * Makefile.am (CCFILES): Add gc.cc.
8374 (HFILES): Add gc.h.
8375 * Makefile.in: Regenerate.
8376 * gold.cc (Gc_runner): New class.
8377 (queue_initial_tasks): Call garbage collection related tasks
8378 when corresponding options are invoked.
8379 (queue_middle_gc_tasks): New function.
8380 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8381 processed early before laying out sections during garbage collection.
8382 * gold.h (queue_middle_gc_tasks): New function.
8383 (is_prefix_of): Move from "layout.cc".
8384 * i386.cc (Target_i386::gc_process_relocs): New function.
8385 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8386 * main.cc (main): Create object of class "Garbage_collection".
8387 * object.cc (Relobj::copy_symbols_data): New function.
8388 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8389 (Sized_relobj::do_layout): Allow this function to be called twice
8390 during garbage collection and defer layout of section during the
6d03d481
ST
8391 first call.
8392 * object.h (Relobj::get_symbols_data): New function.
8393 (Relobj::is_section_name_included): New function.
8394 (Relobj::copy_symbols_data): New function.
8395 (Relobj::set_symbols_data): New function.
8396 (Relobj::get_relocs_data): New function.
8397 (Relobj::set_relocs_data): New function.
8398 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8399 (Relobj::gc_process_relocs): New function.
8400 (Relobj::do_gc_process_relocs): New pure virtual function.
8401 (Relobj::sd_): New data member.
8402 (Sized_relobj::is_output_section_offset_invalid): New function.
8403 (Sized_relobj::do_gc_process_relocs): New function.
8404 * options.h (General_options::gc_sections): Modify to not be a no-op.
8405 (General_options::print_gc_sections): New option.
8406 * plugin.cc (Plugin_finish::run): Remove function call to
8407 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8408 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8409 * reloc.cc (Read_relocs::run): Add task to process relocs and
8410 determine unreferenced sections when doing garbage collection.
8411 (Gc_process_relocs): New class.
8412 (Sized_relobj::do_gc_process_relocs): New function.
8413 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8414 sections that are garbage collected.
8415 * reloc.h (Gc_process_relocs): New class.
8416 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8417 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8418 symbols whose corresponding sections are garbage collected.
8419 (Symbol_table::Symbol_table): Add new parameter for the garbage
8420 collection object.
8421 (Symbol_table::gc_mark_undef_symbols): New function.
8422 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8423 (Symbol_table::gc_mark_dyn_syms): New function.
8424 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8425 as garbage.
8426 (Symbol_table::add_from_object): Likewise.
8427 (Symbol_table::add_from_relobj): When building shared objects, do not
8428 treat externally visible symbols as garbage.
8429 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8430 table information for static and relocatable links.
8431 * symtab.h (Symbol_table::set_gc): New function.
8432 (Symbol_table::gc): New function.
8433 (Symbol_table::gc_mark_undef_symbols): New function.
8434 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8435 (Symbol_table::gc_mark_dyn_syms): New function.
8436 (Symbol_table::gc_): New data member.
e1df38aa 8437 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8438 function.
8439 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8440 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8441
3b293544
CF
84422009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8443
8444 * options.h (General_options::gc_sections): Define as a no-op for now.
8445 (General_options::no_keep_memory): Ditto.
8446 (General_options::Bshareable): Define.
8447 * options.cc (General_options::finalize): Honor -Bshareable.
8448
83d22aa8
AS
84492009-01-20 Andreas Schwab <schwab@suse.de>
8450
8451 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8452 read the value in the contents, since we don't use it. Use the
8453 template endianness when writing.
8454 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8455
cd536b21
AS
84562009-01-19 Andreas Schwab <schwab@suse.de>
8457
8458 * configure.tgt (powerpc64-*): Fix targ_obj.
8459
99e9a495
ILT
84602009-01-15 Ian Lance Taylor <iant@google.com>
8461
8462 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8463 local symbols when stripping all symbols.
8464
bbbfea06
CC
84652009-01-14 Cary Coutant <ccoutant@google.com>
8466
99e9a495 8467 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8468
0f7c0701
CC
84692009-01-14 Cary Coutant <ccoutant@google.com>
8470
8471 * archive.cc (Archive::get_elf_object_for_member): Remove call
8472 to File_read::claim_for_plugin.
8473 * descriptors.cc (Descriptors::open): Remove reference to
8474 is_claimed.
8475 (Descriptors::claim_for_plugin): Remove.
8476 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8477 (Descriptors::is_claimed): Remove.
8478 (claim_descriptor_for_plugin): Remove.
8479 * fileread.cc (File_read::claim_for_plugin): Remove.
8480 * fileread.h (File_read::claim_for_plugin): Remove.
8481 (File_read::descriptor): Reopen descriptor if necessary.
8482 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8483 (Plugin_manager::all_symbols_read): Add task parameter. Change
8484 all callers.
8485 (Plugin_manager::get_input_file): New function.
8486 (Plugin_manager::release_input_file): New function.
8487 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8488 corresponding data member.
8489 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8490 and pass to base constructor. Change all callers.
8491 (get_input_file, release_input_file): New functions.
8492 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8493 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8494 (Plugin_manager::all_symbols_read): Add task parameter.
8495 (Plugin_manager::get_input_file): New function.
8496 (Plugin_manager::release_input_file): New function.
8497 (Plugin_manager::task_): New data member.
8498 (Pluginobj::Pluginobj): Add filesize parameter.
8499 (Pluginobj::filename): New function.
8500 (Pluginobj::descriptor): New function.
8501 (Pluginobj::filesize): New function.
8502 (Pluginobj::filesize_): New data member.
8503 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8504 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8505 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8506
8507 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8508 with archive libraries.
8509 * testsuite/Makefile.in: Regenerate.
8510 * testsuite/plugin_test.c (struct sym_info): New type.
8511 (get_input_file, release_input_file): New static variables.
8512 (onload): Capture new transfer vector entries.
8513 (claim_file_hook): Stop reading at end of file according to filesize.
8514 Factor out parsing of readelf output into separate function.
8515 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8516 APIs and get the source file name from the symbol table. Convert
8517 source file name to corresponding object file name. Print info
8518 message when adding new input files.
8519 (parse_readelf_line): New function.
8520 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8521 * testsuite/plugin_test_2.sh: Likewise.
8522 * testsuite/plugin_test_3.sh: Likewise.
8523 * testsuite/plugin_test_4.sh: New test case.
8524
62a6d109
ILT
85252009-01-07 Ian Lance Taylor <iant@google.com>
8526
8527 * version.cc (version_string): Bump to 1.8.
8528
483620e8
CC
85292008-12-23 Cary Coutant <ccoutant@google.com>
8530
8531 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8532 * plugin.cc (Plugin_manager::finish): Rename as
8533 layout_deferred_objects. Move cleanup to separate function.
8534 (Plugin_manager::cleanup): New function.
8535 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8536 separately.
8537 * plugin.h (Plugin_manager::finish): Rename as
8538 layout_deferred_objects.
8539 (Plugin_manager::cleanup): New function.
8540 (Plugin_manager::cleanup_done): New field.
8541
d66a9eb3
CC
85422008-12-23 Cary Coutant <ccoutant@google.com>
8543
8544 * plugin.cc (is_visible_from_outside): New function.
8545 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8546 so we don't return "IR only" status for exported symbols or -r links.
8547
8548 * testsuite/Makefile.am (plugin_test_3): New test case.
8549 * testsuite/Makefile.in: Regenerate.
8550 * testsuite/plugin_test_3.sh: New file.
8551
5995b570
CC
85522008-12-22 Cary Coutant <ccoutant@google.com>
8553
8554 * object.cc (Sized_relobj::layout_section): New function.
8555 (Sized_relobj::do_layout): Defer layout of input sections until after
8556 plugin has provided replacement files.
8557 (Sized_relobj::do_layout_deferred_sections): New function.
8558 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8559 (Relobj::layout_deferred_sections): New function.
8560 (Relobj::do_layout_deferred_sections): New function.
8561 (Sized_relobj::do_layout_deferred_sections): New function.
8562 (Sized_relobj::layout_section): New function.
8563 (Sized_relobj::Deferred_layout): New structure.
8564 (Sized_relobj::deferred_layout_): New field.
8565 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8566 Change all callers. Layout deferred sections.
8567 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8568 references.
8569 (Plugin_hook::run): Move code from do_plugin_hook inline.
8570 (Plugin_hook::do_plugin_hook): Remove.
8571 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8572 (Plugin_manager::finish): Renamed, was cleanup.
8573 (Plugin_manager::should_defer_layout): New function.
8574 (Plugin_manager::add_deferred_layout_object): New function.
8575 (Plugin_manager::Deferred_layout_list): New type.
8576 (Plugin_manager::deferred_layout_objects_): New field.
8577 (Plugin_hook::do_plugin_hook): Remove.
8578
ee769c88
ILT
85792008-12-17 Ian Lance Taylor <iant@google.com>
8580
8581 * options.h (class General_options): Add --no case for
8582 --export-dynamic.
8583
abc8dcba
CC
85842008-12-16 Cary Coutant <ccoutant@google.com>
8585
8586 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8587 vector.
8588 (Plugin_manager::claim_file): Create plugin object even if
8589 plugin did not call the add_symbols callback.
8590 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8591 asking for more symbols than were added.
8592 * testsuite/Makefile.am (plugin_test_1): Add test case with
8593 no global symbols.
8594 (empty.syms): New target.
8595 * testsuite/Makefile.in: Regenerate.
8596 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8597 message. Don't call add_symbols if no globals.
8598 (all_symbols_read_hook): Don't provide replacement for empty
8599 claimed file.
8600
b0074644
ILT
86012008-12-12 Ian Lance Taylor <iant@google.com>
8602
68943102
ILT
8603 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8604 r_type == 0 for a local symbol with r_sym == 0.
8605 (scan_relocatable_relocs): Pass r_sym to
8606 local_non_section_strategy.
8607 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8608 r_sym parameter.
8609
b0074644
ILT
8610 * configure.ac: Update test for TLS descriptors: they are
8611 supported as of glibc 2.9.
8612 * configure: Rebuild.
8613
c2508178
ILT
86142008-12-11 Ian Lance Taylor <iant@google.com>
8615
8616 PR 7091
8617 * target-reloc.h (Default_scan_relocatable_relocs): For each
8618 function, map r_type == 0 to RELOC_DISCARD.
8619
2756a258
CC
86202008-12-10 Cary Coutant <ccoutant@google.com>
8621
8622 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8623 object to override a kept COMDAT group from a plugin object.
8624
bb6f53d3
ILT
86252008-12-09 Ian Lance Taylor <iant@google.com>
8626
fbc558e1
ILT
8627 PR 7088
8628 * yyscript.y (file_cmd): Handle INPUT.
8629
bb6f53d3
ILT
8630 * testsuite/initpri1.c: Change all declarations to be full
8631 prototypes by adding void, to avoid compiler warnings.
8632
4674ecfc
CC
86332008-12-05 Rafael Avila de Espindola <espindola@google.com>
8634
8635 * options.cc (General_options::parse_plugin_opt): New.
8636 (General_options::add_plugin): The argument now is just the filename.
8637 (General_options::add_plugin_option): New.
8638 * options.h (plugin_opt): New.
8639 (add_plugin): Change argument name.
8640 (add_plugin_option): New.
8641 * plugin.cc (Plugin::load): Don't parse the plugin option.
8642 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8643 (Plugin::add_option): New.
8644 (Plugin::args_): Change type.
8645 (Plugin::filename_): New.
8646 (Plugin_manager::add_plugin_option): New.
8647 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8648 * testsuite/Makefile.in: Regenerate.
8649
fd06b4aa
CC
86502008-12-05 Cary Coutant <ccoutant@google.com>
8651
8652 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8653 Handle --strip-lto-sections option.
8654 * options.h (strip_lto_sections): New option.
8655
6c52134c
CC
86562008-12-01 Cary Coutant <ccoutant@google.com>
8657
8658 * plugin.cc (ld_plugin_message): Change format parameter to const.
8659 Fix mismatch between new[] and delete.
8660
a45248e0
CC
86612008-11-14 Cary Coutant <ccoutant@google.com>
8662
8663 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
8664 instead of -1U.
8665
c82fbeee
CS
86662008-11-05 Craig Silverstein <csilvers@google.com>
8667
8668 * options.cc (General_options::parse_dynamic_list): New function.
8669 * options.h (General_options): New flags dynamic_list,
8670 dynamic_list_data, dynamic_list_cpp_new, and
8671 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
8672 (General_options::in_dynamic_list): New function.
8673 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
8674 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
8675 (Lex::can_continue_name): Likewise.
8676 (yylex): Likewise.
8677 (read_script_file): New parameter script_options.
8678 (read_dynamic_list): New function.
8679 (Script_options::define_dynamic_list): New function.
8680 (dynamic_list_keyword_parsecodes): New variable.
8681 (dynamic_list_keywords): New variable.
8682 * script.h (Script_options::define_dynamic_list): New function
8683 prototype.
8684 (read_dynamic_list): New function prototype.
8685 * symtab.cc (strprefix): New macro.
8686 (Symbol::should_add_dynsym_entry): Support dynamic_list,
8687 dynamic_list_data, dynamic_list_cpp_new, and
8688 dynamic_list_cpp_typeinfo.
8689 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
8690 (dynamic_list_expr): New rule.
8691 (dynamic_list_nodes): Likewise.
8692 (dynamic_list_node): Likewise.
8693 * testsuite/Makefile.am (dynamic_list): New test.
8694 * testsuite/Makefile.in: Regenerated.
8695 * testsuite/dynamic_list.t: New file.
8696 * testsuite/dynamic_list.sh: New file.
8697
e0bb29a5
CS
86982008-11-05 Craig Silverstein <csilvers@google.com>
8699
8700 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
8701 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
8702 (t11_last): Likewise.
8703 * testsuite/ver_test_6.c (main): Likewise.
8704
4e1e25e0
CC
87052008-10-07 Cary Coutant <ccoutant@google.com>
8706
8707 * options.c (General_options::finalize): Add check for -static and
8708 -shared.
8709 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
8710 is not empty.
8711
92f03fcb
CC
87122008-10-02 Cary Coutant <ccoutant@google.com>
8713
8714 * plugin.cc (make_sized_plugin_object): Fix conditional
8715 compilation to work when not all targets are enabled.
8716
fbd8a257
CC
87172008-09-29 Cary Coutant <ccoutant@google.com>
8718
8719 * archive.cc (Archive::get_file_and_offset): Use filename instead
8720 of name to get library path.
8721 (Archive::include_member): Unlock external member of a thin archive.
8722
8723 * testsuite/Makefile.am (TEST_AR): New variable.
8724 (thin_archive_test_1): New test.
8725 (thin_archive_test_2): New test.
81636b3f
CC
8726 * testsuite/Makefile.in: Regenerate.
8727 * testsuite/thin_archive_main.cc: New file.
8728 * testsuite/thin_archive_test_1.cc: New file.
8729 * testsuite/thin_archive_test_2.cc: New file.
8730 * testsuite/thin_archive_test_3.cc: New file.
8731 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 8732
eff45813
CC
87332008-09-29 Cary Coutant <ccoutant@google.com>
8734
8735 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
8736 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
8737 instead of -1U.
8738 (Sized_relobj::do_finalize_local_symbols): Likewise.
8739 (Sized_relobj::map_to_kept_section): Likewise.
8740 * object.h (Sized_relobj::invalid_address): New constant.
8741 (Sized_relobj::do_output_section_offset): Check for invalid_address
8742 and return -1ULL.
8743 * output.cc (Output_reloc::local_section_offset): Use constant
8744 invalid_address instead of -1U.
8745 (Output_reloc::get_address): Likewise.
8746 (Output_section::output_address): Change -1U to -1ULL.
8747 * output.h (Output_reloc::invalid_address): New constant.
8748 * reloc.cc (Sized_relobj::write_sections): Use constant
8749 invalid_address instead of -1U.
8750 (Sized_relobj::relocate_sections): Likewise.
8751 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
8752 values for merge sections.
8753 * target-reloc.h (relocate_for_relocatable): Use constant
8754 invalid_address instead of -1U.
8755
89fc3421
CC
87562008-09-19 Cary Coutant <ccoutant@google.com>
8757
8758 Add plugin functionality for link-time optimization (LTO).
8759 * configure.ac (plugins): Add --enable-plugins option.
8760 * configure: Regenerate.
8761 * config.in: Regenerate.
8762 * Makefile.am (LIBDL): New variable.
8763 (CCFILES): Add plugin.cc.
8764 (HFILES): Add plugin.h.
8765 (ldadd_var): Add LIBDL.
8766 * Makefile.in: Regenerate.
8767
8768 * archive.cc: Include "plugin.h".
8769 (Archive::setup): Don't preread archive symbols when using a plugin.
8770 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
8771 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
8772 files.
8773 (Archive::include_member): Add symbols from plugin objects.
8774 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
8775 * descriptors.cc (Descriptors::open): Check for file descriptors
8776 abandoned by plugins.
8777 (Descriptors::claim_for_plugin): New function.
8778 * descriptors.h (Descriptors::claim_for_plugin): New function.
8779 (Open_descriptor::is_claimed): New field.
8780 (claim_descriptor_for_plugin): New function.
8781 * fileread.cc (File_read::claim_for_plugin): New function.
8782 * fileread.h (File_read::claim_for_plugin): New function.
8783 (File_read::descriptor): New function.
8784 * gold.cc: Include "plugin.h".
8785 (queue_initial_tasks): Add task to call plugin hooks for generating
8786 new object files.
8787 * main.cc: Include "plugin.h".
8788 (main): Load plugin libraries.
8789 * object.h (Pluginobj): Declare.
8790 (Object::pluginobj): New function.
8791 (Object::do_pluginobj): New function.
8792 (Object::set_target): New function.
8793 * options.cc: Include "plugin.h".
8794 (General_options::parse_plugin): New function.
8795 (General_options::General_options): Initialize plugins_ field.
8796 (General_options::add_plugin): New function.
8797 * options.h (Plugin_manager): Declare.
8798 (General_options): Add --plugin option.
8799 (General_options::has_plugins): New function.
8800 (General_options::plugins): New function.
8801 (General_options::add_plugin): New function.
8802 (General_options::plugins_): New field.
8803 * plugin.cc: New file.
8804 * plugin.h: New file.
8805 * readsyms.cc: Include "plugin.h".
8806 (Read_symbols::do_read_symbols): Check for archive before checking
8807 for ELF file. Call plugin hooks to claim files.
8808 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
8809 from a real object file; force override when processing replacement
8810 files.
8811 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
8812 (Symbol::init_base_object): Likewise.
8813 (Symbol::init_base_output_data): Likewise.
8814 (Symbol::init_base_output_segment): Likewise.
8815 (Symbol::init_base_constant): Likewise.
8816 (Symbol::init_base_undefined): Likewise.
8817 (Symbol::output_section): Assert that object is not a plugin.
8818 (Symbol_table::add_from_pluginobj): New function.
8819 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
8820 undefined.
8821 (Symbol_table::sized_write_globals): Likewise.
8822 (Symbol_table::add_from_pluginobj): Instantiate template.
8823 * symtab.h (Sized_pluginobj): Declare.
8824 (Symbol::in_real_elf): New function.
8825 (Symbol::set_in_real_elf): New function.
8826 (Symbol::in_real_elf_): New field.
8827 (Symbol_table::add_from_pluginobj): New function.
8828
8829 * testsuite/Makefile.am (AM_CFLAGS): New variable.
8830 (LIBDL): New variable.
8831 (LDADD): Add LIBDL.
8832 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
8833 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
8834 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
8835 (MOSTLYCLEANFILES): Likewise.
8836 * testsuite/Makefile.in: Regenerate.
8837 * testsuite/plugin_test.c: New file.
8838 * testsuite/plugin_test_1.sh: New file.
8839 * testsuite/plugin_test_2.sh: New file.
8840
de31bda5
ILT
88412008-09-16 Ian Lance Taylor <iant@google.com>
8842
9c2d0ef9
ILT
8843 * target-reloc.h (relocate_section): Check whether a symbol is
8844 defined by the ABI before reporting an undefined symbol error.
8845 * target.h (Target::is_defined_by_abi): Make parameter const.
8846 (Target::do_is_defined_by_abi): Likewise.
8847 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
8848 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
8849 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
8850 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
8851 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
8852 * testsuite/Makefile.in: Rebuild.
8853
de31bda5
ILT
8854 * fileread.cc (make_view): Add casts to avoid warning.
8855
9fa33bee
AO
88562008-09-16 Alexandre Oliva <aoliva@redhat.com>
8857
8858 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
8859 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8860
183fd0e3
AO
88612008-09-16 Alexandre Oliva <aoliva@redhat.com>
8862
8863 * options.h (General_options::output_is_executable): New.
8864 (General_options::output_is_pie): New.
8865 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
8866 for shared libraries.
8867 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8868
7be8330a
CD
88692008-09-11 Chris Demetriou <cgd@google.com>
8870
8871 * options.h (origin): New -z option.
8872 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
8873 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
8874 in DT_FLAGS_1.
8875
a9caad02
CC
88762008-09-05 Cary Coutant <ccoutant@google.com>
8877
8878 * fileread.cc (File_read::make_view): Add check for attempt to map
8879 beyond end of file.
8880
ae6dce4d
CC
88812008-09-05 Cary Coutant <ccoutant@google.com>
8882
8883 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
8884 explicit instantiations.
8885
d7ab2a47
KVH
88862008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
8887
8888 PR gold/6858
8889 * options.cc (General_options::finalize): Allow undefined symbols
8890 in shlibs if linking -shared.
8891
8892 PR gold/6859
8893 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
8894 symbols as not needing a dynsym entry.
8895
1e52a9c1
CS
88962008-08-20 Craig Silverstein <csilvers@google.com>
8897
8898 * fileread.cc (File_read::open): Do not lock the file unless it
8899 was successfully opened.
8900
d85c80a3
CC
89012008-08-14 Cary Coutant <ccoutant@google.com>
8902
8903 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
8904 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
8905 * testsuite/tls_test.cc (struct int128): 128-bit struct
8906 for testing TLS relocs with non-zero addend.
8907 (v12): New TLS variable.
8908 (t12): New test.
8909 (t_last): Add check for v12.
8910 * testsuite/tls_test.h (t12): New function.
8911 * testsuite/tls_test_main.cc (thread_routine): Call new test.
8912
2d924fd9
ILT
89132008-08-13 Ian Lance Taylor <iant@google.com>
8914
8915 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
8916 set tls_segment_ or relro_segment_.
8917 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
8918 when appropriate.
8919 * output.h (Output_section::clear_is_relro): New function.
8920 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
8921 sections specially even when output_data_ is empty.
8922 (Output_segment::maximum_alignment): When first section is relro,
8923 only force alignment for PT_LOAD segments.
8924 * script.cc (script_data_segment_align): New function.
8925 (script_data_segment_relro_end): New function.
8926 * script-c.h (script_data_segment_align): Declare.
8927 (script_data_segment_relro_end): Declare.
8928 * script-sections.h (class Script_sections): Declare
8929 data_segment_align and data_segment_relro_end. Add fields
8930 segment_align_index_ and saw_relro_end_.
8931 * script-sections.cc (class Sections_element): Add set_is_relro
8932 virtual function. Add new bool* parameter to place_orphan_here.
8933 Add get_output_section virtual function.
8934 (class Output_section_definition): Add set_is_relro. Add new
8935 bool* parameter to place_orphan_here. Add get_output_section.
8936 Add is_relro_ field.
8937 (Output_section_definition::Output_section_definition): Initialize
8938 evaluated_address_, evaluated_load_address, evaluated_addralign_,
8939 and is_relro_ fields.
8940 (Output_section_definition::place_orphan_here): Add is_relro
8941 parameter.
8942 (Output_section_definition::set_section_addresses): Set relro for
8943 output section.
8944 (Output_section_definition::alternate_constraint): Likewise.
8945 (class Orphan_output_section): Add new bool* parameter to
8946 place_orphan_here. Add get_output_section.
8947 (Orphan_output_section::place_orphan_here): Add is_relro
8948 parameter.
8949 (Script_sections::Script_sections): Initialize
8950 data_segment_align_index_ and saw_relro_end_.
8951 (Script_sections::data_segment_align): New function.
8952 (Script_sections::data_segment_relro_end): New function.
8953 (Script_sections::place_orphan): Set or clear is_relro.
8954 (Script_sections::set_section_addresses): Force alignment of first
8955 TLS section.
8956 * yyscript.y (exp): Call script_data_segment_align and
8957 script_data_segment_relro_end.
8958 * testsuite/relro_script_test.t: New file.
8959 * testsuite/relro_test.cc (using_script): Declare.
8960 (t1, t2): Test using_script.
8961 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
8962 (relro_script_test_SOURCES): Define.
8963 (relro_script_test_DEPENDENCIES): Define.
8964 (relro_script_test_LDFLAGS): Define.
8965 (relro_script_test_LDADD): Define.
8966 (relro_script_test.so): New target.
8967 * testsuite/Makefile.in: Rebuild.
8968
f827c9a9
CC
89692008-08-06 Cary Coutant <ccoutant@google.com>
8970
8971 * archive.cc (Archive::total_archives, Archive::total_members)
8972 (Archive::total_members_loaded): New variables.
8973 (Archive::setup): Add parameter. Add option to preread
8974 archive symbols.
8975 (Archive::read_armap): Add counter.
8976 (Archive::get_file_and_offset): New function.
8977 (Archive::get_elf_object_for_member): New function.
8978 (Archive::read_all_symbols): New function.
8979 (Archive::read_symbols): New function.
8980 (Archive::add_symbols): Add counters.
8981 (Archive::include_all_members): Use armap to find members if it's
8982 already built.
8983 (Archive::include_member): Skip reading symbols if already read.
8984 Factored code into Archive::get_file_and_offset and
8985 Archive::get_elf_object_for_member. Changed call to
8986 Mapfile::report_include_archive_member.
8987 (Archive::print_stats): New function.
8988 * archive.h: Declare Object and Read_symbols_data classes.
8989 (Archive::Archive): Add initializers for new members.
8990 (Archive::setup): Add parameter.
8991 (Archive::print_stats): New function.
8992 (Archive::total_archives, Archive::total_members)
8993 (Archive::total_members_loaded): New variables.
8994 (Archive::get_file_and_offset): New function.
8995 (Archive::get_elf_object_for_member): New function.
8996 (Archive::read_all_symbols): New function.
8997 (Archive::read_symbols): New function.
8998 (Archive::Archive_member): New class.
8999 (Archive::members_): New member.
9000 (Archive::num_members_): New member.
9001 * main.cc: Include archive.h.
9002 (main): Call Archive::print_stats.
9003 * mapfile.cc (Mapfile::report_include_archive_member): Delete
9004 archive parameter; member_name is now the fully-decorated name.
9005 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9006 * options.h: (General_options): Add --preread-archive-symbols option.
9007 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9008 Archive::setup.
9009
de4c45bd
ILT
90102008-08-04 Ian Lance Taylor <iant@google.com>
9011
9012 * symtab.h (Symbol::use_plt_offset): New function.
9013 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9014 * powerpc.cc (Relocate::relocate): Likewise.
9015 * sparc.cc (Relocate::relocate): Likewise.
9016 * x86_64.cc (Relocate::relocate): Likewise.
9017 * testsuite/weak_plt.sh: New test.
9018 * testsuite/weak_plt_main.cc: New test.
9019 * testsuite/weak_plt_shared.cc: New test.
9020 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9021 (check_PROGRAMS): Add weak_plt.
9022 (check_DATA): Add weak_plt_shared.so.
9023 (weak_plt_main_pic.o, weak_plt): New targets.
9024 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9025 * testsuite/Makefile.in: Rebuild.
9026
9027 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9028 gcctestdir/ld.
9029 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9030 * testsuite/Makefile.in: Rebuild.
9031
323ee3f4
AM
90322008-08-04 Alan Modra <amodra@bigpond.net.au>
9033
9034 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9035 * Makefile.in: Regenerate.
9036 * po/POTFILES.in: Regenerate.
9037
7c07ecec
ILT
90382008-07-29 Ian Lance Taylor <iant@google.com>
9039
9040 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9041 symbols before other symbols.
9042 * testsuite/script_test_2.cc (test_addr): Declare.
9043 (test_addr_alias): Declare.
9044 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9045 values.
7c07ecec
ILT
9046 * testsuite/script_test_2.t: Define test_addr_alias and
9047 test_addr.
9048
5778530e
ILT
90492008-07-24 Ian Lance Taylor <iant@google.com>
9050
2a00e4fb
ILT
9051 PR 5990
9052 * descriptors.cc: New file.
9053 * descriptors.h: New file.
9054 * gold-threads.h (class Hold_optional_lock): New class.
9055 * fileread.cc: Include "descriptors.h".
9056 (File_read::~File_read): Release descriptor rather than closing
9057 it.
9058 (File_read::open) [file]: Call open_descriptor rather than open.
9059 Set is_descriptor_opened_.
9060 (File_read::open) [memory]: Assert that descriptor is not open.
9061 (File_read::reopen_descriptor): New function.
9062 (File_read::release): Release descriptor.
9063 (File_read::do_read): Make non-const. Reopen descriptor.
9064 (File_read::read): Make non-const.
9065 (File_read::make_view): Reopen descriptor.
9066 (File_read::do_readv): Likewise.
9067 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9068 Update declarations.
9069 * layout.cc: Include "descriptors.h".
9070 (Layout::create_build_id): Use open_descriptor rather than open.
9071 * output.cc: Include "descriptors.h".
9072 (Output_file::open): Use open_descriptor rather than open.
9073 * archive.cc (Archive::const_iterator): Change Archive to be
9074 non-const.
9075 (Archive::begin, Archive::end): Make non-const.
9076 (Archive::count_members): Likewise.
9077 * archive.h (class Archive): Update declarations.
9078 * object.h (Object::read): Make non-const.
9079 * Makefile.am (CCFILES): Add descriptors.cc.
9080 (HFILES): Add descriptors.h.
9081 * Makefile.in: Rebuild.
9082
801647d1
ILT
9083 PR 6716
9084 * gold.h: Always include <clocale>. Add Solaris workarounds
9085 following code in binutils/sysdep.h.
9086
5edd166e
ILT
9087 PR 6048
9088 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9089 this->eh_frame_hdr_ is NULL before using it.
9090
c89ad728
ILT
9091 * dynobj.cc (Versions::Versions): Update comment.
9092
aa86f06b
ILT
9093 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9094 the base version name.
9095
5778530e
ILT
9096 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9097 array size plus one.
9098 (Stringpool_template::set_string_offsets): Subtract one from key
9099 before using it as an array index.
9100 (Stringpool_template::get_offset_with_length): Likewise.
9101 (Stringpool_template::write_to_buffer): Likewise.
9102 * stringpool.h (Stringpool_template::get_offset_from_key):
9103 Likewise.
9104
057ead22
ILT
91052008-07-23 Ian Lance Taylor <iant@google.com>
9106
7f649c59
ILT
9107 PR 6658
9108 * object.h (Merged_symbol_value::value): Do our best to handle a
9109 negative addend.
9110
057ead22
ILT
9111 PR 6647
9112 * script.cc (Version_script_info::get_versions): Don't add empty
9113 version tag to return value.
9114 (Version_script_info::get_symbol_version_helper): Change return
9115 type to bool. Add pversion parameter. Change all callers.
9116 (script_register_vers_node): Don't require a non-NULL tag.
9117 * script.h (class Version_script_info): Update declarations.
9118 (Version_script_info::get_symbol_version): Change return type to
9119 bool. Add version parameter. Change all callers.
9120 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9121 handling. Handle an empty version from a version script.
9122 (Symbol_table::define_special_symbol): Likewise.
9123 * testsuite/ver_test_10.script: New file.
9124 * testsuite/ver_test_10.sh: New file.
9125 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9126 (check_DATA): Add ver_test_10.syms.
9127 (ver_test_10.syms, ver_test_10.so): New target.
9128 * testsuite/Makefile.in: Rebuild.
9129
58e54ac2
CD
91302008-07-23 Simon Baldwin <simonb@google.com>
9131
9132 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9133 to zero for undefined symbols from dynamic libraries.
9134
95d14cd3
ILT
91352008-07-23 Ian Lance Taylor <iant@google.com>
9136
9137 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9138 Change all callers.
9139 * symtab.h (class Symbol_table): Update declaration.
9140 * testsuite/ver_test_9.cc: New file.
9141 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9142 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9143 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9144 (ver_test_9.so, ver_test_9.o): New targets.
9145 * testsuite/Makefile.in: Rebuild.
9146
92de84a6
ILT
91472008-07-22 Ian Lance Taylor <iant@google.com>
9148
34810851
ILT
9149 * options.h (class General_options): Define --check-sections.
9150 * layout.cc (Layout::set_segment_offsets): Handle
9151 --check-sections.
9152
af6156ef
ILT
9153 * options.h (class General_options): Define -n/--nmagic and
9154 -N/--omagic.
9155 * options.cc (General_options::finalize): For -n/--nmagic or
9156 -N/--omagic, set -static.
9157 * layout.cc (Layout::attach_allocated_section_to_segment): If
9158 -N/--omagic, don't put read-only and read-write sections in
9159 different segments.
9160 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9161 finding a read-only segment.
9162 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9163 don't set the minimum segment alignment to the common page size,
9164 and don't set the file offset to the address modulo the page size.
9165 * script-sections.cc (Script_sections::create_segments): If
9166 -n/--omagic, don't put read-only and read-write sections in
9167 different segments.
9168
92de84a6
ILT
9169 * cref.cc: New file.
9170 * cref.h: New file.
9171 * options.h (class General_options): Add --print-symbol-counts.
9172 * main.cc (main): Issue defined symbol report if requested.
9173 * archive.cc (Archive::interpret_header): Make into a const member
9174 function.
9175 (Archive::add_symbols): Call Input_objects::archive_start and
9176 archive_stop.
9177 (Archive::const_iterator): Define new class.
9178 (Archive::begin, Archive::end): New functions.
9179 (Archive::include_all_members): Rewrite to use iterator.
9180 (Archive::count_members): New function.
9181 * archive.h (class Archive): Update declarations.
9182 (Archive::filename): New function.
9183 * object.cc: Include "cref.h".
9184 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9185 (Sized_relobj::do_get_global_symbol_counts): New function.
9186 (Input_objects::add_object): Add object to cross-referencer.
9187 (Input_objects::archive_start): New function.
9188 (Input_objects::archive_stop): New function.
9189 (Input_objects::print_symbol_counts): New function.
9190 * object.h: Declare Cref and Archive.
9191 (Object::get_global_symbol_counts): New function.
9192 (Object::do_get_global_symbol_counts): New pure virtual function.
9193 (class Sized_relobj): Add defined_count_ field. Update
9194 declarations.
9195 (class Input_objects): Add cref_ field. Update constructor.
9196 Update declarations.
9197 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9198 defined_count_.
9199 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9200 symbol counts.
9201 (Sized_dynobj::do_get_global_symbol_counts): New function.
9202 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9203 defined_count_. Update declarations. Define Symbols typedef.
9204 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9205 parameter. Change all callers.
9206 (Symbol_table::add_from_dynobj): Add sympointers and defined
9207 parameters. Change all callers.
9208 * symtab.h (class Symbol_table): Update declarations.
9209 * Makefile.am (CCFILES): Add cref.cc.
9210 (HFILES): Add cref.h.
9211 * Makefile.in: Rebuild.
9212
3f7c5e1d
CD
92132008-07-22 Simon Baldwin <simonb@google.com>
9214
9215 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9216 to zero when writing undefined symbols.
9217
e0b64032
ILT
92182008-07-22 Ian Lance Taylor <iant@google.com>
9219
9220 * output.cc (Output_section::add_input_section): Don't try to
9221 merge empty merge sections.
9222
096b02cf
CS
92232008-07-21 Craig Silverstein <csilvers@google.com>
9224
9225 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9226 Include symbol version in error message.
cd536b21 9227
1d1f116d
CD
92282008-07-20 Chris Demetriou <cgd@google.com>
9229
cd536b21 9230 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9231 (RANDOM_SEED_CFLAGS): New substituted variable.
9232 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9233 * configure: Rebuild.
9234 * Makefile.in: Likewise.
9235 * testsuite/Makefile.in: Likewise.
9236
a18f591e
ILT
92372008-07-18 Ian Lance Taylor <iant@google.com>
9238
9239 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9240 where we see NAME/NULL and NAME/VERSION as separate symbols.
9241 * testsuite/ver_test_main.cc (main): Call t4.
9242 (t4, t4_2a): Define.
9243 * testsuite/ver_test_2.cc (t4_2): Define.
9244 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9245 * testsuite/ver_test_4.cc (t4_2a): Define.
9246 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9247 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9248
c6e3f6ed
ILT
92492008-07-17 Ian Lance Taylor <iant@google.com>
9250
9251 * dynobj.cc (Versions::add_def): If we give an error about a
9252 missing version, go ahead and create the version anyhow.
9253
ef9beddf
ILT
92542008-07-10 Ian Lance Taylor <iant@google.com>
9255
9256 Handle output sections with more than 0x7fffffff bytes.
9257 * object.h (class Relobj): Change map_to_output_ to
9258 output_sections_, and just keep a section pointer. Change all
9259 uses. Move comdat group support to Sized_relobj.
9260 (Relobj::is_section_specially_mapped): Remove.
9261 (Relobj::output_section): Remove poff parameter. Change all
9262 callers.
9263 (Relobj::output_section_offset): New function.
9264 (Relobj::set_section_offset): Rewrite.
9265 (Relobj::map_to_output): Remove.
9266 (Relobj::output_sections): New function.
9267 (Relobj::do_output_section_offset): New pure virtual function.
9268 (Relobj::do_set_section_offset): Likewise.
9269 (class Sized_relobj): Add section_offsets_ field. Add comdat
9270 group support from Relobj. Update declarations.
9271 (Sized_relobj::get_output_section_offset): New function.
9272 (Sized_relobj::do_output_section_offset): New function.
9273 (Sized_relobj::do_set_section_offset): New function.
9274 * object.cc (Relobj::output_section_address): Remove.
9275 (Sized_relobj::Sized_relobj): Initialize new fields.
9276 (Sized_relobj::include_section_group): Cast find_kept_object to
9277 Sized_relobj.
9278 (Sized_relobj::include_linkonce_section): Likewise.
9279 (Sized_relobj::do_layout): Use separate arrays for output section
9280 and output offset.
9281 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9282 output_sections.
9283 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9284 output_sections and section_offsets.
9285 (Sized_relobj::write_local_symbols): Likewise.
9286 (map_to_kept_section): Compute output address directly.
9287 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9288 output_sections and section_offsets.
9289 (Sized_relobj::write_sections): Likewise.
9290 (Sized_relobj::relocate_sections): Likewise.
9291 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9292 * output.h (class Output_reloc): Update declarations. Change
9293 u2_.relobj to Sized_relobj*.
9294 (class Output_data_reloc): Change add functions to use
9295 Sized_relobj*.
9296 * output.cc (Output_reloc::Output_reloc): Change relobj to
9297 Sized_relobj*.
9298 (Output_reloc::local_section_offset): Change return type to
9299 Elf_Addr. Use get_output_section_offset.
9300 (Output_reloc::get_address): Likewise.
9301 (Output_section::is_input_address_mapped): Don't call
9302 is_section_specially_mapped.
9303 (Output_section::output_offset): Likewise.
9304 (Output_section::output_address): Likewise.
9305 (Output_section::starting_output_address): Likewise.
9306 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9307 parameter to Sized_relobj*.
9308 (Copy_relocs::need_copy_reloc): Likewise.
9309 (Copy_relocs::save): Likewise.
9310 * copy-relocs.h (class Copy_relocs): Update declarations.
9311 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9312 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9313 * target-reloc.h (relocate_for_relocatable): Change
9314 offset_in_output_section type to Elf_Addr. Change code that uses
9315 it as well.
9316 * layout.cc (Layout::layout): Always set *off.
9317 * mapfile.cc (Mapfile::print_input_section): Use
9318 output_section_offset.
9319 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9320 Sized_relobj*.
9321 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9322 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9323 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9324
5cb66f97
ILT
93252008-07-03 Ian Lance Taylor <iant@google.com>
9326
9327 * layout.cc (Layout::include_section): Do not discard unrecognized
9328 SHT_STRTAB sections.
9329
afe47622
CS
93302008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9331
9332 * script.cc (Lex::can_continue_name): Make '?' allowable in
9333 version-script names.
9334 * testsuite/version_script.map: Change glob pattern to use '?'
9335
5adf9721
ILT
93362008-06-30 Manish Singh <yosh@gimp.org>
9337
9338 PR 6585
9339 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9340 Correct typo.
9341
e6fde208
ILT
93422008-06-30 Ian Lance Taylor <iant@google.com>
9343
9344 PR 6660
9345 PR 6682
9346 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9347 versions]: Don't try to read the value in the contents, since we
9348 don't use it. Use the template endianness when writing.
9349
3f2e6a2d
CC
93502008-06-25 Cary Coutant <ccoutant@google.com>
9351
9352 * fileread.cc (File_read::make_view): Assert on zero-length view.
9353 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9354 symbol table when there are no symbols to read.
9355
c43d3a48
CS
93562008-06-23 Craig Silverstein <csilvers@google.com>
9357
9358 * version.cc (version_string): Bump to 1.7
9359
5f494ea0
CS
93602008-06-18 Craig Silverstein <csilvers@google.com>
9361
9362 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9363 constant 0xFFFF to type Valtype.
9364 (Powerpc_relocate_functions::rel16_ha): Likewise.
9365
c42e122e
ILT
93662008-06-17 Ian Lance Taylor <iant@google.com>
9367
f34787f8
ILT
9368 * output.h (Output_section::Input_section): Initialize p2align_ to
9369 zero for Output_section_data constructors.
9370 (Output_section::Input_section::addralign): If not an input
9371 section, return the alignment of the Output_section_data.
9372 * testsuite/copy_test.cc: New file.
9373 * testsuite/copy_test_1.cc: New file.
9374 * testsuite/copy_test_2.cc: New file.
9375 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9376 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9377 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9378 (copy_test_1_pic.o, copy_test_1.so): New targets.
9379 (copy_test_2_pic.o, copy_test_2.so): New targets.
9380 * testsuite/Makefile.in: Rebuild.
9381
c42e122e
ILT
9382 * script-sections.cc (Script_sections::place_orphan): Initialize
9383 local variable exact.
9384
ce3ac18a
DE
93852008-06-13 David Edelsohn <edelsohn@gnu.org>
9386
9387 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9388
42cacb20
DE
93892008-06-12 David Edelsohn <edelsohn@gnu.org>
9390 David S. Miller <davem@davemloft.net>
9391
9392 * powerpc.cc: New file.
9393 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9394 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9395 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9396 * Makefile.in: Rebuild.
9397
7b308235
ILT
93982008-06-09 Ian Lance Taylor <iant@google.com>
9399
9400 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9401 <exception>.
9402 (throwing, orig_terminate): New static variables.
9403 (terminate_handler): New static function.
9404 (t2): Set terminate handler.
9405
f0b886e3
ILT
94062008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9407
9408 PR 6584
cd536b21 9409 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9410 alignment.
9411
3e90f135
CC
94122008-05-30 Cary Coutant <ccoutant@google.com>
9413
9414 * archive.cc (Archive::include_all_members) Correct to step
9415 over symbol table and extended name table in thin archives.
9416
e09ad04a
ILT
94172008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9418
9419 PR 6407
9420 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9421 calculation.
9422
62b01cb5
ILT
94232008-05-28 Caleb Howe <cshowe@google.com>
9424
9425 * reduced_debug_output.cc: New file.
9426 * reduced_debug_output.h: New file.
92de84a6 9427 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9428 * options.cc (General_options::finalize): Add strip_debug_non_line
9429 to the strip heirarchy.
9430 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9431 fields.
9432 * layout.cc: Include "reduced_debug_output.h".
9433 (Layout::Layout): Initialize new fields.
9434 (line_only_debug_sections): New static array.
9435 (is_lines_only_debug_sections): New static inline function.
9436 (Layout::include_section): Handle --strip-debug-non-line.
9437 (Layout::make_output_section): If --strip-debug-non-line, build
9438 new output sections for .debug_abbrev and .debug_info.
9439 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9440 gold. Warn about possible overflow.
9441 (read_signed_LEB_128): Likewise.
9442 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9443 (read_signed_LEB_128): Declare.
9444 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9445 (HFILES): Add reduced_debug_output.h.
9446 * Makefile.in: Rebuild.
9447
7d9e3d98
ILT
94482008-05-21 Ian Lance Taylor <iant@google.com>
9449
9450 * mapfile.cc: New file.
9451 * mapfile.h: New file.
9452 * options.h (class General_options): Add -M/--print-map and -Map.
9453 * options.cc (General_options::finalize): Make -M equivalent to
9454 -Map -.
9455 * main.cc: Include <cstdio> and "mapfile.h".
9456 (main): Open mapfile if requested.
9457 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9458 constructor. Change caller.
9459 (queue_initial_tasks): Add mapfile parameter. Change caller.
9460 (queue_middle_tasks): Likewise.
9461 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9462 declarations.
9463 * archive.cc: Include "mapfile.h".
9464 (Archive::add_symbols): Add mapfile parameter. Change all
9465 callers. Pass mapfile, symbol, and reason to include_member.
9466 (Archive::include_all_members): Add mapfile parameter. Change all
9467 callers.
9468 (Archive::include_member): Add mapfile, sym, and why parameters.
9469 Change all callers. Report inclusion to map file.
9470 * archive.h: Include "fileread.h".
9471 (class Archive): Update declarations.
9472 (Archive::file): New const method.
9473 (class Add_archive_symbols): Add mapfile_ field. Update
9474 constructor. Change all callers.
9475 * readsyms.h (class Read_symbols): Likewise.
9476 (class Finish_group): Likewise.
9477 (class Read_script): Likewise.
9478 * common.cc: Include "mapfile.h".
9479 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9480 all callers.
9481 (Symbol_table::do_allocate_commons): Likewise.
9482 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9483 symbol allocation to mapfile.
9484 * common.h (class Allocate_commons_task): Add mapfile_ field.
9485 Update constructor. Change all callers.
9486 * symtab.h (class Symbol_table): Update declarations.
9487 * layout.cc: Include "mapfile.h".
9488 (Layout_task_runner::run): Print information to mapfile.
9489 (Layout::create_gold_note): Change Output_data_fixed_space to
9490 Output_data_zero_fill.
9491 (Layout::create_build_id): Likewise.
9492 (Layout::print_to_mapfile): New function.
9493 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9494 constructor. Change caller.
9495 (class Layout): Declare print_to_mapfile.
9496 * output.cc (Output_section::Input_section::print_to_mapfile): New
9497 function.
9498 (Output_section::add_input_section): If producing a map, always
9499 add to input_sections_ list.
9500 (Output_section::do_print_to_mapfile): New function.
9501 (Output_segment::print_sections_to_mapfile): New function.
9502 (Output_segment::print_section_list_to_mapfile): New function.
9503 * output.h: Include "mapfile.h".
9504 (Output_data::print_to_mapfile): New function.
9505 (Output_data::do_print_to_mapfile): New virtual function.
9506 (Output_segment_headers::do_print_to_mapfile): New function.
9507 (Output_file_header::do_print_to_mapfile): New function.
9508 (Output_data_const::do_print_to_mapfile): New function.
9509 (class Output_data_const_buffer): Add map_name_ field. Update
9510 constructor. Change all callers. Add do_print_to_mapfile
9511 function.
9512 (class Output_data_fixed_space): Likewise.
9513 (class Output_data_space): Likewise.
9514 (class Output_data_zero_fill): New class.
9515 (Output_data_strtab::do_print_to_mapfile): New function.
9516 (Output_data_reloc_base::do_print_to_mapfile): New function.
9517 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9518 (Output_data_group::do_print_to_mapfile): New function.
9519 (Output_data_got::do_print_to_mapfile): New function.
9520 (Output_data_dynamic::do_print_to_mapfile): New function.
9521 (Output_symtab_xindex::do_print_to_mapfile): New function.
9522 (class Output_section): Declare do_print_to_mapflie. Declare
9523 print_to_mapfile in Input_section.
9524 (class Output_segment): Declare new functions.
9525 * object.h (Sized_relobj::symbol_count): New function.
9526 * script-sections.cc
9527 (Output_section_element_dot_assignment::set_section_addresses):
9528 Change Output_data_fixed_space to Output_data_zero_fill.
9529 (Output_data_expression::do_print_to_mapfile): New function.
9530 * script.cc (read_input_script): Add mapfile parameter. Change
9531 all callers.
9532 * script.h (read_input_script): Update declaration.
9533 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9534 (Eh_frame::do_print_to_mapfile): New function.
9535 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9536 (Output_merge_string::do_print_to_mapfile): New function.
9537 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9538 function.
9539 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9540 function.
9541 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9542 function.
9543 * Makefile.am (CCFILES): Add mapfile.cc.
9544 (HFILES): Add mapfile.h.
9545 * Makefile.in: Rebuild.
9546
9f1d377b
ILT
95472008-05-19 Ian Lance Taylor <iant@google.com>
9548
9549 * options.h (class General_options): Add -z relro.
9550 * layout.cc (Layout::Layout): Initialize relro_segment_.
9551 (Layout::add_output_section_data): Return the output section.
9552 (Layout::make_output_section): Rcognize relro sections and mark
9553 them appropriately.
9554 (Layout::attach_allocated_section_to_segment): Put relro sections
9555 in a PT_GNU_RELRO segment.
9556 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9557 section as relro.
9558 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9559 PT_TLS segments.
9560 (Layout::linkonce_mapping): Map d.rel.ro.local to
9561 .data.rel.ro.local.
9562 (Layout::output_section_name): Us .data.rel.ro.local for any
9563 section which begins with that.
9564 * layout.h (class Layout): Update add_output_section_data
9565 declaration. Add relro_segment_ field.
9566 * output.cc (Output_section::Output_section): Initialize is_relro_
9567 and is_relro_local_ fields.
9568 (Output_segment::add_output_section): Group relro sections.
9569 (Output_segment::is_first_section_relro): New function.
9570 (Output_segment::maximum_alignment): If there is a relro section,
9571 align the segment to the common page size.
9572 (Output_segment::set_section_addresses): Track whether we are
9573 looking at relro sections. If the last section is a relro
9574 section, align to the common page size.
9575 (Output_segment::set_section_list_addresses): Add in_relro
9576 parameter. Change all callers. Align to the page size when
9577 moving from relro to non-relro section.
9578 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9579 segment.
9580 * output.h (class Output_section): Add is_relro_ and
9581 is_relro_local_ fields.
9582 (Output_section::is_relro): New function.
9583 (Output_section::set_is_relro): New function.
9584 (Output_section::is_relro_local): New function.
9585 (Output_section::set_is_relro_local): New function.
9586 (class Output_segment): Update declarations.
9587 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9588 * sparc.cc (Target_sparc::got_section): Likewise.
9589 * x86_64.cc (Target_x86_64::got_section): Likewise.
9590 * testsuite/relro_test_main.cc: New file.
9591 * testsuite/relro_test.cc: New file.
9592 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9593 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9594 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9595 (relro_test.so, relro_test_pic.o): New targets.
9596 * testsuite/Makefile.in: Rebuild.
9597
a984ee1d
ILT
95982008-05-16 Ian Lance Taylor <iant@google.com>
9599
01676dcd
ILT
9600 * output.cc (Output_segment::add_output_section): Remove front
9601 parameter.
9602 * output.h (class Output_segment): Remove
9603 add_initial_output_section and overloaded add_output_section.
9604 Update declaration of remaining add_output_section.
9605 * layout.cc (Layout::create_interp): Call add_output_section
9606 rather than add_initial_output_section.
9607 (Layout::finish_dynamic_section): Likewise.
9608
497897f9
ILT
9609 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9610 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9611 know the dynamic type.
9612 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9613 field. Initialize it in constructor.
9614 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9615 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9616 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9617 reloc.
9618
a984ee1d
ILT
9619 * output.cc (Output_reloc::get_address): Change return type to
9620 Elf_Addr.
9621 * output.h (class Output_reloc): Update get_address declaration.
9622 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9623 for section addresses.
9624
55ba0940
ILT
96252008-05-09 Ian Lance Taylor <iant@google.com>
9626
9627 PR 6493
9628 * gold.cc (gold_nomem): Use return value of write.
9629
75517b77
ILT
96302008-05-08 Ian Lance Taylor <iant@google.com>
9631
9632 * symtab.c (Symbol::init_base_output_data): Add version
9633 parameter. Change all callers.
9634 (Symbol::init_base_output_segment): Likewise.
9635 (Symbol::init_base_constant): Likewise.
9636 (Symbol::init_base_undefined): Likewise.
9637 (Sized_symbol::init_output_data): Likewise.
9638 (Sized_symbol::init_output_segment): Likewise.
9639 (Sized_symbol::init_constant): Likewise.
9640 (Sized_symbol::init_undefined): Likewise.
9641 (Symbol_table::do_define_in_output_data): If the new symbol has a
9642 version, mark it as the default.
9643 (Symbol_table::do_define_in_output_segment): Likewise.
9644 (Symbol_table::do_define_as_constant): Likewise.
9645 * symtab.h (class Symbol): Update declarations.
9646 (class Sized_symbol): Likewise.
9647 * resolve.cc (Symbol::override_version): New function.
c42e122e 9648 (Symbol::override_base): Call override_version.
75517b77
ILT
9649 (Symbol::override_base_with_special): Likewise.
9650 * testsuite/ver_script_8.script: New file.
9651 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9652 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9653 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9654 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9655
f1f70eae
ILT
96562008-05-06 Ian Lance Taylor <iant@google.com>
9657
f3e9c5c5
ILT
9658 PR 6049
9659 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
9660 functions.
9661 (class General_options): Remove existing --undefined, and add
9662 --no-undefined instead. Add new --undefined as synonym for -u.
9663 * archive.cc (Archive::add_symbols): Check whether symbol was
9664 named with -u.
9665 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
9666 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
9667 all uses. Add IS_UNDEFINED. Update declarations to split
9668 different versions of init_base. Declare init_base_undefined.
9669 (Symbol::is_defined): Handle IS_UNDEFINED.
9670 (Symbol::is_undefined): Likewise.
9671 (Symbol::is_weak_undefined): Call is_undefined.
9672 (Symbol::is_absolute): Handle IS_CONSTANT.
9673 (class Sized_symbol): Update declarations to split different
9674 versions of init. Declare init_undefined.
9675 (class Symbol_table): Declare new functions.
9676 * symtab.cc (Symbol::init_base_object): Rename from init_base.
9677 Change all callers.
9678 (Symbol::init_base_output_data): Likewise.
9679 (Symbol::init_base_output_segment): Likewise.
9680 (Symbol::init_base_constant): Likewise.
9681 (Symbol::init_base_undefined): New function.
9682 (Sized_symbol::init_object): Rename from init. Change all
9683 callers.
9684 (Sized_symbol::init_output_data): Likewise.
9685 (Sized_symbol::init_output_segment): Likewise.
9686 (Sized_symbol::init_constant): Likewise.
9687 (Sized_symbol::init_undefined): New function.
9688 (Symbol_table::add_undefined_symbols_from_command_line): New
9689 function.
9690 (Symbol_table::do_add_undefined_symbols_from_command_line): New
9691 function.
9692 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
9693 (Symbol::output_section): Likewise.
9694 (Symbol::set_output_section): Likewise.
9695 (Symbol_table::sized_finalize_symbol): Likewise.
9696 (Symbol_table::sized_write_globals): Likewise.
9697 * resolve.cc (Symbol_table::should_override): Likewise.
9698 (Symbol::override_base_with_special): Likewise.
9699
8bdcdf2c
ILT
9700 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
9701 symbol, change it to have default visibility.
9702 * testsuite/protected_1.cc: New file.
9703 * testsuite/protected_2.cc: New file.
9704 * testsuite/protected_3.cc: New file.
9705 * testsuite/protected_main_1.cc: New file.
9706 * testsuite/protected_main_2.cc: New file.
9707 * testsuite/protected_main_3.cc: New file.
9708 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
9709 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
9710 (protected_1_LDFLAGS, protected_1_LDADD): Define.
9711 (protected_1.so): New target.
9712 (protected_1_pic.o, protected_2_pic.o): New targets.
9713 (protected_3_pic.o): New target.
9714 (check_PROGRAMS): Add protected_2.
9715 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
9716 (protected_2_LDFLAGS, protected_2_LDADD): Define.
9717 * testsuite/Makefile.in: Rebuild.
9718
2b706932
ILT
9719 * options.h (DEFINE_var): Add set_user_set_##varname__.
9720 (DEFINE_bool_alias): New macro.
9721 (class General_options): Define -Bstatic using DEFINE_bool_alias
9722 rather than DEFINE_special. Add --undefined as an alias for -z
9723 defs.
9724 * options.cc (General_options::parse_Bstatic): Remove.
9725
d82a5bcc
ILT
9726 * options.h (class General_options): Add --fatal-warnings.
9727 * main.cc (main): Implement --fatal-warnings.
9728 * errors.h (Errors::warning_count): New function.
9729
f1f70eae
ILT
9730 * options.h (class General_options): Add -Bsymbolic-functions.
9731 * symtab.h (Symbol::is_preemptible): Check for
9732 -Bsymbolic-functions.
9733
8825ac63
ILT
97342008-05-05 Ian Lance Taylor <iant@google.com>
9735
d98bc257
ILT
9736 * options.h (DEFINE_bool): For DASH_Z, create the negative option
9737 as noVARNAME rather than no-VARNAME.
9738 (class General_options): Add option -z combreloc.
9739 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
9740 get_address.
9741 (Output_reloc::sort_before) [SHT_REL]: New function.
9742 (Output_reloc::sort_before) [SHT_RELA]: New function.
9743 (class Output_data_reloc_base): Add sort_relocs_ field. Define
9744 Sort_relocs_comparison.
9745 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
9746 parameter. Change all callers.
9747 (Output_data_reloc::Output_data_reloc) [both versions]: Add
9748 sort_relocs parameter. Change all callers.
9749 * output.cc (Output_reloc::get_address): New function, broken out
9750 of write_rel.
9751 (Output_reloc::write_rel): Call it.
9752 (Output_reloc::compare): New function.
9753 (Output_data_reloc_base::do_write): Optionally sort relocs.
9754
60b2b4e7
ILT
9755 * configure.ac: If targ_extra_obj is set, link it in.
9756 * configure.tgt: Initialize all variables.
9757 (x86_64*): Set targ_extra_obj and targ_extra_size.
9758 * configure: Rebuild.
9759
8825ac63
ILT
9760 * object.cc (Sized_relobj::include_section_group): Adjust section
9761 indexes read from group data. Build vector to pass to
9762 layout_group.
9763 * layout.cc (Layout::layout_group): Add flags and shndxes
9764 parameters. Remove contents parameter. Change caller. Update
9765 explicit instantiations.
9766 * layout.h (class Layout): Update layout_group declaration.
9767 * output.cc (Output_data_group::Output_data_group): Add flags and
9768 input_shndxes parameters. Remove contents parameter. Change
9769 caller.
9770 (Output_data_group::do_write): Change input_sections_ to
9771 input_shndxes_.
9772 * output.h (class Output_data_group): Update constructor
9773 declaration. Rename input_sections_ to input_shndxes_.
9774 * testsuite/many_sections_test.cc: Add template.
9775
e94cf127
CC
97762008-04-30 Cary Coutant <ccoutant@google.com>
9777
4418b2d5
CC
9778 * target-reloc.h (relocate_section): Fix dead-pointer bug.
9779
e94cf127
CC
9780 * layout.cc (Layout::include_section): Refactored check for debug
9781 info section.
9782 (Layout::add_comdat): Add new parameters. Change type
9783 of signature parameter. Add object and shndx to signatures table.
9784 (Layout::find_kept_object): New function.
9785 * layout.h: Include <cstring>.
9786 (Layout::is_debug_info_section): New function.
9787 (Layout::add_comdat): Add new parameters.
9788 (Layout::find_kept_object): New function.
9789 (Layout::Kept_section): New struct.
9790 (Layout::Signatures): Change type of map range.
9791 * object.cc (Relobj::output_section_address): New function.
9792 (Sized_relobj::include_section_group): Add new parameters. Change
9793 calls to Layout::add_comdat. Change to build table of kept comdat
9794 groups and table mapping discarded sections to kept sections.
9795 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
9796 (Sized_relobj::do_layout): Change calls to include_section_group and
9797 include_linkonce_section.
9798 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
9799 value to zero when section is discarded.
9800 (Sized_relobj::map_to_kept_section): New function.
9801 * object.h (Relobj::output_section_address): New function.
9802 (Relobj::Comdat_group): New type.
9803 (Relobj::find_comdat_group): New function.
9804 (Relobj::Comdat_group_table): New type.
9805 (Relobj::Kept_comdat_section): New type.
9806 (Relobj::Kept_comdat_section_table): New type.
9807 (Relobj::add_comdat_group): New function.
9808 (Relobj::set_kept_comdat_section): New function.
9809 (Relobj::get_kept_comdat_section): New function.
9810 (Relobj::comdat_groups_): New field.
9811 (Relobj::kept_comdat_sections_): New field.
9812 (Symbol_value::input_value): Update comment.
9813 (Sized_relobj::map_to_kept_section) New function.
9814 (Sized_relobj::include_linkonce_section): Add new parameter.
9815 * target-reloc.h (Comdat_behavior): New type.
9816 (get_comdat_behavior): New function.
9817 (relocate_section): Add code to map a discarded section to the
9818 corresponding kept section when applying a relocation.
9819
e4e5049b
CS
98202008-04-30 Craig Silverstein <csilvers@google.com>
9821
9822 * dwarf_reader.cc (next_generation_count): New static var.
9823 (Addr2line_cache_entry): New struct.
9824 (addr2line_cache): New static var.
9825 (Dwarf_line_info::one_addr2line): Added caching.
9826 (Dwarf_line_info::clear_addr2line_cache): New function.
9827 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
9828 cache-size parameter.
9829 (Dwarf_line_info::one_addr2line_cache): New function.
9830 * symtab.cc (Symbol_table::detect_odr_violations): Pass
9831 new cache-size argument to one_addr2line(), and clear cache.
9832
d09e9154
CC
98332008-04-28 Cary Coutant <ccoutant@google.com>
9834
9835 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
9836 R_386_PC8 relocations.
9837
7ef73768
ILT
98382008-04-23 Ian Lance Taylor <iant@google.com>
9839
55438702
ILT
9840 * object.cc (Sized_relobj::include_section_group): Check for
9841 invalid section group.
9842
c165fb93
ILT
9843 * object.cc (make_elf_object): Correct test for 64-bit ELF file
9844 header size.
9845
7ef73768
ILT
9846 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
9847 than read for file header.
9848 * archive.cc (Archive::include_member): Likewise.
9849
6194aaab
L
98502008-04-23 Paolo Bonzini <bonzini@gnu.org>
9851
9852 * aclocal.m4: Regenerate.
9853 * configure: Regenerate.
9854
d491d34e
ILT
98552008-04-19 Ian Lance Taylor <iant@google.com>
9856
5ea2bac6
ILT
9857 * version.cc (version_string): Bump to 1.6.
9858
7bc3e21a
ILT
9859 * testsuite/Makefile.am (many_sections_r_test): New target.
9860 (many_sections_r_test_SOURCES): Remove.
9861 (many_sections_r_test_DEPENDENCIES): Remove.
9862 (many_sections_r_test_LDFLAGS): Remove.
9863 (many_sections_r_test_LDADD): Remove.
9864
7fcd3aa9
ILT
9865 * object.cc (Sized_relobj::do_add_symbols): Always pass
9866 local_symbol_count_ to add_from_relobj.
9867
4c94d6ae
ILT
9868 * testsuite/Makefile.am (many_sections_check.h): Only check one in
9869 every thousand variables.
9870 * testsuite/Makefile.in: Rebuild.
9871
d491d34e
ILT
9872 * object.cc (Xindex::initialize_symtab_xindex): New function.
9873 (Xindex::read_symtab_xindex): New function.
9874 (Xindex::sym_xindex_to_shndx): New function.
9875 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
9876 available.
9877 (Sized_relobj::do_initialize_xindex): New function.
9878 (Sized_relobj::do_read_symbols): Adjust section links.
9879 (Sized_relobj::symbol_section_and_value): Add is_ordinary
9880 parameter. Change all callers.
9881 (Sized_relobj::include_section_group): Adjust section links and
9882 symbol section indexes.
9883 (Sized_relobj::do_layout): Adjust section links.
9884 (Sized_relobj::do_count_local_symbols): Adjust section links and
9885 symbol section indexes.
9886 (Sized_relobj::do_finalize_local_symbols): Distinguish between
9887 ordinary and special symbols.
9888 (Sized_relobj::write_local_symbols): Add symtab_xindex and
9889 dynsym_xindex parameters. Change all callers. Adjust section
9890 links. Use SHN_XINDEX when needed.
9891 (Sized_relobj::get_symbol_location_info): Adjust section links.
9892 Don't get fooled by special symbols.
9893 * object.h (class Xindex): Define.
9894 (class Object): Add xindex_ parameter. Declare virtual functoin
9895 do_initialize_xindex.
9896 (Object::adjust_sym_shndx): New function.
9897 (Object::set_xindex): New protected function.
9898 (class Symbol_value): Add is_ordinary_shndx_ field.
9899 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
9900 (Symbol_value::value): Assert ordinary section.
9901 (Symbol_value::initialize_input_to_output_map): Likewise.
9902 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
9903 Change all callers.
9904 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
9905 all callers.
9906 (class Sized_relobj): Update declarations.
9907 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
9908 parameter. Change all callers.
9909 (Sized_relobj::adjust_shndx): New function.
9910 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
9911 field.
9912 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
9913 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
9914 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
9915 (Sized_dynobj::read_dynsym_section): Adjust section links.
9916 (Sized_dynobj::read_dynamic): Likewise.
9917 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
9918 section links.
9919 (Sized_dynobj::do_initialize_xindex): New function.
9920 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
9921 do_initialize_xindex.
9922 (Sized_dynobj::adjust_shndx): New function.
9923 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
9924 dynsym_xindex_ fields.
9925 (Layout::finalize): Add a call to set_section_indexes before
9926 creating the symtab sections.
9927 (Layout::set_section_indexes): Don't do anything if the section
9928 already has a section index.
9929 (Layout::create_symtab_sections): Add shnum parameter. Change
9930 caller. Create .symtab_shndx section if needed.
9931 (Layout::create_shdrs): Add shstrtab_section parameter. Change
9932 caller.
9933 (Layout::allocated_output_section_count): New function.
9934 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
9935 needed.
9936 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
9937 fields. Update declarations.
9938 (Layout::symtab_xindex): New function.
9939 (Layout::dynsym_xindex): New function.
9940 (class Write_symbols_task): Add layout_ field.
9941 (Write_symbols_task::Write_symbols_task): Add layout parameter.
9942 Change caller.
9943 * output.cc (Output_section_headers::Output_section_headers): Add
9944 shstrtab_section parameter. Change all callers.
9945 (Output_section_headers::do_sized_write): Store overflow values
9946 for section count and section string table section index in
9947 section header zero.
9948 (Output_file_header::do_sized_write): Check for overflow of
9949 section count and section string table section index.
9950 (Output_symtab_xindex::do_write): New function.
9951 (Output_symtab_xindex::endian_do_write): New function.
9952 * output.h (class Output_section_headers): Add shstrtab_section_.
9953 Update declarations.
9954 (class Output_symtab_xindex): Define.
9955 (Output_section::has_out_shndx): New function.
9956 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
9957 field.
9958 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
9959 Change all callers.
9960 (Sized_symbol::init): Likewise.
9961 (Symbol::output_section): Check for ordinary symbol.
9962 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
9963 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
9964 callers.
9965 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
9966 Change all callers. Simplify handling of symbols from sections
9967 not included in the link.
9968 (Symbol_table::add_from_dynobj): Handle ordinary symbol
9969 distinction.
9970 (Weak_alias_sorter::operator()): Assert that symbols are
9971 ordinary.
9972 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
9973 distinction.
9974 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
9975 parameters. Change all callers.
9976 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
9977 symbol distinction. Use SHN_XINDEX when needed.
9978 (Symbol_table::write_section_symbol): Add symtab_xindex
9979 parameter. Change all callers.
9980 (Symbol_table::sized_write_section_symbol): Likewise. Use
9981 SHN_XINDEX when needed.
9982 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
9983 declarations.
9984 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
9985 (Symbol::is_defined): Check is_ordinary.
9986 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
9987 (Symbol::is_absolute, Symbol::is_common): Likewise.
9988 (class Sized_symbol): Update declarations.
9989 (class Symbol_table): Update declarations.
9990 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
9991 parameters. Change all callers.
9992 (Sized_symbol::override): Likewise.
9993 (Symbol_table::override): Likewise.
9994 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
9995 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
9996 is_ordinary, and orig_st_shndx parameters. Change all callers.
9997 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
9998 to be in an ordinary section.
9999 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
10000 object and is_ordinary parameters. Change all callers.
10001 (Sized_dwarf_line_info::read_relocs): Add object parameter.
10002 Change all callers. Don't add undefined or non-ordinary symbols
10003 to reloc_map_.
10004 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
10005 Change all callers.
10006 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10007 declarations.
10008 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10009 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10010 (Sized_relobj::relocate_sections): Likewise.
10011 * target-reloc.h (scan_relocs): Adjust section symbol index.
10012 (scan_relocatable_relocs): Likewise.
10013 * i386.cc (Scan::local): Check for ordinary symbols.
10014 * sparc.cc (Scan::local): Likewise.
10015 * x86_64.cc (Scan::local): Likewise.
10016 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10017 to symbol_section_and_value.
10018 * testsuite/many_sections_test.cc: New file.
10019 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10020 (check_PROGRAMS): Add many_sections_test.
10021 (many_sections_test_SOURCES): Define.
10022 (many_sections_test_DEPENDENCIES): Define.
10023 (many_sections_test_LDFLAGS): Define.
10024 (BUILT_SOURCES): Add many_sections_define.h.
10025 (many_sections_define.h): New target.
10026 (BUILT_SOURCES): Add many_sections_check.h.
10027 (many_sections_check.h): New target.
10028 (check_PROGRAMS): Add many_sections_r_test.
10029 (many_sections_r_test_SOURCES): Define.
10030 (many_sections_r_test_DEPENDENCIES): Define.
10031 (many_sections_r_test_LDFLAGS): Define.
10032 (many_sections_r_test_LDADD): Define.
10033 (many_sections_r_test.o): New target.
10034 * testsuite/Makefile.in: Rebuild.
10035
c5818ff1
CC
100362008-04-17 Cary Coutant <ccoutant@google.com>
10037
10038 * errors.cc (Errors::info): New function.
10039 (gold_info): New function.
10040 * errors.h (Errors::info): New function.
10041 * gold.h (gold_info): New function.
10042 * object.cc (Input_objects::add_object): Print trace output.
10043 * options.cc (options::parse_set): New function.
10044 (General_options::parse_wrap): Deleted.
10045 (General_options::General_options): Deleted initializer.
10046 * options.h (options::String_set): New typedef.
10047 (options::parse_set): New function.
10048 (DEFINE_set): New macro.
10049 (General_options::wrap): Changed to use DEFINE_set. Changed
10050 callers of any_wrap_symbols and is_wrap_symbol.
10051 (General_options::trace, General_options::trace_symbol):
10052 New options.
10053 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10054 (General_options::wrap_symbols_): Deleted.
10055 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10056
b5be4a7c
DM
100572008-04-17 David S. Miller <davem@davemloft.net>
10058
10059 * options.cc (General_options::parse_V): New function.
10060 * options.h: Add entries for -V and -Qy.
10061
155a0dd7
ILT
100622008-04-17 Ian Lance Taylor <iant@google.com>
10063
10064 * common.cc (Symbol_table::allocate_commons): Remove options
10065 parameter. Change caller.
10066 (Symbol_table::do_allocate_commons): Remove options parameter.
10067 Change caller. Just call do_allocate_commons_list twice.
10068 (Symbol_table::do_allocate_commons_list): New function, broken out
10069 of do_allocate_commons.
10070 * common.h (class Allocate_commons_task): Remove options_ field.
10071 Update constructor.
10072 * symtab.cc (Symbol_table::Symbol_table): Initialize
10073 tls_commons_.
10074 (Symbol_table::add_from_object): Put TLS common symbols on
10075 tls_commons_ list.
10076 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10077 which are IN_OUTPUT_DATA.
10078 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10079 allocate_commons and do_allocate_commons declarations. Declare
10080 do_allocate_commons_list.
10081 * gold.cc (queue_middle_tasks): Update creation of
10082 Allocate_commons_task to not pass options.
10083 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10084 (TLS_TEST_C_FLAGS): New variable.
10085 (tls_test_c_pic.o): New target.
10086 (tls_test_shared.so): Link in tls_test_c_pic.o.
10087 (tls_test_c_pic_ie.o): New target.
10088 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10089 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10090 (tls_test_c.o): New target.
10091 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10092 (tls_pic_test_LDADD): Likewise.
10093 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10094 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10095 (tls_test_c_gnu2.o): New target.
10096 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10097 tls_test_c_gnu2.o.
10098 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10099 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10100 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10101 * testsuite/tls_test.cc: Include "config.h".
10102 (t_last): Call t11_last.
10103 * testsuite/tls_test.h (t11, t11_last): Declare.
10104 * testsuite/tls_test_c.c: New file.
10105 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10106 * configure.ac: Check for OpenMP support.
10107 * configure, config.in, Makefile.in: Rebuild.
10108 * testsuite/Makefile.in: Rebuild.
10109
edfbb029
CC
101102008-04-16 Cary Coutant <ccoutant@google.com>
10111
10112 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10113 (Target_i386::tls_base_symbol_defined_): New field.
10114 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10115 (Target_i386::Scan::global): Likewise.
10116 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10117 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10118 (Target_x86_64::tls_base_symbol_defined_): New field.
10119 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10120 (Target_x86_64::Scan::global): Likewise.
10121
f3c69fca
CC
101222008-04-16 Cary Coutant <ccoutant@google.com>
10123
10124 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10125 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10126 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10127 building shared libraries.
10128 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10129 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10130 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10131 * testsuite/Makefile.in: Rebuild.
10132 * testsuite/weak_undef.h: New file.
10133 * testsuite/weak_undef_file1.cc: Add extra test cases.
10134 * testsuite/weak_undef_file2.cc: Likewise.
10135 * testsuite/weak_undef_test.cc: Likewise.
10136
7c414435
DM
101372008-04-16 David S. Miller <davem@davemloft.net>
10138
32b769e1
DM
10139 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10140 Add issued_non_pic_error_ field. Declare check_non_pic.
10141 (Target_sparc::Scan::check_non_pic): New function.
10142 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10143 (Target_sparc::Scan::global): Likewise.
10144
11936fb1
DM
10145 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10146 * configure: Rebuild.
10147
7c414435
DM
10148 * options.h (DEFINE_enable): New macro.
10149 (new_dtags): New enable option.
10150 (initfirst, interpose, loadfltr, nodefaultlib,
10151 nodelete, nodlopen, nodump): New -z options.
10152 * layout.cc (Layout:finish_dynamic_section): If new
10153 dtags enabled, emit DT_RUNPATH. Also, emit a
10154 DT_FLAGS_1 containing any specified -z flags.
10155
85c7bf8b
ILT
101562008-04-16 Ian Lance Taylor <iant@google.com>
10157
12c0daef
ILT
10158 * copy-relocs.cc: New file.
10159 * copy-relocs.h: New file.
10160 * reloc.cc: Remove Copy_relocs code.
10161 * reloc.h: Likewise.
10162 * reloc-types.h (struct Reloc_types) [both versions]: Add
10163 get_reloc_addend_noerror.
10164 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10165 variants of add_global which take an addend which must be zero.
10166 * i386.cc: Include "copy-relocs.h".
10167 (class Target_i386): Change type of copy_relocs_ to variable,
10168 update initializer.
10169 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10170 Change all callers.
10171 (Target_i386::do_finalize_sections): Change handling of
10172 copy_relocs_.
10173 * sparc.cc: Include "copy-relocs.h".
10174 (class Target_sparc): Change type of copy_relocs_ to variable,
10175 update initializer.
10176 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10177 Change all callers.
10178 (Target_sparc::do_finalize_sections): Change handling of
10179 copy_relocs_.
10180 * x86_64.cc: Include "copy-relocs.h".
10181 (class Target_x86_64): Change type of copy_relocs_ to variable,
10182 update initializer.
10183 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10184 class. Change all callers.
10185 (Target_x86_64::do_finalize_sections): Change handling of
10186 copy_relocs_.
10187 * Makefile.am (CCFILES): Add copy-relocs.cc.
10188 (HFILES): Add copy-relocs.h.
10189
4f4995b6
ILT
10190 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10191
85c7bf8b
ILT
10192 * testsuite/script_test_4.sh: Permit leading zeroes.
10193
4f2a9edd
ILT
101942008-04-15 Ian Lance Taylor <iant@google.com>
10195
e6188289
ILT
10196 * script-sections.cc (Script_sections::create_segments): Use
10197 header_size_adjustment even when there is enough room for the
10198 headers.
10199 * testsuite/script_test_4.sh: New file.
10200 * testsuite/script_test_4.t: New file.
10201 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10202 (check_DATA): Add script_test_4.stdout.
10203 (MOSTLYCLEANFILES): Likewise.
10204 (script_test_4): New target.
10205 (script_test_4.stdout): New target.
10206 * testsuite/Makefile.in: Rebuild.
10207
4f2a9edd
ILT
10208 * sparc.cc: Add definitions for Output_data_plt_sparc class
10209 constants.
10210
f5314dd5
DM
102112008-04-14 David S. Miller <davem@davemloft.net>
10212
10213 * sparc.cc: New file.
10214 * Makefile.am (TARGETSOURCES): Add sparc.cc
10215 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10216 * configure.tgt: Document targ_extra_size and
10217 targ_extra_big_endian. Add entries for sparc-* and
10218 sparc64-*.
10219 * configure.ac: Handle targ_extra_size and
10220 targ_extra_big_endian.
10221 * Makefile.in: Rebuild.
10222 * configure: Likewise.
10223 * po/POTFILES.in: Likewise.
10224 * po/gold.pot: Likewise.
10225
154e0e9a
ILT
102262008-04-14 Ian Lance Taylor <iant@google.com>
10227
10228 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10229 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10230 in the name/type/flags to section mapping. Don't call
10231 allocate_output_section.
10232 (Layout::choose_output_section): Change parameter from adjust_name
10233 to is_input_section. Don't permit input sections after sections
10234 are attached to segments. Don't call allocate_output_section.
10235 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10236 not write_enable_output_section.
10237 (Layout::make_output_section): Don't push to
10238 unattached_section_list_ nor call attach_to_segment. Call
10239 attach_section_to_segment if sections are attached.
10240 (Layout::attach_sections_to_segments): New function.
10241 (Layout::attach_section_to_segment): New function.
10242 (Layout::attach_allocated_section_to_segment): Rename from
10243 attach_to_segment. Remove flags parameter.
10244 (Layout::allocate_output_section): Remove function.
10245 (Layout::write_enable_output_section): Remove function.
10246 * layout.h (class Layout): Update for above changes. Add new
10247 field sections_are_attached_.
10248 * output.h (Output_section::update_flags_for_input_section): New
10249 function.
10250 * output.cc (Output_section::add_input_section): Call
10251 update_flags_for_input_section.
10252 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10253
009a67a2
CC
102542008-04-11 Cary Coutant <ccoutant@google.com>
10255
10256 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10257 thought unnecessary.
10258 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10259
759b1a24
ILT
102602008-04-11 Ian Lance Taylor <iant@google.com>
10261
10262 * output.h (class Output_section_data): Remove inline definition
10263 of set_addralign.
10264 * output.cc (Output_section_data::set_addralign): New function.
10265
c2b45e22
CC
102662008-04-11 Cary Coutant <ccoutant@google.com>
10267
10268 Add support for TLS descriptors for i386 and x86_64.
10269 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10270 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10271 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10272 GOT_TYPE_TLS_DESC.
10273 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10274 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10275 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10276 relocations.
10277 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10278 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10279 Fix problem with initial-exec relocations.
10280 (Target_i386::Relocate::relocate_tls): Likewise.
10281 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10282 relaxation.
10283 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10284 support for section-plus-offset dynamic table entries.
10285 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10286 (Output_data_dynamic::Dynamic_entry): Add support for
10287 section-plus-offset dynamic table entries.
10288 (Output_data_dynamic::Classification): Likewise.
10289 (Output_data_dynamic::classification_): Renamed offset_.
10290 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10291 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10292 (Target_x86_64::make_plt_section): New function.
10293 (Target_x86_64::reserve_tlsdesc_entries): New function.
10294 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10295 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10296 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10297 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10298 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10299 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10300 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10301 add extra PLT entry for TLS descriptors.
10302 (Output_data_plt_x86_64::got_): New field.
10303 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10304 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10305 fields.
10306 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10307 descriptors.
10308 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10309 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10310 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10311 R_386_TLS_DESC_CALL relocations.
10312 (Target_x86_64::Scan::global): Likewise.
10313 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10314 for TLS descriptors.
10315 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10316 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10317 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10318 GD-to-IE relaxation.
10319 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10320 and TLS_DESCRIPTORS.
10321 * Makefile.in: Rebuild.
10322 * configure: Rebuild.
10323 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10324 (tls_test_shared2.so): New target.
10325 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10326 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10327 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10328 (tls_shared_gd_to_ie_test_LDADD): New variable.
10329 (tls_shared_gnu2_gd_to_ie_test): New target.
10330 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10331 New targets.
10332 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10333 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10334 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10335 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10336 (tls_shared_gnu2_test): New target.
10337 (tls_test_gnu2_shared.so): New target.
10338 (tls_shared_gnu2_test_SOURCES): New variable.
10339 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10340 (tls_shared_gnu2_test_LDFLAGS): New variable.
10341 (tls_shared_gnu2_test_LDADD): New variable.
10342 * testsuite/Makefile.in: Rebuild.
10343 * testsuite/Makefile.
10344
83bfb6b7
ILT
103452008-04-11 Ian Lance Taylor <iant@google.com>
10346
10347 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10348 justsyms.t.
10349 * testsuite/Makefile.in: Rebuild.
10350
10351 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10352 long.
10353 * testsuite/script_test_2.cc (main): Adjust test.
10354
706e1f5e
ILT
103552008-04-11 David S. Miller <davem@davemloft.net>
10356 Ian Lance Taylor <iant@google.com>
10357
10358 * options.h (General_options): Add entries for '-Y' and
10359 '-relax'.
10360 * options.cc (General_options:finalize): If -Y was used, add those
10361 entries to the library path instead of the default "/lib" and
10362 "/usr/lib".
10363
7c98e6bb
DM
103642008-04-11 David S. Miller <davem@davemloft.net>
10365
10366 * testsuite/justsyms.t: Start at 0x100.
10367 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10368 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10369 long.
10370 * testsuite/script_test_2.cc: Adjust string and section length
10371 checks.
7c98e6bb 10372
99a37bfd
ILT
103732008-04-09 Ian Lance Taylor <iant@google.com>
10374
2cefc357
ILT
10375 PR gold/5996
10376 * script-sections.cc (Sections_element::allocate_to_segment): Add
10377 orphan parameter.
10378 (Output_section_definition::allocate_to_segment): Likewise.
10379 (Orphan_output_section::allocate_to_segment): Likewise.
10380 (Script_sections::attach_sections_using_phdrs_clause): Don't
10381 propagate non-PT_LOAD segments to orphan sections.
10382 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10383 readelf rather than objdump.
10384 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10385 .interp section and PT_INTERP segment are the same size.
10386 * testsuite/Makefile.in: Rebuild.
10387
99a37bfd
ILT
10388 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10389 aliases for symbols defined in the same object.
10390 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10391 (weak_alias_test_SOURCES): New variable.
10392 (weak_alias_test_DEPENDENCIES): New variable.
10393 (weak_alias_test_LDFLAGS): New variable.
10394 (weak_alias_test_LDADD): New variable.
10395 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10396 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10397 (weak_alias_test_3.o): New target.
10398 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10399 * testsuite/weak_alias_test_main.cc: New file.
10400 * testsuite/weak_alias_test_1.cc: New file.
10401 * testsuite/weak_alias_test_2.cc: New file.
10402 * testsuite/weak_alias_test_3.cc: New file.
10403
780e49c5
ILT
104042008-04-08 Ian Lance Taylor <iant@google.com>
10405
cdb0b8f5
ILT
10406 * options.h (class General_options): Add --noinhibit-exec option.
10407 * main.cc (main): Check --noinhibit-exec.
10408
0864d551
ILT
10409 * options.h (class General_options): Define --wrap as a special
10410 option. Add wrap_symbols_ field.
10411 (General_options::any_wrap_symbols): New function.
10412 (General_options::is_wrap_symbol): New function.
10413 * options.cc (General_options::parse_wrap): New function.
10414 (General_options::General_options): Initialize wrap_symbols_.
10415 * symtab.cc (Symbol_table::wrap_symbol): New function.
10416 (Symbol_table::add_from_object): Handle --wrap.
10417 * symtab.h (class Symbol_table): Declare wrap_symbol.
10418 * target.h (Target::wrap_char): New function.
10419 (Target::Target_info): Add wrap_char field.
10420 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10421 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10422 * testsuite/testfile.cc (Target_test::test_target_info):
10423 Likewise.
10424
789aa6de
ILT
10425 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10426 there is one.
10427
2c38906f
ILT
10428 * layout.h (class Layout): Add added_eh_frame_data_ field.
10429 * layout.cc (Layout::Layout): Initialize new field.
10430 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10431 output section until we find a section we merged successfully.
10432 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10433 that the size be non-zero.
10434
780e49c5
ILT
10435 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10436 qualifier.
10437
7fcd0256
ILT
104382008-04-08 Craig Silverstein <csilvers@google.com>
10439
10440 * configure.ac: Export new conditional variable HAVE_ZLIB.
10441 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10442 on HAVE_ZLIB.
10443 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10444 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10445
6835af53
ILT
104462008-04-07 Ian Lance Taylor <iant@google.com>
10447
e24f324c
ILT
10448 * version.cc (version_string): Set to "1.5".
10449
a036edd8
ILT
10450 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10451 Add issued_non_pic_error_ field. Declare check_non_pic.
10452 (Target_x86_64::Scan::check_non_pic): New function.
10453 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10454 (Target_x86_64::Scan::global): Likewise.
10455
624f8810
ILT
10456 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10457 addend parameter. Change caller. Handle merge sections.
10458 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10459 Address to Addend. Don't add in the result of
10460 local_section_offset, pass down the addend and use the returned
10461 value.
10462 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10463 Update declarations of local_section_offset and symbol_value.
10464 * testsuite/two_file_test_1.cc (t18): New function.
10465 * testsuite/two_file_test_2.cc (f18): New function.
10466 * testsuite/two_file_test_main.cc (main): Call t18.
10467 * testsuite/two_file_test.h (t18, f18): Declare.
10468
6835af53
ILT
10469 * configure.ac: Don't test for objdump, c++filt, or readelf.
10470 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10471 conditionals.
10472 (TEST_READELF): New variable.
10473 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10474 (check_PROGRAMS): Add two_file_strip_test.
10475 (two_file_strip_test): New target.
10476 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10477 (two_file_same_shared_strip_test_SOURCES): New variable.
10478 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10479 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10480 (two_file_same_shared_strip_test_LDADD): New variable.
10481 (two_file_shared_strip.so): New target.
10482 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10483 (ver_test_5.syms, ver_test_7.syms): Likewise.
10484 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10485 (strip_test_3.stdout): Use TEST_OBJDUMP.
10486 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10487
86925eef
CC
104882008-04-04 Cary Coutant <ccoutant@google.com>
10489
10490 * symtab.h (Symbol::is_weak_undefined): New function.
10491 (Symbol::is_strong_undefined): New function.
10492 (Symbol::is_absolute): New function.
10493 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10494 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10495 absolute symbols.
10496 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10497 (weak_undef_test): New target.
10498 * testsuite/Makefile.in: Rebuild.
10499 * testsuite/weak_undef_file1.cc: New file.
10500 * testsuite/weak_undef_file2.cc: New file.
10501 * testsuite/weak_undef_test.cc: New file.
10502
126f3ece
ILT
105032008-04-03 Craig Silverstein <csilvers@google.com>
10504
10505 * compressed_output.h (class Output_compressed_section): Use
10506 unsigned buffer.
10507 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10508 add zlib header.
10509 (zlib_compressed_suffix): Removed.
10510 (Output_compressed_section::set_final_data_size): Use unsigned
10511 buffers.
10512 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10513 Fix linker invocation.
10514 (flagstest_o_specialfile_and_compress_debug_sections):
10515 Likewise.
10516 * testsuite/Makefile.in: Regenerated.
10517
deae2a14
DM
105182008-04-02 David S. Miller <davem@davemloft.net>
10519
10520 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10521 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10522
70752818
ILT
105232008-04-02 Craig Silverstein <csilvers@google.com>
10524
10525 * TODO: New file.
10526
39d0cb0e
ILT
105272008-04-02 Ian Lance Taylor <iant@google.com>
10528
10529 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10530 parameters. Update for new key type to views_. Change all
10531 callers.
10532 (File_read::read): Adjust for byteshift in returned view.
10533 (File_read::add_view): New function, broken out of
10534 find_and_make_view.
10535 (File_read::make_view): New function, broken out of
10536 find_and_make_view.
10537 (File_read::find_or_make_view): Add offset and aligned
10538 parameters. Rewrite accordingly. Change all callers.
10539 (File_read::get_view): Add offset and aligned parameters. Adjust
10540 for byteshift in return value.
10541 (File_read::get_lasting_view): Likewise.
10542 * fileread.h (class File_read): Update declarations.
10543 (class File_read::View): Add byteshift_ field. Add byteshift to
10544 constructor. Add byteshift method.
10545 * archive.h (Archive::clear_uncached_views): New function.
10546 (Archive::get_view): Add aligned parameter. Change all callers.
10547 * object.h (Object::get_view): Add aligned parameter. Change all
10548 callers.
10549 (Object::get_lasting_view): Likewise.
10550
10551 * fileread.cc (File_read::release): Don't call clear_views if
10552 there are multiple objects.
10553 * fileread.h (File_read::clear_uncached_views): New function.
10554 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10555 on the archive.
10556
a1207466
CC
105572008-03-31 Cary Coutant <ccoutant@google.com>
10558
10559 Add thin archive support.
10560 * archive.cc (Archive::armagt): New const.
10561 (Archive::setup): Remove task parameter and calls to unlock.
10562 (Archive::unlock_nested_archives): New function.
10563 (Archive::read_header): Add nested_off parameter. Change
10564 all callers.
10565 (Archive::interpret_header): Likewise.
10566 (Archive::include_all_members): Change to handle thin
10567 archives.
10568 (Archive::include_member): Likewise.
10569 * archive.h (Archive::Archive): Add new parameters and
10570 initializers.
10571 (Archive::armagt): New const.
10572 (Archive::setup): Remove task parameter.
10573 (Archive::unlock_nested_archives): New function.
10574 (Archive::read_header): Add nested_off parameter.
10575 (Archive::interpret_header): Likewise.
10576 (Archive::Nested_archive_table): New typedef.
10577 (Archive::is_thin_archive_): New field.
10578 (Archive::nested_archives_): New field.
10579 (Archive::options_): New field.
10580 (Archive::dirpath_): New field.
10581 (Archive::task_): New field.
10582 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10583 for thin archives. Pass additional parameters to
10584 Archive::Archive. Unlock the archive file after calling
10585 Archive::setup.
cd536b21 10586
479f6503
ILT
105872008-03-29 Ian Lance Taylor <iant@google.com>
10588
686c8caf
ILT
10589 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10590 version symbol to be local.
10591 * testsuite/ver_test_4.sh: New file.
10592 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10593 (check_DATA): Add ver_test_4.syms.
10594 (ver_test_4.syms): New target.
10595 * testsuite/Makefile.in: Rebuild.
10596
ab794b6b
ILT
10597 * output.cc
10598 (Output_section::Input_section_sort_entry::has_priority): New
10599 function.
10600 (Output_section::Input_section_sort_entry::match_file_name): New
10601 function.
10602 (Output_section::Input_section_sort_entry::match_section_name):
10603 Remove.
10604 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10605 Remove.
10606 (Output_section::Input_section_sort_entry::match_section_file):
10607 Remove.
10608 (Output_section::Input_section_sort_compare::operator()): Rewrite
10609 using new Input_section_sort_entry functions. Sort crtbegin and
10610 crtend first. Sort sections with no priority before sections with
10611 a priority.
10612 * testsuite/initpri1.c (d3): Check j != 4.
10613 (cd5): New constructor/destructor function.
10614 (main): Check j != 2.
10615
479f6503
ILT
10616 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10617 new symbol when resolving, don't call set_is_default.
10618 * testsuite/ver_test_7.cc: New file.
10619 * testsuite/ver_test_7.sh: New file.
10620 * testsuite/Makefile.am (ver_test_7.so): New target.
10621 (ver_test_7.o): New target.
10622 (check_SCRIPTS): Add ver_test_7.sh.
10623 (check_DATA): Add ver_test_7.syms.
10624 (ver_test_7.syms): New target.
10625
2fd32231
ILT
106262008-03-28 Ian Lance Taylor <iant@google.com>
10627
10628 * layout.cc (Layout::layout): If we see an input section with a
10629 name that needs sorting, set the must_sort flag for the output
10630 section.
10631 (Layout::make_output_section): If the name of the output section
10632 indicates that it might require sorting, set the may_sort flag.
10633 * output.h (Output_section::may_sort_attached_input_sections): New
10634 function.
10635 (Output_section::set_may_sort_attached_input_sections): New
10636 function.
10637 (Output_section::must_sort_attached_input_sections): New
10638 function.
10639 (Output_section::set_must_sort_attached_input_sections): New
10640 function.
10641 (class Output_section): Declare Input_section_sort_entry. Define
10642 Input_section_sort_compare. Declare
10643 sort_attached_input_sections. Add new fields:
10644 may_sort_attached_input_sections_,
10645 must_sort_attached_input_sections_,
10646 attached_input_sections_are_sorted_.
10647 * output.cc (Output_section::Output_section): Initialize new
10648 fields.
10649 (Output_section::add_input_section): Add an entry to
10650 input_sections_ if may_sort or must_sort are true.
10651 (Output_section::set_final_data_size): Call
10652 sort_attached_input_sections if necessary.
10653 (Output_section::Input_section_sort_entry): Define new class.
10654 (Output_section::Input_section_sort_compare::operator()): New
10655 function.
10656 (Output_section::sort_attached_input_sections): New function.
10657 * configure.ac: Check whether the compiler supports constructor
10658 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
10659 * testsuite/initpri1.c: New file.
10660 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
10661 CONSTRUCTOR_PRIORITY.
10662 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
10663 (initpri1_LDFLAGS): New variable.
10664 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10665
18e6b24e
ILT
106662008-03-27 Ian Lance Taylor <iant@google.com>
10667
49bdd526
ILT
10668 * common.cc (Sort_commons::operator): Correct sorting algorithm.
10669 * testsuite/common_test_1.c: New file.
10670 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
10671 (common_test_1_SOURCES): New variable.
10672 (common_test_1_DEPENDENCIES): New variable.
10673 (common_test_1_LDFLAGS): New variable.
10674
18e6b24e
ILT
10675 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
10676 and commons_ correctly when NAME/VERSION does not override
10677 NAME/NULL.
10678 * testsuite/ver_test_6.c: New file.
10679 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
10680 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
10681 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
10682
04bf7072
ILT
106832008-03-26 Ian Lance Taylor <iant@google.com>
10684
5871526f
ILT
10685 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
10686 of an undefined symbol from a version script.
10687 * testsuite/Makefile.am (ver_test_5.so): New target.
10688 (ver_test_5.o): New target.
10689 (check_SCRIPTS): Add ver_test_5.sh.
10690 (check_DATA): Add ver_test_5.syms.
10691 (ver_test_5.syms): New target.
10692 * testsuite/ver_test_5.cc: New file.
10693 * testsuite/ver_test_5.script: New file.
10694 * testsuite/ver_test_5.sh: New file.
10695 * Makefile.in, testsuite/Makefile.in: Rebuild.
10696
04bf7072
ILT
10697 PR gold/5986
10698 Fix problems building gold with gcc 4.3.0.
10699 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
10700 (gold_error_at_location, gold_warning_at_location): Use it.
10701 * configure.ac: Check whether we can compile and use a template
10702 function with a printf attribute.
10703 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
10704 when jumping over bytes.
10705 * object.cc: Instantiate Object::read_section_data.
10706 * debug.h: Include <cstring>
10707 * dwarf_reader.cc: Include <algorithm>
10708 * main.cc: Include <cstring>.
10709 * options.cc: Include <cstring>.
10710 * output.cc: Include <cstring>.
10711 * script.cc: Include <cstring>.
10712 * script.h: Include <string>.
10713 * symtab.cc: Include <cstring> and <algorithm>.
10714 * target-select.cc: Include <cstring>.
10715 * version.cc: Include <string>.
10716 * testsuite/testmain.cc: Include <cstdlib>.
10717 * configure, config.in: Rebuild.
10718
874c5b28
ILT
107192008-03-25 Ian Lance Taylor <iant@google.com>
10720
819d6c3a
ILT
10721 * options.cc: Include "../bfd/bfdver.h".
10722 (options::help): Print bug reporting address.
10723
f4b2c6f5
ILT
10724 * version.cc (print_version): Adjust output for current value of
10725 BFD_VERSION_STRING.
10726
10727 * NEWS: New file.
10728
e96caa79
ILT
10729 * options.cc (options::help): Print list of supported targets.
10730 * target-select.h: Include <vector>.
10731 (class Target_selector): Make machine_, size_, and is_big_endian_
10732 fields const. Add bfd_name_ and instantiated_target_ fields.
10733 (Target_selector::Target_selector): Add bfd_name parameter.
10734 (Target_selector::recognize): Make non-virtual, call
10735 do_recognize.
10736 (Target_selector::recognize_by_name): Make non-virtual, call
10737 do_recognize_by_name.
10738 (Target_selector::supported_names): New function.
10739 (Target_selector::bfd_name): New function.
10740 (Target_selector::do_instantiate_target): New pure virtual
10741 function.
10742 (Target_selector::do_recognize): New virtual function.
10743 (Target_selector::do_recognize_by_name): New virtual function.
10744 (Target_selector::instantiate_target): New private function.
10745 (supported_target_names): Declare.
10746 * target-select.cc (Target_selector::Target_selector): Update for
10747 new parameter and fields.
10748 (select_target_by_name): Check that the name matches before
10749 calling recognize_by_name.
10750 (supported_target_names): New function.
10751 * i386.cc (class Target_selector_i386): Update Target_selector
10752 constructor call. Remove recognize and recognize_by_name. Add
10753 do_instantiate_target.
10754 * x86_64.cc (class Target_selector_x86_64): Likewise.
10755 * testsuite/testfile.cc (class Target_selector_test): Update for
10756 changes to Target_selector.
10757
874c5b28
ILT
10758 * README: Rewrite, with some notes on unsupported features.
10759
0a65a3a7
CC
107602008-03-24 Cary Coutant <ccoutant@google.com>
10761
10762 * i386.cc (Target_i386::Got_type): New enum declaration.
10763 (Target_i386::Scan::local): Updated callers of Output_data_got
10764 member functions.
10765 (Target_i386::Scan::global): Likewise.
10766 (Target_i386::Relocate::relocate): Likewise.
10767 (Target_i386::Relocate::relocate_tls): Likewise.
10768 * object.h (Got_offset_list): New class.
10769 (Sized_relobj::local_has_got_offset): Added got_type parameter.
10770 (Sized_relobj::local_got_offset): Likewise.
10771 (Sized_relobj::set_local_got_offset): Likewise.
10772 (Sized_relobj::local_has_tls_got_offset): Removed.
10773 (Sized_relobj::local_tls_got_offset): Removed.
10774 (Sized_relobj::set_local_tls_got_offset): Removed.
10775 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
10776 * output.cc (Output_data_got::add_global): Added got_type parameter.
10777 (Output_data_got::add_global_with_rel): Likewise.
10778 (Output_data_got::add_global_with_rela): Likewise.
10779 (Output_data_got::add_global_pair_with_rel): New function.
10780 (Output_data_got::add_global_pair_with_rela): New function.
10781 (Output_data_got::add_local): Added got_type parameter.
10782 (Output_data_got::add_local_with_rel): Likewise.
10783 (Output_data_got::add_local_with_rela): Likewise.
10784 (Output_data_got::add_local_pair_with_rel): New function.
10785 (Output_data_got::add_local_pair_with_rela): New function.
10786 (Output_data_got::add_global_tls): Removed.
10787 (Output_data_got::add_global_tls_with_rel): Removed.
10788 (Output_data_got::add_global_tls_with_rela): Removed.
10789 (Output_data_got::add_local_tls): Removed.
10790 (Output_data_got::add_local_tls_with_rel): Removed.
10791 (Output_data_got::add_local_tls_with_rela): Removed.
10792 * output.h (Output_data_got::add_global): Added got_type parameter.
10793 (Output_data_got::add_global_with_rel): Likewise.
10794 (Output_data_got::add_global_with_rela): Likewise.
10795 (Output_data_got::add_global_pair_with_rel): New function.
10796 (Output_data_got::add_global_pair_with_rela): New function.
10797 (Output_data_got::add_local): Added got_type parameter.
10798 (Output_data_got::add_local_with_rel): Likewise.
10799 (Output_data_got::add_local_with_rela): Likewise.
10800 (Output_data_got::add_local_pair_with_rel): New function.
10801 (Output_data_got::add_local_pair_with_rela): New function.
10802 (Output_data_got::add_global_tls): Removed.
10803 (Output_data_got::add_global_tls_with_rel): Removed.
10804 (Output_data_got::add_global_tls_with_rela): Removed.
10805 (Output_data_got::add_local_tls): Removed.
10806 (Output_data_got::add_local_tls_with_rel): Removed.
10807 (Output_data_got::add_local_tls_with_rela): Removed.
10808 * resolve.cc (Symbol::override_base_with_special): Removed
10809 reference to has_got_offset_ field.
10810 * symtab.cc (Symbol::init_fields): Replaced initialization
10811 of got_offset_ with got_offsets_. Removed initialization
10812 of has_got_offset_
53fcba31 10813 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
10814 (Symbol::got_offset): Likewise.
10815 (Symbol::set_got_offset): Likewise.
10816 (Symbol::has_tls_got_offset): Removed.
10817 (Symbol::tls_got_offset): Removed.
10818 (Symbol::set_tls_got_offset): Removed.
10819 (Symbol::got_offset_): Removed.
10820 (Symbol::tls_mod_got_offset_): Removed.
10821 (Symbol::tls_pair_got_offset_): Removed.
10822 (Symbol::got_offsets_): New field.
10823 (Symbol::has_got_offset): Removed.
10824 (Symbol::has_tls_mod_got_offset): Removed.
10825 (Symbol::has_tls_pair_got_offset): Removed.
10826 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
10827 (Target_x86_64::Scan::local): Updated callers of Output_data_got
10828 member functions.
10829 (Target_x86_64::Scan::global): Likewise.
10830 (Target_x86_64::Relocate::relocate): Likewise.
10831 (Target_x86_64::Relocate::relocate_tls): Likewise.
10832
bd52eafb
BE
108332008-03-25 Ben Elliston <bje@au.ibm.com>
10834
10835 * yyscript.y: Fix spelling error in comment.
10836
8b105e34
ILT
108372008-03-24 Ian Lance Taylor <iant@google.com>
10838
8ed814a9
ILT
10839 * options.h (class General_options): Define build_id option.
10840 * layout.h (class Layout): Declare write_build_id, create_note,
10841 create_build_id. Add build_id_note_ member.
10842 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
10843 "libiberty.h", "md5.h", "sha1.h".
10844 (Layout::Layout): Initialize eh_frame_data_,
10845 eh_frame_hdr_section_, and build_id_note_.
10846 (Layout::finalize): Call create_build_id.
10847 (Layout::create_note): New function, broken out of
10848 Layout::create_gold_note.
10849 (Layout::create_gold_note): Call create_note.
10850 (Layout::create_build_id): New function.
10851 (Layout::write_build_id): New function.
10852 (Close_task_runner::run): Call write_build_id.
10853
8b105e34
ILT
10854 * x86_64.cc: Correct license to GPLv3.
10855
086a1841
ILT
108562008-03-23 Ian Lance Taylor <iant@google.com>
10857
10858 * options.cc: Include "demangle.h".
10859 (parse_optional_string): New function.
10860 (parse_long_option): Handle takes_optional_argument.
10861 (parse_short_option): Update dash_z initializer. Handle
10862 takes_optional_argument.
10863 (General_options::General_options): Initialize do_demangle_.
10864 (General_options::finalize): Set do_demangle_. Handle demangling
10865 style.
10866 * options.h (parse_optional_string): Declare.
10867 (struct One_option): Add optional_arg field. Update constructor.
10868 Update call constructor calls. Add takes_optional_argument
10869 function.
10870 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
10871 (DEFINE_optional_string): Define.
10872 (General_options::demangle): Change from DEFINE_bool to
10873 DEFINE_optional_string.
10874 (General_options::no_demangle): New function.
10875 (General_options::do_demangle): New function.
10876 (General_options::set_do_demangle): New function.
10877 (General_options::execstack_status_): Move definition to end of
10878 class definition.
10879 (General_options::static_): Likewise.
10880 (General_options::do_demangle_): New field.
10881 * object.cc (big_endian>::get_symbol_location_info): Call
10882 Options::do_demangle, not Options::demangle.
10883 * symtab.cc (demangle): Likewise.
10884
cbb93e63
ILT
108852008-03-22 Ian Lance Taylor <iant@google.com>
10886
10887 * gold.h: Include <cstddef> and <sys/types.h>
10888 * options.h: Include <cstring>.
10889
ec531623
ILT
108902008-03-21 Ian Lance Taylor <iant@google.com>
10891
10892 * Added source code to GNU binutils.
This page took 0.626249 seconds and 4 git commands to generate.