daily update
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
57eb9b50
DK
12011-06-27 Doug Kwan <dougkwan@google.com>
2
3 * arm.cc (Arm_relocate_functions::thm_jump8,
4 Arm_relocate_functions::thm_jump11): Use a wider signed
5 type to compute offset.
6 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
7 arm_thm_jump8.
8 * testsuite/Makefile.in: Regenerate.
9 * testsuite/arm_branch_in_range.sh: Check test results of
10 arm_thm_jump11 and arm_thm_jump8.
11 * testsuite/arm_thm_jump11.s: New test source file.
12 * testsuite/arm_thm_jump11.t: New linker script.
13 * testsuite/arm_thm_jump8.s: New test source file.
14 * testsuite/arm_thm_jump8.t: New linker script.
15
487b39df
ILT
162011-06-24 Ian Lance Taylor <iant@google.com>
17
18 * layout.cc: Include "object.h".
19 (ctors_sections_in_init_array): New static variable.
20 (Layout::is_ctors_in_init_array): New function.
21 (Layout::layout): Add entry to ctors_sections_in_init_array if
22 appropriate.
23 * layout.h (class Layout): Declare is_ctors_in_init_array.
24 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
25 is_ctors_reverse_view is set.
26 (Sized_relobj_file::write_sections): Add layout parameter. Change
27 all callers. Set is_ctors_reverse_view field of View_size.
28 (Sized_relobj_file::reverse_words): New function.
29 * object.h (Sized_relobj_file::View_size): Add
30 is_ctors_reverse_view field.
31 (class Sized_relobj_file): Update declarations.
32 * testsuite/initpri3.c: New test.
33 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
34 initpri3b.
35 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
36 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
37 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
38 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
39 * testsuite/Makefile.in: Rebuild.
40
472076e4
CC
412011-06-24 Cary Coutant <ccoutant@google.com>
42
43 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
44 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
45 (debug_msg_cdebug.err): New targets.
46 * testsuite/Makefile.in: Regenerate.
47 * testsuite/debug_msg.sh: Check output of link with compressed debug.
48 Fix checks for link with shared library.
49
a60af0db
DK
502011-06-24 Doug Kwan <dougkwan@google.com>
51
52 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
53 skip empty text sections.
54 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
55
5393d741
ILT
562011-06-22 Ian Lance Taylor <iant@google.com>
57
58 PR gold/12910
59 * options.h (class General_options): Add --ctors-in-init-array.
60 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
61 friends as SHT_PROGBITS for merging sections.
62 (Layout::layout): Remove special handling of .init_array and
63 friends. Don't sort if doing relocatable link. Sort for .ctors
64 and .dtors if ctors_in_init_array.
65 (Layout::make_output_section): Force correct section types for
66 .init_array and friends. Don't sort if doing relocatable link,
67 Don't sort .ctors and .dtors if ctors_in_init_array.
68 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
69 (Layout::output_section_name): Add relobj parameter. Change all
70 callers. Handle .ctors. and .dtors. in code rather than table.
71 Handle .ctors and .dtors if ctors_in_init_array.
72 (Layout::match_file_name): New function, moved from output.cc.
73 * layout.h (class Layout): Update declarations.
74 * output.cc: Include "layout.h".
75 (Input_section_sort_entry::get_priority): New function.
76 (Input_section_sort_entry::match_file_name): Just call
77 Layout::match_file_name.
78 (Output_section::Input_section_sort_init_fini_compare::operator()):
79 Handle .ctors and .dtors. Sort by explicit priority rather than
80 by name.
81 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
82 * testsuite/initpri2.c: New test.
83 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
84 (check_PROGRAMS): Add initpri2.
85 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
86 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
87 * configure, testsuite/Makefile.in: Rebuild.
88
e1f74f98
ILT
892011-06-19 Ian Lance Taylor <iant@google.com>
90
91 PR gold/12880
92 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
93 .interp section to a PT_INTERP segment even if we have seen a
94 --dynamic-linker option. Don't do it if we have seen a PHDRS
95 clause in a linker script.
96 (Layout::finalize): Don't create a .interp section if we've
97 already create a PT_INTERP segment.
98 (Layout::create_interp): Always call choose_output_section (revert
99 patch of 2011-06-17). Don't create PT_INTERP segment.
100 * script-sections.cc
101 (Script_sections::create_note_and_tls_segments): Add a .interp
102 section to a PT_INTERP segment even if we have seen a
103 --dynamic-linker option.
104
766f91bb
ILT
1052011-06-18 Ian Lance Taylor <iant@google.com>
106
107 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
108 merely because a non-PT_LOAD segment has a dynamic reloc.
109
0d212c3a
ILT
1102011-06-18 Ian Lance Taylor <iant@google.com>
111
112 * layout.cc (Layout::finish_dynamic_section): Don't create
113 DT_FLAGS entry if not needed.
114
911a5072
ILT
1152011-06-18 Ian Lance Taylor <iant@google.com>
116
117 PR gold/12745
118 * layout.cc (Layout::layout_eh_frame): Correct handling of
119 writable .eh_frame section.
120
534b4e5f
ILT
1212011-06-17 Ian Lance Taylor <iant@google.com>
122
123 PR gold/12893
124 * resolve.cc (Symbol_table::resolve): Don't give an error if a
125 symbol is redefined with the exact same object and value.
126
10b4f102
ILT
1272011-06-17 Ian Lance Taylor <iant@google.com>
128
129 PR gold/12880
130 * layout.h (class Layout): Add interp_segment_ field.
131 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
132 (Layout::attach_allocated_section_to_segment): If making shared
133 library, put .interp section in PT_INTERP segment.
134 (Layout::finalize): Also call create_interp if -dynamic-linker
135 option was used.
136 (Layout::create_interp): Assert that there is no PT_INTERP
137 segment. If not using a SECTIONS clause, use make_output_section.
138 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
139 * script-sections.cc
140 (Script_sections::create_note_and_tls_segments): If making shared
141 library, put .interp section in PT_INTERP segment.
142
a29b0dad
ILT
1432011-06-17 Ian Lance Taylor <iant@google.com>
144
e588ea8d
ILT
145 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
146 when making a shared library.
147
1482011-06-17 Ian Lance Taylor <iant@google.com>
149
150 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
151 parameter. Change all callers. Don't issue warning about PC32
152 against locally defined symbol.
a29b0dad 153
9d3b0698
ILT
1542011-06-16 Ian Lance Taylor <iant@google.com>
155
156 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
157 occurs in same object.
158
85b0f90c
AM
1592011-06-14 Alan Modra <amodra@gmail.com>
160
161 * po/POTFILES.in: Regenerate.
162
a94907d9
ILT
1632011-06-09 Ian Lance Taylor <iant@google.com>
164
165 * script-sections.cc
166 (Orphan_output_section::set_section_addresses): For a relocatable
167 link set address to 0.
168
4fb3a1c3
CC
1692011-06-09 Cary Coutant <ccoutant@google.com>
170
171 PR gold/12804
172 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
173 used with --compress-debug-sections.
174 * gold/object.cc (Sized_relobj_file::do_layout): Report
175 uncompressed size of compressed input sections.
176
61220854
CC
1772011-06-08 Cary Coutant <ccoutant@google.com>
178
179 PR gold/12804
180 * testsuite/two_file_test_2_v1.cc: Change initialization of
181 v2 to keep it in .data.
182
e6455dfb
CC
1832011-06-07 Cary Coutant <ccoutant@google.com>
184
185 * common.cc (Symbol_table::do_allocate_commons_list): Call
186 gold_fallback.
187 * errors.cc (Errors::fatal): Adjust call to gold_exit.
188 (Errors::fallback): New function.
189 (gold_fallback): New function.
190 * errors.h (Errors::fallback): New function.
191 * gold.cc (gold_exit): Change status parameter to enum; adjust
192 all callers.
193 (queue_initial_tasks): Call gold_fallback.
194 * gold.h: Include cstdlib.
195 (Exit_status): New enum type.
196 (gold_exit): Change status parameter to enum.
197 (gold_fallback): New function.
198 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
199 (Layout::create_symtab_sections): Likewise.
200 (Layout::create_shdrs): Likewise.
201 * main.cc (main): Adjust call to gold_exit.
202 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
203 (Output_data_got::add_got_entry_pair): Likewise.
204 (Output_section::add_input_section): Likewise.
205 (Output_section::add_output_section_data): Likewise.
206 (Output_segment::set_section_list_addresses): Likewise.
207 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
208
fb0e076f
CC
2092011-06-07 Cary Coutant <ccoutant@google.com>
210
211 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
212 for incremental links.
213 * output.cc (Output_segment::set_section_list_addresses): Remove
214 FIXME and test for TLS or BSS.
215
a5ee4d5d
CC
2162011-06-07 Cary Coutant <ccoutant@google.com>
217
218 * testsuite/Makefile.am: Add incremental_copy_test,
219 incremental_common_test_1.
220 * testsuite/Makefile.in: Regenerate.
221 * testsuite/common_test_1_v1.c: New source file.
222 * testsuite/common_test_1_v2.c: New source file.
223 * testsuite/copy_test_v1.cc: New source file.
224
5146f448
CC
2252011-06-07 Cary Coutant <ccoutant@google.com>
226
227 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
228 update, allocate common from bss section's free list.
229 * incremental-dump.cc (dump_incremental_inputs): Print flag for
230 linker-defined symbols.
231 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
232 Skip GOT and PLT entries that are no longer referenced.
233 (Output_section_incremental_inputs::write_info_blocks): Mark
234 linker-defined symbols.
235 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
236 * output.cc (Output_section::allocate): New function.
237 * output.h (Output_section::allocate): New function.
238 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
239 linker-defined symbols.
240 (Symbol::override_base_with_special): Copy is_predefined_ flag.
241 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
242 (Symbol::init_base_output_data): Likewise.
243 (Symbol::init_base_output_segment): Likewise.
244 (Symbol::init_base_constant): Likewise.
245 (Sized_symbol::init_output_data): Likewise.
246 (Sized_symbol::init_output_segment): Likewise.
247 (Sized_symbol::init_constant): Likewise.
248 (Symbol_table::do_define_in_output_data): Likewise.
249 (Symbol_table::do_define_in_output_segment): Likewise.
250 (Symbol_table::do_define_as_constant): Likewise.
251 * symtab.h (Symbol::is_predefined): New function.
252 (Symbol::init_base_output_data): Add is_predefined parameter.
253 (Symbol::init_base_output_segment): Likewise.
254 (Symbol::init_base_constant): Likewise.
255 (Symbol::is_predefined_): New data member.
256 (Sized_symbol::init_output_data): Add is_predefined parameter.
257 (Sized_symbol::init_output_segment): Likewise.
258 (Sized_symbol::init_constant): Likewise.
259 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
260
26d3c67d
CC
2612011-06-07 Cary Coutant <ccoutant@google.com>
262
263 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
264 instead of emit_copy_reloc.
265 (Copy_relocs::emit_copy_reloc): Refactor.
266 (Copy_relocs::make_copy_reloc): New function.
267 (Copy_relocs::add_copy_reloc): Remove.
268 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
269 section.
270 (Copy_relocs::make_copy_reloc): New function.
271 (Copy_relocs::add_copy_reloc): Remove.
272 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
273 unchanged input files.
274 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
275 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
276 Reserve BSS space for COPY relocations.
277 (Sized_incremental_binary::do_emit_copy_relocs): New function.
278 (Output_section_incremental_inputs::write_info_blocks): Record
279 whether a symbol is copied from a shared object.
280 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
281 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
282 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
283 (Incremental_input_entry_reader::get_output_symbol_index): Add
284 is_copy parameter.
285 (Incremental_binary::emit_copy_relocs): New function.
286 (Incremental_binary::do_emit_copy_relocs): New function.
287 (Sized_incremental_binary::Sized_incremental_binary): Initialize
288 new data member.
289 (Sized_incremental_binary::add_copy_reloc): New function.
290 (Sized_incremental_binary::do_emit_copy_relocs): New function.
291 (Sized_incremental_binary::Copy_reloc): New struct.
292 (Sized_incremental_binary::Copy_relocs): New typedef.
293 (Sized_incremental_binary::copy_relocs_): New data member.
294 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
295 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
296 * target.h (Sized_target::emit_copy_reloc): New function.
297 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
298
7cdb37d9
CC
2992011-06-02 Cary Coutant <ccoutant@google.com>
300
301 PR gold/12163
302 * gold/archive.cc (Archive::Archive): Initialize new data member.
303 (Archive::include_all_members): Return if archive has already been
304 included.
305 * gold/archive.h (Archive::include_all_members_): New data member.
306
cc643b88
NC
3072011-06-02 Nick Clifton <nickc@redhat.com>
308
309 * dynobj.h: Fix spelling mistake in comment.
310 * output.cc: Likewise.
311
f62a3ca7
DK
3122011-05-31 Doug Kwan <dougkwan@google.com>
313 Asier Llano
314
315 PR gold/12826
cc643b88 316 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
317 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
318 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
319 redundant arm_exidx_test.so.
320 * testsuite/Makefile.in: Regenerate.
321 (check_SCRIPTS): Add pr12826.sh
322 (check_DATA): Add pr12826.stdout
323 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
324 * testsuite/pr12826.sh: New file.
325 * testsuite/pr12826_1.s: Ditto.
326 * testsuite/pr12826_1.s: Ditto.
327
8dbe1edc
ILT
3282011-05-30 Ian Lance Taylor <iant@google.com>
329
330 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
331 sections.
332
c49875be
ILT
3332011-05-29 Ian Lance Taylor <iant@google.com>
334
335 PR gold/12804
336 * testsuite/Makefile.am: Use different file name for two_file_test
337 temporary file for each incremental test.
338 * testsuite/Makefile.in: Rebuild.
339
69d53f7a
ILT
3402011-05-29 Ian Lance Taylor <iant@google.com>
341
342 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
343 binary input file is empty.
344
41d0ab5f
ILT
3452011-05-27 Ian Lance Taylor <iant@google.com>
346
347 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
348 (ver_test_9.so): Likewise.
349 * testsuite/Makefile.in: Rebuild.
350
89d8a36b
CC
3512011-05-26 Cary Coutant <ccoutant@google.com>
352
353 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
354 * incremental.cc (Incremental_inputs::report_input_section): Fix
355 comment, indentation.
356 (Incremental_inputs::report_comdat_group): New function.
357 (Output_section_incremental_inputs::set_final_data_size): Adjust size
358 of data for incremental input file entry.
359 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
360 group count, COMDAT group signatures.
361 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
362 an unchanged input file.
363 * incremental.h (Incremental_object_entry::Incremental_object_entry):
364 Initialize new data member.
365 (Incremental_object_entry::add_comdat_group): New function.
366 (Incremental_object_entry::get_comdat_group_count): New function.
367 (Incremental_object_entry::get_comdat_signature_key): New function.
368 (Incremental_object_entry::groups_): New data member.
369 (Incremental_inputs::report_comdat_group): New function.
370 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
371 data for incremental input file entry.
372 (Incremental_input_entry_reader::get_comdat_group_count): New function.
373 (Incremental_input_entry_reader::get_input_section): Adjust size of
374 data for incremental input file entry.
375 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
376 (Incremental_input_entry_reader::get_comdat_group_signature): New
377 function.
378 * object.cc (Sized_relobj::include_section_group): Report kept
379 COMDAT groups for incremental links.
380
1706a06f
ILT
3812011-05-24 David Meyer <pdox@google.com>
382
383 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
384 with name parameter. Add found_name parameter.
385 * fileread.cc (Input_file::find_file): Adjust code accordingly.
386 * dirsearch.h (class Dirsearch): Update declaration.
387
a10ae760
ILT
3882011-05-24 Ian Lance Taylor <iant@google.com>
389
390 * archive.cc (Library_base::should_include_member): Pull in object
391 from archive if it defines the entry symbol.
392 * parameters.cc (Parameters::entry): New function.
393 * parameters.h (class Parameters): Declare entry.
394 * output.h (class Output_file_header): Remove entry_ field.
395 * output.cc (Output_file_header::Output_file_header): Remove entry
396 parameter. Change all callers.
397 (Output_file_header::entry): Use parameters->entry.
398 * gold.cc (queue_middle_tasks): Likewise.
399 * plugin.cc (Plugin_hook::run): Likewise.
400
aa92d6ed
CC
4012011-05-24 Cary Coutant <ccoutant@google.com>
402
403 * gold.cc (queue_initial_tasks): Pass incremental base filename
404 to Output_file::open_base_file; don't print error message.
405 * incremental-dump.cc (main): Adjust call to
406 Output_file::open_for_modification.
407 * incremental-dump.cc (main): Likewise.
408 * incremental.cc (Incremental_inputs::report_command_line):
409 Ignore --incremental-base option when comparing command lines.
410 Ignore parameter when given as separate argument.
411 * options.h (class General_options): Add --incremental-base.
412 * output.cc (Output_file::Output_file):
413 (Output_file::open_base_file): Add base_name and writable parameters;
414 read base file into new file; print error message here.
415 (Output_file::map_no_anonymous): Add writable parameter; adjust all
416 callers.
417 * output.h (Output_file::open_for_modification): Rename to...
418 (Output_file::open_base_file): ...this; add base_name and
419 writable parameters; adjust all callers.
420 (Output_file::map_no_anonymous): Add writable parameter; adjust all
421 callers.
422 * testsuite/Makefile.am (incremental_test_4): Test
423 --incremental-base.
424 * testsuite/Makefile.in: Regenerate.
425
2eedd706
CC
4262011-05-24 Cary Coutant <ccoutant@google.com>
427
428 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
429 incremental_test_4.
430 * testsuite/Makefile.in: Regenerate.
431 * testsuite/two_file_test_1_v1.cc: New test source file.
432 * testsuite/two_file_test_1b_v1.cc: New test source file.
433 * testsuite/two_file_test_2_v1.cc: New test source file.
434
0f1c85a6
CC
4352011-05-24 Cary Coutant <ccoutant@google.com>
436
437 * dynobj.h (Dynobj::do_dynobj): New function.
438 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
439 flag and soname for shared objects.
440 * incremental.cc (Incremental_inputs::report_object): Make
441 either Incremental_object_entry or Incremental_dynobj_entry; add
442 soname to string table.
443 (Incremental_inputs::report_input_section): Add assertion.
444 (Output_section_incremental_inputs::set_final_data_size): Adjust
445 type of input file entry for shared libraries; adjust size of
446 shared library info entry.
447 (Output_section_incremental_inputs::write_input_files): Write
448 as_needed flag for shared libraries.
449 (Output_section_incremental_inputs::write_info_blocks): Adjust type
450 of input file entry for shared libraries; write soname.
451 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
452 soname from incremental info.
453 * incremental.h (enum Incremental_input_flags): Add
454 INCREMENTAL_INPUT_AS_NEEDED.
455 (Incremental_input_entry::Incremental_input_entry): Initialize new
456 data member.
457 (Incremental_input_entry::set_as_needed): New function.
458 (Incremental_input_entry::as_needed): New function.
459 (Incremental_input_entry::do_dynobj_entry): New function.
460 (Incremental_input_entry::as_needed_): New data member.
461 (Incremental_object_entry::Incremental_object_entry): Don't check
462 for shared library.
463 (Incremental_object_entry::do_type): Likewise.
464 (class Incremental_dynobj_entry): New class.
465 (Incremental_input_entry_reader::as_needed): New function.
466 (Incremental_input_entry_reader::get_soname): New function.
467 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
468 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
469 size of shared library info entry.
470 * layout.cc (Layout::finish_dynamic_section): Don't test for
471 incremental link when adding DT_NEEDED entries.
472 * object.h (Object::Object): Initialize new data member.
473 (Object::dynobj): New function.
474 (Object::set_as_needed): New function.
475 (Object::as_needed): New function.
476 (Object::do_dynobj): New function.
477 (Object::as_needed_): New data member.
478
6fa2a40b
CC
4792011-05-24 Cary Coutant <ccoutant@google.com>
480
481 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
482 info; adjust display of GOT entries.
483 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
484 vector of input objects; remove file_status_.
485 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
486 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
487 got_plt reader; call target hooks to reserve GOT entries.
488 (Output_section_incremental_inputs::set_final_data_size): Adjust size
489 of input file info header and GOT info entry.
490 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
491 relocation info.
492 (Got_plt_view_info::got_descriptor): Remove.
493 (Got_plt_view_info::sym_index): New data member.
494 (Got_plt_view_info::input_index): New data member.
495 (Local_got_offset_visitor::visit): Write input file index.
496 (Global_got_offset_visitor::visit): Write 0 for input file index.
497 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
498 with sym_index and input_index.
499 (Output_section_incremental_inputs::write_got_plt): Adjust size of
500 incremental info GOT entry; replace got_descriptor with input_index.
501 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
502 map from input file index to object.
503 (Sized_relobj_incr::do_layout): Replace direct data member reference
504 with accessor function.
505 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
506 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
507 Adjust size of input file info header.
508 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
509 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
510 (Incremental_input_entry_reader::get_input_section): Adjust size of
511 input file info header.
512 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
513 of incremental info GOT entry.
514 (Incremental_got_plt_reader::get_got_desc): Remove.
515 (Incremental_got_plt_reader::get_got_symndx): New function.
516 (Incremental_got_plt_reader::get_got_input_index): New function.
517 (Sized_incremental_binary::Sized_incremental_binary): Remove
518 file_status_; add input_objects_.
519 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
520 (Sized_incremental_binary::set_file_is_unchanged): Remove.
521 (Sized_incremental_binary::file_is_unchanged): Remove.
522 (Sized_incremental_binary::set_input_object): New function.
523 (Sized_incremental_binary::input_object): New function.
524 (Sized_incremental_binary::file_status_): Remove.
525 (Sized_incremental_binary::input_objects_): New data member.
526 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
527 references.
528 (Sized_relobj_incr::invalid_address): Move to base class.
529 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
530 class.
531 (Sized_relobj_incr::do_output_section_offset): Likewise.
532 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
533 (Sized_relobj_incr::section_offsets_): Likewise.
534 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
535 function.
536 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
537 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
538 with accessor function.
539 (Sized_relobj_file::do_layout): Likewise.
540 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
541 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
542 (Sized_relobj_file::compute_final_local_value): Replace refs to
543 section_offsets_ with accessor function.
544 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
545 * object.h (Relobj::Relobj): Initialize new data members.
546 (Relobj::add_dyn_reloc): New function.
547 (Relobj::first_dyn_reloc): New function.
548 (Relobj::dyn_reloc_count): New function.
549 (Relobj::first_dyn_reloc_): New data member.
550 (Relobj::dyn_reloc_count_): New data member.
551 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
552 references.
553 (Sized_relobj::Address): New typedef.
554 (Sized_relobj::invalid_address): Move here from child class.
555 (Sized_relobj::Sized_relobj): Initialize new data members.
556 (Sized_relobj::sized_relobj): New function.
557 (Sized_relobj::is_output_section_offset_invalid): Move here from
558 child class.
559 (Sized_relobj::get_output_section_offset): Likewise.
560 (Sized_relobj::local_has_got_offset): Likewise.
561 (Sized_relobj::local_got_offset): Likewise.
562 (Sized_relobj::set_local_got_offset): Likewise.
563 (Sized_relobj::do_for_all_local_got_entries): Likewise.
564 (Sized_relobj::clear_got_offsets): New function.
565 (Sized_relobj::section_offsets): Move here from child class.
566 (Sized_relobj::do_output_section_offset): Likewise.
567 (Sized_relobj::do_set_section_offset): Likewise.
568 (Sized_relobj::Local_got_offsets): Likewise.
569 (Sized_relobj::local_got_offsets_): Likewise.
570 (Sized_relobj::section_offsets_): Likewise.
571 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
572 references.
573 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
574 class.
575 (Sized_relobj_file::sized_relobj): New function
576 (Sized_relobj_file::local_has_got_offset): Move to base class.
577 (Sized_relobj_file::local_got_offset): Likewise.
578 (Sized_relobj_file::set_local_got_offset): Likewise.
579 (Sized_relobj_file::get_output_section_offset): Likewise.
580 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
581 (Sized_relobj_file::do_output_section_offset): Likewise.
582 (Sized_relobj_file::do_set_section_offset): Likewise.
583 (Sized_relobj_file::Local_got_offsets): Likewise.
584 (Sized_relobj_file::local_got_offsets_): Likewise.
585 (Sized_relobj_file::section_offsets_): Likewise.
586 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
587 (all constructors).
588 (set_needs_dynsym_index): Convert relobj to derived class pointer.
589 (Output_reloc::get_symbol_index): Likewise.
590 (Output_reloc::local_section_offset): Likewise.
591 (Output_reloc::get_address): Likewise.
592 (Output_reloc::symbol_value): Likewise.
593 (Output_data_got::reserve_slot): Move to class definition.
594 (Output_data_got::reserve_local): New function.
595 (Output_data_got::reserve_slot_for_global): Remove.
596 (Output_data_got::reserve_global): New function.
597 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
598 (all constructors, two instantiations).
599 (Output_reloc::get_relobj): New function (two instantiations).
600 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
601 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
602 (Output_data_reloc::add_global): Adjust type of relobj.
603 (Output_data_reloc::add_global_relative): Likewise.
604 (Output_data_reloc::add_symbolless_global_addend): Likewise.
605 (Output_data_reloc::add_local): Likewise.
606 (Output_data_reloc::add_local_relative): Likewise.
607 (Output_data_reloc::add_symbolless_local_addend): Likewise.
608 (Output_data_reloc::add_local_section): Likewise.
609 (Output_data_reloc::add_output_section): Likewise.
610 (Output_data_reloc::add_absolute): Likewise.
611 (Output_data_reloc::add_target_specific): Likewise.
612 (Output_data_got::reserve_slot): Move definition here.
613 (Output_data_got::reserve_local): New function.
614 (Output_data_got::reserve_global): New function.
615 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
616 section_offsets_ with accessor function.
617 (Sized_relobj_file::write_sections): Likewise.
618 (Sized_relobj_file::do_relocate_sections): Likewise.
619 * target.h (Sized_target::reserve_local_got_entry): New function.
620 (Sized_target::reserve_global_got_entry): New function.
621 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
622 (Target_x86_64::reserve_global_got_entry): New function.
623 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
624
4829d394
CC
6252011-05-23 Cary Coutant <ccoutant@google.com>
626
627 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
628 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
629 bit when checking got_type.
630 * incremental.cc (Sized_incremental_binary::setup_readers):
631 Store symbol table and string table locations; initialize bit vector
632 of file status flags.
633 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
634 unchanged files.
635 (Sized_incremental_binary::do_process_got_plt): New function.
636 (Sized_incremental_binary::get_symtab_view): Use stored locations.
637 (Output_section_incremental_inputs::set_final_data_size): Record
638 file index for each input file.
639 (Output_section_incremental_inputs::write_got_plt): Store file index
640 instead of input entry offset for each GOT entry.
641 * incremental.h
642 (Incremental_input_entry::Incremental_input_entry): Initialize new
643 data member.
644 (Incremental_input_entry::set_offset): Store file index.
645 (Incremental_input_entry::get_file_index): New function.
646 (Incremental_input_entry::file_index_): New data member.
647 (Incremental_binary::process_got_plt): New function.
648 (Incremental_binary::do_process_got_plt): New function.
649 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
650 data members.
651 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
652 (Sized_incremental_binary::set_file_is_unchanged): New function.
653 (Sized_incremental_binary::file_is_unchanged): New function.
654 (Sized_incremental_binary::do_process_got_plt): New function.
655 (Sized_incremental_binary::file_status_): New data member.
656 (Sized_incremental_binary::main_symtab_loc_): New data member.
657 (Sized_incremental_binary::main_strtab_loc_): New data member.
658 * output.cc (Output_data_got::Got_entry::write): Add case
659 RESERVED_CODE.
660 (Output_data_got::add_global): Call add_got_entry.
661 (Output_data_got::add_global_plt): Likewise.
662 (Output_data_got::add_global_with_rel): Likewise.
663 (Output_data_got::add_global_with_rela): Likewise.
664 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
665 (Output_data_got::add_global_pair_with_rela): Likewise.
666 (Output_data_got::add_local): Call add_got_entry.
667 (Output_data_got::add_local_plt): Likewise.
668 (Output_data_got::add_local_with_rel): Likewise.
669 (Output_data_got::add_local_with_rela): Likewise.
670 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
671 (Output_data_got::add_local_pair_with_rela): Likewise.
672 (Output_data_got::reserve_slot): New function.
673 (Output_data_got::reserve_slot_for_global): New function.
674 (Output_data_got::add_got_entry): New function.
675 (Output_data_got::add_got_entry_pair): New function.
676 (Output_section::add_output_section_data): Edit FIXME.
677 * output.h
678 (Output_section_data_build::Output_section_data_build): New
679 constructor with size parameter.
680 (Output_data_space::Output_data_space): Likewise.
681 (Output_data_got::Output_data_got): Initialize new data member; new
682 constructor with size parameter.
683 (Output_data_got::add_constant): Call add_got_entry.
684 (Output_data_got::reserve_slot): New function.
685 (Output_data_got::reserve_slot_for_global): New function.
686 (class Output_data_got::Got_entry): Add RESERVED_CODE.
687 (Output_data_got::add_got_entry): New function.
688 (Output_data_got::add_got_entry_pair): New function.
689 (Output_data_got::free_list_): New data member.
690 * target.h (Sized_target::init_got_plt_for_update): New function.
691 (Sized_target::register_global_plt_entry): New function.
692 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
693 Initialize new data member; call init; add constructor with PLT count.
694 (Output_data_plt_x86_64::init): New function.
695 (Output_data_plt_x86_64::add_relocation): New function.
696 (Output_data_plt_x86_64::reserve_slot): New function.
697 (Output_data_plt_x86_64::free_list_): New data member.
698 (Target_x86_64::init_got_plt_for_update): New function.
699 (Target_x86_64::register_global_plt_entry): New function.
700 (Output_data_plt_x86_64::add_entry): Allocate from free list for
701 incremental updates.
702 (Output_data_plt_x86_64::add_relocation): New function.
703 * testsuite/object_unittest.cc (Object_test): Set default options.
704
ec69d6da
ILT
7052011-05-16 Ian Lance Taylor <iant@google.com>
706
707 * options.h (class General_options): Make -i a synonym for -r.
708
732e31de
ILT
7092011-05-16 Ian Lance Taylor <iant@google.com>
710
711 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
712
403676b5
CC
7132011-05-10 Cary Coutant <ccoutant@google.com>
714
715 * object.cc (Sized_relobj::do_count_local_symbols): Check for
716 strip_all (-s).
717
5b7b7d6e
ILT
7182011-05-06 Ian Lance Taylor <iant@google.com>
719
720 * layout.cc (Layout::layout): If the output section flags change,
721 update the ordering.
722
f0f9babf
CC
7232011-04-25 Cary Coutant <ccoutant@google.com>
724
725 * incremental-dump.cc (dump_incremental_inputs): Print local
726 symbol info for each input file.
727 * incremental.cc
728 (Output_section_incremental_inputs::set_final_data_size): Add local
729 symbol info to input file entries in incremental info.
730 (Output_section_incremental_inputs::write_info_blocks): Likewise.
731 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
732 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
733 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
734 implementation.
735 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
736 (Sized_incr_relobj::do_relocate): Write the local symbols.
737 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
738 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
739 Adjust size of input file header.
740 (Incremental_inputs_reader::get_local_symbol_offset): New function.
741 (Incremental_inputs_reader::get_local_symbol_count): New function.
742 (Incremental_inputs_reader::get_input_section): Adjust size of input
743 file header.
744 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
745 (Sized_incr_relobj::This): New typedef.
746 (Sized_incr_relobj::sym_size): New const data member.
747 (Sized_incr_relobj::Local_symbol): New struct.
748 (Sized_incr_relobj::do_output_local_symbol_count): New function.
749 (Sized_incr_relobj::do_local_symbol_offset): New function.
750 (Sized_incr_relobj::local_symbol_count_): New data member.
751 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
752 (Sized_incr_relobj::local_symbol_index_): New data member.
753 (Sized_incr_relobj::local_symbol_offset_): New data member.
754 (Sized_incr_relobj::local_dynsym_offset_): New data member.
755 (Sized_incr_relobj::local_symbols_): New data member.
756 * object.h (Relobj::output_local_symbol_count): New function.
757 (Relobj::local_symbol_offset): New function.
758 (Relobj::do_output_local_symbol_count): New function.
759 (Relobj::do_local_symbol_offset): New function.
760 (Sized_relobj::do_output_local_symbol_count): New function.
761 (Sized_relobj::do_local_symbol_offset): New function.
762
d0a9ace3
ILT
7632011-04-22 Vladimir Simonov <sv@sw.ru>
764
765 * descriptors.cc (set_close_on_exec): New function.
766 (Descriptors::open): Use set_close_on_exec.
767 * output.cc (S_ISLNK): Define if not defined.
768
94a3fc8b
CC
7692011-04-22 Cary Coutant <ccoutant@google.com>
770
771 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
772 global symbol map.
773 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
774 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
775 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
776 relocations.
777 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
778 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
779 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
780 * incremental.h
781 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
782 function.
783 (Incremental_binary::apply_incremental_relocs): New function.
784 (Incremental_binary::do_apply_incremental_relocs): New function.
785 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
786 data member.
787 (Sized_incremental_binary::add_global_symbol): New function.
788 (Sized_incremental_binary::global_symbol): New function.
789 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
790 (Sized_incremental_binary::symbol_map_): New data member.
791 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
792 * target.h (Sized_target::apply_relocation): New function.
793 * target-reloc.h (apply_relocation): New function.
794 * x86_64.cc (Target_x86_64::apply_relocation): New function.
795
c87e4302
DK
7962011-04-22 Doug Kwan <dougkwan@google.com>
797
798 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
799 flag of a SHT_ARM_EXIDX section.
800 * testsuite/Makefile.am (arm_exidx_test): New test rules.
801 * testsuite/Makefile.in: Regenerate.
802 * testsuite/arm_exidx_test.s: New file.
803 * testsuite/arm_exidx_test.sh: Same.
804
e7782cf6
CC
8052011-04-20 Cary Coutant <ccoutant@google.com>
806
807 PR gold/12689
808 * archive.h (Incremental_archive_entry::Archive_member):
809 Initialize arg_serial_ (second constructor).
810
308ecdc7
ILT
8112011-04-17 Ian Lance Taylor <iant@google.com>
812
813 * object.cc (Relocate_info::location): Simplify location string.
814 * errors.cc (Errors::error_at_location): Don't print program
815 name.
816 (Errors::warning_at_location): Likewise.
817 (Errors::undefined_symbol): Likewise.
818 * testsuite/debug_msg.sh: Update accordingly.
819
bec5b579
CC
8202011-04-14 Cary Coutant <ccoutant@google.com>
821
822 * gold/layout.cc (Layout::symtab_section_offset): New function.
823 * gold/layout.h (Layout::symtab_section_offset): New function.
824 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
825
88597d34
ILT
8262011-04-12 Ian Lance Taylor <iant@google.com>
827
828 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
829 with MREMAP_MAYMOVE.
830 * output.h (class Output_file): Add map_is_allocated_ field.
831 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
832 not available, provide stubs. If mremap is not available, #define
833 it to gold_mremap.
834 (MREMAP_MAYMOVE): Define if not defined.
835 (Output_file::Output_file): Initialize map_is_allocated_.
836 (Output_file::resize): Check map_is_allocated_.
837 (Output_file::map_anonymous): If mmap fails, use malloc.
838 (Output_file::unmap): Don't do anything for an anonymous map.
839 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
840 is not available, provide stubs.
841 (File_read::View::~View): Use free rather than delete[].
842 (File_read::make_view): Use malloc rather than new[]. If mmap
843 fails, use malloc.
844 (File_read::find_or_make_view): Use malloc rather than new[].
845 * gold.h: Remove HAVE_REMAP code.
846 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
847 exists. Rename mremap to gold_mremap. If mmap is not available
848 don't do anything.
849 * configure, config.in: Rebuild.
850
11e361bc
ILT
8512011-04-11 Ian Lance Taylor <iant@google.com>
852
853 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
854 initialize local variable v.
855
cdc29364
CC
8562011-04-11 Cary Coutant <ccoutant@google.com>
857
858 * archive.cc (Archive::include_member): Adjust call to
859 report_object.
860 (Add_archive_symbols::run): Track argument serial numbers.
861 (Lib_group::include_member): Likewise.
862 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
863 * archive.h (Incremental_archive_entry::Archive_member):
864 Initialize arg_serial_.
865 (Archive_member::arg_serial_): New data member.
866 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
867 (Sized_dynobj::do_add_symbols): Track symbols when doing an
868 incremental link.
869 (Sized_dynobj::do_for_all_local_got_entries): New function.
870 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
871 function.
872 * fileread.cc (get_mtime): New function.
873 * fileread.h (get_mtime): New function.
874 * gold.cc (queue_initial_tasks): Check for incremental update.
875 (process_incremental_input): New function.
876 (queue_middle_tasks): Don't force valid target for incremental
877 update.
878 * incremental-dump.cc (find_input_containing_global): Adjust
879 size of symbol info entry.
880 (dump_incremental_inputs): Dump argument serial number and
881 in_system_directory flag; bias shndx by 1; print symbol names
882 when dumping per-file symbol lists; use new symbol info readers.
883 * incremental.cc
884 (Output_section_incremental_inputs:update_data_size): New function.
885 (Sized_incremental_binary::setup_readers): Setup input readers
886 for each input file; build maps for files added from libraries
887 and scripts.
888 (Sized_incremental_binary::check_input_args): New function.
889 (Sized_incremental_binary::do_check_inputs): Build map of argument
890 serial numbers to input arguments.
891 (Sized_incremental_binary::do_file_has_changed): Rename
892 do_file_is_unchanged to this; compare file modification times.
893 (Sized_incremental_binary::do_init_layout): New function.
894 (Sized_incremental_binary::do_reserve_layout): New function.
895 (Sized_incremental_binary::do_get_input_reader): Remove.
896 (Sized_incremental_binary::get_symtab_view): New function.
897 (Incremental_checker::can_incrementally_link_output_file): Remove.
898 (Incremental_inputs::report_command_line): Exclude --debug options.
899 (Incremental_inputs::report_archive_begin): Add parameter; track
900 argument serial numbers; don't put input file entry for archive
901 before archive members.
902 (Incremental_inputs::report_archive_end): Put input file entry
903 for archive after archive members.
904 (Incremental_inputs::report_object): Add parameter; track argument
905 serial numbers and in_system_directory flag.
906 (Incremental_inputs::report_script): Add parameter; track argument
907 serial numbers.
908 (Output_section_incremental_inputs::set_final_data_size): Adjust
909 size of symbol info entry; check for forwarding symbols.
910 (Output_section_incremental_inputs::write_input_files): Write
911 in_system_directory flag and argument serial number.
912 (Output_section_incremental_inputs::write_info_blocks): Map section
913 indices between incremental info and original input file; store
914 input section index for each symbol.
915 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
916 change operator() to visit().
917 (class Global_got_offset_visitor): Likewise.
918 (class Global_symbol_visitor_got_plt):
919 (Output_section_incremental_inputs::write_got_plt): Use new visitor
920 classes.
921 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
922 (Sized_incr_relobj::do_read_symbols): New function.
923 (Sized_incr_relobj::do_layout): New function.
924 (Sized_incr_relobj::do_layout_deferred_sections): New function.
925 (Sized_incr_relobj::do_add_symbols): New function.
926 (Sized_incr_relobj::do_should_include_member): New function.
927 (Sized_incr_relobj::do_for_all_global_symbols): New function.
928 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
929 (Sized_incr_relobj::do_section_size): New function.
930 (Sized_incr_relobj::do_section_name): New function.
931 (Sized_incr_relobj::do_section_contents): New function.
932 (Sized_incr_relobj::do_section_flags): New function.
933 (Sized_incr_relobj::do_section_entsize): New function.
934 (Sized_incr_relobj::do_section_address): New function.
935 (Sized_incr_relobj::do_section_type): New function.
936 (Sized_incr_relobj::do_section_link): New function.
937 (Sized_incr_relobj::do_section_info): New function.
938 (Sized_incr_relobj::do_section_addralign): New function.
939 (Sized_incr_relobj::do_initialize_xindex): New function.
940 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
941 (Sized_incr_relobj::do_read_relocs): New function.
942 (Sized_incr_relobj::do_gc_process_relocs): New function.
943 (Sized_incr_relobj::do_scan_relocs): New function.
944 (Sized_incr_relobj::do_count_local_symbols): New function.
945 (Sized_incr_relobj::do_finalize_local_symbols): New function.
946 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
947 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
948 (Sized_incr_relobj::do_relocate): New function.
949 (Sized_incr_relobj::do_set_section_offset): New function.
950 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
951 (Sized_incr_dynobj::do_read_symbols): New function.
952 (Sized_incr_dynobj::do_layout): New function.
953 (Sized_incr_dynobj::do_add_symbols): New function.
954 (Sized_incr_dynobj::do_should_include_member): New function.
955 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
956 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
957 (Sized_incr_dynobj::do_section_size): New function.
958 (Sized_incr_dynobj::do_section_name): New function.
959 (Sized_incr_dynobj::do_section_contents): New function.
960 (Sized_incr_dynobj::do_section_flags): New function.
961 (Sized_incr_dynobj::do_section_entsize): New function.
962 (Sized_incr_dynobj::do_section_address): New function.
963 (Sized_incr_dynobj::do_section_type): New function.
964 (Sized_incr_dynobj::do_section_link): New function.
965 (Sized_incr_dynobj::do_section_info): New function.
966 (Sized_incr_dynobj::do_section_addralign): New function.
967 (Sized_incr_dynobj::do_initialize_xindex): New function.
968 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
969 (make_sized_incremental_object): New function.
970 (Incremental_library::copy_unused_symbols): New function.
971 (Incremental_library::do_for_all_unused_symbols): New function.
972 * incremental.h (enum Incremental_input_flags): New type.
973 (class Incremental_checker): Remove.
974 (Incremental_input_entry::Incremental_input_entry): Add argument
975 serial number.
976 (Incremental_input_entry::arg_serial): New function.
977 (Incremental_input_entry::set_is_in_system_directory): New function.
978 (Incremental_input_entry::is_in_system_directory): New function.
979 (Incremental_input_entry::arg_serial_): New data member.
980 (Incremental_input_entry::is_in_system_directory_): New data member.
981 (class Script_info): Move here from script.h.
982 (Script_info::Script_info): Add filename parameter.
983 (Script_info::filename): New function.
984 (Script_info::filename_): New data member.
985 (Incremental_script_entry::Incremental_script_entry): Add argument
986 serial number.
987 (Incremental_object_entry::Incremental_object_entry): Likewise.
988 (Incremental_object_entry::add_input_section): Build list of input
989 sections with map to original shndx.
990 (Incremental_object_entry::get_input_section_index): New function.
991 (Incremental_object_entry::shndx_): New data member.
992 (Incremental_object_entry::name_key_): Rename; adjust all refs.
993 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
994 (Incremental_archive_entry::Incremental_archive_entry): Add argument
995 serial number.
996 (Incremental_inputs::report_archive_begin): Likewise.
997 (Incremental_inputs::report_object): Likewise.
998 (Incremental_inputs::report_script): Likewise.
999 (class Incremental_global_symbol_reader): New class.
1000 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1001 and store flags and input file type.
1002 (Incremental_input_entry_reader::arg_serial): New function.
1003 (Incremental_input_entry_reader::type): Extract type from flags.
1004 (Incremental_input_entry_reader::is_in_system_directory): New function.
1005 (Incremental_input_entry_reader::get_input_section_count): Call
1006 accessor function for type.
1007 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1008 function for type; adjust size of global symbol entry.
1009 (Incremental_input_entry_reader::get_global_symbol_count): Call
1010 accessor function for type.
1011 (Incremental_input_entry_reader::get_object_count): Likewise.
1012 (Incremental_input_entry_reader::get_object_offset): Likewise.
1013 (Incremental_input_entry_reader::get_member_count): Likewise.
1014 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1015 (Incremental_input_entry_reader::get_member_offset): Likewise.
1016 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1017 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1018 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1019 (Incremental_input_entry_reader::get_global_symbol_reader): New
1020 function.
1021 (Incremental_input_entry_reader::get_output_symbol_index): New
1022 function.
1023 (Incremental_input_entry_reader::type_): Remove.
1024 (Incremental_input_entry_reader::flags_): New data member.
1025 (Incremental_inputs_reader::input_file_offset): New function.
1026 (Incremental_inputs_reader::input_file_index): New function.
1027 (Incremental_inputs_reader::input_file): Call input_file_offset.
1028 (Incremental_inputs_reader::input_file_at_offset): New function.
1029 (Incremental_relocs_reader::get_r_type): Reformat.
1030 (Incremental_relocs_reader::get_r_shndx): Reformat.
1031 (Incremental_relocs_reader::get_r_offset): Reformat.
1032 (Incremental_relocs_reader::data): New function.
1033 (Incremental_binary::Incremental_binary): Initialize new data members.
1034 (Incremental_binary::check_inputs): Add cmdline parameter.
1035 (Incremental_binary::file_is_unchanged): Remove.
1036 (Input_reader::arg_serial): New function.
1037 (Input_reader::get_unused_symbol_count): New function.
1038 (Input_reader::get_unused_symbol): New function.
1039 (Input_reader::do_arg_serial): New function.
1040 (Input_reader::do_get_unused_symbol_count): New function.
1041 (Input_reader::do_get_unused_symbol): New function.
1042 (Incremental_binary::input_file_count): New function.
1043 (Incremental_binary::get_input_reader): Change signature to use
1044 index instead of filename.
1045 (Incremental_binary::file_has_changed): New function.
1046 (Incremental_binary::get_input_argument): New function.
1047 (Incremental_binary::get_library): New function.
1048 (Incremental_binary::get_script_info): New function.
1049 (Incremental_binary::init_layout): New function.
1050 (Incremental_binary::reserve_layout): New function.
1051 (Incremental_binary::output_file): New function.
1052 (Incremental_binary::do_check_inputs): New function.
1053 (Incremental_binary::do_file_is_unchanged): Remove.
1054 (Incremental_binary::do_file_has_changed): New function.
1055 (Incremental_binary::do_init_layout): New function.
1056 (Incremental_binary::do_reserve_layout): New function.
1057 (Incremental_binary::do_input_file_count): New function.
1058 (Incremental_binary::do_get_input_reader): Change signature.
1059 (Incremental_binary::input_args_map_): New data member.
1060 (Incremental_binary::library_map_): New data member.
1061 (Incremental_binary::script_map_): New data member.
1062 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1063 new data members.
1064 (Sized_incremental_binary::output_section): New function.
1065 (Sized_incremental_binary::inputs_reader): Add const.
1066 (Sized_incremental_binary::symtab_reader): Add const.
1067 (Sized_incremental_binary::relocs_reader): Add const.
1068 (Sized_incremental_binary::got_plt_reader): Add const.
1069 (Sized_incremental_binary::get_symtab_view): New function.
1070 (Sized_incremental_binary::Inputs_reader): New typedef.
1071 (Sized_incremental_binary::Input_entry_reader): New typedef.
1072 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1073 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1074 (Sized_incremental_binary::do_file_has_changed): New function.
1075 (Sized_incremental_binary::do_init_layout): New function.
1076 (Sized_incremental_binary::do_reserve_layout): New function.
1077 (Sized_input_reader::Inputs_reader): Remove.
1078 (Sized_input_reader::Input_entry_reader): Remove.
1079 (Sized_input_reader::do_arg_serial): New function.
1080 (Sized_input_reader::do_get_unused_symbol_count): New function.
1081 (Sized_input_reader::do_get_unused_symbol): New function.
1082 (Sized_incremental_binary::do_input_file_count): New function.
1083 (Sized_incremental_binary::do_get_input_reader): Change signature;
1084 use index instead of filename.
1085 (Sized_incremental_binary::section_map_): New data member.
1086 (Sized_incremental_binary::input_entry_readers_): New data member.
1087 (class Sized_incr_relobj): New class.
1088 (class Sized_incr_dynobj): New class.
1089 (make_sized_incremental_object): New function.
1090 (class Incremental_library): New class.
1091 * layout.cc (Free_list::num_lists): New static data member.
1092 (Free_list::num_nodes): New static data member.
1093 (Free_list::num_removes): New static data member.
1094 (Free_list::num_remove_visits): New static data member.
1095 (Free_list::num_allocates): New static data member.
1096 (Free_list::num_allocate_visits): New static data member.
1097 (Free_list::init): New function.
1098 (Free_list::remove): New function.
1099 (Free_list::allocate): New function.
1100 (Free_list::dump): New function.
1101 (Free_list::print_stats): New function.
1102 (Layout_task_runner::run): Resize output file for incremental updates.
1103 (Layout::Layout): Initialize new data members.
1104 (Layout::set_incremental_base): New function.
1105 (Layout::init_fixed_output_section): New function.
1106 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1107 incremental updates.
1108 (Layout::create_gold_note): Do not create gold note section for
1109 incremental updates.
1110 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1111 for incremental updates.
1112 (Layout::set_section_offsets): For incremental updates, allocate space
1113 from free list.
1114 (Layout::create_symtab_sections): Layout with offsets relative to
1115 start of section; for incremental updates, allocate space from free
1116 list.
1117 (Layout::create_shdrs): For incremental updates, allocate space from
1118 free list.
1119 (Layout::finish_dynamic_section): For incremental updates, do not
1120 check --as-needed (fixed in subsequent patch).
1121 * layout.h (class Free_list): New class.
1122 (Layout::set_incremental_base): New function.
1123 (Layout::incremental_base): New function.
1124 (Layout::init_fixed_output_section): New function.
1125 (Layout::allocate): New function.
1126 (Layout::incremental_base_): New data member.
1127 (Layout::free_list_): New data member.
1128 * main.cc (main): Print Free_list statistics.
1129 * object.cc (Relobj::finalize_incremental_relocs): Add
1130 clear_counts parameter; clear counts only when clear_counts is set.
1131 (Sized_relobj::Sized_relobj): Initialize new base class.
1132 (Sized_relobj::do_layout): Don't report special sections.
1133 (Sized_relobj::do_for_all_local_got_entries): New function.
1134 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1135 symtab_off to all symbol table offsets.
1136 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1137 * object.h (class Got_offset_list): Move to top of file.
1138 (Object::Object): Allow case where input_file == NULL.
1139 (Object::~Object): Likewise.
1140 (Object::input_file): Assert that input_file != NULL.
1141 (Object::lock): Allow case where input_file == NULL.
1142 (Object::unlock): Likewise.
1143 (Object::is_locked): Likewise.
1144 (Object::token): Likewise.
1145 (Object::release): Likewise.
1146 (Object::is_incremental): New function.
1147 (Object::get_mtime): New function.
1148 (Object::for_all_local_got_entries): New function.
1149 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1150 (Object::set_is_in_system_directory): New function.
1151 (Object::is_in_system_directory): New function.
1152 (Object::do_is_incremental): New function.
1153 (Object::do_get_mtime): New function.
1154 (Object::do_for_all_local_got_entries): New function.
1155 (Object::is_in_system_directory_): New data member.
1156 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1157 (class Sized_relobj_base): New class.
1158 (class Sized_relobj): Derive from Sized_relobj_base.
1159 (class Sized_relobj::Symbols): Redeclare from base class.
1160 (class Sized_relobj::local_got_offset_list): Remove.
1161 (class Sized_relobj::Output_sections): Redeclare from base class.
1162 (class Sized_relobj::do_for_all_local_got_entries): New function.
1163 (class Sized_relobj::write_local_symbols): Add offset parameter.
1164 (class Sized_relobj::local_symbol_offset_): Update comment.
1165 (class Sized_relobj::local_dynsym_offset_): Update comment.
1166 * options.cc (Input_arguments::add_file): Remove const.
1167 * options.h (Input_file_argument::Input_file_argument):
1168 Initialize arg_serial_ (all constructors).
1169 (Input_file_argument::set_arg_serial): New function.
1170 (Input_file_argument::arg_serial): New function.
1171 (Input_file_argument::arg_serial_): New data member.
1172 (Input_arguments::Input_arguments): Initialize file_count_.
1173 (Input_arguments::add_file): Remove const.
1174 (Input_arguments::number_of_input_files): New function.
1175 (Input_arguments::file_count_): New data member.
1176 (Command_line::number_of_input_files): Call
1177 Input_arguments::number_of_input_files.
1178 * output.cc (Output_segment_headers::Output_segment_headers):
1179 Set current size.
1180 (Output_section::Input_section::current_data_size): New function.
1181 (Output_section::Output_section): Initialize new data members.
1182 (Output_section::add_input_section): Don't do merge sections for
1183 an incremental link; allocate space from free list for an
1184 incremental update.
1185 (Output_section::add_output_section_data): Allocate space from
1186 free list for an incremental update.
1187 (Output_section::update_data_size): New function.
1188 (Output_section::set_fixed_layout): New function.
1189 (Output_section::reserve): New function.
1190 (Output_segment::set_section_addresses): Remove const.
1191 (Output_segment::set_section_list_addresses): Remove const; allocate
1192 space from free list for an incremental update.
1193 (Output_segment::set_offset): Adjust size of RELRO segment for an
1194 incremental update.
1195 * output.h (Output_data::current_data_size): Move here from
1196 child classes.
1197 (Output_data::pre_finalize_data_size): New function.
1198 (Output_data::update_data_size): New function.
1199 (Output_section_headers::update_data_size): new function.
1200 (Output_section_data_build::current_data_size): Move to Output_data.
1201 (Output_data_strtab::update_data_size): New function.
1202 (Output_section::current_data_size): Move to Output_data.
1203 (Output_section::set_fixed_layout): New function.
1204 (Output_section::has_fixed_layout): New function.
1205 (Output_section::reserve): New function.
1206 (Output_section::update_data_size): New function.
1207 (Output_section::has_fixed_layout_): New data member.
1208 (Output_section::free_list_): New data member.
1209 (Output_segment::set_section_addresses): Remove const.
1210 (Output_segment::set_section_list_addresses): Remove const.
1211 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
1212 New function.
1213 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
1214 New function.
1215 * readsyms.cc (Read_symbols::do_read_symbols): Add library
1216 parameter when calling Add_symbols constructor; store argument
1217 serial number for members of a lib group.
1218 (Add_symbols::locks): Allow case where token == NULL.
1219 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
1220 (Read_member::~Read_member): New function.
1221 (Read_member::is_runnable): New function.
1222 (Read_member::locks): New function.
1223 (Read_member::run): New function.
1224 (Check_script::~Check_script): New function.
1225 (Check_script::is_runnable): New function.
1226 (Check_script::locks): New function.
1227 (Check_script::run): New function.
1228 (Check_library::~Check_library): New function.
1229 (Check_library::is_runnable): New function.
1230 (Check_library::locks): New function.
1231 (Check_library::run): New function.
1232 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
1233 (Add_symbols::library_): New data member.
1234 (class Read_member): New class.
1235 (class Check_script): New class.
1236 (class Check_library): New class.
1237 * reloc.cc (Read_relocs::is_runnable): Allow case where
1238 token == NULL.
1239 (Read_relocs::locks): Likewise.
1240 (Scan_relocs::locks): Likewise.
1241 (Relocate_task::locks): Likewise.
1242 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
1243 to clear counters.
1244 (Sized_relobj::incremental_relocs_scan): Fix comment.
1245 (Sized_relobj::do_relocate): Pass output file offset to
1246 write_local_symbols.
1247 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
1248 from class declaration.
1249 * script.cc (read_input_script): Allocate Script_info; pass
1250 argument serial number to report_script.
1251 * script.h (class Script_info): Move to incremental.h.
1252 * symtab.cc (Symbol_table::add_from_incrobj): New function.
1253 * symtab.h (Symbol_table::add_from_incrobj): New function.
1254 (Symbol_table::set_file_offset): New function.
1255
b961d0d7
CC
12562011-04-05 Cary Coutant <ccoutant@google.com>
1257
1258 * incremental-dump.cc (dump_incremental_inputs): Change signature
1259 to take a Sized_incremental_binary; change caller. Use readers
1260 in Sized_incremental_binary.
1261 * incremental.cc
1262 (Sized_incremental_binary::find_incremental_inputs_sections):
1263 Rename do_find_incremental_inputs_sections to this.
1264 (Sized_incremental_binary::setup_readers): New function.
1265 (Sized_incremental_binary::do_check_inputs): Check
1266 has_incremental_info_ flag; move setup code to setup_readers;
1267 use input readers.
1268 (Sized_incremental_binary::do_file_is_unchanged): New function.
1269 (Sized_incremental_binary::do_get_input_reader): New function.
1270 * incremental.h (class Incremental_binary): Move to end of file.
1271 (Incremental_binary::file_is_unchanged): New function.
1272 (Incremental_binary::do_file_is_unchanged): New function.
1273 (Incremental_binary::Input_reader): New class.
1274 (Incremental_binary::get_input_reader): New function.
1275 (class Sized_incremental_binary): Move to end of file.
1276 (Sized_incremental_binary::Sized_incremental_binary): Setup the
1277 input section reader classes.
1278 (Sized_incremental_binary::has_incremental_info): New function.
1279 (Sized_incremental_binary::inputs_reader): New function.
1280 (Sized_incremental_binary::symtab_reader): New function.
1281 (Sized_incremental_binary::relocs_reader): New function.
1282 (Sized_incremental_binary::got_plt_reader): New function.
1283 (Sized_incremental_binary::do_file_is_unchanged): New function.
1284 (Sized_incremental_binary::Sized_input_reader): New class.
1285 (Sized_incremental_binary::get_input_reader): New function.
1286 (Sized_incremental_binary::find_incremental_inputs_sections):
1287 Rename do_find_incremental_inputs_sections to this.
1288 (Sized_incremental_binary::setup_readers): New function.
1289 (Sized_incremental_binary::has_incremental_info_): New data member.
1290 (Sized_incremental_binary::inputs_reader_): New data member.
1291 (Sized_incremental_binary::symtab_reader_): New data member.
1292 (Sized_incremental_binary::relocs_reader_): New data member.
1293 (Sized_incremental_binary::got_plt_reader_): New data member.
1294 (Sized_incremental_binary::current_input_file_): New data member.
1295
a869183f
PP
12962011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
1297
1298 PR gold/12640
1299 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
1300 violation.
1301
13022011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
1303
1304 * archive.cc (Archive::include_member): Adjust call to report_object.
1305 (Add_archive_symbols::run): Add script_info to call to
1306 report_archive_begin.
1307 (Lib_group::include_member): Adjust call to report_object.
1308 (Add_lib_group_symbols::run): Adjust call to report_object.
1309 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
1310 blocks. Add object count for script input files.
1311 * incremental.cc (Incremental_inputs::report_archive_begin): Add
1312 script_info parameter; change all callers.
1313 (Incremental_inputs::report_object): Add script_info parameter;
1314 change all callers.
1315 (Incremental_inputs::report_script): Store backpointer to
1316 incremental info entry.
1317 (Output_section_incremental_inputs::set_final_data_size): Record
1318 additional information for scripts.
1319 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1320 * incremental.h (Incremental_script_entry::add_object): New function.
1321 (Incremental_script_entry::get_object_count): New function.
1322 (Incremental_script_entry::get_object): New function.
1323 (Incremental_script_entry::objects_): New data member; adjust
1324 constructor.
1325 (Incremental_inputs::report_archive_begin): Add script_info parameter.
1326 (Incremental_inputs::report_object): Add script_info parameter.
1327 (Incremental_inputs_reader::get_object_count): New function.
1328 (Incremental_inputs_reader::get_object_offset): New function.
1329 * options.cc (Input_arguments::add_file): Return reference to
1330 new input argument.
1331 * options.h (Input_argument::set_script_info): New function.
1332 (Input_argument::script_info): New function.
1333 (Input_argument::script_info_): New data member; adjust all
1334 constructors.
1335 (Input_file_group::add_file): Return reference to new input argument.
1336 (Input_file_lib::add_file): Likewise.
1337 (Input_arguments::add_file): Likewise.
1338 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
1339 * script.cc (Parser_closure::Parser_closure): Add script_info
1340 parameter; adjust all callers.
1341 (Parser_closure::script_info): New function.
1342 (Parser_closure::script_info_): New data member.
1343 (read_input_script): Report scripts earlier to incremental info.
1344 (script_add_file): Set script_info in Input_argument.
1345 (script_add_library): Likewise.
1346 * script.h (Script_options::Script_info): Rewrite class.
1347
a869183f 13482011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
1349
1350 * archive.cc (Library_base::should_include_member): Move
1351 method here from class Archive.
1352 (Archive::Archive): Initialize base class.
1353 (Archive::should_include_member): Move to base class.
1354 (Archive::do_for_all_unused_symbols): New function.
1355 (Add_archive_symbols::run): Remove redundant access to
1356 incremental_inputs.
1357 (Lib_group::Lib_group): Initialize base class.
1358 (Lib_group::do_filename): New function.
1359 (Lib_group::include_member): Pass pointer to Lib_group to
1360 report_object.
1361 (Lib_group::do_for_all_unused_symbols): New function.
1362 (Add_lib_group_symbols::run): Report archive information for
1363 incremental links.
1364 * archive.h (class Library_base): New base class.
1365 (class Archive): Derive from Library_base.
1366 (Archive::filename): Move to base class.
1367 (Archive::set_incremental_info): Likewise.
1368 (Archive::incremental_info): Likewise.
1369 (Archive::Should_include): Likewise.
1370 (Archive::should_include_member): Likewise.
1371 (Archive::Armap_entry): Remove.
1372 (Archive::Unused_symbol_iterator): Remove.
1373 (Archive::unused_symbols_begin): Remove.
1374 (Archive::unused_symbols_end): Remove.
1375 (Archive::do_filename): New function.
1376 (Archive::do_get_mtime): New function.
1377 (Archive::do_for_all_unused_symbols): New function.
1378 (Archive::task_): Move to base class.
1379 (Archive::incremental_info_): Likewise.
1380 (class Lib_group): Derive from Library_base.
1381 (Lib_group::do_filename): New function.
1382 (Lib_group::do_get_mtime): New function.
1383 (Lib_group::do_for_all_unused_symbols): New function.
1384 (Lib_group::task_): Move to base class.
1385 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1386 function.
1387 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1388 function.
1389 * incremental.cc (Incremental_inputs::report_archive_begin):
1390 Use Library_base; call library's get_mtime; add incremental inputs
1391 entry before members.
1392 (class Unused_symbol_visitor): New class.
1393 (Incremental_inputs::report_archive_end): Use Library_base; use
1394 visitor class to record unused symbols; don't add incremental inputs
1395 entry after members.
1396 (Incremental_inputs::report_object): Use Library_base.
1397 * incremental.h
1398 (Incremental_archive_entry::Incremental_archive_entry): Remove
1399 unused Archive parameter.
1400 (Incremental_inputs::report_archive_begin): Use Library_base.
1401 (Incremental_inputs::report_archive_end): Likewise.
1402 (Incremental_inputs::report_object): Likewise.
1403 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1404 function.
1405 * object.h (Object::for_all_global_symbols): New function.
1406 (Object::do_for_all_global_symbols): New function.
1407 (Sized_relobj::do_for_all_global_symbols): New function.
1408 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1409 function.
1410 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1411 function.
1412
61ab3e40
ILT
14132011-03-27 Ian Lance Taylor <iant@google.com>
1414
1415 * archive.cc (Archive::interpret_header): Return -1 if something
1416 goes wrong. Change callers accordingly.
1417
30e1f9e6
CC
14182011-03-25 Cary Coutant <ccoutant@google.com>
1419
1420 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1421 * testsuite/Makefile.in: Regenerate.
1422
9c793f14
RÁE
14232010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1424
1425 * plugin.cc (get_view): New.
1426 (Plugin::load): Pass get_view to the plugin.
1427 (Plugin_manager::get_view): New.
1428
9312bb0a
ILT
14292011-03-21 Ian Lance Taylor <iant@google.com>
1430
1431 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1432 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1433
7e12ba9e
ST
14342011-03-21 Sriraman Tallam <tmsriram@google.com>
1435
1436 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1437 Change == to -eq.
1438 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1439 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1440 Change == to -eq.
1441 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1442 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1443
fd7a005d
ILT
14442011-03-14 Ian Lance Taylor <iant@google.com>
1445
1446 * script-sections.cc (Sort_output_sections::script_compare):
1447 Rename from is_before, change return type.
1448 (Sort_output_sections::operator()): Adjust accordingly.
1449
ed16fd1b
ILT
14502011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1451
1452 PR gold/12572
1453 * testsuite/odr_violation2.cc: Add comment to make all error line
1454 numbers double digits.
1455 * testsuite/debug_msg.sh: Adjust expected errors.
1456
71ff8986
ILT
14572011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1458
1459 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1460 but mark earlier ones as non-canonical
1461 (offset_to_iterator): Update search target and example
1462 (do_addr2line): Return extra lines in a vector*
1463 (format_file_lineno): Extract from do_addr2line
1464 (one_addr2line): Add vector* out-param
1465 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1466 when a lineno entry appeared last for its instruction
1467 (Dwarf_line_info): Add vector* out-param
1468 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1469 * symtab.cc (Odr_violation_compare): Include the lineno in the
1470 comparison again.
1471 (linenos_from_loc): New. Combine the canonical line for an
1472 address with its other lines.
1473 (True_if_intersect): New. Helper functor to make
1474 std::set_intersection a query.
1475 (detect_odr_violations): Compare sets of lines instead of just
1476 one line for each function. This became less deterministic, but
1477 has fewer false positives.
1478 * symtab.h: Declarations.
1479 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1480 mix an optimized and non-optimized object in the same binary
1481 (odr_violation2.so): Same.
1482 * testsuite/Makefile.in: Regenerate from Makefile.am.
1483 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1484 * testsuite/debug_msg.sh: Update line numbers and add
1485 assertions.
1486 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1487 non-optimized context.
1488 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1489 isn't inlined, and use OdrDerived in an optimized context.
1490 * testsuite/odr_header1.h: Defines OdrDerived, where
1491 optimization will change the
1492 first-instruction-in-the-destructor's file and line number.
1493 * testsuite/odr_header2.h: Defines OdrBase.
1494
a19fefdc
ILT
14952011-03-09 Ian Lance Taylor <iant@google.com>
1496
1497 * fileread.cc (File_read::clear_views): Don't delete the whole
1498 file view.
1499
ecb351e9
ILT
15002011-03-08 Ian Lance Taylor <iant@google.com>
1501
1502 PR gold/12525
1503 * fileread.cc: #include <climits>.
1504 (GOLD_IOV_MAX): Define.
1505 (File_read::read_multiple): Limit number of entries by iov_max.
1506 * fileread.h (class File_read): Always set max_readv_entries to
1507 128.
1508
b821d13c
ILT
15092011-03-07 Ian Lance Taylor <iant@google.com>
1510
1511 PR gold/12525
1512 * options.h (class General_options): Add -dy and -dn.
1513
89243142
CC
15142011-03-02 Cary Coutant <ccoutant@google.com>
1515
1516 * testsuite/script_test_9.t: Add TLS segment.
1517
d0773f31
ILT
15182011-03-02 Simon Baldwin <simonb@google.com>
1519
1520 * configure.ac: Add check for gnu_indirect_function support in
1521 the toolchain building binutils.
1522 * configure: Rebuild.
1523
badc8139
RÁE
15242010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1525
1526 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1527 plugin only symbols.
1528 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1529 in plugin files as not needed in the symbol table.
1530
4cf7a849
ST
15312011-02-11 Sriraman Tallam <tmsriram@google.com>
1532
1533 * output.cc (Output_section::add_input_section): Delay fill
1534 generation for section ordering.
1535
b578bd7d
ILT
15362011-02-09 Ian Lance Taylor <iant@google.com>
1537
1538 PR gold/12316
1539 * object.h (class Sized_relobj): Remove clear_local_symbols.
1540 * reloc.cc (Sized_relobj::do_relocate): Don't call
1541 clear_local_symbols.
1542
84ced98a
RÁE
15432010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1544
1545 * plugin.cc (is_visible_from_outside): Return true for symbols
1546 in the -u option.
1547
55382fb7
ILT
15482011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1549
1550 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1551 filename.
1552
4e271fff
ST
15532011-02-02 Sriraman Tallam <tmsriram@google.com>
1554
1555 * icf.h (is_section_foldable_candidate): Change type of parameter
1556 to std::string.
1557 * icf.cc (Icf::find_identical_sections): Change type of local variable
1558 section_name to be std::string.
1559 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1560
d433c3ac
ILT
15612011-01-25 Ian Lance Taylor <iant@google.com>
1562
1563 * script.cc (script_add_extern): Rewrite to use
1564 add_symbol_reference.
1565
880473a6
DK
15662011-01-25 Doug Kwan <dougkwan@google.com>
1567
d433c3ac 1568 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1569
f30f86fa
ILT
15702011-01-24 Ian Lance Taylor <iant@google.com>
1571
1572 * options.h (class General_options): Accept
1573 --no-detect-odr-violations.
1574
8e51a0b9
ILT
15752011-01-24 Ian Lance Taylor <iant@google.com>
1576
1577 * version.cc (version_string): Bump to 1.11.
1578
0f3b89d8
ILT
15792011-01-24 Ian Lance Taylor <iant@google.com>
1580
1581 * plugin.cc (class Plugin_rescan): Define new class.
1582 (Plugin_manager::claim_file): Set any_claimed_.
1583 (Plugin_manager::save_archive): New function.
1584 (Plugin_manager::save_input_group): New function.
1585 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1586 necessary.
1587 (Plugin_manager::new_undefined_symbol): New function.
1588 (Plugin_manager::rescan): New function.
1589 (Plugin_manager::rescannable_defines): New function.
1590 (Plugin_manager::add_input_file): Set any_added_.
1591 * plugin.h (class Plugin_manager): define new fields rescannable_,
1592 undefined_symbols_, any_claimed_, and any_added_. Declare
1593 Plugin_rescan as friend. Declare new functions.
1594 (Plugin_manager::Rescannable): Define type.
1595 (Plugin_manager::Rescannable_list): Define type.
1596 (Plugin_manager::Undefined_symbol_list): Define type.
1597 (Plugin_manager::Plugin_manager): Initialize new fields.
1598 * archive.cc (Archive::defines_symbol): New function.
1599 (Add_archive_symbols::run): Pass archive to plugins if any.
1600 * archive.h (class Archive): Declare defines_symbol.
1601 * readsyms.cc (Input_group::~Input_group): New function.
1602 (Finish_group::run): Pass input_group to plugins if any.
1603 * readsyms.h (class Input_group): Declare destructor.
1604 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1605 any.
1606
3bb951e5
ILT
16072011-01-10 Ian Lance Taylor <iant@google.com>
1608
1609 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1610 section as relro.
1611 (Layout::set_segment_offsets): Reset increase_relro before calling
1612 set_section_addresses a second time.
1613
0aa45fac
CC
16142011-01-04 Cary Coutant <ccoutant@google.com>
1615
1616 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1617 sections before NOBITS sections.
1618
0db46eb4
L
16192011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1620
1621 * version.cc (print_version): Update copyright to 2011.
1622
829c9745
CC
16232010-12-23 Cary Coutant <ccoutant@google.com>
1624
1625 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1626 of OS to this->add. Add OD parameter to second form of the function.
1627
7500420b
ILT
16282010-12-20 Ian Lance Taylor <iant@google.com>
1629
1630 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1631 second of two consecutive entries with same offset.
1632
f8e9a930
RW
16332010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1634
1635 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1636 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1637 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1638 to avoid unneeded links against $(LDADD).
1639 * testsuite/Makefile.in: Regenerate.
1640
2fbb4320
ILT
16412010-12-15 Ian Lance Taylor <iant@google.com>
1642
1643 PR gold/12324
1644 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1645 for R_X86_64_32 and R_X86_64_PC32.
1646 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1647 ver_matching_def_pic.o.
1648 (ver_matching_def_pic.o): New target.
1649
fedb228d
RW
16502010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1651
1652 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1653 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1654 Move definition before File_read::View member definitions.
1655 (File_read::View::~View): Initialize and hold lock before
1656 updating current_mapped_bytes.
1657
9b547ce6
RW
16582010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1659
1660 * dwarf_reader.cc: Remove outdated comment.
1661 * gold-threads.cc: Fix typo in error message.
1662 * archive.cc: Fix typos in comments.
1663 * archive.h: Likewise.
1664 * arm-reloc-property.cc: Likewise.
1665 * arm-reloc-property.h: Likewise.
1666 * arm-reloc.def: Likewise.
1667 * arm.cc: Likewise.
1668 * attributes.h: Likewise.
1669 * cref.cc: Likewise.
1670 * ehframe.cc: Likewise.
1671 * fileread.h: Likewise.
1672 * gold.h: Likewise.
1673 * i386.cc: Likewise.
1674 * icf.cc: Likewise.
1675 * incremental.h: Likewise.
1676 * int_encoding.cc: Likewise.
1677 * layout.h: Likewise.
1678 * main.cc: Likewise.
1679 * merge.h: Likewise.
1680 * object.cc: Likewise.
1681 * object.h: Likewise.
1682 * options.cc: Likewise.
1683 * readsyms.cc: Likewise.
1684 * reduced_debug_output.cc: Likewise.
1685 * reloc.cc: Likewise.
1686 * script-sections.cc: Likewise.
1687 * sparc.cc: Likewise.
1688 * symtab.h: Likewise.
1689 * target-reloc.h: Likewise.
1690 * target.cc: Likewise.
1691 * target.h: Likewise.
1692 * timer.cc: Likewise.
1693 * timer.h: Likewise.
1694 * x86_64.cc: Likewise.
1695
83e17bd5
CC
16962010-12-09 Cary Coutant <ccoutant@google.com>
1697
1698 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1699 stack.
1700 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1701 parameter; change all callers.
1702 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1703 * options.h (warn_execstack): New option.
1704
017257f8
DK
17052010-12-07 Doug Kwan <dougkwan@google.com>
1706
1707 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1708 like function call relocations.
1709
c20cbc06
ILT
17102010-12-07 Ian Lance Taylor <iant@google.com>
1711
1712 * archive.cc (Archive::get_elf_object_for_member): Permit
1713 punconfigured to be NULL.
1714 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1715 (Archive::include_member): Pass NULL to get_elf_object_for_member
1716 if we searched for the archive and this is the first included
1717 object.
1718
4dbfafcc
ILT
17192010-12-01 Ian Lance Taylor <iant@google.com>
1720
1721 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1722 track_relocs_type_ field.
1723 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1724 Set track_relocs_type_.
1725 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1726 contents when using RELA relocs.
1727 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1728 reloc_map_.
1729 * reloc.cc (Track_relocs::next_addend): New function.
1730 * reloc.h (class Track_relocs): Declare next_addend.
1731
e5e19edd
ILT
17322010-12-01 Ian Lance Taylor <iant@google.com>
1733
1734 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1735 virtual destructor.
1736
9a5ce24c
ILT
17372010-12-01 Ian Lance Taylor <iant@google.com>
1738
1739 * README: Update compilers known to work and fail.
1740
c7791212
NC
17412010-11-23 Matthias Klose <doko@ubuntu.com>
1742
1743 * configure.in: For --enable-gold, handle value `default' instead of
1744 `both*'. Always install ld as ld.bfd, install as ld if gold is
1745 not the default.
1746 * configure: Regenerate.
1747
0ad220c9
DK
17482010-11-18 Doug Kwan <dougkwan@google.com>
1749
1750 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1751 and right_alignment to be zero. Store result alignment only if it is
1752 greater than existing alignment.
1753
ab8056e0
CC
17542010-11-16 Cary Coutant <ccoutant@google.com>
1755
1756 PR gold/12220
1757 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1758 Check for ".zdebug_line".
1759
fd064a5b
CC
17602010-11-16 Doug Kwan <dougkwan@google.com>
1761 Cary Coutant <ccoutant@google.com>
1762
1763 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1764 by reference; adjust all callers.
1765 * output.cc (Output_segment::set_section_addresses): Adjust references
1766 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1767 list is empty.
1768 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1769 end at page boundary.
1770
6fc6ea19
CC
17712010-11-16 Cary Coutant <ccoutant@google.com>
1772
1773 PR gold/12220
1774 * layout.cc (Layout::choose_output_section): Transform names of
1775 compressed sections even when using a script with a SECTIONS clause.
1776 (Layout::output_section_name): Remove code to transform
1777 compressed debug section names.
1778 * output.cc (Output_section::add_input_section): Use uncompressed
1779 section size when tracking input sections.
1780
95a2c8d6
RS
17812010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1782
1783 * symtab.h (Symbol::NON_PIC_REF): Remove.
1784 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1785 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1786 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1787 (Symbol::use_plt_offset): Take a flags argument and pass it
1788 directly to needs_dynamic_reloc. Restrict check for undefined
1789 weak symbols to function calls.
1790 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1791 (Target_arm::Scan::global): Use it.
1792 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1793 (Target_arm::Relocate::relocate): Likewise.
1794 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1795 parameter with an r_type parameter. Use get_reference_flags
1796 to get the flags.
1797 (Target_arm::Relocate::relocate): Update accordingly.
1798 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1799 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1800 (Target_i386::Scan::global): Likewise.
1801 (Target_i386::Relocate::relocate): Likewise.
1802 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1803 parameter with an r_type parameter. Use get_reference_flags
1804 to get the flags.
1805 (Target_i386::Relocate::relocate): Update accordingly.
1806 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1807 (Target_powerpc::Scan::global): Use it.
1808 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1809 (Target_powerpc::Relocate::relocate): Likewise.
1810 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1811 (Target_sparc::Scan::global): Use it.
1812 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1813 (Target_sparc::Relocate::relocate): Likewise.
1814 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1815 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1816 (Target_x86_64::Scan::global): Likewise.
1817 (Target_x86_64::Relocate::relocate): Likewise.
1818
f625ae50
DK
18192010-11-08 Doug Kwan <dougkwan@google.com>
1820 Cary Coutant <ccoutant@google.com>
1821
1822 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1823 (Arm_exidx_merge_section::section_contents_): New data member.
1824 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1825 (Arm_input_section::~Arm_input_section): De-allocate memory.
1826 (Arm_input_section::original_contents_): New data member.
1827 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1828 in parameters instead of calling Object::section_contents without
1829 locking.
1830 (Arm_output_section::group_section): New parameter TASK. Pass it
1831 to callees that need locking objects.
1832 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1833 to lock EXIDX input sections. Fix a formatting issue. Call
1834 Arm_exidx_merged_section::build_contents to create merged section
1835 contents.
1836 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1837 to lock object of stub table owner.
1838 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1839 TEXT_SIZE to initialize data member TEXT_SIZE_.
1840 (Arm_exidx_input_section::addralign): Fix typo in comment.
1841 (Arm_exidx_input_section::text_size): New method.
1842 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1843 that require locking objects. Lock objects before scanning for stubs
1844 and updating local symbols.
1845 (Arm_input_section<big_endian>::init): Copy contents of original
1846 input section.
1847 (Arm_input_section<big_endian>::do_write): Use saved contents of
1848 original input section instead of calling Object::section_contents
1849 without locking.
1850 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1851 size without calling Object::section_size().
1852 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1853 for size. Allocate a buffer for merged EXIDX entries.
1854 (Arm_exidx_merged_section::build_contents): New method.
1855 (Arm_exidx_merged_section::do_write): Move merge section contents
1856 building code to Arm_exidx_merged_section::build_contetns. Write
1857 out contetns in buffer instead of building it on the fly.
1858 (Arm_relobj::make_exidx_input_section): Also pass text section size
1859 to Arm_exidx_input_section constructor.
1860 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1861 (Arm_dynobj::do_read_symbols): Fix memory leak.
1862 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1863 * target.h: (class Task): Add forward declaration.
1864 (Target::relax): Add new parameter TASK and pass it to
1865 Target::do_relax().
1866 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1867
5f9bcf58
CC
18682010-11-05 Cary Coutant <ccoutant@google.com>
1869
1870 PR gold/10708
1871 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1872 object when reading from the file.
1873 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1874 second layout pass.
1875 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1876 when reading section contents.
1877 (get_section_contents): Likewise.
1878 (icf::find_identical_sections): Likewise.
1879 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1880 object when reading from the file.
1881 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1882 the object when doing deferred section layout.
1883
e597fa08
NC
18842010-11-03 Nick Clifton <nickc@redhat.com>
1885
1886 PR gold/12001
1887 * script.h (class Symbol_assignment: name): New member. Returns
1888 the name of the symbol.
1889 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1890 Returns true if the given symbol name is on the list of
1891 assignments wating to be processed.
1892 * archive.cc (should_incldue_member): If the symbol is undefined,
1893 check to see if it is on the list of symbols pending assignment.
1894
3f9a3278
ILT
18952010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1896
1897 * script-sections.cc (Script_sections::find_memory_region): Check
1898 for a NULL output section pointer.
1899
d06fb4d1
DK
19002010-10-29 Doug Kwan <dougkwan@google.com>
1901
1902 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1903 Output_section::add_relaxed_input_section.
1904 * output.cc (Output_section::add_relaxed_input_section): Add new
1905 arguments LAYOUT and NAME. Set section order index.
1906 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1907 Copy section order index.
1908 * output.h (Output_section::add_relaxed_input_section): Add new
1909 arguments LAYOUT and NAME.
1910
90e24de5
ILT
19112010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1912
1913 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1914 NATIVE_OR_CROSS_LINKER.
1915 * testsuite/Makefile.in: Regenerate.
1916
c9484ea5
DK
19172010-10-20 Doug Kwan <dougkwan@google.com>
1918
1919 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1920 without SHF_LINK_ORDER flags.
1921 * layout.cc (Layout::choose_output_section): Do not filter
1922 SHF_LINK_ORDER flag in a relocatable link.
1923
5bc2f5be
CC
19242010-10-17 Cary Coutant <ccoutant@google.com>
1925
1926 * output.h (Output_segment::set_section_addresses): Change function
1927 signature. Update all callers.
1928 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1929 sections.
1930 (Output_segment::set_section_addresses): Align after last TLS
1931 section. Add padding before last relro section instead of after.
1932
0c91cf04
DK
19332010-10-17 Doug Kwan <dougkwan@google.com>
1934
1935 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1936 GOT output section to be writable.
1937
8c21d9d3
CC
19382010-10-14 Cary Coutant <ccoutant@google.com>
1939
1940 * debug.h (DEBUG_INCREMENTAL): New flag.
1941 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1942 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1943 mode.
1944 * incremental.cc (report_command_line): Ignore all forms of
1945 --incremental.
1946 * layout.cc (Layout::Layout): Check parameters for incremental link
1947 mode.
1948 * options.cc (General_options::parse_incremental): New function.
1949 (General_options::parse_no_incremental): New function.
1950 (General_options::parse_incremental_full): New function.
1951 (General_options::parse_incremental_update): New function.
1952 (General_options::incremental_mode_): New data member.
1953 (General_options::finalize): Check incremental_mode_.
1954 * options.h (General_options): Update help text for --incremental.
1955 Add --no-incremental, --incremental-full, --incremental-update.
1956 (General_options::Incremental_mode): New enum type.
1957 (General_options::incremental_mode): New function.
1958 (General_options::incremental_mode_): New data member.
1959 * parameters.cc (Parameters::incremental_mode_): New data member.
1960 (Parameters::set_options): Set incremental_mode_.
1961 (Parameters::set_incremental_full): New function.
1962 (Parameters::incremental): New function.
1963 (Parameters::incremental_update): New function.
1964 (set_parameters_incremental_full): New function.
1965 * parameters.h (Parameters::set_incremental_full): New function.
1966 (Parameters::incremental): New function.
1967 (Parameters::incremental_update): New function.
1968 (Parameters::incremental_mode_): New data member.
1969 (set_parameters_incremental_full): New function.
1970 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1971 incremental link mode.
1972 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1973 (Sized_relobj::do_relocate_sections): Likewise.
1974 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1975 option.
1976 * testsuite/Makefile.in: Regenerate.
1977 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1978
bb32aa18 19792010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1980
1981 * script-sections.h (class Script_sections): Make
1982 Sections_elements typedef public.
1983 * script-sections.cc (class Sort_output_sections): Add elements_
1984 field. Add constructor which sets it; change all callers.
1985 (Sort_output_sections::is_before): New function.
1986 (Sort_output_sections::operator()): Call is_before.
1987 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1988 conditional.
1989 * testsuite/script_test_10.sh: New test. Test script section
1990 order.
1991 * testsuite/script_test_10.t: Likewise.
1992 * testsuite/script_test_10.s: Likewise.
1993 * testsuite/Makefile.am: Wrap the cross linker tests and the
1994 common tests into NATIVE_OR_CROSS_LINKER.
1995 (check_SCRIPTS): Add script_test_10.sh.
1996 (check_DATA): Add script_test_10.stdout.
1997 (script_test_10.o, script_test_10): New targets.
1998 (script_test_10.stdout): New target.
1999 * configure, testsuite/Makefile.in: Regenerate.
2000
3cef7179
ILT
20012010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2002
2003 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2004 error for the deprecated relocations.
2005 (Target_arm::Scan::global): Likewise.
2006 (Target_arm::Relocate::relocate): Likewise.
2007
7411e9a8
RS
20082010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2009
2010 * fileread.cc (Input_file::find_file): Initialize *found_name
2011 and *namep when using the fallback search for case 4.
2012
6a9da32a
CC
20132010-10-11 Cary Coutant <ccoutant@google.com>
2014
2015 * options.h (class General_options): Redefine -z lazy as an alias for
2016 the negation of -z now.
2017
ac897c20
ILT
20182010-10-11 Ian Lance Taylor <iant@google.com>
2019
2020 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2021 binding.
2022
ea5cae92
NC
20232010-10-06 Nick Clifton <nickc@redhat.com>
2024
2025 * script-sections.cc(class Memory_region): Remove
2026 current_lma_offset_ field. Rename current_vma_offset_ to
2027 current_offset_. Add last_section_ field.
2028 (Memory_region::get_current_vma_address): Rename to
2029 get_current_address.
2030 (Memory_region::get_current_lma_address): Delete.
2031 (Memory_region::increment_vma_offset): Rename to
2032 increment_offset.
2033 (Memory_region::increment_lma_offset): Delete.
2034 (Memory_region::attributes_compatible): New method. Returns
2035 true if the provided section is compatible with the region.
2036 (Memory_region::get_last_section): New method. Returns the last
2037 section to use the region.
2038 (Memory_region::set_last_section): New method. Stores the last
2039 section to use the region.
2040 (Script_sections::block_in_region): New method. Returns true if
2041 a block of memory is contained within a region.
2042 (Script_sections::find_memory_region): New method. Locates a
2043 memory region to be used to set a VMA or LMA address.
2044 (Output_section_definition::set_section_addresses): Add code to
2045 check for addresses set by memory regions.
2046 (Output_segment::set_section_addresses): Remove memory region
2047 walking code.
2048 (Script_sections::create_segment): Add a warning if a header
2049 segment is created outside of any region.
2050 * script-sections.h (class Script_sections): Add prototypes for
2051 find_memory_region and block_in_region methods.
2052 * testsuite/memory_test.s: Use .long instead of .word.
2053 * testsuite/memory_test.t: Add some more output sections.
2054 * testsuite/memory_test.sh: Update expected output.
2055
a9bfd952
DK
20562010-10-02 Doug Kwan <dougkwan@google.com>
2057
2058 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2059 defintion to symtab.h
2060 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2061 declaration to defintion.
2062
bacff3ab
NC
20632010-10-01 Nick Clifton <nickc@redhat.com>
2064
2065 * expression.cc (eval): Replace dummy argument with NULL.
2066 (eval_maybe_dot): Check for a NULL result section pointer.
2067 (Symbol_expression::value): Likewise.
2068 (Dot_expression::value): Likewise.
2069 (BINARY_EXPRESSION): Likewise.
2070 (Max_expression::value): Likewise.
2071 (Min_expression::value): Likewise.
2072 (Absolute_expression::value): Likewise.
2073 (Addr_expression::value_from_output_section): Likewise.
2074 (Loaddddr_expression::value_from_output_section): Likewise.
2075 (Segment_start_expression::value): Likewise.
2076 * script-sections.cc
2077 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2078 argument with NULL.
2079 (Sections_elememt_dot_assignment::set_section_addresses):
2080 Likewise.
2081 (Output_data_expression::do_write_to_buffer): Likewise.
2082 (Output_section_definition::finalize_symbols): Likewise.
2083 (Output_section_definition::set_section_addresses): Likewise.
2084
f81bc8b5
DK
20852010-09-30 Doug Kwan <dougkwan@google.com>
2086
2087 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2088
c95e9f27
ST
20892010-09-28 Sriraman Tallam <tmsriram@google.com>
2090
2091 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 2092 function.
c95e9f27
ST
2093 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2094 virtual function.
2095 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2096 virtual function.
2097 * icf.cc (get_section_contents): Inline merge sections only when
2098 target allows it.
2099
3cac54d2
RW
21002010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2101
2102 * configure: Regenerate.
2103
2904037a
ILT
21042010-09-17 Ian Lance Taylor <iant@google.com>
2105
2106 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
2107 * testsuite/Makefile.am (memory_test.o): New target.
2108 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2109 memory_test.t.
2110 * testsuite/Makefile.in: Rebuild.
2904037a 2111
bca7fb63
DK
21122010-09-17 Doug Kwan <dougkwan@google.com>
2113
2114 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2115 defintion if relocation uses GOT entries of the symbol.
2116 * testsuite/icf_safe_test.sh: Fix test.
2117 * testsuite/icf_safe_so_test.sh: Fix test.
2118
4ef28648
CC
21192010-09-16 Cary Coutant <ccoutant@google.com>
2120
2121 * script_sections.cc (class Memory_region): Remove "NULL" from
2122 vector initializations.
2123
793990de
CC
21242010-09-15 Cary Coutant <ccoutant@google.com>
2125
2126 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2127 Resolve forwarding symbols.
2128
81e015e2
DK
21292010-09-15 Doug Kwan <dougkwan@google.com>
2130
2131 * gold/testsuite/script_test_3.t: Add ARM special sections.
2132 * gold/testsuite/script_test_4.t: Same.
2133 * gold/testsuite/script_test_5.t: Same.
2134 * gold/testsuite/script_test_6.t: Same.
2135 * gold/testsuite/script_test_7.t: Same.
2136 * gold/testsuite/script_test_7.t: Same.
2137 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2138
36171d64
CC
21392010-09-14 Cary Coutant <ccoutant@google.com>
2140
2141 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2142 (Target_x86_64::Relocate::relocate_tls): Replace check for
2143 saw_tls_block_reloc_ with test for executable section.
2144
d89051bd
CC
21452010-09-12 Cary Coutant <ccoutant@google.com>
2146
2147 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2148 position-independent executables to shared libraries need dynamic
2149 relocations.
2150 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2151 position-independent executables.
2152 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2153 * testsuite/Makefile.in: Regenerate.
2154
fca41f0f
NC
21552010-09-10 Nick Clifton <nickc@redhat.com>
2156
2157 PR gold/11997
2158 * testsuite/memory_test.t: Discard any sections that are not
2159 needed.
2160
6695e4b3
L
21612010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2162
2163 PR gold/11996
2164 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2165 "This::" to work around a bug in gcc 4.2.
2166
2167 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2168
0f72bf6f
RÁE
21692010-09-09 Rafael Espindola <espindola@google.com>
2170
2171 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
2172 sections with different PF_X flags in the same segment.
2173 (Layout::find_first_load_seg): Search all segments to find the first
2174 one.
2175 * options.h (rosegment): New.
2176
21772010-09-08 Rafael Espindola <espindola@google.com>
a6577478 2178
05a79166 2179 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 2180
aa98ff75
DK
21812010-09-08 Doug Kwan <dougkwan@google.com>
2182
2183 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
2184 (Arm_relobj::do_relocate_sections): Add new parameter for output
2185 file to match the parent.
2186 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
2187 of local symbols instead of input values. Update code to track
2188 changes in gold::relocate_section.
2189 * object.cc (Sized_relobj::compute_final_local_value): New methods.
2190 (Sized_relobj::compute_final_local_value_internal): New methods.
2191 (Sized_relobj::do_finalize_local_symbols): Move code from loop
2192 body into private version of Sized_relobj::compute_final_local_value.
2193 Call the inline method.
2194 * object.h (Symbol_value::Symbol_value): Define destructor. Free
2195 merged symbol value if there is one.
2196 (Symbol_value::has_output_value): New method defintiion.
2197 (Sized_relobj::Compute_final_local_value_status): New enum type.
2198 (Sized_relobj::compute_final_local_value): New methods.
2199 (Sized_relobj::compute_final_local_value_internal): New methods.
2200 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
2201 and arm_cortex_a8.sh.
2202 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
2203 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
2204 New tests.
2205 * Makefile.in: Regenerate.
2206 * testsuite/arm_bl_out_of_range.s: Update test.
2207 * testsuite/thumb_bl_out_of_range.s: Ditto.
2208 * testsuite/thumb_blx_out_of_range.s: Ditto.
2209 * testsuite/arm_branch_out_of_range.sh: New file.
2210 * testsuite/arm_cortex_a8.sh: Ditto.
2211 * testsuite/arm_cortex_a8_b.s: Ditto.
2212 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
2213 * testsuite/arm_cortex_a8_b_local.s: Ditto.
2214 * testsuite/arm_cortex_a8_bl.s: Ditto.
2215 * testsuite/arm_cortex_a8_blx.s: Ditto.
2216 * testsuite/arm_cortex_a8_local.s: Ditto.
2217 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
2218 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2219
05a79166
L
22202010-09-08 Rafael Espindola <espindola@google.com>
2221
2222 * Makefile.am (memory_test.stdout): Run readelf with -W.
2223 * Makefile.in: Regenerate.
2224 * testsuite/memory_test.sh: Make the regexps accept both 32 and
2225 64 bit output.
2226
33dbc701
RÁE
22272010-09-08 Rafael Espindola <espindola@google.com>
2228
2229 * script-sections.cc (Script_sections::add_memory_region): Convert
2230 field precision to int.
2231 * script.cc (script_set_section_region, script_set_section_region):
2232 Convert field precision to int.
2233
731ca54a
RÁE
22342010-09-08 Rafael Espindola <espindola@google.com>
2235
2236 * arm.cc (do_finalize_sections): Create the __exidx_start and
2237 __exdix_end symbols even when the section is missing.
2238
7f8cd844
NC
22392010-09-08 Nick Clifton <nickc@redhat.com>
2240
2241 * README: Remove claim that MEMORY is not supported.
2242 * expression.cc (script_exp_function_origin)
2243 (script_exp_function_length): Move from here to ...
2244 * script.cc: ... here.
2245 (script_set_section_region, script_add_memory)
2246 (script_parse_memory_attr, script_include_directive): New
2247 functions.
2248 * script-sections.cc
2249 (class Memory_region): New class.
2250 (class Output_section_definition): Add set_memory_region,
2251 set_section_vma, set_section_lma and get_section_name methods.
2252 (class Script_Sections): Add add_memory_region,
2253 find_memory_region, find_memory_region_origin,
2254 find_memory_region_length and set_memory_region methods.
2255 Have set_section_addresses method walk the list of set memory
2256 regions.
2257 Extend the print methos to display memory regions.
2258 * script-sections.h: Add prototypes for new methods.
2259 Add enum for MEMORY region attributes.
2260 * yyscript.y: Add support for parsing MEMORY regions.
2261 * script-c.h: Add prototypes for new functions.
2262 * testsuite/Makefile.am: Add test of MEMORY region functionality.
2263 * testsuite/Makefile.in: Regenerate.
2264 * testsuite/memory_test.sh: New script.
2265 * testsuite/memory_test.s: New assembler source file.
2266 * testsuite/memory_test.t: New linker script.
2267
a4649286
DK
22682010-08-27 Doug Kwan <dougkwan@google.com>
2269
2270 * gold/resolve.cc (Symbol_table::should_override): Let a weak
2271 reference override an existing dynamic weak reference.
2272 * testsuite/Makefile.am: Add new test dyn_weak_ref.
2273 * testsuite/Makefile.in: Regenerate.
2274 * testsuite/dyn_weak_ref.sh: New file.
2275 * testsuite/dyn_weak_ref_1.c: Ditto.
2276 * testsuite/dyn_weak_ref_2.c: Ditto.
2277
b56648ad
ILT
22782010-08-27 Ian Lance Taylor <iant@google.com>
2279
2280 * incremental.h (class Incremental_input_entry): Add virtual
2281 destructor.
2282
809313cb
ILT
22832010-08-27 Ian Lance Taylor <iant@google.com>
2284
2285 * testsuite/start_lib_test_3.c: Mark t3 as used.
2286
11e32464
NC
22872010-08-27 Nick Clifton <nickc@redhat.com>
2288
2289 * options.cc (version_script): Fix small typo in previous
2290 whitespace tidyup.
2291
ca09d69a
NC
22922010-08-25 Nick Clifton <nickc@redhat.com>
2293
2294 * archive.cc: Formatting fixes: Remove whitespace between
2295 typename and following asterisk. Remove whitespace between
2296 function name and opening parenthesis.
2297 * archive.h: Likewise.
2298 * arm.cc: Likewise.
2299 * attributes.cc: Likewise.
2300 * attributes.h: Likewise.
2301 * common.cc: Likewise.
2302 * copy-relocs.cc: Likewise.
2303 * dirsearch.h: Likewise.
2304 * dynobj.cc: Likewise.
2305 * ehframe.cc: Likewise.
2306 * ehframe.h: Likewise.
2307 * expression.cc: Likewise.
2308 * fileread.cc: Likewise.
2309 * fileread.h: Likewise.
2310 * gc.h: Likewise.
2311 * gold-threads.cc: Likewise.
2312 * gold.cc: Likewise.
2313 * i386.cc: Likewise.
2314 * icf.h: Likewise.
2315 * incremental-dump.cc: Likewise.
2316 * incremental.cc: Likewise.
2317 * layout.cc: Likewise.
2318 * layout.h: Likewise.
2319 * main.cc: Likewise.
2320 * merge.cc: Likewise.
2321 * merge.h: Likewise.
2322 * object.cc: Likewise.
2323 * object.h: Likewise.
2324 * options.cc: Likewise.
2325 * options.h: Likewise.
2326 * output.cc: Likewise.
2327 * output.h: Likewise.
2328 * plugin.cc: Likewise.
2329 * plugin.h: Likewise.
2330 * powerpc.cc: Likewise.
2331 * reloc.cc: Likewise.
2332 * script-c.h: Likewise.
2333 * script-sections.cc: Likewise.
2334 * script.cc: Likewise.
2335 * stringpool.cc: Likewise.
2336 * symtab.cc: Likewise.
2337 * symtab.h: Likewise.
2338 * target.cc: Likewise.
2339 * timer.cc: Likewise.
2340 * timer.h: Likewise.
2341 * version.cc: Likewise.
2342 * x86_64.cc: Likewise.
2343
b8fa8750
NC
23442010-08-24 Nick Clifton <nickc@redhat.com>
2345
2346 PR 11899
2347 * layout.cc (segment_precedes): Sort segments by their physical
2348 addresses, if they have been set.
2349
9919d93b
CC
23502010-08-23 Cary Coutant <ccoutant@google.com>
2351
2352 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2353 symbols data.
2354 (Lib_group::include_member): Unlock object after deleting its
2355 symbols data.
2356 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2357 the bug fixed here.
2358
97b4be1c
CC
23592010-08-19 Neil Vachharajani <nvachhar@google.com>
2360 Cary Coutant <ccoutant@google.com>
2361
2362 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2363 constructor, and set_blocker.
2364 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2365 readsyms_blocker_.
2366 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2367 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2368 * testsuite/Makefile.am (start_lib_test): New test case.
2369 * testsuite/Makefile.in: Regenerate.
2370 * testsuite/start_lib_test_main.c: New file.
2371 * testsuite/start_lib_test_1.c: New file.
2372 * testsuite/start_lib_test_2.c: New file.
2373 * testsuite/start_lib_test_3.c: New file.
2374
dd0b1884
ILT
23752010-08-19 Ian Lance Taylor <iant@google.com>
2376
2377 * Makefile.in: Rebuild with automake 1.11.1.
2378 * aclocal.m4: Likewise.
2379 * testsuite/Makefile.in: Likewise.
2380
7223e9ca
ILT
23812010-08-19 Ian Lance Taylor <iant@google.com>
2382
2383 PR 10893
2384 * i386.cc (class Output_data_plt_i386): Update declarations.
2385 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2386 local_ifuncs_ fields.
2387 (Target_i386::do_plt_section_for_global): New function.
2388 (Target_i386::do_plt_section_for_local): New function.
2389 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2390 parameter; change all callers. Initialize global_ifuncs_ and
2391 local_ifuncs_. If doing a static link define __rel_iplt_start and
2392 __rel_iplt_end.
2393 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2394 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2395 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2396 symbols.
2397 (Target_i386::make_plt_section): New function, broken out of
2398 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2399 (Target_i386::make_plt_entry): Call make_plt_section.
2400 (Target_i386::make_local_ifunc_plt_entry): New function.
2401 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2402 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2403 R_386_IRELATIVE to switch.
2404 (Target_i386::Scan::global): Likewise.
2405 (Target_i386::Relocate::relocate): Likewise.
2406 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2407 switch.
2408 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2409 (Target_x86_64::do_plt_section_for_global): New function.
2410 (Target_x86_64::do_plt_section_for_local): New function.
2411 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2412 parameter; change all callers. If doing a static link define
2413 __rela_iplt_start and __rela_iplt_end.
2414 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2415 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2416 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2417 to point to .plt.
2418 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2419 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2420 switch.
2421 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2422 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2423 R_X86_64_IRELATIVE to switch.
2424 (Target_x86_64::Scan::global): Likewise.
2425 (Target_x86_64::Relocate::relocate): Likewise.
2426 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2427 switch.
2428 * target.h (class Target): Add plt_section_for_global and
2429 plt_section_for_local functions. Add do_plt_section_for_global
2430 and do_plt_section_for_local virtual functions.
2431 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2432 clarifying comments.
2433 (Symbol::use_plt_offset): Handle IFUNC symbol.
2434 * object.cc (Sized_relobj::Sized_relobj): Initialize
2435 local_plt_offsets_.
2436 (Sized_relobj::local_has_plt_offset): New function.
2437 (Sized_relobj::local_plt_offset): New function.
2438 (Sized_relobj::set_local_plt_offset): New function.
2439 (Sized_relobj::do_count): Handle IFUNC symbol.
2440 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2441 a bit away from input_shndx_ field. Add set_is_func_symbol and
2442 is_ifunc_symbol functions.
2443 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2444 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2445 local_plt_offsets_ field.
2446 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2447 * output.h (class Output_section_data): Add non-const
2448 output_section function.
2449 (class Output_data_got): Update declarations.
2450 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2451 Add use_plt_offset parameter to global and local constructors.
2452 Change all callers. Change local_sym_index_ field to 31 bits.
2453 Change GSYM_CODE and CONSTANT_CODE accordingly.
2454 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2455 doing a static link don't set sh_link field.
2456 (Output_data_got::Got_entry::write): Use PLT offset if
2457 appropriate.
2458 (Output_data_got::add_global_plt): New function.
2459 (Output_data_got::add_local_plt): New function.
2460 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2461 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2462 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2463 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2464 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2465 IFUNC conditional.
2466 * testsuite/ifunc-sel.h: New file.
2467 * testsuite/ifuncmain1.c: New file.
2468 * testsuite/ifuncmain1vis.c: New file.
2469 * testsuite/ifuncmod1.c: New file.
2470 * testsuite/ifuncdep2.c: New file.
2471 * testsuite/ifuncmain2.c: New file.
2472 * testsuite/ifuncmain3.c: New file.
2473 * testsuite/ifuncmod3.c: New file.
2474 * testsuite/ifuncmain4.c: New file.
2475 * testsuite/ifuncmain5.c: New file.
2476 * testsuite/ifuncmod5.c: New file.
2477 * testsuite/ifuncmain6pie.c: New file.
2478 * testsuite/ifuncmod6.c: New file.
2479 * testsuite/ifuncmain7.c: New file.
2480 * configure, testsuite/Makefile.in: Rebuild.
2481
56f75c03
ILT
24822010-08-18 Ian Lance Taylor <iant@google.com>
2483
2484 * incremental.cc
2485 (Output_section_incremental_inputs::write_input_files): Add cast
2486 to avoid signed/unsigned comparison warning.
2487 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2488
55455f89
CC
24892010-08-12 Cary Coutant <ccoutant@google.com>
2490
2491 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2492
e2054bcb
ILT
24932010-08-13 Ian Lance Taylor <iant@google.com>
2494
2495 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2496
74f67560
DK
24972010-08-12 Cary Coutant <ccoutant@google.com>
2498 Doug Kwan <dougkwan@google.com>
2499
2500 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2501 defintion overrides non-weak undef, remember that the original undef
2502 is not weak.
2503 * symtab.cc (Symbol_table::sized_write_global): For undef without
2504 an original weak binding, set binding to global in output.
2505 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2506 * testsuite/Makefile.in: Regenerate.
2507 * testsuite/strong_ref_weak_def.sh: New file.
2508 * testsuite/strong_ref_weak_def_1.c: Ditto.
2509 * testsuite/strong_ref_weak_def_2.c: Ditto.
2510
d1238d12
CC
25112010-08-12 Cary Coutant <ccoutant@google.com>
2512
2513 * testsuite/incremental_test.sh: Rewrite.
2514 * testsuite/incremental_test_1.c: Rewrite.
2515 * testsuite/incremental_test_2.c: Rewrite.
2516
0e70b911
CC
25172010-08-12 Cary Coutant <ccoutant@google.com>
2518
2519 * arm.cc (Target_arm::got_size): Add const.
2520 (Target_arm::got_entry_count): New function.
2521 (Target_arm::plt_entry_count): New function.
2522 (Target_arm::first_plt_entry_offset): New function.
2523 (Target_arm::plt_entry_size): New function.
2524 (Output_data_plt_arm::entry_count): New function.
2525 (Output_data_plt_arm::first_plt_entry_offset): New function.
2526 (Output_data_plt_arm::get_plt_entry_size): New function.
2527 * i386.cc (Target_i386::got_size): Add const.
2528 (Target_i386::got_entry_count): New function.
2529 (Target_i386::plt_entry_count): New function.
2530 (Target_i386::first_plt_entry_offset): New function.
2531 (Target_i386::plt_entry_size): New function.
2532 (Output_data_plt_i386::entry_count): New function.
2533 (Output_data_plt_i386::first_plt_entry_offset): New function.
2534 (Output_data_plt_i386::get_plt_entry_size): New function.
2535 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2536 find_incremental_inputs_sections. Dump incremental_got_plt section.
2537 * incremental.cc: Include target.h.
2538 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2539 parameter. Adjust all callers. Find incremental_got_plt section.
2540 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2541 section.
2542 (Output_section_incremental_inputs::set_final_data_size): Calculate
2543 size of incremental_got_plt section.
2544 (Output_section_incremental_inputs::do_write): Write the
2545 incremental_got_plt section.
2546 (Got_plt_view_info): New struct.
2547 (Local_got_offset_visitor): New class.
2548 (Global_got_offset_visitor): New class.
2549 (Global_symbol_visitor_got_plt): New class.
2550 (Output_section_incremental_inputs::write_got_plt): New function.
2551 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2552 Add parameter. Adjust all callers.
2553 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2554 (Incremental_inputs::got_plt_section): New function.
2555 (Incremental_inputs::got_plt_section_): New data member.
2556 (Incremental_got_plt_reader): New class.
2557 * layout.cc (Layout::create_incremental_info_sections): Add the
2558 incremental_got_plt section.
2559 * object.h (Got_offset_list::get_list): New function.
2560 (Got offset_list::for_all_got_offsets): New function.
2561 (Sized_relobj::local_got_offset_list): New function.
2562 * powerpc.cc (Target_powerpc::got_size): Add const.
2563 (Target_powerpc::got_entry_count): New function.
2564 (Target_powerpc::plt_entry_count): New function.
2565 (Target_powerpc::first_plt_entry_offset): New function.
2566 (Target_powerpc::plt_entry_size): New function.
2567 (Output_data_plt_powerpc::entry_count): New function.
2568 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2569 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2570 * sparc.cc (Target_sparc::got_size): Add const.
2571 (Target_sparc::got_entry_count): New function.
2572 (Target_sparc::plt_entry_count): New function.
2573 (Target_sparc::first_plt_entry_offset): New function.
2574 (Target_sparc::plt_entry_size): New function.
2575 (Output_data_plt_sparc::entry_count): New function.
2576 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2577 (Output_data_plt_sparc::get_plt_entry_size): New function.
2578 * symtab.h (Symbol::got_offset_list): New function.
2579 (Symbol_table::for_all_symbols): New function.
2580 * target.h (Sized_target::got_entry_count): New function.
2581 (Sized_target::plt_entry_count): New function.
2582 (Sized_target::plt_entry_size): New function.
2583 * x86_64.cc (Target_x86_64::got_size): Add const.
2584 (Target_x86_64::got_entry_count): New function.
2585 (Target_x86_64::plt_entry_count): New function.
2586 (Target_x86_64::first_plt_entry_offset): New function.
2587 (Target_x86_64::plt_entry_size): New function.
2588 (Output_data_plt_x86_64::entry_count): New function.
2589 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2590 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2591
09ec0418
CC
25922010-08-12 Cary Coutant <ccoutant@google.com>
2593
2594 * archive.cc: Include incremental.h.
2595 (Archive::Archive): Initialize incremental_info_.
2596 (Archive::include_member): Record archive members in incremental info.
2597 (Add_archive_symbols::run): Record begin and end of an archive in
2598 incremental info.
2599 (Lib_group::include_member): Record objects in incremental info.
2600 * archive.h (Incremental_archive_entry): Forward declaration.
2601 (Archive::set_incremental_info): New member function.
2602 (Archive::incremental_info): New member function.
2603 (Archive::Unused_symbol_iterator): New class.
2604 (Archive::unused_symbols_begin): New member function.
2605 (Archive::unused_symbols_end): New member function.
2606 (Archive::incremental_info_): New data member.
2607 * incremental-dump.cc (find_input_containing_global): New function.
2608 (dump_incremental_inputs): Dump new incremental info sections.
2609 * incremental.cc: Include symtab.h.
2610 (Output_section_incremental_inputs): New class.
2611 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2612 new incremental info sections.
2613 (Sized_incremental_binary::do_check_inputs): Likewise.
2614 (Incremental_inputs::report_archive): Remove.
2615 (Incremental_inputs::report_archive_begin): New function.
2616 (Incremental_inputs::report_archive_end): New function.
2617 (Incremental_inputs::report_object): New function.
2618 (Incremental_inputs::finalize_inputs): Remove.
2619 (Incremental_inputs::report_input_section): New function.
2620 (Incremental_inputs::report_script): Rewrite.
2621 (Incremental_inputs::finalize): Do nothing but finalize string table.
2622 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2623 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2624 (Incremental_inputs::create_data_sections): New function.
2625 (Incremental_inputs::relocs_entsize): New function.
2626 (Output_section_incremental_inputs::set_final_data_size): New function.
2627 (Output_section_incremental_inputs::do_write): New function.
2628 (Output_section_incremental_inputs::write_header): New function.
2629 (Output_section_incremental_inputs::write_input_files): New function.
2630 (Output_section_incremental_inputs::write_info_blocks): New function.
2631 (Output_section_incremental_inputs::write_symtab): New function.
2632 * incremental.h (Incremental_script_entry): Forward declaration.
2633 (Incremental_object_entry): Forward declaration.
2634 (Incremental_archive_entry): Forward declaration.
2635 (Incremental_inputs): Forward declaration.
2636 (Incremental_inputs_header_data): Remove.
2637 (Incremental_inputs_header): Remove.
2638 (Incremental_inputs_header_write): Remove.
2639 (Incremental_inputs_entry_data): Remove.
2640 (Incremental_inputs_entry): Remove.
2641 (Incremental_inputs_entry_write): Remove.
2642 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2643 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2644 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2645 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2646 Likewise.
2647 (Incremental_input_entry): New class.
2648 (Incremental_script_entry): New class.
2649 (Incremental_object_entry): New class.
2650 (Incremental_archive_entry): New class.
2651 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2652 (Incremental_inputs::report_inputs): Remove.
2653 (Incremental_inputs::report_archive): Remove.
2654 (Incremental_inputs::report_archive_begin): New function.
2655 (Incremental_inputs::report_archive_end): New function.
2656 (Incremental_inputs::report_object): Change prototype.
2657 (Incremental_inputs::report_input_section): New function.
2658 (Incremental_inputs::report_script): Change prototype.
2659 (Incremental_inputs::get_reloc_count): New function.
2660 (Incremental_inputs::set_reloc_count): New function.
2661 (Incremental_inputs::create_data_sections): New function.
2662 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2663 (Incremental_inputs::inputs_section): New function.
2664 (Incremental_inputs::symtab_section): New function.
2665 (Incremental_inputs::relocs_section): New function.
2666 (Incremental_inputs::get_stringpool): Add const.
2667 (Incremental_inputs::command_line): Add const.
2668 (Incremental_inputs::inputs): Remove.
2669 (Incremental_inputs::command_line_key): New function.
2670 (Incremental_inputs::input_file_count): New function.
2671 (Incremental_inputs::input_files): New function.
2672 (Incremental_inputs::relocs_entsize): New function.
2673 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2674 (Incremental_inputs::finalize_inputs): Remove.
2675 (Incremental_inputs::Input_info): Remove.
2676 (Incremental_inputs::lock_): Remove.
2677 (Incremental_inputs::inputs_): Change type.
2678 (Incremental_inputs::inputs_map_): Remove.
2679 (Incremental_inputs::current_object_entry_): New data member.
2680 (Incremental_inputs::inputs_section_): New data member.
2681 (Incremental_inputs::symtab_section_): New data member.
2682 (Incremental_inputs::relocs_section_): New data member.
2683 (Incremental_inputs::reloc_count_): New data member.
2684 (Incremental_inputs_reader): New class.
2685 (Incremental_symtab_reader): New class.
2686 (Incremental_relocs_reader): New class.
2687 * layout.cc (Layout::finalize): Move finalization of incremental info
2688 and creation of incremental info sections to follow finalization of
2689 symbol table. Set offsets for postprocessing sections.
2690 (Layout::create_incremental_info_sections): Call
2691 Incremental_inputs::create_data_sections. Add incremental symtab
2692 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2693 sections to layout after input sections.
2694 * layout.h (struct Timespec): Forward declaration.
2695 (Layout::incremental_inputs): Add const.
2696 (Layout::create_incremental_info_sections): Add parameter.
2697 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2698 * object.cc: Include incremental.h.
2699 (Relobj::finalize_incremental_relocs): New function.
2700 (Sized_relobj::do_layout): Record input sections in incremental info.
2701 * object.h (Object::output_section): New function.
2702 (Object::output_section_offset): Moved from Relobj.
2703 (Object::get_incremental_reloc_base): New function.
2704 (Object::get_incremental_reloc_count): New function.
2705 (Object::do_output_section): New function.
2706 (Object::do_output_section_offset): Moved from Relobj.
2707 (Object::do_get_incremental_reloc_base): New function.
2708 (Object::do_get_incremental_reloc_count): New function.
2709 (Object::Object): Initialize new data members.
2710 (Relobj::output_section): Renamed do_output_section and moved to
2711 protected.
2712 (Relobj::output_section_offset): Moved to Object.
2713 (Relobj::do_get_incremental_reloc_base): New function.
2714 (Relobj::do_get_incremental_reloc_count): New function.
2715 (Relobj::allocate_incremental_reloc_counts): New function.
2716 (Relobj::count_incremental_reloc): New function.
2717 (Relobj::finalize_incremental_relocs): New function.
2718 (Relobj::next_incremental_reloc_index): New function.
2719 (Relobj::reloc_counts_): New data member.
2720 (Relobj::reloc_bases_): New data member.
2721 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2722 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2723 (Sized_relobj::incremental_relocs_scan): New function.
2724 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2725 (Sized_relobj::incremental_relocs_write): New function.
2726 (Sized_relobj::incremental_relocs_write_reltype): New function.
2727 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2728 incremental link.
2729 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2730 archives and object files elsewhere.
2731 (Add_symbols::run): Report object files here.
2732 (Finish_group::run): Report end of archive at end of group.
2733 * reloc.cc: Include layout.h, incremental.h.
2734 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2735 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2736 (Sized_relobj::incremental_relocs_scan): New function.
2737 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2738 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2739 (Sized_relobj::incremental_relocs_write): New function.
2740 (Sized_relobj::incremental_relocs_write_reltype): New function.
2741 * script.cc (read_input_script): Rewrite test for incremental link.
2742 Change call to Incremental_inputs::report_script.
2743 * symtab.h (Symbol_table::first_global_index): New function.
2744 (Symbol_table::output_count): New function.
2745
ce0d1972
DK
27462010-08-12 Doug Kwan <dougkwan@google.com>
2747
2748 * arm.cc (Target_arm::merge_object_attributes): Check command line
2749 options --no-wchar-size-warning and --no-enum-size-warning.
2750 * options.h (General_options): Add ld-compatible options
2751 --no-enum-size-warning and --no-wchar-size-warning.
2752
6e5710ce
ILT
27532010-08-04 Ian Lance Taylor <iant@google.com>
2754
2755 * x86_64.cc (Target_x86_64::Scan::local): Use
2756 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2757 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2758 (Target_x86_64::Scan::global): Likewise.
2759 (Target_x86_64::Relocate::relocate): Likewise.
2760 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2761 Likewise.
2762
fef830db
CC
27632010-08-03 Cary Coutant <ccoutant@google.com>
2764
2765 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2766 to reserve space in merged_strings vector. Keep total input size
2767 for stats.
2768 (Output_merge_string::do_print_merge_stats): Print total input size.
2769 * merge.h (Output_merge_string): Add input_size_ field.
2770 * stringpool.cc (Stringpool_template::string_length): Move
2771 implementations out of Stringpool_template class and place in
2772 stringpool.h.
2773 * stringpool.h (string_length): Move out of Stringpool_template.
2774
1e3811b0
ILT
27752010-08-03 Ian Lance Taylor <iant@google.com>
2776
2777 PR 11712
2778 * layout.cc (relaxation_loop_body): If address of load segment is
2779 set, adjust address to include headers if possible.
2780
7af0c620
ILT
27812010-08-03 Ian Lance Taylor <iant@google.com>
2782
2783 * version.cc (version_string): Bump to 1.10.
2784
22f0da72
ILT
27852010-08-03 Ian Lance Taylor <iant@google.com>
2786
2787 PR 11805
2788 * layout.h (enum Output_section_order): Define.
2789 (class Layout): Update declarations.
2790 * layout.cc (Layout::get_output_section): Add order parameter.
2791 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2792 is_first_non_relro parameters. Change all callers.
2793 (Layout::choose_output_section): Likewise.
2794 (Layout::add_output_section_data): Likewise.
2795 (Layout::make_output_section): Likewise. Set order.
2796 (Layout::default_section_order): New function.
2797 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2798 * output.cc (Output_section::Output_section): Initialize order_.
2799 Don't initialize deleted fields.
2800 (Output_segment::Output_segment): Don't initialize deleted
2801 fields.
2802 (Output_segment::add_output_section_to_load): New function
2803 replacing add_output_section. Change all callers to call this or
2804 add_output_section_to_nonload.
2805 (Output_segment::add_output_section_to_nonload): New function.
2806 (Output_segment::remove_output_section): Rewrite.
2807 (Output_segment::add_initial_output_data): Likewise.
2808 (Output_segment::has_any_data_sections): Likewise.
2809 (Output_segment::is_first_section_relro): Likewise.
2810 (Output_segment::maximum_alignment): Likewise.
2811 (Output_segment::has_dynamic_reloc): New function replacing
2812 dynamic_reloc_count. Change all callers.
2813 (Output_segment::has_dynamic_reloc_list): New function replacing
2814 dynamic_reloc_count_list. Change all callers.
2815 (Output_segment::set_section_addresses): Rewrite.
2816 (Output_segment::set_offset): Rewrite.
2817 (Output_segment::find_first_and_last_list): Remove.
2818 (Output_segment::set_tls_offsets): Rewrite.
2819 (Output_segment::first_section_load_address): Likewise.
2820 (Output_segment::output_section_count): Likewise.
2821 (Output_segment::section_with_lowest_load_address): Likewise.
2822 (Output_segment::write_section_headers): Likewise.
2823 (Output_segment::print_sections_to_map): Likewise.
2824 * output.h (class Output_data): Remove dynamic_reloc_count_
2825 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2826 (Output_data::add_dynamic_reloc): Rewrite.
2827 (Output_data::has_dynamic_reloc): New function.
2828 (Output_data::dynamic_reloc_count): Remove.
2829 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2830 is_last_relro_, is_first_non_relro_, is_interp_,
2831 is_dynamic_linker_section_ fields. Add order and set_order
2832 functions. Remove is_relro_local, set_is_relro_local,
2833 is_last_relro, set_is_last_relro, is_first_non_relro,
2834 set_is_first_non_relro functions, is_interp, set_is_interp,
2835 is_dynamic_linker_section, and set_is_dynamic_linker_section
2836 functions.
2837 (class Output_segment): Change Output_data_list from std::list to
2838 std:;vector. Add output_lists_ field. Remove output_data_ and
2839 output_bss_ fields. Update declarations.
2840
3ff2ccb0
ILT
28412010-08-02 Ian Lance Taylor <iant@google.com>
2842
2843 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2844 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2845 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2846
88a4108b
ILT
28472010-08-02 Ian Lance Taylor <iant@google.com>
2848
2849 PR 11855
2850 * script.cc (Script_options::Script_options): Initialize
2851 symbol_definitions_ and symbol_references_.
2852 (Script_options::add_symbol_assignment): Update
2853 symbol_definitions_ and symbol_references_.
2854 (Script_options::add_symbol_reference): New function.
2855 (script_symbol): New function.
2856 * script.h (class Script_options): Add symbol_definitions_ and
2857 symbol_references_ fields.
2858 (Script_options::referenced_const_iterator): New type.
2859 (Script_options::referenced_begin): New function.
2860 (Script_options::referenced_end): New function.
2861 (Script_options::is_referenced): New function.
2862 (Script_options::any_unreferenced): New function.
2863 * script-c.h (script_symbol): Declare.
2864 * yyscript.y (exp): Call script_symbol.
2865 * symtab.cc: Include "script.h".
2866 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2867 Change all callers. Check symbols referenced by scripts.
2868 (Symbol_table::add_undefined_symbols_from_command_line): Add
2869 layout parameter. Change all callers.
2870 (Symbol_table::do_add_undefined_symbols_from_command_line):
2871 Likewise. Break out loop body. Check symbols referenced by
2872 scripts.
2873 (Symbol_table::add_undefined_symbol_from_command_line): New
2874 function broken out of
2875 do_add_undefined_symbols_from_command_line.
2876 * symtab.h (class Symbol_table): Update declarations.
2877 * archive.cc: Include "layout.h".
2878 (Archive::should_include_member): Add layout parameter. Change
2879 all callers. Check for symbol mentioned in expression.
2880 * archive.h (class Archive): Update declaration.
2881 * object.cc (Sized_relobj::do_should_include_member): Add layout
2882 parameter.
2883 * object.h (Object::should_include_member): Add layout parameter.
2884 Change all callers.
2885 (Object::do_should_include_member): Add layout parameter.
2886 (class Sized_relobj): Update declaration.
2887 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2888 parameter.
2889 * dynobj.h (class Sized_dynobj): Update declaration.
2890 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2891 layout parameter.
2892 * plugin.h (class Sized_pluginobj): Update declaration.
2893
5f1ab67a
ILT
28942010-08-02 Ian Lance Taylor <iant@google.com>
2895
2896 PR 11866
2897 * output.cc (Output_segment::set_offset): Search for the first and
2898 last sections rather than assuming that the list is in order.
2899 (Output_segment::find_first_and_last_list): New function.
2900 * output.h (class Output_segment): Update declarations.
2901 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2902 (relro_strip_test_SOURCES): New variable.
2903 (relro_strip_test_DEPENDENCIES): New variable.
2904 (relro_strip_test_LDFLAGS): New variable.
2905 (relro_strip_test_LDADD): New variable.
2906 (relro_strip_test.so): New target.
2907
a8df5856
ILT
29082010-08-02 Ian Lance Taylor <iant@google.com>
2909
2910 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2911 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2912 (Target_i386::got_tlsdesc_section): New function.
2913 (Target_i386::got_section): Create space for GOT entries for
2914 TLSDESC relocations.
2915 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2916 R_386_TLS_GOTDESC.
2917 (Target_i386::Scan::global): Likewise.
2918 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2919 using TLSDESC GOT.
2920 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2921 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2922 (Target_x86_64::got_tlsdesc_section): New function.
2923 (Target_x86_64::got_section): Create space for GOT entries for
2924 TLSDESC relocations.
2925 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2926 R_386_TLS_GOTDESC.
2927 (Target_x86_64::Scan::global): Likewise.
2928 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2929 using TLSDESC GOT.
2930
0c10a0a6
ILT
29312010-08-02 Ian Lance Taylor <iant@google.com>
2932
2933 * testsuite/final_layout.sh: Use dc to convert from hex to
2934 decimal.
2935
41cbeecc
ST
29362010-07-29 Sriraman Tallam <tmsriram@google.com>
2937
2938 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2939 paramter to the call to gold::gc_process_relocs.
2940 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2941 paramter to the call to gold::gc_process_relocs.
2942 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2943 parameter to the call to gold::gc_process_relocs.
2944 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2945 template parameter to the call to gold::gc_process_relocs.
2946 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2947 paramter to the call to gold::gc_process_relocs.
2948 * gc.h (get_embedded_addend_size): New function.
2949 (gc_process_relocs): Save the size of the reloc for use by ICF.
2950 * icf.cc (get_section_contents): Get the addend from the text section
2951 for SHT_REL relocation sections.
2952 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2953 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2954 * int_encoding.h (read_from_pointer): New overloaded function.
2955 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2956 * testsuite/icf_sht_rel_addend_test.sh: New file.
2957 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2958 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2959
6ea55b82
RW
29602010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2961
2962 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2963 * Makefile.in: Regenerate.
2964 * testsuite/Makefile.in: Regenerate.
2965
9691462b
ILT
29662010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2967
2968 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2969 * gold/testsuite/debug_msg.cc: Likewise.
2970 * gold/testsuite/odr_violation1.cc
2971 * gold/testsuite/odr_violation2.cc
2972
76897331
CC
29732010-07-21 Cary Coutant <ccoutant@google.com>
2974
2975 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2976 string, and length fields.
2977 (Output_merge_string::Merged_strings_list): New type.
2978 (Output_merge_string::Merged_strings_lists): New typedef.
2979 (Output_merge_string): Replace merged_strings_ with
2980 merged_strings_lists_.
2981 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2982 Merged_strings_list per input object and section. Don't store pointer
2983 to the string. Don't store length with each merged string entry.
2984 (Output_merge_string::finalize_merged_data): Loop over list of merged
2985 strings lists. Recompute length of each merged string.
2986
78384e8f
CC
29872010-07-15 Cary Coutant <ccoutant@google.com>
2988
2989 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2990 here.
2991
783659f9
ILT
29922010-07-14 Ian Lance Taylor <iant@google.com>
2993
2994 * descriptors.cc (Descriptors::open): Report correct name in error
2995 message.
2996
131687b4
DK
29972010-07-13 Doug Kwan <dougkwan@google.com>
2998
2999 * arm.cc (Arm_input_section::Arm_input_section): For a
3000 SHT_ARM_EXIDX section, always keeps the input sections.
3001 (Arm_input_section::set_exidx_section_link): New method.
3002 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3003 has_errors_ to false.
3004 (Arm_exidx_input_section::has_errors,
3005 Arm_exidx_input_section::set_has_errors): New methods.
3006 (Arm_exidx_input_section::has_errors_): New data member.
3007 (Arm_relobj::get_exidx_shndx_list): New method.
3008 (Arm_output_section::append_text_sections_to_list): Do not skip
3009 section without SHF_EXECINSTR.
3010 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3011 errors.
3012 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3013 section header. Make error messages more verbose. Check for
3014 a non-executable section linked to an EXIDX section.
3015 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3016 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3017 check that there is no deferred EXIDX section if we exit early.
3018 Instead of not making an EXIDX section in case of an error, make one
3019 and set the has_errors flag of it.
3020 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3021 in a relocatable link.
3022 (Target_arm::do_relax): Look for the EXIDX output section instead of
3023 assuming that it is called .ARM.exidx.
3024 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3025 section list. Do not check for SHF_EXECINSTR section flags but
3026 skip any input section with errors.
3027 * output.cc (Output_section::Output_section): Initialize
3028 always_keeps_input_sections_ to false.
3029 (Output_section::add_input_section): Check for
3030 always_keeps_input_sections_.
3031 * output.h (Output_section::always_keeps_input_sections,
3032 Output_section::set_always_keeps_input_sections): New methods.
3033 (Output_section::always_keeps_input_sections): New data member.
3034
69517287
RÁE
30352010-07-13 Rafael Espindola <espindola@google.com>
3036
3037 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3038 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3039
82742395
ILT
30402010-07-13 Philip Herron <herron.philip@googlemail.com>
3041 Ian Lance Taylor <iant@google.com>
3042
3043 * output.h (Output_section_lookup_maps::add_merge_section):
3044 Correct check of whether value was inserted.
3045 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3046 (Output_section_lookup_maps::add_relaxed_input_section):
3047 Likewise.
3048 * arm.cc (Target_arm::got_section): Remove used local os.
3049 * i386.cc (Target_i386::got_section): Likewise.
3050 * x86_64.cc (Target_x86_64::got_section): Likewise.
3051 * sparc.cc (Target_sparc::got_section): Likewise.
3052 (Target_sparc::relocate): Remove unused local have_got_offset.
3053 * powerpc.cc (Target_powerpc::relocate): Likewise.
3054
f2d707b5
ILT
30552010-07-13 Ian Lance Taylor <iant@google.com>
3056
241531d6
ILT
3057 * compressed_output.cc (zlib_decompress): Fix signature in
3058 !HAVE_ZLIB_H case.
3059
f2d707b5
ILT
3060 * archive.cc (Archive::include_member): Unlock an external member
3061 of a thin archive. Don't bother to delete an object we know is
3062 NULL.
3063
a2e47362
CC
30642010-07-12 Cary Coutant <ccoutant@google.com>
3065
3066 * compressed_output.cc (zlib_decompress): New function.
3067 (get_uncompressed_size): New function.
3068 (decompress_input_section): New function.
3069 * compressed_output.h (get_uncompressed_size): New function.
3070 (decompress_input_section): New function.
3071 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3072 Handle compressed debug sections.
3073 * layout.cc (is_compressed_debug_section): New function.
3074 (Layout::output_section_name): Map compressed section names to
3075 canonical names.
3076 * layout.h (is_compressed_debug_section): New function.
3077 (is_debug_info_section): Recognize compressed debug sections.
3078 * merge.cc: Include compressed_output.h.
3079 (Output_merge_data::do_add_input_section): Handle compressed
3080 debug sections.
3081 (Output_merge_string::do_add_input_section): Handle compressed
3082 debug sections.
3083 * object.cc: Include compressed_output.h.
3084 (Sized_relobj::Sized_relobj): Initialize new data members.
3085 (build_compressed_section_map): New function.
3086 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3087 * object.h (Object::section_is_compressed): New method.
3088 (Object::do_section_is_compressed): New method.
3089 (Sized_relobj::Compressed_section_map): New type.
3090 (Sized_relobj::do_section_is_compressed): New method.
3091 (Sized_relobj::compressed_sections_): New data member.
3092 * output.cc (Output_section::add_input_section): Handle compressed
3093 debug sections.
3094 * reloc.cc: Include compressed_output.h.
3095 (Sized_relobj::write_sections): Handle compressed debug sections.
3096
ce279a62
CC
30972010-07-08 Cary Coutant <ccoutant@google.com>
3098
3099 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3100 weak when resolving to a dynamic def.
3101 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3102 for weak undef/dynamic def cases. Adjust callers.
3103 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3104 undef_binding_weak_.
3105 (Symbol_table::sized_write_globals): Adjust symbol binding.
3106 (Symbol_table::sized_write_symbol): Add binding parameter.
3107 * symtab.h (Symbol::set_undef_binding): New method.
3108 (Symbol::is_undef_binding_weak): New method.
3109 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3110 (Symbol_table::should_override): Add new parameter.
3111 (Symbol_table::sized_write_symbol): Add new parameter.
3112
3113 * testsuite/weak_undef_file1.cc: Add new test case.
3114 * testsuite/weak_undef_file2.cc: Fix header comment.
3115 * testsuite/weak_undef_test.cc: Add new test case.
3116
b2286c10
DK
31172010-06-29 Doug Kwan <dougkwan@google.com>
3118
3119 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3120 Initialize USE_SYMBOL_.
3121 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3122 definition.
3123 (Arm_reloc_property::uses_symbol_): New data member declaration.
3124 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3125 uses symbol value and symbol is undefined but not weakly undefined.
3126
4802450a
RÁE
31272010-06-28 Rafael Espindola <espindola@google.com>
3128
3129 * plugin.cc (Plugin::load): Use dlerror.
3130
e5ca47ba
ILT
31312010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3132
3133 * symtab.cc (detect_odr_violations): When reporting an ODR
3134 violation, report an object where the symbol is defined.
3135
8a75a161
DK
31362010-06-25 Doug Kwan <dougkwan@google.com>
3137
3138 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3139 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3140 definition.
3141 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3142 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3143 target hook to detect function points.
3144 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3145 * icf.h (Icf::check_section_for_function_pointers): Change type of
3146 parameter SECTION_NAME to const reference to std::string. Use
3147 target hook to determine if section may have unsafe pointers.
3148 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3149 method definition.
3150
42218b9f
RÁE
31512010-06-21 Rafael Espindola <espindola@google.com>
3152
3153 * fileread.cc (Input_file::find_fie): New
3154 (Input_file::open): Use Input_file::find_fie.
3155 * fileread.h (Input_file::find_fie): New
3156 * plugin.cc (set_extra_library_path): New.
3157 (Plugin::load): Add set_extra_library_path to the transfer vector.
3158 (Plugin_manager::set_extra_library_path): New.
3159 (Plugin_manager::add_input_file): Use the extra search path if set.
3160 (set_extra_library_path(): New.
3161 * plugin.h (Plugin_manager): Add set_extra_library_path and
3162 extra_search_path_.
3163
a0506cca
CC
31642010-06-19 Cary Coutant <ccoutant@google.com>
3165
3166 * layout.cc (gdb_sections): Add .debug_types.
3167 (lines_only_debug_sections): Likewise.
3168
6508b958
RÁE
31692010-06-18 Rafael Espindola <espindola@google.com>
3170
3171 * plugin.cc (add_input_file,add_input_library)
3172 (Plugin_manager::add_input_file): Make filename arguments const.
3173 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
3174 const.
3175
3e235302
DK
31762010-06-16 Doug Kwan <dougkwan@google.com>
3177
3178 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
3179 .ARM.attributes section if we have not merged any input
3180 attributes sections.
3181
106e8a6c
DK
31822010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3183
3184 * arm.cc: Allow combining objects with no EABI version
3185 information.
3186
91ff43fe
RÁE
31872010-06-15 Rafael Espindola <espindola@google.com>
3188
3189 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
3190
68ed838c
ILT
31912010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3192
3193 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
3194 (struct iovec): Correct !HAVE_READV definition.
3195
f3a2388f
CC
31962010-06-10 Cary Coutant <ccoutant@google.com>
3197
3198 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
3199 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
3200 reloc sections.
3201 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
3202
3203 PR 11683
3204 * symtab.h (Symbol::is_placeholder): New member function.
3205 * target-reloc.h (relocate_section): Check for placeholder symbols.
3206
3207 * testsuite/Makefile.am (plugin_test_8): New test.
3208 (plugin_test_9): New test.
3209 * testsuite/Makefile.in: Regenerate.
3210
e1df38aa
NC
32112010-06-09 Nick Clifton <nickc@redhat.com>
3212
3213 * yyscript.y (input_list_element): Allow strings prefixed with
3214 the '-' character. Treat these as libraries.
3215 * script.cc (script_add_library): New function. Adds a library
3216 specified by "-l<name>" found in an input script.
3217 * script-c.h: Add prototype for script_add_library.
3218
25bbe950
DK
32192010-06-07 Doug Kwan <dougkwan@google.com>
3220
3221 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
3222 Restrict stub-group size to be within long conditional branch
3223 range when working around cortex-A8 erratum.
3224
0f32ea4c
ILT
32252010-06-07 Damien Diederen <dd@crosstwine.com>
3226
3227 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
3228 #ifdef typo.
3229
8fe2a369
ST
32302010-06-03 Sriraman Tallam <tmsriram@google.com>
3231
3232 PR gold/11658
3233 * output.cc
3234 (Output_section::Input_section_sort_entry::compare_section_ordering):
3235 Change to return non-zero correctly.
3236 (Output_section::Input_section_sort_section_order_index_compare
3237 ::operator()): Change to fix ambiguity in comparisons.
3238
6e9ba2ca
ST
32392010-06-01 Sriraman Tallam <tmsriram@google.com>
3240
3241 * gold.h (is_wildcard_string): New function.
3242 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
3243 (Layout::layout_eh_frame): Ditto.
3244 (Layout::find_section_order_index): New method.
3245 (Layout::read_layout_from_file): New method.
3246 * layout.h (Layout::find_section_order_index): New method.
3247 (Layout::read_layout_from_file): New method.
3248 (Layout::input_section_position_): New private member.
3249 (Layout::input_section_glob_): New private member.
3250 * main.cc (main): Call read_layout_from_file here.
3251 * options.h (--section-ordering-file): New option.
3252 * output.cc (Output_section::input_section_order_specified_): New
3253 member.
3254 (Output_section::Output_section): Initialize new member.
3255 (Output_section::add_input_section): Add new parameter.
3256 Keep input sections when --section-ordering-file is used.
3257 (Output_section::set_final_data_size): Sort input sections when
3258 section ordering file is specified.
3259 (Output_section::Input_section_sort_entry): Add new parameter.
3260 Check sorting type.
3261 (Output_section::Input_section_sort_entry::compare_section_ordering):
3262 New method.
3263 (Output_section::Input_section_sort_compare::operator()): Change to
3264 consider section_order_index.
3265 (Output_section::Input_section_sort_init_fini_compare::operator()):
3266 Change to consider section_order_index.
3267 (Output_section::Input_section_sort_section_order_index_compare
3268 ::operator()): New method.
3269 (Output_section::sort_attached_input_sections): Change to sort
3270 according to section order when specified.
e1df38aa
NC
3271 (Output_section::add_input_section<32, true>): Add new parameter.
3272 (Output_section::add_input_section<64, true>): Add new parameter.
3273 (Output_section::add_input_section<32, false>): Add new parameter.
3274 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
3275 * output.h (Output_section::add_input_section): Add new parameter.
3276 (Output_section::input_section_order_specified): New
3277 method.
3278 (Output_section::set_input_section_order_specified): New method.
3279 (Input_section::Input_section): Initialize section_order_index_.
3280 (Input_section::section_order_index): New method.
3281 (Input_section::set_section_order_index): New method.
3282 (Input_section::section_order_index_): New member.
3283 (Input_section::Input_section_sort_section_order_index_compare): New
3284 struct.
3285 (Output_section::input_section_order_specified_): New member.
3286 * script-sections.cc (is_wildcard_string): Delete and move modified
3287 method to gold.h.
3288 (Output_section_element_input::Output_section_element_input): Modify
3289 call to is_wildcard_string.
3290 (Output_section_element_input::Input_section_pattern
3291 ::Input_section_pattern): Ditto.
3292 (Output_section_element_input::Output_section_element_input): Ditto.
3293 * testsuite/Makefile.am (final_layout): New test case.
3294 * testsuite/Makefile.in: Regenerate.
3295 * testsuite/final_layout.cc: New file.
3296 * testsuite/final_layout.sh: New file.
3297
3537c84b
RÁE
32982010-06-01 Rafael Espindola <espindola@google.com>
3299
3300 * plugin.cc (Plugin::load): Pass the output name to the plugin.
3301
105b6afd
RÁE
33022010-06-01 Rafael Espindola <espindola@google.com>
3303
3304 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
3305 visibility of symbols.
3306
29e11421
DK
33072010-05-27 Doug Kwan <dougkwan@google.com>
3308
3309 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
3310 from start of output section instead of address for a local symbol
3311 in a merged or relaxed section when doing a relocatable link.
3312
5e0f337e
RÁE
33132010-05-26 Rafael Espindola <espindola@google.com>
3314
3315 PR 11604
3316 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
3317 adding sections the garbage collector removed.
3318 * gold/testsuite/Makefile.am: Add test.
3319 * gold/testsuite/Makefile.in: Regenerate.
3320 * gold/testsuite/plugin_test_7.sh: New.
3321 * gold/testsuite/plugin_test_7_1.c: New.
3322 * gold/testsuite/plugin_test_7_2.c: New.
3323
f4187277
RÁE
33242010-05-26 Rafael Espindola <espindola@google.com>
3325
3326 * script-sections.cc (Output_section_definition::set_section_addresses):
3327 Check for --section-start.
3328
5c388529
DK
33292010-05-26 Doug Kwan <dougkwan@google.com>
3330
3331 * arm.cc (Arm_scan_relocatable_relocs): New class.
3332 (Target_arm::relocate_special_relocatable): New method.
3333 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
3334 (Arm_relocate_functions::thumb_branch_common): Same.
3335 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
3336 instead of Default_scan_relocatable_relocs.
3337 * target-reloc.h (relocate_for_relocatable): Let target handle
3338 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
3339 * target.h (Sized_target::relocate_special_relocatable): New method.
3340
bca1c3ae
ILT
33412010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3342
3343 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
3344
0439c796
DK
33452010-05-23 Doug Kwan <dougkwan@google.com>
3346
3347 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
3348 instead of a cast.
3349 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3350 with a direct branch, not a conditional branch, to a stub.
3351 * merge.cc (Output_merge_base::record_input_section): New method
3352 defintion.
3353 (Output_merge_data::do_add_input_section): Record input section if
3354 keeps-input-sections flag is set.
3355 (Output_merge_string::do_add_input_section): Ditto.
3356 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3357 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3358 INPUT_SECTIONS_.
3359 (Output_merge_base::keeps_input_sections,
3360 Output_merge_base::set_keeps_input_sections,
3361 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3362 method definitions.
3363 (Output_merge_base::Input_sections): New type declaration.
3364 (Output_merge_base::input_sections_begin,
3365 Output_merge_base::input_sections_end,
3366 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3367 (Output_merge_base::bool keeps_input_sections_,
3368 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3369 Output_merge_base::input_sections_): New data members.
3370 (Output_merge_data::do_set_keeps_input_sections): New method
3371 defintion.
3372 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3373 * output.cc (Output_section::Input_section::relobj): Move method
3374 defintion from class declaration to here and handle merge sections.
3375 (Output_section::Input_section::shndx): Ditto.
3376 (Output_section::Output_section): Remove initializations of removed
3377 data members and initialize new data member LOOKUP_MAPS_.
3378 (Output_section::add_input_section): Set keeps-input-sections flag
3379 for a newly created merge output section as appropriate. Adjust code
3380 to use Output_section_lookup_maps class.
3381 (Output_section::add_relaxed_input_section): Adjst code for lookup
3382 maps code refactoring.
3383 (Output_section::add_merge_input_section): Add a new parameter
3384 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3385 class. If adding input section to a newly created merge output
3386 section fails, remove the new merge section.
3387 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3388 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3389 (Output_section::find_merge_section): Ditto.
3390 (Output_section::build_lookup_maps): New method defintion.
3391 (Output_section::find_relaxed_input_section): Adjust code to use
3392 Output_section_lookup_maps class.
3393 (Output_section::get_input_sections): Export merge sections. Adjust
3394 code to use Output_section_lookup_maps class.
3395 (Output_section:::add_script_input_section): Adjust code to use
3396 Output_section_lookup_maps class. Update lookup maps for merge
3397 sections also.
3398 (Output_section::discard_states): Use Output_section_lookup_maps.
3399 (Output_section::restore_states): Same.
3400 * output.h (Merge_section_properties): Move class defintion out of
3401 Output_section.
3402 (Output_section_lookup_maps): New class.
3403 (Output_section::Input_section::is_merge_section): New method
3404 defintion.
3405 (Output_section::Input_section::relobj): Move defintion out of class
3406 defintion. Declare method only.
3407 (Output_section::Input_section::shndx): Ditto.
3408 (Output_section::Input_section::output_merge_base): New method defintion.
3409 (Output_section::Input_section::u2_.pomb): New union field.
3410 (Output_section::Merge_section_by_properties_map,
3411 Output_section::Output_section_data_by_input_section_map,
3412 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3413 Remove types.
3414 (Output_section::add_merge_input_section): Add new parameter
3415 KEEPS_INPUT_SECTIONS.
3416 (Output_section::build_lookup_maps): New method declaration.
3417 (Output_section::merge_section_map_,
3418 Output_section::merge_section_by_properties_map_,
3419 Output_section::relaxed_input_section_map_,
3420 Output_section::is_relaxed_input_section_map_valid_): Remove data
3421 members.
3422 (Output_section::lookup_maps_): New data member.
3423
76295588
L
34242010-05-21 Doug Kwan <dougkwan@google.com>
3425
3426 PR gold/11619
3427 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3428 avoid a compilation error.
3429
d103a984
RÁE
34302010-05-19 Rafael Espindola <espindola@google.com>
3431
3432 * script-sections.cc (Output_section_definition::allocate_to_segment):
3433 Update the phdrs_list even when the output section is NULL.
3434 * testsuite/Makefile.am: Add test.
3435 * testsuite/Makefile.in: Regenerate.
3436 * testsuite/script_test_9.cc: New.
3437 * testsuite/script_test_9.sh: New.
3438 * testsuite/script_test_9.t: New.
3439
6625d24e
DK
34402010-05-19 Doug Kwan <dougkwan@google.com>
3441
3442 * arm.cc (Arm_input_section::original_size): New method.
3443 (Arm_input_section::do_addralign): Add a cast.
3444 (Arm_input_section::do_output_offset): Remove static cast.
3445 (Arm_input_section::original_addralign,
3446 Arm_input_section::original_size_): Change type to uint32_t.
3447 (Arm_input_section::init): Add safe casts for section alignment
3448 and size.
3449 (Arm_input_section::set_final_data_size): Do not set address and
3450 offset of stub table.
3451 (Arm_output_section::fix_exidx_coverage): Change use of of
3452 Output_section::Simple_input_section to that of
3453 Output_section::Input_section.
3454 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3455 except for the first pass.
3456 * output.cc (Output_section::get_input_sections): Change type of
3457 input_sections to std::list<Input_section>.
3458 (Output_section::add_script_input_section): Rename from
3459 Output_section::add_simple_input_section. Change type of SIS
3460 parameter from Simple_input_section to Input_section.
3461 * output.h (Output_section::Simple_input_section): Remove class.
3462 (Output_section::Input_section): Change class visibility to public.
3463 (Output_section::Input_section::addralign): Use stored alignments
3464 for special input sections if set.
3465 (Output_section::Input_section::set_addralign): New method.
3466 (Output_section::get_input_sections): Change parameter type from
3467 list of Simple_input_section to list of Input_section.
3468 (Output_section::add_script_input_section): Rename from
3469 Output_section::add_simple_input_section. Change first parameter's
3470 type from Simple_input_section to Input_section and remove the
3471 second and third parameters.
3472 * script-sections.cc (Input_section::Input_section_list): Change
3473 type to list of Output_section::Input_section/
3474 (Input_section_info::Input_section_info): Change parameter type of
3475 INPUT_SECTION to Output_section::Input_section.
3476 (Input_section_info::input_section): Change return type.
3477 (Input_section_info::input_section_): Change type to
3478 Output_section::Input_section.
3479 (Output_section_element_input::set_section_addresses): Adjust code
3480 to use Output_section::Input_section instead of
3481 Output_section::Simple_input_section. Adjust code for renaming
3482 of Output_section::add_simple_input_section.
3483 (Orphan_output_section::set_section_addresses): Ditto.
3484
e1e82ea4
RW
34852010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3486
3487 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3488 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3489
91e75c8a
RÁE
34902010-05-18 Rafael Espindola <espindola@google.com>
3491
3492 * options.cc (General_options::finalize): Handle -nostdlib.
3493 * options.h (nostdlib): New option.
3494 * script.cc (script_add_search_dir): Handle -nostdlib.
3495
da59ad79
DK
34962010-05-12 Doug Kwan <dougkwan@google.com>
3497
3498 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3499 attributes section only if there no attributes section after merging.
3500 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3501 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3502 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3503 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3504 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3505 and arm_attr_merge_7.stdout.
3506 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3507 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3508 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3509 arm_attr_merge_7b.o): New rules.
3510 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3511 arm_attr_merge_7
3512 * testsuite/Makefile.in: Regenerate.
3513 * testsuite/arm_attr_merge.sh: New file.
3514 * testsuite/arm_attr_merge_[67][ab].s: Same.
3515
3e01a7fd
NC
35162010-05-05 Nick Clifton <nickc@redhat.com>
3517
3518 * po/es.po: Updated Spanish translation.
3519
7ad2014a
L
35202010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3521
3522 * Makefile.am (install-exec-local): Properly install gold as
3523 default cross linker.
3524 * Makefile.in: Regenerated.
3525
4fda8867
NC
35262010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3527 Nick Clifton <nickc@redhat.com>
3528
3529 * configure.ac (install_as_default): Define and set to false
3530 unless --enable-gold or --enable-gold=both/gold has been
3531 specified.
3532 * configure: Regenerate.
3533
3534 * Makefile.am (install-exec-local): Install the executable as
3535 'ld.gold'. If install_as_default is true then also install it as
3536 'ld'.
3537 * Makefile.in: Regenerated.
3538
bd288ea2
ILT
35392010-04-24 Ian Lance Taylor <iant@google.com>
3540
3541 * layout.cc (Layout::layout_reloc): In relocatable link don't
3542 combine reloc sections for grouped sections.
3543
ef38fd8a
ST
35442010-04-23 Sriraman Tallam <tmsriram@google.com>
3545
3546 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3547 sections that are not ordinary to icf.
3548 * icf.cc (get_section_contents): Handle relocation pointing to section
3549 with no object or shndx information.
3550 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3551 * testsuite/Makefile.in: Regenerate.
3552 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3553 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3554
f6973bdc
ILT
35552010-04-22 Ian Lance Taylor <iant@google.com>
3556
3557 * expression.cc (Expression::Expression_eval_info): Add
3558 result_alignment_pointer field.
3559 (Expression::eval_with_dot): Add result_alignment_pointer
3560 parameter. Change all callers.
3561 (Expression::eval_maybe_dot): Likewise.
3562 (class Binary_expression): Add alignment_pointer parameter to
3563 left_value and right_value. Change all callers.
3564 (BINARY_EXPRESSION): Set result alignment.
3565 (class Trinary_expression): Add alignment_pointer parameter to
3566 arg2_value and arg3_value. Change all callers.
3567 (Trinary_cond::value): Set result alignment.
3568 (Max_expression::value, Min_expression::value): Likewise.
3569 (Align_expression::value): Likewise.
3570 * script-sections.cc (class Sections_element): Add dot_alignment
3571 parameter to set_section_addresses virtual function. Update
3572 instantiations.
3573 (class Output_section_element): Likewise.
3574 (Script_sections::create_segments): Add dot_alignment parameter.
3575 Change all callers.
3576 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3577 (Script_sections::set_phdrs_clause_addresses): Likewise.
3578 * script-sections.h: Update declarations.
3579 * script.h: Update declarations.
3580 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3581 min_p_align.
3582 * testsuite/script_test_3.t: Set large alignment.
3583 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3584 segment has expected alignment.
3585
9c9c98a5
NC
35862010-04-22 Nick Clifton <nickc@redhat.com>
3587
3588 * po/gold.pot: Updated by the Translation project.
3589 * po/vi.po: Updated Vietnamese translation.
3590
2253bfba
L
35912010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3592
3593 * testsuite/Makefile.am (check_PROGRAMS): Add
3594 icf_virtual_function_folding_test.
3595 * testsuite/Makefile.in: Regenerated.
3596
85fdf906
AH
35972010-04-15 Andrew Haley <aph@redhat.com>
3598
3599 * options.h (merge_exidx_entries): New option.
3600 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3601 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3602 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3603 (Target_arm::merge_exidx_entries): New function.
3604 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3605 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3606 to Arm_exidx_fixup constructor.
3607 Add new arg, merge_exidx_entries.
3608 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3609 Arm_output_section::fix_exidx_coverage.
3610
ce97fa81
ST
36112010-04-18 Sriraman Tallam <tmsriram@google.com>
3612
3613 * icf.cc (get_section_contents): Check for preemptible functions.
3614 Ignore addend when appropriate.
3615 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3616 section folded.
3617 (add_from_relobj): Check for section folded.
3618 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3619 * symtab.h (should_add_dynsym_entry): Add new parameter.
3620 * target-reloc.h (scan_relocs): Check for section folded.
3621 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3622 Check reloc types for function pointers in shared objects.
3623 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3624 case.
3625 (icf_preemptible_functions_test): New test case.
3626 (icf_string_merge_test): New test case.
3627 * testsuite.Makefile.in: Regenerate.
3628 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3629 bar_glob. Refactor code.
3630 * testsuite/icf_preemptible_functions_test.cc: New file.
3631 * testsuite/icf_preemptible_functions_test.sh: New file.
3632 * testsuite/icf_string_merge_test.cc: New file.
3633 * testsuite/icf_string_merge_test.sh: New file.
3634 * testsuite/icf_virtual_function_folding_test.cc: New file.
3635 * testsuite/icf_virtual_function_folding_test.sh: New file.
3636
04ceb17c
DK
36372010-04-14 Doug Kwan <dougkwan@google.com>
3638
3639 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3640 for local symbol recounting if we remove a section due to ICF.
3641 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3642 there are no regular objects in input.
3643
153e7da4
DK
36442010-04-13 Doug Kwan <dougkwan@google.com>
3645
3646 * arm.cc (Arm_input_section::set_final_data_size): Compute
3647 accurate final data size instead of using current data size.
3648
4dbd9faf
DK
36492010-04-09 Doug Kwan <dougkwan@google.com>
3650
3651 * layout.cc (Layout::choose_output_section): Handle script section
3652 types.
3653 (Layout::make_output_section_for_script): Add section type parameter.
3654 Handle script section types.
3655 * layout.h (Layout::make_output_section_for_script): Add section
3656 type parameter.
3657 * output.cc (Output_section::Output_section): Initialize data member
3658 is_noload_.
3659 (Output_section::do_reset_address_and_file_offset): Do not set address
3660 to 0 if section is a NOLOAD section.
3661 * output.h (Output_section::is_noload): New method.
3662 (Output_section::set_is_noload): Ditto.
3663 (Output_section::is_noload_): New data member.
3664 * script-c.h (Script_section_type): New enum type.
3665 (struct Parser_output_section_header): Add new file section_type.
3666 * script-sections.cc (Sections_element::output_section_name): Add
3667 parameter for returning script section type.
3668 (Output_section_definition::output_section_name): Ditto.
3669 (Output_section_definition::section_type)P; New method.
3670 (Output_section_definiton::script_section_type_name): Ditto.
3671 (Output_section_definition::script_section_type_): New data member.
3672 (Output_section_definition::Output_section_definition): Initialize
3673 data member Output_section_definition::script_section_type_.
3674 (Output_section_definition::create_sections): Pass script section type
3675 to Layout::make_output_section_for_script.
3676 (Output_section_definition::output_section_name): Return script
3677 section type to caller.
3678 (Output_section_definition::set_section_address): Do not advance
3679 dot value and load address if section type is NOLOAD. Set address
3680 of NOLOAD sections regardless of section flags.
3681 (Output_section_definition::print): Print section type if it is
3682 not SCRIPT_SECTION_TYPE_NONE.
3683 (Output_section_definition::section_type): New method.
3684 (Output_section_definition::script_section_type_name): Ditto.
3685 (Script_sections::output_section_name): Add new parameter
3686 PSECTION_TYPE for returning script section type. Pass it to
3687 section elements. Handle discard sections.
3688 (Sort_output_sections::operator()): Handle NOLOAD sections.
3689 * script-sections.h (Script_sections::Section_type): New enum type.
3690 (Script_sections::output_section_name): Add a new parameter for
3691 returning script section type.
3692 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3693 INFO and NOLOAD.
3694 * yyscript.y (union): Add new field SECTION_TYPE.
3695 (COPY, DSECT, INFO, NOLOAD): New tokens.
3696 (opt_address_and_section_type): Change type to output_section_header.
3697 (section_type): New non-terminal
3698 (section_header): Handle section type.
2253bfba 3699 (opt_address_and_section_type): Return section type value.
4dbd9faf 3700
721ea635
L
37012010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3702
3703 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3704 * testsuite/plugin_common_test_2.c (foo): Likewise.
3705
6bf924b0
DK
37062010-04-08 Doug Kwan <dougkwan@google.com>
3707
3708 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3709 Output_merge_data.
3710 * output.cc (Output_section::add_merge_input_section): Simplify
3711 code and return status of Output_merge_base::add_input_section.
e1df38aa 3712 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3713 returns true.
3714
24af6f92
DK
37152010-04-07 Doug Kwan <dougkwan@google.com>
3716
3717 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3718 if section is marked as containing instructions but has no mapping
3719 symbols.
3720 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3721 correct section index.
3722 (Arm_relobj::find_linked_text_section): Ditto.
3723
00698fc5
CC
37242010-04-07 Cary Coutant <ccoutant@google.com>
3725
3726 * archive.cc (include_member): Destroy Read_symbols_data object before
3727 releasing file.
3728 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3729 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3730 (Read_symbols_data::~Read_symbols_data) New destructor.
3731 (Section_relocs::Section_relocs) New constructor.
3732 (Section_relocs::~Section_relocs) New destructor.
3733 (Read_relocs_data::Read_relocs_data) New constructor.
3734 (Read_relocs_data::~Read_relocs_data) New destructor.
3735 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3736 pointers to NULL after deleting.
3737
7296d933
DK
37382010-04-07 Doug Kwan <dougkwan@google.com>
3739
3740 * arm.cc: Replace "endianity" with "endianness" in comments.
3741 (Arm_exidx_cantunwind): Ditto.
3742 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3743 (Arm_relobj::merge_flags_and_attributes): New method.
3744 (Arm_relobj::merge_flags_and_attributes_): New data member.
3745 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3746 (Arm_relobj::scan_sections_for_stubs): Ditto.
3747 (Arm_relobj::do_read_symbols): Check to see if we really want to
3748 merge processor-specific flags and attributes. Exit early if
3749 an object is empty except for section names and the undefined symbol.
3750 (Target_arm::do_finalize_sections): Move check for ELF format to
3751 Arm_relobj::do_read_symbols. Merge processor specific flags and
3752 attributes from a regular object only when we have determined that
3753 it is aapropriate. Do not create an .ARM.attributes section in
3754 output if there is no regular input object.
3755 (Target_arm::merge_processor_specific_flags): Check
3756 --warn-mismatch before printing any error.
3757 (Target_arm::merge_object_attributes): Ditto.
3758 * gold.cc (queue_middle_tasks): Handle the case in which there is
3759 no regular object in input.
3760 * options.cc (General_options::parse_EB): New method.
3761 (General_options::parse_EL): Same.
3762 (General_options::General_options): Initialize endianness_.
3763 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3764 New options.
3765 (General_options::Endianness): New enum.
3766 (General_options::endianness): New method.
3767 (General_options::endianness_): New data member.
3768 * parameters.cc (Parameters::set_options): Check target endianness.
3769 (Parameters::set_target_once): Ditto.
3770 (Parameters::check_target_endianness): New method.
3771 (parameters_force_valid_target): If either -EL or -EB is specified,
3772 use it to define endianness of default target.
3773 * parameters.h (Parameters::check_target_endianness): New method
3774 declaration.
3775 * target.h (class Target): Change "endianity" to "endianness"
3776 in comments.
3777
efc8d4f2
RW
37782010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3779
3780 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3781 * configure: Regenerate.
3782 * Makefile.in: Regenerate.
3783 * testsuite/Makefile.in: Regenerate.
3784
be234d88
CC
37852010-04-06 Cary Coutant <ccoutant@google.com>
3786
3787 gcc PR lto/42757
3788 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3789 prevailing definitions of common symbols.
3790 * testsuite/plugin_test_6.sh: New test case.
3791 * testsuite/plugin_common_test_1.c: New test case.
3792 * testsuite/plugin_common_test_2.c: New test case.
3793 * testsuite/Makefile.am (plugin_test_6): New test case.
3794 * testsuite/Makefile.in: Regenerate.
3795
bd32c6bd
NC
37962010-04-06 Nick Clifton <nickc@redhat.com>
3797
3798 * po/vi.po: New Vietnamese translation.
3799
323c532f
DK
38002010-03-30 Doug Kwan <dougkwan@google.com>
3801
3802 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3803
4fcd97eb
DK
38042010-03-25 Doug Kwan <dougkwan@google.com>
3805
3806 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3807 to avoid a conversion warning on a 32-bit host.
3808
4ebf39db
ILT
38092010-03-24 Ian Lance Taylor <iant@google.com>
3810
3811 * testsuite/script_test_3.t: Add a TLS segment.
3812 * testsuite/Makefile.am (check_PROGRAMS): Add
3813 tls_phdrs_script_test.
3814 (tls_phdrs_script_test_SOURCES): Define.
3815 (tls_phdrs_script_test_DEPENDENCIES): Define.
3816 (tls_phdrs_script_test_LDFLAGS): Define.
3817 (tls_phdrs_script_test_LDADD): Define.
3818 * testsuite/Makefile.in: Rebuild.
3819
4a599bdd
CC
38202010-03-23 Cary Coutant <ccoutant@google.com>
3821
3822 * fileread.cc (find_or_make_view): Fix comment.
3823
6c93b22c
ILT
38242010-03-23 Ian Lance Taylor <iant@google.com>
3825
3826 * script-sections.cc (class Orphan_section_placement): Define
3827 PLACE_TLS and PLACE_TLS_BSS.
3828 (Orphan_section_placement::Orphan_section_placement): Initialize
3829 new places.
3830 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3831 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3832 (tls_script_test_SOURCES): Define.
3833 (tls_script_test_DEPENDENCIES): Define.
3834 (tls_script_test_LDFLAGS): Define.
3835 (tls_script_test_LDADD): Define.
3836 * testsuite/Makefile.in: Rebuild.
3837
a2c7281b
DK
38382010-03-22 Doug Kwan <dougkwan@google.com>
3839
3840 * arm.cc (Arm_relocate_functions::abs8,
3841 Arm_relocate_functions::abs16): Use correct check for overflow
3842 specified in the ARM ELF specs.
3843 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3844 target of a BLX instruction specially.
3845 (Reloc_stub::stub_type_for_reloc): Ditto.
3846 (Relocate::relocate): Use symbolic names instead of numeric relocation
3847 codes to report error.
3848 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3849 workaround.
3850 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3851 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3852 thumb2_blx_out_of_range.stdout
3853 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3854 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3855 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3856 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3857 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3858 thumb2_blx_in_range, thumb2_blx_in_range.o,
3859 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3860 thumb2_blx_out_of_range.o): New rules.
3861 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3862 thumb2_blx_in_range and thumb2_blx_out_of_range.
3863 * testsuite/Makefile.in: Regenerate.
3864 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3865 * testsuite/thumb_blx_in_range.s: New file.
3866 * testsuite/thumb_blx_out_of_range.s: New file.
3867
b0193076
RÁE
38682010-03-22 Rafael Espindola <espindola@google.com>
3869
3870 * archive.cc (Should_include): Move to archive.h.
3871 (should_include_member): Make it a member of Archive.
3872 (Lib_group): New.
3873 (Add_lib_group_symbols): New.
3874 * archive.h: Include options.h.
3875 (Archive_member): Moved from Archive.
3876 (Should_include): Moved from archive.cc.
3877 (Lib_group): New.
3878 (Add_lib_group_symbols): New.
3879 * dynobj.cc (do_should_include_member): New.
3880 * dynobj.h (do_should_include_member): New.
3881 * gold.cc (queue_initial_tasks): Update call to queue.
3882 * main.cc (main): Print lib group stats.
3883 * object.cc (do_should_include_member): New.
3884 * object.h: Include archive.h.
3885 (Object::should_include_member): New.
3886 (Object::do_should_include_member): New.
3887 (Sized_relobj::do_should_include_member): New.
3888 * options.cc (General_options::parse_start_lib): New.
3889 (General_options::parse_end_lib): New.
3890 (Input_arguments::add_file): Handle lib groups.
3891 (Input_arguments::start_group): Check we are not in a lib.
3892 (Input_arguments::start_lib): New.
3893 (Input_arguments::end_lib): New.
3894 * options.h (General_options): Add start_lib and end_lib.
3895 (Input_argument::lib_): New.
3896 (Input_argument::lib): New.
3897 (Input_argument::is_lib): New.
3898 (Input_file_lib): New.
3899 (Input_arguments::in_lib_): New.
3900 (Input_arguments::in_lib): New.
3901 (Input_arguments::start_lib): New.
3902 (Input_arguments::end_lib_): New.
3903 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3904 in unused members as preempted.
3905 (Sized_pluginobj::do_should_include_member): New.
3906 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3907 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3908 return the blocker.
3909 (Read_symbols::do_whole_lib_group): New.
3910 (Read_symbols::do_lib_group): New.
3911 (Read_symbols::do_read_symbols): Handle lib groups.
3912 (Read_symbols::get_name): Handle lib groups.
3913 * readsyms.h (Read_symbols): Add an archive member pointer.
3914 (Read_symbols::do_whole_lib_group): New.
3915 (Read_symbols::do_lib_group): New.
3916 (Read_symbols::member_): New.
3917 * script.cc (read_input_script): Update call to queue_soon.
3918
d099120c
DK
39192010-03-19 Doug Kwan <dougkwan@google.com>
3920
3921 * arm.cc (Stub_table::Stub_table): Initialize new data members
3922 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3923 (Stub_table::add_reloc_stub): Assign stub offset and update
3924 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3925 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3926 New data members.
3927 (Stub_table::update_data_size_and_addralign): Use
3928 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3929 instead of going over all reloc stubs.
3930 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3931 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3932 Stringpool_template::offset_ to size of Stringpool_char.
3933 (Stringpool_template::new_key_offset): Remove code to initialize
3934 Stringpool_template::offset_.
3935 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3936 Stringpool_template::offset_ to zero.
3937
1aa37384
DK
39382010-03-15 Doug Kwan <dougkwan@google.com>
3939
3940 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3941 offset_.
3942 (Stringpool_template::new_key_offset): New method.
3943 (Stringpool_template::add_string): Assign offsets when adding new
3944 strings.
3945 (Stringpool_template::set_string_offsets): Do not set string offsets
3946 when not optimizing.
3947 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3948 member size_.
3949 (Chunked_vector::clear): Clear size_.
3950 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3951 (Chunked_vector::size): Return size_.
3952 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3953 (Chunked_vector::size_): New data member.
1aa37384
DK
3954 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3955 (Stringpool_template::new_key_offset): New method declaration.
3956 (Stringpool_template::offset_): New data member.
3957
b672b057
RÁE
39582010-03-15 Rafael Espindola <espindola@google.com>
3959
3960 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3961 Add_symbols' constructor.
3962 * readsyms.h (Add_symbols): Remove the input_group member.
3963
b6848d3c
ILT
39642010-03-10 Ian Lance Taylor <iant@google.com>
3965
3966 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3967 target to ask whether a reference to a symbol requires a stack
3968 split.
3969 * target.h (Target::is_call_to_non_split): New function.
3970 (Target::do_is_call_to_non_split): Declare virtual function.
3971 * target.cc: Include "symtab.h".
3972 (Target::do_is_call_to_non_split): New function.
3973 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3974
a2a5469e
CC
39752010-03-10 Cary Coutant <ccoutant@google.com>
3976
3977 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3978 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3979 (File_read::open[2]): Add whole_file_view_ to list of views.
3980 (File_read::make_view): Remove test of whole_file_view_.
3981 (File_read::find_or_make_view): Create whole_file_view_ if
3982 necessary.
3983 (File_read::clear_views): Replace bool parameter with enum;
3984 adjust all callers. Don't delete views with permanent data;
3985 do delete cached views and views from archives if
3986 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3987 if clearing the corresponding view.
3988 * fileread.h (File_read::Clear_views_mode): New enum.
3989 (File_read::View::is_permanent_view): New method.
3990 (File_read::clear_views): Replace bool parameter
3991 with enum; adjust all callers.
3992 * options.h (General_options): Change keep_files_mapped option;
3993 add map_whole_files.
3994 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3995 releasing the file.
3996 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3997 the file.
3998
8861f32b
DM
39992010-03-10 David S. Miller <davem@davemloft.net>
4000
4001 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4002
d62d0f5f
ST
40032010-03-09 Sriraman Tallam <tmsriram@google.com>
4004
4005 * icf.cc (get_section_contents): Add '@' marker after processing the
4006 merge reloc.
4007
9177756d
DK
40082010-03-08 Doug Kwan <dougkwan@google.com>
4009
4010 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4011 due to a conversion warning.
4012 (Arm_relobj::update_output_local_symbol_count): Check for local
4013 symbol with unset output index.
4014
9e9e071b
ILT
40152010-03-05 Ian Lance Taylor <iant@google.com>
4016
4017 * options.h (class General_options): Add --spare-dynamic-tags.
4018 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4019 --spare-dynamic-tags.
4020
a81ee015
ILT
40212010-03-05 Ian Lance Taylor <iant@google.com>
4022
4023 * incremental.cc: Include "libiberty.h".
4024
44ec90b9
RO
40252010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4026
4027 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4028 function, is_info_ member.
4029 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4030 (Versions::Versions): Update caller.
4031 (Versions::define_base_version): Likewise.
4032 (Versions::add_def): Likewise.
4033
0897ed3b
ST
40342010-03-03 Sriraman Tallam <tmsriram@google.com>
4035
4036 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4037 (Scan::possible_function_pointer_reloc): New function.
4038 (Scan::local_reloc_may_be_function_pointer): Change to call
4039 possible_function_pointer_reloc.
4040 (Scan::global_reloc_may_be_function_pointer): Ditto.
4041 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4042 relocations in ".data.rel.ro._ZTV" section.
4043 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4044 * testsuite/icf_safe_so_test.cc: Ditto.
4045 * testsuite/icf_safe_test.cc: Ditto.
4046 * testsuite/icf_safe_test.sh: Ditto.
4047
d3bbad62
ILT
40482010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4049 Ian Lance Taylor <iant@google.com>
4050
4051 * target-reloc.h (relocate_section): Check the symbol table index
4052 for -1U before setting the local symbol index.
4053 (scan_relocatable_relocs): If copying the relocation, record that
4054 the local symbol is required.
4055 * object.h (Symbol_value::is_output_symtab_index_set): New
4056 function.
4057 (Symbol_value::may_be_discarded_from_output_symtab): New
4058 function.
4059 (Symbol_value::has_output_symtab_entry): New function.
4060 (Symbol_value::needs_output_symtab_entry): Remove.
4061 (Symbol_value::output_symtab_index): Make sure the symbol index is
4062 set.
4063 (Symbol_value::set_output_symtab_index): Make sure the symbol
4064 index is not set. Make sure the new index is valid.
4065 (Symbol_value::set_must_have_output_symtab_entry): New function.
4066 (Symbol_value::has_output_dynsym_entry): New function.
4067 (Symbol_value::set_output_dynsym_index): Make sure the new index
4068 is valid.
4069 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4070 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4071 local symbol if permitted.
4072 (Sized_relobj::do_finalize_local_symbols): Call
4073 is_output_symtab_index_set rather than needs_output_symtab_entry.
4074 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4075 rather than needs_output_symtab_entry. Call
4076 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4077 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4078 is_output_symtab_index_set rather than needs_output_symtab_entry.
4079 * testsuite/discard_locals_relocatable_test.c: New file.
4080 * testsuite/discard_locals_test.sh: Test -r.
4081 * testsuite/Makefile.am (check_DATA): Add
4082 discard_locals_relocatable_test1.syms,
4083 discard_local_relocatable_test2.syms.
4084 (MOSTLYCLEANFILES): Likewise. Also add
4085 discard_locals_relocatable_test1.lout and
4086 discard_locals_relocatable_test2.out.
4087 (discard_locals_relocatable_test1.syms): New target.
4088 (discard_locals_relocatable_test.o): New target.
4089 (discard_locals_relocatable_test1.out): New target.
4090 (discard_locals_relocatable_test2.syms): New target.
4091 (discard_locals_relocatable_test2.out): New target.
4092 (various): Add missing ../ld-new dependencies.
4093 * testsuite/Makefile.in: Rebuild.
4094
7e8ccf26
NC
40952010-03-03 Nick Clifton <nickc@redhat.com>
4096
4097 * po/fi.po: New Finnish translation.
4098
2a0ff005
DK
40992010-03-01 Doug Kwan <dougkwan@google.com>
4100
4101 * layout.cc (Layout::Layout): Force section types of .init_array*,
4102 .preinit_array* and .fini_array* sections.
4103 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4104 Fix check of return value of std::string::find.().
4105 (Output_section::Input_section_sort_compare::operator()): Remove
4106 comment about .init_array.
4107 (Output_section::Input_section_sort_init_fini_compare::operator()):
4108 New method.
4109 (Output_section::sort_attached_input_sections): Handle .init_array
4110 and .fini_array specially.
4111 * output.h (Output_section::Inut_section_sort_compare): Update
4112 comment.
4113 (Output_section::Input_section_sort_init_fini_compare): New struct.
4114
c3e4ae29
DK
41152010-02-26 Doug Kwan <dougkwan@google.com>
4116
4117 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4118 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4119 * testsuite/debug_msg.sh: Avoid matching source line number for
4120 use of global variable undef_int.
4121
2fd9ae7a
DK
41222010-02-26 Doug Kwan <dougkwan@google.com>
4123
4124 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4125 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4126 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4127 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4128 * options.cc (General_options::General_options): Initialize member
4129 fix_v4bx_.
4130 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4131 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4132 and rm_no_fix_v4bx.stdout
4133 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4134 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4135 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4136 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4137 and arm_no_fix_v4bx.
4138 * Makefile.in: Regenerate.
4139 * testsuite/arm_fix_v4bx.s: New file.
4140 * testsuite/arm_fix_v4bx.sh: Ditto.
4141
67ec7d0b
DK
41422010-02-24 Doug Kwan <dougkwan@google.com>
4143
4144 * arm.cc (Target_arm::got_section): Make the .got section the first
4145 non RELRO section in the data segment.
4146 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4147 suffixes of section names.
4148
10165461
DK
41492010-02-24 Doug Kwan <dougkwan@google.com>
4150
4151 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4152 flags and attributes merging if an input file is a binary file.
4153 * fileread.cc (Input_file::open): Record format of original file.
4154 * fileread.h (Input_file::Format): New enum type.
4155 (Input_file::Input_file): Initialize data member format_.
4156 (Input_file::format): New method definition.
4157 (Input_file::format_):: New data member.
4158
4a54abbb
DK
41592010-02-24 Doug Kwan <dougkwan@google.com>
4160
4161 * arm.cc (Arm_output_data_got): New class.
4162 (ARM_TCB_SIZE): New constant
4163 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4164 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4165 If user uses a script with a SECTIONS clause, issue only a warning
4166 for a misplaced EXIDX input section. Otherwise, issue an error.
4167 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4168 garbage collection.
4169 (Target_arm::got_mode_index_entry): Handle static linking.
4170 (Target_arm::Scan::local): Ditto.
4171 (Target_arm::Scan::global): Ditto.
4172 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
4173 all incorrectly implemented relocations.
e1df38aa 4174 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
4175 Arm_output_section::fix_exidx_coverage.
4176 * layout.cc (Layout::section_name_mapping): Remove trailing dots
4177 from ".ARM.exidx." and ".ARM.extab.".
4178
ca419a6f
ILT
41792010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4180
4181 * arm.cc (Target_arm::do_finalize_sections): Create attribute
4182 section if it does not already exist.
4183 * attributes.cc (Attributes_section_data::Attributes_section_data):
4184 Don't crash if size is zero.
4185
135b9c78
ILT
41862010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4187 Ian Lance Taylor <iant@google.com>
4188
4189 * gold.cc (queue_middle_tasks): If no input files were opened,
4190 exit.
4191 * workqueue.h (Task_function::Task_function): Assert that there is
4192 a blocker.
4193
bb0bfe4f
DK
41942010-02-22 Doug Kwan <dougkwan@google.com>
4195
4196 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
4197 * icf.cc (get_section_contents): Cast snprintf arguments to long long
4198 types to avoid warnings due to different uint64_t implementations
4199 on different hosts.
4200
2a2b6d42
DK
42012010-02-21 Doug Kwan <dougkwan@google.com>
4202
4203 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
4204 handling of the maximum backward branch offset.
4205 (Arm_relocate_functions::thumb_branch_common): Ditto.
4206 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
4207 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 4208 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
4209 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
4210 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
4211 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
4212 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
4213 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
4214 thumb_bl_out_of_range thumb_bl_out_of_range.o,
4215 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
4216 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
4217 thumb2_bl_out_of_range.o): New rules.
4218 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
4219 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
4220 thumb2_bl_out_of_range
4221 * testsuite/Makefile.in: Regenerate.
4222 * testsuite/arm_bl_in_range.s: New file.
4223 * testsuite/arm_bl_out_of_range.s: Ditto.
4224 * testsuite/arm_branch_in_range.sh: Ditto.
4225 * testsuite/arm_branch_range.t: Ditto.
4226 * testsuite/thumb2_branch_range.t: Ditto.
4227 * testsuite/thumb_bl_in_range.s: Ditto.
4228 * testsuite/thumb_bl_out_of_range.s: Ditto.
4229 * testsuite/thumb_branch_range.t: Ditto.
4230
b487ad64
ST
42312010-02-20 Sriraman Tallam <tmsriram@google.com>
4232
4233 * gc.h (gc_process_relocs): Change vectors to point to the new list.
4234 Add reloc offset information.
4235 * icf.cc (get_section_contents): Change iterators to point to the new
4236 vectors. Add reloc offset information to the contents.
4237 * icf.h (Icf::Sections_reachable_info): New typedef.
4238 (Icf::Sections_reachable_list): New typedef.
4239 (Icf::Offset_info): New typedef.
4240 (Icf::Reloc_info): New struct typedef.
4241 (Icf::Reloc_info_list): New typedef.
4242 (Icf::symbol_reloc_list): Delete method.
4243 (Icf::addend_reloc_list): Delete method.
4244 (Icf::section_reloc_list): Delete method.
4245 (Icf::reloc_info_list): New method.
4246 (Icf::reloc_info_list_): New member.
4247
f96accdf
DK
42482010-02-19 Doug Kwan <dougkwan@google.com>
4249
4250 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
4251 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
4252 * arm.cc (Arm_relocation_functions): New forward declaration.
4253 (Target_arm::Target_arm): Initialize new data members
4254 got_mod_index_offset_ and tls_base_symbol_defined_.
4255 (Target_arm::Relocate::relocate_tls): New method.
4256 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
4257 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
4258 New methods.
4259 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
4260 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
4261 (Target_arm::got_mod_index_offset_,
4262 Target_arm::tls_base_symbol_defined_): New data members.
4263 (Target_arm::Scan::local, Target::Scan::global,
4264 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
4265 relocations.
4266
c8761b9a
DK
42672010-02-18 Doug Kwan <dougkwan@google.com>
4268
4269 * arm.cc (Arm_relobj::find_linked_text_section): New method.
4270 (Arm_relobj::make_exidx_input_section): Pass section index of linked
4271 text section as a parameter becuase some broken tools may not set
4272 the link in section header.
4273 (Target_arm::has_got_section): New method.
4274 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
4275 without any mapping symbol as data only. Remove warning.
4276 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
4277 link in its section header, try to discover the link by inspecting the
4278 REL31 relocation at the beginning of the section.
4279 (Target_arm::Scan::check_non_pic): Report name of offending relocation
4280 in error message.
4281 (Target_arm::Scan::global): Treat any reference to the symbol
4282 _GLOBAL_OFFSET_TABLE_ as a GOT access.
4283
21bb3914
ST
42842010-02-12 Sriraman Tallam <tmsriram@google.com>
4285
4286 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
4287 (Scan::global_reloc_may_be_function_pointer): New function.
4288 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4289 (Scan::global_reloc_may_be_function_pointer): New function.
4290 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4291 (Scan::global_reloc_may_be_function_pointer): New function.
4292 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
4293 (Scan::global_reloc_may_be_function_pointer): New function.
4294 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
4295 (Scan::global_reloc_may_be_function_pointer): New function.
4296 (Scan::possible_function_pointer_reloc): New function.
4297 (Target_x86_64::can_check_for_function_pointers): New function.
4298 * gc.h (gc_process_relocs): Scan relocation types to determine if
4299 function pointers were taken for targets that support it.
4300 * icf.cc (Icf::find_identical_sections): Include functions for
4301 folding in safe ICF whose pointer is not taken.
4302 * icf.h (Secn_fptr_taken_set): New typedef.
4303 (fptr_section_id_): New member.
4304 (section_has_function_pointers): New function.
4305 (set_section_has_function_pointers): New function.
4306 (check_section_for_function_pointers): New function.
4307 * options.h: Fix comment for safe ICF option.
4308 * target.h (can_check_for_function_pointers): New function.
4309 * testsuite/Makefile.am: Add icf_safe_so_test test case.
4310 Modify icf_safe_test for X86-64.
4311 * testsuite/Makefile.in: Regenerate.
4312 * testsuite/icf_safe_so_test.cc: New file.
4313 * testsuite/icf_safe_so_test.sh: New file.
4314 * testsuite/icf_safe_test.cc (kept_func_3): New function.
4315 (main): Change to take pointer to function kept_func_3.
4316 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
4317 folding is done correctly for X86-64.
4318
0da6fa6c
DM
43192010-02-12 David S. Miller <davem@davemloft.net>
4320
4321 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
4322 is_symbolless parameter.
4323 (Output_reloc<SHT_REL>::is_symbolless): New.
4324 (Output_reloc<SHT_REL>::is_symbolless_): New.
4325 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
4326 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
4327 (Output_reloc<SHT_RELA>::is_symbolless): New.
4328 (Output_data_reloc::add_global): Handle is_symbolless.
4329 (Output_data_reloc::add_global_relative): Likewise.
4330 (Output_data_reloc::add_local): Likewise.
4331 (Output_data_reloc::add_local_relative): Likewise.
4332 (Output_data_reloc::add_symbolless_global_addend): New.
4333 (Output_data_reloc::add_symbolless_local_addend): New.
4334 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
4335 is_symbolless.
4336 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
4337 instead of ->is_relative_
4338 (Output_reloc::write): Likewise.
4339 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
4340 (Output_reloc::write_rel): Simplify.
4341
4342 * sparc.cc (Target_sparc::Scan::local): Use
4343 ->add_symbolless_local_addend as needed.
4344 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
4345 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
4346 based upon relocation offset.
4347
e4782e83
DK
43482010-02-11 Doug Kwan <dougkwan@google.com>
4349
4350 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4351 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4352 beginning of function.
4353 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4354 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4355 parameter is_32bit in calls to should_apply_static_reloc.
4356 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4357 (check_DATA): Add arm_abs_global.stdout.
4358 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4359 arm_abs_global.stdout): New rules.
4360 (MOSTLLYCLEANFILES): Add arm_abs_global
4361 * Makefile.in: Regenerate.
4362 * testsuite/arm_abs_global.s: New file.
4363 * testsuite/arm_abs_global.sh: Ditto.
4364 * testsuite/arm_abs_lib.s: Ditto.
4365
93ceb764
ILT
43662010-02-11 Ian Lance Taylor <iant@google.com>
4367
4368 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4369 Read_relocs task.
4370 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4371 Allocate_commons_task first.
4372 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4373 task, rather than symtab_lock_.
4374 (Gc_process_relocs::~Gc_process_relocs): New function.
4375 (Gc_process_relocs::is_runnable): Check this_blocker_.
4376 (Gc_process_relocs::locks): Use next_blocker_ rather than
4377 blocker_.
4378 (Scan_relocs::~Scan_relocs): New function.
4379 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4380 symtab_lock_.
4381 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4382 next_blocker_.
4383 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4384 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4385 constructor accordingly.
4386 (class Gc_process_relocs): Likewise.
4387 (class Scan_relocs): Likewise.
4388 * common.h (class Allocate_commons_task): Remove symtab_lock_
4389 field, and corresponding constructor parameter.
4390 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4391 symtab_lock_.
4392 (Allocate_commons_task::locks): Likewise.
4393
114dfbe1
ILT
43942010-02-11 Ian Lance Taylor <iant@google.com>
4395
4396 * gold-threads.h (class Once): Define.
4397 (class Initialize_lock): Rewrite as child of Once.
4398 * gold-threads.cc (class Once_initialize): Define.
4399 (once_pointer_control): New static variable.
4400 (once_pointer, once_arg): New static variables.
4401 (c_run_once): New static function.
4402 (Once::Once, Once::run_once, Once::internal_run): New functions.
4403 (class Initialize_lock_once): Remove.
4404 (initialize_lock_control): Remove.
4405 (initialize_lock_pointer): Remove.
4406 (initialize_lock_once): Remove.
4407 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4408 (Initialize_lock::initialize): Rewrite.
4409 (Initialize_lock::do_run_once): New function.
4410 * archive.cc (Archive::interpret_header): Only clear name if it is
4411 not already empty.
4412 * fileread.cc: Include "gold-threads.h"
4413 (file_counts_lock): New static variable.
4414 (file_counts_initialize_lock): Likewise.
4415 (File_read::release): Only increment counts when using --stats.
4416 Use a lock around the increment.
4417 * parameters.cc (class Set_parameters_target_once): Define.
4418 (set_parameters_target_once): New static variable.
4419 (Parameters::Parameters): Move here from parameters.h.
4420 (Parameters::set_target): Rewrite.
4421 (Parameters::set_target_once): New function.
4422 (Parameters::clear_target): Move here and rewrite.
4423 * parameters.h (class Parameters): Update declarations. Add
4424 set_parameters_target_once_ field.
4425 (Parameters::Parameters): Move to parameters.cc.
4426 (Parameters::clear_target): Likewise.
4427 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4428 task.
4429 (Start_group::~Start_group): New function.
4430 (Start_group::is_runnable): New function.
4431 (Start_group::locks, Start_group::run): New functions.
4432 (Finish_group::run): Change saw_undefined to size_t.
4433 * readsyms.h (class Start_group): Define.
4434 (class Finish_group): Change saw_undefined_ field to size_t.
4435 (Finish_group::Finish_group): Remove saw_undefined and
4436 this_blocker parameters. Change all callers.
4437 (Finish_group::set_saw_undefined): New function.
4438 (Finish_group::set_blocker): New function.
4439 * symtab.h (class Symbol_table): Change saw_undefined to return
4440 size_t. Change saw_undefined_ field to size_t.
4441 * target-select.cc (Set_target_once::do_run_once): New function.
4442 (Target_selector::Target_selector): Initialize set_target_once_
4443 field. Don't initialize lock_ and initialize_lock_ fields.
4444 (Target_selector::instantiate_target): Rewrite.
4445 (Target_selector::set_target): New function.
4446 * target-select.h (class Set_target_once): Define.
4447 (class Target_selector): Update declarations. Make
4448 Set_target_once a friend. Remove lock_ and initialize_lock_
4449 fields. Add set_target_once_ field.
4450
fa17a3f4
ILT
44512010-02-10 Ian Lance Taylor <iant@google.com>
4452
4453 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4454 queueing any tasks.
4455 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4456 (queue_middle_tasks): Add all blockers before queueing any tasks.
4457 (queue_final_tasks): Likewise.
4458 * token.h (Task_token::add_blockers): New function.
4459 * object.h (Input_objects::number_of_relobjs): New function.
4460
c7177d31
ILT
44612010-02-10 Ian Lance Taylor <iant@google.com>
4462
5de0e392
ILT
4463 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4464 shared, not if not position independent.
4465 * x86_64.cc (Relocate::relocate_tls): Likewise.
4466 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4467 (tls_pie_pic_test): New target.
4468 * testsuite/Makefile.in: Rebuild.
4469
c7177d31
ILT
4470 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4471 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4472 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4473 * testsuite/Makefile.in: Rebuild.
4474
684b268a
DM
44752010-02-09 David S. Miller <davem@davemloft.net>
4476
4477 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4478 R_SPARC_RELATIVE using ->add_local_relative().
4479 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4480
612a8d3d
DM
4481 * output.h (Output_data_dynamic::add_section_size): New method
4482 that takes two Output_data objects.
4483 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4484 entry param. Handle it in initializers.
4485 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4486 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4487 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4488 arg.
4489 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4490 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4491 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4492 for dynrel_includes_plt.
4493 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4494 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4495 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4496 before .rela.plt
4497 (Target_sparc::do_finalize_sections): Update to pass true for
4498 dynrel_includes_plt.
4499 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4500 output before .rela.plt
4501 (Target_powerpc::do_finalize_sections): Update to pass true for
4502 dynrel_includes_plt when 32-bit.
4503
cb1be87e
DK
45042010-02-08 Doug Kwan <dougkwan@google.com>
4505
4506 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4507 method.
4508 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4509 Arm_relobj::scan_section_for_cortex_a8_stubs,
4510 Arm_relobj::do_relocation_section): Instead of calling
4511 Output_section::output_address, use faster
4512 Arm_relobj::simple_input_section_output_address.
4513
705b5121
DM
45142010-02-08 David S. Miller <davem@davemloft.net>
4515
4516 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4517 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4518 relocation helper function.
4519
024c4466
DM
4520 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4521 just like R_SPARC_GOT{10,13,22}.
4522 (Target_sparc::Scan::local): Likewise.
4523 (Target_sparc::Relocate:relocate): Likewise.
4524
9109c078
ILT
45252010-02-06 Ian Lance Taylor <iant@google.com>
4526
4527 * configure.ac: Rewrite targetobjs duplicate removal code to use
4528 only shell constructs.
4529 * configure: Rebuild.
4530
cf846138
DK
45312010-02-05 Doug Kwan <dougkwan@google.com>
4532
4533 PR 11247
4534 * arm.cc (Arm_relobj::section_is_scannable): New method.
4535 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4536 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4537
6cfaf60b
DK
45382010-02-04 Doug Kwan <dougkwan@google.com>
4539
4540 PR 11247
4541 * arm-reloc-property.cc (cstdio): Include.
4542 * configure.ac (targetobjs): Remove duplicates.
4543 * configure: Regenerate.
4544 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4545 big and little endian version for a given address size.
4546
5c57f1be
DK
45472010-02-03 Doug Kwan <dougkwan@google.com>
4548
4549 * arm-reloc-property.cc
4550 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4551 definition.
4552 * arm-reloc-property.h
4553 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4554 New method definition.
4555 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4556 declaration.
4557 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4558 overflow to N.
4559 (GOT_PREL): Change implemented to Y.
4560 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4561 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4562 (Arm_relocate_functions::movw_abs_nc): Remove method.
4563 (Arm_relocate_functions::movt_abs): Ditto.
4564 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4565 (Arm_relocate_functions::thm_movt_abs): Ditto.
4566 (Arm_relocate_functions::movw_rel_nc): Ditto.
4567 (Arm_relocate_functions::movw_rel): Ditto.
4568 (Arm_relocate_functions::movt_rel): Ditto.
4569 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4570 (Arm_relocate_functions:thm_movw_rel): Ditto.
4571 (Arm_relocate_functions:thm_movt_rel): Ditto.
4572 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4573 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4574 New method definitions.
4575 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4576 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4577 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4578 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4579 (Target_arm::Relocate::relocate): Check for non-static or
4580 unimplemented relocation code and exit early. Change calls to
4581 Target_arm::reloc_uses_thumb_bit and
4582 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4583 instead. Refactor code to handle similar relocations to increase
4584 code sharing. Remove check for unsupported relocation code in switch
4585 statement.
4586 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4587 relocation property table to find out size. Change error message to
4588 print out the name of a relocation code instead of the numeric value.
4589 (Target_arm::scan_reloc_for_stub): Use relocation property table
4590 instead of calling Target_arm::reloc_uses_thumb_bit().
4591
218c5831
DK
45922010-02-02 Doug Kwan <dougkwan@google.com>
4593
4594 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4595 types of relaxed input section.
4596
0d31c79d
DK
45972010-02-02 Doug Kwan <dougkwan@google.com>
4598
4599 * Makefile.am (HFILES): Add arm-reloc-property.h.
4600 (DEFFILES): New.
4601 (TARGETSOURCES): Add arm-reloc-property.cc
4602 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4603 (libgold_a_SOURCES): $(DEFFILES)
4604 * Makefile.in: Regenerate.
4605 * arm-reloc-property.cc: New file.
4606 * arm-reloc-property.h: New file.
4607 * arm-reloc.def: New file.
4608 * arm.cc: Update comments.
4609 (arm-reloc-property.h): New included header.
4610 (arm_reloc_property_table): New global variable.
4611 (Target_arm::do_select_as_default_target): New method definition.
4612 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4613 arm-reloc-property to targ_extra_obj.
4614 * parameters.cc (set_parameters_target): Call
4615 Target::select_as_default_target().
4616 * target.h (Target::select_as_default_target): New method definition.
4617 (Target::do_select_as_default_target): Same.
4618
546c7457
DK
46192010-02-01 Doug Kwan <dougkwan@google.com>
4620
4621 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4622 first_output_text_section_.
4623 (Arm_exidx_fixup::first_output_text_section): New method definition.
4624 (Arm_exidx_fixup::first_output_text_section_): New data member.
4625 (Arm_exidx_fixup::process_exidx_section): Record the first text
4626 output section seen.
4627 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4628 and entsize in output section header.
4629
11b861d5
DK
46302010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4631
4632 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4633 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4634 (Arm_relocate_functions::thm_alu11): New Method.
4635 (Arm_relocate_functions::thm_pc8): New Method.
4636 (Arm_relocate_functions::thm_pc12): New Method.
4637 (Target_arm::Scan::local): Handle the relocations.
4638 (Target_arm::Scan::global): Likewise.
4639 (Target_arm::Relocate::relocate): Likewise.
4640 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4641
c9a2c125
DK
46422010-01-29 Doug Kwan <dougkwan@google.com>
4643
4644 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4645 of relocation types as ld.
4646
1521477a
DK
46472010-01-29 Doug Kwan <dougkwan@google.com>
4648
4649 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4650 to public.
4651 (Arm_relocate_functions::thumb_branch_common): Ditto.
4652 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4653 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4654 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4655 Arm_relocate_functions::jump24): Remove.
4656 (Target_arm::Relocate::relocate): Adjust code to call
4657 Arm_relocation_functions::arm_branch_common and
4658 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4659 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4660
e7eca48c
DK
46612010-01-29 Doug Kwan <dougkwan@google.com>
4662
4663 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4664 output_local_symbol_count_needs_update_.
4665 (Arm_relobj::output_local_symbol_count_needs_update,
4666 Arm_relobj::set_output_local_symbol_count_needs_update,
4667 Arm_relobj::update_output_local_symbol_count): New methods.
4668 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4669 member.
4670 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4671 of pointed function as in a R_ARM_PREL31 relocation.
4672 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4673 for output local symbol count updating.
4674 (Target_arm::do_relax): Update output local symbol counts in objects
4675 if necessary.
4676 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4677
02961d7e
ILT
46782010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4679
4680 * arm.cc: Added support for the ARM relocations:
4681 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4682 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4683 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4684 movw_prel_nc).
4685 (Arm_relocate_functions::movw_rel): New method.
4686 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4687 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4688 thm_movw_prel_nc).
4689 (Arm_relocate_functions::thm_movw_rel): New method.
4690 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4691 thm_movt_prel).
4692 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4693 relocations.
4694 (Target_arm::Scan::global): Likewise.
4695 (Target_arm::Relocate::relocate): Likewise.
4696 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4697 Likewise.
4698
b10d2873
ILT
46992010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4700
4701 * arm.cc: Added support for ARM group relocations.
4702 (Target_arm::reloc_needs_sym_origin): New method.
4703 (Arm_relocate_functions::calc_grp_kn): New method.
4704 (Arm_relocate_functions::calc_grp_residual): New method.
4705 (Arm_relocate_functions::calc_grp_gn): New method.
4706 (Arm_relocate_functions::arm_grp_alu): New Method.
4707 (Arm_relocate_functions::arm_grp_ldr): New Method.
4708 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4709 (Arm_relocate_functions::arm_grp_ldc): New Method.
4710 (Target_arm::Scan::local): Handle the ARM group relocations.
4711 (Target_arm::Scan::global): Likewise.
4712 (Target_arm::Relocate::relocate): Likewise.
4713 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4714 Likewise.
4715
2b328d4e
DK
47162010-01-26 Doug Kwan <dougkwan@google.com>
4717
4718 * arm.cc (set): Include.
4719 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4720 pointer type.
4721 (Arm_output_section::Text_section_list): New type.
4722 (Arm_output_section::append_text_sections_to_list): New method.
4723 (Arm_output_section::fix_exidx_coverage): Ditto.
4724 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4725 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4726 Relobj::set_section_offset() instead of
4727 Sized_relobj::invalidate_section_offset().
4728 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4729 parameter for section headers. Ignore relocation sections for
4730 unallocated sections and EXIDX sections.
4731 (Target_arm::fix_exidx_coverage): New method.
4732 (Target_arm::output_section_address_less_than): New type.
4733 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4734 linked text section instead of the EXIDX section.
4735 (Arm_output_section::create_stub_group): Add an assertion to check
4736 that this is not an EXIDX output section.
4737 (Arm_output_section::append_text_sections_to_list): New method.
4738 (Arm_output_section::fix_exidx_coverage): Ditto.
4739 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4740 Arm_relobj::section_needs_reloc_stub_scanning.
4741 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4742 first pass.
4743 (Target_arm::fix_exidx_coverage): New method.
4744 * object.h (Relobj::set_output_section): New method.
4745 (Sized_relobj::invalidate_section_offset): Remove method.
4746 (Sized_relobj::do_invalidate_section_offset): Remove method.
4747 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4748
c7f3c371
DK
47492010-01-25 Doug Kwan <dougkwan@google.com>
4750
4751 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4752 Fix warning due to signed and unsigned comparison on a 32-bit host.
4753
8923b24c
DK
47542010-01-22 Doug Kwan <dougkwan@google.com>
4755
4756 * arm.cc (Target_arm::do_relax): Record an output section for section
4757 offset adjustment it contains any stub table that has changed.
4758 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4759 offsets in an output section if necessary.
4760 * output.cc (Output_section::Output_section): Initialize
4761 section_offsets_need_adjustments_.
4762 (Output_section::add_input_section_for_script): Renamed to
4763 Output_section::add_simple_input_section.
4764 (Output_section::save_states): Add a comment.
4765 (Output_section::discard_states): New method defintion.
4766 (Output_section::adjust_section_offsets): Same.
4767 * output.h (Output_section::add_input_section_for_script): Renamed to
4768 Output_section::add_simple_input_section.
4769 (Output_section::discard_states): New method declaration.
4770 (Output_section::adjust_section_offsets): Same.
4771 (Output_section::section_offsets_need_adjustment,
4772 Output_section::set_section_offsets_need_adjustment): New method
4773 definitions.
4774 (Output_section::section_offsets_need_adjustment_): New data member.
4775 * script-sections.cc
4776 (Output_section_element_input::set_section_address): Adjust code for
4777 renaming of Output_section::add_input_section_for_script.
4778 (Orphan_output_section::set_section_address): Same.
4779
9b2fd367
DK
47802010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4781
4782 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4783 Fix_v4bx enum values .
4784 * gold/options.h (General_options): New option definitions.
4785 (General_options::fix_v4bx): New method.
4786 (General_options::Fix_v4bx): New enum.
4787 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4788 (General_options::parse_fix_v4bx_interworking): New method.
4789
80d0d023
DK
47902010-01-22 Doug Kwan <dougkwan@google.com>
4791
4792 * arm.cc (Arm_exidx_fixup): New class.
4793
af2cdeae
DK
47942010-01-21 Doug Kwan <dougkwan@google.com>
4795
4796 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4797 classes.
4798 (Arm_exidx_section_offset_map): New type.
4799
993d07c1
DK
48002010-01-21 Doug Kwan <dougkwan@google.com>
4801
4802 * arm.cc (Arm_exidx_input_section): New class.
4803 (Arm_relobj::exidx_input_section_by_link,
4804 Arm_relobj::exidx_input_section_by_shndx,
4805 Arm_relobj::make_exidx_input_section): New methods.
4806 (read_arm_attributes_section): Remove.
4807 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4808 information about them.
4809 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4810 to here.
4811
5ac169d4
DK
48122010-01-20 Doug Kwan <dougkwan@google.com>
4813
4814 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4815 Input_section_specifier to Section_id.
4816 (Target_arm::new_arm_input_section: Adjust code for change of key
4817 type.
4818 (Target_arm::find_arm_input_section): Ditto.
4819 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4820 (Section_id): Remove.
4821 (Garbage_collection::Section_id_hash): Remove.
4822 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4823 (Section_id): Remove.
4824 (Icf::Section_id_hash): Remove.
4825 * object.h (Section_id, Const_section_id, Section_id_hash,
4826 Const_section_id_hash): New type definitions.
4827 * output.cc (Output_section::add_relaxed_input_section): Change to
4828 use Const_section_id instead of Input_section_specifier as key type.
4829 (Output_section::add_merge_input_section): Ditto.
4830 (Output_section::build_relaxation_map): Change to use Section_id
4831 instead of Input_section_specifier as key type.
4832 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4833 Ditto.
4834 (Output_section::convert_input_sections_to_relaxed_sections): Change
4835 to use Const_section_id instead of Input_section_specifier as key type.
4836 (Output_section::find_merge_section): Ditto.
4837 (Output_section::find_relaxed_input_section): Ditto.
4838 * output.h (Input_section_specifier): Remove class.
4839 (Output_section::Output_section_data_by_input_section_map): Change
4840 key type to Const_section_id.
4841 (Output_section::Output_relaxed_input_section_by_input_section_map):
4842 Ditto.
4843 (Output_section::Relaxation_map): Change key type to Section_id.
4844
a2162063
ILT
48452010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4846
4847 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4848 (class Arm_v4bx_stub): New class.
4849 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4850 (Stub_factory::make_arm_v4bx_stub): New method.
4851 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4852 (Stub_table::empty): Handle v4bx stubs.
4853 (Stub_table::add_arm_v4bx_stub): New method.
4854 (Stub_table::find_arm_v4bx_stub): New method.
4855 (Arm_relocate_functions::v4bx): New method.
4856 (Target_arm::fix_v4bx): New method.
4857 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4858 (Stub_table::relocate_stubs): Likewise.
4859 (Stub_table::do_write): Likewise.
4860 (Stub_table::update_data_size_and_addralign): Likewise.
4861 (Stub_table::finalize_stubs): Likewise.
4862 (Target_arm::Scan::local): Likewise.
4863 (Target_arm::Scan::global): Likewise.
4864 (Target_arm::do_finalize_sections): Likewise.
4865 (Target_arm::Relocate::relocate): Likewise.
4866 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4867 Likewise.
4868 (Target_arm::scan_reloc_for_stub): Likewise.
4869 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4870
5696ab0b
ILT
48712010-01-19 Ian Lance Taylor <iant@google.com>
4872
4873 * output.cc (Output_section_headers::do_sized_write): Write large
4874 segment count to sh_info field.
4875 (Output_file_header::do_sized_write): For large segment count,
4876 write PN_XNUM to e_phnum field.
4877
800d0f56
ILT
48782010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4879
4880 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4881 (Arm_relocate_functions::thm_jump8): New function.
4882 (Arm_relocate_functions::thm_jump11): New function.
4883 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4884 R_ARM_THM_JUMP11.
4885 (Target_arm::Scan::global): Likewise.
4886 (Target_arm::Relocate::relocate): Likewise.
4887 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4888 Likewise.
4889
41263c05
DK
48902010-01-14 Doug Kwan <dougkwan@google.com>
4891
4892 * arm.cc (map, utility): Include headers.
4893 (Target_arm::apply_cortex_a8_workaround): New method.
4894 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4895 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4896 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4897 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4898 the --[no-]fix-cortex-a8 command line options.
4899 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4900 (Target_arm::relocate_stub): Use addend in instruction template.
4901 * options.h (DEFINE_bool): Set the user-set flag.
4902 (General_options): Add --[no-]-fix-cortex options.
4903 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4904 : Update fast look-up map after conversion.
41263c05 4905
459e9b03
ST
49062010-01-14 Sriraman Tallam <tmsriram@google.com>
4907
4908 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4909 in the first pass of do_layout.
4910
b521dfe4
DK
49112010-01-13 Doug Kwan <dougkwan@google.com>
4912
4913 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4914 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4915 apparent compiler problem of not folding static constant integral
4916 data members of elfcpp::Elf_sizes<32>.
4917
44272192
DK
49182010-01-13 Doug Kwan <dougkwan@google.com>
4919
4920 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4921 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4922 Arm_relobj::scan_section_for_cortex_a8_erratum,
4923 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4924 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4925 sections to scan for relocation stubs into a new method
4926 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4927 relocation and Cortex-A8 stub scanning.
4928 (Target_arm::do_relax): Force stubs to be after stubbed sections
4929 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4930 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4931 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4932
44b71ece
ILT
49332010-01-12 Ian Lance Taylor <iant@google.com>
4934
4935 * target-reloc.h (visibility_error): New inline function.
4936 (relocate_section): Call visibility_error.
4937 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4938 (MOSTLYCLEANFILES): Likewise.
4939 (protected_4_pic.o, protected_3.err): New targets.
4940 * testsuite/protected_4.cc: New file.
4941
a120bc7f
DK
49422010-01-12 Doug Kwan <dougkwan@google.com>
4943
4944 * arm.cc (Cortex_a8_reloc): New class.
4945 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4946 and cortex_a8_relocs_info_.
4947 (Target_arm::fix_cortex_a8): New method definition.
4948 (Target_arm::Cortex_a8_relocs_info): New type.
4949 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4950 New data member declarations.
4951 (Target_arm::scan_reloc_for_stub): Record information about
4952 relocations for THUMB branches that might be exempted from the
4953 Cortex-A8 workaround.
4954 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4955 at the beginning of a relaxation pass.
4956
20138696
DK
49572010-01-12 Doug Kwan <dougkwan@google.com>
4958
4959 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4960 (Arm_relobj::Mapping_symbol_position,
4961 Arm_reloj::Mapping_symbol_position_less,
4962 Arm_relobj::Mapping_symbols_info): New types.
4963 (Target_arm::is_mapping_symbol_name): New method definition.
4964 (Arm_relobj::do_count_local_symbols): Save information about mapping
4965 symbols.
4966
089d69dc
DK
49672010-01-11 Doug Kwan <dougkwan@google.com>
4968
4969 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4970 Arm_relocate_functions::thumb32_branch_upper,
4971 Arm_relocate_functions::thumb32_branch_lower,
4972 Arm_relocate_functions::thumb32_cond_branch_offset,
4973 Arm_relocate_functions::thumb32_cond_branch_upper,
4974 Arm_relocate_functions::thumb32_cond_branch_lower,
4975 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4976 branch offset encoding.
4977 (Arm_relocate_functions::thumb_branch_common): Use new branch
4978 offset encoding methods to avoid code duplication.
4979 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4980 (Stub_addend_reader::operator()): Use new branch encoding method
4981 to avoid code duplication.
4982
99e5bff2
DK
49832010-01-11 Doug Kwan <dougkwan@google.com>
4984
4985 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4986 (Target_arm::do_finalize_sections): Define special EXIDX section
4987 symbols only if referenced.
4988 * gc.h (Garbage_collection::add_reference): New method.
4989 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4990 code duplication.
4991
98e090bd
ILT
49922010-01-11 Ian Lance Taylor <iant@google.com>
4993
d0a91bd8
ILT
4994 * script.cc (Version_script_info::build_expression_list_lookup):
4995 Change complaing about duplicate wildcard match from error to
4996 warning.
4997
98e090bd
ILT
4998 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4999 of 2009-12-30.
5000 (Version_script_info::Version_script_info): Initialize globs_,
5001 default_version_, default_is_global_, and exact_. Don't
5002 initialize globals_ or locals_.
5003 (Version_script_info::build_lookup_tables): Build local symbols
5004 first.
5005 (Version_script_info::unquote): New function.
5006 (Version_script_info::add_exact_match): New function.
5007 (Version_script_info::build_expression_list_lookup): Remove lookup
5008 parameter. Add is_global parameter. Change all callers. Handle
5009 wildcard pattern specially. Unquote pattern. Call
5010 add_exact_match.
5011 (Version_script_info::get_name_to_match): New function.
5012 (Version_script_info::get_symbol_version): New function.
5013 (Version_script_info::get_symbol_version_helper): Remove.
5014 (Version_script_info::check_unmatched_names): Call unquote.
5015 * script.h (class Version_script_info): Change get_symbol_version
5016 to be non-inline and add is_global parameter; change all callers.
5017 Rewrite symbol_is_local. Update declarations. Define struct
5018 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5019 Remove globals_ and locals_ members. Add exact_, globs_,
5020 default_version_, is_global_.
5021 (Version_script_info::Glob): Remove pattern, add expression and
5022 is_global. Update constructor. Change all callers.
5023 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5024 default version.
5025 (Versions::symbol_section_contents): If a symbol is undefined, or
5026 defined in a dynamic object, set the version index to
5027 VER_NDX_LOCAL.
5028 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5029 symbol_is_local.
5030 (Symbol_table::add_from_pluginobj): Likewise.
5031 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5032
d56962d3
DK
50332010-01-11 Doug Kwan <dougkwan@google.com>
5034
5035 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5036 (incremental_dump_LDADD): Add linking option for libintl.
5037 * Makefile.in: Regenerate.
5038
94e6ee91
L
50392010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5040
5041 PR gold/11144
5042 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5043 instead of -Ds.
5044 * testsuite/Makefile.in: Regenerated.
5045
e96c574b
DK
50462010-01-10 Doug Kwan <dougkwan@google.com>
5047
5048 * options.h (DEFINE_var): Use parentheses around argument varname__
5049 in macro body to avoid any unintended subsequent substitutions.
5050
7198066b
ILT
50512010-01-10 Ian Lance Taylor <iant@google.com>
5052
ba4d53bf
ILT
5053 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5054 candidates before doing symbol resolution.
5055
7198066b
ILT
5056 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5057 ODR candidates if only one is weak.
5058
a2beed37
ILT
50592010-01-08 Ian Lance Taylor <iant@google.com>
5060
5061 * script.cc (Version_script_info::build_expression_list_lookup):
5062 Don't warn about ambiguous version, just record the ambiguity.
5063 (Version_script_info::get_symbol_version_helper): Give error if
5064 version is ambiguous.
5065
2fb7225c
DK
50662010-01-08 Doug Kwan <dougkwan@google.com>
5067
5068 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5069 prev_data_size_ and prev_addralign_. Remove initializer for
5070 deleted data member has_been_changed_.
5071 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5072 to determine if the table is empty.
5073 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5074 Remove.
5075 (Stub_table::add_reloc_stub): Define method in class definition
5076 instead of just declaring it there.
5077 (Stub_table::add_cortex_a8_stub): New method definition.
5078 (Stub_table::update_data_size_and_addralign): Ditto.
5079 (Stub_table::finalize_stubs): Ditto.
5080 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5081 (Stub_table::do_addralign_): Return address alignment in the
5082 (Stub_table::do_reset_address_and_file_offset): Define method in
5083 class definition instead of declaring it there. Set current data
5084 size to be the data size of the previous pass.
5085 (Stub_table::set_final_data_size): Use current data size as the
5086 final data size.
5087 (Stub_table::relocate_stub): Change parameter type of stub from
5088 Reloc_stub pointer to Stub pointer.
5089 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5090 (Stub_table::Cortex_a8_stub_list): New typedef.
5091 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5092 Stub_table::prev_addralign_): New data member.
5093 (Arm_relobj::Arm_relobj): Initialize data member
5094 section_has_cortex_a8_workaround_.
5095 (Arm_relobj::section_has_cortex_a8_workaround,
5096 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5097 definitions.
5098 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5099 declarations.
5100 (Target_arm::relocate_stub): Change parameter type of stub from
5101 Reloc_stub pointer to Stub pointer.
5102 (Insn_template::size, Insn_template::alignment): Handle
5103 THUMB16_SPECIAL_TYPE.
5104 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5105 Stub_table::update_data_size_and_addralign,
5106 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5107 definitions.
5108 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5109 (Stub_table::do_write): Ditto.
5110 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5111
880cd20d
ILT
51122010-01-08 Ian Lance Taylor <iant@google.com>
5113
5114 PR 11108
5115 * symtab.h (class Symbol): Remove fields is_target_special_ and
5116 has_plt_offset_. Add field is_defined_in_discarded_section_.
5117 (Symbol::is_defined_in_discarded_section): New function.
5118 (Symbol::set_is_defined_in_discarded_section): New function.
5119 (Symbol::has_plt_offset): Rewrite.
5120 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5121 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5122 Don't initialize is_target_special_ or has_plt_offset_.
5123 Initialize is_defined_in_discarded_section_.
5124 (Symbol_table::add_from_relobj): If appropriate, set
5125 is_defined_in_discarded_section.
5126 * resolve.cc (Symbol::override_base_with_special): Don't test
5127 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5128 * target-reloc.h (relocate_section): Do special handling for
5129 symbols defined in discarded sections for global symbols as well
5130 as local symbols.
5131
2703e3eb
ILT
51322010-01-08 Ian Lance Taylor <iant@google.com>
5133
5134 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5135 the SHT_SYMTAB case.
5136
339d40a3
ILT
51372010-01-08 Ian Lance Taylor <iant@google.com>
5138
5139 * object.cc (Sized_relobj::do_layout): Don't get confused if
5140 layout_eh_frame returns NULL.
5141
abecea76
ILT
51422010-01-08 Ian Lance Taylor <iant@google.com>
5143
5144 PR 11084
5145 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5146 dynamic symbol table, use the normal symbol table.
5147 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5148 symbol table.
5149
6b7dd3f3
ILT
51502010-01-08 Ian Lance Taylor <iant@google.com>
5151
5152 PR 11072
5153 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5154 sections.
5155
36c50e63
L
51562010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5157
5158 * version.cc (print_version): Change to "Copyright 2010".
5159
e291e7b9
ILT
51602010-01-08 Ian Lance Taylor <iant@google.com>
5161
5162 PR 10287
5163 PR 11063
5164 * i386.cc (class Target_i386): Change return type of plt_section
5165 to be non-const.
5166 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5167 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5168 tls_desc_rel_ field.
5169 (Output_data_plt_i386::rel_tls_desc): New function.
5170 (Target_i386::rel_tls_desc_section): New function.
5171 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
5172 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
5173 R_386_TLS_DESC reloc in rel_tls_desc_section.
5174 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
5175 Define struct Tlsdesc_info.
5176 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
5177 (Target_x86_64::do_reloc_symbol_index): New function.
5178 (Target_x86_64::add_tlsdesc_info): New function.
5179 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
5180 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
5181 tlsdesc_rel_ field.
5182 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
5183 all callers.
5184 (Output_data_plt_x86_64::rela_tlsdesc): New function.
5185 (Target_x86_64::rela_tlsdesc_section): New function.
5186 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
5187 handling.
5188 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
5189 (Target_x86_64::do_reloc_addend): New function.
5190 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
5191 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
5192 declarations. Define TARGET_CODE. Add arg field to u1_ union.
5193 (Output_reloc::type): New function.
5194 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
5195 (Output_reloc::is_target_specific): New function.
5196 (Output_reloc::target_arg): New function.
5197 (class Output_reloc) [SHT_RELA]: Add four new constructors for
5198 absolute relocs and target specific relocs.
5199 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
5200 add_target_specific.
5201 (class Output_data_reloc) [SHT_RELA]: Likewise.
5202 * output.cc (Output_reloc::Output_reloc): Add four new versions
5203 for absolute relocs and target specific relocs.
5204 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
5205 (Output_reloc::get_symbol_index): Likewise.
5206 (Output_reloc::local_section_offset): Check that local_sym_index_
5207 is not TARGET_CODE or 0.
5208 (Output_reloc::symbol_value): Likewise.
5209 (Output_reloc::write) [SHT_RELA]: Call target for target specific
5210 reloc.
5211 * target.h (class Target): Add reloc_symbol_index and reloc_addend
5212 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
5213 functions.
5214 * layout.cc (add_target_dynamic_tags): Use output section for
5215 DT_PLTRELSZ and DT_JMPREL.
5216
3a44184e
ILT
52172010-01-07 Ian Lance Taylor <iant@google.com>
5218
5219 PR 11061
5220 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
5221 function.
5222 (class Output_data_reloc_generic): Define.
5223 (class Output_data_reloc_base): Change base class to
5224 Output_data_reloc_generic. Change add() method to call
5225 bump_relative_reloc_count for a relative reloc. Remove
5226 sort_relocs_ field.
5227 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
5228 to sort_relocs().
5229 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
5230 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
5231 appropriate.
5232 * layout.h (class Layout): Update declaration.
5233
ea715a34
ILT
52342010-01-07 Ian Lance Taylor <iant@google.com>
5235
5236 * output.h (class Output_data): Add const version of
5237 output_section and do_output_section.
5238 (class Output_section_data): Add const version of
5239 do_output_section.
5240 (class Output_section): Likewise.
5241 * layout.cc (Layout::add_target_dynamic_tags): New function.
5242 * layout.h (class Layout): Update declarations.
5243 * arm.cc (Target_arm::do_finalize_sections): Use
5244 add_target_dynamic_tags.
5245 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5246 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5247 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5248 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5249
659948a4
ILT
52502010-01-07 Ian Lance Taylor <iant@google.com>
5251
5252 PR 11042
5253 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
5254 object as needed.
5255
9d3b86f6
ILT
52562010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
5257 Ian Lance Taylor <iant@google.com>
5258
5259 PR 11019
5260 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
5261 Xindex::read_symtab_xindex.
5262
bb0d3eb0
DK
52632010-01-07 Doug Kwan <dougkwan@google.com>
5264
5265 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
5266 (Insn_template::thumb16_bcond_insn): New method declaration.
5267 (Insn_template): Fix spelling.
5268 (Stub::thumb16_special): New method declaration.
5269 (Stub::do_write): Define virtual method which was previously pure
5270 virtual.
5271 (Stub::do_thumb16_special): New method declaration.
5272 (Stub::do_fixed_endian_write): New template member.
5273 (Reloc_stub::do_write): Remove.
5274 (Reloc_stub::do_fixed_endian_write): Remove.
5275 (Cortex_a8_stub): New class definition.
5276 (Stub_factory::make_cortex_a8_stub): New method definition.
5277 (Stub_factory::Stub_factory): Add missing static storage class
5278 qualifier for elf32_arm_stub_a8_veneer_blx.
5279
ffeef7df
ILT
52802010-01-07 Ian Lance Taylor <iant@google.com>
5281
dc3f80fe
ILT
5282 PR 10980
5283 * options.h (class General_options): Add --warn-unresolved-symbols
5284 and --error-unresolved-symbols.
5285 * errors.cc (Errors::undefined_symbol): Implement
5286 --warn-unresolved-symbols.
5287
ffeef7df
ILT
5288 * options.h (class General_options): Add -z text and -z textoff.
5289 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
5290
f1ec9ded
ST
52912010-01-06 Sriraman Tallam <tmsriram@google.com>
5292
5293 * gc.h (Garbage_collection::Cident_section_map): New typedef.
5294 (Garbage_collection::cident_sections): New function.
5295 (Garbage_collection::add_cident_section): New function.
5296 (Garbage_collection::cident_sections_): New member.
5297 (gc_process_relocs): Add references to sections whose names are C
5298 identifiers.
5299 * gold.h (cident_section_start_prefix): New constant.
5300 (cident_section_stop_prefix): New constant.
5301 (is_cident): New function.
5302 * layout.cc (Layout::define_section_symbols): Replace string constants
5303 with the newly defined constants.
5304 * object.cc (Sized_relobj::do_layout): Track sections whose names are
5305 C identifiers.
5306 * testsuite/Makefile.am: Add gc_orphan_section_test.
5307 * testsuite/Makefile.in: Regenerate.
5308 * testsuite/gc_orphan_section_test.cc: New file.
5309 * testsuite/gc_orphan_section_test.sh: New file.
5310
6eda8c29
ILT
53112010-01-06 Ian Lance Taylor <iant@google.com>
5312
b9674e17
ILT
5313 PR 10980
5314 * options.h (class General_options): Add --warn-shared-textrel.
5315 * layout.cc (Layout::finish_dynamic_section): Implement
5316 --warn-shared-textrel.
5317
6eda8c29
ILT
5318 PR 10980
5319 * options.h (class General_options): Add --warn-multiple-gp.
5320
32dcd44e
ILT
53212010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5322
5323 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
5324 $(THREADSLIB) and $(LIBDL).
5325 * Makefile.in: Rebuild.
5326
a192ba05
ILT
53272010-01-06 Ian Lance Taylor <iant@google.com>
5328
5329 PR 10980
5330 * options.cc (General_options::parse_section_start): New function.
5331 (General_options::section_start): New function.
5332 (General_options::General_options): Initialize all members.
5333 * options.h: Include <map>
5334 (class General_options): Add --section-start. Add section_starts_
5335 member.
5336 * layout.cc (Layout::attach_allocated_section_to_segment): If
5337 --section-start was used, set the address of the segment. Remove
5338 local sort_sections.
5339 (Layout::relaxation_loop_body): If the address of the load segment
5340 has been set by --section-start, don't use it.
5341 * output.h (Output_segment::update_flags_for_output_section): New
5342 function.
5343 * output.cc (Output_segment::add_output_section): Call
5344 update_flags_for_output_section.
5345
dde3f402
ILT
53462010-01-05 Ian Lance Taylor <iant@google.com>
5347
62dfdd4d
ILT
5348 PR 10980
5349 * options.h (class General_options): Add --undefined-version.
5350 * script.cc (struct Version_expression): Add was_matched_by_symbol
5351 field.
5352 (Version_script_info::matched_symbol): New function.
5353 (Version_script_info::get_symbol_version_helper): Call
5354 matched_symbol.
5355 (Version_script_info::check_unmatched_names): New function.
5356 * script.h (class Version_script_info): Update declarations.
5357 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5358
9c4ae156
ILT
5359 * options.h (class General_options): Use DEFINE_bool_alias for
5360 allow_multiple_definition.
5361 * resolve.cc (Symbol_table::should_override): Don't test
5362 allow_multiple_definition.
5363
dde3f402
ILT
5364 PR 10980
5365 * options.h (class General_options): Add --cref.
5366 * main.cc (main): Print cref table if --cref. Don't close mapfile
5367 until after printing cref table.
5368 * cref.cc: Include "symtab.h".
5369 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5370 (Cref_table_compare::operator()): New function.
5371 (Cref_inputs::gather_cref): New function.
5372 (filecol): New static const.
5373 (Cref_inputs::print_cref): New function.
5374 (Cref::print_cref): New function.
5375 * cref.h: Include <cstdio>.
5376 (class Cref): Update declarations.
5377 * mapfile.h (Mapfile::file): New function.
5378 * object.h (class Object): Define Symbols. Declare virtual
5379 do_get_global_symbols.
5380 (Object::get_global_symbols): New function.
5381 * object.cc (Input_objects::add_object): Pass object to cref_ if
5382 --cref.
5383 (Input_objects::archive_start): Likewise.
5384 (Input_objects::archive_stop): Likewise.
5385 (Input_objects::print_cref): New function.
5386 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5387 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5388 --cref.
5389 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5390 function.
5391 * plugin.h (class Sized_pluginobj): Update declarations.
5392
8781f709
ILT
53932010-01-05 Ian Lance Taylor <iant@google.com>
5394
5395 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5396 to is_default_version. Rename insdef to insdefault.
5397 (Symbol_table::add_from_relobj): Rename def to is_default_version
5398 and local to is_forced_local.
5399 (Symbol_table::add_from_pluginobj): Likewise.
5400 (Symbol_table::add_from_dynobj): Likewise.
5401 (Symbol_table::define_special_symbol): Rename insdef to
5402 insdefault.
5403
fe35d28d
ILT
54042010-01-04 Ian Lance Taylor <iant@google.com>
5405
30bc8c46
ILT
5406 PR 10980
5407 * options.h (class General_options): Add
5408 --allow-multiple-definition and -z muldefs.
5409 * resolve.cc (Symbol_table::should_override): Don't warn about a
5410 multiple symbol definition if --allow-multiple-definition or -z
5411 muldefs.
5412
7eaea549
ILT
5413 PR 10980
5414 * options.h (class General_options): Add --add-needed and
5415 --copy-dt-needed-entries. Tweak --as-needed help entry.
5416 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5417 error if --copy-dt-needed-entries aka --add-needed is used and
5418 would cause a change in behaviour.
5419
fe35d28d
ILT
5420 PR 10980
5421 * options.h (class General_options): Add -G as a short version of
5422 --shared. Add no-op options -assert, -g, and -i.
5423
55a2bb35
ST
54242010-01-04 Sriraman Tallam <tmsriram@google.com>
5425
5426 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5427 check for .text or .gnu.linkonce.t sections.
5428 * icf.cc (Icf::find_identical_sections): Ditto.
5429 Change the detection for mangled function name within the section
5430 name.
5431 * icf.h (is_section_foldable_candidate): New function.
5432
719328e1
ILT
54332009-12-30 Ian Lance Taylor <iant@google.com>
5434
5435 PR 10980
5436 * options.h (class General_options): Permit two dashes with
5437 --retain-symbols-file.
5438
d7bb5745
ILT
54392009-12-30 Ian Lance Taylor <iant@google.com>
5440
403a15dd
ILT
5441 PR 10979
5442 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5443 don't put the file header and segment headers in the text
5444 segment.
5445
eda294df
ILT
5446 PR 10979
5447 * common.cc (Sort_commons::operator()): Stabilize sort when both
5448 entries are NULL.
5449 (Symbol_table::do_allocate_commons_list): When allocating common
5450 symbols, skip a symbol which is no longer common.
5451 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5452 an object before checking its type.
5453 * testsuite/common_test_2.c: New file.
5454 * testsuite/common_test_3.c: New file.
5455 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5456 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5457 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5458 (common_test_2_pic.o, common_test_2.so): New targets.
5459 (common_test_3_pic.o, common_test_3.so): New targets.
5460 * testsuite/Makefile.in: Rebuild.
5461
d7bb5745
ILT
5462 PR 10979
5463 * script.cc (read_input_script): If we see a new SECTIONS clause,
5464 and we have added an input section, give an error.
5465 * layout.h (class Layout): Add have_added_input_section function.
5466 Add have_added_input_section_ field.
5467 * layout.cc (Layout::Layout): Initialize
5468 have_added_input_section_.
5469 (Layout::layout): Set have_added_input_section_.
5470 (Layout::layout_eh_frame): Likewise.
5471
fc59c572
ILT
54722009-12-30 Ian Lance Taylor <iant@google.com>
5473
5474 PR 10931
5475 * options.h (class General_options): Add --sort-common option.
5476 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5477 * common.cc (Sort_common): Add sort_order parameter to
5478 constructor. Add sort_order_ field.
5479 (Sort_commons::operator): Check sort_order_.
5480 (Symbol_table::allocate_commons): Determine the sort order.
5481 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5482 Change all callers.
5483 (Symbol_table::do_allocate_commons_list): Likewise.
5484
1c74fab0
ILT
54852009-12-30 Ian Lance Taylor <iant@google.com>
5486
5487 PR 10916
5488 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5489 symbols from this object, don't change the visibility of an
5490 undefined symbol.
5491 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5492
6affe781
ILT
54932009-12-30 Ian Lance Taylor <iant@google.com>
5494
5495 PR 10861
5496 * script.h (class Version_script_info): Define Language enum.
5497 Update declarations. Define Glob, Exact, and Lookup types. Add
5498 new fields globals_, locals_, and is_finalized_.
5499 * script.cc: Various formatting fixes.
5500 (class Parser_closure): Change language_stack_ from a vector of
5501 std::string to one of Version_script_info::Language. Adjust all
5502 uses accordingly.
5503 (class Lazy_demangler): Remove.
5504 (struct Version_expression): Change language from std::string to
5505 Version_script_info::Language.
5506 (Version_script_info::Version_script_info): New function.
5507 (Version_script_info::~Version_script_info): Don't call clear.
5508 (Version_script_info::finalize): New function.
5509 (Version_script_info::build_lookup_tables): New function.
5510 (Version_script_info::build_expression_list_lookup): New
5511 function.
5512 (Version_script_info::get_symbol_version_helper): Rewrite to use
5513 lookup tables.
5514 (Version_script_info::print_expression_list): Adjust to use
5515 Version_script_info::Language.
5516 (script_push_lex_into_version_mode): Check that the version script
5517 has not been finalized.
5518 (version_script_push_lang): Change language string to
5519 Version_script_info::Language.
5520 * options.cc (Command_line::version_script): New function.
5521 * options.h (class General_options): Add finalize_dynamic_list
5522 function. Change version_script from declaration to definition.
5523 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5524 * testsuite/version_script.map: Remove duplicate def of foo.
5525 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5526 version_script.map.
5527 * testsuite/Makefile.in: Rebuild.
5528
818bf354
ILT
55292009-12-30 Ian Lance Taylor <iant@google.com>
5530
5531 PR 10843
5532 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5533 if the input symbol index is 0, make the output symbol index 0.
5534
ebcc8304
ILT
55352009-12-30 Ian Lance Taylor <iant@google.com>
5536
5537 PR 10670
5538 * options.h (class General_options): Add -x/--discard-all.
5539 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5540 --discard-all. If the local symbol needs a dynamic entry, check
5541 that before handling --discard-locals.
5542
176fe33f
ILT
55432009-12-30 Ian Lance Taylor <iant@google.com>
5544
bb321bb1
ILT
5545 PR 10450
5546 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5547 flags to PF_R.
5548 (Output_segment::add_output_section): Don't change the flags if
5549 the type is PT_TLS.
5550
176fe33f
ILT
5551 PR 10450
5552 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5553 GNU hash table if they need a dynamic value. Otherwise, don't add
5554 them if they are defined in a dynamic object or are forced local.
5555
e8cd95c7
ILT
55562009-12-29 Ian Lance Taylor <iant@google.com>
5557
1b81fb71
ILT
5558 PR 10450
5559 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5560 .gnu.hash table for a 32-bit target.
5561
8d6d383d
ILT
5562 PR 10450
5563 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5564 regular and a dynamic object only needs a dynamic symbol table
5565 entry if it is externally visible.
5566
e785ec03
ILT
5567 PR 10450
5568 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5569 constructor. Add global_offset_table_ field.
5570 (Target_i386::got_section): Set global_offset_table_.
5571 (Target_i386::do_finalize_sections): Set global_offset_table_
5572 size.
5573 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5574 in constructor. Add global_offset_table_ field.
5575 (Target_x86_64::got_section): Set global_offset_table_.
5576 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5577 size.
5578
1a2dff53
ILT
5579 * layout.cc (Layout::Layout): Initialize increase_relro_.
5580 (Layout::get_output_section): Add is_relro, is_last_relro, and
5581 is_first_non_relro parameters. Change all callers.
5582 (Layout::choose_output_section): Likewise.
5583 (Layout::add_output_section_data): Likewise.
5584 (Layout::make_output_section): Likewise.
5585 (Layout::set_segment_offsets): Clear increase_relro when using a
5586 linker script.
5587 * layout.h (class Layout): Add increase_relro method. Add
5588 increase_relro_ field. Update declarations.
5589 * output.cc (Output_section::Output_section): Initialize
5590 is_last_relro_ and is_first_non_relro_.
5591 (Output_segment::add_output_section): Group relro sections is
5592 do_sort is true. Handle is_last_relro and is_first_non_relro.
5593 (Output_segment::maximum_alignment): Remove relro handling.
5594 (Output_segment::set_section_addresses): Add increase_relro
5595 parameter. Change all callers. Add initial alignment to align
5596 relro sections on separate page. Remove old relro handling.
5597 (Output_segment::set_section_list_addresses): Remove in_relro
5598 parameter. Change all callers.
5599 (Output_segment::set_offset): Add increase parameter. Change all
5600 callers. Remove old relro handling.
5601 * output.h (class Output_section): Add new methods: is_last_relro,
5602 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5603 Add is_last_relro_ and is_first_non_relro_ fields.
5604 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5605 Create separate .got.plt section. Call increase_relro.
5606 * x86_64.cc (Target_x86_64::got_section): Likewise.
5607 * testsuite/relro_script_test.t: Add .got.plt.
5608
f0ba79e2
ILT
5609 PR 10450
5610 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5611 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5612 (Layout::finalize): Call set_dynamic_symbol_size.
5613 (Layout::set_dynamic_symbol_size): New function.
5614 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5615 set_dynamic_symbol_size.
5616
e8cd95c7
ILT
5617 PR 10450
5618 * output.h (class Output_section): Add is_entsize_zero_ field.
5619 * output.cc (Output_section::Output_section): Initialize
5620 is_entsize_zero_.
5621 (Output_section::set_entsize): If two different entsizes are
5622 requested, force it to zero.
5623 (Output_section::add_input_section): Set flags for .debug_str
5624 before updating section flags. Set entsize.
5625 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5626 and SHF_STRING if all input sections have those flags.
5627
3e1b9a8a
RÁE
56282009-12-29 Rafael Espindola <espindola@google.com>
5629
5630 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5631 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5632 reporting.
3e1b9a8a 5633
3dcad376
ST
56342009-12-29 Sriraman Tallam <tmsriram@google.com>
5635
5636 * options.cc (General_options::parse_version): Allow -v to exit
5637 without an error if there is nothing to link.
5638
084e2665
ILT
56392009-12-29 Ian Lance Taylor <iant@google.com>
5640
5641 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5642 using a version of gcc before 4.1.
5643 * configure: Rebuild.
5644
250acde3
CD
56452009-12-28 Chris Demetriou <cgd@google.com>
5646
5647 * attributes.cc (Output_attributes_section_data::do_write): Use
5648 std::vector::front rather than std::vector::data.
5649
99fff23b
ILT
56502009-12-28 Ian Lance Taylor <iant@google.com>
5651
5652 * symtab.h (class Symbol_table): Add enum Defined.
5653 * resolve.cc (Symbol_table::should_override): Add defined
5654 parameter. Change all callers. Test whether object is NULL
5655 before calling a method on it.
5656 (Symbol_table::report_resolve_problem): Add defined parameter.
5657 Change all callers.
5658 (Symbol_table::should_override_with_special): Likewise.
5659 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5660 parameter. Change all callers.
5661 (Symbol_table::do_define_in_output_data): Likewise.
5662 (Symbol_table::define_in_output_segment): Likewise.
5663 (Symbol_table::do_define_in_output_segment): Likewise.
5664 (Symbol_table::define_as_constant): Likewise.
5665 (Symbol_table::do_define_as_constant): Likewise.
5666 * script.h (class Symbol_assignment): Add is_defsym parameter to
5667 constructor; change all callers.
5668 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5669 parameter. Change all callers. Add is_defsym_ field.
5670 (class Parser_closure): Add parsing_defsym parameter to
5671 constructor; change all callers. Add parsing_defsym accessor
5672 function. Add parsing_defsym_ field.
5673
556bd683
ILT
56742009-12-28 Ian Lance Taylor <iant@google.com>
5675
5676 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5677 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5678
1782c879
ILT
56792009-12-23 Ian Lance Taylor <iant@google.com>
5680
5681 * i386.cc (Target_i386::do_calls_non_split): Recognize
5682 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5683 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5684 -fsplit-stack prologue when using %r11.
1782c879 5685
329ca2b1
ST
56862009-12-21 Sriraman Tallam <tmsriram@google.com>
5687
5688 * options.cc (General_options::parse_version): Make -v continue and do
5689 the link like GNU ld does.
5690
d675ff46
RÁE
56912009-12-17 Rafael Avila de Espindola <espindola@google.com>
5692
5693 * Makefile.am (CCFILES): Add timer.cc.
5694 (HFILES): Add timer.h.
5695 * configure.ac: Check for sysconf and times.
5696 * main.cc: include timer.h.
5697 (main): Use Timer instead of get_run_time.
5698 * timer.cc: New.
5699 * timer.h: New.
5700 * workqueue.cc: include timer.h.
5701 (Workqueue::find_and_run_task):
5702 Report user, sys and wall time.
5703 * Makefile.in: Regenerate.
5704 * config.in: Regenerate.
5705 * configure: Regenerate.
5706
d6344fb5
DK
57072009-12-16 Doug Kwan <dougkwan@google.com>
5708
5709 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5710 sections.
5711 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5712 relaxed input sections.
5713 * output.cc (Output_section::find_relaxed_input_section): Change
5714 return type to Output_relaxed_input_section pointer. Adjust code
5715 for new type of relaxed_input_section_map_.
5716 * output.h (Output_section::find_relaxed_input_section): Change
5717 return type to Output_relaxed_input_section pointer.
5718 (Output_section::Output_relaxed_input_section_by_input_section_map):
5719 New type.
5720 (Output_section::relaxed_input_section_map_): Change type to
5721 Output_section::Output_relaxed_input_section_by_input_section_map.
5722 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5723 input section.
5724
0e0d5469
ILT
57252009-12-15 Ian Lance Taylor <iant@google.com>
5726
5727 * layout.cc (Layout::create_shstrtab): Only write out after input
5728 sections if we are compressing debug sections.
5729
0649a889
ILT
57302009-12-15 Ian Lance Taylor <iant@google.com>
5731
5732 * archive.cc (Archive::add_symbols): Only look up a symbol without
5733 a version if there is, in fact, a version.
5734
2ea97941
ILT
57352009-12-14 Ian Lance Taylor <iant@google.com>
5736
5737 Revert -Wshadow changes, all changes from:
5738 2009-12-11 Doug Kwan <dougkwan@google.com>
5739 2009-12-11 Nick Clifton <nickc@redhat.com>
5740 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5741
b0eec2cc
DK
57422009-12-11 Doug Kwan <dougkwan@google.com>
5743
5744 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5745 due to -Wshadow.
5746 * attributes.cc (Object_attribute::size): Ditto.
5747 (Attributes_section_data::size): Ditto.
5748 (Attributes_section_data::Attributes_section_data): Ditto.
5749 (Output_attributes_section_data::do_write): Ditto.
5750 * attributes.h (Object_attribute::set_type): Ditto.
5751 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5752
91d6fa6a
NC
57532009-12-11 Nick Clifton <nickc@redhat.com>
5754
5755 * archive.cc: Fix shadowed variable warnings.
5756 * arm.cc: Likewise.
5757 * compressed_output.cc: Likewise.
5758 * compressed_output.h: Likewise.
5759 * configure: Likewise.
5760 * dwarf_reader.cc: Likewise.
5761 * dynobj.cc: Likewise.
5762 * dynobj.h: Likewise.
5763 * ehframe.cc: Likewise.
5764 * ehframe.h: Likewise.
5765 * errors.cc: Likewise.
5766 * expression.cc: Likewise.
5767 * fileread.cc: Likewise.
5768 * fileread.h: Likewise.
5769 * freebsd.h: Likewise.
5770 * i386.cc: Likewise.
5771 * icf.cc: Likewise.
5772 * incremental.h: Likewise.
5773 * layout.cc: Likewise.
5774 * layout.h: Likewise.
5775 * mapfile.cc: Likewise.
5776 * merge.cc: Likewise.
5777 * merge.h: Likewise.
5778 * object.cc: Likewise.
5779 * object.h: Likewise.
5780 * options.h: Likewise.
5781 * output.cc: Likewise.
5782 * output.h: Likewise.
5783 * parameters.cc: Likewise.
5784 * plugin.cc: Likewise.
5785 * powerpc.cc: Likewise.
5786 * reduced_debug_output.cc: Likewise.
5787 * reduced_debug_output.h: Likewise.
5788 * reloc.cc: Likewise.
5789 * reloc.h: Likewise.
5790 * resolve.cc: Likewise.
5791 * script-sections.cc: Likewise.
5792 * script.cc: Likewise.
5793 * script.h: Likewise.
5794 * sparc.cc: Likewise.
5795 * symtab.cc: Likewise.
5796 * symtab.h: Likewise.
5797 * target-select.cc: Likewise.
5798 * target-select.h: Likewise.
5799 * token.h: Likewise.
5800 * workqueue.cc: Likewise.
5801 * workqueue.h: Likewise.
5802 * x86_64.cc: Likewise.
5803
a0351a69
DK
58042009-12-10 Doug Kwan <dougkwan@google.com>
5805
5806 * arm.cc (attributes.h): New include.
5807 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5808 (Arm_relobj::~Arm_relobj): Delete object pointed by
5809 attributes_section_data_.
5810 (Arm_relobj::attributes_section_data): New method definition.
5811 (Arm_relobj::attributes_section_data_): New data member declaration.
5812 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5813 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5814 attributes_section_data_.
5815 (Arm_dynobj::attributes_section_data): New method definition.
5816 (Arm_dynobj::attributes_section_data_): New data member declaration.
5817 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5818 initialization value of may_use_blx_ to false.
5819 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5820 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5821 object attributes to compute results instead of hard-coding.
5822 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5823 Target_arm::get_secondary_compatible_arch,
5824 Target_arm::set_secondary_compatible_arch
5825 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5826 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5827 New method declarations.
5828 (Target_arm::get_aeabi_object_attribute): New method definition.
5829 (Target_arm::attributes_section_data_): New data member declaration.
5830 (read_arm_attributes_section): New template definition.
5831 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5832 (Arm_dynobj::do_read_symbols): Ditto.
5833 (Target_arm::do_finalize_sections): Merge attributes sections from
5834 input. Check for BLX use after attributes section merging.
5835 Fix __exidx_start and __exidx_end visibility. Create an
5836 .ARM.attributes section if necessary.
5837 (Target_arm::get_secondary_compatible_arch,
5838 Target_arm::set_secondary_compatible_arch,
5839 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5840 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5841 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5842 New method definitions.
5843
b59befec
ILT
58442009-12-09 Ian Lance Taylor <iant@google.com>
5845
5846 * plugin.cc (Plugin::load): Don't cast from void* to a function
5847 pointer.
5848
1276bc89
ILT
58492009-12-09 Ian Lance Taylor <iant@google.com>
5850
5851 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5852 information fields.
5853
2f2de248
L
58542009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5855
5856 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5857 Replace two_file_shared_1.so with two_file_shared_2.so.
5858 * testsuite/Makefile.in: Regenerated.
5859
4f787271
DK
58602009-12-08 Doug Kwan <dougkwan@google.com>
5861
5862 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5863 (HFILES): Add attributes.h and int_encoding.h.
5864 * Makefile.in: Regenerate.
5865 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5866 function definitions to int_encoding.cc
5867 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5868 prototypes to int_encoding.h
5869 * reduced_debug_output.cc (int_encoding.h): New include.
5870 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5871 function definitions to int_encoding.cc
5872 (insert_into_vector, read_from_pointer): Move template definitions to
5873 int_encoding.h
5874 * attributes.cc: New file.
5875 * attributes.h: New file.
5876 * int_encoding.cc: New file.
5877 * int_encoding.h: New file.
5878
20b52f1a
RÁE
58792009-12-07 Rafael Avila de Espindola <espindola@google.com>
5880
5881 PR gold/11055
5882 * incremental-dump.cc (dump_incremental_inputs): New.
5883 (main): Use dump_incremental_inputs.
5884
53d7974c
L
58852009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5886
5887 PR gold/10893
5888 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5889 checking elfcpp::STT_FUNC.
5890 (Target_i386::Relocate::relocate): Likewise.
5891 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5892
5893 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5894 symbols from shared libraries into normal FUNC symbols.
5895
5896 * symtab.h (Symbol): Add is_func and use it.
5897
05a352e6
DK
58982009-12-05 Doug Kwan <dougkwan@google.com>
5899
5900 * arm.cc (Target_arm::arm_info): Initialize new fields
5901 attributes_section and attributes_vendor.
5902 * i386.cc (Target_i386::i386_info): Same.
5903 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5904 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5905 fields attributes_section and attributes_vendor.
53d7974c 5906 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5907 * target.h (Target::attributes_section, Target::attributes_vendor,
5908 Target::is_attributes_section, Target::attribute_arg_type,
5909 Target::attributes_order): New method definitions.
5910 (Target::Target_info::attributes_section,
5911 Target::Target_info::attributes_vendor): New fields.
5912 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5913 virtual method definitions.
5914 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5915 attributes_section and attributes_vendor.
5916 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5917
f4e5969c
DK
59182009-12-05 Doug Kwan <dougkwan@google.com>
5919
5920 * arm.cc: Update comments about interworking and stub generation.
5921 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5922 considered as non-PIC.
5923 (Arm_relocate_functions::base_abs): Fix formatting.
5924 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5925 of function to use GOT entry address instead of offset.
5926 (Target_arm::Scan::global): Issue an error if a symbol would need a
5927 PLT does not get one because it is untyped. Remove code to create
5928 dynamic symbols for relative branches.
5929 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5930 takes unsigned integer instead of boolean.
5931
1abce4a6
L
59322009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5933
5934 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5935 (two_file_test_LDADD): Likewise.
5936 (common_test_1_LDADD): Likewise.
5937 (exception_test_LDADD) Likewise.
5938 (weak_test_LDADD): Likewise.
5939 (many_sections_test_LDADD): Likewise.
5940 (initpri1_LDADD): Likewise.
5941 (script_test_1_LDADD): Likewise.
5942 (script_test_2_LDADD): Likewise.
5943 (justsyms_LDADD): Likewise.
5944 (binary_test_LDADD): Likewise.
5945 (large_LDADD): Likewise.
5946 * testsuite/Makefile.in: Regenerated.
5947
adcf2816 59482009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5949
adcf2816
L
5950 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5951 (Symbol_table::override_with_special): Likewise.
5952 (Symbol_table::add_from_object): Likewise.
5953
28e67f5d
RÁE
59542009-12-04 Rafael Avila de Espindola <espindola@google.com>
5955
5956 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5957 Don't set the data_offset twice.
5958
ae10a101
RÁE
59592009-12-04 Rafael Avila de Espindola <espindola@google.com>
5960
5961 * testsuite/Makefile.in: Regenerate.
5962
f59f41f3
DK
59632009-12-03 Doug Kwan <dougkwan@google.com>
5964
5965 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5966 (Target_arm::do_finalize_sections): Add parameter for symbol table
5967 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5968 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5969 parameter for symbol table pointer.
5970 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5971 an additional parameter for a pointer to symbol table.
5972 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5973 parameter for a symbol table pointer.
5974 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5975 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5976 Ditto.
5977 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5978 parameter for a symbol table pointer.
5979
ca55d848
RÁE
59802009-12-03 Rafael Avila de Espindola <espindola@google.com>
5981
5982 * incremental.cc (Incremental_inputs_header)
5983 (Incremental_inputs_header_write, Incremental_inputs_entry)
5984 (Incremental_inputs_entry_write): Move ...
5985 * incremental.h (Incremental_inputs_header)
5986 (Incremental_inputs_header_write, Incremental_inputs_entry)
5987 (Incremental_inputs_entry_write): here.
5988
3aec4f9c
RÁE
59892009-12-02 Rafael Avila de Espindola <espindola@google.com>
5990
5991 * incremental.cc (make_sized_incremental_binary): Set the target.
5992 Error if it is incompatible.
5993 * output.h (Output_file): Add filename method.
5994
9c0ae74d
RÁE
59952009-12-02 Rafael Avila de Espindola <espindola@google.com>
5996
5997 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5998 from the get_* methods.
5999
a45500ae
RÁE
60002009-12-02 Rafael Avila de Espindola <espindola@google.com>
6001
6002 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6003 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6004 Write 0 for the data_offset of scripts.
6005
325e6408
RÁE
60062009-12-02 Rafael Avila de Espindola <espindola@google.com>
6007
6008 * testsuite/Makefile.am: Add the incremental_test.sh test.
6009 * testsuite/incremental_test.sh: New.
6010 * testsuite/incremental_test_1.c: New.
6011 * testsuite/incremental_test_2.c: New.
6012
954c3e2e
RÁE
60132009-12-01 Rafael Avila de Espindola <espindola@google.com>
6014
6015 * incremental-dump.cc (main): Fix typos.
6016
f8086623
RÁE
60172009-11-27 Rafael Avila de Espindola <espindola@google.com>
6018
6019 PR gold/11025
6020 * incremental-dump.cc (main): Use llu to print 64 bit values.
6021
3b0dd6ac
L
60222009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6023 H.J. Lu <hongjiu.lu@intel.com>
6024
6025 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6026 $(LIBDL).
6027 (incremental_dump_LDADD): Likewise.
6028 * Makefile.in: Regenerated.
6029
a6d1ef57 60302009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 6031
a6d1ef57
DK
6032 Revert:
6033
6034 2009-11-25 Doug Kwan <dougkwan@google.com>
6035
6036 * arm.cc (Target_arm::Target_arm): Move method definition
6037 outside of class definition. Add code to handle
6038 --target1-rel, --target1-abs and --target2= options.
6039 (Target_arm::get_reloc_reloc_type): Change method to be
6040 non-static and const.
6041 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6042 New data member declaration.
6043 (Target_arm::Scan::local, Target_arm::Scan::global,
6044 Target_arm::Relocate::relocate,
6045 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6046 Adjust call to Target_arm::get_real_reloc_type.
6047 (Target_arm::get_real_reloc_type): Use command line options
6048 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6049 * options.h (--target1-rel, --target1-abs, --target2): New
6050 ARM-only options.
6051
50aeb7d4
DK
60522009-11-25 Doug Kwan <dougkwan@google.com>
6053
6054 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6055 class definition. Add code to handle --target1-rel, --target1-abs
6056 and --target2= options.
6057 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6058 and const.
6059 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6060 member declaration.
6061 (Target_arm::Scan::local, Target_arm::Scan::global,
6062 Target_arm::Relocate::relocate,
6063 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6064 call to Target_arm::get_real_reloc_type.
6065 (Target_arm::get_real_reloc_type): Use command line options to
6066 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6067 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6068 options.
6069
51938283
DK
60702009-11-25 Doug Kwan <dougkwan@google.com>
6071
6072 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6073 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6074 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6075 formatting.
6076 (Arm_relocate_functions::thm_call): Replace body with a call to
6077 Arm_relocate_functions::thumb_branch_common.
6078 (Arm_relocate_functions::thm_jump24,
6079 Arm_relocate_functions::thm_xpc22): New method definitions.
6080 (Arm_relocate_functions::thumb_branch_common): New method definition.
6081 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6082 operator.
6083 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6084 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6085
e2b8f3c4
RÁE
60862009-11-24 Rafael Avila de Espindola <espindola@google.com>
6087
6088 * Makefile.am: Build incremental-dump
6089 * Makefile.in: Regenerate.
6090 * incremental-dump.cc: New.
6091 * incremental.cc (Incremental_inputs_header_data,
6092 Incremental_inputs_entry_data): Move to incremental.h
6093 * incremental.h: (Incremental_inputs_header_data,
6094 Incremental_inputs_entry_data): Move from incremental.cc
6095
bcba9aec
RÁE
60962009-11-24 Rafael Avila de Espindola <espindola@google.com>
6097
6098 * incremental.cc (Incremental_inputs_header,
6099 Incremental_inputs_header_write, Incremental_inputs_entry,
6100 Incremental_inputs_entry_write): Add a typedef with the data type.
6101
7c3afe08
RÁE
61022009-11-24 Rafael Avila de Espindola <espindola@google.com>
6103
6104 * incremental.cc (Incremental_inputs_header,
6105 Incremental_inputs_header_write, Incremental_inputs_entry,
6106 Incremental_inputs_entry_write): Update comment about which
6107 type has the filed descriptions.
6108
d204b6e9
DK
61092009-11-15 Doug Kwan <dougkwan@google.com>
6110
6111 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6112 (Arm_relocate_functions::arm_branch_common): Change method defintion
6113 in class definition to a method declaration and update list of formal
6114 parameters.
6115 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6116 Arm_relocation_functions::jump24): Adjust call to
6117 Arm_relocate_functions::arm_branch_common. Update list of formal
6118 parameters.
6119 (Arm_relocate_functions::xpc25): New method definition.
6120 (Arm_relocate_functions::arm_branch_common): Move method defintion
6121 out from class definition. Use stubs for mode-switching and extending
6122 branch ranges.
6123 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6124 specially. Change code to enable use of stubs in ARM branches.
6125
43d12afe
DK
61262009-11-10 Doug Kwan <dougkwan@google.com>
6127
6128 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6129 in method declaration.
6130 (Target_arm::relocate_stub): New method declaration.
6131 (Target_arm::default_target): Change to return a pointer instead of
6132 a const reference.
6133 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6134 Target_arm::default_target.
6135 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6136 method definition.
6137 (Target_arm::relocate_section): Adjust view.
6138 (Target_arm::relocate_stub): New method definition.
6139
ac33a407
DK
61402009-11-10 Doug Kwan <dougkwan@google.com>
6141
6142 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6143 a format warning.
6144 * incremental.cc (open_incremental_binary): Initialized local
6145 variables to avoid warnings.
6146 * object.cc (make_elf_object): Ditto.
6147 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6148 a format warning.
e1df38aa 6149
88ee28e9
L
6150009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6151
6152 PR gold/10930
6153 * testsuite/plugin_test.c: Include "config.h".
6154
2daedcd6
DK
61552009-11-09 Doug Kwan <dougkwan@google.com>
6156
6157 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6158 (arm_symbol_value): Remove.
6159 (Arm_relocate_functions::arm_branch_common,
6160 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6161 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6162 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6163 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6164 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6165 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6166 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6167 Arm_relocate_functions::thm_mobw_abs_nc,
6168 Arm_relocate_functions::thm_mov_abs,
6169 Arm_relocate_functions::movw_prel_nc,
6170 Arm_relocate_functions::thm_movt_abs,
6171 Arm_relocate_functions::movt_prel,
6172 Arm_relocate_functions::thm_movw_prel_nc,
6173 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
6174 (Target_arm::Relocate::relocate): Only decompose address into two
6175 parts if relocation type uses the thumb-bit and pass the actual
6176 bit instead of a flag indicating that the thumb-bit is used. Adjust
6177 calls to methods in Arm_relocate_functions for this change.
6178
1276bc89 61792009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
6180
6181 PR 10925
6182 * reloc.cc: Instantiate
6183 Sized_relobj::initialize_input_to_output_maps and
6184 Sized_relobj:free_input_to_output_maps.
6185
e53ad1b5
ILT
61862009-11-06 Ian Lance Taylor <iant@google.com>
6187
6188 PR 10876
6189 * defstd.cc (in_segment): Set only_if_ref true for "end".
6190
eb44217c
DK
61912009-11-06 Doug Kwan <dougkwan@google.com>
6192
6193 * arm.cc (class Reloc_stub): Correct a comment.
6194 (Target_arm::Target_arm): Initialize arm_input_section_map_.
6195 (Target_arm::scan_section_for_stubs): New method declaration.
6196 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
6197 Change methods from private to protected.
6198 (Target_arm::do_may_relax): New method definition.
6199 (Target_arm::do_relax, Target_arm::group_sections,
6200 Target_arm::scan_reloc_for_stub,
6201 Target_arm::scan_reloc_section_for_stubs): New method declarations.
6202 (Target_arm::arm_input_section_map_): New data member declaration.
6203 (Target_arm::scan_reloc_for_stub,
6204 Target_arm::scan_reloc_section_for_stubs,
6205 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
6206 Target_arm::do_relax): New method definitions.
6207
5d329b7d
ILT
62082009-11-06 Mikolaj Zalewski <mikolaj@google.com>
6209
6210 * configure.ac: Check for (struct stat)::st_mtim
6211 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
6212 * config.in: Regenerate.
6213 * configure: Regenerate.
6214
96a0d71b
ILT
62152009-11-05 Ian Lance Taylor <iant@google.com>
6216
6217 PR 10910
6218 * output.cc (Output_segment::add_output_section): Add missing
6219 return statement.
6220
594c8e5e
ILT
62212009-11-04 Ian Lance Taylor <iant@google.com>
6222
6223 PR 10880
6224 * object.h (class Object): Add is_needed and set_is_needed
6225 methods. Add is_needed_ field. Make bool fields into bitfields.
6226 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
6227 defined in a dynamic object and referenced by a regular object,
6228 set is_needed for the dynamic object.
6229 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
6230 if the file is marked with as_needed and it is not needed.
6231
22b127cc
ILT
62322009-11-04 Ian Lance Taylor <iant@google.com>
6233
6234 PR 10887
6235 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
6236 tags if data is discarded by linker script.
6237 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6238 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6239 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6240 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6241
f5c870d2
ILT
62422009-11-04 Ian Lance Taylor <iant@google.com>
6243
6244 * layout.cc (Layout::get_output_section): Add is_interp and
6245 is_dynamic_linker_section parameters. Change all callers.
6246 (Layout::choose_output_section): Likewise.
6247 (Layout::make_output_section): Likewise.
6248 (Layout::add_output_section_data): Add is_dynamic_linker_section
6249 parameter. Change all callers.
6250 * layout.h (class Layout): Update declarations.
6251 * output.h (class Output_section): Add is_interp, set_is_interp,
6252 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
6253 Add is_interp_, is_dynamic_linker_section_ fields. Change
6254 generate_code_fills_at_write_ to a bitfield.
6255 * output.cc (Output_section::Output_sections): Initialize new
6256 fields.
6257 (Output_segment::add_output_section): Add do_sort parameter.
6258 Change all callers.
6259
1ae4d23b
ILT
62602009-11-03 Ian Lance Taylor <iant@google.com>
6261
6262 PR 10860
6263 * options.h (class General_options): Add --warn-common.
6264 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
6265 merging two common symbols.
6266 (Symbol_table::should_override): Handle --warn-common when merging
6267 a common symbol with a defined symbol. Use report_resolve_problem
6268 for multiple definitions.
6269 (Symbol_table::report_resolve_problem): New function.
6270 * symtab.h (class Symbol_table): Declare report_resolve_problem.
6271
55da9579
DK
62722009-11-03 Doug Kwan <dougkwan@google.com>
6273
6274 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
6275 stub_factory_.
6276 (Target_arm::stub_factory): New method definition.
6277 (Target_arm::new_arm_input_section,
6278 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
6279 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 6280 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
6281 New type definitions.
6282 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
6283 member declarations.
6284 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
6285 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
6286 New method definitions.
6287
37a9ac43
ILT
62882009-11-03 Ian Lance Taylor <iant@google.com>
6289
6290 * options.h (class General_options): Add --warn_constructors.
6291
b3d6a3d4
ILT
62922009-11-03 Ian Lance Taylor <iant@google.com>
6293
6294 PR 10893
6295 * defstd.cc (in_section): Add entries for __rel_iplt_start,
6296 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
6297
934b01dd
ILT
62982009-11-03 Ian Lance Taylor <iant@google.com>
6299
6300 PR 10895
6301 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
6302 --msgid-bugs-address.
6303 (install-pdf): New target.
6304 (install-data_yes): Look up one directory to find mkinstalldirs.
6305
03c1939b
L
63062009-11-03 H.J. Lu <hongjiu.lu@intel.com>
6307
6308 * po/Make-in (.po.gmo): Don't generate .gmo files in source
6309 tree.
6310
ebd95253
DK
63112009-10-30 Doug Kwan <dougkwan@google.com>
6312
6313 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
6314
e9bbb538
DK
63152009-10-30 Doug Kwan <dougkwan@google.com>
6316
6317 * arm.cc (Stub_addend_reader): New struct template definition
6318 and partial specializations.
6319 (Stub_addend_reader::operator()): New method definition for a
6320 partially specialized template.
6321
d5b40221
DK
63222009-10-30 Doug Kwan <dougkwan@google.com>
6323
6324 * arm.cc (Arm_relobj::processor_specific_flags): New method
6325 definition.
6326 (Arm_relobj::do_read_symbols): New method declaration.
6327 (Arm_relobj::processor_specific_flags_): New data member declaration.
6328 (Arm_dynobj): New class definition.
6329 (Target_arm::do_finalize_sections): Add input_objects parameter.
6330 (Target_arm::do_adjust_elf_header): New method declaration.
6331 (Target_arm::are_eabi_versions_compatible,
6332 (Target_arm::merge_processor_specific_flags): New method declaration.
6333 (Target_arm::do_make_elf_object): New overloaded method definitions
6334 and declaration.
6335 (Arm_relobj::do_read_symbols): New method definition.
6336 (Arm_dynobj::do_read_symbols): Ditto.
6337 (Target_arm::do_finalize_sections): Add input_objects parameters.
6338 Merge processor-specific flags from all input objects.
6339 (Target_arm::are_eabi_versions_compatible,
6340 Target_arm::merge_processor_specific_flags,
6341 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
6342 New method definitions.
6343 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
6344 Input_objects pointer type parameter.
6345 * layout.cc (Layout::finalize): Pass input objects to target's.
6346 finalize_sections function.
6347 * output.cc (Output_file_header::do_sized_write): Set ELF file
6348 header's processor-specific flags.
6349 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6350 Input_objects pointer type parameter.
6351 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6352 * target.h (Input_objects): New forward class declaration.
6353 (Target::processor_specific_flags,
6354 Target::are_processor_specific_flags_sect): New method definitions.
6355 (Target::finalize_sections): Add input_objects parameter.
6356 (Target::Target): Initialize processor_specific_flags_ and
6357 are_processor_specific_flags_set_.
6358 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6359 parameter.
6360 (Target::set_processor_specific_flags): New method definition.
6361 (Target::processor_specific_flags_,
6362 Target::are_processor_specific_flags_set_): New data member
6363 declarations.
6364 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6365 Input_objects pointer type parameter.
6366
ebabffbd
DK
63672009-10-30 Doug Kwan <dougkwan@google.com>
6368
6369 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6370
ad0f2072
ILT
63712009-10-28 Ian Lance Taylor <iant@google.com>
6372
6373 * object.h (class Relobj): Drop options parameter from
6374 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6375 do_scan_relocs, do_relocate. Change all callers.
6376 (class Sized_relobj): Drop options parameters from
6377 do_gc_process_relocs, do_scan_relocs, do_relocate,
6378 do_relocate_sections, relocate_sections, emit_relocs_scan,
6379 emit_relocs_scan_reltype. Change all callers.
6380 (struct Relocate_info): Remove options field and all references to
6381 it.
6382 * reloc.h (class Read_relocs): Remove options constructor
6383 parameter and options_ field. Change all callers.
6384 (class Gc_process_relocs, class Scan_relocs): Likewise.
6385 (class Relocate_task): Likewise.
6386 * target-reloc.h (scan_relocs): Remove options parameter. Change
6387 all callers.
6388 (scan_relocatable_relocs): Likewise.
6389 * target.h (class Sized_target): Remove options parameter from
6390 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6391 all callers.
6392 * gc.h (gc_process_relocs): Remove options parameter. Change all
6393 callers.
6394 * arm.cc: Update functions to remove options parameters.
6395 * i386.cc: Likewise.
6396 * powerpc.cc: Likewise.
6397 * sparc.cc: Likewise.
6398 * x86_64.cc: Likewise.
6399 * testsuite/testfile.cc: Likewise.
6400
8ffa3667
DK
64012009-10-28 Doug Kwan <dougkwan@google.com>
6402
6403 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6404 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6405 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6406 New method definitions.
6407
40f36857
CC
64082009-10-28 Cary Coutant <ccoutant@google.com>
6409
6410 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6411 (Plugin::cleanup_done_): New member.
6412 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6413 (Plugin_manager::cleanup_done_): Remove.
6414 (Plugin_manager::add_input_file): Edit error message.
6415 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6416 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6417
2c849493
ILT
64182009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6419
6420 * fileread.cc: (File_read::View::~View): Use the new
6421 data_ownership_ filed.
6422 (File_read::~File_read): Dispose the new whole_file_view_.
6423 (File_read::open): Mmap the whole file if needed.
6424 (File_read::open): Use whole_file_view_ instead of contents_.
6425 (File_read::find_view): Use whole_file_view_ if applicable.
6426 (File_read::do_read): Use whole_file_view_ instead of contents_.
6427 (File_read::make_view): Use whole_file_view_ instead of contents_,
6428 update File_read::View::View call.
6429 (File_read::find_or_make_view): Update File_read::View::View
6430 call.
6431 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6432 remove contents_
6433 (File_read::View::Data_ownership): New enum.
6434 (File_read::View::View): Replace bool mapped_ with Data_ownership
6435 argument.
6436 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6437 (File_read::View::data_ownership_): New field.
6438 (File_read::contents_): Remove (replaced by whole_file_view_).
6439 (File_read::whole_file_view_): New field.
6440 * options.h (class General_options): Add --keep-files-mapped.
6441
24998053
CC
64422009-10-27 Cary Coutant <ccoutant@google.com>
6443
6444 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6445 * testsuite/Makefile.am (plugin_test_5): New test case.
6446 * testsuite/Makefile.in: Regenerate.
6447
72adc4fa
DK
64482009-10-25 Doug Kwan <dougkwan@google.com>
6449
6450 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6451 from private to protected to allow access by child class.
6452 (Sized_relobj::do_relocate_sections): New method declaration.
6453 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6454 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6455 Sized_relobj::relocate_sections. Instantiate template explicitly
6456 for different target sizes and endianity.
6457
07f508a2
DK
64582009-10-24 Doug Kwan <dougkwan@google.com>
6459
6460 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6461 (Arm_input_section::as_arm_input_section): New method.
6462 (Arm_output_section): New class definition.
6463 (Arm_output_section::create_stub_group,
6464 Arm_output_section::group_sections): New method definitions.
6465
10ad9fe5
DK
64662009-10-22 Doug Kwan <dougkwan@google.com>
6467
6468 * arm.cc (Arm_input_section): New class definition.
6469 (Arm_input_section::init, Arm_input_section:do_write,
6470 Arm_input_section::set_final_data_size,
6471 Arm_input_section::do_reset_address_and_file_offset): New method
6472 definitions.
6473
56ee5e00
DK
64742009-10-21 Doug Kwan <dougkwan@google.com>
6475
6476 * arm.cc (Stub_table, Arm_input_section): New forward class
6477 declarations.
6478 (Stub_table): New class defintion.
6479 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6480 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6481 New method definition.
6482
b569affa
DK
64832009-10-21 Doug Kwan <dougkwan@google.com>
6484
6485 * arm.cc: Update copyright comments.
6486 (Target_arm): New forward class template declaration.
6487 (Arm_address): New type.
6488 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6489 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6490 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6491 constants.
6492 (Insn_template): Same.
6493 (DEF_STUBS): New macro.
6494 (Stub_type): New enum type.
6495 (Stub_template): New class definition.
6496 (Stub): Same.
6497 (Reloc_stub): Same.
6498 (Stub_factory): Same.
6499 (Target_arm::Target_arm): Initialize may_use_blx_ and
6500 should_force_pic_veneer_.
6501 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6502 Target_arm::should_force_pic_veneer,
6503 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6504 Target_arm::using_thumb_only, Target_arm:;default_target): New
6505 method defintions.
6506 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6507 New data member declarations.
6508 (Insn_template::size, Insn_template::alignment): New method defintions.
6509 (Stub_template::Stub_template): New method definition.
6510 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6511 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6512 (Stub_factory::Stub_factory): New method definition.
6513 * gold.h (string_hash): New template.
6514 * output.h (Input_section_specifier::hash_value): Use
6515 gold::string_hash.
6516 (Input_section_specifier::string_hash): Remove.
6517 * stringpool.cc (Stringpool_template::string_hash): Use
6518 gold::string_hash.
6519
6c172549
DK
65202009-10-20 Doug Kwan <dougkwan@google.com>
6521
6522 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6523 symbols of relaxed input sections.
6524 * output.h (Output_section::find_relaxed_input_section): Make
6525 method public.
6526
c5617f2f
DK
65272009-10-16 Doug Kwan <dougkwan@google.com>
6528
6529 * dynobj.cc (Versions::Versions): Initialize version_script_.
6530 Only insert base version symbol definition for a shared object
6531 if version script defines any version versions.
6532 (Versions::define_base_version): New method definition.
6533 (Versions::add_def): Check that base version is not needed.
6534 (Versions::add_need): Define base version lazily.
6535 * dynobj.h (Versions::define_base_version): New method declaration.
6536 (Versions::needs_base_version_): New data member declaration.
6537 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6538 (check_DATA): Add no_version_test.stdout.
6539 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6540 New make rules.
6541 * testsuite/Makefile.in: Regenerate.
6542 * testsuite/no_version_test.c: New file.
6543 * testsuite/no_version_test.sh: Ditto.
6544
3c12dcdb
DK
65452009-10-16 Doug Kwan <dougkwan@google.com>
6546
6547 * expression.cc (class Segment_start_expression): New class definition.
6548 (Segment_start_expression::value): New method definition.
6549 (script_exp_function_segment_start): Return a new
6550 Segment_start_expression.
6551 * gold/script-c.h (script_saw_segment_start_expression): New function
6552 prototype.
6553 * script-sections.cc (Script_sections::Script_sections): Initialize
6554 SAW_SEGMENT_START_EXPRESSION_ to false.
6555 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6556 and -Tbbs options to specify section addresses if given in
6557 command line and no SEGMENT_START expression is seen in a script.
6558 * script-sections.h (Script_sections::saw_segment_start_expression,
6559 Script_sections::set_saw_segment_start_expression): New method
6560 definition.
6561 (Script_sections::saw_segment_start_expression_): New data member
6562 declaration.
6563 * script.cc (script_saw_segment_start_expression): New function.
6564 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6565 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6566 script_test_7.sh and script_test_8.sh.
6567 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6568 script_test_8.stdout.
6569 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6570 (script_test_6, script_test_6.stdout, script_test_7,
6571 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6572 * Makefile.in: Regenerate.
6573 * testsuite/script_test_6.sh: New file.
6574 * testsuite/script_test_6.t: Same.
6575 * testsuite/script_test_7.sh: Same.
6576 * testsuite/script_test_7.t: Same.
6577 * testsuite/script_test_8.sh: Same.
6578
64b1ae37
DK
65792009-10-16 Doug Kwan <dougkwan@google.com>
6580
6581 * output.cc (Output_segment::set_section_list_address): Cast
6582 expressions to unsigned long long type to avoid format warnings.
6583
661be1e2
ILT
65842009-10-15 Ian Lance Taylor <iant@google.com>
6585
12edd763 6586 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6587 dot assignment to script_sections_.
12edd763
ILT
6588 * script-sections.cc (Script_sections::add_dot_assignment):
6589 Initialize if necessary.
6590
68b6574b
ILT
6591 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6592 program headers with no load segment if there is a linker script.
6593
661be1e2
ILT
6594 * layout.cc (Layout::set_segment_offsets): Align the file offset
6595 to the segment aligment for -N or -n with no load segment.
6596 * output.cc (Output_segment::add_output_section): Don't crash if
6597 the first section is a TLS section.
6598 (Output_segment::set_section_list_addresses): Print an error
6599 message if the address moves backward in a linker script.
6600 * script-sections.cc
6601 (Output_section_element_input::set_section_addresses): Don't
6602 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6603 (Orphan_output_section::set_section_addresses): Likewise.
6604
f15f61a7
DK
66052009-10-15 Doug Kwan <dougkwan@google.com>
6606
6607 * layout.cc (Layout::finish_dynamic_section): Generate tags
6608 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6609 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6610 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6611
82bb573a
ILT
66122009-10-14 Ian Lance Taylor <iant@google.com>
6613
6614 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6615 fields.
6616 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6617 data_shdr fields of relinfo.
6618 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6619 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6620 R_386_TLS_LDO_32, adjust based on section flags.
6621 (Target_i386::Relocate::fix_up_ldo): Remove.
6622
374ad285
ILT
66232009-10-13 Ian Lance Taylor <iant@google.com>
6624
6625 Add support for -pie.
6626 * options.h (class General_options): Add -pie and
6627 --pic-executable.
6628 (General_options::output_is_position_independent): Test -pie.
6629 (General_options::output_is_executable): Return true if not shared
6630 and not relocatable.
6631 (General_options::output_is_pie): Remove.
6632 * options.cc (General_options::finalize): Reject incompatible uses
6633 of -pie.
6634 * gold.cc (queue_middle_tasks): A -pie link is not static.
6635 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6636 * symtab.cc (Symbol::final_value_is_known): Return false if
6637 output_is_position_independent.
6638 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6639 output_is_position_independent.
6640 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6641 output_is_position_independent.
6642 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6643 output_is_position_independent.
6644 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6645 two_file_pie_test.
6646 (basic_pie_test.o, basic_pie_test): New targets.
6647 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6648 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6649 (two_file_pie_test): New target.
6650 * testsuite/Makefile.in: Rebuild.
6651 * README: Remove note saying that -pie is not supported.
6652
c6585162
ILT
66532009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6654
6655 * options.h (class General_options): Add -init and -fini.
6656 * layout.cc (Layout::finish_dynamic_section): Emit
6657 given init and fini functions.
6658
032ce4e9
ST
66592009-10-13 Sriraman Tallam <tmsriram@google.com>
6660
6661 * gc.h (gc_process_relocs): Check if icf is enabled using new
6662 function.
6663 * gold.cc (queue_initial_tasks): Likewise.
6664 (queue_middle_tasks): Likewise.
6665 * object.cc (do_layout): Likewise.
6666 * symtab.cc (is_section_folded): Likewise.
6667 * main.cc (main): Likewise.
6668 * reloc.cc (Read_relocs::run): Likewise.
6669 (Sized_relobj::do_scan_relocs): Likewise.
6670 * icf.cc (is_function_ctor_or_dtor): New function.
6671 (Icf::find_identical_sections): Check if function is ctor or dtor when
6672 safe icf is chosen.
6673 * options.h (General_options::icf): Change option to be an enum.
6674 (Icf_status): New enum.
6675 (icf_enabled): New method.
6676 (icf_safe_folding): New method.
6677 (set_icf_status): New method.
6678 (icf_status_): New variable.
6679 * (options.cc) (General_options::finalize): Set icf_status_.
6680 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6681 icf_test and icf_keep_unique_test to use the --icf enum flag.
6682 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6683 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6684
f345227a
ST
66852009-10-12 Sriraman Tallam <tmsriram@google.com>
6686
6687 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6688 includes to gc.h and icf.h.
6689 * arm.cc: Include gc.h.
6690 * gold.cc: Likewise.
6691 * i386.cc: Likewise.
6692 * powerpc.cc: Likewise.
6693 * sparc.cc: Likewise.
6694 * x86_64.cc: Likewise.
6695 * gc.h: Include icf.h.
6696
1c7814ed
ILT
66972009-10-11 Ian Lance Taylor <iant@google.com>
6698
6699 * plugin.cc: Include "gold.h" before other header files.
6700
ae3b5189
CD
67012009-10-10 Chris Demetriou <cgd@google.com>
6702
6703 * options.h (Input_file_argument::Input_file_type): New enum.
6704 (Input_file_argument::is_lib_): Replace with...
6705 (Input_file_argument::type_): New member.
6706 (Input_file_argument::Input_file_argument): Take Input_file_type
6707 'type' rather than boolean 'is_lib' as second argument.
6708 (Input_file_argument::is_lib): Use type_.
6709 (Input_file_argument::is_searched_file): New function.
6710 (Input_file_argument::may_need_search): Handle is_searched_file.
6711 * options.cc (General_options::parse_library): Support -l:filename.
6712 (General_options::parse_just_symbols): Update for Input_file_argument
6713 changes.
6714 (Command_line::process): Likewise.
6715 * archive.cc (Archive::get_file_and_offset): Likewise.
6716 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6717 * script.cc (read_script_file, script_add_file): Likewise.
6718 * fileread.cc (Input_file::Input_file): Likewise.
6719 (Input_file::will_search_for): Handle is_searched_file.
6720 (Input_file::open): Likewise.
6721 * readsyms.cc (Read_symbols::get_name): Likewise.
6722 * testsuite/Makefile.am (searched_file_test): New test.
6723 * testsuite/Makefile.in: Regenerate.
6724 * testsuite/searched_file_test.cc: New file.
6725 * testsuite/searched_file_test_lib.cc: New file.
6726
f3048a1d
ILT
67272009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6728 Ian Lance Taylor <iant@google.com>
6729
6730 * descriptor.cc: Include <cstdio> and "binary-io.h".
6731 (Descriptors::open): Open the files in binary mode always.
6732 * script.cc (Lex::get_token): Treat \r as whitespace.
6733
d4780e57
ILT
67342009-10-09 Ian Lance Taylor <iant@google.com>
6735
6736 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6737
d9a893b8
ILT
67382009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6739 Ian Lance Taylor <iant@google.com>
6740
6741 * configure.ac: Check for readv function also.
6742 * fileread.cc (readv): Define if not HAVE_READV.
6743 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6744 does not exist.
6745 * config.in: Regenerate.
6746 * configure: Regenerate.
6747
c0a62865
DK
67482009-10-09 Doug Kwan <dougkwan@google.com>
6749
6750 * layout.cc (Layout::make_output_section): Call target hook to make
6751 ordinary output section.
6752 (Layout::finalize): Adjust parameter list of call the
6753 Target::may_relax().
6754 * layout.h (class Layout::section_list): New method.
6755 * merge.h (Output_merge_base::entsize): Change visibility to public.
6756 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6757 New methods.
6758 (Output_merge_string::do_is_string): New method.
6759 * object.cc (Sized_relobj::do_setup): renamed from
6760 Sized_relobj::set_up.
6761 * object.h (Sized_relobj::adjust_shndx,
6762 Sized_relobj::initializ_input_to_output_maps,
6763 Sized_relobj::free_input_to_output_maps): Change visibilities to
6764 protected.
6765 (Sized_relobj::setup): Virtualize.
6766 (Sized_relobj::do_setup): New method declaration.
6767 (Sized_relobj::invalidate_section_offset,
6768 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6769 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6770 * options.cc (parse_int): New function.
6771 * options.h (parse_int): New declaration.
6772 (DEFINE_int): New macro.
6773 (stub_group_size): New option.
6774 * output.cc (Output_section::Output_section): Initialize memebers
6775 merge_section_map_, merge_section_by_properties_map_,
6776 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6777 (Output_section::add_input_section): Handled deferred code-fill
6778 generation and remove an old comment.
6779 (Output_section::add_relaxed_input_section): New method definition.
6780 (Output_section::add_merge_input_section): Use merge section by
6781 properties map to speed to search. Update merge section maps
6782 as appropriate.
6783 (Output_section::build_relaxation_map): New method definition.
6784 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6785 Same.
6786 (Output_section::relax_input_section): Renamed to
6787 Output_section::convert_input_sections_to_relaxed_sections and change
6788 interface to take a vector of pointers to relaxed sections.
6789 (Output_section::find_merge_section,
6790 Output_section::find_relaxed_input_section): New method definitions.
6791 (Output_section::is_input_address_mapped,
6792 Output_section::output_offset, Output_section::output_address):
6793 Use output section data maps to speed up searching.
6794 (Output_section::find_starting_output_address): Add comments.
6795 (Output_section::do_write,
6796 Output_section::write_to_postprocessing_buffer): Do code-fill
6797 generation as appropriate.
6798 (Output_section::get_input_sections): Invalidate relaxed input section
6799 map.
6800 (Output_section::restore_states): Adjust type of checkpoint .
6801 Invalidate relaxed input section map.
6802 * output.h (Output_merge_base): New class declaration.
6803 (Input_section_specifier): New class defintion.
6804 (class Output_relaxed_input_section) Change base class to
6805 Output_section_data_build.
6806 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6807 base class initializer.
6808 (Output_section::add_relaxed_input_section): New method declaration.
6809 (Output_section::Input_section): Change visibility to protected.
6810 (Output_section::Input_section::relobj,
6811 Output_section::Input_section::shndx): Handle relaxed input sections.
6812 Output_section::input_sections) Change visibility to protected. Also
6813 define overload to return a non-const pointer.
6814 (Output_section::Merge_section_properties): New class defintion.
6815 (Output_section::Merge_section_by_properties_map,
6816 Output_section::Output_section_data_by_input_section_map,
6817 Output_section::Relaxation_map): New types.
6818 (Output_section::relax_input_section): Rename method to
6819 Output_section::convert_input_sections_to_relaxed_sections and change
6820 interface to take a vector of relaxed section pointers.
6821 (Output_section::find_merge_section,
6822 Output_section::find_relaxed_input_section,
6823 Output_section::build_relaxation_map,
6824 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6825 New method declarations.
6826 (Output_section::merge_section_map_
6827 Output_section::merge_section_by_properties_map_,
6828 Output_section::relaxed_input_section_map_,
6829 Output_section::is_relaxed_input_section_map_valid_,
6830 Output_section::generate_code_fills_at_write_): New data members.
6831 * script-sections.cc
6832 (Output_section_element_input::set_section_addresses): Call
6833 current_data_size and addralign methods of relaxed input sections.
6834 (Orphan_output_section::set_section_addresses): Call current_data_size
6835 and addralign methods of relaxed input sections.
6836 * symtab.cc (Symbol_table::compute_final_value): Extract template
6837 from the body of Symbol_table::sized_finalize_symbol.
6838 (Symbol_table::sized_finalized_symbol): Call
6839 Symbol_table::compute_final_value.
6840 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6841 (Symbol_table::compute_final_value): New templated method declaration.
6842 * target.cc (Target::do_make_output_section): New method defintion.
6843 * target.h (Target::make_output_section): New method declaration.
6844 (Target::relax): Add more parameters for input objects, symbol table
6845 and layout. Adjust call to do_relax.
6846 (Target::do_make_output_section): New method declaration.
6847 (Target::do_relax): Add parameters for input objects, symbol table
6848 and layout.
6849
d446d6c4
ILT
68502009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6851
6852 * pread.c: Include stdio.h.
6853
bc06c745
ILT
68542009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6855
6856 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6857 defined.
6858
75aea3d0
ILT
68592009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6860
6861 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6862 Change read_shndx type to unsigned int.
6863 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6864 int.
6865 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6866 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6867 Change read_shndx type to unsigned int.
6868 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6869 int.
6870 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6871 * layout.cc (Layout::create_symtab_sections): Cast the result of
6872 local_symcount * symsize to off_t in the gold_assert.
6873
be8fcb75
ILT
68742009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6875
6876 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6877 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6878 R_ARM_BASE_ABS.
6879 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6880 (Arm_relocate_functions::thm_abs5): New function.
6881 (Arm_relocate_functions::abs12): New function.
6882 (Arm_relocate_functions::abs16): New function.
6883 (Arm_relocate_functions::base_abs): New function.
6884 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6885 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6886 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6887 R_ARM_BASE_ABS.
6888 (Scan::global): Likewise.
6889 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6890 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6891 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6892 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6893 R_ARM_BASE_ABS.
6894
c2a122b6
ILT
68952009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6896
6897 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6898 (Arm_relocate_functions::movt_prel): New function.
6899 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6900 (Arm_relocate_functions::thm_movt_prel): New function.
6901 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6902 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6903 (Scan::global, Relocate::relocate): Likewise.
6904 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6905
c4aa1e2d
ILT
69062009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6907
6908 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6909 Incremental_checker.
6910 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6911 unsigned int.
6912 (class Incremental_inputs_header): New class.
6913 (Incremental_inputs_header_writer): Edit comment.
6914 (Incremental_inputs_entry): New class.
6915 (Incremental_inputs_entry_writer): Edit comment.
6916 (Sized_incremental_binary::do_find_incremental_inputs_section):
6917 Add *strtab_shndx parameter, fill it.
6918 (Sized_incremental_binary::do_check_inputs): New method.
6919 (Incremental_checker::can_incrementally_link_output_file): Use
6920 Sized_incremental_binary::check_inputs.
6921 (Incremental_inputs::report_command_line): Save command line in
6922 command_line_.
6923 * incremental.h:
6924 (Incremental_binary::find_incremental_inputs_section): New
6925 method.
6926 (Incremental_binary::do_find_incremental_inputs_section): Add
6927 strtab_shndx parameter.
6928 (Incremental_binary::do_check_inputs): New pure virtual method.
6929 (Sized_incremental_binary::do_check_inputs): Declare.
6930 (Incremental_checker::Incremental_checker): Add incremental_inputs
6931 parameter, use it to initialize incremental_inputs_.
6932 (Incremental_checker::incremental_inputs_): New field.
6933 (Incremental_checker::command_line): New method.
6934 (Incremental_checker::inputs): New method.
6935 (Incremental_checker::command_line_): New field.
6936
c549a694
ILT
69372009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6938
6939 * incremental.cc: Include <cstdarg> and "target-select.h".
6940 (vexplain_no_incremental): New function.
6941 (explain_no_incremental): New function.
6942 (Incremental_binary::error): New method.
6943 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6944 method.
6945 (make_sized_incremental_binary): New function.
6946 (open_incremental_binary): New function.
6947 (can_incrementally_link_file): Add checks if output is ELF and has
6948 inputs section.
6949 * incremental.h: Include "elfcpp_file.h" and "output.h".
6950 (Incremental_binary): New class.
6951 (Sized_incremental_binary): New class.
6952 (open_incremental_binary): Declare.
6953 * object.cc (is_elf_object): Use
6954 elfcpp::Elf_recognizer::is_elf_file.
6955 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6956 * output.h (Output_file::filesize): New method.
6957
fd3c5f0b
ILT
69582009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6959
6960 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6961 New function.
6962 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6963 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6964 function.
6965 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6966 function.
6967 (Arm_relocate_functions::movw_abs_nc): New function.
6968 (Arm_relocate_functions::movt_abs): New function.
6969 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6970 (Arm_relocate_functions::thm_movt_abs): New function.
6971 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6972 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6973 (Scan::global): Likewise.
6974 (Relocate::relocate): Likewise.
6975 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6976
7f5309a5
ILT
69772009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6978
6979 * arm.cc (Arm_relocate_functions::got_prel) New function.
6980 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6981 (Relocate::relocate): Likewise.
6982 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6983
364c7fa5
ILT
69842009-10-06 Ian Lance Taylor <iant@google.com>
6985
6986 * options.h (class General_options): Define
6987 split_stack_adjust_size parameter.
6988 * object.h (class Object): Add uses_split_stack_ and
6989 has_no_split_stack_ fields. Add uses_split_stack and
6990 has_no_split_stack accessor functions. Declare
6991 handle_split_stack_section.
6992 (class Reloc_symbol_changes): Define.
6993 (class Sized_relobj): Define Function_offsets. Declare
6994 split_stack_adjust, split_stack_adjust_reltype, and
6995 find_functions.
6996 * object.cc (Object::handle_split_stack_section): New function.
6997 (Sized_relobj::do_layout): Call handle_split_stack_section.
6998 * dynobj.cc (Sized_dynobj::do_layout): Call
6999 handle_split_stack_section.
7000 * reloc.cc (Sized_relobj::relocate_sections): Call
7001 split_stack_adjust for executable sections in split_stack
7002 objects. Pass reloc_map to relocate_section.
7003 (Sized_relobj::split_stack_adjust): New function.
7004 (Sized_relobj::split_stack_adjust_reltype): New function.
7005 (Sized_relobj::find_functions): New function.
7006 * target-reloc.h: Include "object.h".
7007 (relocate_section): Add reloc_symbol_changes parameter. Change
7008 all callers.
7009 * target.h (class Target): Add calls_non_split method. Declare
7010 do_calls_non_split virtual method. Declare match_view and
7011 set_view_to_nop.
7012 * target.cc: Include "elfcpp.h".
7013 (Target::do_calls_non_split): New function.
7014 (Target::match_view): New function.
7015 (Target::set_view_to_nop): New function.
7016 * gold.cc (queue_middle_tasks): Give an error if mixing
7017 split-stack and non-split-stack objects with -r.
7018 * i386.cc (Target_i386::relocate_section): Add
7019 reloc_symbol_changes parameter.
7020 (Target_i386::do_calls_non_split): New function.
7021 * x86_64.cc (Target_x86_64::relocate_section): Add
7022 reloc_symbol_changes parameter.
7023 (Target_x86_64::do_calls_non_split): New function.
7024 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7025 parameter.
7026 * powerpc.cc (Target_powerpc::relocate_section): Add
7027 reloc_symbol_changes parameter.
7028 * sparc.cc (Target_sparc::relocate_section): Add
7029 reloc_symbol_changes parameter.
7030 * configure.ac: Call AM_CONDITIONAL for the default target.
7031 * configure: Rebuild.
7032 * testsuite/Makefile.am (TEST_AS): New variable.
7033 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7034 (check_DATA): Add split_i386 and split_x86_64 files.
7035 (SPLIT_DEFSYMS): Define.
7036 (split_i386_[1234n].o): New targets.
7037 (split_i386_[124]): New targets.
7038 (split_i386_[1234r].stdout): New targets.
7039 (split_x86_64_[1234n].o): New targets.
7040 (split_x86_64_[124]): New targets.
7041 (split_x86_64_[1234r].stdout): New targets.
7042 (MOSTLYCLEANFILES): Add new executables.
7043 * testsuite/split_i386.sh: New file.
7044 * testsuite/split_x86_64.sh: New file.
7045 * testsuite/split_i386_1.s: New file.
7046 * testsuite/split_i386_2.s: New file.
7047 * testsuite/split_i386_3.s: New file.
7048 * testsuite/split_i386_4.s: New file.
7049 * testsuite/split_i386_n.s: New file.
7050 * testsuite/split_x86_64_1.s: New file.
7051 * testsuite/split_x86_64_2.s: New file.
7052 * testsuite/split_x86_64_3.s: New file.
7053 * testsuite/split_x86_64_4.s: New file.
7054 * testsuite/split_x86_64_n.s: New file.
7055 * testsuite/testfile.cc (Target_test): Update relocation_section
7056 function.
7057 * testsuite/Makefile.in: Rebuild.
7058
e8a9fcda
ILT
70592009-10-06 Ian Lance Taylor <iant@google.com>
7060
7061 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7062 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7063 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7064 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7065 the address on ldo_addrs_.
7066 (Target_i386::Relocate::fix_up_ldo): New function.
7067
e99daf92
ILT
70682009-10-06 Rafael Espindola <espindola@google.com>
7069
7070 * plugin.cc (add_input_library): New.
7071 (Plugin::load): Add add_input_library to tv.
7072 (Plugin_manager::add_input_file): Add the is_lib argument.
7073 (add_input_file): Update call to Plugin_manager::add_input_file.
7074 (add_input_library): New.
7075 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7076
966d4097
DK
70772009-09-30 Doug Kwan <dougkwan@google.com>
7078
7079 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7080 symbol and call Symbol::may_need_copy_reloc to determine if
7081 a copy reloc is needed.
7082 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7083 nocopyreloc is given in command line.
7084 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7085 given in command line.
7086 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7087 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7088 of the removed Target_i386::may_need_copy_reloc.
7089 * options.h (copyreloc): New option with default value false.
7090 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7091 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7092 instead of the removed Target_powerpc::may_need_copy_reloc.
7093 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7094 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7095 instead of the removed Target_sparc::may_need_copy_reloc.
7096 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7097 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7098 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7099 instead of the removed Target_x86_64::may_need_copy_reloc.
7100
029ba973
ILT
71012009-09-30 Ian Lance Taylor <iant@google.com>
7102
7103 * object.h (class Object): Remove target_ field, and target,
7104 sized_target, and set_target methods.
7105 (Object::sized_target): Remove.
7106 (class Sized_relobj): Update declarations. Remove sized_target.
7107 * object.cc (Sized_relobj::setup): Remove target parameter.
7108 Change all callers.
7109 (Input_objects::add_object): Don't do anything with the target.
7110 (make_elf_sized_object): Add punconfigured parameter. Change all
7111 callers. Set or test parameter target.
7112 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7113 Change all callers.
7114 * parameters.cc (Parameters::set_target): Change parameter type to
7115 be non-const.
7116 (Parameters::default_target): Remove.
7117 (set_parameters_target): Change parameter type to be non-const.
7118 (parameters_force_valid_target): New function.
7119 (parameters_clear_target): New function.
7120 * parameters.h (class Parameters): Update declarations. Remove
7121 default_target method. Add sized_target and clear_target
7122 methods. Change target_ to be non-const.
7123 (set_parameters_target): Update declaration.
7124 (parameters_force_valid_target): Declare.
7125 (parameters_clear_target): Declare.
7126 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7127 as NULL if we aren't searching.
7128 (Add_symbols::run): Don't check for compatible target.
7129 * fileread.cc (Input_file::open_binary): Call
7130 parameters_force_valid_target.
7131 * gold.cc (queue_middle_tasks): Likewise.
7132 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7133 set_target on object.
7134 * dynobj.h (class Sized_dynobj): Update declarations.
7135 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7136 make_elf_object returns NULL.
7137 (Archive::include_member): Don't check whether object target is
7138 compatible.
7139 * output.cc (Output_section::add_input_section): Get target from
7140 parameters.
7141 (Output_section::relax_input_section): Likewise.
7142 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7143 parameters.
7144 (Sized_relobj::do_scan_relocs): Likewise.
7145 (Sized_relobj::relocate_sections): Likewise.
7146 * resolve.cc (Symbol_table::resolve): Likewise.
7147 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7148 parameter. Change all callers.
7149 (Symbol_table::add_from_object): Get target from parameters.
7150 (Symbol_table::add_from_relobj): Don't check object target.
7151 (Symbol_table::add_from_dynobj): Likewise.
7152 (Symbol_table::define_special_symbol): Get target from
7153 parameters.
7154 * symtab.h (class Symbol_table): Update declaration.
7155 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7156 parameter. Change all callers. Clear parameter target.
7157 (Binary_test): Test target here.
7158 * testsuite/object_unittest.cc (gold_testsuite): Remove
7159 target_test_pointer parameter. Change all callers.
7160 (Object_test): Test target here.
7161
a6a22b83
ILT
71622009-09-26 Ian Lance Taylor <iant@google.com>
7163
7164 * testsuite/initpri1.c: Don't try to use constructor priorities if
7165 compiling with gcc before 4.3.
7166
6a8f49fe
ILT
71672009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7168
7169 * testsuite/retain_symbols_file_test.sh (check_present): Change
7170 output file name to retain_symbols_file_test.stdout.
7171 (check_absent): Likewise.
7172
8c604651
CS
71732009-09-18 Craig Silverstein <csilvers@google.com>
7174
7175 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
7176 * options.cc: Include <cerrno> and <fstream>.
7177 (General_options::finalize): Parse -retain-symbols-file tag.
7178 * options.h: New flag.
7179 (General_options): New method should_retain_symbol, new
7180 variable symbols_to_retain.
7181 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
7182 should_retain_symbol map.
7183 * testsuite/Makefile.am (retain_symbols_file_test): New test.
7184 * testsuite/Makefile.in: Regenerate.
7185 * testsuite/retain_symbols_file_test.sh: New file.
7186
ca58b19f
NC
71872009-09-18 Nick Clifton <nickc@redhat.com>
7188
7189 * po/es.po: Updated Spanish translation.
7190
20e6d0d6
DK
71912009-09-17 Doug Kwan <dougkwan@google.com>
7192
7193 * debug.h (DEBUG_RELAXATION): New constant.
7194 (DEBUG_ALL): Add DEBUG_RELAXATION.
7195 (debug_string_to_enum): Add relaxation debug option.
7196 * layout.cc
7197 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
7198 Layout::Relaxation_debug_check::read_sections,
7199 Layout::Relaxation_debug_check::read_sections): New method definitions.
7200 (Layout::Layout): Initialize data members
7201 record_output_section_data_from_scrips_,
7202 script_output_section_data_list_ and relaxation_debug_check_.
7203 (Layout::save_segments, Layout::restore_segments,
7204 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7205 Layout::relaxation_loop_body): New method definitions.
7206 (Layout::finalize): Support relaxation. Move section layout code to
7207 Layout::relaxation_loop_body.
7208 (Layout::set_asection_address_from_script): Move code for orphan
7209 section placement out.
7210 (Layout::place_orphan_sections_in_script): New method definition.
7211 * layout.h (Output_segment_headers, Output_file_header):
7212 New forward class declarations.
7213 (Layout::~Layout): Define.
7214 (Layout::new_output_section_data_from_script): New method definition.
7215 (Layout::place_orphan_sections_in_script): New method declaration.
7216 (Layout::Segment_states): New type declaration.
7217 (Layout::save_segments, Layout::restore_segments,
7218 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7219 Layout::relaxation_loop_body): New method declarations.
7220 (Layout::Output_section_data_list): New type declaration.
7221 (Layout::Relaxation_debug_check): New class definition.
7222 (Layout::record_output_section_data_from_script_,
7223 Layout::script_output_section_data_list_, Layout::segment_states_,
7224 Layout::relaxation_debug_check_): New data members.
7225 * output.cc: (Output_section_headers::do_size): New method definition.
7226 (Output_section_headers::Output_section_headers): Move size
7227 computation to Output_section_headers::do_size.
7228 (Output_segment_headers::do_size): New method definition.
e1df38aa 7229 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
7230 Output_file_header::do_size and call it.
7231 (Output_file_header::do_size): New method definition.
7232 (Output_data_group::Output_data_group): Adjust call to
7233 Output_section_data.
7234 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
7235 (Output_symtab_xindex::do_write): Add array bound check.
7236 (Output_section::Input_section::print_to_mapfile): Handle
7237 RELAXED_INPUT_SECTION_CODE.
7238 (Output_section::Output_section): Initialize data member checkpoint_.
7239 (Output_section::~Output_section): Delete checkpoint object pointed
7240 by checkpoint_.
7241 (Output_section::add_input_section): Always add an Input_section if
7242 relaxing.
7243 (Output_section::add_merge_input_section): Add assert.
7244 (Output_section::relax_input_section): New method definition.
7245 (Output_section::set_final_data_size): Set load address to zero for
7246 an unallocated section.
7247 (Output_section::do_address_and_file_offset_have_reset_values):
7248 New method definition.
7249 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
7250 Handle relaxed input section.
7251 (Output_section::sort_attached_input_sections): Checkpoint input
7252 section list lazily.
7253 (Output_section::get_input_sections): Change type of input_sections to
7254 list of Simple_input_section pointers. Checkpoint input section list
7255 lazily. Also handle relaxed input sections.
7256 (Output_section::add_input_section_for_script): Take a reference to
7257 a Simple_input_section object instead of Relobj pointer and section
7258 index as parameter. Handle relaxed input sections.
7259 (Output_section::save_states, Output_section::restore_states): New
7260 method definitions.
7261 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
7262 (Output_data::is_data_size_fixed): New method definition.
7263 (Output_data::reset_addresss_and_file_offset): Do not reset data size
7264 if it is fixed.
7265 (Output_data::address_and_file_offset_have_reset_values): New method
7266 definition.
7267 (Output_data::do_address_and_file_offset_have_reset_values): New method
7268 definition.
7269 (Output_data::set_data_size): Check that data size is not fixed.
7270 (Output_data::fix_data_size): New method definition.
7271 (Output_data::is_data_size_fixed_): New data member.
7272 (Output_section_headers::set_final_data_size): New method definition.
7273 (Output_section_headers::do_size): New method declaration.
7274 (Output_segment_headers::set_final_data_size): New method definition.
7275 (Output_segment_headers::do_size): New method declaration.
7276 (Output_file_header::set_final_data_size)::New method definition.
7277 (Output_file_header::do_size)::New method declaration.
7278 (Output_section_data::Output_section_data): Add new parameter
7279 is_data_size_fixed and use it to fix data size.
7280 (Output_data_const::Output_data_const): Adjust call to base class
7281 constructor and fix data size.
7282 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
7283 base class constructor and fix data size.
7284 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
7285 base class constructor and fix data size.
7286 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
7287 class constructor and fix data size.
7288 (Output_data_group::set_final_data_size): New method definition.
7289 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
7290 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
7291 class constructor and fix data size.
7292 (Output_relaxed_input_section): New class definition.
7293 (Output_section::Simple_input_section): New class definition.
7294 (Output_section::get_input_sections): Adjust parameter list.
7295 (Output_section::add_input_section_for_script): Same.
7296 (Output_section::save_states, Output_section::restore_states,
7297 Output_section::do_address_and_file_offset_have_reset_values,
7298 (Output_section::Input_section::Input_section): Handle
7299 RELAXED_INPUT_SECTION_CODE. Add new overload for
7300 Output_relaxed_input_section.
7301 (Output_section::Input_section::is_input_section,
7302 Output_section::Input_section::set_output_section): Handle relaxed
7303 input section.
7304 (Output_section::Input_section::is_relaxed_input_section,
7305 Output_section::Input_section::output_section_data,
7306 Output_section::Input_section::relaxed_input_section): New method
7307 definitions.
7308 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
7309 value.
7310 (Output_section::Input_section::u1_): Update comments.
7311 (Output_section::Input_section::u2_): Add new union member poris.
7312 (Output_section::Checkpoint_output_section): New classs definition.
7313 (Output_section::relax_input_section): New method declaration.
7314 (Output_section::checkpoint_): New data member.
7315 (Output_segment): Update comments.
7316 (Output_segment::Output_segment): Un-privatize copy constructor.
7317 (Output_segment::operator=): Un-privatize.
7318 * script-sections.cc (Output_section_element::Input_section_list):
7319 Change element type to Output_section::Simple_input_section.
7320 (Output_section_element_dot_assignment::set_section_addresses):
7321 Register output section data for relaxation clean up.
7322 (Output_data_exression::Output_data_expression): Adjust call to base
7323 constructor to fix data size.
7324 (Output_section_element_data::set_section_addresses): Register
7325 Output_data_expression object for relaxation clean up.
7326 (struct Input_section_info): Replace Relobj pointer and section index
7327 pair with Output_section::Simple_input_section and Convert struct to a
7328 class.
7329 (Input_section_sorter::operator()): Adjust access to
e1df38aa 7330 Input_section_info data member to use accessors.
20e6d0d6
DK
7331 (Output_section_element_input::set_section_addresses): Use layout
7332 parameter. Adjust code to use Output_section::Simple_input_section
7333 and Input_secction_info classes. Register filler for relaxation
7334 clean up.
7335 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
7336 and section index pair with Output_section::Simple_input_section
7337 class. Adjust code accordingly.
7338 (Phdrs_element::release_segment): New method definition.
7339 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
7340 segment list.
7341 (Script_sections::release_segments): New method definition.
7342 * gold/script-sections.h (Script_sections::release_segments): New
7343 method declaration.
7344 * gold/target.h (Target::may_relax, Target::relax,
7345 Target::do_may_relax, Target::do_relax): New method definitions.
7346
5e445df6
ILT
73472009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7348
7349 * arm.cc (has_signed_unsigned_overflow): New function.
7350 (Arm_relocate_functions::abs8): New function.
7351 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7352 (Target_arm::Scan::global): Likewise.
7353 (Target_arm::relocate::relocate): Likewise.
7354 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7355 Likewise.
7356
8c604651 73572009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7358
7359 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7360 * testsuite/Makefile.in: Regenerate.
7361
1e9cc1c2
NC
73622009-09-11 Nick Clifton <nickc@redhat.com>
7363
7364 * po/gold.pot: Updated by the Translation project.
7365
6a89f575
CC
73662009-09-08 Cary Coutant <ccoutant@google.com>
7367
7368 * output.cc (Output_file::open): Add execute permission to empty file.
7369 * testsuite/Makefile.am (permission_test): New test.
7370 * testsuite/Makefile.in: Regenerate.
7371
fdcac5af
ILT
73722009-09-02 Ian Lance Taylor <iant@google.com>
7373
7374 * output.cc (Output_file::resize): Call map_no_anonymous rather
7375 than map.
7376
44453f85
ILT
73772009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7378
7379 * gold.cc: Include "incremental.h".
7380 (queue_initial_tasks): Call Incremental_checker methods.
7381 * incremental.cc: Include "output.h".
7382 (Incremental_checker::can_incrementally_link_output_file): New
7383 method.
7384 * incremental.h (Incremental_checker): New class.
7385
7386 * output.cc (Output_file::open_for_modification): New method.
7387 (Output_file::map_anonymous): Changed return type to bool. Record
7388 map in base_ field.
7389 (Output_file::map_no_anonymous): New method, broken out of map.
7390 (Output_file::map): Use map_no_anonymous and map_anonymous.
7391 * output.h (class Output_file): Update declarations.
7392
293c1386
CC
73932009-08-24 Cary Coutant <ccoutant@google.com>
7394
7395 * options.h (Command_line::Pre_options): New class.
7396 (Command_line::pre_options): New member.
7397 * options.cc (gold::options::ready_to_register): New variable.
7398 (One_option::register_option): Do nothing if not registering options.
7399 Assert if same short option registered twice.
7400 (General_options::General_options): Turn off option registration when
7401 done constructing.
7402 (Command_line::Pre_options::Pre_options): New constructor.
7403
f773f3d2
CC
74042009-08-24 Cary Coutant <ccoutant@google.com>
7405
06a73cfe
CC
7406 * options.h (General_options::no_keep_memory): Remove incorrect
7407 short option.
f773f3d2 7408
a15af8e2
RW
74092009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7410
7411 * Makefile.am (am__skiplex, am__skipyacc): New.
7412 * Makefile.in: Regenerate.
7413
c462b41b
RW
74142009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7415
14ec8efd
RW
7416 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7417 (INCLUDES): ... this.
7418 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7419 (AM_CPPFLAGS): Renamed from ...
7420 (INCLUDE): ... this.
7421 * Makefile.in, testsuite/Makefile.in: Regenerate.
7422
81ecdfbb
RW
7423 * Makefile.in: Regenerate.
7424 * aclocal.m4: Likewise.
7425 * config.in: Likewise.
7426 * configure: Likewise.
7427 * testsuite/Makefile.in: Likewise.
7428
c462b41b
RW
7429 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7430 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7431 * Makefile.in: Regenerate.
7432 * testsuite/Makefile.in: Regenerate.
7433
2da73f13
CC
74342009-08-19 Cary Coutant <ccoutant@google.com>
7435
7436 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7437 symbols in shared libraries overridden by hidden or internal symbols
7438 in the main program.
7439
2db70501
CD
74402009-08-19 Chris Demetriou <cgd@google.com>
7441
7442 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7443 checking source file names in error messages.
7444
f733487b
DK
74452009-08-18 Doug Kwan <dougkwan@google.com>
7446
7447 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7448 an elcpp::Ehdr as parameter. Adjust call to set_target.
7449 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7450 an elfcpp::Ehdr as parameter.
7451 * object.cc (Object::set_target): Remove the version that looks up
7452 a target and sets it.
7453 (Sized_relobj::setup): Take a Target object instead of
7454 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7455 (make_elf_sized_object): Find target and ask target to
7456 make an ELF object.
7457 * object.h: (Object::set_target): Remove the version that looks up
7458 a target and sets it.
7459 (Sized_relobj::setup): Take a Target object instead of
7460 an elfcpp:Ehdr as parameter.
7461 * target.cc: Include dynobj.h.
7462 (Target::do_make_elf_object_implementation): New.
7463 (Target::do_make_elf_object): New.
7464 * target.h (Target::make_elf_object): New template declaration.
7465 (Target::do_make_elf_object): New method declarations.
7466 (Target::do_make_elf_object_implementation): New template declaration.
7467
cc70f101
ILT
74682009-08-14 Ian Lance Taylor <iant@google.com>
7469
7470 * gold.h (FUNCTION_NAME): Define.
7471 (gold_unreachable): Use FUNCTION_NAME.
7472
ef5e0cb1
ST
74732009-08-12 Sriraman Tallam <tmsriram@google.com>
7474
7475 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7476 symbol in the --keep-unique list is not found.
7477
48c187ce
ST
74782009-08-12 Sriraman Tallam <tmsriram@google.com>
7479
7480 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7481 been maked as --keep-unique.
7482 (Icf::unfold_section): New function.
7483 * icf.h (Icf::unfold_section): New function.
7484 * options.h (General_options::keep_unique): New option.
7485 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7486 * testsuite/Makefile.in: Regenerate.
7487 * testsuite/icf_keep_unique_test.sh: New file.
7488 * testsuite/icf_keep_unique_test.cc: New file.
7489
645afe0c
CC
74902009-08-12 Cary Coutant <ccoutant@google.com>
7491
7492 PR 10471
7493 * resolve.cc (Symbol_table::resolve): Check for references from
7494 dynamic objects to hidden and internal symbols.
7495 * testsuite/Makefile.am (hidden_test.sh): New test.
7496 * testsuite/Makefile.in: Regenerate.
7497 * testsuite/hidden_test.sh: New script.
7498 * testsuite/hidden_test_1.c: New test source.
7499 * testsuite/hidden_test_main.c: New test source.
7500
11af873f
DK
75012009-08-11 Doug Kwan <dougkwan@google.com>
7502
7503 * arm.cc: Update comments.
7504 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7505 segment to locate the .ARM.exidx section if present.
7506
b9f7d72d
DK
75072009-08-09 Doug Kwan <dougkwan@google.com>
7508
7509 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7510 patch.
7511
ddd3c53c
ST
75122009-08-07 Sriraman Tallam <tmsriram@google.com>
7513 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7514 compiler warnings.
7515
27721062
ST
75162009-08-06 Sriraman Tallam <tmsriram@google.com>
7517
7518 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7519 valid tls_segment only for non-debug-section relocations.
7520 * testsuite/Makefile.am: Add gc_tls_test.
7521 * testsuite/Makefile.in: Regenerate.
7522 * testsuite/gc_tls_test.cc: New file.
7523 * testsuite/gc_tls_test.sh: New file.
7524
ef15dade 75252009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7526
ef15dade
ST
7527 * icf.cc: New file.
7528 * icf.h: New file.
7529 * Makefile.am (CCFILES): Add icf.cc.
7530 (HFILES): Add icf.h
7531 * Makefile.in: Regenerate.
7532 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7533 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7534 section, symbol and addend information for the relocs.
7535 * gold.cc (queue_middle_tasks): Call identical code folding.
7536 * gold.h: Add defines for multimap.
7537 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7538 to the call of finalize_local_symbols.
7539 * main.cc (main): Create object of class Icf.
7540 * object.cc (Sized_relobj::do_layout): Allow this function to be
7541 called twice during icf.
7542 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7543 to sections marked as identical by icf.
7544 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7545 when available.
7546 (Sized_relobj::do_section_entsize): New function.
7547 * object.h (Object::section_entsize): New function.
7548 (Object::do_section_entsize): New pure virtual function.
7549 (Relobj::finalize_local_symbols): Add new parameter.
7550 (Relobj::do_section_entsize): New function.
7551 * options.h (General_options::icf): New option.
7552 (General_options::icf_iterations): New option.
7553 (General_options::print_icf_sections): New option.
7554 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7555 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7556 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7557 icf.
7558 * symtab.cc (Symbol_table::is_section_folded): New function.
7559 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7560 to sections marked as identical by icf.
7561 * symtab.h (Symbol_table::set_icf): New function.
7562 (Symbol_table::icf): New function.
7563 (Symbol_table::is_section_folded): New function.
7564 (Symbol_table::icf_): New data member.
7565 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7566 * testsuite/Makefile.am: Add commands to build icf_test.
7567 * testsuite/Makefile.in: Regenerate.
7568 * testsuite/icf_test.sh: New file.
7569 * testsuite/icf_test.cc: New file.
7570
c3b65ac4
CD
75712009-07-24 Chris Demetriou <cgd@google.com>
7572
7573 * layout.cc (is_compressible_debug_section): Fix incorrect
7574 comment about compressed section names.
7575
1caf2c51
ILT
75762009-07-20 Ian Lance Taylor <ian@airs.com>
7577
7578 PR 10419
7579 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7580
1ef4d87f
ILT
75812009-07-16 Ian Lance Taylor <iant@google.com>
7582
7583 PR 10400
7584 * layout.h: #include <map>.
7585 (class Kept_section): Change from struct to class. Add accessors
7586 and setters. Add section size to Comdat_group mapping. Change
7587 Comdat_group to std::map. Add is_comdat_ field. Add
7588 linkonce_size field in union.
7589 (class Layout): Update declaration of find_or_add_kept_section.
7590 Don't declare find_kept_object.
7591 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7592 parameter. Add object, shndx, is_comdat, and is_group_name
7593 parameters. Change all callers. Adjust for new Kept_section.
7594 (Layout::find_kept_object): Remove.
7595 * object.cc (Sized_relobj::include_section_group): Update use of
7596 Kept_section. Rename secnum to shndx. Only record
7597 Kept_comdat_section if sections are the same size.
7598 (Sized_relobj::include_linkonce_section): Update use of
7599 Kept_section. Only record Kept_comdat_section if sections are the
7600 same size. Set size of linkonce section.
7601 (Sized_relobj::map_to_kept_section): Update call to
7602 get_kept_comdat_section.
7603 * object.h (class Sized_relobj): Rename fields in
7604 Kept_comdat_section to drop trailing underscores; change object
7605 field to Relobj*. Change Kept_comdat_section_table to store
7606 struct rather than pointer.
7607 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7608 Add kept_object and kept_shndx parameters. Change all callers.
7609 (Sized_relobj::get_kept_comdat_section): Change return type to
7610 bool. Add kept_object and kept_shndx parameters. Change all
7611 callers.
7612 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7613 Layout::find_or_add_kept_section.
7614
37c3b7b0
ILT
76152009-07-09 Ian Lance Taylor <iant@google.com>
7616
7617 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7618 Reserve space in the hash table.
7619
98fa85cb
ILT
76202009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7621
7622 * fileread.cc (File_read::get_mtime): New method.
7623 * fileread.h (Timespec): New structure.
7624 (File_read::get_mtime): New method.
7625 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7626 Renamed from timestamp_nsec.
7627 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7628 Elf_Xword.
e1df38aa 7629 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7630 timestamp_nsec.
e1df38aa 7631 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7632 (Incremental_inputs::report_obejct): Save mtime; style fix.
7633 (Incremental_inputs::report_script): Save mtime; style fix.
7634 (Incremental_inputs::finalize_inputs): Style fix.
7635 (Incremental_inputs::finalize): Style fix.
7636 (Incremental_inputs::create_input_section_data): Store inputs
7637 mtime.
7638 * incremental.h (Incremental_inputs::report_script): Add mtime
7639 argument.
7640 (Incremental_inputs::Input_info::Input_info): Intialize only one
7641 union member.
7642 (Incremental_inputs::Input_info::archive): Move to nameless
7643 union.
7644 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7645 (Incremental_inputs::Input_info::script): Move to nameless union.
7646 (Incremental_inputs::mtime): New field.
7647 * script.cc (read_input_script): Pass file mtime to
7648 Incremental_input.
7649 * script.h (Script_info::inputs): Style fix.
7650
c9d70757
ILT
76512009-07-01 Ian Lance Taylor <ian@airs.com>
7652
7653 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7654 instead of 32.
7655
9c547ec3
ILT
76562009-06-24 Ian Lance Taylor <iant@google.com>
7657
7658 PR 10156
7659 * layout.cc (Layout::choose_output_section): If we find an
7660 existing section, update the flags.
7661 (Layout::create_notes): New function, broken out of
7662 Layout::finalize.
7663 (Layout::finalize): Don't create note sections.
7664 (Layout::create_note): Don't crash if linker script discards
7665 section.
7666 (Layout::create_gold_note): Likewise.
7667 (Layout::create_build_id): Likewise. Don't set
7668 after_input_sections on the section.
7669 (Layout::create_executable_stack_info): Remove target parameter.
7670 Change caller.
7671 * layout.h (class Layout): Declare create_notes. Update
7672 declaration of create_executable_stack_info.
7673 * gold.cc (queue_middle_tasks): Call create_notes.
7674 * output.cc (Output_section::update_flags_for_input_section): Move
7675 here from output.h. If SHF_ALLOC flag is newly set, mark address
7676 invalid.
7677 * output.h (Output_data::mark_address_invalid): New function.
7678 (class Output_section): Only declare, not define,
7679 update_flags_for_input_section. Remove set_flags.
7680
55458500
ILT
76812009-06-24 Ian Lance Taylor <iant@google.com>
7682
7683 * script-sections.cc (Output_section_definition::
7684 set_section_addresses): Rename shadowing local load_address to
7685 laddr.
7686
1307d6cd
ILT
76872009-06-24 Ian Lance Taylor <iant@google.com>
7688
7689 PR 10244
7690 * reloc.cc (relocate_sections): Skip empty relocation sections.
7691
ec3f783e
ILT
76922009-06-23 Ian Lance Taylor <iant@google.com>
7693
7694 PR 10156
7695 * layout.cc (Layout::create_note): Use choose_output_section
7696 rather than make_output_section.
7697
459c9f1c
ILT
76982009-06-23 Ian Lance Taylor <iant@google.com>
7699
7700 PR 10237
7701 * options.cc (General_options::parse_V): Set printed_version_.
7702 (General_options::General_options): Initialize printed_version_.
7703 * options.h (class General_options): Add printed_version_ field.
7704 * gold.cc (queue_initial_tasks): If there are no input files,
7705 don't give a fatal error if we printed the version information.
7706 (queue_middle_tasks): If using -r with a shared object, give a
7707 fatal error rather than an ordinary error.
7708
1518dc8f
ILT
77092009-06-23 Ian Lance Taylor <iant@google.com>
7710
7711 PR 10219
7712 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7713 (Layout::make_output_section): Set have_stabstr_section_ if we see
7714 a .stab*str section.
7715 (Layout::finalize): Call link_stabs_sections.
7716 (Layout::link_stabs_sections): New file.
7717 * layout.h (class Layout): Add have_stabstr_section_ field.
7718 Declare link_stabs_sections.
7719
3d857b98
DK
77202009-06-23 Doug Kwan <dougkwan@google.com>
7721
7722 * Makefile.am (libgold_a_LIBADD): New.
7723 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7724 * Makefile.in: Regenerate.
7725 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7726 * configure: Regenerate.
7727 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7728 * fileread.cc: Include sys/state.h
7729 * gold.h: Declare memmem and strndup if found missing.
7730 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7731
0639a6f6
ILT
77322009-06-23 Ian Lance Taylor <iant@google.com>
7733
7734 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7735 * configure: Rebuild.
7736
8d63875c
ILT
77372009-06-23 Ian Lance Taylor <iant@google.com>
7738
7739 PR 10147
7740 * object.cc (Object::section_contents): Don't try to get a view if
7741 the section has length zero.
7742 (Object::handle_gnu_warning_section): If the section is empty, use
7743 the name of the section as the warning.
7744
f7c8a183
ILT
77452009-06-23 Ian Lance Taylor <iant@google.com>
7746
7747 PR 10133
7748 * stringpool.h (class Stringpool_template): Add optimize_ field.
7749 (Stringpool_template::set_optimize): New function.
7750 * stringpool.cc (Stringpool_template::Stringpool_template):
7751 Initialize optimize_ field.
7752 (Stringpool_template::set_string_offsets): Test local optimize
7753 fild rather than parameter.
7754 * layout.cc (Layout::Layout): Call set_optimize on the section
7755 name stringpool.
7756
e6a307ba
ILT
77572009-06-22 Ian Lance Taylor <iant@google.com>
7758
7759 PR 10030
7760 * yyscript.y: Parse TARGET.
7761 * script.cc (script_set_target): New function.
7762 * script-c.h (script_set_target): Declare.
7763 * options.cc (General_options::string_to_object_format): Rename
7764 from string_to_object_format in anonymous namespace. Change
7765 callers.
7766 * options.h (class General_options): Declare
7767 string_to_object_format.
7768
3ee173de
ILT
77692009-06-22 Ian Lance Taylor <iant@google.com>
7770
7771 * script-sections.cc (Script_sections::create_segments): Don't put
7772 program headers in a PT_LOAD segment if -n or -N.
7773
77742009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7775
7776 PR 10141
7777 * options.h (class General_options): Add -z lazy and -z now. Sort
7778 -z options into alphabetical order.
7779 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7780
cd6739a1 77812009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7782
7783 * layout.cc (Layout::make_output_section): Call
7784 Target::new_output_section.
7785 (Layout::attach_allocated_section_to_segment): Put large section
7786 sections in a separate load segment with the large segment flag
7787 set.
7788 (Layout::segment_precedes): Sort large data segments after other
7789 load segments.
7790 (align_file_offset): New static function.
7791 (Layout::set_segment_offsets): Use align_file_offset.
7792 * output.h (class Output_section): Add is_small_section_ and
7793 is_large_section_ fields.
7794 (Output_section::is_small_section): New function.
7795 (Output_section::set_is_small_section): New function.
7796 (Output_section::is_large_section): New function.
7797 (Output_section::set_is_large_section): New function.
7798 (Output_section::is_large_data_section): New function.
7799 (class Output_segment): Add is_large_data_segment_ field.
7800 (Output_segment::is_large_data_segment): New function.
7801 (Output_segment::set_is_large_data_segment): New function.
7802 * output.cc (Output_section::Output_section): Initialize new
7803 fields.
7804 (Output_segment::Output_segment): Likewise.
7805 (Output_segment::add_output_section): Add assertion that large
7806 data sections always go in large data segments. Force small data
7807 sections to the end of the list of data sections. Force small BSS
7808 sections to the start of the list of BSS sections. For large BSS
7809 sections to the end of the list of BSS sections.
7810 * symtab.h (class Symbol): Declare is_common_shndx.
7811 (Symbol::is_defined): Check Symbol::is_common_shndx.
7812 (Symbol::is_common): Likewise.
7813 (class Symbol_table): Define enum Commons_section_type. Update
7814 declarations. Add small_commons_ and large_commons_ fields.
7815 * symtab.cc (Symbol::is_common_shndx): New function.
7816 (Symbol_table::Symbol_table): Initialize new fields.
7817 (Symbol_table::add_from_object): Put small and large common
7818 symbols in the right list.
7819 (Symbol_table::sized_finalized_symbol): Check
7820 Symbol::is_common_shndx.
7821 (Symbol_table::sized_write_globals): Likewise.
7822 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7823 common symbol lists. Don't call do_allocate_commons_list if the
7824 list is empty.
7825 (Symbol_table::do_allocate_commons_list): Remove is_tls
7826 parameter. Add comons_section_type parameter. Change all
7827 callers. Handle small and large common symbols.
7828 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7829 Symbol::is_common_shndx.
7830 * resolve.cc (symbol_to_bits): Likewise.
7831 * target.h (Target::small_common_shndx): New function.
7832 (Target::small_common_section_flags): New function.
7833 (Target::large_common_shndx): New function.
7834 (Target::large_common_section_flags): New function.
7835 (Target::new_output_section): New function.
7836 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7837 small_common_section_flags, and large_common_section_flags
7838 fields.
7839 (Target::do_new_output_section): New virtual function.
7840 * arm.cc (Target_arm::arm_info): Initialize new fields.
7841 * i386.cc (Target_i386::i386_info): Likewise.
7842 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7843 Likewise.
7844 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7845 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7846 (Target_x86_64::do_new_output_section): New function.
7847 * configure.ac: Define conditional MCMODEL_MEDIUM.
7848 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7849 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7850 (large_LDFLAGS): Define.
7851 * testsuite/large.c: New file.
7852 * testsuite/testfile.cc (Target_test::test_target_info):
7853 Initialize new fields.
7854 * configure, testsuite/Makefile.in: Rebuild.
7855
bb04269c
DK
78562009-06-05 Doug Kwan <dougkwan@google.com>
7857
7858 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7859 * Makefile.in: Regenerate.
bb04269c
DK
7860 * i386.cc (class Target_i386): Define new virtual method to
7861 override do_is_local_label_name in parent.
7862 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7863 local symbols if --discard-locals or -X is given.
7864 * options.h (class General_options): Declare new options
7865 '--discard-locals' and '-X' for discarding locals.
7866 * target.h (class Target): Define new methods is_local_label_name.
7867 Declare new virtual method do_is_local_label_name.
7868 * target.cc: New file.
7869 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7870 (check_SCRIPTS): Add discard_locals_test.sh.
7871 (check_DATA): Add discard_local_tests.syms.
7872 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7873 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7874 * testsuite/Makefile.in: Regenerate.
7875 * testsuite/discard_locals_test.c: New file.
7876 * testsuite/discard_locals_test.sh: Same.
7877
805bb01c
DK
78782009-06-05 Doug Kwan <dougkwan@google.com>
7879
7880 * object.cc (Sized_relobj::Sized_relobj): Initialize
7881 discarded_eh_frame_shndx_ to -1U.
7882 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7883 section.
7884 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7885 a discarded .eh_frame section.
7886 (Sized_relobj::do_finalize_local_symbols): Ditto.
7887 * object.h (class Sized_relobj): Declare new member
7888 discarded_eh_frame_shndx_.
7889 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7890 (local_labels_test.o, local_labels_test): New rules.
7891 * testsuite/Makefile.in: Regenerate.
7892
1dcd334d
DK
78932009-06-04 Doug Kwan <dougkwan@google.com>
7894
7895 * layout.cc (Layout::section_name_mapping): Add mapping for
7896 special ARM sections.
7897
96d49306
DK
78982009-06-03 Doug Kwan <dougkwan@google.com>
7899
7900 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7901 (utils::has_overflow): Same.
7902
dff16297
ILT
79032009-06-03 Ian Lance Taylor <iant@google.com>
7904
7905 * layout.cc (Layout::section_name_mapping): New array, replacing
7906 Layout::linkonce_mapping.
7907 (Layout::section_name_mapping_count): New variable, replacing
7908 Layout::linkonce_mapping_count.
7909 (Layout::linkonce_output_name): Remove.
7910 (Layout::output_section_name): Rewrite.
7911 * layout.h (class Layout): Rename Linkonce_mapping to
7912 Section_name_mapping, linkonce_mapping to section_name_mapping,
7913 linkonce_mapping_count to section_name_mapping_count. Don't
7914 declare linkonce_output_name.
7915
c121c671
DK
79162009-06-03 Doug Kwan <dougkwan@google.com>
7917
7918 * gold/arm.cc (namespace utils): New.
7919 (Target_arm::reloc_is_non_pic): Define new method.
7920 (class Arm_relocate_functions): New.
7921 (Target_arm::Relocate::relocate): Handle relocation types used by
7922 Android.
7923
07800fab
ILT
79242009-06-03 Ian Lance Taylor <iant@google.com>
7925
7926 * arm.cc (Target_arm::scan::global): Use || instead of |.
7927
c121c671
DK
79282009-06-02 Doug Kwan <dougkwan@google.com>
7929
7930 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7931 issued_non_pic_error_.
7932 (class Target_arm::Scan): Declare new method check_non_pic.
7933 Define new method symbol_needs_plt_entry.
7934 Declare new data member issued_non_pic_error_.
7935 (class Target_arm::Relocate): Declare new method
7936 should_apply_static_reloc.
7937 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7938 (Target_arm::Scan::check_non_pic): Define new method.
7939 (Target_arm::Scan::local): Handle a small subset of reloc types used
7940 by Android.
7941 (Target_arm::Scan::local): Same.
7942 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7943
b19b0c6d
ILT
79442009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7945
7946 * incremental.cc (Incremental_inputs::report_command_line): Filter
7947 out --incremental-* options.
7948
94cdfcff
DK
79492009-05-29 Doug Kwan <dougkwan@google.com>
7950
7951 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7952 template class.
7953 (class Target_arm): Update comment.
7954 (Target_arm::Target_arm): Initialize new data members GOT_,
7955 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7956 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7957 and Target_arm::rel_dyn_section.
7958 Declare new_enum Target_arm::Got_type.
7959 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7960 and DYNBSS_.
7961 Update commments for member do_dynsym_value.
7962 (Target_arm::got_size, Target_arm::plt_section,
7963 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7964 new methods inside class defintion.
7965 (Target_arm::got_section): Define new method.
7966 (Target_arm::rel_dyn_section): Same.
7967 (Output_data_plt_arm): New template class.
7968 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7969 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7970 (Output_data_plt_arm::add_entry): Same.
7971 (Output_data_plt_arm::first_plt_entry): Define new
7972 static data member for PLT instruction template.
7973 (Output_data_plt_arm::plt_entry): Same.
7974 (Output_data_plt_arm::do_write): Define new method.
7975 (Target_arm::make_plt_entry): Same.
7976 (Target_arm::do_finalize_sections): Same.
7977 (Target_arm::do_dynsym_value): Same.
7978
4a657b0d
DK
79792009-05-28 Doug Kwan <dougkwan@google.com>
7980
7981 * Makefile.am (TARGETSOURCES): Add arm.cc.
7982 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7983 * Makefile.in: Regenerate.
7984 * arm.cc: New file.
7985 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7986
e7ae8c36
DK
79872009-05-26 Doug Kwan <dougkwan@google.com>
7988
7989 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7990 (General_options::check_excluded_libs): Strip off directories in
7991 archive name before matching like GNU ld does.
7992 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7993 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7994 (exclude_libs_test_LDFLAGS): Add linker option
7995 -Wl,--exclude-libs,libexclude_libs_test_3
7996 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7997 an explicit archive without using -l.
7998 (alt/libexclude_libs_test_3.a): New make rule.
7999 * testsuite/Makefile.in: Regenerate.
8000 * testsuite/exclude_libs_test.c : Declare lib3_default().
8001 (main): Call it.
8002 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8003 * exclude_libs_test_3.c: New file.
8004
f12e7348
NC
80052009-05-26 Nick Clifton <nickc@redhat.com>
8006
8007 * po/id.po: New Indonesian translation.
8008 * po/gold.pot: Updated template file.
8009
4daadc0d
ST
80102009-05-22 Sriraman Tallam <tmsriram@google.com>
8011
e1df38aa 8012 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
8013 gc_comdat_test files. Add -Wl,--gc-sections to build
8014 gc_comdat_test.
8015 * testsuite/Makefile.in: Regenerate.
8016 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8017
531813ad
ST
80182009-05-21 Sriraman Tallam <tmsriram@google.com>
8019
8020 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8021 kept comdat section was garbage collected.
8022 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8023 * testsuite/Makefile.in: Regenerate.
8024 * testsuite/gc_comdat_test.sh: New file.
8025 * testsuite/gc_comdat_test_1.cc: New file.
8026 * testsuite/gc_comdat_test_2.cc: New file.
8027
65514900
CC
80282009-05-19 Doug Kwan <dougkwan@google.com>
8029
8030 * archive.cc (Archive::Archive): Move constructor from archive.h
8031 to here. Initialize no_export_.
8032 (Archive::get_elf_object_for_member): Set no_export flag of object.
8033 * archive.h (Archive::Archive): Move constructor body to
8034 archive.cc.
8035 (Archive::no_export): New method.
8036 (Archive::no_export_): New field.
8037 * object.h (Object::Object): Initialize no_export_ to false.
8038 (Object::no_export, Object::set_no_export): New methods.
8039 (Object::no_export_): New field.
8040 * options.cc (General_options::parse_exclude_libs): New method.
8041 (General_options::check_excluded_libs) Same.
8042 * options.h (exclude_libs): New option.
8043 (General_options::check_excluded_libs): New method declaration.
8044 (General_options::excluded_libs_): New field.
8045 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8046 default or protected visibility if an object has no-export flag set.
8047 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8048 (check_SCRIPTS): Add exclude_libs_test.sh.
8049 (check_DATA): Add exclude_libs_test.syms.
8050 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8051 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8052 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8053 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8054 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8055 libexclude_libs_test_2.a): New rules.
8056 * testsuite/Makefile.in: Regenerate.
8057 * testsuite/exclude_libs_test.c: New file.
8058 * testsuite/exclude_libs_test.sh: Ditto.
8059 * testsuite/exclude_libs_test_1.c: Ditto.
8060 * testsuite/exclude_libs_test_2.c: Ditto.
8061
1b77ea50
ILT
80622009-05-15 Ian Lance Taylor <iant@google.com>
8063
8064 * configure.ac: Check for declarations for cases where libiberty.h
8065 checks HAVE_DECL_xxx.
8066 * configure, config.in: Rebuild.
8067
072fe7ce
ILT
80682009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8069
8070 * gold.h (Incremental_argument_list): Remove (invalid) forward
8071 declaration.
8072 * incremental.cc (Incremental_inputs::report_achive): New method.
8073 (Incremental_inputs::report_object): New method.
8074 (Incremental_inputs::report_script): New method.
8075 (Incremental_inputs::finalize_inputs): New method.
8076 (Incremental_inputs::finalize): Call finalize_inputs().
8077 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8078 Create inputs entries.
8079 * incremental.h (Incremental_input_type): New enum.
8080 (Incremental_inputs::Incremental_input): Initialize new fields.
8081 (Incremental_inputs::report_inputs): New method.
8082 (Incremental_inputs::report_achive): New method.
8083 (Incremental_inputs::report_object): New method.
8084 (Incremental_inputs::report_script): New method.
8085 (Incremental_inputs::finalize_inputs): New method.
8086 (Incremental_inputs::Input_info): New struct.
8087 (Incremental_inputs::Input_info_map): New typedef.
8088 (Incremental_inputs::lock_): New field.
8089 (Incremental_inputs::Inputs_): New field.
8090 (Incremental_inputs::Inputs_map): New field.
8091 * main.cc (main): Call Incremental_input::report_inputs.
8092 * options.h (Input_argument_list): Typedef moved from
8093 Input_arguments.
8094 (Input_file_group::Files): Remove, use ::Input_argument_list.
8095 (Input_file_group::Input_argument_list): Remove, use
8096 ::Input_argument_list.
8097 * plugin.cc (Plugin_manager::add_input_file): Add error in
8098 incremental build.
8099 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8100 functions.
8101 * script.cc (read_input_script): Call
8102 Incremental_input::report_script.
8103 * script.h (Script_info): New class.
8104
b0481b0b
ILT
81052009-04-27 Ian Lance Taylor <iant@google.com>
8106
8107 * x86_64.cc (do_adjust_output_section): Set entsize to
8108 plt_entry_size.
8109
b22a5a41 81102009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
8111
8112 * output.cc (Output_file::close): After short writes, continue
8113 writing from the correct offset in the buffer being written.
8114
40fde488
CD
81152009-04-23 Chris Demetriou <cgd@google.com>
8116
8117 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8118 * configure: Regenerate.
8119 * config.in: Regenerate.
8120 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8121 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8122
3ce2c28e
ILT
81232009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8124
8125 * incremental.cc (Incremental_inputs_header_data): Renamed from
8126 Incremental_input_header_data.
8127 (Incremental_inputs_header_data::data_size): New field.
8128 (Incremental_inputs_header_data::put_input_file_count): Renamed
8129 from input_file_count.
8130 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8131 from command_line_offset.
8132 (Incremental_inputs_header_data::put_reserved): Renamed from
8133 put_reserved.
8134 (Incremental_inputs_entry_data): Renamed from
8135 Incremental_input_entry_data.
8136 (Incremental_inputs_entry_data::data_size): New field.
8137 (Incremental_inputs::report_command_line): New method.
8138 (Incremental_inputs::finalize): New method.
8139 (Incremental_inputs::create_incremental_inputs_data): New method.
8140 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8141 * incremental.h: New file.
8142 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8143 (Layout::finalize): Create incremental inputs section in
8144 incremental builds.
8145 (Layout::create_incremental_info_sections): New method.
8146 * layout.h (Layout::incremental_inputs): New method.
8147 (Layout::create_incremental_info_sections): New method.
8148 (Layout::incremental_inputs_): New field.
8149 * main.cc (main): Notify Incremental_input of the command line.
8150
e55bde5e
ILT
81512009-04-01 Ian Lance Taylor <iant@google.com>
8152 Mikolaj Zalewski <mikolajz@google.com>
8153
8154 * gold.h (reserve_unordered_map): Define, three versions, one for
8155 each version of Unordered_map.
8156 * layout.cc (Layout::Layout): Remove options parameter. Add
8157 number_of_input_files parameter. Don't initialize options_.
8158 Initialize number_of_input_files_ and resized_signatures_. Move
8159 sections_are_attached_.
8160 (Layout::layout_group): Reserve space for group_signatures_.
8161 (Layout::find_or_add_kept_section): Change name parameter to be a
8162 reference. Resize signatures_ map when it gets large enough.
8163 (Layout::layout_eh_frame): Use parameters->options() instead of
8164 this->options_.
8165 (Layout::make_output_section): Likewise.
8166 (Layout::attach_allocated_section_to_segment): Likewise.
8167 (Layout::finalize, Layout::create_executable_stack): Likewise.
8168 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8169 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8170 * layout.h (class Layout): Update declarations. Remove options_
8171 field. Add number_of_input_files_ and resized_signatures_
8172 fields. Move sections_are_attached_ field.
8173 * main.cc (main): Pass number of input files to Layout
8174 constructor. Don't pass options.
8175
154b857c
ILT
81762009-03-30 Ian Lance Taylor <iant@google.com>
8177
8178 * ffsll.c (ffsll): Correct implementation.
8179
2f35ab9b
ILT
81802009-03-27 Ian Lance Taylor <iant@google.com>
8181
fd03461a
ILT
8182 * ffsll.c: New file.
8183 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
8184 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
8185 * ftruncate.c (ftruncate): Declare before definition.
8186 * mremap.c (mremap): Likewise.
8187 * pread.c (pread): Likewise.
8188 * configure, Makefile.in, config.in: Rebuild.
8189
2f35ab9b
ILT
8190 * mremap.c: New file.
8191 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
8192 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
8193 (mremap): Declare if HAVE_MREMAP is not defined.
8194 * configure, Makefile.in, config.in: Rebuild.
8195
33aea2fd
CC
81962009-03-27 Cary Coutant <ccoutant@google.com>
8197
8198 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
8199 position independent.
8200 * sparc.cc (Target_sparc::check_non_pic): Likewise.
8201 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
8202
6d479619
CC
82032009-03-24 Cary Coutant <ccoutant@google.com>
8204
8205 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
8206 an executable.
8207 (needs_dynamic_reloc): Likewise.
8208
afc06bb8
ILT
82092009-03-24 Ian Lance Taylor <iant@google.com>
8210
8211 * yyscript.y (file_cmd): Recognize EXTERN.
8212 (extern_name_list, extern_name_list_body): New nonterminals.
8213 * script.cc (script_add_extern): Define.
8214 * script-c.h (script_add_extern): Declare.
8215
f6060a4d
ILT
82162009-03-24 Rafael Avila de Espindola <espindola@google.com>
8217
8218 * object.cc (is_elf_object): Define.
8219 * object.h (is_elf_object): Declare.
8220 * archive.cc (Archive::get_elf_object_for_member): Call
8221 is_elf_object.
33aea2fd 8222 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 8223
26736d8e
ILT
82242009-03-24 Elliott Hughes <enh@google.com>
8225
8226 * output.cc (Output_file::map_anonymous): Define.
8227 (Output_file::map): Use map_anonymous. If the regular mmap fails,
8228 try an anonymous one. Report the size if the mmap fails.
8229 * output.h (class Output_file): Declare map_anonymous.
8230
22fd9730
ILT
82312009-03-24 Ian Lance Taylor <iant@google.com>
8232
8233 * target-select.cc (instantiate_target): Don't acquire the lock if
8234 the instantiated_target_ field has already been set.
8235
cb010894
ILT
82362009-03-23 Ian Lance Taylor <iant@google.com>
8237
7f055c20
ILT
8238 * gold-threads.h (class Initialize_lock): Define.
8239 * gold-threads.cc (class Initialize_lock_once): Define.
8240 (initialize_lock_control): New static variable.
8241 (initialize_lock_pointer): New static variable.
8242 (initialize_lock_once): New static function.
8243 (Initialize_lock::Initialize_lock): Define.
8244 (Initialize_lock::initialize): Define.
8245 * target-select.h: Include "gold-threads.h".
8246 (class Target_selector): Add lock_ and initialize_lock_ fields.
8247 Don't define instantiate_target, just declare it.
8248 * target-select.cc (Target_selector::Target_selector): Initialize
8249 new fields.
8250 (Target_selector::instantiate_target): Define.
8251 * descriptors.h: Include "gold-threads.h".
8252 (class Descriptors): Add initialize_lock_ field.
8253 * descriptors.cc (Descriptors::Descriptors): Initialize new
8254 field.
8255 (Descriptors::open): Use initialize_lock_ field
8256 * errors.h (class Errors): Add initialize_lock_ field.
8257 * errors.cc (Errors::Errors): Initialize new field.
8258 (Errors::initialize_lock): Use initialize_lock_ field.
8259 * powerpc.cc (class Target_selector_powerpc): Remove
8260 instantiated_target_ field. In do_recognize call
8261 instantiate_target rather than do_instantiate_target. In
8262 do_instantiate_target just allocate a new target.
8263 * sparc.cc (class Target_selector_sparc): Likewise.
8264
36959681
ILT
8265 * freebsd.h: New file.
8266 * i386.cc: Include "freebsd.h".
8267 (Target_i386): Derive from Target_freebsd rather than
8268 Sized_target.
8269 (Target_selector_i386): Derive from Target_selector_freebsd rather
8270 than Target_selector.
8271 * x86_64.cc: Include "freebsd.h".
8272 (Target_x86_64): Derive from Target_freebsd rather than
8273 Sized_target.
8274 (Target_selector_x86_64): Derive from Target_selector_freebsd
8275 rather than Target_selector.
8276 * target.h (class Target): Add adjust_elf_header and
8277 do_adjust_elf_header.
8278 * output.cc (Output_file_header:: do_sized_write): Call target
8279 adjust_elf_header routine.
8280 * configure.tgt: Set targ_osabi.
8281 * configure.ac: Define GOLD_DEFAULT_OSABI.
8282 * parameters.cc (Parameters::default_target): Pass
8283 GOLD_DEFAULT_OSABI to select_target.
8284 * target-select.h (class Target_selector): Make instantiate_target
8285 protected rather than private.
8286 * Makefile.am (HFILES): Add freebsd.h.
8287 * configure, Makefile.in, config.in: Rebuild.
8288
cb010894
ILT
8289 * merge.cc (do_add_input_section): Correct pend value. Change
8290 message about last entry not being null terminated from error to
8291 warning.
8292
0e879927
ILT
82932009-03-20 Mikolaj Zalewski <mikolajz@google.com>
8294
8295 * incremental.cc: New file.
8296 * Makefile.am (CCFILES): Add incremental.cc.
8297 * Makefile.in: Rebuild.
8298
41105937
PP
82992009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
8300
8301 * layout.cc (Layout::output_section_name): Preserve names
8302 of '.note.' sections.
e1df38aa 8303
60439920
ILT
83042009-03-19 Ian Lance Taylor <iant@google.com>
8305
8306 * descriptors.cc (Descriptors::open): Check that the options are
8307 valid before using them.
8308
0d371ad3
ILT
83092009-03-18 Ian Lance Taylor <iant@google.com>
8310
8311 * script-sections.h: Include <list>.
8312 (class Script_sections): Change Sections_elements from std::vector
8313 to std::list. Typedef public Elements_iterator. Add
8314 orphan_section_placement_, data_segment_align_start_, and
8315 saw_data_segment_align_ fields. Remove data_segment_align_index_
8316 field.
8317 * script-sections.cc (class Orphan_section_placement): New class.
8318 (class Sections_element): Add virtual functions is_relro and
8319 orphan_section_init. Remove virtual function place_orphan_here.
8320 (class Output_section_definition): Add is_relro and
8321 orphan_section_init. Remove place_orphan_here.
8322 (class Orphan_output_section): Likewise.
8323 (Script_sections::Script_sections): Update for field changes.
8324 (Script_sections::data_segment_align): Set saw_data_segment_align_
8325 and data_segment_align_start_, not data_segment_align_index.
8326 (Script_sections::data_segment_relro_end): Check
8327 saw_data_segment_align_. Use data_segment_align_start_ rather
8328 than data_segment_align_index_.
8329 (Script_sections::place_orphan): Rewrite to use
8330 Orphan_section_placement.
8331
9201d894
ILT
83322009-03-17 Ian Lance Taylor <iant@google.com>
8333
9c5b8369
ILT
8334 * archive.cc (Archive::add_symbols): Check for a version attached
8335 to the symbol name in the archive map.
8336 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
8337 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
8338 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
8339 (ver_test_11.a): New target.
8340 * testsuite/Makefile.in: Rebuild.
8341
9201d894
ILT
8342 * configure.ac: Check for chsize and posix_fallocate. Replace
8343 ftruncate.
8344 * ftruncate.c: New file, from gnulib.
8345 * output.cc (posix_fallocate): Define dummy version if not
8346 HAVE_POSIX_FALLOCATE.
8347 (Output_file::map): Call posix_fallocate rather than lseek and
8348 write.
8349 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8350 * configure, Makefile.in, config.in: Rebuild.
8351
ef4ab7a8 83522009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8353
ef4ab7a8
PP
8354 * layout.h (Layout::create_note): Add section_name parameter.
8355 * layout.cc (Layout::create_note): Likewise.
8356 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8357
8c500701
ILT
83582009-03-17 Ian Lance Taylor <iant@google.com>
8359
e85b18e1
ILT
8360 * descriptors.cc: Include "options.h".
8361 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8362 (Descriptors::open): Always use O_CLOEXEC when opening a new
8363 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8364 then set FD_CLOEXEC.
8365
9efe6174
ILT
8366 * sparc.cc (class Target_sparc): Add has_got_section.
8367 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8368 make sure we have a GOT section.
8369
8370 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8371 (Target_sparc::Scan::local): Likewise.
8372 (Target_sparc::Scan::global): Likewise.
8373 (Target_sparc::Relocate::relocate): Likewise.
8374 (Target_sparc::Relocate::relocate_tls): Likewise.
8375
8c500701
ILT
8376 * symtab.cc (Symbol_table::define_default_version): New function,
8377 broken out of add_from_object.
8378 (Symbol_table::add_from_object): Call define_default_version.
8379 (Symbol_table::define_special_symbol): Add resolve_oldsym
8380 parameter. Change all callers. If the version for a symbol comes
8381 from a version script, resolve it with the symbol with the same
8382 name with no version. Also add the symbol without a version if
8383 appropriate.
8384 (do_define_in_output_data): If resolving with oldsym, don't delete
8385 sym.
8386 (do_define_in_output_segment): Likewise.
8387 (do_define_as_constant): Likewise.
8388 * symtab.h (class Symbol_table): Update declarations.
8389
f1ed28fb
ILT
83902009-03-13 Ian Lance Taylor <iant@google.com>
8391
15f8229b
ILT
8392 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8393 (Read_symbols::requeue): New function.
8394 (Read_symbols::do_read_symbols): If make_elf_object fails because
8395 the target type is not configured, and the file was searched for,
8396 issue a warning and retry with the next directory.
8397 (Add_symbols::run): If the file has an incompatible format, and
8398 it was searched for, requeue the Read_symbols task. On error,
8399 release the object.
8400 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8401 dirindex parameter to constructor. Change all callers. Declare
8402 incompatible_warning and requeue.
8403 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8404 input_argument_ and input_group_ fields. Add them to
8405 constructor. Change all callers.
8406 (class Read_script): Add dirindex_ field. Add it to constructor.
8407 Change all callers.
8408 * archive.cc (Archive::setup): Remove input_objects parameter.
8409 Change all callers.
8410 (Archive::get_file_and_offset): Likewise.
8411 (Archive::read_all_symbols): Likewise.
8412 (Archive::read_symbols): Likewise.
8413 (Archive::get_elf_object_for_member): Remove input_objects
8414 parameter. Add punconfigured parameter. Change all callers.
8415 (Archive::add_symbols): Change return type to bool. Check return
8416 value of include_member.
8417 (Archive::include_all_members): Likewise.
8418 (Archive::include_member): Change return type to bool. Return
8419 false if first included object has incompatible target. Set
8420 included_member_ field.
8421 (Add_archive_symbols::run): If add_symbols returns false, requeue
8422 Read_symbols task.
8423 * archive.h (class Archive): Add included_member_ field.
8424 Initialize it in constructor. Add input_file and searched_for
8425 methods. Update declarations.
8426 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8427 input_argument_ fields. Add them to constructor. Change all
8428 callers.
8429 * script.cc: Include "target-select.h".
8430 (class Parser_closure): Add skip_on_incompatible_target_ and
8431 found_incompatible_target_ fields. Add
8432 skip_on_incompatible_target parameter to constructor. Change all
8433 callers. Add methods skip_on_incompatible_target,
8434 clear_skip_on_incompatible_target, found_incompatible_target, and
8435 set_found_incompatible_target.
8436 (read_input_script): Add dirindex parameter. Change all callers.
8437 If parser finds an incompatible target, requeue Read_symbols
8438 task.
8439 (script_set_symbol): Clear skip_on_incompatible_target in
8440 closure.
8441 (script_add_assertion, script_parse_option): Likewise.
8442 (script_start_sections, script_add_phdr): Likewise.
8443 (script_check_output_format): New function.
8444 * script.h (read_input_script): Update declaration.
8445 * script-c.h (script_check_output_format): Declare.
8446 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8447 (ignore_cmd): Remove OUTPUT_FORMAT.
8448 * fileread.cc (Input_file::Input_file): Add explicit this.
8449 (Input_file::will_search_for): New function.
8450 (Input_file::open): Add pindex parameter. Change all callers.
8451 * fileread.h (class Input_file): Add input_file_argument method.
8452 Declare will_search_for. Update declarations.
8453 * object.cc (make_elf_object): Add punconfigured parameter.
8454 Change all callers.
8455 * object.h (class Object): Make input_file public. Add
8456 searched_for method.
8457 (make_elf_object): Update declaration.
8458 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8459 restart search.
8460 * dirsearch.h (class Dirsearch): Update declaration.
8461 * options.h (class General_options): Add --warn-search-mismatch.
8462 * parameters.cc (Parameters::is_compatible_target): New function.
8463 * parameters.h (class Parameters): Declare is_compatible_target.
8464 * workqueue.cc (Workqueue::add_blocker): New function.
8465 * workqueue.h (class Workqueue): Declare add_blocker.
8466
f1ed28fb
ILT
8467 * fileread.cc (Input_file::open): Remove options parameter.
8468 Change all callers.
8469 (Input_file::open_binary): Likewise.
8470 * script.cc (read_input_script): Likewise.
8471 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8472 options parameter from constructor. Change all callers.
8473 (class Read_script): Likewise.
8474 * fileread.h (class Input_file): Update declarations.
8475 * script.h (read_input_script): Update declaration.
8476
34dd024a
NC
84772009-03-10 Nick Clifton <nickc@redhat.com>
8478
8479 * po/es.po: New Spanish translation.
8480
6d71b17c
CC
84812009-03-06 Cary Coutant <ccoutant@google.com>
8482
8483 * options.cc (parse_short_option): Keep dash_z from registering itself.
8484
031cdbed
ILT
84852009-03-03 Ian Lance Taylor <iant@google.com>
8486
8487 PR 9918
8488 * target-reloc.h (relocate_section): Pass output_section to
8489 relocate.
8490 * i386.cc (Target_i386::should_apply_static_reloc): Add
8491 output_section parameter. Change all callers.
8492 (Target_i386::Relocate::relocate): Add output_section parameter.
8493 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8494 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8495 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8496 * testsuite/two_file_shared.sh: New script.
8497 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8498 (check_DATA): Add two_file_shared.dbg.
8499 (two_file_shared.dbg): New target.
8500 * testsuite/Makefile.in: Rebuild.
8501
15d5fa16
ILT
85022009-03-01 Ian Lance Taylor <iant@google.com>
8503
8504 * configure.ac: Check for byteswap.h.
8505 * configure: Rebuild.
8506 * config.in: Rebuild.
8507
8a4c0b0d
ILT
85082009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8509
8510 * layout.cc (Layout::find_or_add_kept_section): New function.
8511 (Layout::add_comdat): Removed.
8512 * layout.h (struct Kept_section): Move out of class Layout.
8513 Remove trailing underscores from field names. Add group_sections
8514 field. Rename group_ field to is_group. Change all uses.
8515 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8516 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8517 comdat_groups_ field.
8518 (Sized_relobj::include_section_group): Use
8519 find_or_add_kept_section and Kept_section::group_sections.
8520 (Sized_relobj::include_linkonce_section): Likewise.
8521 * object.cc (class Sized_relobj): Don't define Comdat_group or
8522 Comdat_group_table. Remove find_comdat_group and
8523 add_comdat_group. Remove comdat_groups_ field.
8524 * plugin.cc (include_comdat_group): Use
8525 Layout::find_or_add_kept_section.
8526
b4ecf66b
ILT
85272009-02-28 Ian Lance Taylor <iant@google.com>
8528
14359ca0
ILT
8529 * README: --gc-sections and map files are now supported. Document
8530 some build requirements.
8531
b4ecf66b
ILT
8532 PR 6992
8533 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8534 relocatable link set the value of the section symbol to zero.
8535 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8536 relocatable link don't include the section address in the local
8537 symbol value.
8538
0602e05a
ILT
85392009-02-27 Ian Lance Taylor <iant@google.com>
8540
fd9d194f
ILT
8541 PR 6811
8542 * options.h (class Search_directory): Add is_system_directory.
8543 (class General_options): Declare is_in_system_directory.
8544 * options.cc (get_relative_sysroot): Make static.
8545 (get_default_sysroot): Make static.
8546 (General_optoins::is_in_system_directory): New function.
8547 * fileread.cc (Input_file::is_in_system_directory): New function.
8548 * fileread.h (class Input_file): Declare is_in_system_directory.
8549 * object.h (class Object): Add is_in_system_directory.
8550 (class Input_objects): Remove system_library_directory_ field.
8551 * object.cc (Input_objects::add_object): Don't set
8552 system_library_directory_.
8553 (input_objects::found_in_system_library_directory): Remove.
8554 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8555 parameter. Change all callers.
8556 (Symbol_table::sized_write_globals): Likewise.
8557 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8558 Call Object::is_in_system_directory.
8559 * symtab.h (class Symbol_table): Update declarations.
8560
61edd21f
ILT
8561 PR 5990
8562 * descriptors.h (Open_descriptor): Add is_on_stack field.
8563 * descriptors.cc (Descriptors::open): If the descriptor is on the
8564 top of the stack, remove it. Initialize is_on_stack field.
8565 (Descriptors::release): Only add pod to stack if it is not on the
8566 stack already.
8567 (Descriptors::close_some_descriptor): Clear stack_next and
8568 is_on_stack fields.
8569
e29e076a
ILT
8570 PR 7091
8571 * output.cc (Output_section::find_starting_output_address): Rename
8572 from starting_output_address; add PADDR parameter; change return
8573 type.
8574 * output.h (class Output_section): Declare
8575 find_starting_output_address instead of starting_output_address.
8576 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8577 section symbol for which we can't find a merge section.
8578
0602e05a
ILT
8579 PR 9836
8580 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8581 hidden or internal, force the symbol to be local.
8582 * resolve.cc (Symbol::override_visibility): Define.
8583 (Symbol::override_base): Use override_visibility.
8584 (Symbol_table::resolve): Likewise.
8585 (Symbol::override_base_with_special): Likewise.
8586 (Symbol_table::override_with_special): If the visibility is hidden
8587 or internal, force the symbol to be local.
8588 * symtab.h (class Symbol): Add set_visibility and
8589 override_visibility.
8590 * testsuite/ver_test_1.sh: New file.
8591 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8592 (check_DATA): Add ver_test_1.syms.
8593 (ver_test_1.syms): New target.
8594 * testsuite/Makefile.in: Rebuild.
8595
401a9a73
CC
85962009-02-25 Cary Coutant <ccoutant@google.com>
8597
8598 * layout.cc (Layout::choose_output_section): Don't rename sections
8599 when using a linker script that has a SECTIONS clause.
8600 * Makefile.in: Regenerate.
8601
8602 * testsuite/Makefile.am (script_test_5.sh): New test case.
8603 * testsuite/Makefile.in: Regenerate.
8604 * testsuite/script_test_5.cc: New file.
8605 * testsuite/script_test_5.sh: New file.
8606 * testsuite/script_test_5.t: New file.
8607
f488e4b0
CC
86082009-02-13 Rafael Avila de Espindola <espindola@google.com>
8609
8610 * archive.cc (Archive::include_member): Update calls to add_symbols.
8611 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8612 the Layout argument.
8613 * dynobj.h (do_add_symbols): Add the Layout argument.
8614 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8615 Layout argument.
8616 * object.h (Object::add_symbols): Add the Layout argument.
8617 (Object::do_add_symbols): Add the Layout argument.
8618 (Sized_relobj::do_add_symbols): Add the Layout argument.
8619 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8620 Unify the two versions.
8621 (Add_plugin_symbols): Remove.
8622 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8623 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8624 (Add_plugin_symbols): Remove.
8625 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8626 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8627 (Add_symbols::run): Make it work with Pulginobj.
8628
89dd1680
ILT
86292009-02-06 Ian Lance Taylor <iant@google.com>
8630
8631 * object.cc (Sized_relobj::do_layout): Make info message start
8632 with lower case letter.
8633
266d0a74
ILT
86342009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8635
602b464e
ILT
8636 * binary.cc: Fix file comment.
8637
266d0a74
ILT
8638 * options.h (enum Incremental_disposition): Define.
8639 (class General_options): Add new options: --incremental,
8640 --incremental_changed, --incremental_unchanged,
8641 --incremental_unknown. Add incremental_disposition_ and
8642 implicit_incremental_ fields.
8643 (General_options::incremental_disposition): New function.
8644 (class Position_dependent_options): Add incremental_disposition
8645 option.
8646 (Position_dependent_options::copy_from_options): Set incremental
8647 dispositions.
8648 * options.cc (General_options::parse_incremental_changed): New
8649 function.
8650 (General_options::parse_incremental_unchanged): New function.
8651 (General_options::parse_incremental_unknown): New function.
8652 (General_options::General_options): Initialize new fields
8653 incremental_disposition_ and implicit_incremental_.
8654 (General_options::finalize): Check for uasge of --incremental-*
8655 without --incremental.
8656
f073bbf7
CD
86572009-02-06 Chris Demetriou <cgd@google.com>
8658
8659 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8660 pointer and to report location as the file name associated with
8661 the symbol.
8662 (gold_undefined_symbol_at_location): New function to replace the
8663 old gold_undefined_symbol functionality.
8664 * target-reloc.h (relocate_section): Update to use
8665 gold_undefined_symbol_at_location.
8666 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8667 Call gold_undefined_symbol function rather than gold_error.
8668 * errors.h (Errors::undefined_symbol): Take location as a
8669 string, rather than calculating it from a relocation.
8670 * errors.cc (Errors::fatal): Print "fatal error:" before the
8671 formatted message.
8672 (Errors::error, Errors::error_at_location): Print "error: "
8673 before the formatted message.
8674 (Errors::undefined_symbol): Take location as a string, rather
8675 than calculating it from a relocation.
8676 (gold_undefined_symbol_at_location): New function akin to
8677 old gold_undefined_symbol, calculates location from relocation.
8678 (gold_undefined_symbol): Change to take only a Symbol pointer
8679 and to report location as the file name associated with the symbol.
8680 * testsuite/debug_msg.sh: Update for changed error messages.
8681 * testsuite/undef_symbol.sh: Likewise.
8682
8e94a90c
ILT
86832009-02-04 Duncan Sands <baldrick@free.fr>
8684
8685 PR 9812
8686 * reduced_debug_output.h
8687 (Output_reduced_debug_abbrev_section::failed): Use format for
8688 gold_warning.
8689 (Output_reduced_debug_info_section::faild): Likewise.
8690
88a0e15b
ILT
86912009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8692
8693 * script.cc (Lazy_demangler): New class.
8694 (Version_script_info::get_symbol_version_helper): Demangle a
8695 symbol only once.
8696
5efc7cd2
CC
86972009-01-29 Cary Coutant <ccoutant@google.com>
8698
8699 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8700 to __tls_get_addr.
8701 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8702
e0ebcf42
ILT
87032009-01-28 Ian Lance Taylor <iant@google.com>
8704
5efc7cd2 8705 * version.cc (version_string): Bump to 1.9.
75fe7426 8706
e0ebcf42
ILT
8707 * gold.h: Include <cstring> and <stdint.h>.
8708 * version.cc: Include <cstdio>.
8709 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8710 warning.
8711 * reduced_debug_output.cc (insert_into_vector): Rename from
8712 Insert_into_vector; change all callers. Use Swap_unaligned to
8713 avoid aliasing issue; remove union since it is unnecessary.
8714
8e2813be 87152009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8716
8717 * Makefile.am (CCFILES): Add gc.cc.
8718 (HFILES): Add gc.h.
8719 * Makefile.in: Regenerate.
8720 * gold.cc (Gc_runner): New class.
8721 (queue_initial_tasks): Call garbage collection related tasks
8722 when corresponding options are invoked.
8723 (queue_middle_gc_tasks): New function.
8724 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8725 processed early before laying out sections during garbage collection.
8726 * gold.h (queue_middle_gc_tasks): New function.
8727 (is_prefix_of): Move from "layout.cc".
8728 * i386.cc (Target_i386::gc_process_relocs): New function.
8729 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8730 * main.cc (main): Create object of class "Garbage_collection".
8731 * object.cc (Relobj::copy_symbols_data): New function.
8732 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8733 (Sized_relobj::do_layout): Allow this function to be called twice
8734 during garbage collection and defer layout of section during the
6d03d481
ST
8735 first call.
8736 * object.h (Relobj::get_symbols_data): New function.
8737 (Relobj::is_section_name_included): New function.
8738 (Relobj::copy_symbols_data): New function.
8739 (Relobj::set_symbols_data): New function.
8740 (Relobj::get_relocs_data): New function.
8741 (Relobj::set_relocs_data): New function.
8742 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8743 (Relobj::gc_process_relocs): New function.
8744 (Relobj::do_gc_process_relocs): New pure virtual function.
8745 (Relobj::sd_): New data member.
8746 (Sized_relobj::is_output_section_offset_invalid): New function.
8747 (Sized_relobj::do_gc_process_relocs): New function.
8748 * options.h (General_options::gc_sections): Modify to not be a no-op.
8749 (General_options::print_gc_sections): New option.
8750 * plugin.cc (Plugin_finish::run): Remove function call to
8751 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8752 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8753 * reloc.cc (Read_relocs::run): Add task to process relocs and
8754 determine unreferenced sections when doing garbage collection.
8755 (Gc_process_relocs): New class.
8756 (Sized_relobj::do_gc_process_relocs): New function.
8757 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8758 sections that are garbage collected.
8759 * reloc.h (Gc_process_relocs): New class.
8760 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8761 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8762 symbols whose corresponding sections are garbage collected.
8763 (Symbol_table::Symbol_table): Add new parameter for the garbage
8764 collection object.
8765 (Symbol_table::gc_mark_undef_symbols): New function.
8766 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8767 (Symbol_table::gc_mark_dyn_syms): New function.
8768 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8769 as garbage.
8770 (Symbol_table::add_from_object): Likewise.
8771 (Symbol_table::add_from_relobj): When building shared objects, do not
8772 treat externally visible symbols as garbage.
8773 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8774 table information for static and relocatable links.
8775 * symtab.h (Symbol_table::set_gc): New function.
8776 (Symbol_table::gc): New function.
8777 (Symbol_table::gc_mark_undef_symbols): New function.
8778 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8779 (Symbol_table::gc_mark_dyn_syms): New function.
8780 (Symbol_table::gc_): New data member.
e1df38aa 8781 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8782 function.
8783 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8784 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8785
3b293544
CF
87862009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8787
8788 * options.h (General_options::gc_sections): Define as a no-op for now.
8789 (General_options::no_keep_memory): Ditto.
8790 (General_options::Bshareable): Define.
8791 * options.cc (General_options::finalize): Honor -Bshareable.
8792
83d22aa8
AS
87932009-01-20 Andreas Schwab <schwab@suse.de>
8794
8795 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8796 read the value in the contents, since we don't use it. Use the
8797 template endianness when writing.
8798 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8799
cd536b21
AS
88002009-01-19 Andreas Schwab <schwab@suse.de>
8801
8802 * configure.tgt (powerpc64-*): Fix targ_obj.
8803
99e9a495
ILT
88042009-01-15 Ian Lance Taylor <iant@google.com>
8805
8806 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8807 local symbols when stripping all symbols.
8808
bbbfea06
CC
88092009-01-14 Cary Coutant <ccoutant@google.com>
8810
99e9a495 8811 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8812
0f7c0701
CC
88132009-01-14 Cary Coutant <ccoutant@google.com>
8814
8815 * archive.cc (Archive::get_elf_object_for_member): Remove call
8816 to File_read::claim_for_plugin.
8817 * descriptors.cc (Descriptors::open): Remove reference to
8818 is_claimed.
8819 (Descriptors::claim_for_plugin): Remove.
8820 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8821 (Descriptors::is_claimed): Remove.
8822 (claim_descriptor_for_plugin): Remove.
8823 * fileread.cc (File_read::claim_for_plugin): Remove.
8824 * fileread.h (File_read::claim_for_plugin): Remove.
8825 (File_read::descriptor): Reopen descriptor if necessary.
8826 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8827 (Plugin_manager::all_symbols_read): Add task parameter. Change
8828 all callers.
8829 (Plugin_manager::get_input_file): New function.
8830 (Plugin_manager::release_input_file): New function.
8831 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8832 corresponding data member.
8833 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8834 and pass to base constructor. Change all callers.
8835 (get_input_file, release_input_file): New functions.
8836 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8837 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8838 (Plugin_manager::all_symbols_read): Add task parameter.
8839 (Plugin_manager::get_input_file): New function.
8840 (Plugin_manager::release_input_file): New function.
8841 (Plugin_manager::task_): New data member.
8842 (Pluginobj::Pluginobj): Add filesize parameter.
8843 (Pluginobj::filename): New function.
8844 (Pluginobj::descriptor): New function.
8845 (Pluginobj::filesize): New function.
8846 (Pluginobj::filesize_): New data member.
8847 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8848 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8849 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8850
8851 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8852 with archive libraries.
8853 * testsuite/Makefile.in: Regenerate.
8854 * testsuite/plugin_test.c (struct sym_info): New type.
8855 (get_input_file, release_input_file): New static variables.
8856 (onload): Capture new transfer vector entries.
8857 (claim_file_hook): Stop reading at end of file according to filesize.
8858 Factor out parsing of readelf output into separate function.
8859 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8860 APIs and get the source file name from the symbol table. Convert
8861 source file name to corresponding object file name. Print info
8862 message when adding new input files.
8863 (parse_readelf_line): New function.
8864 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8865 * testsuite/plugin_test_2.sh: Likewise.
8866 * testsuite/plugin_test_3.sh: Likewise.
8867 * testsuite/plugin_test_4.sh: New test case.
8868
62a6d109
ILT
88692009-01-07 Ian Lance Taylor <iant@google.com>
8870
8871 * version.cc (version_string): Bump to 1.8.
8872
483620e8
CC
88732008-12-23 Cary Coutant <ccoutant@google.com>
8874
8875 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8876 * plugin.cc (Plugin_manager::finish): Rename as
8877 layout_deferred_objects. Move cleanup to separate function.
8878 (Plugin_manager::cleanup): New function.
8879 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8880 separately.
8881 * plugin.h (Plugin_manager::finish): Rename as
8882 layout_deferred_objects.
8883 (Plugin_manager::cleanup): New function.
8884 (Plugin_manager::cleanup_done): New field.
8885
d66a9eb3
CC
88862008-12-23 Cary Coutant <ccoutant@google.com>
8887
8888 * plugin.cc (is_visible_from_outside): New function.
8889 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8890 so we don't return "IR only" status for exported symbols or -r links.
8891
8892 * testsuite/Makefile.am (plugin_test_3): New test case.
8893 * testsuite/Makefile.in: Regenerate.
8894 * testsuite/plugin_test_3.sh: New file.
8895
5995b570
CC
88962008-12-22 Cary Coutant <ccoutant@google.com>
8897
8898 * object.cc (Sized_relobj::layout_section): New function.
8899 (Sized_relobj::do_layout): Defer layout of input sections until after
8900 plugin has provided replacement files.
8901 (Sized_relobj::do_layout_deferred_sections): New function.
8902 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8903 (Relobj::layout_deferred_sections): New function.
8904 (Relobj::do_layout_deferred_sections): New function.
8905 (Sized_relobj::do_layout_deferred_sections): New function.
8906 (Sized_relobj::layout_section): New function.
8907 (Sized_relobj::Deferred_layout): New structure.
8908 (Sized_relobj::deferred_layout_): New field.
8909 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8910 Change all callers. Layout deferred sections.
8911 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8912 references.
8913 (Plugin_hook::run): Move code from do_plugin_hook inline.
8914 (Plugin_hook::do_plugin_hook): Remove.
8915 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8916 (Plugin_manager::finish): Renamed, was cleanup.
8917 (Plugin_manager::should_defer_layout): New function.
8918 (Plugin_manager::add_deferred_layout_object): New function.
8919 (Plugin_manager::Deferred_layout_list): New type.
8920 (Plugin_manager::deferred_layout_objects_): New field.
8921 (Plugin_hook::do_plugin_hook): Remove.
8922
ee769c88
ILT
89232008-12-17 Ian Lance Taylor <iant@google.com>
8924
8925 * options.h (class General_options): Add --no case for
8926 --export-dynamic.
8927
abc8dcba
CC
89282008-12-16 Cary Coutant <ccoutant@google.com>
8929
8930 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8931 vector.
8932 (Plugin_manager::claim_file): Create plugin object even if
8933 plugin did not call the add_symbols callback.
8934 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8935 asking for more symbols than were added.
8936 * testsuite/Makefile.am (plugin_test_1): Add test case with
8937 no global symbols.
8938 (empty.syms): New target.
8939 * testsuite/Makefile.in: Regenerate.
8940 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8941 message. Don't call add_symbols if no globals.
8942 (all_symbols_read_hook): Don't provide replacement for empty
8943 claimed file.
8944
b0074644
ILT
89452008-12-12 Ian Lance Taylor <iant@google.com>
8946
68943102
ILT
8947 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8948 r_type == 0 for a local symbol with r_sym == 0.
8949 (scan_relocatable_relocs): Pass r_sym to
8950 local_non_section_strategy.
8951 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8952 r_sym parameter.
8953
b0074644
ILT
8954 * configure.ac: Update test for TLS descriptors: they are
8955 supported as of glibc 2.9.
8956 * configure: Rebuild.
8957
c2508178
ILT
89582008-12-11 Ian Lance Taylor <iant@google.com>
8959
8960 PR 7091
8961 * target-reloc.h (Default_scan_relocatable_relocs): For each
8962 function, map r_type == 0 to RELOC_DISCARD.
8963
2756a258
CC
89642008-12-10 Cary Coutant <ccoutant@google.com>
8965
8966 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8967 object to override a kept COMDAT group from a plugin object.
8968
bb6f53d3
ILT
89692008-12-09 Ian Lance Taylor <iant@google.com>
8970
fbc558e1
ILT
8971 PR 7088
8972 * yyscript.y (file_cmd): Handle INPUT.
8973
bb6f53d3
ILT
8974 * testsuite/initpri1.c: Change all declarations to be full
8975 prototypes by adding void, to avoid compiler warnings.
8976
4674ecfc
CC
89772008-12-05 Rafael Avila de Espindola <espindola@google.com>
8978
8979 * options.cc (General_options::parse_plugin_opt): New.
8980 (General_options::add_plugin): The argument now is just the filename.
8981 (General_options::add_plugin_option): New.
8982 * options.h (plugin_opt): New.
8983 (add_plugin): Change argument name.
8984 (add_plugin_option): New.
8985 * plugin.cc (Plugin::load): Don't parse the plugin option.
8986 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8987 (Plugin::add_option): New.
8988 (Plugin::args_): Change type.
8989 (Plugin::filename_): New.
8990 (Plugin_manager::add_plugin_option): New.
8991 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8992 * testsuite/Makefile.in: Regenerate.
8993
fd06b4aa
CC
89942008-12-05 Cary Coutant <ccoutant@google.com>
8995
8996 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8997 Handle --strip-lto-sections option.
8998 * options.h (strip_lto_sections): New option.
8999
6c52134c
CC
90002008-12-01 Cary Coutant <ccoutant@google.com>
9001
9002 * plugin.cc (ld_plugin_message): Change format parameter to const.
9003 Fix mismatch between new[] and delete.
9004
a45248e0
CC
90052008-11-14 Cary Coutant <ccoutant@google.com>
9006
9007 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9008 instead of -1U.
9009
c82fbeee
CS
90102008-11-05 Craig Silverstein <csilvers@google.com>
9011
9012 * options.cc (General_options::parse_dynamic_list): New function.
9013 * options.h (General_options): New flags dynamic_list,
9014 dynamic_list_data, dynamic_list_cpp_new, and
9015 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9016 (General_options::in_dynamic_list): New function.
9017 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9018 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9019 (Lex::can_continue_name): Likewise.
9020 (yylex): Likewise.
9021 (read_script_file): New parameter script_options.
9022 (read_dynamic_list): New function.
9023 (Script_options::define_dynamic_list): New function.
9024 (dynamic_list_keyword_parsecodes): New variable.
9025 (dynamic_list_keywords): New variable.
9026 * script.h (Script_options::define_dynamic_list): New function
9027 prototype.
9028 (read_dynamic_list): New function prototype.
9029 * symtab.cc (strprefix): New macro.
9030 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9031 dynamic_list_data, dynamic_list_cpp_new, and
9032 dynamic_list_cpp_typeinfo.
9033 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9034 (dynamic_list_expr): New rule.
9035 (dynamic_list_nodes): Likewise.
9036 (dynamic_list_node): Likewise.
9037 * testsuite/Makefile.am (dynamic_list): New test.
9038 * testsuite/Makefile.in: Regenerated.
9039 * testsuite/dynamic_list.t: New file.
9040 * testsuite/dynamic_list.sh: New file.
9041
e0bb29a5
CS
90422008-11-05 Craig Silverstein <csilvers@google.com>
9043
9044 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9045 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9046 (t11_last): Likewise.
9047 * testsuite/ver_test_6.c (main): Likewise.
9048
4e1e25e0
CC
90492008-10-07 Cary Coutant <ccoutant@google.com>
9050
9051 * options.c (General_options::finalize): Add check for -static and
9052 -shared.
9053 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9054 is not empty.
9055
92f03fcb
CC
90562008-10-02 Cary Coutant <ccoutant@google.com>
9057
9058 * plugin.cc (make_sized_plugin_object): Fix conditional
9059 compilation to work when not all targets are enabled.
9060
fbd8a257
CC
90612008-09-29 Cary Coutant <ccoutant@google.com>
9062
9063 * archive.cc (Archive::get_file_and_offset): Use filename instead
9064 of name to get library path.
9065 (Archive::include_member): Unlock external member of a thin archive.
9066
9067 * testsuite/Makefile.am (TEST_AR): New variable.
9068 (thin_archive_test_1): New test.
9069 (thin_archive_test_2): New test.
81636b3f
CC
9070 * testsuite/Makefile.in: Regenerate.
9071 * testsuite/thin_archive_main.cc: New file.
9072 * testsuite/thin_archive_test_1.cc: New file.
9073 * testsuite/thin_archive_test_2.cc: New file.
9074 * testsuite/thin_archive_test_3.cc: New file.
9075 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 9076
eff45813
CC
90772008-09-29 Cary Coutant <ccoutant@google.com>
9078
9079 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9080 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9081 instead of -1U.
9082 (Sized_relobj::do_finalize_local_symbols): Likewise.
9083 (Sized_relobj::map_to_kept_section): Likewise.
9084 * object.h (Sized_relobj::invalid_address): New constant.
9085 (Sized_relobj::do_output_section_offset): Check for invalid_address
9086 and return -1ULL.
9087 * output.cc (Output_reloc::local_section_offset): Use constant
9088 invalid_address instead of -1U.
9089 (Output_reloc::get_address): Likewise.
9090 (Output_section::output_address): Change -1U to -1ULL.
9091 * output.h (Output_reloc::invalid_address): New constant.
9092 * reloc.cc (Sized_relobj::write_sections): Use constant
9093 invalid_address instead of -1U.
9094 (Sized_relobj::relocate_sections): Likewise.
9095 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9096 values for merge sections.
9097 * target-reloc.h (relocate_for_relocatable): Use constant
9098 invalid_address instead of -1U.
9099
89fc3421
CC
91002008-09-19 Cary Coutant <ccoutant@google.com>
9101
9102 Add plugin functionality for link-time optimization (LTO).
9103 * configure.ac (plugins): Add --enable-plugins option.
9104 * configure: Regenerate.
9105 * config.in: Regenerate.
9106 * Makefile.am (LIBDL): New variable.
9107 (CCFILES): Add plugin.cc.
9108 (HFILES): Add plugin.h.
9109 (ldadd_var): Add LIBDL.
9110 * Makefile.in: Regenerate.
9111
9112 * archive.cc: Include "plugin.h".
9113 (Archive::setup): Don't preread archive symbols when using a plugin.
9114 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9115 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9116 files.
9117 (Archive::include_member): Add symbols from plugin objects.
9118 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9119 * descriptors.cc (Descriptors::open): Check for file descriptors
9120 abandoned by plugins.
9121 (Descriptors::claim_for_plugin): New function.
9122 * descriptors.h (Descriptors::claim_for_plugin): New function.
9123 (Open_descriptor::is_claimed): New field.
9124 (claim_descriptor_for_plugin): New function.
9125 * fileread.cc (File_read::claim_for_plugin): New function.
9126 * fileread.h (File_read::claim_for_plugin): New function.
9127 (File_read::descriptor): New function.
9128 * gold.cc: Include "plugin.h".
9129 (queue_initial_tasks): Add task to call plugin hooks for generating
9130 new object files.
9131 * main.cc: Include "plugin.h".
9132 (main): Load plugin libraries.
9133 * object.h (Pluginobj): Declare.
9134 (Object::pluginobj): New function.
9135 (Object::do_pluginobj): New function.
9136 (Object::set_target): New function.
9137 * options.cc: Include "plugin.h".
9138 (General_options::parse_plugin): New function.
9139 (General_options::General_options): Initialize plugins_ field.
9140 (General_options::add_plugin): New function.
9141 * options.h (Plugin_manager): Declare.
9142 (General_options): Add --plugin option.
9143 (General_options::has_plugins): New function.
9144 (General_options::plugins): New function.
9145 (General_options::add_plugin): New function.
9146 (General_options::plugins_): New field.
9147 * plugin.cc: New file.
9148 * plugin.h: New file.
9149 * readsyms.cc: Include "plugin.h".
9150 (Read_symbols::do_read_symbols): Check for archive before checking
9151 for ELF file. Call plugin hooks to claim files.
9152 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9153 from a real object file; force override when processing replacement
9154 files.
9155 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9156 (Symbol::init_base_object): Likewise.
9157 (Symbol::init_base_output_data): Likewise.
9158 (Symbol::init_base_output_segment): Likewise.
9159 (Symbol::init_base_constant): Likewise.
9160 (Symbol::init_base_undefined): Likewise.
9161 (Symbol::output_section): Assert that object is not a plugin.
9162 (Symbol_table::add_from_pluginobj): New function.
9163 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9164 undefined.
9165 (Symbol_table::sized_write_globals): Likewise.
9166 (Symbol_table::add_from_pluginobj): Instantiate template.
9167 * symtab.h (Sized_pluginobj): Declare.
9168 (Symbol::in_real_elf): New function.
9169 (Symbol::set_in_real_elf): New function.
9170 (Symbol::in_real_elf_): New field.
9171 (Symbol_table::add_from_pluginobj): New function.
9172
9173 * testsuite/Makefile.am (AM_CFLAGS): New variable.
9174 (LIBDL): New variable.
9175 (LDADD): Add LIBDL.
9176 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
9177 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
9178 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
9179 (MOSTLYCLEANFILES): Likewise.
9180 * testsuite/Makefile.in: Regenerate.
9181 * testsuite/plugin_test.c: New file.
9182 * testsuite/plugin_test_1.sh: New file.
9183 * testsuite/plugin_test_2.sh: New file.
9184
de31bda5
ILT
91852008-09-16 Ian Lance Taylor <iant@google.com>
9186
9c2d0ef9
ILT
9187 * target-reloc.h (relocate_section): Check whether a symbol is
9188 defined by the ABI before reporting an undefined symbol error.
9189 * target.h (Target::is_defined_by_abi): Make parameter const.
9190 (Target::do_is_defined_by_abi): Likewise.
9191 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
9192 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
9193 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
9194 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
9195 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
9196 * testsuite/Makefile.in: Rebuild.
9197
de31bda5
ILT
9198 * fileread.cc (make_view): Add casts to avoid warning.
9199
9fa33bee
AO
92002008-09-16 Alexandre Oliva <aoliva@redhat.com>
9201
9202 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
9203 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9204
183fd0e3
AO
92052008-09-16 Alexandre Oliva <aoliva@redhat.com>
9206
9207 * options.h (General_options::output_is_executable): New.
9208 (General_options::output_is_pie): New.
9209 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
9210 for shared libraries.
9211 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9212
7be8330a
CD
92132008-09-11 Chris Demetriou <cgd@google.com>
9214
9215 * options.h (origin): New -z option.
9216 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
9217 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
9218 in DT_FLAGS_1.
9219
a9caad02
CC
92202008-09-05 Cary Coutant <ccoutant@google.com>
9221
9222 * fileread.cc (File_read::make_view): Add check for attempt to map
9223 beyond end of file.
9224
ae6dce4d
CC
92252008-09-05 Cary Coutant <ccoutant@google.com>
9226
9227 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
9228 explicit instantiations.
9229
d7ab2a47
KVH
92302008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
9231
9232 PR gold/6858
9233 * options.cc (General_options::finalize): Allow undefined symbols
9234 in shlibs if linking -shared.
9235
9236 PR gold/6859
9237 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
9238 symbols as not needing a dynsym entry.
9239
1e52a9c1
CS
92402008-08-20 Craig Silverstein <csilvers@google.com>
9241
9242 * fileread.cc (File_read::open): Do not lock the file unless it
9243 was successfully opened.
9244
d85c80a3
CC
92452008-08-14 Cary Coutant <ccoutant@google.com>
9246
9247 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
9248 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
9249 * testsuite/tls_test.cc (struct int128): 128-bit struct
9250 for testing TLS relocs with non-zero addend.
9251 (v12): New TLS variable.
9252 (t12): New test.
9253 (t_last): Add check for v12.
9254 * testsuite/tls_test.h (t12): New function.
9255 * testsuite/tls_test_main.cc (thread_routine): Call new test.
9256
2d924fd9
ILT
92572008-08-13 Ian Lance Taylor <iant@google.com>
9258
9259 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
9260 set tls_segment_ or relro_segment_.
9261 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
9262 when appropriate.
9263 * output.h (Output_section::clear_is_relro): New function.
9264 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
9265 sections specially even when output_data_ is empty.
9266 (Output_segment::maximum_alignment): When first section is relro,
9267 only force alignment for PT_LOAD segments.
9268 * script.cc (script_data_segment_align): New function.
9269 (script_data_segment_relro_end): New function.
9270 * script-c.h (script_data_segment_align): Declare.
9271 (script_data_segment_relro_end): Declare.
9272 * script-sections.h (class Script_sections): Declare
9273 data_segment_align and data_segment_relro_end. Add fields
9274 segment_align_index_ and saw_relro_end_.
9275 * script-sections.cc (class Sections_element): Add set_is_relro
9276 virtual function. Add new bool* parameter to place_orphan_here.
9277 Add get_output_section virtual function.
9278 (class Output_section_definition): Add set_is_relro. Add new
9279 bool* parameter to place_orphan_here. Add get_output_section.
9280 Add is_relro_ field.
9281 (Output_section_definition::Output_section_definition): Initialize
9282 evaluated_address_, evaluated_load_address, evaluated_addralign_,
9283 and is_relro_ fields.
9284 (Output_section_definition::place_orphan_here): Add is_relro
9285 parameter.
9286 (Output_section_definition::set_section_addresses): Set relro for
9287 output section.
9288 (Output_section_definition::alternate_constraint): Likewise.
9289 (class Orphan_output_section): Add new bool* parameter to
9290 place_orphan_here. Add get_output_section.
9291 (Orphan_output_section::place_orphan_here): Add is_relro
9292 parameter.
9293 (Script_sections::Script_sections): Initialize
9294 data_segment_align_index_ and saw_relro_end_.
9295 (Script_sections::data_segment_align): New function.
9296 (Script_sections::data_segment_relro_end): New function.
9297 (Script_sections::place_orphan): Set or clear is_relro.
9298 (Script_sections::set_section_addresses): Force alignment of first
9299 TLS section.
9300 * yyscript.y (exp): Call script_data_segment_align and
9301 script_data_segment_relro_end.
9302 * testsuite/relro_script_test.t: New file.
9303 * testsuite/relro_test.cc (using_script): Declare.
9304 (t1, t2): Test using_script.
9305 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
9306 (relro_script_test_SOURCES): Define.
9307 (relro_script_test_DEPENDENCIES): Define.
9308 (relro_script_test_LDFLAGS): Define.
9309 (relro_script_test_LDADD): Define.
9310 (relro_script_test.so): New target.
9311 * testsuite/Makefile.in: Rebuild.
9312
f827c9a9
CC
93132008-08-06 Cary Coutant <ccoutant@google.com>
9314
9315 * archive.cc (Archive::total_archives, Archive::total_members)
9316 (Archive::total_members_loaded): New variables.
9317 (Archive::setup): Add parameter. Add option to preread
9318 archive symbols.
9319 (Archive::read_armap): Add counter.
9320 (Archive::get_file_and_offset): New function.
9321 (Archive::get_elf_object_for_member): New function.
9322 (Archive::read_all_symbols): New function.
9323 (Archive::read_symbols): New function.
9324 (Archive::add_symbols): Add counters.
9325 (Archive::include_all_members): Use armap to find members if it's
9326 already built.
9327 (Archive::include_member): Skip reading symbols if already read.
9328 Factored code into Archive::get_file_and_offset and
9329 Archive::get_elf_object_for_member. Changed call to
9330 Mapfile::report_include_archive_member.
9331 (Archive::print_stats): New function.
9332 * archive.h: Declare Object and Read_symbols_data classes.
9333 (Archive::Archive): Add initializers for new members.
9334 (Archive::setup): Add parameter.
9335 (Archive::print_stats): New function.
9336 (Archive::total_archives, Archive::total_members)
9337 (Archive::total_members_loaded): New variables.
9338 (Archive::get_file_and_offset): New function.
9339 (Archive::get_elf_object_for_member): New function.
9340 (Archive::read_all_symbols): New function.
9341 (Archive::read_symbols): New function.
9342 (Archive::Archive_member): New class.
9343 (Archive::members_): New member.
9344 (Archive::num_members_): New member.
9345 * main.cc: Include archive.h.
9346 (main): Call Archive::print_stats.
9347 * mapfile.cc (Mapfile::report_include_archive_member): Delete
9348 archive parameter; member_name is now the fully-decorated name.
9349 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9350 * options.h: (General_options): Add --preread-archive-symbols option.
9351 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9352 Archive::setup.
9353
de4c45bd
ILT
93542008-08-04 Ian Lance Taylor <iant@google.com>
9355
9356 * symtab.h (Symbol::use_plt_offset): New function.
9357 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9358 * powerpc.cc (Relocate::relocate): Likewise.
9359 * sparc.cc (Relocate::relocate): Likewise.
9360 * x86_64.cc (Relocate::relocate): Likewise.
9361 * testsuite/weak_plt.sh: New test.
9362 * testsuite/weak_plt_main.cc: New test.
9363 * testsuite/weak_plt_shared.cc: New test.
9364 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9365 (check_PROGRAMS): Add weak_plt.
9366 (check_DATA): Add weak_plt_shared.so.
9367 (weak_plt_main_pic.o, weak_plt): New targets.
9368 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9369 * testsuite/Makefile.in: Rebuild.
9370
9371 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9372 gcctestdir/ld.
9373 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9374 * testsuite/Makefile.in: Rebuild.
9375
323ee3f4
AM
93762008-08-04 Alan Modra <amodra@bigpond.net.au>
9377
9378 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9379 * Makefile.in: Regenerate.
9380 * po/POTFILES.in: Regenerate.
9381
7c07ecec
ILT
93822008-07-29 Ian Lance Taylor <iant@google.com>
9383
9384 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9385 symbols before other symbols.
9386 * testsuite/script_test_2.cc (test_addr): Declare.
9387 (test_addr_alias): Declare.
9388 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9389 values.
7c07ecec
ILT
9390 * testsuite/script_test_2.t: Define test_addr_alias and
9391 test_addr.
9392
5778530e
ILT
93932008-07-24 Ian Lance Taylor <iant@google.com>
9394
2a00e4fb
ILT
9395 PR 5990
9396 * descriptors.cc: New file.
9397 * descriptors.h: New file.
9398 * gold-threads.h (class Hold_optional_lock): New class.
9399 * fileread.cc: Include "descriptors.h".
9400 (File_read::~File_read): Release descriptor rather than closing
9401 it.
9402 (File_read::open) [file]: Call open_descriptor rather than open.
9403 Set is_descriptor_opened_.
9404 (File_read::open) [memory]: Assert that descriptor is not open.
9405 (File_read::reopen_descriptor): New function.
9406 (File_read::release): Release descriptor.
9407 (File_read::do_read): Make non-const. Reopen descriptor.
9408 (File_read::read): Make non-const.
9409 (File_read::make_view): Reopen descriptor.
9410 (File_read::do_readv): Likewise.
9411 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9412 Update declarations.
9413 * layout.cc: Include "descriptors.h".
9414 (Layout::create_build_id): Use open_descriptor rather than open.
9415 * output.cc: Include "descriptors.h".
9416 (Output_file::open): Use open_descriptor rather than open.
9417 * archive.cc (Archive::const_iterator): Change Archive to be
9418 non-const.
9419 (Archive::begin, Archive::end): Make non-const.
9420 (Archive::count_members): Likewise.
9421 * archive.h (class Archive): Update declarations.
9422 * object.h (Object::read): Make non-const.
9423 * Makefile.am (CCFILES): Add descriptors.cc.
9424 (HFILES): Add descriptors.h.
9425 * Makefile.in: Rebuild.
9426
801647d1
ILT
9427 PR 6716
9428 * gold.h: Always include <clocale>. Add Solaris workarounds
9429 following code in binutils/sysdep.h.
9430
5edd166e
ILT
9431 PR 6048
9432 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9433 this->eh_frame_hdr_ is NULL before using it.
9434
c89ad728
ILT
9435 * dynobj.cc (Versions::Versions): Update comment.
9436
aa86f06b
ILT
9437 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9438 the base version name.
9439
5778530e
ILT
9440 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9441 array size plus one.
9442 (Stringpool_template::set_string_offsets): Subtract one from key
9443 before using it as an array index.
9444 (Stringpool_template::get_offset_with_length): Likewise.
9445 (Stringpool_template::write_to_buffer): Likewise.
9446 * stringpool.h (Stringpool_template::get_offset_from_key):
9447 Likewise.
9448
057ead22
ILT
94492008-07-23 Ian Lance Taylor <iant@google.com>
9450
7f649c59
ILT
9451 PR 6658
9452 * object.h (Merged_symbol_value::value): Do our best to handle a
9453 negative addend.
9454
057ead22
ILT
9455 PR 6647
9456 * script.cc (Version_script_info::get_versions): Don't add empty
9457 version tag to return value.
9458 (Version_script_info::get_symbol_version_helper): Change return
9459 type to bool. Add pversion parameter. Change all callers.
9460 (script_register_vers_node): Don't require a non-NULL tag.
9461 * script.h (class Version_script_info): Update declarations.
9462 (Version_script_info::get_symbol_version): Change return type to
9463 bool. Add version parameter. Change all callers.
9464 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9465 handling. Handle an empty version from a version script.
9466 (Symbol_table::define_special_symbol): Likewise.
9467 * testsuite/ver_test_10.script: New file.
9468 * testsuite/ver_test_10.sh: New file.
9469 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9470 (check_DATA): Add ver_test_10.syms.
9471 (ver_test_10.syms, ver_test_10.so): New target.
9472 * testsuite/Makefile.in: Rebuild.
9473
58e54ac2
CD
94742008-07-23 Simon Baldwin <simonb@google.com>
9475
9476 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9477 to zero for undefined symbols from dynamic libraries.
9478
95d14cd3
ILT
94792008-07-23 Ian Lance Taylor <iant@google.com>
9480
9481 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9482 Change all callers.
9483 * symtab.h (class Symbol_table): Update declaration.
9484 * testsuite/ver_test_9.cc: New file.
9485 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9486 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9487 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9488 (ver_test_9.so, ver_test_9.o): New targets.
9489 * testsuite/Makefile.in: Rebuild.
9490
92de84a6
ILT
94912008-07-22 Ian Lance Taylor <iant@google.com>
9492
34810851
ILT
9493 * options.h (class General_options): Define --check-sections.
9494 * layout.cc (Layout::set_segment_offsets): Handle
9495 --check-sections.
9496
af6156ef
ILT
9497 * options.h (class General_options): Define -n/--nmagic and
9498 -N/--omagic.
9499 * options.cc (General_options::finalize): For -n/--nmagic or
9500 -N/--omagic, set -static.
9501 * layout.cc (Layout::attach_allocated_section_to_segment): If
9502 -N/--omagic, don't put read-only and read-write sections in
9503 different segments.
9504 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9505 finding a read-only segment.
9506 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9507 don't set the minimum segment alignment to the common page size,
9508 and don't set the file offset to the address modulo the page size.
9509 * script-sections.cc (Script_sections::create_segments): If
9510 -n/--omagic, don't put read-only and read-write sections in
9511 different segments.
9512
92de84a6
ILT
9513 * cref.cc: New file.
9514 * cref.h: New file.
9515 * options.h (class General_options): Add --print-symbol-counts.
9516 * main.cc (main): Issue defined symbol report if requested.
9517 * archive.cc (Archive::interpret_header): Make into a const member
9518 function.
9519 (Archive::add_symbols): Call Input_objects::archive_start and
9520 archive_stop.
9521 (Archive::const_iterator): Define new class.
9522 (Archive::begin, Archive::end): New functions.
9523 (Archive::include_all_members): Rewrite to use iterator.
9524 (Archive::count_members): New function.
9525 * archive.h (class Archive): Update declarations.
9526 (Archive::filename): New function.
9527 * object.cc: Include "cref.h".
9528 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9529 (Sized_relobj::do_get_global_symbol_counts): New function.
9530 (Input_objects::add_object): Add object to cross-referencer.
9531 (Input_objects::archive_start): New function.
9532 (Input_objects::archive_stop): New function.
9533 (Input_objects::print_symbol_counts): New function.
9534 * object.h: Declare Cref and Archive.
9535 (Object::get_global_symbol_counts): New function.
9536 (Object::do_get_global_symbol_counts): New pure virtual function.
9537 (class Sized_relobj): Add defined_count_ field. Update
9538 declarations.
9539 (class Input_objects): Add cref_ field. Update constructor.
9540 Update declarations.
9541 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9542 defined_count_.
9543 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9544 symbol counts.
9545 (Sized_dynobj::do_get_global_symbol_counts): New function.
9546 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9547 defined_count_. Update declarations. Define Symbols typedef.
9548 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9549 parameter. Change all callers.
9550 (Symbol_table::add_from_dynobj): Add sympointers and defined
9551 parameters. Change all callers.
9552 * symtab.h (class Symbol_table): Update declarations.
9553 * Makefile.am (CCFILES): Add cref.cc.
9554 (HFILES): Add cref.h.
9555 * Makefile.in: Rebuild.
9556
3f7c5e1d
CD
95572008-07-22 Simon Baldwin <simonb@google.com>
9558
9559 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9560 to zero when writing undefined symbols.
9561
e0b64032
ILT
95622008-07-22 Ian Lance Taylor <iant@google.com>
9563
9564 * output.cc (Output_section::add_input_section): Don't try to
9565 merge empty merge sections.
9566
096b02cf
CS
95672008-07-21 Craig Silverstein <csilvers@google.com>
9568
9569 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9570 Include symbol version in error message.
cd536b21 9571
1d1f116d
CD
95722008-07-20 Chris Demetriou <cgd@google.com>
9573
cd536b21 9574 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9575 (RANDOM_SEED_CFLAGS): New substituted variable.
9576 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9577 * configure: Rebuild.
9578 * Makefile.in: Likewise.
9579 * testsuite/Makefile.in: Likewise.
9580
a18f591e
ILT
95812008-07-18 Ian Lance Taylor <iant@google.com>
9582
9583 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9584 where we see NAME/NULL and NAME/VERSION as separate symbols.
9585 * testsuite/ver_test_main.cc (main): Call t4.
9586 (t4, t4_2a): Define.
9587 * testsuite/ver_test_2.cc (t4_2): Define.
9588 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9589 * testsuite/ver_test_4.cc (t4_2a): Define.
9590 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9591 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9592
c6e3f6ed
ILT
95932008-07-17 Ian Lance Taylor <iant@google.com>
9594
9595 * dynobj.cc (Versions::add_def): If we give an error about a
9596 missing version, go ahead and create the version anyhow.
9597
ef9beddf
ILT
95982008-07-10 Ian Lance Taylor <iant@google.com>
9599
9600 Handle output sections with more than 0x7fffffff bytes.
9601 * object.h (class Relobj): Change map_to_output_ to
9602 output_sections_, and just keep a section pointer. Change all
9603 uses. Move comdat group support to Sized_relobj.
9604 (Relobj::is_section_specially_mapped): Remove.
9605 (Relobj::output_section): Remove poff parameter. Change all
9606 callers.
9607 (Relobj::output_section_offset): New function.
9608 (Relobj::set_section_offset): Rewrite.
9609 (Relobj::map_to_output): Remove.
9610 (Relobj::output_sections): New function.
9611 (Relobj::do_output_section_offset): New pure virtual function.
9612 (Relobj::do_set_section_offset): Likewise.
9613 (class Sized_relobj): Add section_offsets_ field. Add comdat
9614 group support from Relobj. Update declarations.
9615 (Sized_relobj::get_output_section_offset): New function.
9616 (Sized_relobj::do_output_section_offset): New function.
9617 (Sized_relobj::do_set_section_offset): New function.
9618 * object.cc (Relobj::output_section_address): Remove.
9619 (Sized_relobj::Sized_relobj): Initialize new fields.
9620 (Sized_relobj::include_section_group): Cast find_kept_object to
9621 Sized_relobj.
9622 (Sized_relobj::include_linkonce_section): Likewise.
9623 (Sized_relobj::do_layout): Use separate arrays for output section
9624 and output offset.
9625 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9626 output_sections.
9627 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9628 output_sections and section_offsets.
9629 (Sized_relobj::write_local_symbols): Likewise.
9630 (map_to_kept_section): Compute output address directly.
9631 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9632 output_sections and section_offsets.
9633 (Sized_relobj::write_sections): Likewise.
9634 (Sized_relobj::relocate_sections): Likewise.
9635 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9636 * output.h (class Output_reloc): Update declarations. Change
9637 u2_.relobj to Sized_relobj*.
9638 (class Output_data_reloc): Change add functions to use
9639 Sized_relobj*.
9640 * output.cc (Output_reloc::Output_reloc): Change relobj to
9641 Sized_relobj*.
9642 (Output_reloc::local_section_offset): Change return type to
9643 Elf_Addr. Use get_output_section_offset.
9644 (Output_reloc::get_address): Likewise.
9645 (Output_section::is_input_address_mapped): Don't call
9646 is_section_specially_mapped.
9647 (Output_section::output_offset): Likewise.
9648 (Output_section::output_address): Likewise.
9649 (Output_section::starting_output_address): Likewise.
9650 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9651 parameter to Sized_relobj*.
9652 (Copy_relocs::need_copy_reloc): Likewise.
9653 (Copy_relocs::save): Likewise.
9654 * copy-relocs.h (class Copy_relocs): Update declarations.
9655 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9656 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9657 * target-reloc.h (relocate_for_relocatable): Change
9658 offset_in_output_section type to Elf_Addr. Change code that uses
9659 it as well.
9660 * layout.cc (Layout::layout): Always set *off.
9661 * mapfile.cc (Mapfile::print_input_section): Use
9662 output_section_offset.
9663 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9664 Sized_relobj*.
9665 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9666 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9667 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9668
5cb66f97
ILT
96692008-07-03 Ian Lance Taylor <iant@google.com>
9670
9671 * layout.cc (Layout::include_section): Do not discard unrecognized
9672 SHT_STRTAB sections.
9673
afe47622
CS
96742008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9675
9676 * script.cc (Lex::can_continue_name): Make '?' allowable in
9677 version-script names.
9678 * testsuite/version_script.map: Change glob pattern to use '?'
9679
5adf9721
ILT
96802008-06-30 Manish Singh <yosh@gimp.org>
9681
9682 PR 6585
9683 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9684 Correct typo.
9685
e6fde208
ILT
96862008-06-30 Ian Lance Taylor <iant@google.com>
9687
9688 PR 6660
9689 PR 6682
9690 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9691 versions]: Don't try to read the value in the contents, since we
9692 don't use it. Use the template endianness when writing.
9693
3f2e6a2d
CC
96942008-06-25 Cary Coutant <ccoutant@google.com>
9695
9696 * fileread.cc (File_read::make_view): Assert on zero-length view.
9697 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9698 symbol table when there are no symbols to read.
9699
c43d3a48
CS
97002008-06-23 Craig Silverstein <csilvers@google.com>
9701
9702 * version.cc (version_string): Bump to 1.7
9703
5f494ea0
CS
97042008-06-18 Craig Silverstein <csilvers@google.com>
9705
9706 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9707 constant 0xFFFF to type Valtype.
9708 (Powerpc_relocate_functions::rel16_ha): Likewise.
9709
c42e122e
ILT
97102008-06-17 Ian Lance Taylor <iant@google.com>
9711
f34787f8
ILT
9712 * output.h (Output_section::Input_section): Initialize p2align_ to
9713 zero for Output_section_data constructors.
9714 (Output_section::Input_section::addralign): If not an input
9715 section, return the alignment of the Output_section_data.
9716 * testsuite/copy_test.cc: New file.
9717 * testsuite/copy_test_1.cc: New file.
9718 * testsuite/copy_test_2.cc: New file.
9719 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9720 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9721 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9722 (copy_test_1_pic.o, copy_test_1.so): New targets.
9723 (copy_test_2_pic.o, copy_test_2.so): New targets.
9724 * testsuite/Makefile.in: Rebuild.
9725
c42e122e
ILT
9726 * script-sections.cc (Script_sections::place_orphan): Initialize
9727 local variable exact.
9728
ce3ac18a
DE
97292008-06-13 David Edelsohn <edelsohn@gnu.org>
9730
9731 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9732
42cacb20
DE
97332008-06-12 David Edelsohn <edelsohn@gnu.org>
9734 David S. Miller <davem@davemloft.net>
9735
9736 * powerpc.cc: New file.
9737 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9738 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9739 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9740 * Makefile.in: Rebuild.
9741
7b308235
ILT
97422008-06-09 Ian Lance Taylor <iant@google.com>
9743
9744 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9745 <exception>.
9746 (throwing, orig_terminate): New static variables.
9747 (terminate_handler): New static function.
9748 (t2): Set terminate handler.
9749
f0b886e3
ILT
97502008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9751
9752 PR 6584
cd536b21 9753 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9754 alignment.
9755
3e90f135
CC
97562008-05-30 Cary Coutant <ccoutant@google.com>
9757
9758 * archive.cc (Archive::include_all_members) Correct to step
9759 over symbol table and extended name table in thin archives.
9760
e09ad04a
ILT
97612008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9762
9763 PR 6407
9764 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9765 calculation.
9766
62b01cb5
ILT
97672008-05-28 Caleb Howe <cshowe@google.com>
9768
9769 * reduced_debug_output.cc: New file.
9770 * reduced_debug_output.h: New file.
92de84a6 9771 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9772 * options.cc (General_options::finalize): Add strip_debug_non_line
9773 to the strip heirarchy.
9774 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9775 fields.
9776 * layout.cc: Include "reduced_debug_output.h".
9777 (Layout::Layout): Initialize new fields.
9778 (line_only_debug_sections): New static array.
9779 (is_lines_only_debug_sections): New static inline function.
9780 (Layout::include_section): Handle --strip-debug-non-line.
9781 (Layout::make_output_section): If --strip-debug-non-line, build
9782 new output sections for .debug_abbrev and .debug_info.
9783 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9784 gold. Warn about possible overflow.
9785 (read_signed_LEB_128): Likewise.
9786 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9787 (read_signed_LEB_128): Declare.
9788 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9789 (HFILES): Add reduced_debug_output.h.
9790 * Makefile.in: Rebuild.
9791
7d9e3d98
ILT
97922008-05-21 Ian Lance Taylor <iant@google.com>
9793
9794 * mapfile.cc: New file.
9795 * mapfile.h: New file.
9796 * options.h (class General_options): Add -M/--print-map and -Map.
9797 * options.cc (General_options::finalize): Make -M equivalent to
9798 -Map -.
9799 * main.cc: Include <cstdio> and "mapfile.h".
9800 (main): Open mapfile if requested.
9801 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9802 constructor. Change caller.
9803 (queue_initial_tasks): Add mapfile parameter. Change caller.
9804 (queue_middle_tasks): Likewise.
9805 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9806 declarations.
9807 * archive.cc: Include "mapfile.h".
9808 (Archive::add_symbols): Add mapfile parameter. Change all
9809 callers. Pass mapfile, symbol, and reason to include_member.
9810 (Archive::include_all_members): Add mapfile parameter. Change all
9811 callers.
9812 (Archive::include_member): Add mapfile, sym, and why parameters.
9813 Change all callers. Report inclusion to map file.
9814 * archive.h: Include "fileread.h".
9815 (class Archive): Update declarations.
9816 (Archive::file): New const method.
9817 (class Add_archive_symbols): Add mapfile_ field. Update
9818 constructor. Change all callers.
9819 * readsyms.h (class Read_symbols): Likewise.
9820 (class Finish_group): Likewise.
9821 (class Read_script): Likewise.
9822 * common.cc: Include "mapfile.h".
9823 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9824 all callers.
9825 (Symbol_table::do_allocate_commons): Likewise.
9826 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9827 symbol allocation to mapfile.
9828 * common.h (class Allocate_commons_task): Add mapfile_ field.
9829 Update constructor. Change all callers.
9830 * symtab.h (class Symbol_table): Update declarations.
9831 * layout.cc: Include "mapfile.h".
9832 (Layout_task_runner::run): Print information to mapfile.
9833 (Layout::create_gold_note): Change Output_data_fixed_space to
9834 Output_data_zero_fill.
9835 (Layout::create_build_id): Likewise.
9836 (Layout::print_to_mapfile): New function.
9837 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9838 constructor. Change caller.
9839 (class Layout): Declare print_to_mapfile.
9840 * output.cc (Output_section::Input_section::print_to_mapfile): New
9841 function.
9842 (Output_section::add_input_section): If producing a map, always
9843 add to input_sections_ list.
9844 (Output_section::do_print_to_mapfile): New function.
9845 (Output_segment::print_sections_to_mapfile): New function.
9846 (Output_segment::print_section_list_to_mapfile): New function.
9847 * output.h: Include "mapfile.h".
9848 (Output_data::print_to_mapfile): New function.
9849 (Output_data::do_print_to_mapfile): New virtual function.
9850 (Output_segment_headers::do_print_to_mapfile): New function.
9851 (Output_file_header::do_print_to_mapfile): New function.
9852 (Output_data_const::do_print_to_mapfile): New function.
9853 (class Output_data_const_buffer): Add map_name_ field. Update
9854 constructor. Change all callers. Add do_print_to_mapfile
9855 function.
9856 (class Output_data_fixed_space): Likewise.
9857 (class Output_data_space): Likewise.
9858 (class Output_data_zero_fill): New class.
9859 (Output_data_strtab::do_print_to_mapfile): New function.
9860 (Output_data_reloc_base::do_print_to_mapfile): New function.
9861 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9862 (Output_data_group::do_print_to_mapfile): New function.
9863 (Output_data_got::do_print_to_mapfile): New function.
9864 (Output_data_dynamic::do_print_to_mapfile): New function.
9865 (Output_symtab_xindex::do_print_to_mapfile): New function.
9866 (class Output_section): Declare do_print_to_mapflie. Declare
9867 print_to_mapfile in Input_section.
9868 (class Output_segment): Declare new functions.
9869 * object.h (Sized_relobj::symbol_count): New function.
9870 * script-sections.cc
9871 (Output_section_element_dot_assignment::set_section_addresses):
9872 Change Output_data_fixed_space to Output_data_zero_fill.
9873 (Output_data_expression::do_print_to_mapfile): New function.
9874 * script.cc (read_input_script): Add mapfile parameter. Change
9875 all callers.
9876 * script.h (read_input_script): Update declaration.
9877 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9878 (Eh_frame::do_print_to_mapfile): New function.
9879 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9880 (Output_merge_string::do_print_to_mapfile): New function.
9881 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9882 function.
9883 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9884 function.
9885 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9886 function.
9887 * Makefile.am (CCFILES): Add mapfile.cc.
9888 (HFILES): Add mapfile.h.
9889 * Makefile.in: Rebuild.
9890
9f1d377b
ILT
98912008-05-19 Ian Lance Taylor <iant@google.com>
9892
9893 * options.h (class General_options): Add -z relro.
9894 * layout.cc (Layout::Layout): Initialize relro_segment_.
9895 (Layout::add_output_section_data): Return the output section.
9896 (Layout::make_output_section): Rcognize relro sections and mark
9897 them appropriately.
9898 (Layout::attach_allocated_section_to_segment): Put relro sections
9899 in a PT_GNU_RELRO segment.
9900 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9901 section as relro.
9902 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9903 PT_TLS segments.
9904 (Layout::linkonce_mapping): Map d.rel.ro.local to
9905 .data.rel.ro.local.
9906 (Layout::output_section_name): Us .data.rel.ro.local for any
9907 section which begins with that.
9908 * layout.h (class Layout): Update add_output_section_data
9909 declaration. Add relro_segment_ field.
9910 * output.cc (Output_section::Output_section): Initialize is_relro_
9911 and is_relro_local_ fields.
9912 (Output_segment::add_output_section): Group relro sections.
9913 (Output_segment::is_first_section_relro): New function.
9914 (Output_segment::maximum_alignment): If there is a relro section,
9915 align the segment to the common page size.
9916 (Output_segment::set_section_addresses): Track whether we are
9917 looking at relro sections. If the last section is a relro
9918 section, align to the common page size.
9919 (Output_segment::set_section_list_addresses): Add in_relro
9920 parameter. Change all callers. Align to the page size when
9921 moving from relro to non-relro section.
9922 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9923 segment.
9924 * output.h (class Output_section): Add is_relro_ and
9925 is_relro_local_ fields.
9926 (Output_section::is_relro): New function.
9927 (Output_section::set_is_relro): New function.
9928 (Output_section::is_relro_local): New function.
9929 (Output_section::set_is_relro_local): New function.
9930 (class Output_segment): Update declarations.
9931 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9932 * sparc.cc (Target_sparc::got_section): Likewise.
9933 * x86_64.cc (Target_x86_64::got_section): Likewise.
9934 * testsuite/relro_test_main.cc: New file.
9935 * testsuite/relro_test.cc: New file.
9936 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9937 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9938 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9939 (relro_test.so, relro_test_pic.o): New targets.
9940 * testsuite/Makefile.in: Rebuild.
9941
a984ee1d
ILT
99422008-05-16 Ian Lance Taylor <iant@google.com>
9943
01676dcd
ILT
9944 * output.cc (Output_segment::add_output_section): Remove front
9945 parameter.
9946 * output.h (class Output_segment): Remove
9947 add_initial_output_section and overloaded add_output_section.
9948 Update declaration of remaining add_output_section.
9949 * layout.cc (Layout::create_interp): Call add_output_section
9950 rather than add_initial_output_section.
9951 (Layout::finish_dynamic_section): Likewise.
9952
497897f9
ILT
9953 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9954 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9955 know the dynamic type.
9956 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9957 field. Initialize it in constructor.
9958 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9959 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9960 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9961 reloc.
9962
a984ee1d
ILT
9963 * output.cc (Output_reloc::get_address): Change return type to
9964 Elf_Addr.
9965 * output.h (class Output_reloc): Update get_address declaration.
9966 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9967 for section addresses.
9968
55ba0940
ILT
99692008-05-09 Ian Lance Taylor <iant@google.com>
9970
9971 PR 6493
9972 * gold.cc (gold_nomem): Use return value of write.
9973
75517b77
ILT
99742008-05-08 Ian Lance Taylor <iant@google.com>
9975
9976 * symtab.c (Symbol::init_base_output_data): Add version
9977 parameter. Change all callers.
9978 (Symbol::init_base_output_segment): Likewise.
9979 (Symbol::init_base_constant): Likewise.
9980 (Symbol::init_base_undefined): Likewise.
9981 (Sized_symbol::init_output_data): Likewise.
9982 (Sized_symbol::init_output_segment): Likewise.
9983 (Sized_symbol::init_constant): Likewise.
9984 (Sized_symbol::init_undefined): Likewise.
9985 (Symbol_table::do_define_in_output_data): If the new symbol has a
9986 version, mark it as the default.
9987 (Symbol_table::do_define_in_output_segment): Likewise.
9988 (Symbol_table::do_define_as_constant): Likewise.
9989 * symtab.h (class Symbol): Update declarations.
9990 (class Sized_symbol): Likewise.
9991 * resolve.cc (Symbol::override_version): New function.
c42e122e 9992 (Symbol::override_base): Call override_version.
75517b77
ILT
9993 (Symbol::override_base_with_special): Likewise.
9994 * testsuite/ver_script_8.script: New file.
9995 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9996 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9997 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9998 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9999
f1f70eae
ILT
100002008-05-06 Ian Lance Taylor <iant@google.com>
10001
f3e9c5c5
ILT
10002 PR 6049
10003 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10004 functions.
10005 (class General_options): Remove existing --undefined, and add
10006 --no-undefined instead. Add new --undefined as synonym for -u.
10007 * archive.cc (Archive::add_symbols): Check whether symbol was
10008 named with -u.
10009 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10010 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10011 all uses. Add IS_UNDEFINED. Update declarations to split
10012 different versions of init_base. Declare init_base_undefined.
10013 (Symbol::is_defined): Handle IS_UNDEFINED.
10014 (Symbol::is_undefined): Likewise.
10015 (Symbol::is_weak_undefined): Call is_undefined.
10016 (Symbol::is_absolute): Handle IS_CONSTANT.
10017 (class Sized_symbol): Update declarations to split different
10018 versions of init. Declare init_undefined.
10019 (class Symbol_table): Declare new functions.
10020 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10021 Change all callers.
10022 (Symbol::init_base_output_data): Likewise.
10023 (Symbol::init_base_output_segment): Likewise.
10024 (Symbol::init_base_constant): Likewise.
10025 (Symbol::init_base_undefined): New function.
10026 (Sized_symbol::init_object): Rename from init. Change all
10027 callers.
10028 (Sized_symbol::init_output_data): Likewise.
10029 (Sized_symbol::init_output_segment): Likewise.
10030 (Sized_symbol::init_constant): Likewise.
10031 (Sized_symbol::init_undefined): New function.
10032 (Symbol_table::add_undefined_symbols_from_command_line): New
10033 function.
10034 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10035 function.
10036 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10037 (Symbol::output_section): Likewise.
10038 (Symbol::set_output_section): Likewise.
10039 (Symbol_table::sized_finalize_symbol): Likewise.
10040 (Symbol_table::sized_write_globals): Likewise.
10041 * resolve.cc (Symbol_table::should_override): Likewise.
10042 (Symbol::override_base_with_special): Likewise.
10043
8bdcdf2c
ILT
10044 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10045 symbol, change it to have default visibility.
10046 * testsuite/protected_1.cc: New file.
10047 * testsuite/protected_2.cc: New file.
10048 * testsuite/protected_3.cc: New file.
10049 * testsuite/protected_main_1.cc: New file.
10050 * testsuite/protected_main_2.cc: New file.
10051 * testsuite/protected_main_3.cc: New file.
10052 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10053 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10054 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10055 (protected_1.so): New target.
10056 (protected_1_pic.o, protected_2_pic.o): New targets.
10057 (protected_3_pic.o): New target.
10058 (check_PROGRAMS): Add protected_2.
10059 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10060 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10061 * testsuite/Makefile.in: Rebuild.
10062
2b706932
ILT
10063 * options.h (DEFINE_var): Add set_user_set_##varname__.
10064 (DEFINE_bool_alias): New macro.
10065 (class General_options): Define -Bstatic using DEFINE_bool_alias
10066 rather than DEFINE_special. Add --undefined as an alias for -z
10067 defs.
10068 * options.cc (General_options::parse_Bstatic): Remove.
10069
d82a5bcc
ILT
10070 * options.h (class General_options): Add --fatal-warnings.
10071 * main.cc (main): Implement --fatal-warnings.
10072 * errors.h (Errors::warning_count): New function.
10073
f1f70eae
ILT
10074 * options.h (class General_options): Add -Bsymbolic-functions.
10075 * symtab.h (Symbol::is_preemptible): Check for
10076 -Bsymbolic-functions.
10077
8825ac63
ILT
100782008-05-05 Ian Lance Taylor <iant@google.com>
10079
d98bc257
ILT
10080 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10081 as noVARNAME rather than no-VARNAME.
10082 (class General_options): Add option -z combreloc.
10083 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10084 get_address.
10085 (Output_reloc::sort_before) [SHT_REL]: New function.
10086 (Output_reloc::sort_before) [SHT_RELA]: New function.
10087 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10088 Sort_relocs_comparison.
10089 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10090 parameter. Change all callers.
10091 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10092 sort_relocs parameter. Change all callers.
10093 * output.cc (Output_reloc::get_address): New function, broken out
10094 of write_rel.
10095 (Output_reloc::write_rel): Call it.
10096 (Output_reloc::compare): New function.
10097 (Output_data_reloc_base::do_write): Optionally sort relocs.
10098
60b2b4e7
ILT
10099 * configure.ac: If targ_extra_obj is set, link it in.
10100 * configure.tgt: Initialize all variables.
10101 (x86_64*): Set targ_extra_obj and targ_extra_size.
10102 * configure: Rebuild.
10103
8825ac63
ILT
10104 * object.cc (Sized_relobj::include_section_group): Adjust section
10105 indexes read from group data. Build vector to pass to
10106 layout_group.
10107 * layout.cc (Layout::layout_group): Add flags and shndxes
10108 parameters. Remove contents parameter. Change caller. Update
10109 explicit instantiations.
10110 * layout.h (class Layout): Update layout_group declaration.
10111 * output.cc (Output_data_group::Output_data_group): Add flags and
10112 input_shndxes parameters. Remove contents parameter. Change
10113 caller.
10114 (Output_data_group::do_write): Change input_sections_ to
10115 input_shndxes_.
10116 * output.h (class Output_data_group): Update constructor
10117 declaration. Rename input_sections_ to input_shndxes_.
10118 * testsuite/many_sections_test.cc: Add template.
10119
e94cf127
CC
101202008-04-30 Cary Coutant <ccoutant@google.com>
10121
4418b2d5
CC
10122 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10123
e94cf127
CC
10124 * layout.cc (Layout::include_section): Refactored check for debug
10125 info section.
10126 (Layout::add_comdat): Add new parameters. Change type
10127 of signature parameter. Add object and shndx to signatures table.
10128 (Layout::find_kept_object): New function.
10129 * layout.h: Include <cstring>.
10130 (Layout::is_debug_info_section): New function.
10131 (Layout::add_comdat): Add new parameters.
10132 (Layout::find_kept_object): New function.
10133 (Layout::Kept_section): New struct.
10134 (Layout::Signatures): Change type of map range.
10135 * object.cc (Relobj::output_section_address): New function.
10136 (Sized_relobj::include_section_group): Add new parameters. Change
10137 calls to Layout::add_comdat. Change to build table of kept comdat
10138 groups and table mapping discarded sections to kept sections.
10139 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10140 (Sized_relobj::do_layout): Change calls to include_section_group and
10141 include_linkonce_section.
10142 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10143 value to zero when section is discarded.
10144 (Sized_relobj::map_to_kept_section): New function.
10145 * object.h (Relobj::output_section_address): New function.
10146 (Relobj::Comdat_group): New type.
10147 (Relobj::find_comdat_group): New function.
10148 (Relobj::Comdat_group_table): New type.
10149 (Relobj::Kept_comdat_section): New type.
10150 (Relobj::Kept_comdat_section_table): New type.
10151 (Relobj::add_comdat_group): New function.
10152 (Relobj::set_kept_comdat_section): New function.
10153 (Relobj::get_kept_comdat_section): New function.
10154 (Relobj::comdat_groups_): New field.
10155 (Relobj::kept_comdat_sections_): New field.
10156 (Symbol_value::input_value): Update comment.
10157 (Sized_relobj::map_to_kept_section) New function.
10158 (Sized_relobj::include_linkonce_section): Add new parameter.
10159 * target-reloc.h (Comdat_behavior): New type.
10160 (get_comdat_behavior): New function.
10161 (relocate_section): Add code to map a discarded section to the
10162 corresponding kept section when applying a relocation.
10163
e4e5049b
CS
101642008-04-30 Craig Silverstein <csilvers@google.com>
10165
10166 * dwarf_reader.cc (next_generation_count): New static var.
10167 (Addr2line_cache_entry): New struct.
10168 (addr2line_cache): New static var.
10169 (Dwarf_line_info::one_addr2line): Added caching.
10170 (Dwarf_line_info::clear_addr2line_cache): New function.
10171 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
10172 cache-size parameter.
10173 (Dwarf_line_info::one_addr2line_cache): New function.
10174 * symtab.cc (Symbol_table::detect_odr_violations): Pass
10175 new cache-size argument to one_addr2line(), and clear cache.
10176
d09e9154
CC
101772008-04-28 Cary Coutant <ccoutant@google.com>
10178
10179 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
10180 R_386_PC8 relocations.
10181
7ef73768
ILT
101822008-04-23 Ian Lance Taylor <iant@google.com>
10183
55438702
ILT
10184 * object.cc (Sized_relobj::include_section_group): Check for
10185 invalid section group.
10186
c165fb93
ILT
10187 * object.cc (make_elf_object): Correct test for 64-bit ELF file
10188 header size.
10189
7ef73768
ILT
10190 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
10191 than read for file header.
10192 * archive.cc (Archive::include_member): Likewise.
10193
6194aaab
L
101942008-04-23 Paolo Bonzini <bonzini@gnu.org>
10195
10196 * aclocal.m4: Regenerate.
10197 * configure: Regenerate.
10198
d491d34e
ILT
101992008-04-19 Ian Lance Taylor <iant@google.com>
10200
5ea2bac6
ILT
10201 * version.cc (version_string): Bump to 1.6.
10202
7bc3e21a
ILT
10203 * testsuite/Makefile.am (many_sections_r_test): New target.
10204 (many_sections_r_test_SOURCES): Remove.
10205 (many_sections_r_test_DEPENDENCIES): Remove.
10206 (many_sections_r_test_LDFLAGS): Remove.
10207 (many_sections_r_test_LDADD): Remove.
10208
7fcd3aa9
ILT
10209 * object.cc (Sized_relobj::do_add_symbols): Always pass
10210 local_symbol_count_ to add_from_relobj.
10211
4c94d6ae
ILT
10212 * testsuite/Makefile.am (many_sections_check.h): Only check one in
10213 every thousand variables.
10214 * testsuite/Makefile.in: Rebuild.
10215
d491d34e
ILT
10216 * object.cc (Xindex::initialize_symtab_xindex): New function.
10217 (Xindex::read_symtab_xindex): New function.
10218 (Xindex::sym_xindex_to_shndx): New function.
10219 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
10220 available.
10221 (Sized_relobj::do_initialize_xindex): New function.
10222 (Sized_relobj::do_read_symbols): Adjust section links.
10223 (Sized_relobj::symbol_section_and_value): Add is_ordinary
10224 parameter. Change all callers.
10225 (Sized_relobj::include_section_group): Adjust section links and
10226 symbol section indexes.
10227 (Sized_relobj::do_layout): Adjust section links.
10228 (Sized_relobj::do_count_local_symbols): Adjust section links and
10229 symbol section indexes.
10230 (Sized_relobj::do_finalize_local_symbols): Distinguish between
10231 ordinary and special symbols.
10232 (Sized_relobj::write_local_symbols): Add symtab_xindex and
10233 dynsym_xindex parameters. Change all callers. Adjust section
10234 links. Use SHN_XINDEX when needed.
10235 (Sized_relobj::get_symbol_location_info): Adjust section links.
10236 Don't get fooled by special symbols.
10237 * object.h (class Xindex): Define.
10238 (class Object): Add xindex_ parameter. Declare virtual functoin
10239 do_initialize_xindex.
10240 (Object::adjust_sym_shndx): New function.
10241 (Object::set_xindex): New protected function.
10242 (class Symbol_value): Add is_ordinary_shndx_ field.
10243 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
10244 (Symbol_value::value): Assert ordinary section.
10245 (Symbol_value::initialize_input_to_output_map): Likewise.
10246 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
10247 Change all callers.
10248 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
10249 all callers.
10250 (class Sized_relobj): Update declarations.
10251 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
10252 parameter. Change all callers.
10253 (Sized_relobj::adjust_shndx): New function.
10254 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
10255 field.
10256 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
10257 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
10258 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
10259 (Sized_dynobj::read_dynsym_section): Adjust section links.
10260 (Sized_dynobj::read_dynamic): Likewise.
10261 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
10262 section links.
10263 (Sized_dynobj::do_initialize_xindex): New function.
10264 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
10265 do_initialize_xindex.
10266 (Sized_dynobj::adjust_shndx): New function.
10267 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
10268 dynsym_xindex_ fields.
10269 (Layout::finalize): Add a call to set_section_indexes before
10270 creating the symtab sections.
10271 (Layout::set_section_indexes): Don't do anything if the section
10272 already has a section index.
10273 (Layout::create_symtab_sections): Add shnum parameter. Change
10274 caller. Create .symtab_shndx section if needed.
10275 (Layout::create_shdrs): Add shstrtab_section parameter. Change
10276 caller.
10277 (Layout::allocated_output_section_count): New function.
10278 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
10279 needed.
10280 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
10281 fields. Update declarations.
10282 (Layout::symtab_xindex): New function.
10283 (Layout::dynsym_xindex): New function.
10284 (class Write_symbols_task): Add layout_ field.
10285 (Write_symbols_task::Write_symbols_task): Add layout parameter.
10286 Change caller.
10287 * output.cc (Output_section_headers::Output_section_headers): Add
10288 shstrtab_section parameter. Change all callers.
10289 (Output_section_headers::do_sized_write): Store overflow values
10290 for section count and section string table section index in
10291 section header zero.
10292 (Output_file_header::do_sized_write): Check for overflow of
10293 section count and section string table section index.
10294 (Output_symtab_xindex::do_write): New function.
10295 (Output_symtab_xindex::endian_do_write): New function.
10296 * output.h (class Output_section_headers): Add shstrtab_section_.
10297 Update declarations.
10298 (class Output_symtab_xindex): Define.
10299 (Output_section::has_out_shndx): New function.
10300 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
10301 field.
10302 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
10303 Change all callers.
10304 (Sized_symbol::init): Likewise.
10305 (Symbol::output_section): Check for ordinary symbol.
10306 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
10307 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
10308 callers.
10309 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
10310 Change all callers. Simplify handling of symbols from sections
10311 not included in the link.
10312 (Symbol_table::add_from_dynobj): Handle ordinary symbol
10313 distinction.
10314 (Weak_alias_sorter::operator()): Assert that symbols are
10315 ordinary.
10316 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
10317 distinction.
10318 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
10319 parameters. Change all callers.
10320 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
10321 symbol distinction. Use SHN_XINDEX when needed.
10322 (Symbol_table::write_section_symbol): Add symtab_xindex
10323 parameter. Change all callers.
10324 (Symbol_table::sized_write_section_symbol): Likewise. Use
10325 SHN_XINDEX when needed.
10326 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
10327 declarations.
10328 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
10329 (Symbol::is_defined): Check is_ordinary.
10330 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
10331 (Symbol::is_absolute, Symbol::is_common): Likewise.
10332 (class Sized_symbol): Update declarations.
10333 (class Symbol_table): Update declarations.
10334 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
10335 parameters. Change all callers.
10336 (Sized_symbol::override): Likewise.
10337 (Symbol_table::override): Likewise.
10338 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
10339 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
10340 is_ordinary, and orig_st_shndx parameters. Change all callers.
10341 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
10342 to be in an ordinary section.
10343 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
10344 object and is_ordinary parameters. Change all callers.
10345 (Sized_dwarf_line_info::read_relocs): Add object parameter.
10346 Change all callers. Don't add undefined or non-ordinary symbols
10347 to reloc_map_.
10348 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
10349 Change all callers.
10350 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10351 declarations.
10352 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10353 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10354 (Sized_relobj::relocate_sections): Likewise.
10355 * target-reloc.h (scan_relocs): Adjust section symbol index.
10356 (scan_relocatable_relocs): Likewise.
10357 * i386.cc (Scan::local): Check for ordinary symbols.
10358 * sparc.cc (Scan::local): Likewise.
10359 * x86_64.cc (Scan::local): Likewise.
10360 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10361 to symbol_section_and_value.
10362 * testsuite/many_sections_test.cc: New file.
10363 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10364 (check_PROGRAMS): Add many_sections_test.
10365 (many_sections_test_SOURCES): Define.
10366 (many_sections_test_DEPENDENCIES): Define.
10367 (many_sections_test_LDFLAGS): Define.
10368 (BUILT_SOURCES): Add many_sections_define.h.
10369 (many_sections_define.h): New target.
10370 (BUILT_SOURCES): Add many_sections_check.h.
10371 (many_sections_check.h): New target.
10372 (check_PROGRAMS): Add many_sections_r_test.
10373 (many_sections_r_test_SOURCES): Define.
10374 (many_sections_r_test_DEPENDENCIES): Define.
10375 (many_sections_r_test_LDFLAGS): Define.
10376 (many_sections_r_test_LDADD): Define.
10377 (many_sections_r_test.o): New target.
10378 * testsuite/Makefile.in: Rebuild.
10379
c5818ff1
CC
103802008-04-17 Cary Coutant <ccoutant@google.com>
10381
10382 * errors.cc (Errors::info): New function.
10383 (gold_info): New function.
10384 * errors.h (Errors::info): New function.
10385 * gold.h (gold_info): New function.
10386 * object.cc (Input_objects::add_object): Print trace output.
10387 * options.cc (options::parse_set): New function.
10388 (General_options::parse_wrap): Deleted.
10389 (General_options::General_options): Deleted initializer.
10390 * options.h (options::String_set): New typedef.
10391 (options::parse_set): New function.
10392 (DEFINE_set): New macro.
10393 (General_options::wrap): Changed to use DEFINE_set. Changed
10394 callers of any_wrap_symbols and is_wrap_symbol.
10395 (General_options::trace, General_options::trace_symbol):
10396 New options.
10397 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10398 (General_options::wrap_symbols_): Deleted.
10399 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10400
b5be4a7c
DM
104012008-04-17 David S. Miller <davem@davemloft.net>
10402
10403 * options.cc (General_options::parse_V): New function.
10404 * options.h: Add entries for -V and -Qy.
10405
155a0dd7
ILT
104062008-04-17 Ian Lance Taylor <iant@google.com>
10407
10408 * common.cc (Symbol_table::allocate_commons): Remove options
10409 parameter. Change caller.
10410 (Symbol_table::do_allocate_commons): Remove options parameter.
10411 Change caller. Just call do_allocate_commons_list twice.
10412 (Symbol_table::do_allocate_commons_list): New function, broken out
10413 of do_allocate_commons.
10414 * common.h (class Allocate_commons_task): Remove options_ field.
10415 Update constructor.
10416 * symtab.cc (Symbol_table::Symbol_table): Initialize
10417 tls_commons_.
10418 (Symbol_table::add_from_object): Put TLS common symbols on
10419 tls_commons_ list.
10420 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10421 which are IN_OUTPUT_DATA.
10422 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10423 allocate_commons and do_allocate_commons declarations. Declare
10424 do_allocate_commons_list.
10425 * gold.cc (queue_middle_tasks): Update creation of
10426 Allocate_commons_task to not pass options.
10427 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10428 (TLS_TEST_C_FLAGS): New variable.
10429 (tls_test_c_pic.o): New target.
10430 (tls_test_shared.so): Link in tls_test_c_pic.o.
10431 (tls_test_c_pic_ie.o): New target.
10432 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10433 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10434 (tls_test_c.o): New target.
10435 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10436 (tls_pic_test_LDADD): Likewise.
10437 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10438 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10439 (tls_test_c_gnu2.o): New target.
10440 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10441 tls_test_c_gnu2.o.
10442 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10443 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10444 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10445 * testsuite/tls_test.cc: Include "config.h".
10446 (t_last): Call t11_last.
10447 * testsuite/tls_test.h (t11, t11_last): Declare.
10448 * testsuite/tls_test_c.c: New file.
10449 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10450 * configure.ac: Check for OpenMP support.
10451 * configure, config.in, Makefile.in: Rebuild.
10452 * testsuite/Makefile.in: Rebuild.
10453
edfbb029
CC
104542008-04-16 Cary Coutant <ccoutant@google.com>
10455
10456 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10457 (Target_i386::tls_base_symbol_defined_): New field.
10458 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10459 (Target_i386::Scan::global): Likewise.
10460 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10461 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10462 (Target_x86_64::tls_base_symbol_defined_): New field.
10463 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10464 (Target_x86_64::Scan::global): Likewise.
10465
f3c69fca
CC
104662008-04-16 Cary Coutant <ccoutant@google.com>
10467
10468 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10469 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10470 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10471 building shared libraries.
10472 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10473 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10474 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10475 * testsuite/Makefile.in: Rebuild.
10476 * testsuite/weak_undef.h: New file.
10477 * testsuite/weak_undef_file1.cc: Add extra test cases.
10478 * testsuite/weak_undef_file2.cc: Likewise.
10479 * testsuite/weak_undef_test.cc: Likewise.
10480
7c414435
DM
104812008-04-16 David S. Miller <davem@davemloft.net>
10482
32b769e1
DM
10483 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10484 Add issued_non_pic_error_ field. Declare check_non_pic.
10485 (Target_sparc::Scan::check_non_pic): New function.
10486 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10487 (Target_sparc::Scan::global): Likewise.
10488
11936fb1
DM
10489 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10490 * configure: Rebuild.
10491
7c414435
DM
10492 * options.h (DEFINE_enable): New macro.
10493 (new_dtags): New enable option.
10494 (initfirst, interpose, loadfltr, nodefaultlib,
10495 nodelete, nodlopen, nodump): New -z options.
10496 * layout.cc (Layout:finish_dynamic_section): If new
10497 dtags enabled, emit DT_RUNPATH. Also, emit a
10498 DT_FLAGS_1 containing any specified -z flags.
10499
85c7bf8b
ILT
105002008-04-16 Ian Lance Taylor <iant@google.com>
10501
12c0daef
ILT
10502 * copy-relocs.cc: New file.
10503 * copy-relocs.h: New file.
10504 * reloc.cc: Remove Copy_relocs code.
10505 * reloc.h: Likewise.
10506 * reloc-types.h (struct Reloc_types) [both versions]: Add
10507 get_reloc_addend_noerror.
10508 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10509 variants of add_global which take an addend which must be zero.
10510 * i386.cc: Include "copy-relocs.h".
10511 (class Target_i386): Change type of copy_relocs_ to variable,
10512 update initializer.
10513 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10514 Change all callers.
10515 (Target_i386::do_finalize_sections): Change handling of
10516 copy_relocs_.
10517 * sparc.cc: Include "copy-relocs.h".
10518 (class Target_sparc): Change type of copy_relocs_ to variable,
10519 update initializer.
10520 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10521 Change all callers.
10522 (Target_sparc::do_finalize_sections): Change handling of
10523 copy_relocs_.
10524 * x86_64.cc: Include "copy-relocs.h".
10525 (class Target_x86_64): Change type of copy_relocs_ to variable,
10526 update initializer.
10527 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10528 class. Change all callers.
10529 (Target_x86_64::do_finalize_sections): Change handling of
10530 copy_relocs_.
10531 * Makefile.am (CCFILES): Add copy-relocs.cc.
10532 (HFILES): Add copy-relocs.h.
10533
4f4995b6
ILT
10534 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10535
85c7bf8b
ILT
10536 * testsuite/script_test_4.sh: Permit leading zeroes.
10537
4f2a9edd
ILT
105382008-04-15 Ian Lance Taylor <iant@google.com>
10539
e6188289
ILT
10540 * script-sections.cc (Script_sections::create_segments): Use
10541 header_size_adjustment even when there is enough room for the
10542 headers.
10543 * testsuite/script_test_4.sh: New file.
10544 * testsuite/script_test_4.t: New file.
10545 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10546 (check_DATA): Add script_test_4.stdout.
10547 (MOSTLYCLEANFILES): Likewise.
10548 (script_test_4): New target.
10549 (script_test_4.stdout): New target.
10550 * testsuite/Makefile.in: Rebuild.
10551
4f2a9edd
ILT
10552 * sparc.cc: Add definitions for Output_data_plt_sparc class
10553 constants.
10554
f5314dd5
DM
105552008-04-14 David S. Miller <davem@davemloft.net>
10556
10557 * sparc.cc: New file.
10558 * Makefile.am (TARGETSOURCES): Add sparc.cc
10559 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10560 * configure.tgt: Document targ_extra_size and
10561 targ_extra_big_endian. Add entries for sparc-* and
10562 sparc64-*.
10563 * configure.ac: Handle targ_extra_size and
10564 targ_extra_big_endian.
10565 * Makefile.in: Rebuild.
10566 * configure: Likewise.
10567 * po/POTFILES.in: Likewise.
10568 * po/gold.pot: Likewise.
10569
154e0e9a
ILT
105702008-04-14 Ian Lance Taylor <iant@google.com>
10571
10572 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10573 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10574 in the name/type/flags to section mapping. Don't call
10575 allocate_output_section.
10576 (Layout::choose_output_section): Change parameter from adjust_name
10577 to is_input_section. Don't permit input sections after sections
10578 are attached to segments. Don't call allocate_output_section.
10579 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10580 not write_enable_output_section.
10581 (Layout::make_output_section): Don't push to
10582 unattached_section_list_ nor call attach_to_segment. Call
10583 attach_section_to_segment if sections are attached.
10584 (Layout::attach_sections_to_segments): New function.
10585 (Layout::attach_section_to_segment): New function.
10586 (Layout::attach_allocated_section_to_segment): Rename from
10587 attach_to_segment. Remove flags parameter.
10588 (Layout::allocate_output_section): Remove function.
10589 (Layout::write_enable_output_section): Remove function.
10590 * layout.h (class Layout): Update for above changes. Add new
10591 field sections_are_attached_.
10592 * output.h (Output_section::update_flags_for_input_section): New
10593 function.
10594 * output.cc (Output_section::add_input_section): Call
10595 update_flags_for_input_section.
10596 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10597
009a67a2
CC
105982008-04-11 Cary Coutant <ccoutant@google.com>
10599
10600 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10601 thought unnecessary.
10602 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10603
759b1a24
ILT
106042008-04-11 Ian Lance Taylor <iant@google.com>
10605
10606 * output.h (class Output_section_data): Remove inline definition
10607 of set_addralign.
10608 * output.cc (Output_section_data::set_addralign): New function.
10609
c2b45e22
CC
106102008-04-11 Cary Coutant <ccoutant@google.com>
10611
10612 Add support for TLS descriptors for i386 and x86_64.
10613 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10614 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10615 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10616 GOT_TYPE_TLS_DESC.
10617 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10618 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10619 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10620 relocations.
10621 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10622 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10623 Fix problem with initial-exec relocations.
10624 (Target_i386::Relocate::relocate_tls): Likewise.
10625 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10626 relaxation.
10627 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10628 support for section-plus-offset dynamic table entries.
10629 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10630 (Output_data_dynamic::Dynamic_entry): Add support for
10631 section-plus-offset dynamic table entries.
10632 (Output_data_dynamic::Classification): Likewise.
10633 (Output_data_dynamic::classification_): Renamed offset_.
10634 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10635 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10636 (Target_x86_64::make_plt_section): New function.
10637 (Target_x86_64::reserve_tlsdesc_entries): New function.
10638 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10639 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10640 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10641 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10642 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10643 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10644 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10645 add extra PLT entry for TLS descriptors.
10646 (Output_data_plt_x86_64::got_): New field.
10647 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10648 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10649 fields.
10650 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10651 descriptors.
10652 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10653 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10654 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10655 R_386_TLS_DESC_CALL relocations.
10656 (Target_x86_64::Scan::global): Likewise.
10657 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10658 for TLS descriptors.
10659 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10660 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10661 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10662 GD-to-IE relaxation.
10663 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10664 and TLS_DESCRIPTORS.
10665 * Makefile.in: Rebuild.
10666 * configure: Rebuild.
10667 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10668 (tls_test_shared2.so): New target.
10669 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10670 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10671 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10672 (tls_shared_gd_to_ie_test_LDADD): New variable.
10673 (tls_shared_gnu2_gd_to_ie_test): New target.
10674 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10675 New targets.
10676 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10677 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10678 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10679 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10680 (tls_shared_gnu2_test): New target.
10681 (tls_test_gnu2_shared.so): New target.
10682 (tls_shared_gnu2_test_SOURCES): New variable.
10683 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10684 (tls_shared_gnu2_test_LDFLAGS): New variable.
10685 (tls_shared_gnu2_test_LDADD): New variable.
10686 * testsuite/Makefile.in: Rebuild.
10687 * testsuite/Makefile.
10688
83bfb6b7
ILT
106892008-04-11 Ian Lance Taylor <iant@google.com>
10690
10691 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10692 justsyms.t.
10693 * testsuite/Makefile.in: Rebuild.
10694
10695 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10696 long.
10697 * testsuite/script_test_2.cc (main): Adjust test.
10698
706e1f5e
ILT
106992008-04-11 David S. Miller <davem@davemloft.net>
10700 Ian Lance Taylor <iant@google.com>
10701
10702 * options.h (General_options): Add entries for '-Y' and
10703 '-relax'.
10704 * options.cc (General_options:finalize): If -Y was used, add those
10705 entries to the library path instead of the default "/lib" and
10706 "/usr/lib".
10707
7c98e6bb
DM
107082008-04-11 David S. Miller <davem@davemloft.net>
10709
10710 * testsuite/justsyms.t: Start at 0x100.
10711 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10712 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10713 long.
10714 * testsuite/script_test_2.cc: Adjust string and section length
10715 checks.
7c98e6bb 10716
99a37bfd
ILT
107172008-04-09 Ian Lance Taylor <iant@google.com>
10718
2cefc357
ILT
10719 PR gold/5996
10720 * script-sections.cc (Sections_element::allocate_to_segment): Add
10721 orphan parameter.
10722 (Output_section_definition::allocate_to_segment): Likewise.
10723 (Orphan_output_section::allocate_to_segment): Likewise.
10724 (Script_sections::attach_sections_using_phdrs_clause): Don't
10725 propagate non-PT_LOAD segments to orphan sections.
10726 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10727 readelf rather than objdump.
10728 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10729 .interp section and PT_INTERP segment are the same size.
10730 * testsuite/Makefile.in: Rebuild.
10731
99a37bfd
ILT
10732 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10733 aliases for symbols defined in the same object.
10734 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10735 (weak_alias_test_SOURCES): New variable.
10736 (weak_alias_test_DEPENDENCIES): New variable.
10737 (weak_alias_test_LDFLAGS): New variable.
10738 (weak_alias_test_LDADD): New variable.
10739 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10740 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10741 (weak_alias_test_3.o): New target.
10742 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10743 * testsuite/weak_alias_test_main.cc: New file.
10744 * testsuite/weak_alias_test_1.cc: New file.
10745 * testsuite/weak_alias_test_2.cc: New file.
10746 * testsuite/weak_alias_test_3.cc: New file.
10747
780e49c5
ILT
107482008-04-08 Ian Lance Taylor <iant@google.com>
10749
cdb0b8f5
ILT
10750 * options.h (class General_options): Add --noinhibit-exec option.
10751 * main.cc (main): Check --noinhibit-exec.
10752
0864d551
ILT
10753 * options.h (class General_options): Define --wrap as a special
10754 option. Add wrap_symbols_ field.
10755 (General_options::any_wrap_symbols): New function.
10756 (General_options::is_wrap_symbol): New function.
10757 * options.cc (General_options::parse_wrap): New function.
10758 (General_options::General_options): Initialize wrap_symbols_.
10759 * symtab.cc (Symbol_table::wrap_symbol): New function.
10760 (Symbol_table::add_from_object): Handle --wrap.
10761 * symtab.h (class Symbol_table): Declare wrap_symbol.
10762 * target.h (Target::wrap_char): New function.
10763 (Target::Target_info): Add wrap_char field.
10764 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10765 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10766 * testsuite/testfile.cc (Target_test::test_target_info):
10767 Likewise.
10768
789aa6de
ILT
10769 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10770 there is one.
10771
2c38906f
ILT
10772 * layout.h (class Layout): Add added_eh_frame_data_ field.
10773 * layout.cc (Layout::Layout): Initialize new field.
10774 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10775 output section until we find a section we merged successfully.
10776 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10777 that the size be non-zero.
10778
780e49c5
ILT
10779 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10780 qualifier.
10781
7fcd0256
ILT
107822008-04-08 Craig Silverstein <csilvers@google.com>
10783
10784 * configure.ac: Export new conditional variable HAVE_ZLIB.
10785 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10786 on HAVE_ZLIB.
10787 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10788 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10789
6835af53
ILT
107902008-04-07 Ian Lance Taylor <iant@google.com>
10791
e24f324c
ILT
10792 * version.cc (version_string): Set to "1.5".
10793
a036edd8
ILT
10794 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10795 Add issued_non_pic_error_ field. Declare check_non_pic.
10796 (Target_x86_64::Scan::check_non_pic): New function.
10797 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10798 (Target_x86_64::Scan::global): Likewise.
10799
624f8810
ILT
10800 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10801 addend parameter. Change caller. Handle merge sections.
10802 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10803 Address to Addend. Don't add in the result of
10804 local_section_offset, pass down the addend and use the returned
10805 value.
10806 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10807 Update declarations of local_section_offset and symbol_value.
10808 * testsuite/two_file_test_1.cc (t18): New function.
10809 * testsuite/two_file_test_2.cc (f18): New function.
10810 * testsuite/two_file_test_main.cc (main): Call t18.
10811 * testsuite/two_file_test.h (t18, f18): Declare.
10812
6835af53
ILT
10813 * configure.ac: Don't test for objdump, c++filt, or readelf.
10814 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10815 conditionals.
10816 (TEST_READELF): New variable.
10817 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10818 (check_PROGRAMS): Add two_file_strip_test.
10819 (two_file_strip_test): New target.
10820 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10821 (two_file_same_shared_strip_test_SOURCES): New variable.
10822 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10823 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10824 (two_file_same_shared_strip_test_LDADD): New variable.
10825 (two_file_shared_strip.so): New target.
10826 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10827 (ver_test_5.syms, ver_test_7.syms): Likewise.
10828 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10829 (strip_test_3.stdout): Use TEST_OBJDUMP.
10830 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10831
86925eef
CC
108322008-04-04 Cary Coutant <ccoutant@google.com>
10833
10834 * symtab.h (Symbol::is_weak_undefined): New function.
10835 (Symbol::is_strong_undefined): New function.
10836 (Symbol::is_absolute): New function.
10837 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10838 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10839 absolute symbols.
10840 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10841 (weak_undef_test): New target.
10842 * testsuite/Makefile.in: Rebuild.
10843 * testsuite/weak_undef_file1.cc: New file.
10844 * testsuite/weak_undef_file2.cc: New file.
10845 * testsuite/weak_undef_test.cc: New file.
10846
126f3ece
ILT
108472008-04-03 Craig Silverstein <csilvers@google.com>
10848
10849 * compressed_output.h (class Output_compressed_section): Use
10850 unsigned buffer.
10851 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10852 add zlib header.
10853 (zlib_compressed_suffix): Removed.
10854 (Output_compressed_section::set_final_data_size): Use unsigned
10855 buffers.
10856 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10857 Fix linker invocation.
10858 (flagstest_o_specialfile_and_compress_debug_sections):
10859 Likewise.
10860 * testsuite/Makefile.in: Regenerated.
10861
deae2a14
DM
108622008-04-02 David S. Miller <davem@davemloft.net>
10863
10864 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10865 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10866
70752818
ILT
108672008-04-02 Craig Silverstein <csilvers@google.com>
10868
10869 * TODO: New file.
10870
39d0cb0e
ILT
108712008-04-02 Ian Lance Taylor <iant@google.com>
10872
10873 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10874 parameters. Update for new key type to views_. Change all
10875 callers.
10876 (File_read::read): Adjust for byteshift in returned view.
10877 (File_read::add_view): New function, broken out of
10878 find_and_make_view.
10879 (File_read::make_view): New function, broken out of
10880 find_and_make_view.
10881 (File_read::find_or_make_view): Add offset and aligned
10882 parameters. Rewrite accordingly. Change all callers.
10883 (File_read::get_view): Add offset and aligned parameters. Adjust
10884 for byteshift in return value.
10885 (File_read::get_lasting_view): Likewise.
10886 * fileread.h (class File_read): Update declarations.
10887 (class File_read::View): Add byteshift_ field. Add byteshift to
10888 constructor. Add byteshift method.
10889 * archive.h (Archive::clear_uncached_views): New function.
10890 (Archive::get_view): Add aligned parameter. Change all callers.
10891 * object.h (Object::get_view): Add aligned parameter. Change all
10892 callers.
10893 (Object::get_lasting_view): Likewise.
10894
10895 * fileread.cc (File_read::release): Don't call clear_views if
10896 there are multiple objects.
10897 * fileread.h (File_read::clear_uncached_views): New function.
10898 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10899 on the archive.
10900
a1207466
CC
109012008-03-31 Cary Coutant <ccoutant@google.com>
10902
10903 Add thin archive support.
10904 * archive.cc (Archive::armagt): New const.
10905 (Archive::setup): Remove task parameter and calls to unlock.
10906 (Archive::unlock_nested_archives): New function.
10907 (Archive::read_header): Add nested_off parameter. Change
10908 all callers.
10909 (Archive::interpret_header): Likewise.
10910 (Archive::include_all_members): Change to handle thin
10911 archives.
10912 (Archive::include_member): Likewise.
10913 * archive.h (Archive::Archive): Add new parameters and
10914 initializers.
10915 (Archive::armagt): New const.
10916 (Archive::setup): Remove task parameter.
10917 (Archive::unlock_nested_archives): New function.
10918 (Archive::read_header): Add nested_off parameter.
10919 (Archive::interpret_header): Likewise.
10920 (Archive::Nested_archive_table): New typedef.
10921 (Archive::is_thin_archive_): New field.
10922 (Archive::nested_archives_): New field.
10923 (Archive::options_): New field.
10924 (Archive::dirpath_): New field.
10925 (Archive::task_): New field.
10926 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10927 for thin archives. Pass additional parameters to
10928 Archive::Archive. Unlock the archive file after calling
10929 Archive::setup.
cd536b21 10930
479f6503
ILT
109312008-03-29 Ian Lance Taylor <iant@google.com>
10932
686c8caf
ILT
10933 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10934 version symbol to be local.
10935 * testsuite/ver_test_4.sh: New file.
10936 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10937 (check_DATA): Add ver_test_4.syms.
10938 (ver_test_4.syms): New target.
10939 * testsuite/Makefile.in: Rebuild.
10940
ab794b6b
ILT
10941 * output.cc
10942 (Output_section::Input_section_sort_entry::has_priority): New
10943 function.
10944 (Output_section::Input_section_sort_entry::match_file_name): New
10945 function.
10946 (Output_section::Input_section_sort_entry::match_section_name):
10947 Remove.
10948 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10949 Remove.
10950 (Output_section::Input_section_sort_entry::match_section_file):
10951 Remove.
10952 (Output_section::Input_section_sort_compare::operator()): Rewrite
10953 using new Input_section_sort_entry functions. Sort crtbegin and
10954 crtend first. Sort sections with no priority before sections with
10955 a priority.
10956 * testsuite/initpri1.c (d3): Check j != 4.
10957 (cd5): New constructor/destructor function.
10958 (main): Check j != 2.
10959
479f6503
ILT
10960 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10961 new symbol when resolving, don't call set_is_default.
10962 * testsuite/ver_test_7.cc: New file.
10963 * testsuite/ver_test_7.sh: New file.
10964 * testsuite/Makefile.am (ver_test_7.so): New target.
10965 (ver_test_7.o): New target.
10966 (check_SCRIPTS): Add ver_test_7.sh.
10967 (check_DATA): Add ver_test_7.syms.
10968 (ver_test_7.syms): New target.
10969
2fd32231
ILT
109702008-03-28 Ian Lance Taylor <iant@google.com>
10971
10972 * layout.cc (Layout::layout): If we see an input section with a
10973 name that needs sorting, set the must_sort flag for the output
10974 section.
10975 (Layout::make_output_section): If the name of the output section
10976 indicates that it might require sorting, set the may_sort flag.
10977 * output.h (Output_section::may_sort_attached_input_sections): New
10978 function.
10979 (Output_section::set_may_sort_attached_input_sections): New
10980 function.
10981 (Output_section::must_sort_attached_input_sections): New
10982 function.
10983 (Output_section::set_must_sort_attached_input_sections): New
10984 function.
10985 (class Output_section): Declare Input_section_sort_entry. Define
10986 Input_section_sort_compare. Declare
10987 sort_attached_input_sections. Add new fields:
10988 may_sort_attached_input_sections_,
10989 must_sort_attached_input_sections_,
10990 attached_input_sections_are_sorted_.
10991 * output.cc (Output_section::Output_section): Initialize new
10992 fields.
10993 (Output_section::add_input_section): Add an entry to
10994 input_sections_ if may_sort or must_sort are true.
10995 (Output_section::set_final_data_size): Call
10996 sort_attached_input_sections if necessary.
10997 (Output_section::Input_section_sort_entry): Define new class.
10998 (Output_section::Input_section_sort_compare::operator()): New
10999 function.
11000 (Output_section::sort_attached_input_sections): New function.
11001 * configure.ac: Check whether the compiler supports constructor
11002 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11003 * testsuite/initpri1.c: New file.
11004 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11005 CONSTRUCTOR_PRIORITY.
11006 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11007 (initpri1_LDFLAGS): New variable.
11008 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11009
18e6b24e
ILT
110102008-03-27 Ian Lance Taylor <iant@google.com>
11011
49bdd526
ILT
11012 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11013 * testsuite/common_test_1.c: New file.
11014 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11015 (common_test_1_SOURCES): New variable.
11016 (common_test_1_DEPENDENCIES): New variable.
11017 (common_test_1_LDFLAGS): New variable.
11018
18e6b24e
ILT
11019 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11020 and commons_ correctly when NAME/VERSION does not override
11021 NAME/NULL.
11022 * testsuite/ver_test_6.c: New file.
11023 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11024 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11025 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11026
04bf7072
ILT
110272008-03-26 Ian Lance Taylor <iant@google.com>
11028
5871526f
ILT
11029 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11030 of an undefined symbol from a version script.
11031 * testsuite/Makefile.am (ver_test_5.so): New target.
11032 (ver_test_5.o): New target.
11033 (check_SCRIPTS): Add ver_test_5.sh.
11034 (check_DATA): Add ver_test_5.syms.
11035 (ver_test_5.syms): New target.
11036 * testsuite/ver_test_5.cc: New file.
11037 * testsuite/ver_test_5.script: New file.
11038 * testsuite/ver_test_5.sh: New file.
11039 * Makefile.in, testsuite/Makefile.in: Rebuild.
11040
04bf7072
ILT
11041 PR gold/5986
11042 Fix problems building gold with gcc 4.3.0.
11043 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11044 (gold_error_at_location, gold_warning_at_location): Use it.
11045 * configure.ac: Check whether we can compile and use a template
11046 function with a printf attribute.
11047 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11048 when jumping over bytes.
11049 * object.cc: Instantiate Object::read_section_data.
11050 * debug.h: Include <cstring>
11051 * dwarf_reader.cc: Include <algorithm>
11052 * main.cc: Include <cstring>.
11053 * options.cc: Include <cstring>.
11054 * output.cc: Include <cstring>.
11055 * script.cc: Include <cstring>.
11056 * script.h: Include <string>.
11057 * symtab.cc: Include <cstring> and <algorithm>.
11058 * target-select.cc: Include <cstring>.
11059 * version.cc: Include <string>.
11060 * testsuite/testmain.cc: Include <cstdlib>.
11061 * configure, config.in: Rebuild.
11062
874c5b28
ILT
110632008-03-25 Ian Lance Taylor <iant@google.com>
11064
819d6c3a
ILT
11065 * options.cc: Include "../bfd/bfdver.h".
11066 (options::help): Print bug reporting address.
11067
f4b2c6f5
ILT
11068 * version.cc (print_version): Adjust output for current value of
11069 BFD_VERSION_STRING.
11070
11071 * NEWS: New file.
11072
e96caa79
ILT
11073 * options.cc (options::help): Print list of supported targets.
11074 * target-select.h: Include <vector>.
11075 (class Target_selector): Make machine_, size_, and is_big_endian_
11076 fields const. Add bfd_name_ and instantiated_target_ fields.
11077 (Target_selector::Target_selector): Add bfd_name parameter.
11078 (Target_selector::recognize): Make non-virtual, call
11079 do_recognize.
11080 (Target_selector::recognize_by_name): Make non-virtual, call
11081 do_recognize_by_name.
11082 (Target_selector::supported_names): New function.
11083 (Target_selector::bfd_name): New function.
11084 (Target_selector::do_instantiate_target): New pure virtual
11085 function.
11086 (Target_selector::do_recognize): New virtual function.
11087 (Target_selector::do_recognize_by_name): New virtual function.
11088 (Target_selector::instantiate_target): New private function.
11089 (supported_target_names): Declare.
11090 * target-select.cc (Target_selector::Target_selector): Update for
11091 new parameter and fields.
11092 (select_target_by_name): Check that the name matches before
11093 calling recognize_by_name.
11094 (supported_target_names): New function.
11095 * i386.cc (class Target_selector_i386): Update Target_selector
11096 constructor call. Remove recognize and recognize_by_name. Add
11097 do_instantiate_target.
11098 * x86_64.cc (class Target_selector_x86_64): Likewise.
11099 * testsuite/testfile.cc (class Target_selector_test): Update for
11100 changes to Target_selector.
11101
874c5b28
ILT
11102 * README: Rewrite, with some notes on unsupported features.
11103
0a65a3a7
CC
111042008-03-24 Cary Coutant <ccoutant@google.com>
11105
11106 * i386.cc (Target_i386::Got_type): New enum declaration.
11107 (Target_i386::Scan::local): Updated callers of Output_data_got
11108 member functions.
11109 (Target_i386::Scan::global): Likewise.
11110 (Target_i386::Relocate::relocate): Likewise.
11111 (Target_i386::Relocate::relocate_tls): Likewise.
11112 * object.h (Got_offset_list): New class.
11113 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11114 (Sized_relobj::local_got_offset): Likewise.
11115 (Sized_relobj::set_local_got_offset): Likewise.
11116 (Sized_relobj::local_has_tls_got_offset): Removed.
11117 (Sized_relobj::local_tls_got_offset): Removed.
11118 (Sized_relobj::set_local_tls_got_offset): Removed.
11119 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11120 * output.cc (Output_data_got::add_global): Added got_type parameter.
11121 (Output_data_got::add_global_with_rel): Likewise.
11122 (Output_data_got::add_global_with_rela): Likewise.
11123 (Output_data_got::add_global_pair_with_rel): New function.
11124 (Output_data_got::add_global_pair_with_rela): New function.
11125 (Output_data_got::add_local): Added got_type parameter.
11126 (Output_data_got::add_local_with_rel): Likewise.
11127 (Output_data_got::add_local_with_rela): Likewise.
11128 (Output_data_got::add_local_pair_with_rel): New function.
11129 (Output_data_got::add_local_pair_with_rela): New function.
11130 (Output_data_got::add_global_tls): Removed.
11131 (Output_data_got::add_global_tls_with_rel): Removed.
11132 (Output_data_got::add_global_tls_with_rela): Removed.
11133 (Output_data_got::add_local_tls): Removed.
11134 (Output_data_got::add_local_tls_with_rel): Removed.
11135 (Output_data_got::add_local_tls_with_rela): Removed.
11136 * output.h (Output_data_got::add_global): Added got_type parameter.
11137 (Output_data_got::add_global_with_rel): Likewise.
11138 (Output_data_got::add_global_with_rela): Likewise.
11139 (Output_data_got::add_global_pair_with_rel): New function.
11140 (Output_data_got::add_global_pair_with_rela): New function.
11141 (Output_data_got::add_local): Added got_type parameter.
11142 (Output_data_got::add_local_with_rel): Likewise.
11143 (Output_data_got::add_local_with_rela): Likewise.
11144 (Output_data_got::add_local_pair_with_rel): New function.
11145 (Output_data_got::add_local_pair_with_rela): New function.
11146 (Output_data_got::add_global_tls): Removed.
11147 (Output_data_got::add_global_tls_with_rel): Removed.
11148 (Output_data_got::add_global_tls_with_rela): Removed.
11149 (Output_data_got::add_local_tls): Removed.
11150 (Output_data_got::add_local_tls_with_rel): Removed.
11151 (Output_data_got::add_local_tls_with_rela): Removed.
11152 * resolve.cc (Symbol::override_base_with_special): Removed
11153 reference to has_got_offset_ field.
11154 * symtab.cc (Symbol::init_fields): Replaced initialization
11155 of got_offset_ with got_offsets_. Removed initialization
11156 of has_got_offset_
53fcba31 11157 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11158 (Symbol::got_offset): Likewise.
11159 (Symbol::set_got_offset): Likewise.
11160 (Symbol::has_tls_got_offset): Removed.
11161 (Symbol::tls_got_offset): Removed.
11162 (Symbol::set_tls_got_offset): Removed.
11163 (Symbol::got_offset_): Removed.
11164 (Symbol::tls_mod_got_offset_): Removed.
11165 (Symbol::tls_pair_got_offset_): Removed.
11166 (Symbol::got_offsets_): New field.
11167 (Symbol::has_got_offset): Removed.
11168 (Symbol::has_tls_mod_got_offset): Removed.
11169 (Symbol::has_tls_pair_got_offset): Removed.
11170 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11171 (Target_x86_64::Scan::local): Updated callers of Output_data_got
11172 member functions.
11173 (Target_x86_64::Scan::global): Likewise.
11174 (Target_x86_64::Relocate::relocate): Likewise.
11175 (Target_x86_64::Relocate::relocate_tls): Likewise.
11176
bd52eafb
BE
111772008-03-25 Ben Elliston <bje@au.ibm.com>
11178
11179 * yyscript.y: Fix spelling error in comment.
11180
8b105e34
ILT
111812008-03-24 Ian Lance Taylor <iant@google.com>
11182
8ed814a9
ILT
11183 * options.h (class General_options): Define build_id option.
11184 * layout.h (class Layout): Declare write_build_id, create_note,
11185 create_build_id. Add build_id_note_ member.
11186 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
11187 "libiberty.h", "md5.h", "sha1.h".
11188 (Layout::Layout): Initialize eh_frame_data_,
11189 eh_frame_hdr_section_, and build_id_note_.
11190 (Layout::finalize): Call create_build_id.
11191 (Layout::create_note): New function, broken out of
11192 Layout::create_gold_note.
11193 (Layout::create_gold_note): Call create_note.
11194 (Layout::create_build_id): New function.
11195 (Layout::write_build_id): New function.
11196 (Close_task_runner::run): Call write_build_id.
11197
8b105e34
ILT
11198 * x86_64.cc: Correct license to GPLv3.
11199
086a1841
ILT
112002008-03-23 Ian Lance Taylor <iant@google.com>
11201
11202 * options.cc: Include "demangle.h".
11203 (parse_optional_string): New function.
11204 (parse_long_option): Handle takes_optional_argument.
11205 (parse_short_option): Update dash_z initializer. Handle
11206 takes_optional_argument.
11207 (General_options::General_options): Initialize do_demangle_.
11208 (General_options::finalize): Set do_demangle_. Handle demangling
11209 style.
11210 * options.h (parse_optional_string): Declare.
11211 (struct One_option): Add optional_arg field. Update constructor.
11212 Update call constructor calls. Add takes_optional_argument
11213 function.
11214 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
11215 (DEFINE_optional_string): Define.
11216 (General_options::demangle): Change from DEFINE_bool to
11217 DEFINE_optional_string.
11218 (General_options::no_demangle): New function.
11219 (General_options::do_demangle): New function.
11220 (General_options::set_do_demangle): New function.
11221 (General_options::execstack_status_): Move definition to end of
11222 class definition.
11223 (General_options::static_): Likewise.
11224 (General_options::do_demangle_): New field.
11225 * object.cc (big_endian>::get_symbol_location_info): Call
11226 Options::do_demangle, not Options::demangle.
11227 * symtab.cc (demangle): Likewise.
11228
cbb93e63
ILT
112292008-03-22 Ian Lance Taylor <iant@google.com>
11230
11231 * gold.h: Include <cstddef> and <sys/types.h>
11232 * options.h: Include <cstring>.
11233
ec531623
ILT
112342008-03-21 Ian Lance Taylor <iant@google.com>
11235
11236 * Added source code to GNU binutils.
This page took 0.72859 seconds and 4 git commands to generate.