]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gold/ChangeLog
* target.h (Target::can_check_for_function_pointers): Rewrite.
[thirdparty/binutils-gdb.git] / gold / ChangeLog
CommitLineData
b3ce541e
ILT
12011-06-28 Ian Lance Taylor <iant@google.com>
2
3 * target.h (Target::can_check_for_function_pointers): Rewrite.
4 Make non-virtual.
5 (Target::can_icf_inline_merge_sections): Likewise.
6 (Target::section_may_have_icf_unsafe_poineters): Likewise.
7 (Target::Target_info): Add can_icf_inline_merge_sections field.
8 (Target::do_can_check_for_function_pointers): New virtual
9 function.
10 (Target::do_section_may_have_icf_unsafe_pointers): Likewise.
11 * arm.cc (Target_arm::do_can_check_for_function_pointers): Rename
12 from can_check_for_function_pointers, move in file.
13 (Target_arm::do_section_may_have_icf_unsafe_pointers): Rename from
14 section_may_have_icf_unsafe_poineters, move in file.
15 (Target_arm::arm_info): Initialize can_icf_inline_merge_sections.
16 * i386.cc (Target_i386::do_can_check_for_function_pointers):
17 Rename from can_check_for_function_pointers, move in file.
18 (Target_i386::can_icf_inline_merge_sections): Remove.
19 (Target_i386::i386_info): Initialize
20 can_icf_inline_merge_sections.
21 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
22 Initialize can_icf_inline_merge_sections.
23 * sparc.cc (Target_sparc::sparc_info) [both version]: Likewise.
24 * x86_64.cc (Target_x86_64::do_can_check_for_function_pointers):
25 Rename from can_check_for_function_pointers, move in file.
26 (Target_x86_64::can_icf_inline_merge_sections): Remove.
27 (Target_x86_64::x86_64_info): Initialize
28 can_icf_inline_merge_sections.
29 * testsuite/testfile.cc (Target_test::test_target_info):
30 Likewise.
31 * icf.cc (get_section_contents): Correct formatting.
32
6d1c4efb
ILT
332011-06-27 Ian Lance Taylor <iant@google.com>
34
35 * symtab.cc (Symbol::versioned_name): New function.
36 (Symbol_table::add_to_final_symtab): Use versioned_name when
37 appropriate.
38 (Symbol_table::sized_write_symbol): Likewise.
39 * symtab.h (class Symbol): Declare versioned_name.
40 * stringpool.h (class Stringpool_template): Add variant of add
41 which takes a std::basic_string.
42 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_12.
43 (ver_test_12_SOURCES, ver_test_12_DEPENDENCIES): New variables.
44 (ver_test_12_LDFLAGS, ver_test_12_LDADD): New variables.
45 (ver_test_12.o): New target.
46 * testsuite/Makefile.in: Rebuild.
47
57eb9b50
DK
482011-06-27 Doug Kwan <dougkwan@google.com>
49
50 * arm.cc (Arm_relocate_functions::thm_jump8,
51 Arm_relocate_functions::thm_jump11): Use a wider signed
52 type to compute offset.
53 * testsuite/Makefile.am: Add new tests arm_thm_jump11 and
54 arm_thm_jump8.
55 * testsuite/Makefile.in: Regenerate.
56 * testsuite/arm_branch_in_range.sh: Check test results of
57 arm_thm_jump11 and arm_thm_jump8.
58 * testsuite/arm_thm_jump11.s: New test source file.
59 * testsuite/arm_thm_jump11.t: New linker script.
60 * testsuite/arm_thm_jump8.s: New test source file.
61 * testsuite/arm_thm_jump8.t: New linker script.
62
487b39df
ILT
632011-06-24 Ian Lance Taylor <iant@google.com>
64
65 * layout.cc: Include "object.h".
66 (ctors_sections_in_init_array): New static variable.
67 (Layout::is_ctors_in_init_array): New function.
68 (Layout::layout): Add entry to ctors_sections_in_init_array if
69 appropriate.
70 * layout.h (class Layout): Declare is_ctors_in_init_array.
71 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
72 is_ctors_reverse_view is set.
73 (Sized_relobj_file::write_sections): Add layout parameter. Change
74 all callers. Set is_ctors_reverse_view field of View_size.
75 (Sized_relobj_file::reverse_words): New function.
76 * object.h (Sized_relobj_file::View_size): Add
77 is_ctors_reverse_view field.
78 (class Sized_relobj_file): Update declarations.
79 * testsuite/initpri3.c: New test.
80 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
81 initpri3b.
82 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
83 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
84 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
85 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
86 * testsuite/Makefile.in: Rebuild.
87
472076e4
CC
882011-06-24 Cary Coutant <ccoutant@google.com>
89
90 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
91 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
92 (debug_msg_cdebug.err): New targets.
93 * testsuite/Makefile.in: Regenerate.
94 * testsuite/debug_msg.sh: Check output of link with compressed debug.
95 Fix checks for link with shared library.
96
a60af0db
DK
972011-06-24 Doug Kwan <dougkwan@google.com>
98
99 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
100 skip empty text sections.
101 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
102
5393d741
ILT
1032011-06-22 Ian Lance Taylor <iant@google.com>
104
105 PR gold/12910
106 * options.h (class General_options): Add --ctors-in-init-array.
107 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
108 friends as SHT_PROGBITS for merging sections.
109 (Layout::layout): Remove special handling of .init_array and
110 friends. Don't sort if doing relocatable link. Sort for .ctors
111 and .dtors if ctors_in_init_array.
112 (Layout::make_output_section): Force correct section types for
113 .init_array and friends. Don't sort if doing relocatable link,
114 Don't sort .ctors and .dtors if ctors_in_init_array.
115 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
116 (Layout::output_section_name): Add relobj parameter. Change all
117 callers. Handle .ctors. and .dtors. in code rather than table.
118 Handle .ctors and .dtors if ctors_in_init_array.
119 (Layout::match_file_name): New function, moved from output.cc.
120 * layout.h (class Layout): Update declarations.
121 * output.cc: Include "layout.h".
122 (Input_section_sort_entry::get_priority): New function.
123 (Input_section_sort_entry::match_file_name): Just call
124 Layout::match_file_name.
125 (Output_section::Input_section_sort_init_fini_compare::operator()):
126 Handle .ctors and .dtors. Sort by explicit priority rather than
127 by name.
128 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
129 * testsuite/initpri2.c: New test.
130 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
131 (check_PROGRAMS): Add initpri2.
132 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
133 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
134 * configure, testsuite/Makefile.in: Rebuild.
135
e1f74f98
ILT
1362011-06-19 Ian Lance Taylor <iant@google.com>
137
138 PR gold/12880
139 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
140 .interp section to a PT_INTERP segment even if we have seen a
141 --dynamic-linker option. Don't do it if we have seen a PHDRS
142 clause in a linker script.
143 (Layout::finalize): Don't create a .interp section if we've
144 already create a PT_INTERP segment.
145 (Layout::create_interp): Always call choose_output_section (revert
146 patch of 2011-06-17). Don't create PT_INTERP segment.
147 * script-sections.cc
148 (Script_sections::create_note_and_tls_segments): Add a .interp
149 section to a PT_INTERP segment even if we have seen a
150 --dynamic-linker option.
151
766f91bb
ILT
1522011-06-18 Ian Lance Taylor <iant@google.com>
153
154 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
155 merely because a non-PT_LOAD segment has a dynamic reloc.
156
0d212c3a
ILT
1572011-06-18 Ian Lance Taylor <iant@google.com>
158
159 * layout.cc (Layout::finish_dynamic_section): Don't create
160 DT_FLAGS entry if not needed.
161
911a5072
ILT
1622011-06-18 Ian Lance Taylor <iant@google.com>
163
164 PR gold/12745
165 * layout.cc (Layout::layout_eh_frame): Correct handling of
166 writable .eh_frame section.
167
534b4e5f
ILT
1682011-06-17 Ian Lance Taylor <iant@google.com>
169
170 PR gold/12893
171 * resolve.cc (Symbol_table::resolve): Don't give an error if a
172 symbol is redefined with the exact same object and value.
173
10b4f102
ILT
1742011-06-17 Ian Lance Taylor <iant@google.com>
175
176 PR gold/12880
177 * layout.h (class Layout): Add interp_segment_ field.
178 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
179 (Layout::attach_allocated_section_to_segment): If making shared
180 library, put .interp section in PT_INTERP segment.
181 (Layout::finalize): Also call create_interp if -dynamic-linker
182 option was used.
183 (Layout::create_interp): Assert that there is no PT_INTERP
184 segment. If not using a SECTIONS clause, use make_output_section.
185 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
186 * script-sections.cc
187 (Script_sections::create_note_and_tls_segments): If making shared
188 library, put .interp section in PT_INTERP segment.
189
a29b0dad
ILT
1902011-06-17 Ian Lance Taylor <iant@google.com>
191
e588ea8d
ILT
192 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
193 when making a shared library.
194
1952011-06-17 Ian Lance Taylor <iant@google.com>
196
197 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
198 parameter. Change all callers. Don't issue warning about PC32
199 against locally defined symbol.
a29b0dad 200
9d3b0698
ILT
2012011-06-16 Ian Lance Taylor <iant@google.com>
202
203 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
204 occurs in same object.
205
85b0f90c
AM
2062011-06-14 Alan Modra <amodra@gmail.com>
207
208 * po/POTFILES.in: Regenerate.
209
a94907d9
ILT
2102011-06-09 Ian Lance Taylor <iant@google.com>
211
212 * script-sections.cc
213 (Orphan_output_section::set_section_addresses): For a relocatable
214 link set address to 0.
215
4fb3a1c3
CC
2162011-06-09 Cary Coutant <ccoutant@google.com>
217
218 PR gold/12804
219 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
220 used with --compress-debug-sections.
221 * gold/object.cc (Sized_relobj_file::do_layout): Report
222 uncompressed size of compressed input sections.
223
61220854
CC
2242011-06-08 Cary Coutant <ccoutant@google.com>
225
226 PR gold/12804
227 * testsuite/two_file_test_2_v1.cc: Change initialization of
228 v2 to keep it in .data.
229
e6455dfb
CC
2302011-06-07 Cary Coutant <ccoutant@google.com>
231
232 * common.cc (Symbol_table::do_allocate_commons_list): Call
233 gold_fallback.
234 * errors.cc (Errors::fatal): Adjust call to gold_exit.
235 (Errors::fallback): New function.
236 (gold_fallback): New function.
237 * errors.h (Errors::fallback): New function.
238 * gold.cc (gold_exit): Change status parameter to enum; adjust
239 all callers.
240 (queue_initial_tasks): Call gold_fallback.
241 * gold.h: Include cstdlib.
242 (Exit_status): New enum type.
243 (gold_exit): Change status parameter to enum.
244 (gold_fallback): New function.
245 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
246 (Layout::create_symtab_sections): Likewise.
247 (Layout::create_shdrs): Likewise.
248 * main.cc (main): Adjust call to gold_exit.
249 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
250 (Output_data_got::add_got_entry_pair): Likewise.
251 (Output_section::add_input_section): Likewise.
252 (Output_section::add_output_section_data): Likewise.
253 (Output_segment::set_section_list_addresses): Likewise.
254 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
255
fb0e076f
CC
2562011-06-07 Cary Coutant <ccoutant@google.com>
257
258 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
259 for incremental links.
260 * output.cc (Output_segment::set_section_list_addresses): Remove
261 FIXME and test for TLS or BSS.
262
a5ee4d5d
CC
2632011-06-07 Cary Coutant <ccoutant@google.com>
264
265 * testsuite/Makefile.am: Add incremental_copy_test,
266 incremental_common_test_1.
267 * testsuite/Makefile.in: Regenerate.
268 * testsuite/common_test_1_v1.c: New source file.
269 * testsuite/common_test_1_v2.c: New source file.
270 * testsuite/copy_test_v1.cc: New source file.
271
5146f448
CC
2722011-06-07 Cary Coutant <ccoutant@google.com>
273
274 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
275 update, allocate common from bss section's free list.
276 * incremental-dump.cc (dump_incremental_inputs): Print flag for
277 linker-defined symbols.
278 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
279 Skip GOT and PLT entries that are no longer referenced.
280 (Output_section_incremental_inputs::write_info_blocks): Mark
281 linker-defined symbols.
282 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
283 * output.cc (Output_section::allocate): New function.
284 * output.h (Output_section::allocate): New function.
285 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
286 linker-defined symbols.
287 (Symbol::override_base_with_special): Copy is_predefined_ flag.
288 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
289 (Symbol::init_base_output_data): Likewise.
290 (Symbol::init_base_output_segment): Likewise.
291 (Symbol::init_base_constant): Likewise.
292 (Sized_symbol::init_output_data): Likewise.
293 (Sized_symbol::init_output_segment): Likewise.
294 (Sized_symbol::init_constant): Likewise.
295 (Symbol_table::do_define_in_output_data): Likewise.
296 (Symbol_table::do_define_in_output_segment): Likewise.
297 (Symbol_table::do_define_as_constant): Likewise.
298 * symtab.h (Symbol::is_predefined): New function.
299 (Symbol::init_base_output_data): Add is_predefined parameter.
300 (Symbol::init_base_output_segment): Likewise.
301 (Symbol::init_base_constant): Likewise.
302 (Symbol::is_predefined_): New data member.
303 (Sized_symbol::init_output_data): Add is_predefined parameter.
304 (Sized_symbol::init_output_segment): Likewise.
305 (Sized_symbol::init_constant): Likewise.
306 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
307
26d3c67d
CC
3082011-06-07 Cary Coutant <ccoutant@google.com>
309
310 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
311 instead of emit_copy_reloc.
312 (Copy_relocs::emit_copy_reloc): Refactor.
313 (Copy_relocs::make_copy_reloc): New function.
314 (Copy_relocs::add_copy_reloc): Remove.
315 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
316 section.
317 (Copy_relocs::make_copy_reloc): New function.
318 (Copy_relocs::add_copy_reloc): Remove.
319 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
320 unchanged input files.
321 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
322 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
323 Reserve BSS space for COPY relocations.
324 (Sized_incremental_binary::do_emit_copy_relocs): New function.
325 (Output_section_incremental_inputs::write_info_blocks): Record
326 whether a symbol is copied from a shared object.
327 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
328 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
329 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
330 (Incremental_input_entry_reader::get_output_symbol_index): Add
331 is_copy parameter.
332 (Incremental_binary::emit_copy_relocs): New function.
333 (Incremental_binary::do_emit_copy_relocs): New function.
334 (Sized_incremental_binary::Sized_incremental_binary): Initialize
335 new data member.
336 (Sized_incremental_binary::add_copy_reloc): New function.
337 (Sized_incremental_binary::do_emit_copy_relocs): New function.
338 (Sized_incremental_binary::Copy_reloc): New struct.
339 (Sized_incremental_binary::Copy_relocs): New typedef.
340 (Sized_incremental_binary::copy_relocs_): New data member.
341 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
342 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
343 * target.h (Sized_target::emit_copy_reloc): New function.
344 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
345
7cdb37d9
CC
3462011-06-02 Cary Coutant <ccoutant@google.com>
347
348 PR gold/12163
349 * gold/archive.cc (Archive::Archive): Initialize new data member.
350 (Archive::include_all_members): Return if archive has already been
351 included.
352 * gold/archive.h (Archive::include_all_members_): New data member.
353
cc643b88
NC
3542011-06-02 Nick Clifton <nickc@redhat.com>
355
356 * dynobj.h: Fix spelling mistake in comment.
357 * output.cc: Likewise.
358
f62a3ca7
DK
3592011-05-31 Doug Kwan <dougkwan@google.com>
360 Asier Llano
361
362 PR gold/12826
cc643b88 363 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
364 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
365 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
366 redundant arm_exidx_test.so.
367 * testsuite/Makefile.in: Regenerate.
368 (check_SCRIPTS): Add pr12826.sh
369 (check_DATA): Add pr12826.stdout
370 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
371 * testsuite/pr12826.sh: New file.
372 * testsuite/pr12826_1.s: Ditto.
373 * testsuite/pr12826_1.s: Ditto.
374
8dbe1edc
ILT
3752011-05-30 Ian Lance Taylor <iant@google.com>
376
377 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
378 sections.
379
c49875be
ILT
3802011-05-29 Ian Lance Taylor <iant@google.com>
381
382 PR gold/12804
383 * testsuite/Makefile.am: Use different file name for two_file_test
384 temporary file for each incremental test.
385 * testsuite/Makefile.in: Rebuild.
386
69d53f7a
ILT
3872011-05-29 Ian Lance Taylor <iant@google.com>
388
389 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
390 binary input file is empty.
391
41d0ab5f
ILT
3922011-05-27 Ian Lance Taylor <iant@google.com>
393
394 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
395 (ver_test_9.so): Likewise.
396 * testsuite/Makefile.in: Rebuild.
397
89d8a36b
CC
3982011-05-26 Cary Coutant <ccoutant@google.com>
399
400 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
401 * incremental.cc (Incremental_inputs::report_input_section): Fix
402 comment, indentation.
403 (Incremental_inputs::report_comdat_group): New function.
404 (Output_section_incremental_inputs::set_final_data_size): Adjust size
405 of data for incremental input file entry.
406 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
407 group count, COMDAT group signatures.
408 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
409 an unchanged input file.
410 * incremental.h (Incremental_object_entry::Incremental_object_entry):
411 Initialize new data member.
412 (Incremental_object_entry::add_comdat_group): New function.
413 (Incremental_object_entry::get_comdat_group_count): New function.
414 (Incremental_object_entry::get_comdat_signature_key): New function.
415 (Incremental_object_entry::groups_): New data member.
416 (Incremental_inputs::report_comdat_group): New function.
417 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
418 data for incremental input file entry.
419 (Incremental_input_entry_reader::get_comdat_group_count): New function.
420 (Incremental_input_entry_reader::get_input_section): Adjust size of
421 data for incremental input file entry.
422 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
423 (Incremental_input_entry_reader::get_comdat_group_signature): New
424 function.
425 * object.cc (Sized_relobj::include_section_group): Report kept
426 COMDAT groups for incremental links.
427
1706a06f
ILT
4282011-05-24 David Meyer <pdox@google.com>
429
430 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
431 with name parameter. Add found_name parameter.
432 * fileread.cc (Input_file::find_file): Adjust code accordingly.
433 * dirsearch.h (class Dirsearch): Update declaration.
434
a10ae760
ILT
4352011-05-24 Ian Lance Taylor <iant@google.com>
436
437 * archive.cc (Library_base::should_include_member): Pull in object
438 from archive if it defines the entry symbol.
439 * parameters.cc (Parameters::entry): New function.
440 * parameters.h (class Parameters): Declare entry.
441 * output.h (class Output_file_header): Remove entry_ field.
442 * output.cc (Output_file_header::Output_file_header): Remove entry
443 parameter. Change all callers.
444 (Output_file_header::entry): Use parameters->entry.
445 * gold.cc (queue_middle_tasks): Likewise.
446 * plugin.cc (Plugin_hook::run): Likewise.
447
aa92d6ed
CC
4482011-05-24 Cary Coutant <ccoutant@google.com>
449
450 * gold.cc (queue_initial_tasks): Pass incremental base filename
451 to Output_file::open_base_file; don't print error message.
452 * incremental-dump.cc (main): Adjust call to
453 Output_file::open_for_modification.
454 * incremental-dump.cc (main): Likewise.
455 * incremental.cc (Incremental_inputs::report_command_line):
456 Ignore --incremental-base option when comparing command lines.
457 Ignore parameter when given as separate argument.
458 * options.h (class General_options): Add --incremental-base.
459 * output.cc (Output_file::Output_file):
460 (Output_file::open_base_file): Add base_name and writable parameters;
461 read base file into new file; print error message here.
462 (Output_file::map_no_anonymous): Add writable parameter; adjust all
463 callers.
464 * output.h (Output_file::open_for_modification): Rename to...
465 (Output_file::open_base_file): ...this; add base_name and
466 writable parameters; adjust all callers.
467 (Output_file::map_no_anonymous): Add writable parameter; adjust all
468 callers.
469 * testsuite/Makefile.am (incremental_test_4): Test
470 --incremental-base.
471 * testsuite/Makefile.in: Regenerate.
472
2eedd706
CC
4732011-05-24 Cary Coutant <ccoutant@google.com>
474
475 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
476 incremental_test_4.
477 * testsuite/Makefile.in: Regenerate.
478 * testsuite/two_file_test_1_v1.cc: New test source file.
479 * testsuite/two_file_test_1b_v1.cc: New test source file.
480 * testsuite/two_file_test_2_v1.cc: New test source file.
481
0f1c85a6
CC
4822011-05-24 Cary Coutant <ccoutant@google.com>
483
484 * dynobj.h (Dynobj::do_dynobj): New function.
485 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
486 flag and soname for shared objects.
487 * incremental.cc (Incremental_inputs::report_object): Make
488 either Incremental_object_entry or Incremental_dynobj_entry; add
489 soname to string table.
490 (Incremental_inputs::report_input_section): Add assertion.
491 (Output_section_incremental_inputs::set_final_data_size): Adjust
492 type of input file entry for shared libraries; adjust size of
493 shared library info entry.
494 (Output_section_incremental_inputs::write_input_files): Write
495 as_needed flag for shared libraries.
496 (Output_section_incremental_inputs::write_info_blocks): Adjust type
497 of input file entry for shared libraries; write soname.
498 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
499 soname from incremental info.
500 * incremental.h (enum Incremental_input_flags): Add
501 INCREMENTAL_INPUT_AS_NEEDED.
502 (Incremental_input_entry::Incremental_input_entry): Initialize new
503 data member.
504 (Incremental_input_entry::set_as_needed): New function.
505 (Incremental_input_entry::as_needed): New function.
506 (Incremental_input_entry::do_dynobj_entry): New function.
507 (Incremental_input_entry::as_needed_): New data member.
508 (Incremental_object_entry::Incremental_object_entry): Don't check
509 for shared library.
510 (Incremental_object_entry::do_type): Likewise.
511 (class Incremental_dynobj_entry): New class.
512 (Incremental_input_entry_reader::as_needed): New function.
513 (Incremental_input_entry_reader::get_soname): New function.
514 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
515 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
516 size of shared library info entry.
517 * layout.cc (Layout::finish_dynamic_section): Don't test for
518 incremental link when adding DT_NEEDED entries.
519 * object.h (Object::Object): Initialize new data member.
520 (Object::dynobj): New function.
521 (Object::set_as_needed): New function.
522 (Object::as_needed): New function.
523 (Object::do_dynobj): New function.
524 (Object::as_needed_): New data member.
525
6fa2a40b
CC
5262011-05-24 Cary Coutant <ccoutant@google.com>
527
528 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
529 info; adjust display of GOT entries.
530 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
531 vector of input objects; remove file_status_.
532 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
533 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
534 got_plt reader; call target hooks to reserve GOT entries.
535 (Output_section_incremental_inputs::set_final_data_size): Adjust size
536 of input file info header and GOT info entry.
537 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
538 relocation info.
539 (Got_plt_view_info::got_descriptor): Remove.
540 (Got_plt_view_info::sym_index): New data member.
541 (Got_plt_view_info::input_index): New data member.
542 (Local_got_offset_visitor::visit): Write input file index.
543 (Global_got_offset_visitor::visit): Write 0 for input file index.
544 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
545 with sym_index and input_index.
546 (Output_section_incremental_inputs::write_got_plt): Adjust size of
547 incremental info GOT entry; replace got_descriptor with input_index.
548 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
549 map from input file index to object.
550 (Sized_relobj_incr::do_layout): Replace direct data member reference
551 with accessor function.
552 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
553 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
554 Adjust size of input file info header.
555 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
556 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
557 (Incremental_input_entry_reader::get_input_section): Adjust size of
558 input file info header.
559 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
560 of incremental info GOT entry.
561 (Incremental_got_plt_reader::get_got_desc): Remove.
562 (Incremental_got_plt_reader::get_got_symndx): New function.
563 (Incremental_got_plt_reader::get_got_input_index): New function.
564 (Sized_incremental_binary::Sized_incremental_binary): Remove
565 file_status_; add input_objects_.
566 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
567 (Sized_incremental_binary::set_file_is_unchanged): Remove.
568 (Sized_incremental_binary::file_is_unchanged): Remove.
569 (Sized_incremental_binary::set_input_object): New function.
570 (Sized_incremental_binary::input_object): New function.
571 (Sized_incremental_binary::file_status_): Remove.
572 (Sized_incremental_binary::input_objects_): New data member.
573 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
574 references.
575 (Sized_relobj_incr::invalid_address): Move to base class.
576 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
577 class.
578 (Sized_relobj_incr::do_output_section_offset): Likewise.
579 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
580 (Sized_relobj_incr::section_offsets_): Likewise.
581 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
582 function.
583 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
584 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
585 with accessor function.
586 (Sized_relobj_file::do_layout): Likewise.
587 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
588 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
589 (Sized_relobj_file::compute_final_local_value): Replace refs to
590 section_offsets_ with accessor function.
591 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
592 * object.h (Relobj::Relobj): Initialize new data members.
593 (Relobj::add_dyn_reloc): New function.
594 (Relobj::first_dyn_reloc): New function.
595 (Relobj::dyn_reloc_count): New function.
596 (Relobj::first_dyn_reloc_): New data member.
597 (Relobj::dyn_reloc_count_): New data member.
598 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
599 references.
600 (Sized_relobj::Address): New typedef.
601 (Sized_relobj::invalid_address): Move here from child class.
602 (Sized_relobj::Sized_relobj): Initialize new data members.
603 (Sized_relobj::sized_relobj): New function.
604 (Sized_relobj::is_output_section_offset_invalid): Move here from
605 child class.
606 (Sized_relobj::get_output_section_offset): Likewise.
607 (Sized_relobj::local_has_got_offset): Likewise.
608 (Sized_relobj::local_got_offset): Likewise.
609 (Sized_relobj::set_local_got_offset): Likewise.
610 (Sized_relobj::do_for_all_local_got_entries): Likewise.
611 (Sized_relobj::clear_got_offsets): New function.
612 (Sized_relobj::section_offsets): Move here from child class.
613 (Sized_relobj::do_output_section_offset): Likewise.
614 (Sized_relobj::do_set_section_offset): Likewise.
615 (Sized_relobj::Local_got_offsets): Likewise.
616 (Sized_relobj::local_got_offsets_): Likewise.
617 (Sized_relobj::section_offsets_): Likewise.
618 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
619 references.
620 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
621 class.
622 (Sized_relobj_file::sized_relobj): New function
623 (Sized_relobj_file::local_has_got_offset): Move to base class.
624 (Sized_relobj_file::local_got_offset): Likewise.
625 (Sized_relobj_file::set_local_got_offset): Likewise.
626 (Sized_relobj_file::get_output_section_offset): Likewise.
627 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
628 (Sized_relobj_file::do_output_section_offset): Likewise.
629 (Sized_relobj_file::do_set_section_offset): Likewise.
630 (Sized_relobj_file::Local_got_offsets): Likewise.
631 (Sized_relobj_file::local_got_offsets_): Likewise.
632 (Sized_relobj_file::section_offsets_): Likewise.
633 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
634 (all constructors).
635 (set_needs_dynsym_index): Convert relobj to derived class pointer.
636 (Output_reloc::get_symbol_index): Likewise.
637 (Output_reloc::local_section_offset): Likewise.
638 (Output_reloc::get_address): Likewise.
639 (Output_reloc::symbol_value): Likewise.
640 (Output_data_got::reserve_slot): Move to class definition.
641 (Output_data_got::reserve_local): New function.
642 (Output_data_got::reserve_slot_for_global): Remove.
643 (Output_data_got::reserve_global): New function.
644 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
645 (all constructors, two instantiations).
646 (Output_reloc::get_relobj): New function (two instantiations).
647 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
648 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
649 (Output_data_reloc::add_global): Adjust type of relobj.
650 (Output_data_reloc::add_global_relative): Likewise.
651 (Output_data_reloc::add_symbolless_global_addend): Likewise.
652 (Output_data_reloc::add_local): Likewise.
653 (Output_data_reloc::add_local_relative): Likewise.
654 (Output_data_reloc::add_symbolless_local_addend): Likewise.
655 (Output_data_reloc::add_local_section): Likewise.
656 (Output_data_reloc::add_output_section): Likewise.
657 (Output_data_reloc::add_absolute): Likewise.
658 (Output_data_reloc::add_target_specific): Likewise.
659 (Output_data_got::reserve_slot): Move definition here.
660 (Output_data_got::reserve_local): New function.
661 (Output_data_got::reserve_global): New function.
662 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
663 section_offsets_ with accessor function.
664 (Sized_relobj_file::write_sections): Likewise.
665 (Sized_relobj_file::do_relocate_sections): Likewise.
666 * target.h (Sized_target::reserve_local_got_entry): New function.
667 (Sized_target::reserve_global_got_entry): New function.
668 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
669 (Target_x86_64::reserve_global_got_entry): New function.
670 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
671
4829d394
CC
6722011-05-23 Cary Coutant <ccoutant@google.com>
673
674 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
675 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
676 bit when checking got_type.
677 * incremental.cc (Sized_incremental_binary::setup_readers):
678 Store symbol table and string table locations; initialize bit vector
679 of file status flags.
680 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
681 unchanged files.
682 (Sized_incremental_binary::do_process_got_plt): New function.
683 (Sized_incremental_binary::get_symtab_view): Use stored locations.
684 (Output_section_incremental_inputs::set_final_data_size): Record
685 file index for each input file.
686 (Output_section_incremental_inputs::write_got_plt): Store file index
687 instead of input entry offset for each GOT entry.
688 * incremental.h
689 (Incremental_input_entry::Incremental_input_entry): Initialize new
690 data member.
691 (Incremental_input_entry::set_offset): Store file index.
692 (Incremental_input_entry::get_file_index): New function.
693 (Incremental_input_entry::file_index_): New data member.
694 (Incremental_binary::process_got_plt): New function.
695 (Incremental_binary::do_process_got_plt): New function.
696 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
697 data members.
698 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
699 (Sized_incremental_binary::set_file_is_unchanged): New function.
700 (Sized_incremental_binary::file_is_unchanged): New function.
701 (Sized_incremental_binary::do_process_got_plt): New function.
702 (Sized_incremental_binary::file_status_): New data member.
703 (Sized_incremental_binary::main_symtab_loc_): New data member.
704 (Sized_incremental_binary::main_strtab_loc_): New data member.
705 * output.cc (Output_data_got::Got_entry::write): Add case
706 RESERVED_CODE.
707 (Output_data_got::add_global): Call add_got_entry.
708 (Output_data_got::add_global_plt): Likewise.
709 (Output_data_got::add_global_with_rel): Likewise.
710 (Output_data_got::add_global_with_rela): Likewise.
711 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
712 (Output_data_got::add_global_pair_with_rela): Likewise.
713 (Output_data_got::add_local): Call add_got_entry.
714 (Output_data_got::add_local_plt): Likewise.
715 (Output_data_got::add_local_with_rel): Likewise.
716 (Output_data_got::add_local_with_rela): Likewise.
717 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
718 (Output_data_got::add_local_pair_with_rela): Likewise.
719 (Output_data_got::reserve_slot): New function.
720 (Output_data_got::reserve_slot_for_global): New function.
721 (Output_data_got::add_got_entry): New function.
722 (Output_data_got::add_got_entry_pair): New function.
723 (Output_section::add_output_section_data): Edit FIXME.
724 * output.h
725 (Output_section_data_build::Output_section_data_build): New
726 constructor with size parameter.
727 (Output_data_space::Output_data_space): Likewise.
728 (Output_data_got::Output_data_got): Initialize new data member; new
729 constructor with size parameter.
730 (Output_data_got::add_constant): Call add_got_entry.
731 (Output_data_got::reserve_slot): New function.
732 (Output_data_got::reserve_slot_for_global): New function.
733 (class Output_data_got::Got_entry): Add RESERVED_CODE.
734 (Output_data_got::add_got_entry): New function.
735 (Output_data_got::add_got_entry_pair): New function.
736 (Output_data_got::free_list_): New data member.
737 * target.h (Sized_target::init_got_plt_for_update): New function.
738 (Sized_target::register_global_plt_entry): New function.
739 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
740 Initialize new data member; call init; add constructor with PLT count.
741 (Output_data_plt_x86_64::init): New function.
742 (Output_data_plt_x86_64::add_relocation): New function.
743 (Output_data_plt_x86_64::reserve_slot): New function.
744 (Output_data_plt_x86_64::free_list_): New data member.
745 (Target_x86_64::init_got_plt_for_update): New function.
746 (Target_x86_64::register_global_plt_entry): New function.
747 (Output_data_plt_x86_64::add_entry): Allocate from free list for
748 incremental updates.
749 (Output_data_plt_x86_64::add_relocation): New function.
750 * testsuite/object_unittest.cc (Object_test): Set default options.
751
ec69d6da
ILT
7522011-05-16 Ian Lance Taylor <iant@google.com>
753
754 * options.h (class General_options): Make -i a synonym for -r.
755
732e31de
ILT
7562011-05-16 Ian Lance Taylor <iant@google.com>
757
758 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
759
403676b5
CC
7602011-05-10 Cary Coutant <ccoutant@google.com>
761
762 * object.cc (Sized_relobj::do_count_local_symbols): Check for
763 strip_all (-s).
764
5b7b7d6e
ILT
7652011-05-06 Ian Lance Taylor <iant@google.com>
766
767 * layout.cc (Layout::layout): If the output section flags change,
768 update the ordering.
769
f0f9babf
CC
7702011-04-25 Cary Coutant <ccoutant@google.com>
771
772 * incremental-dump.cc (dump_incremental_inputs): Print local
773 symbol info for each input file.
774 * incremental.cc
775 (Output_section_incremental_inputs::set_final_data_size): Add local
776 symbol info to input file entries in incremental info.
777 (Output_section_incremental_inputs::write_info_blocks): Likewise.
778 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
779 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
780 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
781 implementation.
782 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
783 (Sized_incr_relobj::do_relocate): Write the local symbols.
784 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
785 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
786 Adjust size of input file header.
787 (Incremental_inputs_reader::get_local_symbol_offset): New function.
788 (Incremental_inputs_reader::get_local_symbol_count): New function.
789 (Incremental_inputs_reader::get_input_section): Adjust size of input
790 file header.
791 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
792 (Sized_incr_relobj::This): New typedef.
793 (Sized_incr_relobj::sym_size): New const data member.
794 (Sized_incr_relobj::Local_symbol): New struct.
795 (Sized_incr_relobj::do_output_local_symbol_count): New function.
796 (Sized_incr_relobj::do_local_symbol_offset): New function.
797 (Sized_incr_relobj::local_symbol_count_): New data member.
798 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
799 (Sized_incr_relobj::local_symbol_index_): New data member.
800 (Sized_incr_relobj::local_symbol_offset_): New data member.
801 (Sized_incr_relobj::local_dynsym_offset_): New data member.
802 (Sized_incr_relobj::local_symbols_): New data member.
803 * object.h (Relobj::output_local_symbol_count): New function.
804 (Relobj::local_symbol_offset): New function.
805 (Relobj::do_output_local_symbol_count): New function.
806 (Relobj::do_local_symbol_offset): New function.
807 (Sized_relobj::do_output_local_symbol_count): New function.
808 (Sized_relobj::do_local_symbol_offset): New function.
809
d0a9ace3
ILT
8102011-04-22 Vladimir Simonov <sv@sw.ru>
811
812 * descriptors.cc (set_close_on_exec): New function.
813 (Descriptors::open): Use set_close_on_exec.
814 * output.cc (S_ISLNK): Define if not defined.
815
94a3fc8b
CC
8162011-04-22 Cary Coutant <ccoutant@google.com>
817
818 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
819 global symbol map.
820 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
821 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
822 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
823 relocations.
824 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
825 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
826 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
827 * incremental.h
828 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
829 function.
830 (Incremental_binary::apply_incremental_relocs): New function.
831 (Incremental_binary::do_apply_incremental_relocs): New function.
832 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
833 data member.
834 (Sized_incremental_binary::add_global_symbol): New function.
835 (Sized_incremental_binary::global_symbol): New function.
836 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
837 (Sized_incremental_binary::symbol_map_): New data member.
838 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
839 * target.h (Sized_target::apply_relocation): New function.
840 * target-reloc.h (apply_relocation): New function.
841 * x86_64.cc (Target_x86_64::apply_relocation): New function.
842
c87e4302
DK
8432011-04-22 Doug Kwan <dougkwan@google.com>
844
845 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
846 flag of a SHT_ARM_EXIDX section.
847 * testsuite/Makefile.am (arm_exidx_test): New test rules.
848 * testsuite/Makefile.in: Regenerate.
849 * testsuite/arm_exidx_test.s: New file.
850 * testsuite/arm_exidx_test.sh: Same.
851
e7782cf6
CC
8522011-04-20 Cary Coutant <ccoutant@google.com>
853
854 PR gold/12689
855 * archive.h (Incremental_archive_entry::Archive_member):
856 Initialize arg_serial_ (second constructor).
857
308ecdc7
ILT
8582011-04-17 Ian Lance Taylor <iant@google.com>
859
860 * object.cc (Relocate_info::location): Simplify location string.
861 * errors.cc (Errors::error_at_location): Don't print program
862 name.
863 (Errors::warning_at_location): Likewise.
864 (Errors::undefined_symbol): Likewise.
865 * testsuite/debug_msg.sh: Update accordingly.
866
bec5b579
CC
8672011-04-14 Cary Coutant <ccoutant@google.com>
868
869 * gold/layout.cc (Layout::symtab_section_offset): New function.
870 * gold/layout.h (Layout::symtab_section_offset): New function.
871 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
872
88597d34
ILT
8732011-04-12 Ian Lance Taylor <iant@google.com>
874
875 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
876 with MREMAP_MAYMOVE.
877 * output.h (class Output_file): Add map_is_allocated_ field.
878 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
879 not available, provide stubs. If mremap is not available, #define
880 it to gold_mremap.
881 (MREMAP_MAYMOVE): Define if not defined.
882 (Output_file::Output_file): Initialize map_is_allocated_.
883 (Output_file::resize): Check map_is_allocated_.
884 (Output_file::map_anonymous): If mmap fails, use malloc.
885 (Output_file::unmap): Don't do anything for an anonymous map.
886 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
887 is not available, provide stubs.
888 (File_read::View::~View): Use free rather than delete[].
889 (File_read::make_view): Use malloc rather than new[]. If mmap
890 fails, use malloc.
891 (File_read::find_or_make_view): Use malloc rather than new[].
892 * gold.h: Remove HAVE_REMAP code.
893 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
894 exists. Rename mremap to gold_mremap. If mmap is not available
895 don't do anything.
896 * configure, config.in: Rebuild.
897
11e361bc
ILT
8982011-04-11 Ian Lance Taylor <iant@google.com>
899
900 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
901 initialize local variable v.
902
cdc29364
CC
9032011-04-11 Cary Coutant <ccoutant@google.com>
904
905 * archive.cc (Archive::include_member): Adjust call to
906 report_object.
907 (Add_archive_symbols::run): Track argument serial numbers.
908 (Lib_group::include_member): Likewise.
909 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
910 * archive.h (Incremental_archive_entry::Archive_member):
911 Initialize arg_serial_.
912 (Archive_member::arg_serial_): New data member.
913 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
914 (Sized_dynobj::do_add_symbols): Track symbols when doing an
915 incremental link.
916 (Sized_dynobj::do_for_all_local_got_entries): New function.
917 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
918 function.
919 * fileread.cc (get_mtime): New function.
920 * fileread.h (get_mtime): New function.
921 * gold.cc (queue_initial_tasks): Check for incremental update.
922 (process_incremental_input): New function.
923 (queue_middle_tasks): Don't force valid target for incremental
924 update.
925 * incremental-dump.cc (find_input_containing_global): Adjust
926 size of symbol info entry.
927 (dump_incremental_inputs): Dump argument serial number and
928 in_system_directory flag; bias shndx by 1; print symbol names
929 when dumping per-file symbol lists; use new symbol info readers.
930 * incremental.cc
931 (Output_section_incremental_inputs:update_data_size): New function.
932 (Sized_incremental_binary::setup_readers): Setup input readers
933 for each input file; build maps for files added from libraries
934 and scripts.
935 (Sized_incremental_binary::check_input_args): New function.
936 (Sized_incremental_binary::do_check_inputs): Build map of argument
937 serial numbers to input arguments.
938 (Sized_incremental_binary::do_file_has_changed): Rename
939 do_file_is_unchanged to this; compare file modification times.
940 (Sized_incremental_binary::do_init_layout): New function.
941 (Sized_incremental_binary::do_reserve_layout): New function.
942 (Sized_incremental_binary::do_get_input_reader): Remove.
943 (Sized_incremental_binary::get_symtab_view): New function.
944 (Incremental_checker::can_incrementally_link_output_file): Remove.
945 (Incremental_inputs::report_command_line): Exclude --debug options.
946 (Incremental_inputs::report_archive_begin): Add parameter; track
947 argument serial numbers; don't put input file entry for archive
948 before archive members.
949 (Incremental_inputs::report_archive_end): Put input file entry
950 for archive after archive members.
951 (Incremental_inputs::report_object): Add parameter; track argument
952 serial numbers and in_system_directory flag.
953 (Incremental_inputs::report_script): Add parameter; track argument
954 serial numbers.
955 (Output_section_incremental_inputs::set_final_data_size): Adjust
956 size of symbol info entry; check for forwarding symbols.
957 (Output_section_incremental_inputs::write_input_files): Write
958 in_system_directory flag and argument serial number.
959 (Output_section_incremental_inputs::write_info_blocks): Map section
960 indices between incremental info and original input file; store
961 input section index for each symbol.
962 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
963 change operator() to visit().
964 (class Global_got_offset_visitor): Likewise.
965 (class Global_symbol_visitor_got_plt):
966 (Output_section_incremental_inputs::write_got_plt): Use new visitor
967 classes.
968 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
969 (Sized_incr_relobj::do_read_symbols): New function.
970 (Sized_incr_relobj::do_layout): New function.
971 (Sized_incr_relobj::do_layout_deferred_sections): New function.
972 (Sized_incr_relobj::do_add_symbols): New function.
973 (Sized_incr_relobj::do_should_include_member): New function.
974 (Sized_incr_relobj::do_for_all_global_symbols): New function.
975 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
976 (Sized_incr_relobj::do_section_size): New function.
977 (Sized_incr_relobj::do_section_name): New function.
978 (Sized_incr_relobj::do_section_contents): New function.
979 (Sized_incr_relobj::do_section_flags): New function.
980 (Sized_incr_relobj::do_section_entsize): New function.
981 (Sized_incr_relobj::do_section_address): New function.
982 (Sized_incr_relobj::do_section_type): New function.
983 (Sized_incr_relobj::do_section_link): New function.
984 (Sized_incr_relobj::do_section_info): New function.
985 (Sized_incr_relobj::do_section_addralign): New function.
986 (Sized_incr_relobj::do_initialize_xindex): New function.
987 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
988 (Sized_incr_relobj::do_read_relocs): New function.
989 (Sized_incr_relobj::do_gc_process_relocs): New function.
990 (Sized_incr_relobj::do_scan_relocs): New function.
991 (Sized_incr_relobj::do_count_local_symbols): New function.
992 (Sized_incr_relobj::do_finalize_local_symbols): New function.
993 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
994 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
995 (Sized_incr_relobj::do_relocate): New function.
996 (Sized_incr_relobj::do_set_section_offset): New function.
997 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
998 (Sized_incr_dynobj::do_read_symbols): New function.
999 (Sized_incr_dynobj::do_layout): New function.
1000 (Sized_incr_dynobj::do_add_symbols): New function.
1001 (Sized_incr_dynobj::do_should_include_member): New function.
1002 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
1003 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
1004 (Sized_incr_dynobj::do_section_size): New function.
1005 (Sized_incr_dynobj::do_section_name): New function.
1006 (Sized_incr_dynobj::do_section_contents): New function.
1007 (Sized_incr_dynobj::do_section_flags): New function.
1008 (Sized_incr_dynobj::do_section_entsize): New function.
1009 (Sized_incr_dynobj::do_section_address): New function.
1010 (Sized_incr_dynobj::do_section_type): New function.
1011 (Sized_incr_dynobj::do_section_link): New function.
1012 (Sized_incr_dynobj::do_section_info): New function.
1013 (Sized_incr_dynobj::do_section_addralign): New function.
1014 (Sized_incr_dynobj::do_initialize_xindex): New function.
1015 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
1016 (make_sized_incremental_object): New function.
1017 (Incremental_library::copy_unused_symbols): New function.
1018 (Incremental_library::do_for_all_unused_symbols): New function.
1019 * incremental.h (enum Incremental_input_flags): New type.
1020 (class Incremental_checker): Remove.
1021 (Incremental_input_entry::Incremental_input_entry): Add argument
1022 serial number.
1023 (Incremental_input_entry::arg_serial): New function.
1024 (Incremental_input_entry::set_is_in_system_directory): New function.
1025 (Incremental_input_entry::is_in_system_directory): New function.
1026 (Incremental_input_entry::arg_serial_): New data member.
1027 (Incremental_input_entry::is_in_system_directory_): New data member.
1028 (class Script_info): Move here from script.h.
1029 (Script_info::Script_info): Add filename parameter.
1030 (Script_info::filename): New function.
1031 (Script_info::filename_): New data member.
1032 (Incremental_script_entry::Incremental_script_entry): Add argument
1033 serial number.
1034 (Incremental_object_entry::Incremental_object_entry): Likewise.
1035 (Incremental_object_entry::add_input_section): Build list of input
1036 sections with map to original shndx.
1037 (Incremental_object_entry::get_input_section_index): New function.
1038 (Incremental_object_entry::shndx_): New data member.
1039 (Incremental_object_entry::name_key_): Rename; adjust all refs.
1040 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
1041 (Incremental_archive_entry::Incremental_archive_entry): Add argument
1042 serial number.
1043 (Incremental_inputs::report_archive_begin): Likewise.
1044 (Incremental_inputs::report_object): Likewise.
1045 (Incremental_inputs::report_script): Likewise.
1046 (class Incremental_global_symbol_reader): New class.
1047 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
1048 and store flags and input file type.
1049 (Incremental_input_entry_reader::arg_serial): New function.
1050 (Incremental_input_entry_reader::type): Extract type from flags.
1051 (Incremental_input_entry_reader::is_in_system_directory): New function.
1052 (Incremental_input_entry_reader::get_input_section_count): Call
1053 accessor function for type.
1054 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
1055 function for type; adjust size of global symbol entry.
1056 (Incremental_input_entry_reader::get_global_symbol_count): Call
1057 accessor function for type.
1058 (Incremental_input_entry_reader::get_object_count): Likewise.
1059 (Incremental_input_entry_reader::get_object_offset): Likewise.
1060 (Incremental_input_entry_reader::get_member_count): Likewise.
1061 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1062 (Incremental_input_entry_reader::get_member_offset): Likewise.
1063 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1064 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1065 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1066 (Incremental_input_entry_reader::get_global_symbol_reader): New
1067 function.
1068 (Incremental_input_entry_reader::get_output_symbol_index): New
1069 function.
1070 (Incremental_input_entry_reader::type_): Remove.
1071 (Incremental_input_entry_reader::flags_): New data member.
1072 (Incremental_inputs_reader::input_file_offset): New function.
1073 (Incremental_inputs_reader::input_file_index): New function.
1074 (Incremental_inputs_reader::input_file): Call input_file_offset.
1075 (Incremental_inputs_reader::input_file_at_offset): New function.
1076 (Incremental_relocs_reader::get_r_type): Reformat.
1077 (Incremental_relocs_reader::get_r_shndx): Reformat.
1078 (Incremental_relocs_reader::get_r_offset): Reformat.
1079 (Incremental_relocs_reader::data): New function.
1080 (Incremental_binary::Incremental_binary): Initialize new data members.
1081 (Incremental_binary::check_inputs): Add cmdline parameter.
1082 (Incremental_binary::file_is_unchanged): Remove.
1083 (Input_reader::arg_serial): New function.
1084 (Input_reader::get_unused_symbol_count): New function.
1085 (Input_reader::get_unused_symbol): New function.
1086 (Input_reader::do_arg_serial): New function.
1087 (Input_reader::do_get_unused_symbol_count): New function.
1088 (Input_reader::do_get_unused_symbol): New function.
1089 (Incremental_binary::input_file_count): New function.
1090 (Incremental_binary::get_input_reader): Change signature to use
1091 index instead of filename.
1092 (Incremental_binary::file_has_changed): New function.
1093 (Incremental_binary::get_input_argument): New function.
1094 (Incremental_binary::get_library): New function.
1095 (Incremental_binary::get_script_info): New function.
1096 (Incremental_binary::init_layout): New function.
1097 (Incremental_binary::reserve_layout): New function.
1098 (Incremental_binary::output_file): New function.
1099 (Incremental_binary::do_check_inputs): New function.
1100 (Incremental_binary::do_file_is_unchanged): Remove.
1101 (Incremental_binary::do_file_has_changed): New function.
1102 (Incremental_binary::do_init_layout): New function.
1103 (Incremental_binary::do_reserve_layout): New function.
1104 (Incremental_binary::do_input_file_count): New function.
1105 (Incremental_binary::do_get_input_reader): Change signature.
1106 (Incremental_binary::input_args_map_): New data member.
1107 (Incremental_binary::library_map_): New data member.
1108 (Incremental_binary::script_map_): New data member.
1109 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1110 new data members.
1111 (Sized_incremental_binary::output_section): New function.
1112 (Sized_incremental_binary::inputs_reader): Add const.
1113 (Sized_incremental_binary::symtab_reader): Add const.
1114 (Sized_incremental_binary::relocs_reader): Add const.
1115 (Sized_incremental_binary::got_plt_reader): Add const.
1116 (Sized_incremental_binary::get_symtab_view): New function.
1117 (Sized_incremental_binary::Inputs_reader): New typedef.
1118 (Sized_incremental_binary::Input_entry_reader): New typedef.
1119 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1120 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1121 (Sized_incremental_binary::do_file_has_changed): New function.
1122 (Sized_incremental_binary::do_init_layout): New function.
1123 (Sized_incremental_binary::do_reserve_layout): New function.
1124 (Sized_input_reader::Inputs_reader): Remove.
1125 (Sized_input_reader::Input_entry_reader): Remove.
1126 (Sized_input_reader::do_arg_serial): New function.
1127 (Sized_input_reader::do_get_unused_symbol_count): New function.
1128 (Sized_input_reader::do_get_unused_symbol): New function.
1129 (Sized_incremental_binary::do_input_file_count): New function.
1130 (Sized_incremental_binary::do_get_input_reader): Change signature;
1131 use index instead of filename.
1132 (Sized_incremental_binary::section_map_): New data member.
1133 (Sized_incremental_binary::input_entry_readers_): New data member.
1134 (class Sized_incr_relobj): New class.
1135 (class Sized_incr_dynobj): New class.
1136 (make_sized_incremental_object): New function.
1137 (class Incremental_library): New class.
1138 * layout.cc (Free_list::num_lists): New static data member.
1139 (Free_list::num_nodes): New static data member.
1140 (Free_list::num_removes): New static data member.
1141 (Free_list::num_remove_visits): New static data member.
1142 (Free_list::num_allocates): New static data member.
1143 (Free_list::num_allocate_visits): New static data member.
1144 (Free_list::init): New function.
1145 (Free_list::remove): New function.
1146 (Free_list::allocate): New function.
1147 (Free_list::dump): New function.
1148 (Free_list::print_stats): New function.
1149 (Layout_task_runner::run): Resize output file for incremental updates.
1150 (Layout::Layout): Initialize new data members.
1151 (Layout::set_incremental_base): New function.
1152 (Layout::init_fixed_output_section): New function.
1153 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1154 incremental updates.
1155 (Layout::create_gold_note): Do not create gold note section for
1156 incremental updates.
1157 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1158 for incremental updates.
1159 (Layout::set_section_offsets): For incremental updates, allocate space
1160 from free list.
1161 (Layout::create_symtab_sections): Layout with offsets relative to
1162 start of section; for incremental updates, allocate space from free
1163 list.
1164 (Layout::create_shdrs): For incremental updates, allocate space from
1165 free list.
1166 (Layout::finish_dynamic_section): For incremental updates, do not
1167 check --as-needed (fixed in subsequent patch).
1168 * layout.h (class Free_list): New class.
1169 (Layout::set_incremental_base): New function.
1170 (Layout::incremental_base): New function.
1171 (Layout::init_fixed_output_section): New function.
1172 (Layout::allocate): New function.
1173 (Layout::incremental_base_): New data member.
1174 (Layout::free_list_): New data member.
1175 * main.cc (main): Print Free_list statistics.
1176 * object.cc (Relobj::finalize_incremental_relocs): Add
1177 clear_counts parameter; clear counts only when clear_counts is set.
1178 (Sized_relobj::Sized_relobj): Initialize new base class.
1179 (Sized_relobj::do_layout): Don't report special sections.
1180 (Sized_relobj::do_for_all_local_got_entries): New function.
1181 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1182 symtab_off to all symbol table offsets.
1183 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1184 * object.h (class Got_offset_list): Move to top of file.
1185 (Object::Object): Allow case where input_file == NULL.
1186 (Object::~Object): Likewise.
1187 (Object::input_file): Assert that input_file != NULL.
1188 (Object::lock): Allow case where input_file == NULL.
1189 (Object::unlock): Likewise.
1190 (Object::is_locked): Likewise.
1191 (Object::token): Likewise.
1192 (Object::release): Likewise.
1193 (Object::is_incremental): New function.
1194 (Object::get_mtime): New function.
1195 (Object::for_all_local_got_entries): New function.
1196 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1197 (Object::set_is_in_system_directory): New function.
1198 (Object::is_in_system_directory): New function.
1199 (Object::do_is_incremental): New function.
1200 (Object::do_get_mtime): New function.
1201 (Object::do_for_all_local_got_entries): New function.
1202 (Object::is_in_system_directory_): New data member.
1203 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1204 (class Sized_relobj_base): New class.
1205 (class Sized_relobj): Derive from Sized_relobj_base.
1206 (class Sized_relobj::Symbols): Redeclare from base class.
1207 (class Sized_relobj::local_got_offset_list): Remove.
1208 (class Sized_relobj::Output_sections): Redeclare from base class.
1209 (class Sized_relobj::do_for_all_local_got_entries): New function.
1210 (class Sized_relobj::write_local_symbols): Add offset parameter.
1211 (class Sized_relobj::local_symbol_offset_): Update comment.
1212 (class Sized_relobj::local_dynsym_offset_): Update comment.
1213 * options.cc (Input_arguments::add_file): Remove const.
1214 * options.h (Input_file_argument::Input_file_argument):
1215 Initialize arg_serial_ (all constructors).
1216 (Input_file_argument::set_arg_serial): New function.
1217 (Input_file_argument::arg_serial): New function.
1218 (Input_file_argument::arg_serial_): New data member.
1219 (Input_arguments::Input_arguments): Initialize file_count_.
1220 (Input_arguments::add_file): Remove const.
1221 (Input_arguments::number_of_input_files): New function.
1222 (Input_arguments::file_count_): New data member.
1223 (Command_line::number_of_input_files): Call
1224 Input_arguments::number_of_input_files.
1225 * output.cc (Output_segment_headers::Output_segment_headers):
1226 Set current size.
1227 (Output_section::Input_section::current_data_size): New function.
1228 (Output_section::Output_section): Initialize new data members.
1229 (Output_section::add_input_section): Don't do merge sections for
1230 an incremental link; allocate space from free list for an
1231 incremental update.
1232 (Output_section::add_output_section_data): Allocate space from
1233 free list for an incremental update.
1234 (Output_section::update_data_size): New function.
1235 (Output_section::set_fixed_layout): New function.
1236 (Output_section::reserve): New function.
1237 (Output_segment::set_section_addresses): Remove const.
1238 (Output_segment::set_section_list_addresses): Remove const; allocate
1239 space from free list for an incremental update.
1240 (Output_segment::set_offset): Adjust size of RELRO segment for an
1241 incremental update.
1242 * output.h (Output_data::current_data_size): Move here from
1243 child classes.
1244 (Output_data::pre_finalize_data_size): New function.
1245 (Output_data::update_data_size): New function.
1246 (Output_section_headers::update_data_size): new function.
1247 (Output_section_data_build::current_data_size): Move to Output_data.
1248 (Output_data_strtab::update_data_size): New function.
1249 (Output_section::current_data_size): Move to Output_data.
1250 (Output_section::set_fixed_layout): New function.
1251 (Output_section::has_fixed_layout): New function.
1252 (Output_section::reserve): New function.
1253 (Output_section::update_data_size): New function.
1254 (Output_section::has_fixed_layout_): New data member.
1255 (Output_section::free_list_): New data member.
1256 (Output_segment::set_section_addresses): Remove const.
1257 (Output_segment::set_section_list_addresses): Remove const.
1258 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
1259 New function.
1260 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
1261 New function.
1262 * readsyms.cc (Read_symbols::do_read_symbols): Add library
1263 parameter when calling Add_symbols constructor; store argument
1264 serial number for members of a lib group.
1265 (Add_symbols::locks): Allow case where token == NULL.
1266 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
1267 (Read_member::~Read_member): New function.
1268 (Read_member::is_runnable): New function.
1269 (Read_member::locks): New function.
1270 (Read_member::run): New function.
1271 (Check_script::~Check_script): New function.
1272 (Check_script::is_runnable): New function.
1273 (Check_script::locks): New function.
1274 (Check_script::run): New function.
1275 (Check_library::~Check_library): New function.
1276 (Check_library::is_runnable): New function.
1277 (Check_library::locks): New function.
1278 (Check_library::run): New function.
1279 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
1280 (Add_symbols::library_): New data member.
1281 (class Read_member): New class.
1282 (class Check_script): New class.
1283 (class Check_library): New class.
1284 * reloc.cc (Read_relocs::is_runnable): Allow case where
1285 token == NULL.
1286 (Read_relocs::locks): Likewise.
1287 (Scan_relocs::locks): Likewise.
1288 (Relocate_task::locks): Likewise.
1289 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
1290 to clear counters.
1291 (Sized_relobj::incremental_relocs_scan): Fix comment.
1292 (Sized_relobj::do_relocate): Pass output file offset to
1293 write_local_symbols.
1294 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
1295 from class declaration.
1296 * script.cc (read_input_script): Allocate Script_info; pass
1297 argument serial number to report_script.
1298 * script.h (class Script_info): Move to incremental.h.
1299 * symtab.cc (Symbol_table::add_from_incrobj): New function.
1300 * symtab.h (Symbol_table::add_from_incrobj): New function.
1301 (Symbol_table::set_file_offset): New function.
1302
b961d0d7
CC
13032011-04-05 Cary Coutant <ccoutant@google.com>
1304
1305 * incremental-dump.cc (dump_incremental_inputs): Change signature
1306 to take a Sized_incremental_binary; change caller. Use readers
1307 in Sized_incremental_binary.
1308 * incremental.cc
1309 (Sized_incremental_binary::find_incremental_inputs_sections):
1310 Rename do_find_incremental_inputs_sections to this.
1311 (Sized_incremental_binary::setup_readers): New function.
1312 (Sized_incremental_binary::do_check_inputs): Check
1313 has_incremental_info_ flag; move setup code to setup_readers;
1314 use input readers.
1315 (Sized_incremental_binary::do_file_is_unchanged): New function.
1316 (Sized_incremental_binary::do_get_input_reader): New function.
1317 * incremental.h (class Incremental_binary): Move to end of file.
1318 (Incremental_binary::file_is_unchanged): New function.
1319 (Incremental_binary::do_file_is_unchanged): New function.
1320 (Incremental_binary::Input_reader): New class.
1321 (Incremental_binary::get_input_reader): New function.
1322 (class Sized_incremental_binary): Move to end of file.
1323 (Sized_incremental_binary::Sized_incremental_binary): Setup the
1324 input section reader classes.
1325 (Sized_incremental_binary::has_incremental_info): New function.
1326 (Sized_incremental_binary::inputs_reader): New function.
1327 (Sized_incremental_binary::symtab_reader): New function.
1328 (Sized_incremental_binary::relocs_reader): New function.
1329 (Sized_incremental_binary::got_plt_reader): New function.
1330 (Sized_incremental_binary::do_file_is_unchanged): New function.
1331 (Sized_incremental_binary::Sized_input_reader): New class.
1332 (Sized_incremental_binary::get_input_reader): New function.
1333 (Sized_incremental_binary::find_incremental_inputs_sections):
1334 Rename do_find_incremental_inputs_sections to this.
1335 (Sized_incremental_binary::setup_readers): New function.
1336 (Sized_incremental_binary::has_incremental_info_): New data member.
1337 (Sized_incremental_binary::inputs_reader_): New data member.
1338 (Sized_incremental_binary::symtab_reader_): New data member.
1339 (Sized_incremental_binary::relocs_reader_): New data member.
1340 (Sized_incremental_binary::got_plt_reader_): New data member.
1341 (Sized_incremental_binary::current_input_file_): New data member.
1342
a869183f
PP
13432011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
1344
1345 PR gold/12640
1346 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
1347 violation.
1348
13492011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
1350
1351 * archive.cc (Archive::include_member): Adjust call to report_object.
1352 (Add_archive_symbols::run): Add script_info to call to
1353 report_archive_begin.
1354 (Lib_group::include_member): Adjust call to report_object.
1355 (Add_lib_group_symbols::run): Adjust call to report_object.
1356 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
1357 blocks. Add object count for script input files.
1358 * incremental.cc (Incremental_inputs::report_archive_begin): Add
1359 script_info parameter; change all callers.
1360 (Incremental_inputs::report_object): Add script_info parameter;
1361 change all callers.
1362 (Incremental_inputs::report_script): Store backpointer to
1363 incremental info entry.
1364 (Output_section_incremental_inputs::set_final_data_size): Record
1365 additional information for scripts.
1366 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1367 * incremental.h (Incremental_script_entry::add_object): New function.
1368 (Incremental_script_entry::get_object_count): New function.
1369 (Incremental_script_entry::get_object): New function.
1370 (Incremental_script_entry::objects_): New data member; adjust
1371 constructor.
1372 (Incremental_inputs::report_archive_begin): Add script_info parameter.
1373 (Incremental_inputs::report_object): Add script_info parameter.
1374 (Incremental_inputs_reader::get_object_count): New function.
1375 (Incremental_inputs_reader::get_object_offset): New function.
1376 * options.cc (Input_arguments::add_file): Return reference to
1377 new input argument.
1378 * options.h (Input_argument::set_script_info): New function.
1379 (Input_argument::script_info): New function.
1380 (Input_argument::script_info_): New data member; adjust all
1381 constructors.
1382 (Input_file_group::add_file): Return reference to new input argument.
1383 (Input_file_lib::add_file): Likewise.
1384 (Input_arguments::add_file): Likewise.
1385 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
1386 * script.cc (Parser_closure::Parser_closure): Add script_info
1387 parameter; adjust all callers.
1388 (Parser_closure::script_info): New function.
1389 (Parser_closure::script_info_): New data member.
1390 (read_input_script): Report scripts earlier to incremental info.
1391 (script_add_file): Set script_info in Input_argument.
1392 (script_add_library): Likewise.
1393 * script.h (Script_options::Script_info): Rewrite class.
1394
a869183f 13952011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
1396
1397 * archive.cc (Library_base::should_include_member): Move
1398 method here from class Archive.
1399 (Archive::Archive): Initialize base class.
1400 (Archive::should_include_member): Move to base class.
1401 (Archive::do_for_all_unused_symbols): New function.
1402 (Add_archive_symbols::run): Remove redundant access to
1403 incremental_inputs.
1404 (Lib_group::Lib_group): Initialize base class.
1405 (Lib_group::do_filename): New function.
1406 (Lib_group::include_member): Pass pointer to Lib_group to
1407 report_object.
1408 (Lib_group::do_for_all_unused_symbols): New function.
1409 (Add_lib_group_symbols::run): Report archive information for
1410 incremental links.
1411 * archive.h (class Library_base): New base class.
1412 (class Archive): Derive from Library_base.
1413 (Archive::filename): Move to base class.
1414 (Archive::set_incremental_info): Likewise.
1415 (Archive::incremental_info): Likewise.
1416 (Archive::Should_include): Likewise.
1417 (Archive::should_include_member): Likewise.
1418 (Archive::Armap_entry): Remove.
1419 (Archive::Unused_symbol_iterator): Remove.
1420 (Archive::unused_symbols_begin): Remove.
1421 (Archive::unused_symbols_end): Remove.
1422 (Archive::do_filename): New function.
1423 (Archive::do_get_mtime): New function.
1424 (Archive::do_for_all_unused_symbols): New function.
1425 (Archive::task_): Move to base class.
1426 (Archive::incremental_info_): Likewise.
1427 (class Lib_group): Derive from Library_base.
1428 (Lib_group::do_filename): New function.
1429 (Lib_group::do_get_mtime): New function.
1430 (Lib_group::do_for_all_unused_symbols): New function.
1431 (Lib_group::task_): Move to base class.
1432 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1433 function.
1434 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1435 function.
1436 * incremental.cc (Incremental_inputs::report_archive_begin):
1437 Use Library_base; call library's get_mtime; add incremental inputs
1438 entry before members.
1439 (class Unused_symbol_visitor): New class.
1440 (Incremental_inputs::report_archive_end): Use Library_base; use
1441 visitor class to record unused symbols; don't add incremental inputs
1442 entry after members.
1443 (Incremental_inputs::report_object): Use Library_base.
1444 * incremental.h
1445 (Incremental_archive_entry::Incremental_archive_entry): Remove
1446 unused Archive parameter.
1447 (Incremental_inputs::report_archive_begin): Use Library_base.
1448 (Incremental_inputs::report_archive_end): Likewise.
1449 (Incremental_inputs::report_object): Likewise.
1450 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1451 function.
1452 * object.h (Object::for_all_global_symbols): New function.
1453 (Object::do_for_all_global_symbols): New function.
1454 (Sized_relobj::do_for_all_global_symbols): New function.
1455 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1456 function.
1457 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1458 function.
1459
61ab3e40
ILT
14602011-03-27 Ian Lance Taylor <iant@google.com>
1461
1462 * archive.cc (Archive::interpret_header): Return -1 if something
1463 goes wrong. Change callers accordingly.
1464
30e1f9e6
CC
14652011-03-25 Cary Coutant <ccoutant@google.com>
1466
1467 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1468 * testsuite/Makefile.in: Regenerate.
1469
9c793f14
RÁE
14702010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1471
1472 * plugin.cc (get_view): New.
1473 (Plugin::load): Pass get_view to the plugin.
1474 (Plugin_manager::get_view): New.
1475
9312bb0a
ILT
14762011-03-21 Ian Lance Taylor <iant@google.com>
1477
1478 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1479 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1480
7e12ba9e
ST
14812011-03-21 Sriraman Tallam <tmsriram@google.com>
1482
1483 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1484 Change == to -eq.
1485 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1486 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1487 Change == to -eq.
1488 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1489 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1490
fd7a005d
ILT
14912011-03-14 Ian Lance Taylor <iant@google.com>
1492
1493 * script-sections.cc (Sort_output_sections::script_compare):
1494 Rename from is_before, change return type.
1495 (Sort_output_sections::operator()): Adjust accordingly.
1496
ed16fd1b
ILT
14972011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1498
1499 PR gold/12572
1500 * testsuite/odr_violation2.cc: Add comment to make all error line
1501 numbers double digits.
1502 * testsuite/debug_msg.sh: Adjust expected errors.
1503
71ff8986
ILT
15042011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1505
1506 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1507 but mark earlier ones as non-canonical
1508 (offset_to_iterator): Update search target and example
1509 (do_addr2line): Return extra lines in a vector*
1510 (format_file_lineno): Extract from do_addr2line
1511 (one_addr2line): Add vector* out-param
1512 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1513 when a lineno entry appeared last for its instruction
1514 (Dwarf_line_info): Add vector* out-param
1515 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1516 * symtab.cc (Odr_violation_compare): Include the lineno in the
1517 comparison again.
1518 (linenos_from_loc): New. Combine the canonical line for an
1519 address with its other lines.
1520 (True_if_intersect): New. Helper functor to make
1521 std::set_intersection a query.
1522 (detect_odr_violations): Compare sets of lines instead of just
1523 one line for each function. This became less deterministic, but
1524 has fewer false positives.
1525 * symtab.h: Declarations.
1526 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1527 mix an optimized and non-optimized object in the same binary
1528 (odr_violation2.so): Same.
1529 * testsuite/Makefile.in: Regenerate from Makefile.am.
1530 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1531 * testsuite/debug_msg.sh: Update line numbers and add
1532 assertions.
1533 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1534 non-optimized context.
1535 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1536 isn't inlined, and use OdrDerived in an optimized context.
1537 * testsuite/odr_header1.h: Defines OdrDerived, where
1538 optimization will change the
1539 first-instruction-in-the-destructor's file and line number.
1540 * testsuite/odr_header2.h: Defines OdrBase.
1541
a19fefdc
ILT
15422011-03-09 Ian Lance Taylor <iant@google.com>
1543
1544 * fileread.cc (File_read::clear_views): Don't delete the whole
1545 file view.
1546
ecb351e9
ILT
15472011-03-08 Ian Lance Taylor <iant@google.com>
1548
1549 PR gold/12525
1550 * fileread.cc: #include <climits>.
1551 (GOLD_IOV_MAX): Define.
1552 (File_read::read_multiple): Limit number of entries by iov_max.
1553 * fileread.h (class File_read): Always set max_readv_entries to
1554 128.
1555
b821d13c
ILT
15562011-03-07 Ian Lance Taylor <iant@google.com>
1557
1558 PR gold/12525
1559 * options.h (class General_options): Add -dy and -dn.
1560
89243142
CC
15612011-03-02 Cary Coutant <ccoutant@google.com>
1562
1563 * testsuite/script_test_9.t: Add TLS segment.
1564
d0773f31
ILT
15652011-03-02 Simon Baldwin <simonb@google.com>
1566
1567 * configure.ac: Add check for gnu_indirect_function support in
1568 the toolchain building binutils.
1569 * configure: Rebuild.
1570
badc8139
RÁE
15712010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1572
1573 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1574 plugin only symbols.
1575 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1576 in plugin files as not needed in the symbol table.
1577
4cf7a849
ST
15782011-02-11 Sriraman Tallam <tmsriram@google.com>
1579
1580 * output.cc (Output_section::add_input_section): Delay fill
1581 generation for section ordering.
1582
b578bd7d
ILT
15832011-02-09 Ian Lance Taylor <iant@google.com>
1584
1585 PR gold/12316
1586 * object.h (class Sized_relobj): Remove clear_local_symbols.
1587 * reloc.cc (Sized_relobj::do_relocate): Don't call
1588 clear_local_symbols.
1589
84ced98a
RÁE
15902010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1591
1592 * plugin.cc (is_visible_from_outside): Return true for symbols
1593 in the -u option.
1594
55382fb7
ILT
15952011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1596
1597 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1598 filename.
1599
4e271fff
ST
16002011-02-02 Sriraman Tallam <tmsriram@google.com>
1601
1602 * icf.h (is_section_foldable_candidate): Change type of parameter
1603 to std::string.
1604 * icf.cc (Icf::find_identical_sections): Change type of local variable
1605 section_name to be std::string.
1606 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1607
d433c3ac
ILT
16082011-01-25 Ian Lance Taylor <iant@google.com>
1609
1610 * script.cc (script_add_extern): Rewrite to use
1611 add_symbol_reference.
1612
880473a6
DK
16132011-01-25 Doug Kwan <dougkwan@google.com>
1614
d433c3ac 1615 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1616
f30f86fa
ILT
16172011-01-24 Ian Lance Taylor <iant@google.com>
1618
1619 * options.h (class General_options): Accept
1620 --no-detect-odr-violations.
1621
8e51a0b9
ILT
16222011-01-24 Ian Lance Taylor <iant@google.com>
1623
1624 * version.cc (version_string): Bump to 1.11.
1625
0f3b89d8
ILT
16262011-01-24 Ian Lance Taylor <iant@google.com>
1627
1628 * plugin.cc (class Plugin_rescan): Define new class.
1629 (Plugin_manager::claim_file): Set any_claimed_.
1630 (Plugin_manager::save_archive): New function.
1631 (Plugin_manager::save_input_group): New function.
1632 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1633 necessary.
1634 (Plugin_manager::new_undefined_symbol): New function.
1635 (Plugin_manager::rescan): New function.
1636 (Plugin_manager::rescannable_defines): New function.
1637 (Plugin_manager::add_input_file): Set any_added_.
1638 * plugin.h (class Plugin_manager): define new fields rescannable_,
1639 undefined_symbols_, any_claimed_, and any_added_. Declare
1640 Plugin_rescan as friend. Declare new functions.
1641 (Plugin_manager::Rescannable): Define type.
1642 (Plugin_manager::Rescannable_list): Define type.
1643 (Plugin_manager::Undefined_symbol_list): Define type.
1644 (Plugin_manager::Plugin_manager): Initialize new fields.
1645 * archive.cc (Archive::defines_symbol): New function.
1646 (Add_archive_symbols::run): Pass archive to plugins if any.
1647 * archive.h (class Archive): Declare defines_symbol.
1648 * readsyms.cc (Input_group::~Input_group): New function.
1649 (Finish_group::run): Pass input_group to plugins if any.
1650 * readsyms.h (class Input_group): Declare destructor.
1651 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1652 any.
1653
3bb951e5
ILT
16542011-01-10 Ian Lance Taylor <iant@google.com>
1655
1656 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1657 section as relro.
1658 (Layout::set_segment_offsets): Reset increase_relro before calling
1659 set_section_addresses a second time.
1660
0aa45fac
CC
16612011-01-04 Cary Coutant <ccoutant@google.com>
1662
1663 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1664 sections before NOBITS sections.
1665
0db46eb4
L
16662011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1667
1668 * version.cc (print_version): Update copyright to 2011.
1669
829c9745
CC
16702010-12-23 Cary Coutant <ccoutant@google.com>
1671
1672 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1673 of OS to this->add. Add OD parameter to second form of the function.
1674
7500420b
ILT
16752010-12-20 Ian Lance Taylor <iant@google.com>
1676
1677 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1678 second of two consecutive entries with same offset.
1679
f8e9a930
RW
16802010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1681
1682 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1683 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1684 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1685 to avoid unneeded links against $(LDADD).
1686 * testsuite/Makefile.in: Regenerate.
1687
2fbb4320
ILT
16882010-12-15 Ian Lance Taylor <iant@google.com>
1689
1690 PR gold/12324
1691 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1692 for R_X86_64_32 and R_X86_64_PC32.
1693 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1694 ver_matching_def_pic.o.
1695 (ver_matching_def_pic.o): New target.
1696
fedb228d
RW
16972010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1698
1699 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1700 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1701 Move definition before File_read::View member definitions.
1702 (File_read::View::~View): Initialize and hold lock before
1703 updating current_mapped_bytes.
1704
9b547ce6
RW
17052010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1706
1707 * dwarf_reader.cc: Remove outdated comment.
1708 * gold-threads.cc: Fix typo in error message.
1709 * archive.cc: Fix typos in comments.
1710 * archive.h: Likewise.
1711 * arm-reloc-property.cc: Likewise.
1712 * arm-reloc-property.h: Likewise.
1713 * arm-reloc.def: Likewise.
1714 * arm.cc: Likewise.
1715 * attributes.h: Likewise.
1716 * cref.cc: Likewise.
1717 * ehframe.cc: Likewise.
1718 * fileread.h: Likewise.
1719 * gold.h: Likewise.
1720 * i386.cc: Likewise.
1721 * icf.cc: Likewise.
1722 * incremental.h: Likewise.
1723 * int_encoding.cc: Likewise.
1724 * layout.h: Likewise.
1725 * main.cc: Likewise.
1726 * merge.h: Likewise.
1727 * object.cc: Likewise.
1728 * object.h: Likewise.
1729 * options.cc: Likewise.
1730 * readsyms.cc: Likewise.
1731 * reduced_debug_output.cc: Likewise.
1732 * reloc.cc: Likewise.
1733 * script-sections.cc: Likewise.
1734 * sparc.cc: Likewise.
1735 * symtab.h: Likewise.
1736 * target-reloc.h: Likewise.
1737 * target.cc: Likewise.
1738 * target.h: Likewise.
1739 * timer.cc: Likewise.
1740 * timer.h: Likewise.
1741 * x86_64.cc: Likewise.
1742
83e17bd5
CC
17432010-12-09 Cary Coutant <ccoutant@google.com>
1744
1745 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1746 stack.
1747 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1748 parameter; change all callers.
1749 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1750 * options.h (warn_execstack): New option.
1751
017257f8
DK
17522010-12-07 Doug Kwan <dougkwan@google.com>
1753
1754 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1755 like function call relocations.
1756
c20cbc06
ILT
17572010-12-07 Ian Lance Taylor <iant@google.com>
1758
1759 * archive.cc (Archive::get_elf_object_for_member): Permit
1760 punconfigured to be NULL.
1761 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1762 (Archive::include_member): Pass NULL to get_elf_object_for_member
1763 if we searched for the archive and this is the first included
1764 object.
1765
4dbfafcc
ILT
17662010-12-01 Ian Lance Taylor <iant@google.com>
1767
1768 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1769 track_relocs_type_ field.
1770 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1771 Set track_relocs_type_.
1772 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1773 contents when using RELA relocs.
1774 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1775 reloc_map_.
1776 * reloc.cc (Track_relocs::next_addend): New function.
1777 * reloc.h (class Track_relocs): Declare next_addend.
1778
e5e19edd
ILT
17792010-12-01 Ian Lance Taylor <iant@google.com>
1780
1781 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1782 virtual destructor.
1783
9a5ce24c
ILT
17842010-12-01 Ian Lance Taylor <iant@google.com>
1785
1786 * README: Update compilers known to work and fail.
1787
c7791212
NC
17882010-11-23 Matthias Klose <doko@ubuntu.com>
1789
1790 * configure.in: For --enable-gold, handle value `default' instead of
1791 `both*'. Always install ld as ld.bfd, install as ld if gold is
1792 not the default.
1793 * configure: Regenerate.
1794
0ad220c9
DK
17952010-11-18 Doug Kwan <dougkwan@google.com>
1796
1797 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1798 and right_alignment to be zero. Store result alignment only if it is
1799 greater than existing alignment.
1800
ab8056e0
CC
18012010-11-16 Cary Coutant <ccoutant@google.com>
1802
1803 PR gold/12220
1804 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1805 Check for ".zdebug_line".
1806
fd064a5b
CC
18072010-11-16 Doug Kwan <dougkwan@google.com>
1808 Cary Coutant <ccoutant@google.com>
1809
1810 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1811 by reference; adjust all callers.
1812 * output.cc (Output_segment::set_section_addresses): Adjust references
1813 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1814 list is empty.
1815 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1816 end at page boundary.
1817
6fc6ea19
CC
18182010-11-16 Cary Coutant <ccoutant@google.com>
1819
1820 PR gold/12220
1821 * layout.cc (Layout::choose_output_section): Transform names of
1822 compressed sections even when using a script with a SECTIONS clause.
1823 (Layout::output_section_name): Remove code to transform
1824 compressed debug section names.
1825 * output.cc (Output_section::add_input_section): Use uncompressed
1826 section size when tracking input sections.
1827
95a2c8d6
RS
18282010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1829
1830 * symtab.h (Symbol::NON_PIC_REF): Remove.
1831 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1832 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1833 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1834 (Symbol::use_plt_offset): Take a flags argument and pass it
1835 directly to needs_dynamic_reloc. Restrict check for undefined
1836 weak symbols to function calls.
1837 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1838 (Target_arm::Scan::global): Use it.
1839 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1840 (Target_arm::Relocate::relocate): Likewise.
1841 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1842 parameter with an r_type parameter. Use get_reference_flags
1843 to get the flags.
1844 (Target_arm::Relocate::relocate): Update accordingly.
1845 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1846 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1847 (Target_i386::Scan::global): Likewise.
1848 (Target_i386::Relocate::relocate): Likewise.
1849 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1850 parameter with an r_type parameter. Use get_reference_flags
1851 to get the flags.
1852 (Target_i386::Relocate::relocate): Update accordingly.
1853 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1854 (Target_powerpc::Scan::global): Use it.
1855 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1856 (Target_powerpc::Relocate::relocate): Likewise.
1857 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1858 (Target_sparc::Scan::global): Use it.
1859 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1860 (Target_sparc::Relocate::relocate): Likewise.
1861 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1862 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1863 (Target_x86_64::Scan::global): Likewise.
1864 (Target_x86_64::Relocate::relocate): Likewise.
1865
f625ae50
DK
18662010-11-08 Doug Kwan <dougkwan@google.com>
1867 Cary Coutant <ccoutant@google.com>
1868
1869 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1870 (Arm_exidx_merge_section::section_contents_): New data member.
1871 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1872 (Arm_input_section::~Arm_input_section): De-allocate memory.
1873 (Arm_input_section::original_contents_): New data member.
1874 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1875 in parameters instead of calling Object::section_contents without
1876 locking.
1877 (Arm_output_section::group_section): New parameter TASK. Pass it
1878 to callees that need locking objects.
1879 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1880 to lock EXIDX input sections. Fix a formatting issue. Call
1881 Arm_exidx_merged_section::build_contents to create merged section
1882 contents.
1883 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1884 to lock object of stub table owner.
1885 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1886 TEXT_SIZE to initialize data member TEXT_SIZE_.
1887 (Arm_exidx_input_section::addralign): Fix typo in comment.
1888 (Arm_exidx_input_section::text_size): New method.
1889 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1890 that require locking objects. Lock objects before scanning for stubs
1891 and updating local symbols.
1892 (Arm_input_section<big_endian>::init): Copy contents of original
1893 input section.
1894 (Arm_input_section<big_endian>::do_write): Use saved contents of
1895 original input section instead of calling Object::section_contents
1896 without locking.
1897 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1898 size without calling Object::section_size().
1899 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1900 for size. Allocate a buffer for merged EXIDX entries.
1901 (Arm_exidx_merged_section::build_contents): New method.
1902 (Arm_exidx_merged_section::do_write): Move merge section contents
1903 building code to Arm_exidx_merged_section::build_contetns. Write
1904 out contetns in buffer instead of building it on the fly.
1905 (Arm_relobj::make_exidx_input_section): Also pass text section size
1906 to Arm_exidx_input_section constructor.
1907 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1908 (Arm_dynobj::do_read_symbols): Fix memory leak.
1909 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1910 * target.h: (class Task): Add forward declaration.
1911 (Target::relax): Add new parameter TASK and pass it to
1912 Target::do_relax().
1913 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1914
5f9bcf58
CC
19152010-11-05 Cary Coutant <ccoutant@google.com>
1916
1917 PR gold/10708
1918 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1919 object when reading from the file.
1920 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1921 second layout pass.
1922 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1923 when reading section contents.
1924 (get_section_contents): Likewise.
1925 (icf::find_identical_sections): Likewise.
1926 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1927 object when reading from the file.
1928 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1929 the object when doing deferred section layout.
1930
e597fa08
NC
19312010-11-03 Nick Clifton <nickc@redhat.com>
1932
1933 PR gold/12001
1934 * script.h (class Symbol_assignment: name): New member. Returns
1935 the name of the symbol.
1936 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1937 Returns true if the given symbol name is on the list of
1938 assignments wating to be processed.
1939 * archive.cc (should_incldue_member): If the symbol is undefined,
1940 check to see if it is on the list of symbols pending assignment.
1941
3f9a3278
ILT
19422010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1943
1944 * script-sections.cc (Script_sections::find_memory_region): Check
1945 for a NULL output section pointer.
1946
d06fb4d1
DK
19472010-10-29 Doug Kwan <dougkwan@google.com>
1948
1949 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1950 Output_section::add_relaxed_input_section.
1951 * output.cc (Output_section::add_relaxed_input_section): Add new
1952 arguments LAYOUT and NAME. Set section order index.
1953 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1954 Copy section order index.
1955 * output.h (Output_section::add_relaxed_input_section): Add new
1956 arguments LAYOUT and NAME.
1957
90e24de5
ILT
19582010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1959
1960 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1961 NATIVE_OR_CROSS_LINKER.
1962 * testsuite/Makefile.in: Regenerate.
1963
c9484ea5
DK
19642010-10-20 Doug Kwan <dougkwan@google.com>
1965
1966 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1967 without SHF_LINK_ORDER flags.
1968 * layout.cc (Layout::choose_output_section): Do not filter
1969 SHF_LINK_ORDER flag in a relocatable link.
1970
5bc2f5be
CC
19712010-10-17 Cary Coutant <ccoutant@google.com>
1972
1973 * output.h (Output_segment::set_section_addresses): Change function
1974 signature. Update all callers.
1975 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1976 sections.
1977 (Output_segment::set_section_addresses): Align after last TLS
1978 section. Add padding before last relro section instead of after.
1979
0c91cf04
DK
19802010-10-17 Doug Kwan <dougkwan@google.com>
1981
1982 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1983 GOT output section to be writable.
1984
8c21d9d3
CC
19852010-10-14 Cary Coutant <ccoutant@google.com>
1986
1987 * debug.h (DEBUG_INCREMENTAL): New flag.
1988 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1989 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1990 mode.
1991 * incremental.cc (report_command_line): Ignore all forms of
1992 --incremental.
1993 * layout.cc (Layout::Layout): Check parameters for incremental link
1994 mode.
1995 * options.cc (General_options::parse_incremental): New function.
1996 (General_options::parse_no_incremental): New function.
1997 (General_options::parse_incremental_full): New function.
1998 (General_options::parse_incremental_update): New function.
1999 (General_options::incremental_mode_): New data member.
2000 (General_options::finalize): Check incremental_mode_.
2001 * options.h (General_options): Update help text for --incremental.
2002 Add --no-incremental, --incremental-full, --incremental-update.
2003 (General_options::Incremental_mode): New enum type.
2004 (General_options::incremental_mode): New function.
2005 (General_options::incremental_mode_): New data member.
2006 * parameters.cc (Parameters::incremental_mode_): New data member.
2007 (Parameters::set_options): Set incremental_mode_.
2008 (Parameters::set_incremental_full): New function.
2009 (Parameters::incremental): New function.
2010 (Parameters::incremental_update): New function.
2011 (set_parameters_incremental_full): New function.
2012 * parameters.h (Parameters::set_incremental_full): New function.
2013 (Parameters::incremental): New function.
2014 (Parameters::incremental_update): New function.
2015 (Parameters::incremental_mode_): New data member.
2016 (set_parameters_incremental_full): New function.
2017 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
2018 incremental link mode.
2019 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
2020 (Sized_relobj::do_relocate_sections): Likewise.
2021 * testsuite/Makefile.am (incremental_test): Use --incremental-full
2022 option.
2023 * testsuite/Makefile.in: Regenerate.
2024 * testsuite/incremental_test.sh: Filter all forms of --incremental.
2025
bb32aa18 20262010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
2027
2028 * script-sections.h (class Script_sections): Make
2029 Sections_elements typedef public.
2030 * script-sections.cc (class Sort_output_sections): Add elements_
2031 field. Add constructor which sets it; change all callers.
2032 (Sort_output_sections::is_before): New function.
2033 (Sort_output_sections::operator()): Call is_before.
2034 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
2035 conditional.
2036 * testsuite/script_test_10.sh: New test. Test script section
2037 order.
2038 * testsuite/script_test_10.t: Likewise.
2039 * testsuite/script_test_10.s: Likewise.
2040 * testsuite/Makefile.am: Wrap the cross linker tests and the
2041 common tests into NATIVE_OR_CROSS_LINKER.
2042 (check_SCRIPTS): Add script_test_10.sh.
2043 (check_DATA): Add script_test_10.stdout.
2044 (script_test_10.o, script_test_10): New targets.
2045 (script_test_10.stdout): New target.
2046 * configure, testsuite/Makefile.in: Regenerate.
2047
3cef7179
ILT
20482010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2049
2050 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
2051 error for the deprecated relocations.
2052 (Target_arm::Scan::global): Likewise.
2053 (Target_arm::Relocate::relocate): Likewise.
2054
7411e9a8
RS
20552010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
2056
2057 * fileread.cc (Input_file::find_file): Initialize *found_name
2058 and *namep when using the fallback search for case 4.
2059
6a9da32a
CC
20602010-10-11 Cary Coutant <ccoutant@google.com>
2061
2062 * options.h (class General_options): Redefine -z lazy as an alias for
2063 the negation of -z now.
2064
ac897c20
ILT
20652010-10-11 Ian Lance Taylor <iant@google.com>
2066
2067 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2068 binding.
2069
ea5cae92
NC
20702010-10-06 Nick Clifton <nickc@redhat.com>
2071
2072 * script-sections.cc(class Memory_region): Remove
2073 current_lma_offset_ field. Rename current_vma_offset_ to
2074 current_offset_. Add last_section_ field.
2075 (Memory_region::get_current_vma_address): Rename to
2076 get_current_address.
2077 (Memory_region::get_current_lma_address): Delete.
2078 (Memory_region::increment_vma_offset): Rename to
2079 increment_offset.
2080 (Memory_region::increment_lma_offset): Delete.
2081 (Memory_region::attributes_compatible): New method. Returns
2082 true if the provided section is compatible with the region.
2083 (Memory_region::get_last_section): New method. Returns the last
2084 section to use the region.
2085 (Memory_region::set_last_section): New method. Stores the last
2086 section to use the region.
2087 (Script_sections::block_in_region): New method. Returns true if
2088 a block of memory is contained within a region.
2089 (Script_sections::find_memory_region): New method. Locates a
2090 memory region to be used to set a VMA or LMA address.
2091 (Output_section_definition::set_section_addresses): Add code to
2092 check for addresses set by memory regions.
2093 (Output_segment::set_section_addresses): Remove memory region
2094 walking code.
2095 (Script_sections::create_segment): Add a warning if a header
2096 segment is created outside of any region.
2097 * script-sections.h (class Script_sections): Add prototypes for
2098 find_memory_region and block_in_region methods.
2099 * testsuite/memory_test.s: Use .long instead of .word.
2100 * testsuite/memory_test.t: Add some more output sections.
2101 * testsuite/memory_test.sh: Update expected output.
2102
a9bfd952
DK
21032010-10-02 Doug Kwan <dougkwan@google.com>
2104
2105 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2106 defintion to symtab.h
2107 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2108 declaration to defintion.
2109
bacff3ab
NC
21102010-10-01 Nick Clifton <nickc@redhat.com>
2111
2112 * expression.cc (eval): Replace dummy argument with NULL.
2113 (eval_maybe_dot): Check for a NULL result section pointer.
2114 (Symbol_expression::value): Likewise.
2115 (Dot_expression::value): Likewise.
2116 (BINARY_EXPRESSION): Likewise.
2117 (Max_expression::value): Likewise.
2118 (Min_expression::value): Likewise.
2119 (Absolute_expression::value): Likewise.
2120 (Addr_expression::value_from_output_section): Likewise.
2121 (Loaddddr_expression::value_from_output_section): Likewise.
2122 (Segment_start_expression::value): Likewise.
2123 * script-sections.cc
2124 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2125 argument with NULL.
2126 (Sections_elememt_dot_assignment::set_section_addresses):
2127 Likewise.
2128 (Output_data_expression::do_write_to_buffer): Likewise.
2129 (Output_section_definition::finalize_symbols): Likewise.
2130 (Output_section_definition::set_section_addresses): Likewise.
2131
f81bc8b5
DK
21322010-09-30 Doug Kwan <dougkwan@google.com>
2133
2134 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2135
c95e9f27
ST
21362010-09-28 Sriraman Tallam <tmsriram@google.com>
2137
2138 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 2139 function.
c95e9f27
ST
2140 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2141 virtual function.
2142 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2143 virtual function.
2144 * icf.cc (get_section_contents): Inline merge sections only when
2145 target allows it.
2146
3cac54d2
RW
21472010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2148
2149 * configure: Regenerate.
2150
2904037a
ILT
21512010-09-17 Ian Lance Taylor <iant@google.com>
2152
2153 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
2154 * testsuite/Makefile.am (memory_test.o): New target.
2155 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2156 memory_test.t.
2157 * testsuite/Makefile.in: Rebuild.
2904037a 2158
bca7fb63
DK
21592010-09-17 Doug Kwan <dougkwan@google.com>
2160
2161 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2162 defintion if relocation uses GOT entries of the symbol.
2163 * testsuite/icf_safe_test.sh: Fix test.
2164 * testsuite/icf_safe_so_test.sh: Fix test.
2165
4ef28648
CC
21662010-09-16 Cary Coutant <ccoutant@google.com>
2167
2168 * script_sections.cc (class Memory_region): Remove "NULL" from
2169 vector initializations.
2170
793990de
CC
21712010-09-15 Cary Coutant <ccoutant@google.com>
2172
2173 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2174 Resolve forwarding symbols.
2175
81e015e2
DK
21762010-09-15 Doug Kwan <dougkwan@google.com>
2177
2178 * gold/testsuite/script_test_3.t: Add ARM special sections.
2179 * gold/testsuite/script_test_4.t: Same.
2180 * gold/testsuite/script_test_5.t: Same.
2181 * gold/testsuite/script_test_6.t: Same.
2182 * gold/testsuite/script_test_7.t: Same.
2183 * gold/testsuite/script_test_7.t: Same.
2184 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2185
36171d64
CC
21862010-09-14 Cary Coutant <ccoutant@google.com>
2187
2188 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2189 (Target_x86_64::Relocate::relocate_tls): Replace check for
2190 saw_tls_block_reloc_ with test for executable section.
2191
d89051bd
CC
21922010-09-12 Cary Coutant <ccoutant@google.com>
2193
2194 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2195 position-independent executables to shared libraries need dynamic
2196 relocations.
2197 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2198 position-independent executables.
2199 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2200 * testsuite/Makefile.in: Regenerate.
2201
fca41f0f
NC
22022010-09-10 Nick Clifton <nickc@redhat.com>
2203
2204 PR gold/11997
2205 * testsuite/memory_test.t: Discard any sections that are not
2206 needed.
2207
6695e4b3
L
22082010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2209
2210 PR gold/11996
2211 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2212 "This::" to work around a bug in gcc 4.2.
2213
2214 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2215
0f72bf6f
RÁE
22162010-09-09 Rafael Espindola <espindola@google.com>
2217
2218 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
2219 sections with different PF_X flags in the same segment.
2220 (Layout::find_first_load_seg): Search all segments to find the first
2221 one.
2222 * options.h (rosegment): New.
2223
22242010-09-08 Rafael Espindola <espindola@google.com>
a6577478 2225
05a79166 2226 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 2227
aa98ff75
DK
22282010-09-08 Doug Kwan <dougkwan@google.com>
2229
2230 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
2231 (Arm_relobj::do_relocate_sections): Add new parameter for output
2232 file to match the parent.
2233 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
2234 of local symbols instead of input values. Update code to track
2235 changes in gold::relocate_section.
2236 * object.cc (Sized_relobj::compute_final_local_value): New methods.
2237 (Sized_relobj::compute_final_local_value_internal): New methods.
2238 (Sized_relobj::do_finalize_local_symbols): Move code from loop
2239 body into private version of Sized_relobj::compute_final_local_value.
2240 Call the inline method.
2241 * object.h (Symbol_value::Symbol_value): Define destructor. Free
2242 merged symbol value if there is one.
2243 (Symbol_value::has_output_value): New method defintiion.
2244 (Sized_relobj::Compute_final_local_value_status): New enum type.
2245 (Sized_relobj::compute_final_local_value): New methods.
2246 (Sized_relobj::compute_final_local_value_internal): New methods.
2247 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
2248 and arm_cortex_a8.sh.
2249 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
2250 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
2251 New tests.
2252 * Makefile.in: Regenerate.
2253 * testsuite/arm_bl_out_of_range.s: Update test.
2254 * testsuite/thumb_bl_out_of_range.s: Ditto.
2255 * testsuite/thumb_blx_out_of_range.s: Ditto.
2256 * testsuite/arm_branch_out_of_range.sh: New file.
2257 * testsuite/arm_cortex_a8.sh: Ditto.
2258 * testsuite/arm_cortex_a8_b.s: Ditto.
2259 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
2260 * testsuite/arm_cortex_a8_b_local.s: Ditto.
2261 * testsuite/arm_cortex_a8_bl.s: Ditto.
2262 * testsuite/arm_cortex_a8_blx.s: Ditto.
2263 * testsuite/arm_cortex_a8_local.s: Ditto.
2264 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
2265 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2266
05a79166
L
22672010-09-08 Rafael Espindola <espindola@google.com>
2268
2269 * Makefile.am (memory_test.stdout): Run readelf with -W.
2270 * Makefile.in: Regenerate.
2271 * testsuite/memory_test.sh: Make the regexps accept both 32 and
2272 64 bit output.
2273
33dbc701
RÁE
22742010-09-08 Rafael Espindola <espindola@google.com>
2275
2276 * script-sections.cc (Script_sections::add_memory_region): Convert
2277 field precision to int.
2278 * script.cc (script_set_section_region, script_set_section_region):
2279 Convert field precision to int.
2280
731ca54a
RÁE
22812010-09-08 Rafael Espindola <espindola@google.com>
2282
2283 * arm.cc (do_finalize_sections): Create the __exidx_start and
2284 __exdix_end symbols even when the section is missing.
2285
7f8cd844
NC
22862010-09-08 Nick Clifton <nickc@redhat.com>
2287
2288 * README: Remove claim that MEMORY is not supported.
2289 * expression.cc (script_exp_function_origin)
2290 (script_exp_function_length): Move from here to ...
2291 * script.cc: ... here.
2292 (script_set_section_region, script_add_memory)
2293 (script_parse_memory_attr, script_include_directive): New
2294 functions.
2295 * script-sections.cc
2296 (class Memory_region): New class.
2297 (class Output_section_definition): Add set_memory_region,
2298 set_section_vma, set_section_lma and get_section_name methods.
2299 (class Script_Sections): Add add_memory_region,
2300 find_memory_region, find_memory_region_origin,
2301 find_memory_region_length and set_memory_region methods.
2302 Have set_section_addresses method walk the list of set memory
2303 regions.
2304 Extend the print methos to display memory regions.
2305 * script-sections.h: Add prototypes for new methods.
2306 Add enum for MEMORY region attributes.
2307 * yyscript.y: Add support for parsing MEMORY regions.
2308 * script-c.h: Add prototypes for new functions.
2309 * testsuite/Makefile.am: Add test of MEMORY region functionality.
2310 * testsuite/Makefile.in: Regenerate.
2311 * testsuite/memory_test.sh: New script.
2312 * testsuite/memory_test.s: New assembler source file.
2313 * testsuite/memory_test.t: New linker script.
2314
a4649286
DK
23152010-08-27 Doug Kwan <dougkwan@google.com>
2316
2317 * gold/resolve.cc (Symbol_table::should_override): Let a weak
2318 reference override an existing dynamic weak reference.
2319 * testsuite/Makefile.am: Add new test dyn_weak_ref.
2320 * testsuite/Makefile.in: Regenerate.
2321 * testsuite/dyn_weak_ref.sh: New file.
2322 * testsuite/dyn_weak_ref_1.c: Ditto.
2323 * testsuite/dyn_weak_ref_2.c: Ditto.
2324
b56648ad
ILT
23252010-08-27 Ian Lance Taylor <iant@google.com>
2326
2327 * incremental.h (class Incremental_input_entry): Add virtual
2328 destructor.
2329
809313cb
ILT
23302010-08-27 Ian Lance Taylor <iant@google.com>
2331
2332 * testsuite/start_lib_test_3.c: Mark t3 as used.
2333
11e32464
NC
23342010-08-27 Nick Clifton <nickc@redhat.com>
2335
2336 * options.cc (version_script): Fix small typo in previous
2337 whitespace tidyup.
2338
ca09d69a
NC
23392010-08-25 Nick Clifton <nickc@redhat.com>
2340
2341 * archive.cc: Formatting fixes: Remove whitespace between
2342 typename and following asterisk. Remove whitespace between
2343 function name and opening parenthesis.
2344 * archive.h: Likewise.
2345 * arm.cc: Likewise.
2346 * attributes.cc: Likewise.
2347 * attributes.h: Likewise.
2348 * common.cc: Likewise.
2349 * copy-relocs.cc: Likewise.
2350 * dirsearch.h: Likewise.
2351 * dynobj.cc: Likewise.
2352 * ehframe.cc: Likewise.
2353 * ehframe.h: Likewise.
2354 * expression.cc: Likewise.
2355 * fileread.cc: Likewise.
2356 * fileread.h: Likewise.
2357 * gc.h: Likewise.
2358 * gold-threads.cc: Likewise.
2359 * gold.cc: Likewise.
2360 * i386.cc: Likewise.
2361 * icf.h: Likewise.
2362 * incremental-dump.cc: Likewise.
2363 * incremental.cc: Likewise.
2364 * layout.cc: Likewise.
2365 * layout.h: Likewise.
2366 * main.cc: Likewise.
2367 * merge.cc: Likewise.
2368 * merge.h: Likewise.
2369 * object.cc: Likewise.
2370 * object.h: Likewise.
2371 * options.cc: Likewise.
2372 * options.h: Likewise.
2373 * output.cc: Likewise.
2374 * output.h: Likewise.
2375 * plugin.cc: Likewise.
2376 * plugin.h: Likewise.
2377 * powerpc.cc: Likewise.
2378 * reloc.cc: Likewise.
2379 * script-c.h: Likewise.
2380 * script-sections.cc: Likewise.
2381 * script.cc: Likewise.
2382 * stringpool.cc: Likewise.
2383 * symtab.cc: Likewise.
2384 * symtab.h: Likewise.
2385 * target.cc: Likewise.
2386 * timer.cc: Likewise.
2387 * timer.h: Likewise.
2388 * version.cc: Likewise.
2389 * x86_64.cc: Likewise.
2390
b8fa8750
NC
23912010-08-24 Nick Clifton <nickc@redhat.com>
2392
2393 PR 11899
2394 * layout.cc (segment_precedes): Sort segments by their physical
2395 addresses, if they have been set.
2396
9919d93b
CC
23972010-08-23 Cary Coutant <ccoutant@google.com>
2398
2399 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2400 symbols data.
2401 (Lib_group::include_member): Unlock object after deleting its
2402 symbols data.
2403 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2404 the bug fixed here.
2405
97b4be1c
CC
24062010-08-19 Neil Vachharajani <nvachhar@google.com>
2407 Cary Coutant <ccoutant@google.com>
2408
2409 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2410 constructor, and set_blocker.
2411 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2412 readsyms_blocker_.
2413 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2414 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2415 * testsuite/Makefile.am (start_lib_test): New test case.
2416 * testsuite/Makefile.in: Regenerate.
2417 * testsuite/start_lib_test_main.c: New file.
2418 * testsuite/start_lib_test_1.c: New file.
2419 * testsuite/start_lib_test_2.c: New file.
2420 * testsuite/start_lib_test_3.c: New file.
2421
dd0b1884
ILT
24222010-08-19 Ian Lance Taylor <iant@google.com>
2423
2424 * Makefile.in: Rebuild with automake 1.11.1.
2425 * aclocal.m4: Likewise.
2426 * testsuite/Makefile.in: Likewise.
2427
7223e9ca
ILT
24282010-08-19 Ian Lance Taylor <iant@google.com>
2429
2430 PR 10893
2431 * i386.cc (class Output_data_plt_i386): Update declarations.
2432 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2433 local_ifuncs_ fields.
2434 (Target_i386::do_plt_section_for_global): New function.
2435 (Target_i386::do_plt_section_for_local): New function.
2436 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2437 parameter; change all callers. Initialize global_ifuncs_ and
2438 local_ifuncs_. If doing a static link define __rel_iplt_start and
2439 __rel_iplt_end.
2440 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2441 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2442 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2443 symbols.
2444 (Target_i386::make_plt_section): New function, broken out of
2445 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2446 (Target_i386::make_plt_entry): Call make_plt_section.
2447 (Target_i386::make_local_ifunc_plt_entry): New function.
2448 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2449 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2450 R_386_IRELATIVE to switch.
2451 (Target_i386::Scan::global): Likewise.
2452 (Target_i386::Relocate::relocate): Likewise.
2453 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2454 switch.
2455 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2456 (Target_x86_64::do_plt_section_for_global): New function.
2457 (Target_x86_64::do_plt_section_for_local): New function.
2458 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2459 parameter; change all callers. If doing a static link define
2460 __rela_iplt_start and __rela_iplt_end.
2461 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2462 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2463 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2464 to point to .plt.
2465 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2466 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2467 switch.
2468 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2469 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2470 R_X86_64_IRELATIVE to switch.
2471 (Target_x86_64::Scan::global): Likewise.
2472 (Target_x86_64::Relocate::relocate): Likewise.
2473 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2474 switch.
2475 * target.h (class Target): Add plt_section_for_global and
2476 plt_section_for_local functions. Add do_plt_section_for_global
2477 and do_plt_section_for_local virtual functions.
2478 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2479 clarifying comments.
2480 (Symbol::use_plt_offset): Handle IFUNC symbol.
2481 * object.cc (Sized_relobj::Sized_relobj): Initialize
2482 local_plt_offsets_.
2483 (Sized_relobj::local_has_plt_offset): New function.
2484 (Sized_relobj::local_plt_offset): New function.
2485 (Sized_relobj::set_local_plt_offset): New function.
2486 (Sized_relobj::do_count): Handle IFUNC symbol.
2487 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2488 a bit away from input_shndx_ field. Add set_is_func_symbol and
2489 is_ifunc_symbol functions.
2490 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2491 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2492 local_plt_offsets_ field.
2493 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2494 * output.h (class Output_section_data): Add non-const
2495 output_section function.
2496 (class Output_data_got): Update declarations.
2497 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2498 Add use_plt_offset parameter to global and local constructors.
2499 Change all callers. Change local_sym_index_ field to 31 bits.
2500 Change GSYM_CODE and CONSTANT_CODE accordingly.
2501 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2502 doing a static link don't set sh_link field.
2503 (Output_data_got::Got_entry::write): Use PLT offset if
2504 appropriate.
2505 (Output_data_got::add_global_plt): New function.
2506 (Output_data_got::add_local_plt): New function.
2507 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2508 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2509 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2510 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2511 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2512 IFUNC conditional.
2513 * testsuite/ifunc-sel.h: New file.
2514 * testsuite/ifuncmain1.c: New file.
2515 * testsuite/ifuncmain1vis.c: New file.
2516 * testsuite/ifuncmod1.c: New file.
2517 * testsuite/ifuncdep2.c: New file.
2518 * testsuite/ifuncmain2.c: New file.
2519 * testsuite/ifuncmain3.c: New file.
2520 * testsuite/ifuncmod3.c: New file.
2521 * testsuite/ifuncmain4.c: New file.
2522 * testsuite/ifuncmain5.c: New file.
2523 * testsuite/ifuncmod5.c: New file.
2524 * testsuite/ifuncmain6pie.c: New file.
2525 * testsuite/ifuncmod6.c: New file.
2526 * testsuite/ifuncmain7.c: New file.
2527 * configure, testsuite/Makefile.in: Rebuild.
2528
56f75c03
ILT
25292010-08-18 Ian Lance Taylor <iant@google.com>
2530
2531 * incremental.cc
2532 (Output_section_incremental_inputs::write_input_files): Add cast
2533 to avoid signed/unsigned comparison warning.
2534 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2535
55455f89
CC
25362010-08-12 Cary Coutant <ccoutant@google.com>
2537
2538 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2539
e2054bcb
ILT
25402010-08-13 Ian Lance Taylor <iant@google.com>
2541
2542 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2543
74f67560
DK
25442010-08-12 Cary Coutant <ccoutant@google.com>
2545 Doug Kwan <dougkwan@google.com>
2546
2547 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2548 defintion overrides non-weak undef, remember that the original undef
2549 is not weak.
2550 * symtab.cc (Symbol_table::sized_write_global): For undef without
2551 an original weak binding, set binding to global in output.
2552 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2553 * testsuite/Makefile.in: Regenerate.
2554 * testsuite/strong_ref_weak_def.sh: New file.
2555 * testsuite/strong_ref_weak_def_1.c: Ditto.
2556 * testsuite/strong_ref_weak_def_2.c: Ditto.
2557
d1238d12
CC
25582010-08-12 Cary Coutant <ccoutant@google.com>
2559
2560 * testsuite/incremental_test.sh: Rewrite.
2561 * testsuite/incremental_test_1.c: Rewrite.
2562 * testsuite/incremental_test_2.c: Rewrite.
2563
0e70b911
CC
25642010-08-12 Cary Coutant <ccoutant@google.com>
2565
2566 * arm.cc (Target_arm::got_size): Add const.
2567 (Target_arm::got_entry_count): New function.
2568 (Target_arm::plt_entry_count): New function.
2569 (Target_arm::first_plt_entry_offset): New function.
2570 (Target_arm::plt_entry_size): New function.
2571 (Output_data_plt_arm::entry_count): New function.
2572 (Output_data_plt_arm::first_plt_entry_offset): New function.
2573 (Output_data_plt_arm::get_plt_entry_size): New function.
2574 * i386.cc (Target_i386::got_size): Add const.
2575 (Target_i386::got_entry_count): New function.
2576 (Target_i386::plt_entry_count): New function.
2577 (Target_i386::first_plt_entry_offset): New function.
2578 (Target_i386::plt_entry_size): New function.
2579 (Output_data_plt_i386::entry_count): New function.
2580 (Output_data_plt_i386::first_plt_entry_offset): New function.
2581 (Output_data_plt_i386::get_plt_entry_size): New function.
2582 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2583 find_incremental_inputs_sections. Dump incremental_got_plt section.
2584 * incremental.cc: Include target.h.
2585 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2586 parameter. Adjust all callers. Find incremental_got_plt section.
2587 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2588 section.
2589 (Output_section_incremental_inputs::set_final_data_size): Calculate
2590 size of incremental_got_plt section.
2591 (Output_section_incremental_inputs::do_write): Write the
2592 incremental_got_plt section.
2593 (Got_plt_view_info): New struct.
2594 (Local_got_offset_visitor): New class.
2595 (Global_got_offset_visitor): New class.
2596 (Global_symbol_visitor_got_plt): New class.
2597 (Output_section_incremental_inputs::write_got_plt): New function.
2598 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2599 Add parameter. Adjust all callers.
2600 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2601 (Incremental_inputs::got_plt_section): New function.
2602 (Incremental_inputs::got_plt_section_): New data member.
2603 (Incremental_got_plt_reader): New class.
2604 * layout.cc (Layout::create_incremental_info_sections): Add the
2605 incremental_got_plt section.
2606 * object.h (Got_offset_list::get_list): New function.
2607 (Got offset_list::for_all_got_offsets): New function.
2608 (Sized_relobj::local_got_offset_list): New function.
2609 * powerpc.cc (Target_powerpc::got_size): Add const.
2610 (Target_powerpc::got_entry_count): New function.
2611 (Target_powerpc::plt_entry_count): New function.
2612 (Target_powerpc::first_plt_entry_offset): New function.
2613 (Target_powerpc::plt_entry_size): New function.
2614 (Output_data_plt_powerpc::entry_count): New function.
2615 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2616 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2617 * sparc.cc (Target_sparc::got_size): Add const.
2618 (Target_sparc::got_entry_count): New function.
2619 (Target_sparc::plt_entry_count): New function.
2620 (Target_sparc::first_plt_entry_offset): New function.
2621 (Target_sparc::plt_entry_size): New function.
2622 (Output_data_plt_sparc::entry_count): New function.
2623 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2624 (Output_data_plt_sparc::get_plt_entry_size): New function.
2625 * symtab.h (Symbol::got_offset_list): New function.
2626 (Symbol_table::for_all_symbols): New function.
2627 * target.h (Sized_target::got_entry_count): New function.
2628 (Sized_target::plt_entry_count): New function.
2629 (Sized_target::plt_entry_size): New function.
2630 * x86_64.cc (Target_x86_64::got_size): Add const.
2631 (Target_x86_64::got_entry_count): New function.
2632 (Target_x86_64::plt_entry_count): New function.
2633 (Target_x86_64::first_plt_entry_offset): New function.
2634 (Target_x86_64::plt_entry_size): New function.
2635 (Output_data_plt_x86_64::entry_count): New function.
2636 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2637 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2638
09ec0418
CC
26392010-08-12 Cary Coutant <ccoutant@google.com>
2640
2641 * archive.cc: Include incremental.h.
2642 (Archive::Archive): Initialize incremental_info_.
2643 (Archive::include_member): Record archive members in incremental info.
2644 (Add_archive_symbols::run): Record begin and end of an archive in
2645 incremental info.
2646 (Lib_group::include_member): Record objects in incremental info.
2647 * archive.h (Incremental_archive_entry): Forward declaration.
2648 (Archive::set_incremental_info): New member function.
2649 (Archive::incremental_info): New member function.
2650 (Archive::Unused_symbol_iterator): New class.
2651 (Archive::unused_symbols_begin): New member function.
2652 (Archive::unused_symbols_end): New member function.
2653 (Archive::incremental_info_): New data member.
2654 * incremental-dump.cc (find_input_containing_global): New function.
2655 (dump_incremental_inputs): Dump new incremental info sections.
2656 * incremental.cc: Include symtab.h.
2657 (Output_section_incremental_inputs): New class.
2658 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2659 new incremental info sections.
2660 (Sized_incremental_binary::do_check_inputs): Likewise.
2661 (Incremental_inputs::report_archive): Remove.
2662 (Incremental_inputs::report_archive_begin): New function.
2663 (Incremental_inputs::report_archive_end): New function.
2664 (Incremental_inputs::report_object): New function.
2665 (Incremental_inputs::finalize_inputs): Remove.
2666 (Incremental_inputs::report_input_section): New function.
2667 (Incremental_inputs::report_script): Rewrite.
2668 (Incremental_inputs::finalize): Do nothing but finalize string table.
2669 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2670 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2671 (Incremental_inputs::create_data_sections): New function.
2672 (Incremental_inputs::relocs_entsize): New function.
2673 (Output_section_incremental_inputs::set_final_data_size): New function.
2674 (Output_section_incremental_inputs::do_write): New function.
2675 (Output_section_incremental_inputs::write_header): New function.
2676 (Output_section_incremental_inputs::write_input_files): New function.
2677 (Output_section_incremental_inputs::write_info_blocks): New function.
2678 (Output_section_incremental_inputs::write_symtab): New function.
2679 * incremental.h (Incremental_script_entry): Forward declaration.
2680 (Incremental_object_entry): Forward declaration.
2681 (Incremental_archive_entry): Forward declaration.
2682 (Incremental_inputs): Forward declaration.
2683 (Incremental_inputs_header_data): Remove.
2684 (Incremental_inputs_header): Remove.
2685 (Incremental_inputs_header_write): Remove.
2686 (Incremental_inputs_entry_data): Remove.
2687 (Incremental_inputs_entry): Remove.
2688 (Incremental_inputs_entry_write): Remove.
2689 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2690 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2691 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2692 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2693 Likewise.
2694 (Incremental_input_entry): New class.
2695 (Incremental_script_entry): New class.
2696 (Incremental_object_entry): New class.
2697 (Incremental_archive_entry): New class.
2698 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2699 (Incremental_inputs::report_inputs): Remove.
2700 (Incremental_inputs::report_archive): Remove.
2701 (Incremental_inputs::report_archive_begin): New function.
2702 (Incremental_inputs::report_archive_end): New function.
2703 (Incremental_inputs::report_object): Change prototype.
2704 (Incremental_inputs::report_input_section): New function.
2705 (Incremental_inputs::report_script): Change prototype.
2706 (Incremental_inputs::get_reloc_count): New function.
2707 (Incremental_inputs::set_reloc_count): New function.
2708 (Incremental_inputs::create_data_sections): New function.
2709 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2710 (Incremental_inputs::inputs_section): New function.
2711 (Incremental_inputs::symtab_section): New function.
2712 (Incremental_inputs::relocs_section): New function.
2713 (Incremental_inputs::get_stringpool): Add const.
2714 (Incremental_inputs::command_line): Add const.
2715 (Incremental_inputs::inputs): Remove.
2716 (Incremental_inputs::command_line_key): New function.
2717 (Incremental_inputs::input_file_count): New function.
2718 (Incremental_inputs::input_files): New function.
2719 (Incremental_inputs::relocs_entsize): New function.
2720 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2721 (Incremental_inputs::finalize_inputs): Remove.
2722 (Incremental_inputs::Input_info): Remove.
2723 (Incremental_inputs::lock_): Remove.
2724 (Incremental_inputs::inputs_): Change type.
2725 (Incremental_inputs::inputs_map_): Remove.
2726 (Incremental_inputs::current_object_entry_): New data member.
2727 (Incremental_inputs::inputs_section_): New data member.
2728 (Incremental_inputs::symtab_section_): New data member.
2729 (Incremental_inputs::relocs_section_): New data member.
2730 (Incremental_inputs::reloc_count_): New data member.
2731 (Incremental_inputs_reader): New class.
2732 (Incremental_symtab_reader): New class.
2733 (Incremental_relocs_reader): New class.
2734 * layout.cc (Layout::finalize): Move finalization of incremental info
2735 and creation of incremental info sections to follow finalization of
2736 symbol table. Set offsets for postprocessing sections.
2737 (Layout::create_incremental_info_sections): Call
2738 Incremental_inputs::create_data_sections. Add incremental symtab
2739 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2740 sections to layout after input sections.
2741 * layout.h (struct Timespec): Forward declaration.
2742 (Layout::incremental_inputs): Add const.
2743 (Layout::create_incremental_info_sections): Add parameter.
2744 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2745 * object.cc: Include incremental.h.
2746 (Relobj::finalize_incremental_relocs): New function.
2747 (Sized_relobj::do_layout): Record input sections in incremental info.
2748 * object.h (Object::output_section): New function.
2749 (Object::output_section_offset): Moved from Relobj.
2750 (Object::get_incremental_reloc_base): New function.
2751 (Object::get_incremental_reloc_count): New function.
2752 (Object::do_output_section): New function.
2753 (Object::do_output_section_offset): Moved from Relobj.
2754 (Object::do_get_incremental_reloc_base): New function.
2755 (Object::do_get_incremental_reloc_count): New function.
2756 (Object::Object): Initialize new data members.
2757 (Relobj::output_section): Renamed do_output_section and moved to
2758 protected.
2759 (Relobj::output_section_offset): Moved to Object.
2760 (Relobj::do_get_incremental_reloc_base): New function.
2761 (Relobj::do_get_incremental_reloc_count): New function.
2762 (Relobj::allocate_incremental_reloc_counts): New function.
2763 (Relobj::count_incremental_reloc): New function.
2764 (Relobj::finalize_incremental_relocs): New function.
2765 (Relobj::next_incremental_reloc_index): New function.
2766 (Relobj::reloc_counts_): New data member.
2767 (Relobj::reloc_bases_): New data member.
2768 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2769 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2770 (Sized_relobj::incremental_relocs_scan): New function.
2771 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2772 (Sized_relobj::incremental_relocs_write): New function.
2773 (Sized_relobj::incremental_relocs_write_reltype): New function.
2774 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2775 incremental link.
2776 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2777 archives and object files elsewhere.
2778 (Add_symbols::run): Report object files here.
2779 (Finish_group::run): Report end of archive at end of group.
2780 * reloc.cc: Include layout.h, incremental.h.
2781 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2782 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2783 (Sized_relobj::incremental_relocs_scan): New function.
2784 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2785 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2786 (Sized_relobj::incremental_relocs_write): New function.
2787 (Sized_relobj::incremental_relocs_write_reltype): New function.
2788 * script.cc (read_input_script): Rewrite test for incremental link.
2789 Change call to Incremental_inputs::report_script.
2790 * symtab.h (Symbol_table::first_global_index): New function.
2791 (Symbol_table::output_count): New function.
2792
ce0d1972
DK
27932010-08-12 Doug Kwan <dougkwan@google.com>
2794
2795 * arm.cc (Target_arm::merge_object_attributes): Check command line
2796 options --no-wchar-size-warning and --no-enum-size-warning.
2797 * options.h (General_options): Add ld-compatible options
2798 --no-enum-size-warning and --no-wchar-size-warning.
2799
6e5710ce
ILT
28002010-08-04 Ian Lance Taylor <iant@google.com>
2801
2802 * x86_64.cc (Target_x86_64::Scan::local): Use
2803 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2804 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2805 (Target_x86_64::Scan::global): Likewise.
2806 (Target_x86_64::Relocate::relocate): Likewise.
2807 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2808 Likewise.
2809
fef830db
CC
28102010-08-03 Cary Coutant <ccoutant@google.com>
2811
2812 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2813 to reserve space in merged_strings vector. Keep total input size
2814 for stats.
2815 (Output_merge_string::do_print_merge_stats): Print total input size.
2816 * merge.h (Output_merge_string): Add input_size_ field.
2817 * stringpool.cc (Stringpool_template::string_length): Move
2818 implementations out of Stringpool_template class and place in
2819 stringpool.h.
2820 * stringpool.h (string_length): Move out of Stringpool_template.
2821
1e3811b0
ILT
28222010-08-03 Ian Lance Taylor <iant@google.com>
2823
2824 PR 11712
2825 * layout.cc (relaxation_loop_body): If address of load segment is
2826 set, adjust address to include headers if possible.
2827
7af0c620
ILT
28282010-08-03 Ian Lance Taylor <iant@google.com>
2829
2830 * version.cc (version_string): Bump to 1.10.
2831
22f0da72
ILT
28322010-08-03 Ian Lance Taylor <iant@google.com>
2833
2834 PR 11805
2835 * layout.h (enum Output_section_order): Define.
2836 (class Layout): Update declarations.
2837 * layout.cc (Layout::get_output_section): Add order parameter.
2838 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2839 is_first_non_relro parameters. Change all callers.
2840 (Layout::choose_output_section): Likewise.
2841 (Layout::add_output_section_data): Likewise.
2842 (Layout::make_output_section): Likewise. Set order.
2843 (Layout::default_section_order): New function.
2844 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2845 * output.cc (Output_section::Output_section): Initialize order_.
2846 Don't initialize deleted fields.
2847 (Output_segment::Output_segment): Don't initialize deleted
2848 fields.
2849 (Output_segment::add_output_section_to_load): New function
2850 replacing add_output_section. Change all callers to call this or
2851 add_output_section_to_nonload.
2852 (Output_segment::add_output_section_to_nonload): New function.
2853 (Output_segment::remove_output_section): Rewrite.
2854 (Output_segment::add_initial_output_data): Likewise.
2855 (Output_segment::has_any_data_sections): Likewise.
2856 (Output_segment::is_first_section_relro): Likewise.
2857 (Output_segment::maximum_alignment): Likewise.
2858 (Output_segment::has_dynamic_reloc): New function replacing
2859 dynamic_reloc_count. Change all callers.
2860 (Output_segment::has_dynamic_reloc_list): New function replacing
2861 dynamic_reloc_count_list. Change all callers.
2862 (Output_segment::set_section_addresses): Rewrite.
2863 (Output_segment::set_offset): Rewrite.
2864 (Output_segment::find_first_and_last_list): Remove.
2865 (Output_segment::set_tls_offsets): Rewrite.
2866 (Output_segment::first_section_load_address): Likewise.
2867 (Output_segment::output_section_count): Likewise.
2868 (Output_segment::section_with_lowest_load_address): Likewise.
2869 (Output_segment::write_section_headers): Likewise.
2870 (Output_segment::print_sections_to_map): Likewise.
2871 * output.h (class Output_data): Remove dynamic_reloc_count_
2872 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2873 (Output_data::add_dynamic_reloc): Rewrite.
2874 (Output_data::has_dynamic_reloc): New function.
2875 (Output_data::dynamic_reloc_count): Remove.
2876 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2877 is_last_relro_, is_first_non_relro_, is_interp_,
2878 is_dynamic_linker_section_ fields. Add order and set_order
2879 functions. Remove is_relro_local, set_is_relro_local,
2880 is_last_relro, set_is_last_relro, is_first_non_relro,
2881 set_is_first_non_relro functions, is_interp, set_is_interp,
2882 is_dynamic_linker_section, and set_is_dynamic_linker_section
2883 functions.
2884 (class Output_segment): Change Output_data_list from std::list to
2885 std:;vector. Add output_lists_ field. Remove output_data_ and
2886 output_bss_ fields. Update declarations.
2887
3ff2ccb0
ILT
28882010-08-02 Ian Lance Taylor <iant@google.com>
2889
2890 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2891 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2892 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2893
88a4108b
ILT
28942010-08-02 Ian Lance Taylor <iant@google.com>
2895
2896 PR 11855
2897 * script.cc (Script_options::Script_options): Initialize
2898 symbol_definitions_ and symbol_references_.
2899 (Script_options::add_symbol_assignment): Update
2900 symbol_definitions_ and symbol_references_.
2901 (Script_options::add_symbol_reference): New function.
2902 (script_symbol): New function.
2903 * script.h (class Script_options): Add symbol_definitions_ and
2904 symbol_references_ fields.
2905 (Script_options::referenced_const_iterator): New type.
2906 (Script_options::referenced_begin): New function.
2907 (Script_options::referenced_end): New function.
2908 (Script_options::is_referenced): New function.
2909 (Script_options::any_unreferenced): New function.
2910 * script-c.h (script_symbol): Declare.
2911 * yyscript.y (exp): Call script_symbol.
2912 * symtab.cc: Include "script.h".
2913 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2914 Change all callers. Check symbols referenced by scripts.
2915 (Symbol_table::add_undefined_symbols_from_command_line): Add
2916 layout parameter. Change all callers.
2917 (Symbol_table::do_add_undefined_symbols_from_command_line):
2918 Likewise. Break out loop body. Check symbols referenced by
2919 scripts.
2920 (Symbol_table::add_undefined_symbol_from_command_line): New
2921 function broken out of
2922 do_add_undefined_symbols_from_command_line.
2923 * symtab.h (class Symbol_table): Update declarations.
2924 * archive.cc: Include "layout.h".
2925 (Archive::should_include_member): Add layout parameter. Change
2926 all callers. Check for symbol mentioned in expression.
2927 * archive.h (class Archive): Update declaration.
2928 * object.cc (Sized_relobj::do_should_include_member): Add layout
2929 parameter.
2930 * object.h (Object::should_include_member): Add layout parameter.
2931 Change all callers.
2932 (Object::do_should_include_member): Add layout parameter.
2933 (class Sized_relobj): Update declaration.
2934 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2935 parameter.
2936 * dynobj.h (class Sized_dynobj): Update declaration.
2937 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2938 layout parameter.
2939 * plugin.h (class Sized_pluginobj): Update declaration.
2940
5f1ab67a
ILT
29412010-08-02 Ian Lance Taylor <iant@google.com>
2942
2943 PR 11866
2944 * output.cc (Output_segment::set_offset): Search for the first and
2945 last sections rather than assuming that the list is in order.
2946 (Output_segment::find_first_and_last_list): New function.
2947 * output.h (class Output_segment): Update declarations.
2948 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2949 (relro_strip_test_SOURCES): New variable.
2950 (relro_strip_test_DEPENDENCIES): New variable.
2951 (relro_strip_test_LDFLAGS): New variable.
2952 (relro_strip_test_LDADD): New variable.
2953 (relro_strip_test.so): New target.
2954
a8df5856
ILT
29552010-08-02 Ian Lance Taylor <iant@google.com>
2956
2957 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2958 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2959 (Target_i386::got_tlsdesc_section): New function.
2960 (Target_i386::got_section): Create space for GOT entries for
2961 TLSDESC relocations.
2962 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2963 R_386_TLS_GOTDESC.
2964 (Target_i386::Scan::global): Likewise.
2965 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2966 using TLSDESC GOT.
2967 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2968 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2969 (Target_x86_64::got_tlsdesc_section): New function.
2970 (Target_x86_64::got_section): Create space for GOT entries for
2971 TLSDESC relocations.
2972 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2973 R_386_TLS_GOTDESC.
2974 (Target_x86_64::Scan::global): Likewise.
2975 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2976 using TLSDESC GOT.
2977
0c10a0a6
ILT
29782010-08-02 Ian Lance Taylor <iant@google.com>
2979
2980 * testsuite/final_layout.sh: Use dc to convert from hex to
2981 decimal.
2982
41cbeecc
ST
29832010-07-29 Sriraman Tallam <tmsriram@google.com>
2984
2985 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2986 paramter to the call to gold::gc_process_relocs.
2987 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2988 paramter to the call to gold::gc_process_relocs.
2989 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2990 parameter to the call to gold::gc_process_relocs.
2991 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2992 template parameter to the call to gold::gc_process_relocs.
2993 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2994 paramter to the call to gold::gc_process_relocs.
2995 * gc.h (get_embedded_addend_size): New function.
2996 (gc_process_relocs): Save the size of the reloc for use by ICF.
2997 * icf.cc (get_section_contents): Get the addend from the text section
2998 for SHT_REL relocation sections.
2999 * icf.h (Icf::Reloc_addend_size_info): New typedef.
3000 (Icf::Reloc_info): Add new member reloc_addend_size_info.
3001 * int_encoding.h (read_from_pointer): New overloaded function.
3002 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
3003 * testsuite/icf_sht_rel_addend_test.sh: New file.
3004 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
3005 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
3006
6ea55b82
RW
30072010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3008
3009 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
3010 * Makefile.in: Regenerate.
3011 * testsuite/Makefile.in: Regenerate.
3012
9691462b
ILT
30132010-07-27 Jeffrey Yasskin <jyasskin@google.com>
3014
3015 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
3016 * gold/testsuite/debug_msg.cc: Likewise.
3017 * gold/testsuite/odr_violation1.cc
3018 * gold/testsuite/odr_violation2.cc
3019
76897331
CC
30202010-07-21 Cary Coutant <ccoutant@google.com>
3021
3022 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
3023 string, and length fields.
3024 (Output_merge_string::Merged_strings_list): New type.
3025 (Output_merge_string::Merged_strings_lists): New typedef.
3026 (Output_merge_string): Replace merged_strings_ with
3027 merged_strings_lists_.
3028 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
3029 Merged_strings_list per input object and section. Don't store pointer
3030 to the string. Don't store length with each merged string entry.
3031 (Output_merge_string::finalize_merged_data): Loop over list of merged
3032 strings lists. Recompute length of each merged string.
3033
78384e8f
CC
30342010-07-15 Cary Coutant <ccoutant@google.com>
3035
3036 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
3037 here.
3038
783659f9
ILT
30392010-07-14 Ian Lance Taylor <iant@google.com>
3040
3041 * descriptors.cc (Descriptors::open): Report correct name in error
3042 message.
3043
131687b4
DK
30442010-07-13 Doug Kwan <dougkwan@google.com>
3045
3046 * arm.cc (Arm_input_section::Arm_input_section): For a
3047 SHT_ARM_EXIDX section, always keeps the input sections.
3048 (Arm_input_section::set_exidx_section_link): New method.
3049 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
3050 has_errors_ to false.
3051 (Arm_exidx_input_section::has_errors,
3052 Arm_exidx_input_section::set_has_errors): New methods.
3053 (Arm_exidx_input_section::has_errors_): New data member.
3054 (Arm_relobj::get_exidx_shndx_list): New method.
3055 (Arm_output_section::append_text_sections_to_list): Do not skip
3056 section without SHF_EXECINSTR.
3057 (Arm_output_section::fix_exidx_coverage): Skip input sections with
3058 errors.
3059 (Arm_relobj::make_exidx_input_section): Add new parameter for text
3060 section header. Make error messages more verbose. Check for
3061 a non-executable section linked to an EXIDX section.
3062 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3063 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3064 check that there is no deferred EXIDX section if we exit early.
3065 Instead of not making an EXIDX section in case of an error, make one
3066 and set the has_errors flag of it.
3067 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3068 in a relocatable link.
3069 (Target_arm::do_relax): Look for the EXIDX output section instead of
3070 assuming that it is called .ARM.exidx.
3071 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3072 section list. Do not check for SHF_EXECINSTR section flags but
3073 skip any input section with errors.
3074 * output.cc (Output_section::Output_section): Initialize
3075 always_keeps_input_sections_ to false.
3076 (Output_section::add_input_section): Check for
3077 always_keeps_input_sections_.
3078 * output.h (Output_section::always_keeps_input_sections,
3079 Output_section::set_always_keeps_input_sections): New methods.
3080 (Output_section::always_keeps_input_sections): New data member.
3081
69517287
RÁE
30822010-07-13 Rafael Espindola <espindola@google.com>
3083
3084 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3085 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3086
82742395
ILT
30872010-07-13 Philip Herron <herron.philip@googlemail.com>
3088 Ian Lance Taylor <iant@google.com>
3089
3090 * output.h (Output_section_lookup_maps::add_merge_section):
3091 Correct check of whether value was inserted.
3092 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3093 (Output_section_lookup_maps::add_relaxed_input_section):
3094 Likewise.
3095 * arm.cc (Target_arm::got_section): Remove used local os.
3096 * i386.cc (Target_i386::got_section): Likewise.
3097 * x86_64.cc (Target_x86_64::got_section): Likewise.
3098 * sparc.cc (Target_sparc::got_section): Likewise.
3099 (Target_sparc::relocate): Remove unused local have_got_offset.
3100 * powerpc.cc (Target_powerpc::relocate): Likewise.
3101
f2d707b5
ILT
31022010-07-13 Ian Lance Taylor <iant@google.com>
3103
241531d6
ILT
3104 * compressed_output.cc (zlib_decompress): Fix signature in
3105 !HAVE_ZLIB_H case.
3106
f2d707b5
ILT
3107 * archive.cc (Archive::include_member): Unlock an external member
3108 of a thin archive. Don't bother to delete an object we know is
3109 NULL.
3110
a2e47362
CC
31112010-07-12 Cary Coutant <ccoutant@google.com>
3112
3113 * compressed_output.cc (zlib_decompress): New function.
3114 (get_uncompressed_size): New function.
3115 (decompress_input_section): New function.
3116 * compressed_output.h (get_uncompressed_size): New function.
3117 (decompress_input_section): New function.
3118 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3119 Handle compressed debug sections.
3120 * layout.cc (is_compressed_debug_section): New function.
3121 (Layout::output_section_name): Map compressed section names to
3122 canonical names.
3123 * layout.h (is_compressed_debug_section): New function.
3124 (is_debug_info_section): Recognize compressed debug sections.
3125 * merge.cc: Include compressed_output.h.
3126 (Output_merge_data::do_add_input_section): Handle compressed
3127 debug sections.
3128 (Output_merge_string::do_add_input_section): Handle compressed
3129 debug sections.
3130 * object.cc: Include compressed_output.h.
3131 (Sized_relobj::Sized_relobj): Initialize new data members.
3132 (build_compressed_section_map): New function.
3133 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3134 * object.h (Object::section_is_compressed): New method.
3135 (Object::do_section_is_compressed): New method.
3136 (Sized_relobj::Compressed_section_map): New type.
3137 (Sized_relobj::do_section_is_compressed): New method.
3138 (Sized_relobj::compressed_sections_): New data member.
3139 * output.cc (Output_section::add_input_section): Handle compressed
3140 debug sections.
3141 * reloc.cc: Include compressed_output.h.
3142 (Sized_relobj::write_sections): Handle compressed debug sections.
3143
ce279a62
CC
31442010-07-08 Cary Coutant <ccoutant@google.com>
3145
3146 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3147 weak when resolving to a dynamic def.
3148 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3149 for weak undef/dynamic def cases. Adjust callers.
3150 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3151 undef_binding_weak_.
3152 (Symbol_table::sized_write_globals): Adjust symbol binding.
3153 (Symbol_table::sized_write_symbol): Add binding parameter.
3154 * symtab.h (Symbol::set_undef_binding): New method.
3155 (Symbol::is_undef_binding_weak): New method.
3156 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3157 (Symbol_table::should_override): Add new parameter.
3158 (Symbol_table::sized_write_symbol): Add new parameter.
3159
3160 * testsuite/weak_undef_file1.cc: Add new test case.
3161 * testsuite/weak_undef_file2.cc: Fix header comment.
3162 * testsuite/weak_undef_test.cc: Add new test case.
3163
b2286c10
DK
31642010-06-29 Doug Kwan <dougkwan@google.com>
3165
3166 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3167 Initialize USE_SYMBOL_.
3168 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3169 definition.
3170 (Arm_reloc_property::uses_symbol_): New data member declaration.
3171 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3172 uses symbol value and symbol is undefined but not weakly undefined.
3173
4802450a
RÁE
31742010-06-28 Rafael Espindola <espindola@google.com>
3175
3176 * plugin.cc (Plugin::load): Use dlerror.
3177
e5ca47ba
ILT
31782010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3179
3180 * symtab.cc (detect_odr_violations): When reporting an ODR
3181 violation, report an object where the symbol is defined.
3182
8a75a161
DK
31832010-06-25 Doug Kwan <dougkwan@google.com>
3184
3185 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3186 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3187 definition.
3188 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3189 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3190 target hook to detect function points.
3191 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3192 * icf.h (Icf::check_section_for_function_pointers): Change type of
3193 parameter SECTION_NAME to const reference to std::string. Use
3194 target hook to determine if section may have unsafe pointers.
3195 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3196 method definition.
3197
42218b9f
RÁE
31982010-06-21 Rafael Espindola <espindola@google.com>
3199
3200 * fileread.cc (Input_file::find_fie): New
3201 (Input_file::open): Use Input_file::find_fie.
3202 * fileread.h (Input_file::find_fie): New
3203 * plugin.cc (set_extra_library_path): New.
3204 (Plugin::load): Add set_extra_library_path to the transfer vector.
3205 (Plugin_manager::set_extra_library_path): New.
3206 (Plugin_manager::add_input_file): Use the extra search path if set.
3207 (set_extra_library_path(): New.
3208 * plugin.h (Plugin_manager): Add set_extra_library_path and
3209 extra_search_path_.
3210
a0506cca
CC
32112010-06-19 Cary Coutant <ccoutant@google.com>
3212
3213 * layout.cc (gdb_sections): Add .debug_types.
3214 (lines_only_debug_sections): Likewise.
3215
6508b958
RÁE
32162010-06-18 Rafael Espindola <espindola@google.com>
3217
3218 * plugin.cc (add_input_file,add_input_library)
3219 (Plugin_manager::add_input_file): Make filename arguments const.
3220 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
3221 const.
3222
3e235302
DK
32232010-06-16 Doug Kwan <dougkwan@google.com>
3224
3225 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
3226 .ARM.attributes section if we have not merged any input
3227 attributes sections.
3228
106e8a6c
DK
32292010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3230
3231 * arm.cc: Allow combining objects with no EABI version
3232 information.
3233
91ff43fe
RÁE
32342010-06-15 Rafael Espindola <espindola@google.com>
3235
3236 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
3237
68ed838c
ILT
32382010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3239
3240 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
3241 (struct iovec): Correct !HAVE_READV definition.
3242
f3a2388f
CC
32432010-06-10 Cary Coutant <ccoutant@google.com>
3244
3245 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
3246 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
3247 reloc sections.
3248 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
3249
3250 PR 11683
3251 * symtab.h (Symbol::is_placeholder): New member function.
3252 * target-reloc.h (relocate_section): Check for placeholder symbols.
3253
3254 * testsuite/Makefile.am (plugin_test_8): New test.
3255 (plugin_test_9): New test.
3256 * testsuite/Makefile.in: Regenerate.
3257
e1df38aa
NC
32582010-06-09 Nick Clifton <nickc@redhat.com>
3259
3260 * yyscript.y (input_list_element): Allow strings prefixed with
3261 the '-' character. Treat these as libraries.
3262 * script.cc (script_add_library): New function. Adds a library
3263 specified by "-l<name>" found in an input script.
3264 * script-c.h: Add prototype for script_add_library.
3265
25bbe950
DK
32662010-06-07 Doug Kwan <dougkwan@google.com>
3267
3268 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
3269 Restrict stub-group size to be within long conditional branch
3270 range when working around cortex-A8 erratum.
3271
0f32ea4c
ILT
32722010-06-07 Damien Diederen <dd@crosstwine.com>
3273
3274 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
3275 #ifdef typo.
3276
8fe2a369
ST
32772010-06-03 Sriraman Tallam <tmsriram@google.com>
3278
3279 PR gold/11658
3280 * output.cc
3281 (Output_section::Input_section_sort_entry::compare_section_ordering):
3282 Change to return non-zero correctly.
3283 (Output_section::Input_section_sort_section_order_index_compare
3284 ::operator()): Change to fix ambiguity in comparisons.
3285
6e9ba2ca
ST
32862010-06-01 Sriraman Tallam <tmsriram@google.com>
3287
3288 * gold.h (is_wildcard_string): New function.
3289 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
3290 (Layout::layout_eh_frame): Ditto.
3291 (Layout::find_section_order_index): New method.
3292 (Layout::read_layout_from_file): New method.
3293 * layout.h (Layout::find_section_order_index): New method.
3294 (Layout::read_layout_from_file): New method.
3295 (Layout::input_section_position_): New private member.
3296 (Layout::input_section_glob_): New private member.
3297 * main.cc (main): Call read_layout_from_file here.
3298 * options.h (--section-ordering-file): New option.
3299 * output.cc (Output_section::input_section_order_specified_): New
3300 member.
3301 (Output_section::Output_section): Initialize new member.
3302 (Output_section::add_input_section): Add new parameter.
3303 Keep input sections when --section-ordering-file is used.
3304 (Output_section::set_final_data_size): Sort input sections when
3305 section ordering file is specified.
3306 (Output_section::Input_section_sort_entry): Add new parameter.
3307 Check sorting type.
3308 (Output_section::Input_section_sort_entry::compare_section_ordering):
3309 New method.
3310 (Output_section::Input_section_sort_compare::operator()): Change to
3311 consider section_order_index.
3312 (Output_section::Input_section_sort_init_fini_compare::operator()):
3313 Change to consider section_order_index.
3314 (Output_section::Input_section_sort_section_order_index_compare
3315 ::operator()): New method.
3316 (Output_section::sort_attached_input_sections): Change to sort
3317 according to section order when specified.
e1df38aa
NC
3318 (Output_section::add_input_section<32, true>): Add new parameter.
3319 (Output_section::add_input_section<64, true>): Add new parameter.
3320 (Output_section::add_input_section<32, false>): Add new parameter.
3321 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
3322 * output.h (Output_section::add_input_section): Add new parameter.
3323 (Output_section::input_section_order_specified): New
3324 method.
3325 (Output_section::set_input_section_order_specified): New method.
3326 (Input_section::Input_section): Initialize section_order_index_.
3327 (Input_section::section_order_index): New method.
3328 (Input_section::set_section_order_index): New method.
3329 (Input_section::section_order_index_): New member.
3330 (Input_section::Input_section_sort_section_order_index_compare): New
3331 struct.
3332 (Output_section::input_section_order_specified_): New member.
3333 * script-sections.cc (is_wildcard_string): Delete and move modified
3334 method to gold.h.
3335 (Output_section_element_input::Output_section_element_input): Modify
3336 call to is_wildcard_string.
3337 (Output_section_element_input::Input_section_pattern
3338 ::Input_section_pattern): Ditto.
3339 (Output_section_element_input::Output_section_element_input): Ditto.
3340 * testsuite/Makefile.am (final_layout): New test case.
3341 * testsuite/Makefile.in: Regenerate.
3342 * testsuite/final_layout.cc: New file.
3343 * testsuite/final_layout.sh: New file.
3344
3537c84b
RÁE
33452010-06-01 Rafael Espindola <espindola@google.com>
3346
3347 * plugin.cc (Plugin::load): Pass the output name to the plugin.
3348
105b6afd
RÁE
33492010-06-01 Rafael Espindola <espindola@google.com>
3350
3351 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
3352 visibility of symbols.
3353
29e11421
DK
33542010-05-27 Doug Kwan <dougkwan@google.com>
3355
3356 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
3357 from start of output section instead of address for a local symbol
3358 in a merged or relaxed section when doing a relocatable link.
3359
5e0f337e
RÁE
33602010-05-26 Rafael Espindola <espindola@google.com>
3361
3362 PR 11604
3363 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
3364 adding sections the garbage collector removed.
3365 * gold/testsuite/Makefile.am: Add test.
3366 * gold/testsuite/Makefile.in: Regenerate.
3367 * gold/testsuite/plugin_test_7.sh: New.
3368 * gold/testsuite/plugin_test_7_1.c: New.
3369 * gold/testsuite/plugin_test_7_2.c: New.
3370
f4187277
RÁE
33712010-05-26 Rafael Espindola <espindola@google.com>
3372
3373 * script-sections.cc (Output_section_definition::set_section_addresses):
3374 Check for --section-start.
3375
5c388529
DK
33762010-05-26 Doug Kwan <dougkwan@google.com>
3377
3378 * arm.cc (Arm_scan_relocatable_relocs): New class.
3379 (Target_arm::relocate_special_relocatable): New method.
3380 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
3381 (Arm_relocate_functions::thumb_branch_common): Same.
3382 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
3383 instead of Default_scan_relocatable_relocs.
3384 * target-reloc.h (relocate_for_relocatable): Let target handle
3385 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
3386 * target.h (Sized_target::relocate_special_relocatable): New method.
3387
bca1c3ae
ILT
33882010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3389
3390 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
3391
0439c796
DK
33922010-05-23 Doug Kwan <dougkwan@google.com>
3393
3394 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
3395 instead of a cast.
3396 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3397 with a direct branch, not a conditional branch, to a stub.
3398 * merge.cc (Output_merge_base::record_input_section): New method
3399 defintion.
3400 (Output_merge_data::do_add_input_section): Record input section if
3401 keeps-input-sections flag is set.
3402 (Output_merge_string::do_add_input_section): Ditto.
3403 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3404 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3405 INPUT_SECTIONS_.
3406 (Output_merge_base::keeps_input_sections,
3407 Output_merge_base::set_keeps_input_sections,
3408 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3409 method definitions.
3410 (Output_merge_base::Input_sections): New type declaration.
3411 (Output_merge_base::input_sections_begin,
3412 Output_merge_base::input_sections_end,
3413 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3414 (Output_merge_base::bool keeps_input_sections_,
3415 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3416 Output_merge_base::input_sections_): New data members.
3417 (Output_merge_data::do_set_keeps_input_sections): New method
3418 defintion.
3419 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3420 * output.cc (Output_section::Input_section::relobj): Move method
3421 defintion from class declaration to here and handle merge sections.
3422 (Output_section::Input_section::shndx): Ditto.
3423 (Output_section::Output_section): Remove initializations of removed
3424 data members and initialize new data member LOOKUP_MAPS_.
3425 (Output_section::add_input_section): Set keeps-input-sections flag
3426 for a newly created merge output section as appropriate. Adjust code
3427 to use Output_section_lookup_maps class.
3428 (Output_section::add_relaxed_input_section): Adjst code for lookup
3429 maps code refactoring.
3430 (Output_section::add_merge_input_section): Add a new parameter
3431 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3432 class. If adding input section to a newly created merge output
3433 section fails, remove the new merge section.
3434 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3435 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3436 (Output_section::find_merge_section): Ditto.
3437 (Output_section::build_lookup_maps): New method defintion.
3438 (Output_section::find_relaxed_input_section): Adjust code to use
3439 Output_section_lookup_maps class.
3440 (Output_section::get_input_sections): Export merge sections. Adjust
3441 code to use Output_section_lookup_maps class.
3442 (Output_section:::add_script_input_section): Adjust code to use
3443 Output_section_lookup_maps class. Update lookup maps for merge
3444 sections also.
3445 (Output_section::discard_states): Use Output_section_lookup_maps.
3446 (Output_section::restore_states): Same.
3447 * output.h (Merge_section_properties): Move class defintion out of
3448 Output_section.
3449 (Output_section_lookup_maps): New class.
3450 (Output_section::Input_section::is_merge_section): New method
3451 defintion.
3452 (Output_section::Input_section::relobj): Move defintion out of class
3453 defintion. Declare method only.
3454 (Output_section::Input_section::shndx): Ditto.
3455 (Output_section::Input_section::output_merge_base): New method defintion.
3456 (Output_section::Input_section::u2_.pomb): New union field.
3457 (Output_section::Merge_section_by_properties_map,
3458 Output_section::Output_section_data_by_input_section_map,
3459 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3460 Remove types.
3461 (Output_section::add_merge_input_section): Add new parameter
3462 KEEPS_INPUT_SECTIONS.
3463 (Output_section::build_lookup_maps): New method declaration.
3464 (Output_section::merge_section_map_,
3465 Output_section::merge_section_by_properties_map_,
3466 Output_section::relaxed_input_section_map_,
3467 Output_section::is_relaxed_input_section_map_valid_): Remove data
3468 members.
3469 (Output_section::lookup_maps_): New data member.
3470
76295588
L
34712010-05-21 Doug Kwan <dougkwan@google.com>
3472
3473 PR gold/11619
3474 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3475 avoid a compilation error.
3476
d103a984
RÁE
34772010-05-19 Rafael Espindola <espindola@google.com>
3478
3479 * script-sections.cc (Output_section_definition::allocate_to_segment):
3480 Update the phdrs_list even when the output section is NULL.
3481 * testsuite/Makefile.am: Add test.
3482 * testsuite/Makefile.in: Regenerate.
3483 * testsuite/script_test_9.cc: New.
3484 * testsuite/script_test_9.sh: New.
3485 * testsuite/script_test_9.t: New.
3486
6625d24e
DK
34872010-05-19 Doug Kwan <dougkwan@google.com>
3488
3489 * arm.cc (Arm_input_section::original_size): New method.
3490 (Arm_input_section::do_addralign): Add a cast.
3491 (Arm_input_section::do_output_offset): Remove static cast.
3492 (Arm_input_section::original_addralign,
3493 Arm_input_section::original_size_): Change type to uint32_t.
3494 (Arm_input_section::init): Add safe casts for section alignment
3495 and size.
3496 (Arm_input_section::set_final_data_size): Do not set address and
3497 offset of stub table.
3498 (Arm_output_section::fix_exidx_coverage): Change use of of
3499 Output_section::Simple_input_section to that of
3500 Output_section::Input_section.
3501 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3502 except for the first pass.
3503 * output.cc (Output_section::get_input_sections): Change type of
3504 input_sections to std::list<Input_section>.
3505 (Output_section::add_script_input_section): Rename from
3506 Output_section::add_simple_input_section. Change type of SIS
3507 parameter from Simple_input_section to Input_section.
3508 * output.h (Output_section::Simple_input_section): Remove class.
3509 (Output_section::Input_section): Change class visibility to public.
3510 (Output_section::Input_section::addralign): Use stored alignments
3511 for special input sections if set.
3512 (Output_section::Input_section::set_addralign): New method.
3513 (Output_section::get_input_sections): Change parameter type from
3514 list of Simple_input_section to list of Input_section.
3515 (Output_section::add_script_input_section): Rename from
3516 Output_section::add_simple_input_section. Change first parameter's
3517 type from Simple_input_section to Input_section and remove the
3518 second and third parameters.
3519 * script-sections.cc (Input_section::Input_section_list): Change
3520 type to list of Output_section::Input_section/
3521 (Input_section_info::Input_section_info): Change parameter type of
3522 INPUT_SECTION to Output_section::Input_section.
3523 (Input_section_info::input_section): Change return type.
3524 (Input_section_info::input_section_): Change type to
3525 Output_section::Input_section.
3526 (Output_section_element_input::set_section_addresses): Adjust code
3527 to use Output_section::Input_section instead of
3528 Output_section::Simple_input_section. Adjust code for renaming
3529 of Output_section::add_simple_input_section.
3530 (Orphan_output_section::set_section_addresses): Ditto.
3531
e1e82ea4
RW
35322010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3533
3534 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3535 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3536
91e75c8a
RÁE
35372010-05-18 Rafael Espindola <espindola@google.com>
3538
3539 * options.cc (General_options::finalize): Handle -nostdlib.
3540 * options.h (nostdlib): New option.
3541 * script.cc (script_add_search_dir): Handle -nostdlib.
3542
da59ad79
DK
35432010-05-12 Doug Kwan <dougkwan@google.com>
3544
3545 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3546 attributes section only if there no attributes section after merging.
3547 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3548 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3549 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3550 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3551 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3552 and arm_attr_merge_7.stdout.
3553 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3554 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3555 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3556 arm_attr_merge_7b.o): New rules.
3557 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3558 arm_attr_merge_7
3559 * testsuite/Makefile.in: Regenerate.
3560 * testsuite/arm_attr_merge.sh: New file.
3561 * testsuite/arm_attr_merge_[67][ab].s: Same.
3562
3e01a7fd
NC
35632010-05-05 Nick Clifton <nickc@redhat.com>
3564
3565 * po/es.po: Updated Spanish translation.
3566
7ad2014a
L
35672010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3568
3569 * Makefile.am (install-exec-local): Properly install gold as
3570 default cross linker.
3571 * Makefile.in: Regenerated.
3572
4fda8867
NC
35732010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3574 Nick Clifton <nickc@redhat.com>
3575
3576 * configure.ac (install_as_default): Define and set to false
3577 unless --enable-gold or --enable-gold=both/gold has been
3578 specified.
3579 * configure: Regenerate.
3580
3581 * Makefile.am (install-exec-local): Install the executable as
3582 'ld.gold'. If install_as_default is true then also install it as
3583 'ld'.
3584 * Makefile.in: Regenerated.
3585
bd288ea2
ILT
35862010-04-24 Ian Lance Taylor <iant@google.com>
3587
3588 * layout.cc (Layout::layout_reloc): In relocatable link don't
3589 combine reloc sections for grouped sections.
3590
ef38fd8a
ST
35912010-04-23 Sriraman Tallam <tmsriram@google.com>
3592
3593 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3594 sections that are not ordinary to icf.
3595 * icf.cc (get_section_contents): Handle relocation pointing to section
3596 with no object or shndx information.
3597 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3598 * testsuite/Makefile.in: Regenerate.
3599 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3600 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3601
f6973bdc
ILT
36022010-04-22 Ian Lance Taylor <iant@google.com>
3603
3604 * expression.cc (Expression::Expression_eval_info): Add
3605 result_alignment_pointer field.
3606 (Expression::eval_with_dot): Add result_alignment_pointer
3607 parameter. Change all callers.
3608 (Expression::eval_maybe_dot): Likewise.
3609 (class Binary_expression): Add alignment_pointer parameter to
3610 left_value and right_value. Change all callers.
3611 (BINARY_EXPRESSION): Set result alignment.
3612 (class Trinary_expression): Add alignment_pointer parameter to
3613 arg2_value and arg3_value. Change all callers.
3614 (Trinary_cond::value): Set result alignment.
3615 (Max_expression::value, Min_expression::value): Likewise.
3616 (Align_expression::value): Likewise.
3617 * script-sections.cc (class Sections_element): Add dot_alignment
3618 parameter to set_section_addresses virtual function. Update
3619 instantiations.
3620 (class Output_section_element): Likewise.
3621 (Script_sections::create_segments): Add dot_alignment parameter.
3622 Change all callers.
3623 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3624 (Script_sections::set_phdrs_clause_addresses): Likewise.
3625 * script-sections.h: Update declarations.
3626 * script.h: Update declarations.
3627 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3628 min_p_align.
3629 * testsuite/script_test_3.t: Set large alignment.
3630 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3631 segment has expected alignment.
3632
9c9c98a5
NC
36332010-04-22 Nick Clifton <nickc@redhat.com>
3634
3635 * po/gold.pot: Updated by the Translation project.
3636 * po/vi.po: Updated Vietnamese translation.
3637
2253bfba
L
36382010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3639
3640 * testsuite/Makefile.am (check_PROGRAMS): Add
3641 icf_virtual_function_folding_test.
3642 * testsuite/Makefile.in: Regenerated.
3643
85fdf906
AH
36442010-04-15 Andrew Haley <aph@redhat.com>
3645
3646 * options.h (merge_exidx_entries): New option.
3647 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3648 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3649 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3650 (Target_arm::merge_exidx_entries): New function.
3651 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3652 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3653 to Arm_exidx_fixup constructor.
3654 Add new arg, merge_exidx_entries.
3655 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3656 Arm_output_section::fix_exidx_coverage.
3657
ce97fa81
ST
36582010-04-18 Sriraman Tallam <tmsriram@google.com>
3659
3660 * icf.cc (get_section_contents): Check for preemptible functions.
3661 Ignore addend when appropriate.
3662 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3663 section folded.
3664 (add_from_relobj): Check for section folded.
3665 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3666 * symtab.h (should_add_dynsym_entry): Add new parameter.
3667 * target-reloc.h (scan_relocs): Check for section folded.
3668 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3669 Check reloc types for function pointers in shared objects.
3670 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3671 case.
3672 (icf_preemptible_functions_test): New test case.
3673 (icf_string_merge_test): New test case.
3674 * testsuite.Makefile.in: Regenerate.
3675 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3676 bar_glob. Refactor code.
3677 * testsuite/icf_preemptible_functions_test.cc: New file.
3678 * testsuite/icf_preemptible_functions_test.sh: New file.
3679 * testsuite/icf_string_merge_test.cc: New file.
3680 * testsuite/icf_string_merge_test.sh: New file.
3681 * testsuite/icf_virtual_function_folding_test.cc: New file.
3682 * testsuite/icf_virtual_function_folding_test.sh: New file.
3683
04ceb17c
DK
36842010-04-14 Doug Kwan <dougkwan@google.com>
3685
3686 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3687 for local symbol recounting if we remove a section due to ICF.
3688 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3689 there are no regular objects in input.
3690
153e7da4
DK
36912010-04-13 Doug Kwan <dougkwan@google.com>
3692
3693 * arm.cc (Arm_input_section::set_final_data_size): Compute
3694 accurate final data size instead of using current data size.
3695
4dbd9faf
DK
36962010-04-09 Doug Kwan <dougkwan@google.com>
3697
3698 * layout.cc (Layout::choose_output_section): Handle script section
3699 types.
3700 (Layout::make_output_section_for_script): Add section type parameter.
3701 Handle script section types.
3702 * layout.h (Layout::make_output_section_for_script): Add section
3703 type parameter.
3704 * output.cc (Output_section::Output_section): Initialize data member
3705 is_noload_.
3706 (Output_section::do_reset_address_and_file_offset): Do not set address
3707 to 0 if section is a NOLOAD section.
3708 * output.h (Output_section::is_noload): New method.
3709 (Output_section::set_is_noload): Ditto.
3710 (Output_section::is_noload_): New data member.
3711 * script-c.h (Script_section_type): New enum type.
3712 (struct Parser_output_section_header): Add new file section_type.
3713 * script-sections.cc (Sections_element::output_section_name): Add
3714 parameter for returning script section type.
3715 (Output_section_definition::output_section_name): Ditto.
3716 (Output_section_definition::section_type)P; New method.
3717 (Output_section_definiton::script_section_type_name): Ditto.
3718 (Output_section_definition::script_section_type_): New data member.
3719 (Output_section_definition::Output_section_definition): Initialize
3720 data member Output_section_definition::script_section_type_.
3721 (Output_section_definition::create_sections): Pass script section type
3722 to Layout::make_output_section_for_script.
3723 (Output_section_definition::output_section_name): Return script
3724 section type to caller.
3725 (Output_section_definition::set_section_address): Do not advance
3726 dot value and load address if section type is NOLOAD. Set address
3727 of NOLOAD sections regardless of section flags.
3728 (Output_section_definition::print): Print section type if it is
3729 not SCRIPT_SECTION_TYPE_NONE.
3730 (Output_section_definition::section_type): New method.
3731 (Output_section_definition::script_section_type_name): Ditto.
3732 (Script_sections::output_section_name): Add new parameter
3733 PSECTION_TYPE for returning script section type. Pass it to
3734 section elements. Handle discard sections.
3735 (Sort_output_sections::operator()): Handle NOLOAD sections.
3736 * script-sections.h (Script_sections::Section_type): New enum type.
3737 (Script_sections::output_section_name): Add a new parameter for
3738 returning script section type.
3739 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3740 INFO and NOLOAD.
3741 * yyscript.y (union): Add new field SECTION_TYPE.
3742 (COPY, DSECT, INFO, NOLOAD): New tokens.
3743 (opt_address_and_section_type): Change type to output_section_header.
3744 (section_type): New non-terminal
3745 (section_header): Handle section type.
2253bfba 3746 (opt_address_and_section_type): Return section type value.
4dbd9faf 3747
721ea635
L
37482010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3749
3750 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3751 * testsuite/plugin_common_test_2.c (foo): Likewise.
3752
6bf924b0
DK
37532010-04-08 Doug Kwan <dougkwan@google.com>
3754
3755 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3756 Output_merge_data.
3757 * output.cc (Output_section::add_merge_input_section): Simplify
3758 code and return status of Output_merge_base::add_input_section.
e1df38aa 3759 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3760 returns true.
3761
24af6f92
DK
37622010-04-07 Doug Kwan <dougkwan@google.com>
3763
3764 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3765 if section is marked as containing instructions but has no mapping
3766 symbols.
3767 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3768 correct section index.
3769 (Arm_relobj::find_linked_text_section): Ditto.
3770
00698fc5
CC
37712010-04-07 Cary Coutant <ccoutant@google.com>
3772
3773 * archive.cc (include_member): Destroy Read_symbols_data object before
3774 releasing file.
3775 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3776 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3777 (Read_symbols_data::~Read_symbols_data) New destructor.
3778 (Section_relocs::Section_relocs) New constructor.
3779 (Section_relocs::~Section_relocs) New destructor.
3780 (Read_relocs_data::Read_relocs_data) New constructor.
3781 (Read_relocs_data::~Read_relocs_data) New destructor.
3782 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3783 pointers to NULL after deleting.
3784
7296d933
DK
37852010-04-07 Doug Kwan <dougkwan@google.com>
3786
3787 * arm.cc: Replace "endianity" with "endianness" in comments.
3788 (Arm_exidx_cantunwind): Ditto.
3789 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3790 (Arm_relobj::merge_flags_and_attributes): New method.
3791 (Arm_relobj::merge_flags_and_attributes_): New data member.
3792 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3793 (Arm_relobj::scan_sections_for_stubs): Ditto.
3794 (Arm_relobj::do_read_symbols): Check to see if we really want to
3795 merge processor-specific flags and attributes. Exit early if
3796 an object is empty except for section names and the undefined symbol.
3797 (Target_arm::do_finalize_sections): Move check for ELF format to
3798 Arm_relobj::do_read_symbols. Merge processor specific flags and
3799 attributes from a regular object only when we have determined that
3800 it is aapropriate. Do not create an .ARM.attributes section in
3801 output if there is no regular input object.
3802 (Target_arm::merge_processor_specific_flags): Check
3803 --warn-mismatch before printing any error.
3804 (Target_arm::merge_object_attributes): Ditto.
3805 * gold.cc (queue_middle_tasks): Handle the case in which there is
3806 no regular object in input.
3807 * options.cc (General_options::parse_EB): New method.
3808 (General_options::parse_EL): Same.
3809 (General_options::General_options): Initialize endianness_.
3810 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3811 New options.
3812 (General_options::Endianness): New enum.
3813 (General_options::endianness): New method.
3814 (General_options::endianness_): New data member.
3815 * parameters.cc (Parameters::set_options): Check target endianness.
3816 (Parameters::set_target_once): Ditto.
3817 (Parameters::check_target_endianness): New method.
3818 (parameters_force_valid_target): If either -EL or -EB is specified,
3819 use it to define endianness of default target.
3820 * parameters.h (Parameters::check_target_endianness): New method
3821 declaration.
3822 * target.h (class Target): Change "endianity" to "endianness"
3823 in comments.
3824
efc8d4f2
RW
38252010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3826
3827 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3828 * configure: Regenerate.
3829 * Makefile.in: Regenerate.
3830 * testsuite/Makefile.in: Regenerate.
3831
be234d88
CC
38322010-04-06 Cary Coutant <ccoutant@google.com>
3833
3834 gcc PR lto/42757
3835 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3836 prevailing definitions of common symbols.
3837 * testsuite/plugin_test_6.sh: New test case.
3838 * testsuite/plugin_common_test_1.c: New test case.
3839 * testsuite/plugin_common_test_2.c: New test case.
3840 * testsuite/Makefile.am (plugin_test_6): New test case.
3841 * testsuite/Makefile.in: Regenerate.
3842
bd32c6bd
NC
38432010-04-06 Nick Clifton <nickc@redhat.com>
3844
3845 * po/vi.po: New Vietnamese translation.
3846
323c532f
DK
38472010-03-30 Doug Kwan <dougkwan@google.com>
3848
3849 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3850
4fcd97eb
DK
38512010-03-25 Doug Kwan <dougkwan@google.com>
3852
3853 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3854 to avoid a conversion warning on a 32-bit host.
3855
4ebf39db
ILT
38562010-03-24 Ian Lance Taylor <iant@google.com>
3857
3858 * testsuite/script_test_3.t: Add a TLS segment.
3859 * testsuite/Makefile.am (check_PROGRAMS): Add
3860 tls_phdrs_script_test.
3861 (tls_phdrs_script_test_SOURCES): Define.
3862 (tls_phdrs_script_test_DEPENDENCIES): Define.
3863 (tls_phdrs_script_test_LDFLAGS): Define.
3864 (tls_phdrs_script_test_LDADD): Define.
3865 * testsuite/Makefile.in: Rebuild.
3866
4a599bdd
CC
38672010-03-23 Cary Coutant <ccoutant@google.com>
3868
3869 * fileread.cc (find_or_make_view): Fix comment.
3870
6c93b22c
ILT
38712010-03-23 Ian Lance Taylor <iant@google.com>
3872
3873 * script-sections.cc (class Orphan_section_placement): Define
3874 PLACE_TLS and PLACE_TLS_BSS.
3875 (Orphan_section_placement::Orphan_section_placement): Initialize
3876 new places.
3877 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3878 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3879 (tls_script_test_SOURCES): Define.
3880 (tls_script_test_DEPENDENCIES): Define.
3881 (tls_script_test_LDFLAGS): Define.
3882 (tls_script_test_LDADD): Define.
3883 * testsuite/Makefile.in: Rebuild.
3884
a2c7281b
DK
38852010-03-22 Doug Kwan <dougkwan@google.com>
3886
3887 * arm.cc (Arm_relocate_functions::abs8,
3888 Arm_relocate_functions::abs16): Use correct check for overflow
3889 specified in the ARM ELF specs.
3890 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3891 target of a BLX instruction specially.
3892 (Reloc_stub::stub_type_for_reloc): Ditto.
3893 (Relocate::relocate): Use symbolic names instead of numeric relocation
3894 codes to report error.
3895 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3896 workaround.
3897 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3898 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3899 thumb2_blx_out_of_range.stdout
3900 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3901 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3902 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3903 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3904 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3905 thumb2_blx_in_range, thumb2_blx_in_range.o,
3906 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3907 thumb2_blx_out_of_range.o): New rules.
3908 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3909 thumb2_blx_in_range and thumb2_blx_out_of_range.
3910 * testsuite/Makefile.in: Regenerate.
3911 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3912 * testsuite/thumb_blx_in_range.s: New file.
3913 * testsuite/thumb_blx_out_of_range.s: New file.
3914
b0193076
RÁE
39152010-03-22 Rafael Espindola <espindola@google.com>
3916
3917 * archive.cc (Should_include): Move to archive.h.
3918 (should_include_member): Make it a member of Archive.
3919 (Lib_group): New.
3920 (Add_lib_group_symbols): New.
3921 * archive.h: Include options.h.
3922 (Archive_member): Moved from Archive.
3923 (Should_include): Moved from archive.cc.
3924 (Lib_group): New.
3925 (Add_lib_group_symbols): New.
3926 * dynobj.cc (do_should_include_member): New.
3927 * dynobj.h (do_should_include_member): New.
3928 * gold.cc (queue_initial_tasks): Update call to queue.
3929 * main.cc (main): Print lib group stats.
3930 * object.cc (do_should_include_member): New.
3931 * object.h: Include archive.h.
3932 (Object::should_include_member): New.
3933 (Object::do_should_include_member): New.
3934 (Sized_relobj::do_should_include_member): New.
3935 * options.cc (General_options::parse_start_lib): New.
3936 (General_options::parse_end_lib): New.
3937 (Input_arguments::add_file): Handle lib groups.
3938 (Input_arguments::start_group): Check we are not in a lib.
3939 (Input_arguments::start_lib): New.
3940 (Input_arguments::end_lib): New.
3941 * options.h (General_options): Add start_lib and end_lib.
3942 (Input_argument::lib_): New.
3943 (Input_argument::lib): New.
3944 (Input_argument::is_lib): New.
3945 (Input_file_lib): New.
3946 (Input_arguments::in_lib_): New.
3947 (Input_arguments::in_lib): New.
3948 (Input_arguments::start_lib): New.
3949 (Input_arguments::end_lib_): New.
3950 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3951 in unused members as preempted.
3952 (Sized_pluginobj::do_should_include_member): New.
3953 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3954 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3955 return the blocker.
3956 (Read_symbols::do_whole_lib_group): New.
3957 (Read_symbols::do_lib_group): New.
3958 (Read_symbols::do_read_symbols): Handle lib groups.
3959 (Read_symbols::get_name): Handle lib groups.
3960 * readsyms.h (Read_symbols): Add an archive member pointer.
3961 (Read_symbols::do_whole_lib_group): New.
3962 (Read_symbols::do_lib_group): New.
3963 (Read_symbols::member_): New.
3964 * script.cc (read_input_script): Update call to queue_soon.
3965
d099120c
DK
39662010-03-19 Doug Kwan <dougkwan@google.com>
3967
3968 * arm.cc (Stub_table::Stub_table): Initialize new data members
3969 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3970 (Stub_table::add_reloc_stub): Assign stub offset and update
3971 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3972 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3973 New data members.
3974 (Stub_table::update_data_size_and_addralign): Use
3975 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3976 instead of going over all reloc stubs.
3977 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3978 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3979 Stringpool_template::offset_ to size of Stringpool_char.
3980 (Stringpool_template::new_key_offset): Remove code to initialize
3981 Stringpool_template::offset_.
3982 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3983 Stringpool_template::offset_ to zero.
3984
1aa37384
DK
39852010-03-15 Doug Kwan <dougkwan@google.com>
3986
3987 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3988 offset_.
3989 (Stringpool_template::new_key_offset): New method.
3990 (Stringpool_template::add_string): Assign offsets when adding new
3991 strings.
3992 (Stringpool_template::set_string_offsets): Do not set string offsets
3993 when not optimizing.
3994 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3995 member size_.
3996 (Chunked_vector::clear): Clear size_.
3997 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3998 (Chunked_vector::size): Return size_.
3999 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 4000 (Chunked_vector::size_): New data member.
1aa37384
DK
4001 (Stringpool_template::set_no_zero_null): Assert string set is empty.
4002 (Stringpool_template::new_key_offset): New method declaration.
4003 (Stringpool_template::offset_): New data member.
4004
b672b057
RÁE
40052010-03-15 Rafael Espindola <espindola@google.com>
4006
4007 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
4008 Add_symbols' constructor.
4009 * readsyms.h (Add_symbols): Remove the input_group member.
4010
b6848d3c
ILT
40112010-03-10 Ian Lance Taylor <iant@google.com>
4012
4013 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
4014 target to ask whether a reference to a symbol requires a stack
4015 split.
4016 * target.h (Target::is_call_to_non_split): New function.
4017 (Target::do_is_call_to_non_split): Declare virtual function.
4018 * target.cc: Include "symtab.h".
4019 (Target::do_is_call_to_non_split): New function.
4020 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
4021
a2a5469e
CC
40222010-03-10 Cary Coutant <ccoutant@google.com>
4023
4024 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
4025 (File_read::open[1]): Remove initial mapping of whole_file_view_.
4026 (File_read::open[2]): Add whole_file_view_ to list of views.
4027 (File_read::make_view): Remove test of whole_file_view_.
4028 (File_read::find_or_make_view): Create whole_file_view_ if
4029 necessary.
4030 (File_read::clear_views): Replace bool parameter with enum;
4031 adjust all callers. Don't delete views with permanent data;
4032 do delete cached views and views from archives if
4033 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
4034 if clearing the corresponding view.
4035 * fileread.h (File_read::Clear_views_mode): New enum.
4036 (File_read::View::is_permanent_view): New method.
4037 (File_read::clear_views): Replace bool parameter
4038 with enum; adjust all callers.
4039 * options.h (General_options): Change keep_files_mapped option;
4040 add map_whole_files.
4041 * readsyms.cc (Add_symbols::run): Delete sd_ object before
4042 releasing the file.
4043 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
4044 the file.
4045
8861f32b
DM
40462010-03-10 David S. Miller <davem@davemloft.net>
4047
4048 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
4049
d62d0f5f
ST
40502010-03-09 Sriraman Tallam <tmsriram@google.com>
4051
4052 * icf.cc (get_section_contents): Add '@' marker after processing the
4053 merge reloc.
4054
9177756d
DK
40552010-03-08 Doug Kwan <dougkwan@google.com>
4056
4057 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
4058 due to a conversion warning.
4059 (Arm_relobj::update_output_local_symbol_count): Check for local
4060 symbol with unset output index.
4061
9e9e071b
ILT
40622010-03-05 Ian Lance Taylor <iant@google.com>
4063
4064 * options.h (class General_options): Add --spare-dynamic-tags.
4065 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4066 --spare-dynamic-tags.
4067
a81ee015
ILT
40682010-03-05 Ian Lance Taylor <iant@google.com>
4069
4070 * incremental.cc: Include "libiberty.h".
4071
44ec90b9
RO
40722010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4073
4074 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4075 function, is_info_ member.
4076 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4077 (Versions::Versions): Update caller.
4078 (Versions::define_base_version): Likewise.
4079 (Versions::add_def): Likewise.
4080
0897ed3b
ST
40812010-03-03 Sriraman Tallam <tmsriram@google.com>
4082
4083 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4084 (Scan::possible_function_pointer_reloc): New function.
4085 (Scan::local_reloc_may_be_function_pointer): Change to call
4086 possible_function_pointer_reloc.
4087 (Scan::global_reloc_may_be_function_pointer): Ditto.
4088 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4089 relocations in ".data.rel.ro._ZTV" section.
4090 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4091 * testsuite/icf_safe_so_test.cc: Ditto.
4092 * testsuite/icf_safe_test.cc: Ditto.
4093 * testsuite/icf_safe_test.sh: Ditto.
4094
d3bbad62
ILT
40952010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4096 Ian Lance Taylor <iant@google.com>
4097
4098 * target-reloc.h (relocate_section): Check the symbol table index
4099 for -1U before setting the local symbol index.
4100 (scan_relocatable_relocs): If copying the relocation, record that
4101 the local symbol is required.
4102 * object.h (Symbol_value::is_output_symtab_index_set): New
4103 function.
4104 (Symbol_value::may_be_discarded_from_output_symtab): New
4105 function.
4106 (Symbol_value::has_output_symtab_entry): New function.
4107 (Symbol_value::needs_output_symtab_entry): Remove.
4108 (Symbol_value::output_symtab_index): Make sure the symbol index is
4109 set.
4110 (Symbol_value::set_output_symtab_index): Make sure the symbol
4111 index is not set. Make sure the new index is valid.
4112 (Symbol_value::set_must_have_output_symtab_entry): New function.
4113 (Symbol_value::has_output_dynsym_entry): New function.
4114 (Symbol_value::set_output_dynsym_index): Make sure the new index
4115 is valid.
4116 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4117 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4118 local symbol if permitted.
4119 (Sized_relobj::do_finalize_local_symbols): Call
4120 is_output_symtab_index_set rather than needs_output_symtab_entry.
4121 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4122 rather than needs_output_symtab_entry. Call
4123 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4124 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4125 is_output_symtab_index_set rather than needs_output_symtab_entry.
4126 * testsuite/discard_locals_relocatable_test.c: New file.
4127 * testsuite/discard_locals_test.sh: Test -r.
4128 * testsuite/Makefile.am (check_DATA): Add
4129 discard_locals_relocatable_test1.syms,
4130 discard_local_relocatable_test2.syms.
4131 (MOSTLYCLEANFILES): Likewise. Also add
4132 discard_locals_relocatable_test1.lout and
4133 discard_locals_relocatable_test2.out.
4134 (discard_locals_relocatable_test1.syms): New target.
4135 (discard_locals_relocatable_test.o): New target.
4136 (discard_locals_relocatable_test1.out): New target.
4137 (discard_locals_relocatable_test2.syms): New target.
4138 (discard_locals_relocatable_test2.out): New target.
4139 (various): Add missing ../ld-new dependencies.
4140 * testsuite/Makefile.in: Rebuild.
4141
7e8ccf26
NC
41422010-03-03 Nick Clifton <nickc@redhat.com>
4143
4144 * po/fi.po: New Finnish translation.
4145
2a0ff005
DK
41462010-03-01 Doug Kwan <dougkwan@google.com>
4147
4148 * layout.cc (Layout::Layout): Force section types of .init_array*,
4149 .preinit_array* and .fini_array* sections.
4150 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4151 Fix check of return value of std::string::find.().
4152 (Output_section::Input_section_sort_compare::operator()): Remove
4153 comment about .init_array.
4154 (Output_section::Input_section_sort_init_fini_compare::operator()):
4155 New method.
4156 (Output_section::sort_attached_input_sections): Handle .init_array
4157 and .fini_array specially.
4158 * output.h (Output_section::Inut_section_sort_compare): Update
4159 comment.
4160 (Output_section::Input_section_sort_init_fini_compare): New struct.
4161
c3e4ae29
DK
41622010-02-26 Doug Kwan <dougkwan@google.com>
4163
4164 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4165 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4166 * testsuite/debug_msg.sh: Avoid matching source line number for
4167 use of global variable undef_int.
4168
2fd9ae7a
DK
41692010-02-26 Doug Kwan <dougkwan@google.com>
4170
4171 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4172 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4173 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4174 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4175 * options.cc (General_options::General_options): Initialize member
4176 fix_v4bx_.
4177 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4178 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4179 and rm_no_fix_v4bx.stdout
4180 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4181 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4182 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4183 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4184 and arm_no_fix_v4bx.
4185 * Makefile.in: Regenerate.
4186 * testsuite/arm_fix_v4bx.s: New file.
4187 * testsuite/arm_fix_v4bx.sh: Ditto.
4188
67ec7d0b
DK
41892010-02-24 Doug Kwan <dougkwan@google.com>
4190
4191 * arm.cc (Target_arm::got_section): Make the .got section the first
4192 non RELRO section in the data segment.
4193 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4194 suffixes of section names.
4195
10165461
DK
41962010-02-24 Doug Kwan <dougkwan@google.com>
4197
4198 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4199 flags and attributes merging if an input file is a binary file.
4200 * fileread.cc (Input_file::open): Record format of original file.
4201 * fileread.h (Input_file::Format): New enum type.
4202 (Input_file::Input_file): Initialize data member format_.
4203 (Input_file::format): New method definition.
4204 (Input_file::format_):: New data member.
4205
4a54abbb
DK
42062010-02-24 Doug Kwan <dougkwan@google.com>
4207
4208 * arm.cc (Arm_output_data_got): New class.
4209 (ARM_TCB_SIZE): New constant
4210 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4211 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4212 If user uses a script with a SECTIONS clause, issue only a warning
4213 for a misplaced EXIDX input section. Otherwise, issue an error.
4214 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4215 garbage collection.
4216 (Target_arm::got_mode_index_entry): Handle static linking.
4217 (Target_arm::Scan::local): Ditto.
4218 (Target_arm::Scan::global): Ditto.
4219 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
4220 all incorrectly implemented relocations.
e1df38aa 4221 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
4222 Arm_output_section::fix_exidx_coverage.
4223 * layout.cc (Layout::section_name_mapping): Remove trailing dots
4224 from ".ARM.exidx." and ".ARM.extab.".
4225
ca419a6f
ILT
42262010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4227
4228 * arm.cc (Target_arm::do_finalize_sections): Create attribute
4229 section if it does not already exist.
4230 * attributes.cc (Attributes_section_data::Attributes_section_data):
4231 Don't crash if size is zero.
4232
135b9c78
ILT
42332010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4234 Ian Lance Taylor <iant@google.com>
4235
4236 * gold.cc (queue_middle_tasks): If no input files were opened,
4237 exit.
4238 * workqueue.h (Task_function::Task_function): Assert that there is
4239 a blocker.
4240
bb0bfe4f
DK
42412010-02-22 Doug Kwan <dougkwan@google.com>
4242
4243 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
4244 * icf.cc (get_section_contents): Cast snprintf arguments to long long
4245 types to avoid warnings due to different uint64_t implementations
4246 on different hosts.
4247
2a2b6d42
DK
42482010-02-21 Doug Kwan <dougkwan@google.com>
4249
4250 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
4251 handling of the maximum backward branch offset.
4252 (Arm_relocate_functions::thumb_branch_common): Ditto.
4253 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
4254 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 4255 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
4256 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
4257 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
4258 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
4259 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
4260 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
4261 thumb_bl_out_of_range thumb_bl_out_of_range.o,
4262 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
4263 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
4264 thumb2_bl_out_of_range.o): New rules.
4265 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
4266 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
4267 thumb2_bl_out_of_range
4268 * testsuite/Makefile.in: Regenerate.
4269 * testsuite/arm_bl_in_range.s: New file.
4270 * testsuite/arm_bl_out_of_range.s: Ditto.
4271 * testsuite/arm_branch_in_range.sh: Ditto.
4272 * testsuite/arm_branch_range.t: Ditto.
4273 * testsuite/thumb2_branch_range.t: Ditto.
4274 * testsuite/thumb_bl_in_range.s: Ditto.
4275 * testsuite/thumb_bl_out_of_range.s: Ditto.
4276 * testsuite/thumb_branch_range.t: Ditto.
4277
b487ad64
ST
42782010-02-20 Sriraman Tallam <tmsriram@google.com>
4279
4280 * gc.h (gc_process_relocs): Change vectors to point to the new list.
4281 Add reloc offset information.
4282 * icf.cc (get_section_contents): Change iterators to point to the new
4283 vectors. Add reloc offset information to the contents.
4284 * icf.h (Icf::Sections_reachable_info): New typedef.
4285 (Icf::Sections_reachable_list): New typedef.
4286 (Icf::Offset_info): New typedef.
4287 (Icf::Reloc_info): New struct typedef.
4288 (Icf::Reloc_info_list): New typedef.
4289 (Icf::symbol_reloc_list): Delete method.
4290 (Icf::addend_reloc_list): Delete method.
4291 (Icf::section_reloc_list): Delete method.
4292 (Icf::reloc_info_list): New method.
4293 (Icf::reloc_info_list_): New member.
4294
f96accdf
DK
42952010-02-19 Doug Kwan <dougkwan@google.com>
4296
4297 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
4298 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
4299 * arm.cc (Arm_relocation_functions): New forward declaration.
4300 (Target_arm::Target_arm): Initialize new data members
4301 got_mod_index_offset_ and tls_base_symbol_defined_.
4302 (Target_arm::Relocate::relocate_tls): New method.
4303 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
4304 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
4305 New methods.
4306 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
4307 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
4308 (Target_arm::got_mod_index_offset_,
4309 Target_arm::tls_base_symbol_defined_): New data members.
4310 (Target_arm::Scan::local, Target::Scan::global,
4311 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
4312 relocations.
4313
c8761b9a
DK
43142010-02-18 Doug Kwan <dougkwan@google.com>
4315
4316 * arm.cc (Arm_relobj::find_linked_text_section): New method.
4317 (Arm_relobj::make_exidx_input_section): Pass section index of linked
4318 text section as a parameter becuase some broken tools may not set
4319 the link in section header.
4320 (Target_arm::has_got_section): New method.
4321 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
4322 without any mapping symbol as data only. Remove warning.
4323 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
4324 link in its section header, try to discover the link by inspecting the
4325 REL31 relocation at the beginning of the section.
4326 (Target_arm::Scan::check_non_pic): Report name of offending relocation
4327 in error message.
4328 (Target_arm::Scan::global): Treat any reference to the symbol
4329 _GLOBAL_OFFSET_TABLE_ as a GOT access.
4330
21bb3914
ST
43312010-02-12 Sriraman Tallam <tmsriram@google.com>
4332
4333 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
4334 (Scan::global_reloc_may_be_function_pointer): New function.
4335 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4336 (Scan::global_reloc_may_be_function_pointer): New function.
4337 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4338 (Scan::global_reloc_may_be_function_pointer): New function.
4339 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
4340 (Scan::global_reloc_may_be_function_pointer): New function.
4341 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
4342 (Scan::global_reloc_may_be_function_pointer): New function.
4343 (Scan::possible_function_pointer_reloc): New function.
4344 (Target_x86_64::can_check_for_function_pointers): New function.
4345 * gc.h (gc_process_relocs): Scan relocation types to determine if
4346 function pointers were taken for targets that support it.
4347 * icf.cc (Icf::find_identical_sections): Include functions for
4348 folding in safe ICF whose pointer is not taken.
4349 * icf.h (Secn_fptr_taken_set): New typedef.
4350 (fptr_section_id_): New member.
4351 (section_has_function_pointers): New function.
4352 (set_section_has_function_pointers): New function.
4353 (check_section_for_function_pointers): New function.
4354 * options.h: Fix comment for safe ICF option.
4355 * target.h (can_check_for_function_pointers): New function.
4356 * testsuite/Makefile.am: Add icf_safe_so_test test case.
4357 Modify icf_safe_test for X86-64.
4358 * testsuite/Makefile.in: Regenerate.
4359 * testsuite/icf_safe_so_test.cc: New file.
4360 * testsuite/icf_safe_so_test.sh: New file.
4361 * testsuite/icf_safe_test.cc (kept_func_3): New function.
4362 (main): Change to take pointer to function kept_func_3.
4363 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
4364 folding is done correctly for X86-64.
4365
0da6fa6c
DM
43662010-02-12 David S. Miller <davem@davemloft.net>
4367
4368 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
4369 is_symbolless parameter.
4370 (Output_reloc<SHT_REL>::is_symbolless): New.
4371 (Output_reloc<SHT_REL>::is_symbolless_): New.
4372 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
4373 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
4374 (Output_reloc<SHT_RELA>::is_symbolless): New.
4375 (Output_data_reloc::add_global): Handle is_symbolless.
4376 (Output_data_reloc::add_global_relative): Likewise.
4377 (Output_data_reloc::add_local): Likewise.
4378 (Output_data_reloc::add_local_relative): Likewise.
4379 (Output_data_reloc::add_symbolless_global_addend): New.
4380 (Output_data_reloc::add_symbolless_local_addend): New.
4381 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
4382 is_symbolless.
4383 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
4384 instead of ->is_relative_
4385 (Output_reloc::write): Likewise.
4386 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
4387 (Output_reloc::write_rel): Simplify.
4388
4389 * sparc.cc (Target_sparc::Scan::local): Use
4390 ->add_symbolless_local_addend as needed.
4391 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
4392 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
4393 based upon relocation offset.
4394
e4782e83
DK
43952010-02-11 Doug Kwan <dougkwan@google.com>
4396
4397 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4398 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4399 beginning of function.
4400 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4401 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4402 parameter is_32bit in calls to should_apply_static_reloc.
4403 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4404 (check_DATA): Add arm_abs_global.stdout.
4405 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4406 arm_abs_global.stdout): New rules.
4407 (MOSTLLYCLEANFILES): Add arm_abs_global
4408 * Makefile.in: Regenerate.
4409 * testsuite/arm_abs_global.s: New file.
4410 * testsuite/arm_abs_global.sh: Ditto.
4411 * testsuite/arm_abs_lib.s: Ditto.
4412
93ceb764
ILT
44132010-02-11 Ian Lance Taylor <iant@google.com>
4414
4415 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4416 Read_relocs task.
4417 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4418 Allocate_commons_task first.
4419 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4420 task, rather than symtab_lock_.
4421 (Gc_process_relocs::~Gc_process_relocs): New function.
4422 (Gc_process_relocs::is_runnable): Check this_blocker_.
4423 (Gc_process_relocs::locks): Use next_blocker_ rather than
4424 blocker_.
4425 (Scan_relocs::~Scan_relocs): New function.
4426 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4427 symtab_lock_.
4428 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4429 next_blocker_.
4430 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4431 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4432 constructor accordingly.
4433 (class Gc_process_relocs): Likewise.
4434 (class Scan_relocs): Likewise.
4435 * common.h (class Allocate_commons_task): Remove symtab_lock_
4436 field, and corresponding constructor parameter.
4437 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4438 symtab_lock_.
4439 (Allocate_commons_task::locks): Likewise.
4440
114dfbe1
ILT
44412010-02-11 Ian Lance Taylor <iant@google.com>
4442
4443 * gold-threads.h (class Once): Define.
4444 (class Initialize_lock): Rewrite as child of Once.
4445 * gold-threads.cc (class Once_initialize): Define.
4446 (once_pointer_control): New static variable.
4447 (once_pointer, once_arg): New static variables.
4448 (c_run_once): New static function.
4449 (Once::Once, Once::run_once, Once::internal_run): New functions.
4450 (class Initialize_lock_once): Remove.
4451 (initialize_lock_control): Remove.
4452 (initialize_lock_pointer): Remove.
4453 (initialize_lock_once): Remove.
4454 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4455 (Initialize_lock::initialize): Rewrite.
4456 (Initialize_lock::do_run_once): New function.
4457 * archive.cc (Archive::interpret_header): Only clear name if it is
4458 not already empty.
4459 * fileread.cc: Include "gold-threads.h"
4460 (file_counts_lock): New static variable.
4461 (file_counts_initialize_lock): Likewise.
4462 (File_read::release): Only increment counts when using --stats.
4463 Use a lock around the increment.
4464 * parameters.cc (class Set_parameters_target_once): Define.
4465 (set_parameters_target_once): New static variable.
4466 (Parameters::Parameters): Move here from parameters.h.
4467 (Parameters::set_target): Rewrite.
4468 (Parameters::set_target_once): New function.
4469 (Parameters::clear_target): Move here and rewrite.
4470 * parameters.h (class Parameters): Update declarations. Add
4471 set_parameters_target_once_ field.
4472 (Parameters::Parameters): Move to parameters.cc.
4473 (Parameters::clear_target): Likewise.
4474 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4475 task.
4476 (Start_group::~Start_group): New function.
4477 (Start_group::is_runnable): New function.
4478 (Start_group::locks, Start_group::run): New functions.
4479 (Finish_group::run): Change saw_undefined to size_t.
4480 * readsyms.h (class Start_group): Define.
4481 (class Finish_group): Change saw_undefined_ field to size_t.
4482 (Finish_group::Finish_group): Remove saw_undefined and
4483 this_blocker parameters. Change all callers.
4484 (Finish_group::set_saw_undefined): New function.
4485 (Finish_group::set_blocker): New function.
4486 * symtab.h (class Symbol_table): Change saw_undefined to return
4487 size_t. Change saw_undefined_ field to size_t.
4488 * target-select.cc (Set_target_once::do_run_once): New function.
4489 (Target_selector::Target_selector): Initialize set_target_once_
4490 field. Don't initialize lock_ and initialize_lock_ fields.
4491 (Target_selector::instantiate_target): Rewrite.
4492 (Target_selector::set_target): New function.
4493 * target-select.h (class Set_target_once): Define.
4494 (class Target_selector): Update declarations. Make
4495 Set_target_once a friend. Remove lock_ and initialize_lock_
4496 fields. Add set_target_once_ field.
4497
fa17a3f4
ILT
44982010-02-10 Ian Lance Taylor <iant@google.com>
4499
4500 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4501 queueing any tasks.
4502 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4503 (queue_middle_tasks): Add all blockers before queueing any tasks.
4504 (queue_final_tasks): Likewise.
4505 * token.h (Task_token::add_blockers): New function.
4506 * object.h (Input_objects::number_of_relobjs): New function.
4507
c7177d31
ILT
45082010-02-10 Ian Lance Taylor <iant@google.com>
4509
5de0e392
ILT
4510 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4511 shared, not if not position independent.
4512 * x86_64.cc (Relocate::relocate_tls): Likewise.
4513 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4514 (tls_pie_pic_test): New target.
4515 * testsuite/Makefile.in: Rebuild.
4516
c7177d31
ILT
4517 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4518 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4519 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4520 * testsuite/Makefile.in: Rebuild.
4521
684b268a
DM
45222010-02-09 David S. Miller <davem@davemloft.net>
4523
4524 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4525 R_SPARC_RELATIVE using ->add_local_relative().
4526 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4527
612a8d3d
DM
4528 * output.h (Output_data_dynamic::add_section_size): New method
4529 that takes two Output_data objects.
4530 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4531 entry param. Handle it in initializers.
4532 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4533 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4534 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4535 arg.
4536 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4537 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4538 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4539 for dynrel_includes_plt.
4540 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4541 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4542 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4543 before .rela.plt
4544 (Target_sparc::do_finalize_sections): Update to pass true for
4545 dynrel_includes_plt.
4546 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4547 output before .rela.plt
4548 (Target_powerpc::do_finalize_sections): Update to pass true for
4549 dynrel_includes_plt when 32-bit.
4550
cb1be87e
DK
45512010-02-08 Doug Kwan <dougkwan@google.com>
4552
4553 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4554 method.
4555 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4556 Arm_relobj::scan_section_for_cortex_a8_stubs,
4557 Arm_relobj::do_relocation_section): Instead of calling
4558 Output_section::output_address, use faster
4559 Arm_relobj::simple_input_section_output_address.
4560
705b5121
DM
45612010-02-08 David S. Miller <davem@davemloft.net>
4562
4563 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4564 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4565 relocation helper function.
4566
024c4466
DM
4567 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4568 just like R_SPARC_GOT{10,13,22}.
4569 (Target_sparc::Scan::local): Likewise.
4570 (Target_sparc::Relocate:relocate): Likewise.
4571
9109c078
ILT
45722010-02-06 Ian Lance Taylor <iant@google.com>
4573
4574 * configure.ac: Rewrite targetobjs duplicate removal code to use
4575 only shell constructs.
4576 * configure: Rebuild.
4577
cf846138
DK
45782010-02-05 Doug Kwan <dougkwan@google.com>
4579
4580 PR 11247
4581 * arm.cc (Arm_relobj::section_is_scannable): New method.
4582 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4583 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4584
6cfaf60b
DK
45852010-02-04 Doug Kwan <dougkwan@google.com>
4586
4587 PR 11247
4588 * arm-reloc-property.cc (cstdio): Include.
4589 * configure.ac (targetobjs): Remove duplicates.
4590 * configure: Regenerate.
4591 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4592 big and little endian version for a given address size.
4593
5c57f1be
DK
45942010-02-03 Doug Kwan <dougkwan@google.com>
4595
4596 * arm-reloc-property.cc
4597 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4598 definition.
4599 * arm-reloc-property.h
4600 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4601 New method definition.
4602 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4603 declaration.
4604 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4605 overflow to N.
4606 (GOT_PREL): Change implemented to Y.
4607 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4608 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4609 (Arm_relocate_functions::movw_abs_nc): Remove method.
4610 (Arm_relocate_functions::movt_abs): Ditto.
4611 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4612 (Arm_relocate_functions::thm_movt_abs): Ditto.
4613 (Arm_relocate_functions::movw_rel_nc): Ditto.
4614 (Arm_relocate_functions::movw_rel): Ditto.
4615 (Arm_relocate_functions::movt_rel): Ditto.
4616 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4617 (Arm_relocate_functions:thm_movw_rel): Ditto.
4618 (Arm_relocate_functions:thm_movt_rel): Ditto.
4619 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4620 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4621 New method definitions.
4622 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4623 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4624 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4625 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4626 (Target_arm::Relocate::relocate): Check for non-static or
4627 unimplemented relocation code and exit early. Change calls to
4628 Target_arm::reloc_uses_thumb_bit and
4629 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4630 instead. Refactor code to handle similar relocations to increase
4631 code sharing. Remove check for unsupported relocation code in switch
4632 statement.
4633 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4634 relocation property table to find out size. Change error message to
4635 print out the name of a relocation code instead of the numeric value.
4636 (Target_arm::scan_reloc_for_stub): Use relocation property table
4637 instead of calling Target_arm::reloc_uses_thumb_bit().
4638
218c5831
DK
46392010-02-02 Doug Kwan <dougkwan@google.com>
4640
4641 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4642 types of relaxed input section.
4643
0d31c79d
DK
46442010-02-02 Doug Kwan <dougkwan@google.com>
4645
4646 * Makefile.am (HFILES): Add arm-reloc-property.h.
4647 (DEFFILES): New.
4648 (TARGETSOURCES): Add arm-reloc-property.cc
4649 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4650 (libgold_a_SOURCES): $(DEFFILES)
4651 * Makefile.in: Regenerate.
4652 * arm-reloc-property.cc: New file.
4653 * arm-reloc-property.h: New file.
4654 * arm-reloc.def: New file.
4655 * arm.cc: Update comments.
4656 (arm-reloc-property.h): New included header.
4657 (arm_reloc_property_table): New global variable.
4658 (Target_arm::do_select_as_default_target): New method definition.
4659 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4660 arm-reloc-property to targ_extra_obj.
4661 * parameters.cc (set_parameters_target): Call
4662 Target::select_as_default_target().
4663 * target.h (Target::select_as_default_target): New method definition.
4664 (Target::do_select_as_default_target): Same.
4665
546c7457
DK
46662010-02-01 Doug Kwan <dougkwan@google.com>
4667
4668 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4669 first_output_text_section_.
4670 (Arm_exidx_fixup::first_output_text_section): New method definition.
4671 (Arm_exidx_fixup::first_output_text_section_): New data member.
4672 (Arm_exidx_fixup::process_exidx_section): Record the first text
4673 output section seen.
4674 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4675 and entsize in output section header.
4676
11b861d5
DK
46772010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4678
4679 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4680 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4681 (Arm_relocate_functions::thm_alu11): New Method.
4682 (Arm_relocate_functions::thm_pc8): New Method.
4683 (Arm_relocate_functions::thm_pc12): New Method.
4684 (Target_arm::Scan::local): Handle the relocations.
4685 (Target_arm::Scan::global): Likewise.
4686 (Target_arm::Relocate::relocate): Likewise.
4687 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4688
c9a2c125
DK
46892010-01-29 Doug Kwan <dougkwan@google.com>
4690
4691 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4692 of relocation types as ld.
4693
1521477a
DK
46942010-01-29 Doug Kwan <dougkwan@google.com>
4695
4696 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4697 to public.
4698 (Arm_relocate_functions::thumb_branch_common): Ditto.
4699 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4700 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4701 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4702 Arm_relocate_functions::jump24): Remove.
4703 (Target_arm::Relocate::relocate): Adjust code to call
4704 Arm_relocation_functions::arm_branch_common and
4705 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4706 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4707
e7eca48c
DK
47082010-01-29 Doug Kwan <dougkwan@google.com>
4709
4710 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4711 output_local_symbol_count_needs_update_.
4712 (Arm_relobj::output_local_symbol_count_needs_update,
4713 Arm_relobj::set_output_local_symbol_count_needs_update,
4714 Arm_relobj::update_output_local_symbol_count): New methods.
4715 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4716 member.
4717 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4718 of pointed function as in a R_ARM_PREL31 relocation.
4719 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4720 for output local symbol count updating.
4721 (Target_arm::do_relax): Update output local symbol counts in objects
4722 if necessary.
4723 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4724
02961d7e
ILT
47252010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4726
4727 * arm.cc: Added support for the ARM relocations:
4728 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4729 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4730 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4731 movw_prel_nc).
4732 (Arm_relocate_functions::movw_rel): New method.
4733 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4734 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4735 thm_movw_prel_nc).
4736 (Arm_relocate_functions::thm_movw_rel): New method.
4737 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4738 thm_movt_prel).
4739 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4740 relocations.
4741 (Target_arm::Scan::global): Likewise.
4742 (Target_arm::Relocate::relocate): Likewise.
4743 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4744 Likewise.
4745
b10d2873
ILT
47462010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4747
4748 * arm.cc: Added support for ARM group relocations.
4749 (Target_arm::reloc_needs_sym_origin): New method.
4750 (Arm_relocate_functions::calc_grp_kn): New method.
4751 (Arm_relocate_functions::calc_grp_residual): New method.
4752 (Arm_relocate_functions::calc_grp_gn): New method.
4753 (Arm_relocate_functions::arm_grp_alu): New Method.
4754 (Arm_relocate_functions::arm_grp_ldr): New Method.
4755 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4756 (Arm_relocate_functions::arm_grp_ldc): New Method.
4757 (Target_arm::Scan::local): Handle the ARM group relocations.
4758 (Target_arm::Scan::global): Likewise.
4759 (Target_arm::Relocate::relocate): Likewise.
4760 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4761 Likewise.
4762
2b328d4e
DK
47632010-01-26 Doug Kwan <dougkwan@google.com>
4764
4765 * arm.cc (set): Include.
4766 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4767 pointer type.
4768 (Arm_output_section::Text_section_list): New type.
4769 (Arm_output_section::append_text_sections_to_list): New method.
4770 (Arm_output_section::fix_exidx_coverage): Ditto.
4771 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4772 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4773 Relobj::set_section_offset() instead of
4774 Sized_relobj::invalidate_section_offset().
4775 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4776 parameter for section headers. Ignore relocation sections for
4777 unallocated sections and EXIDX sections.
4778 (Target_arm::fix_exidx_coverage): New method.
4779 (Target_arm::output_section_address_less_than): New type.
4780 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4781 linked text section instead of the EXIDX section.
4782 (Arm_output_section::create_stub_group): Add an assertion to check
4783 that this is not an EXIDX output section.
4784 (Arm_output_section::append_text_sections_to_list): New method.
4785 (Arm_output_section::fix_exidx_coverage): Ditto.
4786 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4787 Arm_relobj::section_needs_reloc_stub_scanning.
4788 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4789 first pass.
4790 (Target_arm::fix_exidx_coverage): New method.
4791 * object.h (Relobj::set_output_section): New method.
4792 (Sized_relobj::invalidate_section_offset): Remove method.
4793 (Sized_relobj::do_invalidate_section_offset): Remove method.
4794 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4795
c7f3c371
DK
47962010-01-25 Doug Kwan <dougkwan@google.com>
4797
4798 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4799 Fix warning due to signed and unsigned comparison on a 32-bit host.
4800
8923b24c
DK
48012010-01-22 Doug Kwan <dougkwan@google.com>
4802
4803 * arm.cc (Target_arm::do_relax): Record an output section for section
4804 offset adjustment it contains any stub table that has changed.
4805 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4806 offsets in an output section if necessary.
4807 * output.cc (Output_section::Output_section): Initialize
4808 section_offsets_need_adjustments_.
4809 (Output_section::add_input_section_for_script): Renamed to
4810 Output_section::add_simple_input_section.
4811 (Output_section::save_states): Add a comment.
4812 (Output_section::discard_states): New method defintion.
4813 (Output_section::adjust_section_offsets): Same.
4814 * output.h (Output_section::add_input_section_for_script): Renamed to
4815 Output_section::add_simple_input_section.
4816 (Output_section::discard_states): New method declaration.
4817 (Output_section::adjust_section_offsets): Same.
4818 (Output_section::section_offsets_need_adjustment,
4819 Output_section::set_section_offsets_need_adjustment): New method
4820 definitions.
4821 (Output_section::section_offsets_need_adjustment_): New data member.
4822 * script-sections.cc
4823 (Output_section_element_input::set_section_address): Adjust code for
4824 renaming of Output_section::add_input_section_for_script.
4825 (Orphan_output_section::set_section_address): Same.
4826
9b2fd367
DK
48272010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4828
4829 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4830 Fix_v4bx enum values .
4831 * gold/options.h (General_options): New option definitions.
4832 (General_options::fix_v4bx): New method.
4833 (General_options::Fix_v4bx): New enum.
4834 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4835 (General_options::parse_fix_v4bx_interworking): New method.
4836
80d0d023
DK
48372010-01-22 Doug Kwan <dougkwan@google.com>
4838
4839 * arm.cc (Arm_exidx_fixup): New class.
4840
af2cdeae
DK
48412010-01-21 Doug Kwan <dougkwan@google.com>
4842
4843 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4844 classes.
4845 (Arm_exidx_section_offset_map): New type.
4846
993d07c1
DK
48472010-01-21 Doug Kwan <dougkwan@google.com>
4848
4849 * arm.cc (Arm_exidx_input_section): New class.
4850 (Arm_relobj::exidx_input_section_by_link,
4851 Arm_relobj::exidx_input_section_by_shndx,
4852 Arm_relobj::make_exidx_input_section): New methods.
4853 (read_arm_attributes_section): Remove.
4854 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4855 information about them.
4856 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4857 to here.
4858
5ac169d4
DK
48592010-01-20 Doug Kwan <dougkwan@google.com>
4860
4861 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4862 Input_section_specifier to Section_id.
4863 (Target_arm::new_arm_input_section: Adjust code for change of key
4864 type.
4865 (Target_arm::find_arm_input_section): Ditto.
4866 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4867 (Section_id): Remove.
4868 (Garbage_collection::Section_id_hash): Remove.
4869 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4870 (Section_id): Remove.
4871 (Icf::Section_id_hash): Remove.
4872 * object.h (Section_id, Const_section_id, Section_id_hash,
4873 Const_section_id_hash): New type definitions.
4874 * output.cc (Output_section::add_relaxed_input_section): Change to
4875 use Const_section_id instead of Input_section_specifier as key type.
4876 (Output_section::add_merge_input_section): Ditto.
4877 (Output_section::build_relaxation_map): Change to use Section_id
4878 instead of Input_section_specifier as key type.
4879 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4880 Ditto.
4881 (Output_section::convert_input_sections_to_relaxed_sections): Change
4882 to use Const_section_id instead of Input_section_specifier as key type.
4883 (Output_section::find_merge_section): Ditto.
4884 (Output_section::find_relaxed_input_section): Ditto.
4885 * output.h (Input_section_specifier): Remove class.
4886 (Output_section::Output_section_data_by_input_section_map): Change
4887 key type to Const_section_id.
4888 (Output_section::Output_relaxed_input_section_by_input_section_map):
4889 Ditto.
4890 (Output_section::Relaxation_map): Change key type to Section_id.
4891
a2162063
ILT
48922010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4893
4894 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4895 (class Arm_v4bx_stub): New class.
4896 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4897 (Stub_factory::make_arm_v4bx_stub): New method.
4898 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4899 (Stub_table::empty): Handle v4bx stubs.
4900 (Stub_table::add_arm_v4bx_stub): New method.
4901 (Stub_table::find_arm_v4bx_stub): New method.
4902 (Arm_relocate_functions::v4bx): New method.
4903 (Target_arm::fix_v4bx): New method.
4904 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4905 (Stub_table::relocate_stubs): Likewise.
4906 (Stub_table::do_write): Likewise.
4907 (Stub_table::update_data_size_and_addralign): Likewise.
4908 (Stub_table::finalize_stubs): Likewise.
4909 (Target_arm::Scan::local): Likewise.
4910 (Target_arm::Scan::global): Likewise.
4911 (Target_arm::do_finalize_sections): Likewise.
4912 (Target_arm::Relocate::relocate): Likewise.
4913 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4914 Likewise.
4915 (Target_arm::scan_reloc_for_stub): Likewise.
4916 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4917
5696ab0b
ILT
49182010-01-19 Ian Lance Taylor <iant@google.com>
4919
4920 * output.cc (Output_section_headers::do_sized_write): Write large
4921 segment count to sh_info field.
4922 (Output_file_header::do_sized_write): For large segment count,
4923 write PN_XNUM to e_phnum field.
4924
800d0f56
ILT
49252010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4926
4927 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4928 (Arm_relocate_functions::thm_jump8): New function.
4929 (Arm_relocate_functions::thm_jump11): New function.
4930 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4931 R_ARM_THM_JUMP11.
4932 (Target_arm::Scan::global): Likewise.
4933 (Target_arm::Relocate::relocate): Likewise.
4934 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4935 Likewise.
4936
41263c05
DK
49372010-01-14 Doug Kwan <dougkwan@google.com>
4938
4939 * arm.cc (map, utility): Include headers.
4940 (Target_arm::apply_cortex_a8_workaround): New method.
4941 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4942 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4943 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4944 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4945 the --[no-]fix-cortex-a8 command line options.
4946 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4947 (Target_arm::relocate_stub): Use addend in instruction template.
4948 * options.h (DEFINE_bool): Set the user-set flag.
4949 (General_options): Add --[no-]-fix-cortex options.
4950 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4951 : Update fast look-up map after conversion.
41263c05 4952
459e9b03
ST
49532010-01-14 Sriraman Tallam <tmsriram@google.com>
4954
4955 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4956 in the first pass of do_layout.
4957
b521dfe4
DK
49582010-01-13 Doug Kwan <dougkwan@google.com>
4959
4960 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4961 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4962 apparent compiler problem of not folding static constant integral
4963 data members of elfcpp::Elf_sizes<32>.
4964
44272192
DK
49652010-01-13 Doug Kwan <dougkwan@google.com>
4966
4967 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4968 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4969 Arm_relobj::scan_section_for_cortex_a8_erratum,
4970 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4971 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4972 sections to scan for relocation stubs into a new method
4973 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4974 relocation and Cortex-A8 stub scanning.
4975 (Target_arm::do_relax): Force stubs to be after stubbed sections
4976 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4977 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4978 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4979
44b71ece
ILT
49802010-01-12 Ian Lance Taylor <iant@google.com>
4981
4982 * target-reloc.h (visibility_error): New inline function.
4983 (relocate_section): Call visibility_error.
4984 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4985 (MOSTLYCLEANFILES): Likewise.
4986 (protected_4_pic.o, protected_3.err): New targets.
4987 * testsuite/protected_4.cc: New file.
4988
a120bc7f
DK
49892010-01-12 Doug Kwan <dougkwan@google.com>
4990
4991 * arm.cc (Cortex_a8_reloc): New class.
4992 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4993 and cortex_a8_relocs_info_.
4994 (Target_arm::fix_cortex_a8): New method definition.
4995 (Target_arm::Cortex_a8_relocs_info): New type.
4996 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4997 New data member declarations.
4998 (Target_arm::scan_reloc_for_stub): Record information about
4999 relocations for THUMB branches that might be exempted from the
5000 Cortex-A8 workaround.
5001 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
5002 at the beginning of a relaxation pass.
5003
20138696
DK
50042010-01-12 Doug Kwan <dougkwan@google.com>
5005
5006 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
5007 (Arm_relobj::Mapping_symbol_position,
5008 Arm_reloj::Mapping_symbol_position_less,
5009 Arm_relobj::Mapping_symbols_info): New types.
5010 (Target_arm::is_mapping_symbol_name): New method definition.
5011 (Arm_relobj::do_count_local_symbols): Save information about mapping
5012 symbols.
5013
089d69dc
DK
50142010-01-11 Doug Kwan <dougkwan@google.com>
5015
5016 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
5017 Arm_relocate_functions::thumb32_branch_upper,
5018 Arm_relocate_functions::thumb32_branch_lower,
5019 Arm_relocate_functions::thumb32_cond_branch_offset,
5020 Arm_relocate_functions::thumb32_cond_branch_upper,
5021 Arm_relocate_functions::thumb32_cond_branch_lower,
5022 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
5023 branch offset encoding.
5024 (Arm_relocate_functions::thumb_branch_common): Use new branch
5025 offset encoding methods to avoid code duplication.
5026 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
5027 (Stub_addend_reader::operator()): Use new branch encoding method
5028 to avoid code duplication.
5029
99e5bff2
DK
50302010-01-11 Doug Kwan <dougkwan@google.com>
5031
5032 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
5033 (Target_arm::do_finalize_sections): Define special EXIDX section
5034 symbols only if referenced.
5035 * gc.h (Garbage_collection::add_reference): New method.
5036 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
5037 code duplication.
5038
98e090bd
ILT
50392010-01-11 Ian Lance Taylor <iant@google.com>
5040
d0a91bd8
ILT
5041 * script.cc (Version_script_info::build_expression_list_lookup):
5042 Change complaing about duplicate wildcard match from error to
5043 warning.
5044
98e090bd
ILT
5045 * script.cc (class Lazy_demangler): Recreate--revert part of patch
5046 of 2009-12-30.
5047 (Version_script_info::Version_script_info): Initialize globs_,
5048 default_version_, default_is_global_, and exact_. Don't
5049 initialize globals_ or locals_.
5050 (Version_script_info::build_lookup_tables): Build local symbols
5051 first.
5052 (Version_script_info::unquote): New function.
5053 (Version_script_info::add_exact_match): New function.
5054 (Version_script_info::build_expression_list_lookup): Remove lookup
5055 parameter. Add is_global parameter. Change all callers. Handle
5056 wildcard pattern specially. Unquote pattern. Call
5057 add_exact_match.
5058 (Version_script_info::get_name_to_match): New function.
5059 (Version_script_info::get_symbol_version): New function.
5060 (Version_script_info::get_symbol_version_helper): Remove.
5061 (Version_script_info::check_unmatched_names): Call unquote.
5062 * script.h (class Version_script_info): Change get_symbol_version
5063 to be non-inline and add is_global parameter; change all callers.
5064 Rewrite symbol_is_local. Update declarations. Define struct
5065 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5066 Remove globals_ and locals_ members. Add exact_, globs_,
5067 default_version_, is_global_.
5068 (Version_script_info::Glob): Remove pattern, add expression and
5069 is_global. Update constructor. Change all callers.
5070 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5071 default version.
5072 (Versions::symbol_section_contents): If a symbol is undefined, or
5073 defined in a dynamic object, set the version index to
5074 VER_NDX_LOCAL.
5075 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5076 symbol_is_local.
5077 (Symbol_table::add_from_pluginobj): Likewise.
5078 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5079
d56962d3
DK
50802010-01-11 Doug Kwan <dougkwan@google.com>
5081
5082 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5083 (incremental_dump_LDADD): Add linking option for libintl.
5084 * Makefile.in: Regenerate.
5085
94e6ee91
L
50862010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5087
5088 PR gold/11144
5089 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5090 instead of -Ds.
5091 * testsuite/Makefile.in: Regenerated.
5092
e96c574b
DK
50932010-01-10 Doug Kwan <dougkwan@google.com>
5094
5095 * options.h (DEFINE_var): Use parentheses around argument varname__
5096 in macro body to avoid any unintended subsequent substitutions.
5097
7198066b
ILT
50982010-01-10 Ian Lance Taylor <iant@google.com>
5099
ba4d53bf
ILT
5100 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5101 candidates before doing symbol resolution.
5102
7198066b
ILT
5103 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5104 ODR candidates if only one is weak.
5105
a2beed37
ILT
51062010-01-08 Ian Lance Taylor <iant@google.com>
5107
5108 * script.cc (Version_script_info::build_expression_list_lookup):
5109 Don't warn about ambiguous version, just record the ambiguity.
5110 (Version_script_info::get_symbol_version_helper): Give error if
5111 version is ambiguous.
5112
2fb7225c
DK
51132010-01-08 Doug Kwan <dougkwan@google.com>
5114
5115 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5116 prev_data_size_ and prev_addralign_. Remove initializer for
5117 deleted data member has_been_changed_.
5118 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5119 to determine if the table is empty.
5120 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5121 Remove.
5122 (Stub_table::add_reloc_stub): Define method in class definition
5123 instead of just declaring it there.
5124 (Stub_table::add_cortex_a8_stub): New method definition.
5125 (Stub_table::update_data_size_and_addralign): Ditto.
5126 (Stub_table::finalize_stubs): Ditto.
5127 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5128 (Stub_table::do_addralign_): Return address alignment in the
5129 (Stub_table::do_reset_address_and_file_offset): Define method in
5130 class definition instead of declaring it there. Set current data
5131 size to be the data size of the previous pass.
5132 (Stub_table::set_final_data_size): Use current data size as the
5133 final data size.
5134 (Stub_table::relocate_stub): Change parameter type of stub from
5135 Reloc_stub pointer to Stub pointer.
5136 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5137 (Stub_table::Cortex_a8_stub_list): New typedef.
5138 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5139 Stub_table::prev_addralign_): New data member.
5140 (Arm_relobj::Arm_relobj): Initialize data member
5141 section_has_cortex_a8_workaround_.
5142 (Arm_relobj::section_has_cortex_a8_workaround,
5143 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5144 definitions.
5145 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5146 declarations.
5147 (Target_arm::relocate_stub): Change parameter type of stub from
5148 Reloc_stub pointer to Stub pointer.
5149 (Insn_template::size, Insn_template::alignment): Handle
5150 THUMB16_SPECIAL_TYPE.
5151 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5152 Stub_table::update_data_size_and_addralign,
5153 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5154 definitions.
5155 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5156 (Stub_table::do_write): Ditto.
5157 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5158
880cd20d
ILT
51592010-01-08 Ian Lance Taylor <iant@google.com>
5160
5161 PR 11108
5162 * symtab.h (class Symbol): Remove fields is_target_special_ and
5163 has_plt_offset_. Add field is_defined_in_discarded_section_.
5164 (Symbol::is_defined_in_discarded_section): New function.
5165 (Symbol::set_is_defined_in_discarded_section): New function.
5166 (Symbol::has_plt_offset): Rewrite.
5167 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5168 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5169 Don't initialize is_target_special_ or has_plt_offset_.
5170 Initialize is_defined_in_discarded_section_.
5171 (Symbol_table::add_from_relobj): If appropriate, set
5172 is_defined_in_discarded_section.
5173 * resolve.cc (Symbol::override_base_with_special): Don't test
5174 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5175 * target-reloc.h (relocate_section): Do special handling for
5176 symbols defined in discarded sections for global symbols as well
5177 as local symbols.
5178
2703e3eb
ILT
51792010-01-08 Ian Lance Taylor <iant@google.com>
5180
5181 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5182 the SHT_SYMTAB case.
5183
339d40a3
ILT
51842010-01-08 Ian Lance Taylor <iant@google.com>
5185
5186 * object.cc (Sized_relobj::do_layout): Don't get confused if
5187 layout_eh_frame returns NULL.
5188
abecea76
ILT
51892010-01-08 Ian Lance Taylor <iant@google.com>
5190
5191 PR 11084
5192 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5193 dynamic symbol table, use the normal symbol table.
5194 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5195 symbol table.
5196
6b7dd3f3
ILT
51972010-01-08 Ian Lance Taylor <iant@google.com>
5198
5199 PR 11072
5200 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5201 sections.
5202
36c50e63
L
52032010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5204
5205 * version.cc (print_version): Change to "Copyright 2010".
5206
e291e7b9
ILT
52072010-01-08 Ian Lance Taylor <iant@google.com>
5208
5209 PR 10287
5210 PR 11063
5211 * i386.cc (class Target_i386): Change return type of plt_section
5212 to be non-const.
5213 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5214 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5215 tls_desc_rel_ field.
5216 (Output_data_plt_i386::rel_tls_desc): New function.
5217 (Target_i386::rel_tls_desc_section): New function.
5218 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
5219 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
5220 R_386_TLS_DESC reloc in rel_tls_desc_section.
5221 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
5222 Define struct Tlsdesc_info.
5223 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
5224 (Target_x86_64::do_reloc_symbol_index): New function.
5225 (Target_x86_64::add_tlsdesc_info): New function.
5226 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
5227 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
5228 tlsdesc_rel_ field.
5229 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
5230 all callers.
5231 (Output_data_plt_x86_64::rela_tlsdesc): New function.
5232 (Target_x86_64::rela_tlsdesc_section): New function.
5233 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
5234 handling.
5235 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
5236 (Target_x86_64::do_reloc_addend): New function.
5237 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
5238 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
5239 declarations. Define TARGET_CODE. Add arg field to u1_ union.
5240 (Output_reloc::type): New function.
5241 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
5242 (Output_reloc::is_target_specific): New function.
5243 (Output_reloc::target_arg): New function.
5244 (class Output_reloc) [SHT_RELA]: Add four new constructors for
5245 absolute relocs and target specific relocs.
5246 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
5247 add_target_specific.
5248 (class Output_data_reloc) [SHT_RELA]: Likewise.
5249 * output.cc (Output_reloc::Output_reloc): Add four new versions
5250 for absolute relocs and target specific relocs.
5251 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
5252 (Output_reloc::get_symbol_index): Likewise.
5253 (Output_reloc::local_section_offset): Check that local_sym_index_
5254 is not TARGET_CODE or 0.
5255 (Output_reloc::symbol_value): Likewise.
5256 (Output_reloc::write) [SHT_RELA]: Call target for target specific
5257 reloc.
5258 * target.h (class Target): Add reloc_symbol_index and reloc_addend
5259 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
5260 functions.
5261 * layout.cc (add_target_dynamic_tags): Use output section for
5262 DT_PLTRELSZ and DT_JMPREL.
5263
3a44184e
ILT
52642010-01-07 Ian Lance Taylor <iant@google.com>
5265
5266 PR 11061
5267 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
5268 function.
5269 (class Output_data_reloc_generic): Define.
5270 (class Output_data_reloc_base): Change base class to
5271 Output_data_reloc_generic. Change add() method to call
5272 bump_relative_reloc_count for a relative reloc. Remove
5273 sort_relocs_ field.
5274 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
5275 to sort_relocs().
5276 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
5277 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
5278 appropriate.
5279 * layout.h (class Layout): Update declaration.
5280
ea715a34
ILT
52812010-01-07 Ian Lance Taylor <iant@google.com>
5282
5283 * output.h (class Output_data): Add const version of
5284 output_section and do_output_section.
5285 (class Output_section_data): Add const version of
5286 do_output_section.
5287 (class Output_section): Likewise.
5288 * layout.cc (Layout::add_target_dynamic_tags): New function.
5289 * layout.h (class Layout): Update declarations.
5290 * arm.cc (Target_arm::do_finalize_sections): Use
5291 add_target_dynamic_tags.
5292 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5293 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5294 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5295 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5296
659948a4
ILT
52972010-01-07 Ian Lance Taylor <iant@google.com>
5298
5299 PR 11042
5300 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
5301 object as needed.
5302
9d3b86f6
ILT
53032010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
5304 Ian Lance Taylor <iant@google.com>
5305
5306 PR 11019
5307 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
5308 Xindex::read_symtab_xindex.
5309
bb0d3eb0
DK
53102010-01-07 Doug Kwan <dougkwan@google.com>
5311
5312 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
5313 (Insn_template::thumb16_bcond_insn): New method declaration.
5314 (Insn_template): Fix spelling.
5315 (Stub::thumb16_special): New method declaration.
5316 (Stub::do_write): Define virtual method which was previously pure
5317 virtual.
5318 (Stub::do_thumb16_special): New method declaration.
5319 (Stub::do_fixed_endian_write): New template member.
5320 (Reloc_stub::do_write): Remove.
5321 (Reloc_stub::do_fixed_endian_write): Remove.
5322 (Cortex_a8_stub): New class definition.
5323 (Stub_factory::make_cortex_a8_stub): New method definition.
5324 (Stub_factory::Stub_factory): Add missing static storage class
5325 qualifier for elf32_arm_stub_a8_veneer_blx.
5326
ffeef7df
ILT
53272010-01-07 Ian Lance Taylor <iant@google.com>
5328
dc3f80fe
ILT
5329 PR 10980
5330 * options.h (class General_options): Add --warn-unresolved-symbols
5331 and --error-unresolved-symbols.
5332 * errors.cc (Errors::undefined_symbol): Implement
5333 --warn-unresolved-symbols.
5334
ffeef7df
ILT
5335 * options.h (class General_options): Add -z text and -z textoff.
5336 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
5337
f1ec9ded
ST
53382010-01-06 Sriraman Tallam <tmsriram@google.com>
5339
5340 * gc.h (Garbage_collection::Cident_section_map): New typedef.
5341 (Garbage_collection::cident_sections): New function.
5342 (Garbage_collection::add_cident_section): New function.
5343 (Garbage_collection::cident_sections_): New member.
5344 (gc_process_relocs): Add references to sections whose names are C
5345 identifiers.
5346 * gold.h (cident_section_start_prefix): New constant.
5347 (cident_section_stop_prefix): New constant.
5348 (is_cident): New function.
5349 * layout.cc (Layout::define_section_symbols): Replace string constants
5350 with the newly defined constants.
5351 * object.cc (Sized_relobj::do_layout): Track sections whose names are
5352 C identifiers.
5353 * testsuite/Makefile.am: Add gc_orphan_section_test.
5354 * testsuite/Makefile.in: Regenerate.
5355 * testsuite/gc_orphan_section_test.cc: New file.
5356 * testsuite/gc_orphan_section_test.sh: New file.
5357
6eda8c29
ILT
53582010-01-06 Ian Lance Taylor <iant@google.com>
5359
b9674e17
ILT
5360 PR 10980
5361 * options.h (class General_options): Add --warn-shared-textrel.
5362 * layout.cc (Layout::finish_dynamic_section): Implement
5363 --warn-shared-textrel.
5364
6eda8c29
ILT
5365 PR 10980
5366 * options.h (class General_options): Add --warn-multiple-gp.
5367
32dcd44e
ILT
53682010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5369
5370 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
5371 $(THREADSLIB) and $(LIBDL).
5372 * Makefile.in: Rebuild.
5373
a192ba05
ILT
53742010-01-06 Ian Lance Taylor <iant@google.com>
5375
5376 PR 10980
5377 * options.cc (General_options::parse_section_start): New function.
5378 (General_options::section_start): New function.
5379 (General_options::General_options): Initialize all members.
5380 * options.h: Include <map>
5381 (class General_options): Add --section-start. Add section_starts_
5382 member.
5383 * layout.cc (Layout::attach_allocated_section_to_segment): If
5384 --section-start was used, set the address of the segment. Remove
5385 local sort_sections.
5386 (Layout::relaxation_loop_body): If the address of the load segment
5387 has been set by --section-start, don't use it.
5388 * output.h (Output_segment::update_flags_for_output_section): New
5389 function.
5390 * output.cc (Output_segment::add_output_section): Call
5391 update_flags_for_output_section.
5392
dde3f402
ILT
53932010-01-05 Ian Lance Taylor <iant@google.com>
5394
62dfdd4d
ILT
5395 PR 10980
5396 * options.h (class General_options): Add --undefined-version.
5397 * script.cc (struct Version_expression): Add was_matched_by_symbol
5398 field.
5399 (Version_script_info::matched_symbol): New function.
5400 (Version_script_info::get_symbol_version_helper): Call
5401 matched_symbol.
5402 (Version_script_info::check_unmatched_names): New function.
5403 * script.h (class Version_script_info): Update declarations.
5404 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5405
9c4ae156
ILT
5406 * options.h (class General_options): Use DEFINE_bool_alias for
5407 allow_multiple_definition.
5408 * resolve.cc (Symbol_table::should_override): Don't test
5409 allow_multiple_definition.
5410
dde3f402
ILT
5411 PR 10980
5412 * options.h (class General_options): Add --cref.
5413 * main.cc (main): Print cref table if --cref. Don't close mapfile
5414 until after printing cref table.
5415 * cref.cc: Include "symtab.h".
5416 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5417 (Cref_table_compare::operator()): New function.
5418 (Cref_inputs::gather_cref): New function.
5419 (filecol): New static const.
5420 (Cref_inputs::print_cref): New function.
5421 (Cref::print_cref): New function.
5422 * cref.h: Include <cstdio>.
5423 (class Cref): Update declarations.
5424 * mapfile.h (Mapfile::file): New function.
5425 * object.h (class Object): Define Symbols. Declare virtual
5426 do_get_global_symbols.
5427 (Object::get_global_symbols): New function.
5428 * object.cc (Input_objects::add_object): Pass object to cref_ if
5429 --cref.
5430 (Input_objects::archive_start): Likewise.
5431 (Input_objects::archive_stop): Likewise.
5432 (Input_objects::print_cref): New function.
5433 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5434 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5435 --cref.
5436 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5437 function.
5438 * plugin.h (class Sized_pluginobj): Update declarations.
5439
8781f709
ILT
54402010-01-05 Ian Lance Taylor <iant@google.com>
5441
5442 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5443 to is_default_version. Rename insdef to insdefault.
5444 (Symbol_table::add_from_relobj): Rename def to is_default_version
5445 and local to is_forced_local.
5446 (Symbol_table::add_from_pluginobj): Likewise.
5447 (Symbol_table::add_from_dynobj): Likewise.
5448 (Symbol_table::define_special_symbol): Rename insdef to
5449 insdefault.
5450
fe35d28d
ILT
54512010-01-04 Ian Lance Taylor <iant@google.com>
5452
30bc8c46
ILT
5453 PR 10980
5454 * options.h (class General_options): Add
5455 --allow-multiple-definition and -z muldefs.
5456 * resolve.cc (Symbol_table::should_override): Don't warn about a
5457 multiple symbol definition if --allow-multiple-definition or -z
5458 muldefs.
5459
7eaea549
ILT
5460 PR 10980
5461 * options.h (class General_options): Add --add-needed and
5462 --copy-dt-needed-entries. Tweak --as-needed help entry.
5463 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5464 error if --copy-dt-needed-entries aka --add-needed is used and
5465 would cause a change in behaviour.
5466
fe35d28d
ILT
5467 PR 10980
5468 * options.h (class General_options): Add -G as a short version of
5469 --shared. Add no-op options -assert, -g, and -i.
5470
55a2bb35
ST
54712010-01-04 Sriraman Tallam <tmsriram@google.com>
5472
5473 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5474 check for .text or .gnu.linkonce.t sections.
5475 * icf.cc (Icf::find_identical_sections): Ditto.
5476 Change the detection for mangled function name within the section
5477 name.
5478 * icf.h (is_section_foldable_candidate): New function.
5479
719328e1
ILT
54802009-12-30 Ian Lance Taylor <iant@google.com>
5481
5482 PR 10980
5483 * options.h (class General_options): Permit two dashes with
5484 --retain-symbols-file.
5485
d7bb5745
ILT
54862009-12-30 Ian Lance Taylor <iant@google.com>
5487
403a15dd
ILT
5488 PR 10979
5489 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5490 don't put the file header and segment headers in the text
5491 segment.
5492
eda294df
ILT
5493 PR 10979
5494 * common.cc (Sort_commons::operator()): Stabilize sort when both
5495 entries are NULL.
5496 (Symbol_table::do_allocate_commons_list): When allocating common
5497 symbols, skip a symbol which is no longer common.
5498 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5499 an object before checking its type.
5500 * testsuite/common_test_2.c: New file.
5501 * testsuite/common_test_3.c: New file.
5502 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5503 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5504 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5505 (common_test_2_pic.o, common_test_2.so): New targets.
5506 (common_test_3_pic.o, common_test_3.so): New targets.
5507 * testsuite/Makefile.in: Rebuild.
5508
d7bb5745
ILT
5509 PR 10979
5510 * script.cc (read_input_script): If we see a new SECTIONS clause,
5511 and we have added an input section, give an error.
5512 * layout.h (class Layout): Add have_added_input_section function.
5513 Add have_added_input_section_ field.
5514 * layout.cc (Layout::Layout): Initialize
5515 have_added_input_section_.
5516 (Layout::layout): Set have_added_input_section_.
5517 (Layout::layout_eh_frame): Likewise.
5518
fc59c572
ILT
55192009-12-30 Ian Lance Taylor <iant@google.com>
5520
5521 PR 10931
5522 * options.h (class General_options): Add --sort-common option.
5523 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5524 * common.cc (Sort_common): Add sort_order parameter to
5525 constructor. Add sort_order_ field.
5526 (Sort_commons::operator): Check sort_order_.
5527 (Symbol_table::allocate_commons): Determine the sort order.
5528 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5529 Change all callers.
5530 (Symbol_table::do_allocate_commons_list): Likewise.
5531
1c74fab0
ILT
55322009-12-30 Ian Lance Taylor <iant@google.com>
5533
5534 PR 10916
5535 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5536 symbols from this object, don't change the visibility of an
5537 undefined symbol.
5538 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5539
6affe781
ILT
55402009-12-30 Ian Lance Taylor <iant@google.com>
5541
5542 PR 10861
5543 * script.h (class Version_script_info): Define Language enum.
5544 Update declarations. Define Glob, Exact, and Lookup types. Add
5545 new fields globals_, locals_, and is_finalized_.
5546 * script.cc: Various formatting fixes.
5547 (class Parser_closure): Change language_stack_ from a vector of
5548 std::string to one of Version_script_info::Language. Adjust all
5549 uses accordingly.
5550 (class Lazy_demangler): Remove.
5551 (struct Version_expression): Change language from std::string to
5552 Version_script_info::Language.
5553 (Version_script_info::Version_script_info): New function.
5554 (Version_script_info::~Version_script_info): Don't call clear.
5555 (Version_script_info::finalize): New function.
5556 (Version_script_info::build_lookup_tables): New function.
5557 (Version_script_info::build_expression_list_lookup): New
5558 function.
5559 (Version_script_info::get_symbol_version_helper): Rewrite to use
5560 lookup tables.
5561 (Version_script_info::print_expression_list): Adjust to use
5562 Version_script_info::Language.
5563 (script_push_lex_into_version_mode): Check that the version script
5564 has not been finalized.
5565 (version_script_push_lang): Change language string to
5566 Version_script_info::Language.
5567 * options.cc (Command_line::version_script): New function.
5568 * options.h (class General_options): Add finalize_dynamic_list
5569 function. Change version_script from declaration to definition.
5570 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5571 * testsuite/version_script.map: Remove duplicate def of foo.
5572 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5573 version_script.map.
5574 * testsuite/Makefile.in: Rebuild.
5575
818bf354
ILT
55762009-12-30 Ian Lance Taylor <iant@google.com>
5577
5578 PR 10843
5579 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5580 if the input symbol index is 0, make the output symbol index 0.
5581
ebcc8304
ILT
55822009-12-30 Ian Lance Taylor <iant@google.com>
5583
5584 PR 10670
5585 * options.h (class General_options): Add -x/--discard-all.
5586 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5587 --discard-all. If the local symbol needs a dynamic entry, check
5588 that before handling --discard-locals.
5589
176fe33f
ILT
55902009-12-30 Ian Lance Taylor <iant@google.com>
5591
bb321bb1
ILT
5592 PR 10450
5593 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5594 flags to PF_R.
5595 (Output_segment::add_output_section): Don't change the flags if
5596 the type is PT_TLS.
5597
176fe33f
ILT
5598 PR 10450
5599 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5600 GNU hash table if they need a dynamic value. Otherwise, don't add
5601 them if they are defined in a dynamic object or are forced local.
5602
e8cd95c7
ILT
56032009-12-29 Ian Lance Taylor <iant@google.com>
5604
1b81fb71
ILT
5605 PR 10450
5606 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5607 .gnu.hash table for a 32-bit target.
5608
8d6d383d
ILT
5609 PR 10450
5610 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5611 regular and a dynamic object only needs a dynamic symbol table
5612 entry if it is externally visible.
5613
e785ec03
ILT
5614 PR 10450
5615 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5616 constructor. Add global_offset_table_ field.
5617 (Target_i386::got_section): Set global_offset_table_.
5618 (Target_i386::do_finalize_sections): Set global_offset_table_
5619 size.
5620 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5621 in constructor. Add global_offset_table_ field.
5622 (Target_x86_64::got_section): Set global_offset_table_.
5623 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5624 size.
5625
1a2dff53
ILT
5626 * layout.cc (Layout::Layout): Initialize increase_relro_.
5627 (Layout::get_output_section): Add is_relro, is_last_relro, and
5628 is_first_non_relro parameters. Change all callers.
5629 (Layout::choose_output_section): Likewise.
5630 (Layout::add_output_section_data): Likewise.
5631 (Layout::make_output_section): Likewise.
5632 (Layout::set_segment_offsets): Clear increase_relro when using a
5633 linker script.
5634 * layout.h (class Layout): Add increase_relro method. Add
5635 increase_relro_ field. Update declarations.
5636 * output.cc (Output_section::Output_section): Initialize
5637 is_last_relro_ and is_first_non_relro_.
5638 (Output_segment::add_output_section): Group relro sections is
5639 do_sort is true. Handle is_last_relro and is_first_non_relro.
5640 (Output_segment::maximum_alignment): Remove relro handling.
5641 (Output_segment::set_section_addresses): Add increase_relro
5642 parameter. Change all callers. Add initial alignment to align
5643 relro sections on separate page. Remove old relro handling.
5644 (Output_segment::set_section_list_addresses): Remove in_relro
5645 parameter. Change all callers.
5646 (Output_segment::set_offset): Add increase parameter. Change all
5647 callers. Remove old relro handling.
5648 * output.h (class Output_section): Add new methods: is_last_relro,
5649 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5650 Add is_last_relro_ and is_first_non_relro_ fields.
5651 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5652 Create separate .got.plt section. Call increase_relro.
5653 * x86_64.cc (Target_x86_64::got_section): Likewise.
5654 * testsuite/relro_script_test.t: Add .got.plt.
5655
f0ba79e2
ILT
5656 PR 10450
5657 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5658 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5659 (Layout::finalize): Call set_dynamic_symbol_size.
5660 (Layout::set_dynamic_symbol_size): New function.
5661 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5662 set_dynamic_symbol_size.
5663
e8cd95c7
ILT
5664 PR 10450
5665 * output.h (class Output_section): Add is_entsize_zero_ field.
5666 * output.cc (Output_section::Output_section): Initialize
5667 is_entsize_zero_.
5668 (Output_section::set_entsize): If two different entsizes are
5669 requested, force it to zero.
5670 (Output_section::add_input_section): Set flags for .debug_str
5671 before updating section flags. Set entsize.
5672 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5673 and SHF_STRING if all input sections have those flags.
5674
3e1b9a8a
RÁE
56752009-12-29 Rafael Espindola <espindola@google.com>
5676
5677 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5678 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5679 reporting.
3e1b9a8a 5680
3dcad376
ST
56812009-12-29 Sriraman Tallam <tmsriram@google.com>
5682
5683 * options.cc (General_options::parse_version): Allow -v to exit
5684 without an error if there is nothing to link.
5685
084e2665
ILT
56862009-12-29 Ian Lance Taylor <iant@google.com>
5687
5688 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5689 using a version of gcc before 4.1.
5690 * configure: Rebuild.
5691
250acde3
CD
56922009-12-28 Chris Demetriou <cgd@google.com>
5693
5694 * attributes.cc (Output_attributes_section_data::do_write): Use
5695 std::vector::front rather than std::vector::data.
5696
99fff23b
ILT
56972009-12-28 Ian Lance Taylor <iant@google.com>
5698
5699 * symtab.h (class Symbol_table): Add enum Defined.
5700 * resolve.cc (Symbol_table::should_override): Add defined
5701 parameter. Change all callers. Test whether object is NULL
5702 before calling a method on it.
5703 (Symbol_table::report_resolve_problem): Add defined parameter.
5704 Change all callers.
5705 (Symbol_table::should_override_with_special): Likewise.
5706 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5707 parameter. Change all callers.
5708 (Symbol_table::do_define_in_output_data): Likewise.
5709 (Symbol_table::define_in_output_segment): Likewise.
5710 (Symbol_table::do_define_in_output_segment): Likewise.
5711 (Symbol_table::define_as_constant): Likewise.
5712 (Symbol_table::do_define_as_constant): Likewise.
5713 * script.h (class Symbol_assignment): Add is_defsym parameter to
5714 constructor; change all callers.
5715 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5716 parameter. Change all callers. Add is_defsym_ field.
5717 (class Parser_closure): Add parsing_defsym parameter to
5718 constructor; change all callers. Add parsing_defsym accessor
5719 function. Add parsing_defsym_ field.
5720
556bd683
ILT
57212009-12-28 Ian Lance Taylor <iant@google.com>
5722
5723 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5724 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5725
1782c879
ILT
57262009-12-23 Ian Lance Taylor <iant@google.com>
5727
5728 * i386.cc (Target_i386::do_calls_non_split): Recognize
5729 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5730 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5731 -fsplit-stack prologue when using %r11.
1782c879 5732
329ca2b1
ST
57332009-12-21 Sriraman Tallam <tmsriram@google.com>
5734
5735 * options.cc (General_options::parse_version): Make -v continue and do
5736 the link like GNU ld does.
5737
d675ff46
RÁE
57382009-12-17 Rafael Avila de Espindola <espindola@google.com>
5739
5740 * Makefile.am (CCFILES): Add timer.cc.
5741 (HFILES): Add timer.h.
5742 * configure.ac: Check for sysconf and times.
5743 * main.cc: include timer.h.
5744 (main): Use Timer instead of get_run_time.
5745 * timer.cc: New.
5746 * timer.h: New.
5747 * workqueue.cc: include timer.h.
5748 (Workqueue::find_and_run_task):
5749 Report user, sys and wall time.
5750 * Makefile.in: Regenerate.
5751 * config.in: Regenerate.
5752 * configure: Regenerate.
5753
d6344fb5
DK
57542009-12-16 Doug Kwan <dougkwan@google.com>
5755
5756 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5757 sections.
5758 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5759 relaxed input sections.
5760 * output.cc (Output_section::find_relaxed_input_section): Change
5761 return type to Output_relaxed_input_section pointer. Adjust code
5762 for new type of relaxed_input_section_map_.
5763 * output.h (Output_section::find_relaxed_input_section): Change
5764 return type to Output_relaxed_input_section pointer.
5765 (Output_section::Output_relaxed_input_section_by_input_section_map):
5766 New type.
5767 (Output_section::relaxed_input_section_map_): Change type to
5768 Output_section::Output_relaxed_input_section_by_input_section_map.
5769 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5770 input section.
5771
0e0d5469
ILT
57722009-12-15 Ian Lance Taylor <iant@google.com>
5773
5774 * layout.cc (Layout::create_shstrtab): Only write out after input
5775 sections if we are compressing debug sections.
5776
0649a889
ILT
57772009-12-15 Ian Lance Taylor <iant@google.com>
5778
5779 * archive.cc (Archive::add_symbols): Only look up a symbol without
5780 a version if there is, in fact, a version.
5781
2ea97941
ILT
57822009-12-14 Ian Lance Taylor <iant@google.com>
5783
5784 Revert -Wshadow changes, all changes from:
5785 2009-12-11 Doug Kwan <dougkwan@google.com>
5786 2009-12-11 Nick Clifton <nickc@redhat.com>
5787 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5788
b0eec2cc
DK
57892009-12-11 Doug Kwan <dougkwan@google.com>
5790
5791 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5792 due to -Wshadow.
5793 * attributes.cc (Object_attribute::size): Ditto.
5794 (Attributes_section_data::size): Ditto.
5795 (Attributes_section_data::Attributes_section_data): Ditto.
5796 (Output_attributes_section_data::do_write): Ditto.
5797 * attributes.h (Object_attribute::set_type): Ditto.
5798 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5799
91d6fa6a
NC
58002009-12-11 Nick Clifton <nickc@redhat.com>
5801
5802 * archive.cc: Fix shadowed variable warnings.
5803 * arm.cc: Likewise.
5804 * compressed_output.cc: Likewise.
5805 * compressed_output.h: Likewise.
5806 * configure: Likewise.
5807 * dwarf_reader.cc: Likewise.
5808 * dynobj.cc: Likewise.
5809 * dynobj.h: Likewise.
5810 * ehframe.cc: Likewise.
5811 * ehframe.h: Likewise.
5812 * errors.cc: Likewise.
5813 * expression.cc: Likewise.
5814 * fileread.cc: Likewise.
5815 * fileread.h: Likewise.
5816 * freebsd.h: Likewise.
5817 * i386.cc: Likewise.
5818 * icf.cc: Likewise.
5819 * incremental.h: Likewise.
5820 * layout.cc: Likewise.
5821 * layout.h: Likewise.
5822 * mapfile.cc: Likewise.
5823 * merge.cc: Likewise.
5824 * merge.h: Likewise.
5825 * object.cc: Likewise.
5826 * object.h: Likewise.
5827 * options.h: Likewise.
5828 * output.cc: Likewise.
5829 * output.h: Likewise.
5830 * parameters.cc: Likewise.
5831 * plugin.cc: Likewise.
5832 * powerpc.cc: Likewise.
5833 * reduced_debug_output.cc: Likewise.
5834 * reduced_debug_output.h: Likewise.
5835 * reloc.cc: Likewise.
5836 * reloc.h: Likewise.
5837 * resolve.cc: Likewise.
5838 * script-sections.cc: Likewise.
5839 * script.cc: Likewise.
5840 * script.h: Likewise.
5841 * sparc.cc: Likewise.
5842 * symtab.cc: Likewise.
5843 * symtab.h: Likewise.
5844 * target-select.cc: Likewise.
5845 * target-select.h: Likewise.
5846 * token.h: Likewise.
5847 * workqueue.cc: Likewise.
5848 * workqueue.h: Likewise.
5849 * x86_64.cc: Likewise.
5850
a0351a69
DK
58512009-12-10 Doug Kwan <dougkwan@google.com>
5852
5853 * arm.cc (attributes.h): New include.
5854 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5855 (Arm_relobj::~Arm_relobj): Delete object pointed by
5856 attributes_section_data_.
5857 (Arm_relobj::attributes_section_data): New method definition.
5858 (Arm_relobj::attributes_section_data_): New data member declaration.
5859 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5860 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5861 attributes_section_data_.
5862 (Arm_dynobj::attributes_section_data): New method definition.
5863 (Arm_dynobj::attributes_section_data_): New data member declaration.
5864 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5865 initialization value of may_use_blx_ to false.
5866 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5867 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5868 object attributes to compute results instead of hard-coding.
5869 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5870 Target_arm::get_secondary_compatible_arch,
5871 Target_arm::set_secondary_compatible_arch
5872 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5873 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5874 New method declarations.
5875 (Target_arm::get_aeabi_object_attribute): New method definition.
5876 (Target_arm::attributes_section_data_): New data member declaration.
5877 (read_arm_attributes_section): New template definition.
5878 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5879 (Arm_dynobj::do_read_symbols): Ditto.
5880 (Target_arm::do_finalize_sections): Merge attributes sections from
5881 input. Check for BLX use after attributes section merging.
5882 Fix __exidx_start and __exidx_end visibility. Create an
5883 .ARM.attributes section if necessary.
5884 (Target_arm::get_secondary_compatible_arch,
5885 Target_arm::set_secondary_compatible_arch,
5886 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5887 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5888 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5889 New method definitions.
5890
b59befec
ILT
58912009-12-09 Ian Lance Taylor <iant@google.com>
5892
5893 * plugin.cc (Plugin::load): Don't cast from void* to a function
5894 pointer.
5895
1276bc89
ILT
58962009-12-09 Ian Lance Taylor <iant@google.com>
5897
5898 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5899 information fields.
5900
2f2de248
L
59012009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5902
5903 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5904 Replace two_file_shared_1.so with two_file_shared_2.so.
5905 * testsuite/Makefile.in: Regenerated.
5906
4f787271
DK
59072009-12-08 Doug Kwan <dougkwan@google.com>
5908
5909 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5910 (HFILES): Add attributes.h and int_encoding.h.
5911 * Makefile.in: Regenerate.
5912 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5913 function definitions to int_encoding.cc
5914 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5915 prototypes to int_encoding.h
5916 * reduced_debug_output.cc (int_encoding.h): New include.
5917 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5918 function definitions to int_encoding.cc
5919 (insert_into_vector, read_from_pointer): Move template definitions to
5920 int_encoding.h
5921 * attributes.cc: New file.
5922 * attributes.h: New file.
5923 * int_encoding.cc: New file.
5924 * int_encoding.h: New file.
5925
20b52f1a
RÁE
59262009-12-07 Rafael Avila de Espindola <espindola@google.com>
5927
5928 PR gold/11055
5929 * incremental-dump.cc (dump_incremental_inputs): New.
5930 (main): Use dump_incremental_inputs.
5931
53d7974c
L
59322009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5933
5934 PR gold/10893
5935 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5936 checking elfcpp::STT_FUNC.
5937 (Target_i386::Relocate::relocate): Likewise.
5938 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5939
5940 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5941 symbols from shared libraries into normal FUNC symbols.
5942
5943 * symtab.h (Symbol): Add is_func and use it.
5944
05a352e6
DK
59452009-12-05 Doug Kwan <dougkwan@google.com>
5946
5947 * arm.cc (Target_arm::arm_info): Initialize new fields
5948 attributes_section and attributes_vendor.
5949 * i386.cc (Target_i386::i386_info): Same.
5950 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5951 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5952 fields attributes_section and attributes_vendor.
53d7974c 5953 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5954 * target.h (Target::attributes_section, Target::attributes_vendor,
5955 Target::is_attributes_section, Target::attribute_arg_type,
5956 Target::attributes_order): New method definitions.
5957 (Target::Target_info::attributes_section,
5958 Target::Target_info::attributes_vendor): New fields.
5959 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5960 virtual method definitions.
5961 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5962 attributes_section and attributes_vendor.
5963 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5964
f4e5969c
DK
59652009-12-05 Doug Kwan <dougkwan@google.com>
5966
5967 * arm.cc: Update comments about interworking and stub generation.
5968 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5969 considered as non-PIC.
5970 (Arm_relocate_functions::base_abs): Fix formatting.
5971 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5972 of function to use GOT entry address instead of offset.
5973 (Target_arm::Scan::global): Issue an error if a symbol would need a
5974 PLT does not get one because it is untyped. Remove code to create
5975 dynamic symbols for relative branches.
5976 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5977 takes unsigned integer instead of boolean.
5978
1abce4a6
L
59792009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5980
5981 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5982 (two_file_test_LDADD): Likewise.
5983 (common_test_1_LDADD): Likewise.
5984 (exception_test_LDADD) Likewise.
5985 (weak_test_LDADD): Likewise.
5986 (many_sections_test_LDADD): Likewise.
5987 (initpri1_LDADD): Likewise.
5988 (script_test_1_LDADD): Likewise.
5989 (script_test_2_LDADD): Likewise.
5990 (justsyms_LDADD): Likewise.
5991 (binary_test_LDADD): Likewise.
5992 (large_LDADD): Likewise.
5993 * testsuite/Makefile.in: Regenerated.
5994
adcf2816 59952009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5996
adcf2816
L
5997 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5998 (Symbol_table::override_with_special): Likewise.
5999 (Symbol_table::add_from_object): Likewise.
6000
28e67f5d
RÁE
60012009-12-04 Rafael Avila de Espindola <espindola@google.com>
6002
6003 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6004 Don't set the data_offset twice.
6005
ae10a101
RÁE
60062009-12-04 Rafael Avila de Espindola <espindola@google.com>
6007
6008 * testsuite/Makefile.in: Regenerate.
6009
f59f41f3
DK
60102009-12-03 Doug Kwan <dougkwan@google.com>
6011
6012 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
6013 (Target_arm::do_finalize_sections): Add parameter for symbol table
6014 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
6015 * i386.cc (Target_i386::do_finalize_sections): Add an additional
6016 parameter for symbol table pointer.
6017 * layout.cc (Layout::finalize): Call Target::finalize_sections with
6018 an additional parameter for a pointer to symbol table.
6019 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
6020 parameter for a symbol table pointer.
6021 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
6022 * target.h (Target::finalize_sections, Target::do_finalize_sections):
6023 Ditto.
6024 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
6025 parameter for a symbol table pointer.
6026
ca55d848
RÁE
60272009-12-03 Rafael Avila de Espindola <espindola@google.com>
6028
6029 * incremental.cc (Incremental_inputs_header)
6030 (Incremental_inputs_header_write, Incremental_inputs_entry)
6031 (Incremental_inputs_entry_write): Move ...
6032 * incremental.h (Incremental_inputs_header)
6033 (Incremental_inputs_header_write, Incremental_inputs_entry)
6034 (Incremental_inputs_entry_write): here.
6035
3aec4f9c
RÁE
60362009-12-02 Rafael Avila de Espindola <espindola@google.com>
6037
6038 * incremental.cc (make_sized_incremental_binary): Set the target.
6039 Error if it is incompatible.
6040 * output.h (Output_file): Add filename method.
6041
9c0ae74d
RÁE
60422009-12-02 Rafael Avila de Espindola <espindola@google.com>
6043
6044 * incremental.cc (Incremental_inputs_entry): Remove unused argument
6045 from the get_* methods.
6046
a45500ae
RÁE
60472009-12-02 Rafael Avila de Espindola <espindola@google.com>
6048
6049 * incremental-dump.cc (main): Check that the offeset of a script is 0.
6050 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
6051 Write 0 for the data_offset of scripts.
6052
325e6408
RÁE
60532009-12-02 Rafael Avila de Espindola <espindola@google.com>
6054
6055 * testsuite/Makefile.am: Add the incremental_test.sh test.
6056 * testsuite/incremental_test.sh: New.
6057 * testsuite/incremental_test_1.c: New.
6058 * testsuite/incremental_test_2.c: New.
6059
954c3e2e
RÁE
60602009-12-01 Rafael Avila de Espindola <espindola@google.com>
6061
6062 * incremental-dump.cc (main): Fix typos.
6063
f8086623
RÁE
60642009-11-27 Rafael Avila de Espindola <espindola@google.com>
6065
6066 PR gold/11025
6067 * incremental-dump.cc (main): Use llu to print 64 bit values.
6068
3b0dd6ac
L
60692009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6070 H.J. Lu <hongjiu.lu@intel.com>
6071
6072 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6073 $(LIBDL).
6074 (incremental_dump_LDADD): Likewise.
6075 * Makefile.in: Regenerated.
6076
a6d1ef57 60772009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 6078
a6d1ef57
DK
6079 Revert:
6080
6081 2009-11-25 Doug Kwan <dougkwan@google.com>
6082
6083 * arm.cc (Target_arm::Target_arm): Move method definition
6084 outside of class definition. Add code to handle
6085 --target1-rel, --target1-abs and --target2= options.
6086 (Target_arm::get_reloc_reloc_type): Change method to be
6087 non-static and const.
6088 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6089 New data member declaration.
6090 (Target_arm::Scan::local, Target_arm::Scan::global,
6091 Target_arm::Relocate::relocate,
6092 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6093 Adjust call to Target_arm::get_real_reloc_type.
6094 (Target_arm::get_real_reloc_type): Use command line options
6095 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6096 * options.h (--target1-rel, --target1-abs, --target2): New
6097 ARM-only options.
6098
50aeb7d4
DK
60992009-11-25 Doug Kwan <dougkwan@google.com>
6100
6101 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6102 class definition. Add code to handle --target1-rel, --target1-abs
6103 and --target2= options.
6104 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6105 and const.
6106 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6107 member declaration.
6108 (Target_arm::Scan::local, Target_arm::Scan::global,
6109 Target_arm::Relocate::relocate,
6110 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6111 call to Target_arm::get_real_reloc_type.
6112 (Target_arm::get_real_reloc_type): Use command line options to
6113 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6114 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6115 options.
6116
51938283
DK
61172009-11-25 Doug Kwan <dougkwan@google.com>
6118
6119 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6120 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6121 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6122 formatting.
6123 (Arm_relocate_functions::thm_call): Replace body with a call to
6124 Arm_relocate_functions::thumb_branch_common.
6125 (Arm_relocate_functions::thm_jump24,
6126 Arm_relocate_functions::thm_xpc22): New method definitions.
6127 (Arm_relocate_functions::thumb_branch_common): New method definition.
6128 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6129 operator.
6130 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6131 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6132
e2b8f3c4
RÁE
61332009-11-24 Rafael Avila de Espindola <espindola@google.com>
6134
6135 * Makefile.am: Build incremental-dump
6136 * Makefile.in: Regenerate.
6137 * incremental-dump.cc: New.
6138 * incremental.cc (Incremental_inputs_header_data,
6139 Incremental_inputs_entry_data): Move to incremental.h
6140 * incremental.h: (Incremental_inputs_header_data,
6141 Incremental_inputs_entry_data): Move from incremental.cc
6142
bcba9aec
RÁE
61432009-11-24 Rafael Avila de Espindola <espindola@google.com>
6144
6145 * incremental.cc (Incremental_inputs_header,
6146 Incremental_inputs_header_write, Incremental_inputs_entry,
6147 Incremental_inputs_entry_write): Add a typedef with the data type.
6148
7c3afe08
RÁE
61492009-11-24 Rafael Avila de Espindola <espindola@google.com>
6150
6151 * incremental.cc (Incremental_inputs_header,
6152 Incremental_inputs_header_write, Incremental_inputs_entry,
6153 Incremental_inputs_entry_write): Update comment about which
6154 type has the filed descriptions.
6155
d204b6e9
DK
61562009-11-15 Doug Kwan <dougkwan@google.com>
6157
6158 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6159 (Arm_relocate_functions::arm_branch_common): Change method defintion
6160 in class definition to a method declaration and update list of formal
6161 parameters.
6162 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6163 Arm_relocation_functions::jump24): Adjust call to
6164 Arm_relocate_functions::arm_branch_common. Update list of formal
6165 parameters.
6166 (Arm_relocate_functions::xpc25): New method definition.
6167 (Arm_relocate_functions::arm_branch_common): Move method defintion
6168 out from class definition. Use stubs for mode-switching and extending
6169 branch ranges.
6170 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6171 specially. Change code to enable use of stubs in ARM branches.
6172
43d12afe
DK
61732009-11-10 Doug Kwan <dougkwan@google.com>
6174
6175 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6176 in method declaration.
6177 (Target_arm::relocate_stub): New method declaration.
6178 (Target_arm::default_target): Change to return a pointer instead of
6179 a const reference.
6180 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6181 Target_arm::default_target.
6182 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6183 method definition.
6184 (Target_arm::relocate_section): Adjust view.
6185 (Target_arm::relocate_stub): New method definition.
6186
ac33a407
DK
61872009-11-10 Doug Kwan <dougkwan@google.com>
6188
6189 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6190 a format warning.
6191 * incremental.cc (open_incremental_binary): Initialized local
6192 variables to avoid warnings.
6193 * object.cc (make_elf_object): Ditto.
6194 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6195 a format warning.
e1df38aa 6196
88ee28e9
L
6197009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6198
6199 PR gold/10930
6200 * testsuite/plugin_test.c: Include "config.h".
6201
2daedcd6
DK
62022009-11-09 Doug Kwan <dougkwan@google.com>
6203
6204 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6205 (arm_symbol_value): Remove.
6206 (Arm_relocate_functions::arm_branch_common,
6207 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6208 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6209 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6210 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6211 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6212 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6213 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6214 Arm_relocate_functions::thm_mobw_abs_nc,
6215 Arm_relocate_functions::thm_mov_abs,
6216 Arm_relocate_functions::movw_prel_nc,
6217 Arm_relocate_functions::thm_movt_abs,
6218 Arm_relocate_functions::movt_prel,
6219 Arm_relocate_functions::thm_movw_prel_nc,
6220 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
6221 (Target_arm::Relocate::relocate): Only decompose address into two
6222 parts if relocation type uses the thumb-bit and pass the actual
6223 bit instead of a flag indicating that the thumb-bit is used. Adjust
6224 calls to methods in Arm_relocate_functions for this change.
6225
1276bc89 62262009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
6227
6228 PR 10925
6229 * reloc.cc: Instantiate
6230 Sized_relobj::initialize_input_to_output_maps and
6231 Sized_relobj:free_input_to_output_maps.
6232
e53ad1b5
ILT
62332009-11-06 Ian Lance Taylor <iant@google.com>
6234
6235 PR 10876
6236 * defstd.cc (in_segment): Set only_if_ref true for "end".
6237
eb44217c
DK
62382009-11-06 Doug Kwan <dougkwan@google.com>
6239
6240 * arm.cc (class Reloc_stub): Correct a comment.
6241 (Target_arm::Target_arm): Initialize arm_input_section_map_.
6242 (Target_arm::scan_section_for_stubs): New method declaration.
6243 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
6244 Change methods from private to protected.
6245 (Target_arm::do_may_relax): New method definition.
6246 (Target_arm::do_relax, Target_arm::group_sections,
6247 Target_arm::scan_reloc_for_stub,
6248 Target_arm::scan_reloc_section_for_stubs): New method declarations.
6249 (Target_arm::arm_input_section_map_): New data member declaration.
6250 (Target_arm::scan_reloc_for_stub,
6251 Target_arm::scan_reloc_section_for_stubs,
6252 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
6253 Target_arm::do_relax): New method definitions.
6254
5d329b7d
ILT
62552009-11-06 Mikolaj Zalewski <mikolaj@google.com>
6256
6257 * configure.ac: Check for (struct stat)::st_mtim
6258 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
6259 * config.in: Regenerate.
6260 * configure: Regenerate.
6261
96a0d71b
ILT
62622009-11-05 Ian Lance Taylor <iant@google.com>
6263
6264 PR 10910
6265 * output.cc (Output_segment::add_output_section): Add missing
6266 return statement.
6267
594c8e5e
ILT
62682009-11-04 Ian Lance Taylor <iant@google.com>
6269
6270 PR 10880
6271 * object.h (class Object): Add is_needed and set_is_needed
6272 methods. Add is_needed_ field. Make bool fields into bitfields.
6273 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
6274 defined in a dynamic object and referenced by a regular object,
6275 set is_needed for the dynamic object.
6276 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
6277 if the file is marked with as_needed and it is not needed.
6278
22b127cc
ILT
62792009-11-04 Ian Lance Taylor <iant@google.com>
6280
6281 PR 10887
6282 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
6283 tags if data is discarded by linker script.
6284 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6285 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6286 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6287 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6288
f5c870d2
ILT
62892009-11-04 Ian Lance Taylor <iant@google.com>
6290
6291 * layout.cc (Layout::get_output_section): Add is_interp and
6292 is_dynamic_linker_section parameters. Change all callers.
6293 (Layout::choose_output_section): Likewise.
6294 (Layout::make_output_section): Likewise.
6295 (Layout::add_output_section_data): Add is_dynamic_linker_section
6296 parameter. Change all callers.
6297 * layout.h (class Layout): Update declarations.
6298 * output.h (class Output_section): Add is_interp, set_is_interp,
6299 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
6300 Add is_interp_, is_dynamic_linker_section_ fields. Change
6301 generate_code_fills_at_write_ to a bitfield.
6302 * output.cc (Output_section::Output_sections): Initialize new
6303 fields.
6304 (Output_segment::add_output_section): Add do_sort parameter.
6305 Change all callers.
6306
1ae4d23b
ILT
63072009-11-03 Ian Lance Taylor <iant@google.com>
6308
6309 PR 10860
6310 * options.h (class General_options): Add --warn-common.
6311 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
6312 merging two common symbols.
6313 (Symbol_table::should_override): Handle --warn-common when merging
6314 a common symbol with a defined symbol. Use report_resolve_problem
6315 for multiple definitions.
6316 (Symbol_table::report_resolve_problem): New function.
6317 * symtab.h (class Symbol_table): Declare report_resolve_problem.
6318
55da9579
DK
63192009-11-03 Doug Kwan <dougkwan@google.com>
6320
6321 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
6322 stub_factory_.
6323 (Target_arm::stub_factory): New method definition.
6324 (Target_arm::new_arm_input_section,
6325 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
6326 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 6327 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
6328 New type definitions.
6329 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
6330 member declarations.
6331 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
6332 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
6333 New method definitions.
6334
37a9ac43
ILT
63352009-11-03 Ian Lance Taylor <iant@google.com>
6336
6337 * options.h (class General_options): Add --warn_constructors.
6338
b3d6a3d4
ILT
63392009-11-03 Ian Lance Taylor <iant@google.com>
6340
6341 PR 10893
6342 * defstd.cc (in_section): Add entries for __rel_iplt_start,
6343 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
6344
934b01dd
ILT
63452009-11-03 Ian Lance Taylor <iant@google.com>
6346
6347 PR 10895
6348 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
6349 --msgid-bugs-address.
6350 (install-pdf): New target.
6351 (install-data_yes): Look up one directory to find mkinstalldirs.
6352
03c1939b
L
63532009-11-03 H.J. Lu <hongjiu.lu@intel.com>
6354
6355 * po/Make-in (.po.gmo): Don't generate .gmo files in source
6356 tree.
6357
ebd95253
DK
63582009-10-30 Doug Kwan <dougkwan@google.com>
6359
6360 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
6361
e9bbb538
DK
63622009-10-30 Doug Kwan <dougkwan@google.com>
6363
6364 * arm.cc (Stub_addend_reader): New struct template definition
6365 and partial specializations.
6366 (Stub_addend_reader::operator()): New method definition for a
6367 partially specialized template.
6368
d5b40221
DK
63692009-10-30 Doug Kwan <dougkwan@google.com>
6370
6371 * arm.cc (Arm_relobj::processor_specific_flags): New method
6372 definition.
6373 (Arm_relobj::do_read_symbols): New method declaration.
6374 (Arm_relobj::processor_specific_flags_): New data member declaration.
6375 (Arm_dynobj): New class definition.
6376 (Target_arm::do_finalize_sections): Add input_objects parameter.
6377 (Target_arm::do_adjust_elf_header): New method declaration.
6378 (Target_arm::are_eabi_versions_compatible,
6379 (Target_arm::merge_processor_specific_flags): New method declaration.
6380 (Target_arm::do_make_elf_object): New overloaded method definitions
6381 and declaration.
6382 (Arm_relobj::do_read_symbols): New method definition.
6383 (Arm_dynobj::do_read_symbols): Ditto.
6384 (Target_arm::do_finalize_sections): Add input_objects parameters.
6385 Merge processor-specific flags from all input objects.
6386 (Target_arm::are_eabi_versions_compatible,
6387 Target_arm::merge_processor_specific_flags,
6388 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
6389 New method definitions.
6390 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
6391 Input_objects pointer type parameter.
6392 * layout.cc (Layout::finalize): Pass input objects to target's.
6393 finalize_sections function.
6394 * output.cc (Output_file_header::do_sized_write): Set ELF file
6395 header's processor-specific flags.
6396 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6397 Input_objects pointer type parameter.
6398 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6399 * target.h (Input_objects): New forward class declaration.
6400 (Target::processor_specific_flags,
6401 Target::are_processor_specific_flags_sect): New method definitions.
6402 (Target::finalize_sections): Add input_objects parameter.
6403 (Target::Target): Initialize processor_specific_flags_ and
6404 are_processor_specific_flags_set_.
6405 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6406 parameter.
6407 (Target::set_processor_specific_flags): New method definition.
6408 (Target::processor_specific_flags_,
6409 Target::are_processor_specific_flags_set_): New data member
6410 declarations.
6411 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6412 Input_objects pointer type parameter.
6413
ebabffbd
DK
64142009-10-30 Doug Kwan <dougkwan@google.com>
6415
6416 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6417
ad0f2072
ILT
64182009-10-28 Ian Lance Taylor <iant@google.com>
6419
6420 * object.h (class Relobj): Drop options parameter from
6421 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6422 do_scan_relocs, do_relocate. Change all callers.
6423 (class Sized_relobj): Drop options parameters from
6424 do_gc_process_relocs, do_scan_relocs, do_relocate,
6425 do_relocate_sections, relocate_sections, emit_relocs_scan,
6426 emit_relocs_scan_reltype. Change all callers.
6427 (struct Relocate_info): Remove options field and all references to
6428 it.
6429 * reloc.h (class Read_relocs): Remove options constructor
6430 parameter and options_ field. Change all callers.
6431 (class Gc_process_relocs, class Scan_relocs): Likewise.
6432 (class Relocate_task): Likewise.
6433 * target-reloc.h (scan_relocs): Remove options parameter. Change
6434 all callers.
6435 (scan_relocatable_relocs): Likewise.
6436 * target.h (class Sized_target): Remove options parameter from
6437 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6438 all callers.
6439 * gc.h (gc_process_relocs): Remove options parameter. Change all
6440 callers.
6441 * arm.cc: Update functions to remove options parameters.
6442 * i386.cc: Likewise.
6443 * powerpc.cc: Likewise.
6444 * sparc.cc: Likewise.
6445 * x86_64.cc: Likewise.
6446 * testsuite/testfile.cc: Likewise.
6447
8ffa3667
DK
64482009-10-28 Doug Kwan <dougkwan@google.com>
6449
6450 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6451 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6452 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6453 New method definitions.
6454
40f36857
CC
64552009-10-28 Cary Coutant <ccoutant@google.com>
6456
6457 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6458 (Plugin::cleanup_done_): New member.
6459 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6460 (Plugin_manager::cleanup_done_): Remove.
6461 (Plugin_manager::add_input_file): Edit error message.
6462 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6463 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6464
2c849493
ILT
64652009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6466
6467 * fileread.cc: (File_read::View::~View): Use the new
6468 data_ownership_ filed.
6469 (File_read::~File_read): Dispose the new whole_file_view_.
6470 (File_read::open): Mmap the whole file if needed.
6471 (File_read::open): Use whole_file_view_ instead of contents_.
6472 (File_read::find_view): Use whole_file_view_ if applicable.
6473 (File_read::do_read): Use whole_file_view_ instead of contents_.
6474 (File_read::make_view): Use whole_file_view_ instead of contents_,
6475 update File_read::View::View call.
6476 (File_read::find_or_make_view): Update File_read::View::View
6477 call.
6478 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6479 remove contents_
6480 (File_read::View::Data_ownership): New enum.
6481 (File_read::View::View): Replace bool mapped_ with Data_ownership
6482 argument.
6483 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6484 (File_read::View::data_ownership_): New field.
6485 (File_read::contents_): Remove (replaced by whole_file_view_).
6486 (File_read::whole_file_view_): New field.
6487 * options.h (class General_options): Add --keep-files-mapped.
6488
24998053
CC
64892009-10-27 Cary Coutant <ccoutant@google.com>
6490
6491 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6492 * testsuite/Makefile.am (plugin_test_5): New test case.
6493 * testsuite/Makefile.in: Regenerate.
6494
72adc4fa
DK
64952009-10-25 Doug Kwan <dougkwan@google.com>
6496
6497 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6498 from private to protected to allow access by child class.
6499 (Sized_relobj::do_relocate_sections): New method declaration.
6500 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6501 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6502 Sized_relobj::relocate_sections. Instantiate template explicitly
6503 for different target sizes and endianity.
6504
07f508a2
DK
65052009-10-24 Doug Kwan <dougkwan@google.com>
6506
6507 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6508 (Arm_input_section::as_arm_input_section): New method.
6509 (Arm_output_section): New class definition.
6510 (Arm_output_section::create_stub_group,
6511 Arm_output_section::group_sections): New method definitions.
6512
10ad9fe5
DK
65132009-10-22 Doug Kwan <dougkwan@google.com>
6514
6515 * arm.cc (Arm_input_section): New class definition.
6516 (Arm_input_section::init, Arm_input_section:do_write,
6517 Arm_input_section::set_final_data_size,
6518 Arm_input_section::do_reset_address_and_file_offset): New method
6519 definitions.
6520
56ee5e00
DK
65212009-10-21 Doug Kwan <dougkwan@google.com>
6522
6523 * arm.cc (Stub_table, Arm_input_section): New forward class
6524 declarations.
6525 (Stub_table): New class defintion.
6526 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6527 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6528 New method definition.
6529
b569affa
DK
65302009-10-21 Doug Kwan <dougkwan@google.com>
6531
6532 * arm.cc: Update copyright comments.
6533 (Target_arm): New forward class template declaration.
6534 (Arm_address): New type.
6535 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6536 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6537 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6538 constants.
6539 (Insn_template): Same.
6540 (DEF_STUBS): New macro.
6541 (Stub_type): New enum type.
6542 (Stub_template): New class definition.
6543 (Stub): Same.
6544 (Reloc_stub): Same.
6545 (Stub_factory): Same.
6546 (Target_arm::Target_arm): Initialize may_use_blx_ and
6547 should_force_pic_veneer_.
6548 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6549 Target_arm::should_force_pic_veneer,
6550 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6551 Target_arm::using_thumb_only, Target_arm:;default_target): New
6552 method defintions.
6553 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6554 New data member declarations.
6555 (Insn_template::size, Insn_template::alignment): New method defintions.
6556 (Stub_template::Stub_template): New method definition.
6557 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6558 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6559 (Stub_factory::Stub_factory): New method definition.
6560 * gold.h (string_hash): New template.
6561 * output.h (Input_section_specifier::hash_value): Use
6562 gold::string_hash.
6563 (Input_section_specifier::string_hash): Remove.
6564 * stringpool.cc (Stringpool_template::string_hash): Use
6565 gold::string_hash.
6566
6c172549
DK
65672009-10-20 Doug Kwan <dougkwan@google.com>
6568
6569 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6570 symbols of relaxed input sections.
6571 * output.h (Output_section::find_relaxed_input_section): Make
6572 method public.
6573
c5617f2f
DK
65742009-10-16 Doug Kwan <dougkwan@google.com>
6575
6576 * dynobj.cc (Versions::Versions): Initialize version_script_.
6577 Only insert base version symbol definition for a shared object
6578 if version script defines any version versions.
6579 (Versions::define_base_version): New method definition.
6580 (Versions::add_def): Check that base version is not needed.
6581 (Versions::add_need): Define base version lazily.
6582 * dynobj.h (Versions::define_base_version): New method declaration.
6583 (Versions::needs_base_version_): New data member declaration.
6584 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6585 (check_DATA): Add no_version_test.stdout.
6586 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6587 New make rules.
6588 * testsuite/Makefile.in: Regenerate.
6589 * testsuite/no_version_test.c: New file.
6590 * testsuite/no_version_test.sh: Ditto.
6591
3c12dcdb
DK
65922009-10-16 Doug Kwan <dougkwan@google.com>
6593
6594 * expression.cc (class Segment_start_expression): New class definition.
6595 (Segment_start_expression::value): New method definition.
6596 (script_exp_function_segment_start): Return a new
6597 Segment_start_expression.
6598 * gold/script-c.h (script_saw_segment_start_expression): New function
6599 prototype.
6600 * script-sections.cc (Script_sections::Script_sections): Initialize
6601 SAW_SEGMENT_START_EXPRESSION_ to false.
6602 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6603 and -Tbbs options to specify section addresses if given in
6604 command line and no SEGMENT_START expression is seen in a script.
6605 * script-sections.h (Script_sections::saw_segment_start_expression,
6606 Script_sections::set_saw_segment_start_expression): New method
6607 definition.
6608 (Script_sections::saw_segment_start_expression_): New data member
6609 declaration.
6610 * script.cc (script_saw_segment_start_expression): New function.
6611 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6612 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6613 script_test_7.sh and script_test_8.sh.
6614 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6615 script_test_8.stdout.
6616 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6617 (script_test_6, script_test_6.stdout, script_test_7,
6618 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6619 * Makefile.in: Regenerate.
6620 * testsuite/script_test_6.sh: New file.
6621 * testsuite/script_test_6.t: Same.
6622 * testsuite/script_test_7.sh: Same.
6623 * testsuite/script_test_7.t: Same.
6624 * testsuite/script_test_8.sh: Same.
6625
64b1ae37
DK
66262009-10-16 Doug Kwan <dougkwan@google.com>
6627
6628 * output.cc (Output_segment::set_section_list_address): Cast
6629 expressions to unsigned long long type to avoid format warnings.
6630
661be1e2
ILT
66312009-10-15 Ian Lance Taylor <iant@google.com>
6632
12edd763 6633 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6634 dot assignment to script_sections_.
12edd763
ILT
6635 * script-sections.cc (Script_sections::add_dot_assignment):
6636 Initialize if necessary.
6637
68b6574b
ILT
6638 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6639 program headers with no load segment if there is a linker script.
6640
661be1e2
ILT
6641 * layout.cc (Layout::set_segment_offsets): Align the file offset
6642 to the segment aligment for -N or -n with no load segment.
6643 * output.cc (Output_segment::add_output_section): Don't crash if
6644 the first section is a TLS section.
6645 (Output_segment::set_section_list_addresses): Print an error
6646 message if the address moves backward in a linker script.
6647 * script-sections.cc
6648 (Output_section_element_input::set_section_addresses): Don't
6649 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6650 (Orphan_output_section::set_section_addresses): Likewise.
6651
f15f61a7
DK
66522009-10-15 Doug Kwan <dougkwan@google.com>
6653
6654 * layout.cc (Layout::finish_dynamic_section): Generate tags
6655 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6656 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6657 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6658
82bb573a
ILT
66592009-10-14 Ian Lance Taylor <iant@google.com>
6660
6661 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6662 fields.
6663 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6664 data_shdr fields of relinfo.
6665 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6666 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6667 R_386_TLS_LDO_32, adjust based on section flags.
6668 (Target_i386::Relocate::fix_up_ldo): Remove.
6669
374ad285
ILT
66702009-10-13 Ian Lance Taylor <iant@google.com>
6671
6672 Add support for -pie.
6673 * options.h (class General_options): Add -pie and
6674 --pic-executable.
6675 (General_options::output_is_position_independent): Test -pie.
6676 (General_options::output_is_executable): Return true if not shared
6677 and not relocatable.
6678 (General_options::output_is_pie): Remove.
6679 * options.cc (General_options::finalize): Reject incompatible uses
6680 of -pie.
6681 * gold.cc (queue_middle_tasks): A -pie link is not static.
6682 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6683 * symtab.cc (Symbol::final_value_is_known): Return false if
6684 output_is_position_independent.
6685 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6686 output_is_position_independent.
6687 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6688 output_is_position_independent.
6689 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6690 output_is_position_independent.
6691 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6692 two_file_pie_test.
6693 (basic_pie_test.o, basic_pie_test): New targets.
6694 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6695 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6696 (two_file_pie_test): New target.
6697 * testsuite/Makefile.in: Rebuild.
6698 * README: Remove note saying that -pie is not supported.
6699
c6585162
ILT
67002009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6701
6702 * options.h (class General_options): Add -init and -fini.
6703 * layout.cc (Layout::finish_dynamic_section): Emit
6704 given init and fini functions.
6705
032ce4e9
ST
67062009-10-13 Sriraman Tallam <tmsriram@google.com>
6707
6708 * gc.h (gc_process_relocs): Check if icf is enabled using new
6709 function.
6710 * gold.cc (queue_initial_tasks): Likewise.
6711 (queue_middle_tasks): Likewise.
6712 * object.cc (do_layout): Likewise.
6713 * symtab.cc (is_section_folded): Likewise.
6714 * main.cc (main): Likewise.
6715 * reloc.cc (Read_relocs::run): Likewise.
6716 (Sized_relobj::do_scan_relocs): Likewise.
6717 * icf.cc (is_function_ctor_or_dtor): New function.
6718 (Icf::find_identical_sections): Check if function is ctor or dtor when
6719 safe icf is chosen.
6720 * options.h (General_options::icf): Change option to be an enum.
6721 (Icf_status): New enum.
6722 (icf_enabled): New method.
6723 (icf_safe_folding): New method.
6724 (set_icf_status): New method.
6725 (icf_status_): New variable.
6726 * (options.cc) (General_options::finalize): Set icf_status_.
6727 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6728 icf_test and icf_keep_unique_test to use the --icf enum flag.
6729 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6730 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6731
f345227a
ST
67322009-10-12 Sriraman Tallam <tmsriram@google.com>
6733
6734 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6735 includes to gc.h and icf.h.
6736 * arm.cc: Include gc.h.
6737 * gold.cc: Likewise.
6738 * i386.cc: Likewise.
6739 * powerpc.cc: Likewise.
6740 * sparc.cc: Likewise.
6741 * x86_64.cc: Likewise.
6742 * gc.h: Include icf.h.
6743
1c7814ed
ILT
67442009-10-11 Ian Lance Taylor <iant@google.com>
6745
6746 * plugin.cc: Include "gold.h" before other header files.
6747
ae3b5189
CD
67482009-10-10 Chris Demetriou <cgd@google.com>
6749
6750 * options.h (Input_file_argument::Input_file_type): New enum.
6751 (Input_file_argument::is_lib_): Replace with...
6752 (Input_file_argument::type_): New member.
6753 (Input_file_argument::Input_file_argument): Take Input_file_type
6754 'type' rather than boolean 'is_lib' as second argument.
6755 (Input_file_argument::is_lib): Use type_.
6756 (Input_file_argument::is_searched_file): New function.
6757 (Input_file_argument::may_need_search): Handle is_searched_file.
6758 * options.cc (General_options::parse_library): Support -l:filename.
6759 (General_options::parse_just_symbols): Update for Input_file_argument
6760 changes.
6761 (Command_line::process): Likewise.
6762 * archive.cc (Archive::get_file_and_offset): Likewise.
6763 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6764 * script.cc (read_script_file, script_add_file): Likewise.
6765 * fileread.cc (Input_file::Input_file): Likewise.
6766 (Input_file::will_search_for): Handle is_searched_file.
6767 (Input_file::open): Likewise.
6768 * readsyms.cc (Read_symbols::get_name): Likewise.
6769 * testsuite/Makefile.am (searched_file_test): New test.
6770 * testsuite/Makefile.in: Regenerate.
6771 * testsuite/searched_file_test.cc: New file.
6772 * testsuite/searched_file_test_lib.cc: New file.
6773
f3048a1d
ILT
67742009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6775 Ian Lance Taylor <iant@google.com>
6776
6777 * descriptor.cc: Include <cstdio> and "binary-io.h".
6778 (Descriptors::open): Open the files in binary mode always.
6779 * script.cc (Lex::get_token): Treat \r as whitespace.
6780
d4780e57
ILT
67812009-10-09 Ian Lance Taylor <iant@google.com>
6782
6783 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6784
d9a893b8
ILT
67852009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6786 Ian Lance Taylor <iant@google.com>
6787
6788 * configure.ac: Check for readv function also.
6789 * fileread.cc (readv): Define if not HAVE_READV.
6790 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6791 does not exist.
6792 * config.in: Regenerate.
6793 * configure: Regenerate.
6794
c0a62865
DK
67952009-10-09 Doug Kwan <dougkwan@google.com>
6796
6797 * layout.cc (Layout::make_output_section): Call target hook to make
6798 ordinary output section.
6799 (Layout::finalize): Adjust parameter list of call the
6800 Target::may_relax().
6801 * layout.h (class Layout::section_list): New method.
6802 * merge.h (Output_merge_base::entsize): Change visibility to public.
6803 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6804 New methods.
6805 (Output_merge_string::do_is_string): New method.
6806 * object.cc (Sized_relobj::do_setup): renamed from
6807 Sized_relobj::set_up.
6808 * object.h (Sized_relobj::adjust_shndx,
6809 Sized_relobj::initializ_input_to_output_maps,
6810 Sized_relobj::free_input_to_output_maps): Change visibilities to
6811 protected.
6812 (Sized_relobj::setup): Virtualize.
6813 (Sized_relobj::do_setup): New method declaration.
6814 (Sized_relobj::invalidate_section_offset,
6815 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6816 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6817 * options.cc (parse_int): New function.
6818 * options.h (parse_int): New declaration.
6819 (DEFINE_int): New macro.
6820 (stub_group_size): New option.
6821 * output.cc (Output_section::Output_section): Initialize memebers
6822 merge_section_map_, merge_section_by_properties_map_,
6823 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6824 (Output_section::add_input_section): Handled deferred code-fill
6825 generation and remove an old comment.
6826 (Output_section::add_relaxed_input_section): New method definition.
6827 (Output_section::add_merge_input_section): Use merge section by
6828 properties map to speed to search. Update merge section maps
6829 as appropriate.
6830 (Output_section::build_relaxation_map): New method definition.
6831 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6832 Same.
6833 (Output_section::relax_input_section): Renamed to
6834 Output_section::convert_input_sections_to_relaxed_sections and change
6835 interface to take a vector of pointers to relaxed sections.
6836 (Output_section::find_merge_section,
6837 Output_section::find_relaxed_input_section): New method definitions.
6838 (Output_section::is_input_address_mapped,
6839 Output_section::output_offset, Output_section::output_address):
6840 Use output section data maps to speed up searching.
6841 (Output_section::find_starting_output_address): Add comments.
6842 (Output_section::do_write,
6843 Output_section::write_to_postprocessing_buffer): Do code-fill
6844 generation as appropriate.
6845 (Output_section::get_input_sections): Invalidate relaxed input section
6846 map.
6847 (Output_section::restore_states): Adjust type of checkpoint .
6848 Invalidate relaxed input section map.
6849 * output.h (Output_merge_base): New class declaration.
6850 (Input_section_specifier): New class defintion.
6851 (class Output_relaxed_input_section) Change base class to
6852 Output_section_data_build.
6853 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6854 base class initializer.
6855 (Output_section::add_relaxed_input_section): New method declaration.
6856 (Output_section::Input_section): Change visibility to protected.
6857 (Output_section::Input_section::relobj,
6858 Output_section::Input_section::shndx): Handle relaxed input sections.
6859 Output_section::input_sections) Change visibility to protected. Also
6860 define overload to return a non-const pointer.
6861 (Output_section::Merge_section_properties): New class defintion.
6862 (Output_section::Merge_section_by_properties_map,
6863 Output_section::Output_section_data_by_input_section_map,
6864 Output_section::Relaxation_map): New types.
6865 (Output_section::relax_input_section): Rename method to
6866 Output_section::convert_input_sections_to_relaxed_sections and change
6867 interface to take a vector of relaxed section pointers.
6868 (Output_section::find_merge_section,
6869 Output_section::find_relaxed_input_section,
6870 Output_section::build_relaxation_map,
6871 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6872 New method declarations.
6873 (Output_section::merge_section_map_
6874 Output_section::merge_section_by_properties_map_,
6875 Output_section::relaxed_input_section_map_,
6876 Output_section::is_relaxed_input_section_map_valid_,
6877 Output_section::generate_code_fills_at_write_): New data members.
6878 * script-sections.cc
6879 (Output_section_element_input::set_section_addresses): Call
6880 current_data_size and addralign methods of relaxed input sections.
6881 (Orphan_output_section::set_section_addresses): Call current_data_size
6882 and addralign methods of relaxed input sections.
6883 * symtab.cc (Symbol_table::compute_final_value): Extract template
6884 from the body of Symbol_table::sized_finalize_symbol.
6885 (Symbol_table::sized_finalized_symbol): Call
6886 Symbol_table::compute_final_value.
6887 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6888 (Symbol_table::compute_final_value): New templated method declaration.
6889 * target.cc (Target::do_make_output_section): New method defintion.
6890 * target.h (Target::make_output_section): New method declaration.
6891 (Target::relax): Add more parameters for input objects, symbol table
6892 and layout. Adjust call to do_relax.
6893 (Target::do_make_output_section): New method declaration.
6894 (Target::do_relax): Add parameters for input objects, symbol table
6895 and layout.
6896
d446d6c4
ILT
68972009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6898
6899 * pread.c: Include stdio.h.
6900
bc06c745
ILT
69012009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6902
6903 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6904 defined.
6905
75aea3d0
ILT
69062009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6907
6908 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6909 Change read_shndx type to unsigned int.
6910 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6911 int.
6912 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6913 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6914 Change read_shndx type to unsigned int.
6915 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6916 int.
6917 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6918 * layout.cc (Layout::create_symtab_sections): Cast the result of
6919 local_symcount * symsize to off_t in the gold_assert.
6920
be8fcb75
ILT
69212009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6922
6923 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6924 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6925 R_ARM_BASE_ABS.
6926 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6927 (Arm_relocate_functions::thm_abs5): New function.
6928 (Arm_relocate_functions::abs12): New function.
6929 (Arm_relocate_functions::abs16): New function.
6930 (Arm_relocate_functions::base_abs): New function.
6931 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6932 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6933 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6934 R_ARM_BASE_ABS.
6935 (Scan::global): Likewise.
6936 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6937 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6938 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6939 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6940 R_ARM_BASE_ABS.
6941
c2a122b6
ILT
69422009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6943
6944 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6945 (Arm_relocate_functions::movt_prel): New function.
6946 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6947 (Arm_relocate_functions::thm_movt_prel): New function.
6948 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6949 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6950 (Scan::global, Relocate::relocate): Likewise.
6951 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6952
c4aa1e2d
ILT
69532009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6954
6955 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6956 Incremental_checker.
6957 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6958 unsigned int.
6959 (class Incremental_inputs_header): New class.
6960 (Incremental_inputs_header_writer): Edit comment.
6961 (Incremental_inputs_entry): New class.
6962 (Incremental_inputs_entry_writer): Edit comment.
6963 (Sized_incremental_binary::do_find_incremental_inputs_section):
6964 Add *strtab_shndx parameter, fill it.
6965 (Sized_incremental_binary::do_check_inputs): New method.
6966 (Incremental_checker::can_incrementally_link_output_file): Use
6967 Sized_incremental_binary::check_inputs.
6968 (Incremental_inputs::report_command_line): Save command line in
6969 command_line_.
6970 * incremental.h:
6971 (Incremental_binary::find_incremental_inputs_section): New
6972 method.
6973 (Incremental_binary::do_find_incremental_inputs_section): Add
6974 strtab_shndx parameter.
6975 (Incremental_binary::do_check_inputs): New pure virtual method.
6976 (Sized_incremental_binary::do_check_inputs): Declare.
6977 (Incremental_checker::Incremental_checker): Add incremental_inputs
6978 parameter, use it to initialize incremental_inputs_.
6979 (Incremental_checker::incremental_inputs_): New field.
6980 (Incremental_checker::command_line): New method.
6981 (Incremental_checker::inputs): New method.
6982 (Incremental_checker::command_line_): New field.
6983
c549a694
ILT
69842009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6985
6986 * incremental.cc: Include <cstdarg> and "target-select.h".
6987 (vexplain_no_incremental): New function.
6988 (explain_no_incremental): New function.
6989 (Incremental_binary::error): New method.
6990 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6991 method.
6992 (make_sized_incremental_binary): New function.
6993 (open_incremental_binary): New function.
6994 (can_incrementally_link_file): Add checks if output is ELF and has
6995 inputs section.
6996 * incremental.h: Include "elfcpp_file.h" and "output.h".
6997 (Incremental_binary): New class.
6998 (Sized_incremental_binary): New class.
6999 (open_incremental_binary): Declare.
7000 * object.cc (is_elf_object): Use
7001 elfcpp::Elf_recognizer::is_elf_file.
7002 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
7003 * output.h (Output_file::filesize): New method.
7004
fd3c5f0b
ILT
70052009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7006
7007 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
7008 New function.
7009 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
7010 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
7011 function.
7012 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
7013 function.
7014 (Arm_relocate_functions::movw_abs_nc): New function.
7015 (Arm_relocate_functions::movt_abs): New function.
7016 (Arm_relocate_functions::thm_movw_abs_nc): New function.
7017 (Arm_relocate_functions::thm_movt_abs): New function.
7018 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
7019 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
7020 (Scan::global): Likewise.
7021 (Relocate::relocate): Likewise.
7022 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7023
7f5309a5
ILT
70242009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7025
7026 * arm.cc (Arm_relocate_functions::got_prel) New function.
7027 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
7028 (Relocate::relocate): Likewise.
7029 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
7030
364c7fa5
ILT
70312009-10-06 Ian Lance Taylor <iant@google.com>
7032
7033 * options.h (class General_options): Define
7034 split_stack_adjust_size parameter.
7035 * object.h (class Object): Add uses_split_stack_ and
7036 has_no_split_stack_ fields. Add uses_split_stack and
7037 has_no_split_stack accessor functions. Declare
7038 handle_split_stack_section.
7039 (class Reloc_symbol_changes): Define.
7040 (class Sized_relobj): Define Function_offsets. Declare
7041 split_stack_adjust, split_stack_adjust_reltype, and
7042 find_functions.
7043 * object.cc (Object::handle_split_stack_section): New function.
7044 (Sized_relobj::do_layout): Call handle_split_stack_section.
7045 * dynobj.cc (Sized_dynobj::do_layout): Call
7046 handle_split_stack_section.
7047 * reloc.cc (Sized_relobj::relocate_sections): Call
7048 split_stack_adjust for executable sections in split_stack
7049 objects. Pass reloc_map to relocate_section.
7050 (Sized_relobj::split_stack_adjust): New function.
7051 (Sized_relobj::split_stack_adjust_reltype): New function.
7052 (Sized_relobj::find_functions): New function.
7053 * target-reloc.h: Include "object.h".
7054 (relocate_section): Add reloc_symbol_changes parameter. Change
7055 all callers.
7056 * target.h (class Target): Add calls_non_split method. Declare
7057 do_calls_non_split virtual method. Declare match_view and
7058 set_view_to_nop.
7059 * target.cc: Include "elfcpp.h".
7060 (Target::do_calls_non_split): New function.
7061 (Target::match_view): New function.
7062 (Target::set_view_to_nop): New function.
7063 * gold.cc (queue_middle_tasks): Give an error if mixing
7064 split-stack and non-split-stack objects with -r.
7065 * i386.cc (Target_i386::relocate_section): Add
7066 reloc_symbol_changes parameter.
7067 (Target_i386::do_calls_non_split): New function.
7068 * x86_64.cc (Target_x86_64::relocate_section): Add
7069 reloc_symbol_changes parameter.
7070 (Target_x86_64::do_calls_non_split): New function.
7071 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7072 parameter.
7073 * powerpc.cc (Target_powerpc::relocate_section): Add
7074 reloc_symbol_changes parameter.
7075 * sparc.cc (Target_sparc::relocate_section): Add
7076 reloc_symbol_changes parameter.
7077 * configure.ac: Call AM_CONDITIONAL for the default target.
7078 * configure: Rebuild.
7079 * testsuite/Makefile.am (TEST_AS): New variable.
7080 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7081 (check_DATA): Add split_i386 and split_x86_64 files.
7082 (SPLIT_DEFSYMS): Define.
7083 (split_i386_[1234n].o): New targets.
7084 (split_i386_[124]): New targets.
7085 (split_i386_[1234r].stdout): New targets.
7086 (split_x86_64_[1234n].o): New targets.
7087 (split_x86_64_[124]): New targets.
7088 (split_x86_64_[1234r].stdout): New targets.
7089 (MOSTLYCLEANFILES): Add new executables.
7090 * testsuite/split_i386.sh: New file.
7091 * testsuite/split_x86_64.sh: New file.
7092 * testsuite/split_i386_1.s: New file.
7093 * testsuite/split_i386_2.s: New file.
7094 * testsuite/split_i386_3.s: New file.
7095 * testsuite/split_i386_4.s: New file.
7096 * testsuite/split_i386_n.s: New file.
7097 * testsuite/split_x86_64_1.s: New file.
7098 * testsuite/split_x86_64_2.s: New file.
7099 * testsuite/split_x86_64_3.s: New file.
7100 * testsuite/split_x86_64_4.s: New file.
7101 * testsuite/split_x86_64_n.s: New file.
7102 * testsuite/testfile.cc (Target_test): Update relocation_section
7103 function.
7104 * testsuite/Makefile.in: Rebuild.
7105
e8a9fcda
ILT
71062009-10-06 Ian Lance Taylor <iant@google.com>
7107
7108 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7109 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7110 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7111 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7112 the address on ldo_addrs_.
7113 (Target_i386::Relocate::fix_up_ldo): New function.
7114
e99daf92
ILT
71152009-10-06 Rafael Espindola <espindola@google.com>
7116
7117 * plugin.cc (add_input_library): New.
7118 (Plugin::load): Add add_input_library to tv.
7119 (Plugin_manager::add_input_file): Add the is_lib argument.
7120 (add_input_file): Update call to Plugin_manager::add_input_file.
7121 (add_input_library): New.
7122 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7123
966d4097
DK
71242009-09-30 Doug Kwan <dougkwan@google.com>
7125
7126 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7127 symbol and call Symbol::may_need_copy_reloc to determine if
7128 a copy reloc is needed.
7129 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7130 nocopyreloc is given in command line.
7131 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7132 given in command line.
7133 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7134 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7135 of the removed Target_i386::may_need_copy_reloc.
7136 * options.h (copyreloc): New option with default value false.
7137 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7138 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7139 instead of the removed Target_powerpc::may_need_copy_reloc.
7140 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7141 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7142 instead of the removed Target_sparc::may_need_copy_reloc.
7143 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7144 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7145 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7146 instead of the removed Target_x86_64::may_need_copy_reloc.
7147
029ba973
ILT
71482009-09-30 Ian Lance Taylor <iant@google.com>
7149
7150 * object.h (class Object): Remove target_ field, and target,
7151 sized_target, and set_target methods.
7152 (Object::sized_target): Remove.
7153 (class Sized_relobj): Update declarations. Remove sized_target.
7154 * object.cc (Sized_relobj::setup): Remove target parameter.
7155 Change all callers.
7156 (Input_objects::add_object): Don't do anything with the target.
7157 (make_elf_sized_object): Add punconfigured parameter. Change all
7158 callers. Set or test parameter target.
7159 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7160 Change all callers.
7161 * parameters.cc (Parameters::set_target): Change parameter type to
7162 be non-const.
7163 (Parameters::default_target): Remove.
7164 (set_parameters_target): Change parameter type to be non-const.
7165 (parameters_force_valid_target): New function.
7166 (parameters_clear_target): New function.
7167 * parameters.h (class Parameters): Update declarations. Remove
7168 default_target method. Add sized_target and clear_target
7169 methods. Change target_ to be non-const.
7170 (set_parameters_target): Update declaration.
7171 (parameters_force_valid_target): Declare.
7172 (parameters_clear_target): Declare.
7173 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7174 as NULL if we aren't searching.
7175 (Add_symbols::run): Don't check for compatible target.
7176 * fileread.cc (Input_file::open_binary): Call
7177 parameters_force_valid_target.
7178 * gold.cc (queue_middle_tasks): Likewise.
7179 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7180 set_target on object.
7181 * dynobj.h (class Sized_dynobj): Update declarations.
7182 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7183 make_elf_object returns NULL.
7184 (Archive::include_member): Don't check whether object target is
7185 compatible.
7186 * output.cc (Output_section::add_input_section): Get target from
7187 parameters.
7188 (Output_section::relax_input_section): Likewise.
7189 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7190 parameters.
7191 (Sized_relobj::do_scan_relocs): Likewise.
7192 (Sized_relobj::relocate_sections): Likewise.
7193 * resolve.cc (Symbol_table::resolve): Likewise.
7194 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7195 parameter. Change all callers.
7196 (Symbol_table::add_from_object): Get target from parameters.
7197 (Symbol_table::add_from_relobj): Don't check object target.
7198 (Symbol_table::add_from_dynobj): Likewise.
7199 (Symbol_table::define_special_symbol): Get target from
7200 parameters.
7201 * symtab.h (class Symbol_table): Update declaration.
7202 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7203 parameter. Change all callers. Clear parameter target.
7204 (Binary_test): Test target here.
7205 * testsuite/object_unittest.cc (gold_testsuite): Remove
7206 target_test_pointer parameter. Change all callers.
7207 (Object_test): Test target here.
7208
a6a22b83
ILT
72092009-09-26 Ian Lance Taylor <iant@google.com>
7210
7211 * testsuite/initpri1.c: Don't try to use constructor priorities if
7212 compiling with gcc before 4.3.
7213
6a8f49fe
ILT
72142009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7215
7216 * testsuite/retain_symbols_file_test.sh (check_present): Change
7217 output file name to retain_symbols_file_test.stdout.
7218 (check_absent): Likewise.
7219
8c604651
CS
72202009-09-18 Craig Silverstein <csilvers@google.com>
7221
7222 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
7223 * options.cc: Include <cerrno> and <fstream>.
7224 (General_options::finalize): Parse -retain-symbols-file tag.
7225 * options.h: New flag.
7226 (General_options): New method should_retain_symbol, new
7227 variable symbols_to_retain.
7228 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
7229 should_retain_symbol map.
7230 * testsuite/Makefile.am (retain_symbols_file_test): New test.
7231 * testsuite/Makefile.in: Regenerate.
7232 * testsuite/retain_symbols_file_test.sh: New file.
7233
ca58b19f
NC
72342009-09-18 Nick Clifton <nickc@redhat.com>
7235
7236 * po/es.po: Updated Spanish translation.
7237
20e6d0d6
DK
72382009-09-17 Doug Kwan <dougkwan@google.com>
7239
7240 * debug.h (DEBUG_RELAXATION): New constant.
7241 (DEBUG_ALL): Add DEBUG_RELAXATION.
7242 (debug_string_to_enum): Add relaxation debug option.
7243 * layout.cc
7244 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
7245 Layout::Relaxation_debug_check::read_sections,
7246 Layout::Relaxation_debug_check::read_sections): New method definitions.
7247 (Layout::Layout): Initialize data members
7248 record_output_section_data_from_scrips_,
7249 script_output_section_data_list_ and relaxation_debug_check_.
7250 (Layout::save_segments, Layout::restore_segments,
7251 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7252 Layout::relaxation_loop_body): New method definitions.
7253 (Layout::finalize): Support relaxation. Move section layout code to
7254 Layout::relaxation_loop_body.
7255 (Layout::set_asection_address_from_script): Move code for orphan
7256 section placement out.
7257 (Layout::place_orphan_sections_in_script): New method definition.
7258 * layout.h (Output_segment_headers, Output_file_header):
7259 New forward class declarations.
7260 (Layout::~Layout): Define.
7261 (Layout::new_output_section_data_from_script): New method definition.
7262 (Layout::place_orphan_sections_in_script): New method declaration.
7263 (Layout::Segment_states): New type declaration.
7264 (Layout::save_segments, Layout::restore_segments,
7265 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7266 Layout::relaxation_loop_body): New method declarations.
7267 (Layout::Output_section_data_list): New type declaration.
7268 (Layout::Relaxation_debug_check): New class definition.
7269 (Layout::record_output_section_data_from_script_,
7270 Layout::script_output_section_data_list_, Layout::segment_states_,
7271 Layout::relaxation_debug_check_): New data members.
7272 * output.cc: (Output_section_headers::do_size): New method definition.
7273 (Output_section_headers::Output_section_headers): Move size
7274 computation to Output_section_headers::do_size.
7275 (Output_segment_headers::do_size): New method definition.
e1df38aa 7276 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
7277 Output_file_header::do_size and call it.
7278 (Output_file_header::do_size): New method definition.
7279 (Output_data_group::Output_data_group): Adjust call to
7280 Output_section_data.
7281 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
7282 (Output_symtab_xindex::do_write): Add array bound check.
7283 (Output_section::Input_section::print_to_mapfile): Handle
7284 RELAXED_INPUT_SECTION_CODE.
7285 (Output_section::Output_section): Initialize data member checkpoint_.
7286 (Output_section::~Output_section): Delete checkpoint object pointed
7287 by checkpoint_.
7288 (Output_section::add_input_section): Always add an Input_section if
7289 relaxing.
7290 (Output_section::add_merge_input_section): Add assert.
7291 (Output_section::relax_input_section): New method definition.
7292 (Output_section::set_final_data_size): Set load address to zero for
7293 an unallocated section.
7294 (Output_section::do_address_and_file_offset_have_reset_values):
7295 New method definition.
7296 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
7297 Handle relaxed input section.
7298 (Output_section::sort_attached_input_sections): Checkpoint input
7299 section list lazily.
7300 (Output_section::get_input_sections): Change type of input_sections to
7301 list of Simple_input_section pointers. Checkpoint input section list
7302 lazily. Also handle relaxed input sections.
7303 (Output_section::add_input_section_for_script): Take a reference to
7304 a Simple_input_section object instead of Relobj pointer and section
7305 index as parameter. Handle relaxed input sections.
7306 (Output_section::save_states, Output_section::restore_states): New
7307 method definitions.
7308 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
7309 (Output_data::is_data_size_fixed): New method definition.
7310 (Output_data::reset_addresss_and_file_offset): Do not reset data size
7311 if it is fixed.
7312 (Output_data::address_and_file_offset_have_reset_values): New method
7313 definition.
7314 (Output_data::do_address_and_file_offset_have_reset_values): New method
7315 definition.
7316 (Output_data::set_data_size): Check that data size is not fixed.
7317 (Output_data::fix_data_size): New method definition.
7318 (Output_data::is_data_size_fixed_): New data member.
7319 (Output_section_headers::set_final_data_size): New method definition.
7320 (Output_section_headers::do_size): New method declaration.
7321 (Output_segment_headers::set_final_data_size): New method definition.
7322 (Output_segment_headers::do_size): New method declaration.
7323 (Output_file_header::set_final_data_size)::New method definition.
7324 (Output_file_header::do_size)::New method declaration.
7325 (Output_section_data::Output_section_data): Add new parameter
7326 is_data_size_fixed and use it to fix data size.
7327 (Output_data_const::Output_data_const): Adjust call to base class
7328 constructor and fix data size.
7329 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
7330 base class constructor and fix data size.
7331 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
7332 base class constructor and fix data size.
7333 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
7334 class constructor and fix data size.
7335 (Output_data_group::set_final_data_size): New method definition.
7336 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
7337 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
7338 class constructor and fix data size.
7339 (Output_relaxed_input_section): New class definition.
7340 (Output_section::Simple_input_section): New class definition.
7341 (Output_section::get_input_sections): Adjust parameter list.
7342 (Output_section::add_input_section_for_script): Same.
7343 (Output_section::save_states, Output_section::restore_states,
7344 Output_section::do_address_and_file_offset_have_reset_values,
7345 (Output_section::Input_section::Input_section): Handle
7346 RELAXED_INPUT_SECTION_CODE. Add new overload for
7347 Output_relaxed_input_section.
7348 (Output_section::Input_section::is_input_section,
7349 Output_section::Input_section::set_output_section): Handle relaxed
7350 input section.
7351 (Output_section::Input_section::is_relaxed_input_section,
7352 Output_section::Input_section::output_section_data,
7353 Output_section::Input_section::relaxed_input_section): New method
7354 definitions.
7355 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
7356 value.
7357 (Output_section::Input_section::u1_): Update comments.
7358 (Output_section::Input_section::u2_): Add new union member poris.
7359 (Output_section::Checkpoint_output_section): New classs definition.
7360 (Output_section::relax_input_section): New method declaration.
7361 (Output_section::checkpoint_): New data member.
7362 (Output_segment): Update comments.
7363 (Output_segment::Output_segment): Un-privatize copy constructor.
7364 (Output_segment::operator=): Un-privatize.
7365 * script-sections.cc (Output_section_element::Input_section_list):
7366 Change element type to Output_section::Simple_input_section.
7367 (Output_section_element_dot_assignment::set_section_addresses):
7368 Register output section data for relaxation clean up.
7369 (Output_data_exression::Output_data_expression): Adjust call to base
7370 constructor to fix data size.
7371 (Output_section_element_data::set_section_addresses): Register
7372 Output_data_expression object for relaxation clean up.
7373 (struct Input_section_info): Replace Relobj pointer and section index
7374 pair with Output_section::Simple_input_section and Convert struct to a
7375 class.
7376 (Input_section_sorter::operator()): Adjust access to
e1df38aa 7377 Input_section_info data member to use accessors.
20e6d0d6
DK
7378 (Output_section_element_input::set_section_addresses): Use layout
7379 parameter. Adjust code to use Output_section::Simple_input_section
7380 and Input_secction_info classes. Register filler for relaxation
7381 clean up.
7382 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
7383 and section index pair with Output_section::Simple_input_section
7384 class. Adjust code accordingly.
7385 (Phdrs_element::release_segment): New method definition.
7386 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
7387 segment list.
7388 (Script_sections::release_segments): New method definition.
7389 * gold/script-sections.h (Script_sections::release_segments): New
7390 method declaration.
7391 * gold/target.h (Target::may_relax, Target::relax,
7392 Target::do_may_relax, Target::do_relax): New method definitions.
7393
5e445df6
ILT
73942009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7395
7396 * arm.cc (has_signed_unsigned_overflow): New function.
7397 (Arm_relocate_functions::abs8): New function.
7398 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7399 (Target_arm::Scan::global): Likewise.
7400 (Target_arm::relocate::relocate): Likewise.
7401 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7402 Likewise.
7403
8c604651 74042009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7405
7406 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7407 * testsuite/Makefile.in: Regenerate.
7408
1e9cc1c2
NC
74092009-09-11 Nick Clifton <nickc@redhat.com>
7410
7411 * po/gold.pot: Updated by the Translation project.
7412
6a89f575
CC
74132009-09-08 Cary Coutant <ccoutant@google.com>
7414
7415 * output.cc (Output_file::open): Add execute permission to empty file.
7416 * testsuite/Makefile.am (permission_test): New test.
7417 * testsuite/Makefile.in: Regenerate.
7418
fdcac5af
ILT
74192009-09-02 Ian Lance Taylor <iant@google.com>
7420
7421 * output.cc (Output_file::resize): Call map_no_anonymous rather
7422 than map.
7423
44453f85
ILT
74242009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7425
7426 * gold.cc: Include "incremental.h".
7427 (queue_initial_tasks): Call Incremental_checker methods.
7428 * incremental.cc: Include "output.h".
7429 (Incremental_checker::can_incrementally_link_output_file): New
7430 method.
7431 * incremental.h (Incremental_checker): New class.
7432
7433 * output.cc (Output_file::open_for_modification): New method.
7434 (Output_file::map_anonymous): Changed return type to bool. Record
7435 map in base_ field.
7436 (Output_file::map_no_anonymous): New method, broken out of map.
7437 (Output_file::map): Use map_no_anonymous and map_anonymous.
7438 * output.h (class Output_file): Update declarations.
7439
293c1386
CC
74402009-08-24 Cary Coutant <ccoutant@google.com>
7441
7442 * options.h (Command_line::Pre_options): New class.
7443 (Command_line::pre_options): New member.
7444 * options.cc (gold::options::ready_to_register): New variable.
7445 (One_option::register_option): Do nothing if not registering options.
7446 Assert if same short option registered twice.
7447 (General_options::General_options): Turn off option registration when
7448 done constructing.
7449 (Command_line::Pre_options::Pre_options): New constructor.
7450
f773f3d2
CC
74512009-08-24 Cary Coutant <ccoutant@google.com>
7452
06a73cfe
CC
7453 * options.h (General_options::no_keep_memory): Remove incorrect
7454 short option.
f773f3d2 7455
a15af8e2
RW
74562009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7457
7458 * Makefile.am (am__skiplex, am__skipyacc): New.
7459 * Makefile.in: Regenerate.
7460
c462b41b
RW
74612009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7462
14ec8efd
RW
7463 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7464 (INCLUDES): ... this.
7465 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7466 (AM_CPPFLAGS): Renamed from ...
7467 (INCLUDE): ... this.
7468 * Makefile.in, testsuite/Makefile.in: Regenerate.
7469
81ecdfbb
RW
7470 * Makefile.in: Regenerate.
7471 * aclocal.m4: Likewise.
7472 * config.in: Likewise.
7473 * configure: Likewise.
7474 * testsuite/Makefile.in: Likewise.
7475
c462b41b
RW
7476 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7477 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7478 * Makefile.in: Regenerate.
7479 * testsuite/Makefile.in: Regenerate.
7480
2da73f13
CC
74812009-08-19 Cary Coutant <ccoutant@google.com>
7482
7483 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7484 symbols in shared libraries overridden by hidden or internal symbols
7485 in the main program.
7486
2db70501
CD
74872009-08-19 Chris Demetriou <cgd@google.com>
7488
7489 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7490 checking source file names in error messages.
7491
f733487b
DK
74922009-08-18 Doug Kwan <dougkwan@google.com>
7493
7494 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7495 an elcpp::Ehdr as parameter. Adjust call to set_target.
7496 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7497 an elfcpp::Ehdr as parameter.
7498 * object.cc (Object::set_target): Remove the version that looks up
7499 a target and sets it.
7500 (Sized_relobj::setup): Take a Target object instead of
7501 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7502 (make_elf_sized_object): Find target and ask target to
7503 make an ELF object.
7504 * object.h: (Object::set_target): Remove the version that looks up
7505 a target and sets it.
7506 (Sized_relobj::setup): Take a Target object instead of
7507 an elfcpp:Ehdr as parameter.
7508 * target.cc: Include dynobj.h.
7509 (Target::do_make_elf_object_implementation): New.
7510 (Target::do_make_elf_object): New.
7511 * target.h (Target::make_elf_object): New template declaration.
7512 (Target::do_make_elf_object): New method declarations.
7513 (Target::do_make_elf_object_implementation): New template declaration.
7514
cc70f101
ILT
75152009-08-14 Ian Lance Taylor <iant@google.com>
7516
7517 * gold.h (FUNCTION_NAME): Define.
7518 (gold_unreachable): Use FUNCTION_NAME.
7519
ef5e0cb1
ST
75202009-08-12 Sriraman Tallam <tmsriram@google.com>
7521
7522 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7523 symbol in the --keep-unique list is not found.
7524
48c187ce
ST
75252009-08-12 Sriraman Tallam <tmsriram@google.com>
7526
7527 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7528 been maked as --keep-unique.
7529 (Icf::unfold_section): New function.
7530 * icf.h (Icf::unfold_section): New function.
7531 * options.h (General_options::keep_unique): New option.
7532 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7533 * testsuite/Makefile.in: Regenerate.
7534 * testsuite/icf_keep_unique_test.sh: New file.
7535 * testsuite/icf_keep_unique_test.cc: New file.
7536
645afe0c
CC
75372009-08-12 Cary Coutant <ccoutant@google.com>
7538
7539 PR 10471
7540 * resolve.cc (Symbol_table::resolve): Check for references from
7541 dynamic objects to hidden and internal symbols.
7542 * testsuite/Makefile.am (hidden_test.sh): New test.
7543 * testsuite/Makefile.in: Regenerate.
7544 * testsuite/hidden_test.sh: New script.
7545 * testsuite/hidden_test_1.c: New test source.
7546 * testsuite/hidden_test_main.c: New test source.
7547
11af873f
DK
75482009-08-11 Doug Kwan <dougkwan@google.com>
7549
7550 * arm.cc: Update comments.
7551 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7552 segment to locate the .ARM.exidx section if present.
7553
b9f7d72d
DK
75542009-08-09 Doug Kwan <dougkwan@google.com>
7555
7556 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7557 patch.
7558
ddd3c53c
ST
75592009-08-07 Sriraman Tallam <tmsriram@google.com>
7560 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7561 compiler warnings.
7562
27721062
ST
75632009-08-06 Sriraman Tallam <tmsriram@google.com>
7564
7565 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7566 valid tls_segment only for non-debug-section relocations.
7567 * testsuite/Makefile.am: Add gc_tls_test.
7568 * testsuite/Makefile.in: Regenerate.
7569 * testsuite/gc_tls_test.cc: New file.
7570 * testsuite/gc_tls_test.sh: New file.
7571
ef15dade 75722009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7573
ef15dade
ST
7574 * icf.cc: New file.
7575 * icf.h: New file.
7576 * Makefile.am (CCFILES): Add icf.cc.
7577 (HFILES): Add icf.h
7578 * Makefile.in: Regenerate.
7579 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7580 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7581 section, symbol and addend information for the relocs.
7582 * gold.cc (queue_middle_tasks): Call identical code folding.
7583 * gold.h: Add defines for multimap.
7584 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7585 to the call of finalize_local_symbols.
7586 * main.cc (main): Create object of class Icf.
7587 * object.cc (Sized_relobj::do_layout): Allow this function to be
7588 called twice during icf.
7589 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7590 to sections marked as identical by icf.
7591 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7592 when available.
7593 (Sized_relobj::do_section_entsize): New function.
7594 * object.h (Object::section_entsize): New function.
7595 (Object::do_section_entsize): New pure virtual function.
7596 (Relobj::finalize_local_symbols): Add new parameter.
7597 (Relobj::do_section_entsize): New function.
7598 * options.h (General_options::icf): New option.
7599 (General_options::icf_iterations): New option.
7600 (General_options::print_icf_sections): New option.
7601 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7602 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7603 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7604 icf.
7605 * symtab.cc (Symbol_table::is_section_folded): New function.
7606 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7607 to sections marked as identical by icf.
7608 * symtab.h (Symbol_table::set_icf): New function.
7609 (Symbol_table::icf): New function.
7610 (Symbol_table::is_section_folded): New function.
7611 (Symbol_table::icf_): New data member.
7612 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7613 * testsuite/Makefile.am: Add commands to build icf_test.
7614 * testsuite/Makefile.in: Regenerate.
7615 * testsuite/icf_test.sh: New file.
7616 * testsuite/icf_test.cc: New file.
7617
c3b65ac4
CD
76182009-07-24 Chris Demetriou <cgd@google.com>
7619
7620 * layout.cc (is_compressible_debug_section): Fix incorrect
7621 comment about compressed section names.
7622
1caf2c51
ILT
76232009-07-20 Ian Lance Taylor <ian@airs.com>
7624
7625 PR 10419
7626 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7627
1ef4d87f
ILT
76282009-07-16 Ian Lance Taylor <iant@google.com>
7629
7630 PR 10400
7631 * layout.h: #include <map>.
7632 (class Kept_section): Change from struct to class. Add accessors
7633 and setters. Add section size to Comdat_group mapping. Change
7634 Comdat_group to std::map. Add is_comdat_ field. Add
7635 linkonce_size field in union.
7636 (class Layout): Update declaration of find_or_add_kept_section.
7637 Don't declare find_kept_object.
7638 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7639 parameter. Add object, shndx, is_comdat, and is_group_name
7640 parameters. Change all callers. Adjust for new Kept_section.
7641 (Layout::find_kept_object): Remove.
7642 * object.cc (Sized_relobj::include_section_group): Update use of
7643 Kept_section. Rename secnum to shndx. Only record
7644 Kept_comdat_section if sections are the same size.
7645 (Sized_relobj::include_linkonce_section): Update use of
7646 Kept_section. Only record Kept_comdat_section if sections are the
7647 same size. Set size of linkonce section.
7648 (Sized_relobj::map_to_kept_section): Update call to
7649 get_kept_comdat_section.
7650 * object.h (class Sized_relobj): Rename fields in
7651 Kept_comdat_section to drop trailing underscores; change object
7652 field to Relobj*. Change Kept_comdat_section_table to store
7653 struct rather than pointer.
7654 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7655 Add kept_object and kept_shndx parameters. Change all callers.
7656 (Sized_relobj::get_kept_comdat_section): Change return type to
7657 bool. Add kept_object and kept_shndx parameters. Change all
7658 callers.
7659 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7660 Layout::find_or_add_kept_section.
7661
37c3b7b0
ILT
76622009-07-09 Ian Lance Taylor <iant@google.com>
7663
7664 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7665 Reserve space in the hash table.
7666
98fa85cb
ILT
76672009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7668
7669 * fileread.cc (File_read::get_mtime): New method.
7670 * fileread.h (Timespec): New structure.
7671 (File_read::get_mtime): New method.
7672 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7673 Renamed from timestamp_nsec.
7674 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7675 Elf_Xword.
e1df38aa 7676 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7677 timestamp_nsec.
e1df38aa 7678 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7679 (Incremental_inputs::report_obejct): Save mtime; style fix.
7680 (Incremental_inputs::report_script): Save mtime; style fix.
7681 (Incremental_inputs::finalize_inputs): Style fix.
7682 (Incremental_inputs::finalize): Style fix.
7683 (Incremental_inputs::create_input_section_data): Store inputs
7684 mtime.
7685 * incremental.h (Incremental_inputs::report_script): Add mtime
7686 argument.
7687 (Incremental_inputs::Input_info::Input_info): Intialize only one
7688 union member.
7689 (Incremental_inputs::Input_info::archive): Move to nameless
7690 union.
7691 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7692 (Incremental_inputs::Input_info::script): Move to nameless union.
7693 (Incremental_inputs::mtime): New field.
7694 * script.cc (read_input_script): Pass file mtime to
7695 Incremental_input.
7696 * script.h (Script_info::inputs): Style fix.
7697
c9d70757
ILT
76982009-07-01 Ian Lance Taylor <ian@airs.com>
7699
7700 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7701 instead of 32.
7702
9c547ec3
ILT
77032009-06-24 Ian Lance Taylor <iant@google.com>
7704
7705 PR 10156
7706 * layout.cc (Layout::choose_output_section): If we find an
7707 existing section, update the flags.
7708 (Layout::create_notes): New function, broken out of
7709 Layout::finalize.
7710 (Layout::finalize): Don't create note sections.
7711 (Layout::create_note): Don't crash if linker script discards
7712 section.
7713 (Layout::create_gold_note): Likewise.
7714 (Layout::create_build_id): Likewise. Don't set
7715 after_input_sections on the section.
7716 (Layout::create_executable_stack_info): Remove target parameter.
7717 Change caller.
7718 * layout.h (class Layout): Declare create_notes. Update
7719 declaration of create_executable_stack_info.
7720 * gold.cc (queue_middle_tasks): Call create_notes.
7721 * output.cc (Output_section::update_flags_for_input_section): Move
7722 here from output.h. If SHF_ALLOC flag is newly set, mark address
7723 invalid.
7724 * output.h (Output_data::mark_address_invalid): New function.
7725 (class Output_section): Only declare, not define,
7726 update_flags_for_input_section. Remove set_flags.
7727
55458500
ILT
77282009-06-24 Ian Lance Taylor <iant@google.com>
7729
7730 * script-sections.cc (Output_section_definition::
7731 set_section_addresses): Rename shadowing local load_address to
7732 laddr.
7733
1307d6cd
ILT
77342009-06-24 Ian Lance Taylor <iant@google.com>
7735
7736 PR 10244
7737 * reloc.cc (relocate_sections): Skip empty relocation sections.
7738
ec3f783e
ILT
77392009-06-23 Ian Lance Taylor <iant@google.com>
7740
7741 PR 10156
7742 * layout.cc (Layout::create_note): Use choose_output_section
7743 rather than make_output_section.
7744
459c9f1c
ILT
77452009-06-23 Ian Lance Taylor <iant@google.com>
7746
7747 PR 10237
7748 * options.cc (General_options::parse_V): Set printed_version_.
7749 (General_options::General_options): Initialize printed_version_.
7750 * options.h (class General_options): Add printed_version_ field.
7751 * gold.cc (queue_initial_tasks): If there are no input files,
7752 don't give a fatal error if we printed the version information.
7753 (queue_middle_tasks): If using -r with a shared object, give a
7754 fatal error rather than an ordinary error.
7755
1518dc8f
ILT
77562009-06-23 Ian Lance Taylor <iant@google.com>
7757
7758 PR 10219
7759 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7760 (Layout::make_output_section): Set have_stabstr_section_ if we see
7761 a .stab*str section.
7762 (Layout::finalize): Call link_stabs_sections.
7763 (Layout::link_stabs_sections): New file.
7764 * layout.h (class Layout): Add have_stabstr_section_ field.
7765 Declare link_stabs_sections.
7766
3d857b98
DK
77672009-06-23 Doug Kwan <dougkwan@google.com>
7768
7769 * Makefile.am (libgold_a_LIBADD): New.
7770 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7771 * Makefile.in: Regenerate.
7772 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7773 * configure: Regenerate.
7774 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7775 * fileread.cc: Include sys/state.h
7776 * gold.h: Declare memmem and strndup if found missing.
7777 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7778
0639a6f6
ILT
77792009-06-23 Ian Lance Taylor <iant@google.com>
7780
7781 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7782 * configure: Rebuild.
7783
8d63875c
ILT
77842009-06-23 Ian Lance Taylor <iant@google.com>
7785
7786 PR 10147
7787 * object.cc (Object::section_contents): Don't try to get a view if
7788 the section has length zero.
7789 (Object::handle_gnu_warning_section): If the section is empty, use
7790 the name of the section as the warning.
7791
f7c8a183
ILT
77922009-06-23 Ian Lance Taylor <iant@google.com>
7793
7794 PR 10133
7795 * stringpool.h (class Stringpool_template): Add optimize_ field.
7796 (Stringpool_template::set_optimize): New function.
7797 * stringpool.cc (Stringpool_template::Stringpool_template):
7798 Initialize optimize_ field.
7799 (Stringpool_template::set_string_offsets): Test local optimize
7800 fild rather than parameter.
7801 * layout.cc (Layout::Layout): Call set_optimize on the section
7802 name stringpool.
7803
e6a307ba
ILT
78042009-06-22 Ian Lance Taylor <iant@google.com>
7805
7806 PR 10030
7807 * yyscript.y: Parse TARGET.
7808 * script.cc (script_set_target): New function.
7809 * script-c.h (script_set_target): Declare.
7810 * options.cc (General_options::string_to_object_format): Rename
7811 from string_to_object_format in anonymous namespace. Change
7812 callers.
7813 * options.h (class General_options): Declare
7814 string_to_object_format.
7815
3ee173de
ILT
78162009-06-22 Ian Lance Taylor <iant@google.com>
7817
7818 * script-sections.cc (Script_sections::create_segments): Don't put
7819 program headers in a PT_LOAD segment if -n or -N.
7820
78212009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7822
7823 PR 10141
7824 * options.h (class General_options): Add -z lazy and -z now. Sort
7825 -z options into alphabetical order.
7826 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7827
cd6739a1 78282009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7829
7830 * layout.cc (Layout::make_output_section): Call
7831 Target::new_output_section.
7832 (Layout::attach_allocated_section_to_segment): Put large section
7833 sections in a separate load segment with the large segment flag
7834 set.
7835 (Layout::segment_precedes): Sort large data segments after other
7836 load segments.
7837 (align_file_offset): New static function.
7838 (Layout::set_segment_offsets): Use align_file_offset.
7839 * output.h (class Output_section): Add is_small_section_ and
7840 is_large_section_ fields.
7841 (Output_section::is_small_section): New function.
7842 (Output_section::set_is_small_section): New function.
7843 (Output_section::is_large_section): New function.
7844 (Output_section::set_is_large_section): New function.
7845 (Output_section::is_large_data_section): New function.
7846 (class Output_segment): Add is_large_data_segment_ field.
7847 (Output_segment::is_large_data_segment): New function.
7848 (Output_segment::set_is_large_data_segment): New function.
7849 * output.cc (Output_section::Output_section): Initialize new
7850 fields.
7851 (Output_segment::Output_segment): Likewise.
7852 (Output_segment::add_output_section): Add assertion that large
7853 data sections always go in large data segments. Force small data
7854 sections to the end of the list of data sections. Force small BSS
7855 sections to the start of the list of BSS sections. For large BSS
7856 sections to the end of the list of BSS sections.
7857 * symtab.h (class Symbol): Declare is_common_shndx.
7858 (Symbol::is_defined): Check Symbol::is_common_shndx.
7859 (Symbol::is_common): Likewise.
7860 (class Symbol_table): Define enum Commons_section_type. Update
7861 declarations. Add small_commons_ and large_commons_ fields.
7862 * symtab.cc (Symbol::is_common_shndx): New function.
7863 (Symbol_table::Symbol_table): Initialize new fields.
7864 (Symbol_table::add_from_object): Put small and large common
7865 symbols in the right list.
7866 (Symbol_table::sized_finalized_symbol): Check
7867 Symbol::is_common_shndx.
7868 (Symbol_table::sized_write_globals): Likewise.
7869 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7870 common symbol lists. Don't call do_allocate_commons_list if the
7871 list is empty.
7872 (Symbol_table::do_allocate_commons_list): Remove is_tls
7873 parameter. Add comons_section_type parameter. Change all
7874 callers. Handle small and large common symbols.
7875 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7876 Symbol::is_common_shndx.
7877 * resolve.cc (symbol_to_bits): Likewise.
7878 * target.h (Target::small_common_shndx): New function.
7879 (Target::small_common_section_flags): New function.
7880 (Target::large_common_shndx): New function.
7881 (Target::large_common_section_flags): New function.
7882 (Target::new_output_section): New function.
7883 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7884 small_common_section_flags, and large_common_section_flags
7885 fields.
7886 (Target::do_new_output_section): New virtual function.
7887 * arm.cc (Target_arm::arm_info): Initialize new fields.
7888 * i386.cc (Target_i386::i386_info): Likewise.
7889 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7890 Likewise.
7891 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7892 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7893 (Target_x86_64::do_new_output_section): New function.
7894 * configure.ac: Define conditional MCMODEL_MEDIUM.
7895 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7896 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7897 (large_LDFLAGS): Define.
7898 * testsuite/large.c: New file.
7899 * testsuite/testfile.cc (Target_test::test_target_info):
7900 Initialize new fields.
7901 * configure, testsuite/Makefile.in: Rebuild.
7902
bb04269c
DK
79032009-06-05 Doug Kwan <dougkwan@google.com>
7904
7905 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7906 * Makefile.in: Regenerate.
bb04269c
DK
7907 * i386.cc (class Target_i386): Define new virtual method to
7908 override do_is_local_label_name in parent.
7909 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7910 local symbols if --discard-locals or -X is given.
7911 * options.h (class General_options): Declare new options
7912 '--discard-locals' and '-X' for discarding locals.
7913 * target.h (class Target): Define new methods is_local_label_name.
7914 Declare new virtual method do_is_local_label_name.
7915 * target.cc: New file.
7916 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7917 (check_SCRIPTS): Add discard_locals_test.sh.
7918 (check_DATA): Add discard_local_tests.syms.
7919 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7920 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7921 * testsuite/Makefile.in: Regenerate.
7922 * testsuite/discard_locals_test.c: New file.
7923 * testsuite/discard_locals_test.sh: Same.
7924
805bb01c
DK
79252009-06-05 Doug Kwan <dougkwan@google.com>
7926
7927 * object.cc (Sized_relobj::Sized_relobj): Initialize
7928 discarded_eh_frame_shndx_ to -1U.
7929 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7930 section.
7931 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7932 a discarded .eh_frame section.
7933 (Sized_relobj::do_finalize_local_symbols): Ditto.
7934 * object.h (class Sized_relobj): Declare new member
7935 discarded_eh_frame_shndx_.
7936 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7937 (local_labels_test.o, local_labels_test): New rules.
7938 * testsuite/Makefile.in: Regenerate.
7939
1dcd334d
DK
79402009-06-04 Doug Kwan <dougkwan@google.com>
7941
7942 * layout.cc (Layout::section_name_mapping): Add mapping for
7943 special ARM sections.
7944
96d49306
DK
79452009-06-03 Doug Kwan <dougkwan@google.com>
7946
7947 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7948 (utils::has_overflow): Same.
7949
dff16297
ILT
79502009-06-03 Ian Lance Taylor <iant@google.com>
7951
7952 * layout.cc (Layout::section_name_mapping): New array, replacing
7953 Layout::linkonce_mapping.
7954 (Layout::section_name_mapping_count): New variable, replacing
7955 Layout::linkonce_mapping_count.
7956 (Layout::linkonce_output_name): Remove.
7957 (Layout::output_section_name): Rewrite.
7958 * layout.h (class Layout): Rename Linkonce_mapping to
7959 Section_name_mapping, linkonce_mapping to section_name_mapping,
7960 linkonce_mapping_count to section_name_mapping_count. Don't
7961 declare linkonce_output_name.
7962
c121c671
DK
79632009-06-03 Doug Kwan <dougkwan@google.com>
7964
7965 * gold/arm.cc (namespace utils): New.
7966 (Target_arm::reloc_is_non_pic): Define new method.
7967 (class Arm_relocate_functions): New.
7968 (Target_arm::Relocate::relocate): Handle relocation types used by
7969 Android.
7970
07800fab
ILT
79712009-06-03 Ian Lance Taylor <iant@google.com>
7972
7973 * arm.cc (Target_arm::scan::global): Use || instead of |.
7974
c121c671
DK
79752009-06-02 Doug Kwan <dougkwan@google.com>
7976
7977 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7978 issued_non_pic_error_.
7979 (class Target_arm::Scan): Declare new method check_non_pic.
7980 Define new method symbol_needs_plt_entry.
7981 Declare new data member issued_non_pic_error_.
7982 (class Target_arm::Relocate): Declare new method
7983 should_apply_static_reloc.
7984 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7985 (Target_arm::Scan::check_non_pic): Define new method.
7986 (Target_arm::Scan::local): Handle a small subset of reloc types used
7987 by Android.
7988 (Target_arm::Scan::local): Same.
7989 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7990
b19b0c6d
ILT
79912009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7992
7993 * incremental.cc (Incremental_inputs::report_command_line): Filter
7994 out --incremental-* options.
7995
94cdfcff
DK
79962009-05-29 Doug Kwan <dougkwan@google.com>
7997
7998 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7999 template class.
8000 (class Target_arm): Update comment.
8001 (Target_arm::Target_arm): Initialize new data members GOT_,
8002 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
8003 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
8004 and Target_arm::rel_dyn_section.
8005 Declare new_enum Target_arm::Got_type.
8006 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
8007 and DYNBSS_.
8008 Update commments for member do_dynsym_value.
8009 (Target_arm::got_size, Target_arm::plt_section,
8010 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
8011 new methods inside class defintion.
8012 (Target_arm::got_section): Define new method.
8013 (Target_arm::rel_dyn_section): Same.
8014 (Output_data_plt_arm): New template class.
8015 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
8016 (Output_data_plt_arm:do_adjust_output_section): Define new method.
8017 (Output_data_plt_arm::add_entry): Same.
8018 (Output_data_plt_arm::first_plt_entry): Define new
8019 static data member for PLT instruction template.
8020 (Output_data_plt_arm::plt_entry): Same.
8021 (Output_data_plt_arm::do_write): Define new method.
8022 (Target_arm::make_plt_entry): Same.
8023 (Target_arm::do_finalize_sections): Same.
8024 (Target_arm::do_dynsym_value): Same.
8025
4a657b0d
DK
80262009-05-28 Doug Kwan <dougkwan@google.com>
8027
8028 * Makefile.am (TARGETSOURCES): Add arm.cc.
8029 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
8030 * Makefile.in: Regenerate.
8031 * arm.cc: New file.
8032 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
8033
e7ae8c36
DK
80342009-05-26 Doug Kwan <dougkwan@google.com>
8035
8036 * options.cc (General_options::parse_exclude_libs). Fix a comment.
8037 (General_options::check_excluded_libs): Strip off directories in
8038 archive name before matching like GNU ld does.
8039 * testsuite/Makefile.am (MOSTLYCLEANFILES,
8040 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
8041 (exclude_libs_test_LDFLAGS): Add linker option
8042 -Wl,--exclude-libs,libexclude_libs_test_3
8043 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
8044 an explicit archive without using -l.
8045 (alt/libexclude_libs_test_3.a): New make rule.
8046 * testsuite/Makefile.in: Regenerate.
8047 * testsuite/exclude_libs_test.c : Declare lib3_default().
8048 (main): Call it.
8049 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
8050 * exclude_libs_test_3.c: New file.
8051
f12e7348
NC
80522009-05-26 Nick Clifton <nickc@redhat.com>
8053
8054 * po/id.po: New Indonesian translation.
8055 * po/gold.pot: Updated template file.
8056
4daadc0d
ST
80572009-05-22 Sriraman Tallam <tmsriram@google.com>
8058
e1df38aa 8059 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
8060 gc_comdat_test files. Add -Wl,--gc-sections to build
8061 gc_comdat_test.
8062 * testsuite/Makefile.in: Regenerate.
8063 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8064
531813ad
ST
80652009-05-21 Sriraman Tallam <tmsriram@google.com>
8066
8067 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8068 kept comdat section was garbage collected.
8069 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8070 * testsuite/Makefile.in: Regenerate.
8071 * testsuite/gc_comdat_test.sh: New file.
8072 * testsuite/gc_comdat_test_1.cc: New file.
8073 * testsuite/gc_comdat_test_2.cc: New file.
8074
65514900
CC
80752009-05-19 Doug Kwan <dougkwan@google.com>
8076
8077 * archive.cc (Archive::Archive): Move constructor from archive.h
8078 to here. Initialize no_export_.
8079 (Archive::get_elf_object_for_member): Set no_export flag of object.
8080 * archive.h (Archive::Archive): Move constructor body to
8081 archive.cc.
8082 (Archive::no_export): New method.
8083 (Archive::no_export_): New field.
8084 * object.h (Object::Object): Initialize no_export_ to false.
8085 (Object::no_export, Object::set_no_export): New methods.
8086 (Object::no_export_): New field.
8087 * options.cc (General_options::parse_exclude_libs): New method.
8088 (General_options::check_excluded_libs) Same.
8089 * options.h (exclude_libs): New option.
8090 (General_options::check_excluded_libs): New method declaration.
8091 (General_options::excluded_libs_): New field.
8092 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8093 default or protected visibility if an object has no-export flag set.
8094 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8095 (check_SCRIPTS): Add exclude_libs_test.sh.
8096 (check_DATA): Add exclude_libs_test.syms.
8097 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8098 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8099 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8100 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8101 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8102 libexclude_libs_test_2.a): New rules.
8103 * testsuite/Makefile.in: Regenerate.
8104 * testsuite/exclude_libs_test.c: New file.
8105 * testsuite/exclude_libs_test.sh: Ditto.
8106 * testsuite/exclude_libs_test_1.c: Ditto.
8107 * testsuite/exclude_libs_test_2.c: Ditto.
8108
1b77ea50
ILT
81092009-05-15 Ian Lance Taylor <iant@google.com>
8110
8111 * configure.ac: Check for declarations for cases where libiberty.h
8112 checks HAVE_DECL_xxx.
8113 * configure, config.in: Rebuild.
8114
072fe7ce
ILT
81152009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8116
8117 * gold.h (Incremental_argument_list): Remove (invalid) forward
8118 declaration.
8119 * incremental.cc (Incremental_inputs::report_achive): New method.
8120 (Incremental_inputs::report_object): New method.
8121 (Incremental_inputs::report_script): New method.
8122 (Incremental_inputs::finalize_inputs): New method.
8123 (Incremental_inputs::finalize): Call finalize_inputs().
8124 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8125 Create inputs entries.
8126 * incremental.h (Incremental_input_type): New enum.
8127 (Incremental_inputs::Incremental_input): Initialize new fields.
8128 (Incremental_inputs::report_inputs): New method.
8129 (Incremental_inputs::report_achive): New method.
8130 (Incremental_inputs::report_object): New method.
8131 (Incremental_inputs::report_script): New method.
8132 (Incremental_inputs::finalize_inputs): New method.
8133 (Incremental_inputs::Input_info): New struct.
8134 (Incremental_inputs::Input_info_map): New typedef.
8135 (Incremental_inputs::lock_): New field.
8136 (Incremental_inputs::Inputs_): New field.
8137 (Incremental_inputs::Inputs_map): New field.
8138 * main.cc (main): Call Incremental_input::report_inputs.
8139 * options.h (Input_argument_list): Typedef moved from
8140 Input_arguments.
8141 (Input_file_group::Files): Remove, use ::Input_argument_list.
8142 (Input_file_group::Input_argument_list): Remove, use
8143 ::Input_argument_list.
8144 * plugin.cc (Plugin_manager::add_input_file): Add error in
8145 incremental build.
8146 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8147 functions.
8148 * script.cc (read_input_script): Call
8149 Incremental_input::report_script.
8150 * script.h (Script_info): New class.
8151
b0481b0b
ILT
81522009-04-27 Ian Lance Taylor <iant@google.com>
8153
8154 * x86_64.cc (do_adjust_output_section): Set entsize to
8155 plt_entry_size.
8156
b22a5a41 81572009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
8158
8159 * output.cc (Output_file::close): After short writes, continue
8160 writing from the correct offset in the buffer being written.
8161
40fde488
CD
81622009-04-23 Chris Demetriou <cgd@google.com>
8163
8164 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8165 * configure: Regenerate.
8166 * config.in: Regenerate.
8167 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8168 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8169
3ce2c28e
ILT
81702009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8171
8172 * incremental.cc (Incremental_inputs_header_data): Renamed from
8173 Incremental_input_header_data.
8174 (Incremental_inputs_header_data::data_size): New field.
8175 (Incremental_inputs_header_data::put_input_file_count): Renamed
8176 from input_file_count.
8177 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8178 from command_line_offset.
8179 (Incremental_inputs_header_data::put_reserved): Renamed from
8180 put_reserved.
8181 (Incremental_inputs_entry_data): Renamed from
8182 Incremental_input_entry_data.
8183 (Incremental_inputs_entry_data::data_size): New field.
8184 (Incremental_inputs::report_command_line): New method.
8185 (Incremental_inputs::finalize): New method.
8186 (Incremental_inputs::create_incremental_inputs_data): New method.
8187 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8188 * incremental.h: New file.
8189 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8190 (Layout::finalize): Create incremental inputs section in
8191 incremental builds.
8192 (Layout::create_incremental_info_sections): New method.
8193 * layout.h (Layout::incremental_inputs): New method.
8194 (Layout::create_incremental_info_sections): New method.
8195 (Layout::incremental_inputs_): New field.
8196 * main.cc (main): Notify Incremental_input of the command line.
8197
e55bde5e
ILT
81982009-04-01 Ian Lance Taylor <iant@google.com>
8199 Mikolaj Zalewski <mikolajz@google.com>
8200
8201 * gold.h (reserve_unordered_map): Define, three versions, one for
8202 each version of Unordered_map.
8203 * layout.cc (Layout::Layout): Remove options parameter. Add
8204 number_of_input_files parameter. Don't initialize options_.
8205 Initialize number_of_input_files_ and resized_signatures_. Move
8206 sections_are_attached_.
8207 (Layout::layout_group): Reserve space for group_signatures_.
8208 (Layout::find_or_add_kept_section): Change name parameter to be a
8209 reference. Resize signatures_ map when it gets large enough.
8210 (Layout::layout_eh_frame): Use parameters->options() instead of
8211 this->options_.
8212 (Layout::make_output_section): Likewise.
8213 (Layout::attach_allocated_section_to_segment): Likewise.
8214 (Layout::finalize, Layout::create_executable_stack): Likewise.
8215 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8216 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8217 * layout.h (class Layout): Update declarations. Remove options_
8218 field. Add number_of_input_files_ and resized_signatures_
8219 fields. Move sections_are_attached_ field.
8220 * main.cc (main): Pass number of input files to Layout
8221 constructor. Don't pass options.
8222
154b857c
ILT
82232009-03-30 Ian Lance Taylor <iant@google.com>
8224
8225 * ffsll.c (ffsll): Correct implementation.
8226
2f35ab9b
ILT
82272009-03-27 Ian Lance Taylor <iant@google.com>
8228
fd03461a
ILT
8229 * ffsll.c: New file.
8230 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
8231 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
8232 * ftruncate.c (ftruncate): Declare before definition.
8233 * mremap.c (mremap): Likewise.
8234 * pread.c (pread): Likewise.
8235 * configure, Makefile.in, config.in: Rebuild.
8236
2f35ab9b
ILT
8237 * mremap.c: New file.
8238 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
8239 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
8240 (mremap): Declare if HAVE_MREMAP is not defined.
8241 * configure, Makefile.in, config.in: Rebuild.
8242
33aea2fd
CC
82432009-03-27 Cary Coutant <ccoutant@google.com>
8244
8245 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
8246 position independent.
8247 * sparc.cc (Target_sparc::check_non_pic): Likewise.
8248 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
8249
6d479619
CC
82502009-03-24 Cary Coutant <ccoutant@google.com>
8251
8252 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
8253 an executable.
8254 (needs_dynamic_reloc): Likewise.
8255
afc06bb8
ILT
82562009-03-24 Ian Lance Taylor <iant@google.com>
8257
8258 * yyscript.y (file_cmd): Recognize EXTERN.
8259 (extern_name_list, extern_name_list_body): New nonterminals.
8260 * script.cc (script_add_extern): Define.
8261 * script-c.h (script_add_extern): Declare.
8262
f6060a4d
ILT
82632009-03-24 Rafael Avila de Espindola <espindola@google.com>
8264
8265 * object.cc (is_elf_object): Define.
8266 * object.h (is_elf_object): Declare.
8267 * archive.cc (Archive::get_elf_object_for_member): Call
8268 is_elf_object.
33aea2fd 8269 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 8270
26736d8e
ILT
82712009-03-24 Elliott Hughes <enh@google.com>
8272
8273 * output.cc (Output_file::map_anonymous): Define.
8274 (Output_file::map): Use map_anonymous. If the regular mmap fails,
8275 try an anonymous one. Report the size if the mmap fails.
8276 * output.h (class Output_file): Declare map_anonymous.
8277
22fd9730
ILT
82782009-03-24 Ian Lance Taylor <iant@google.com>
8279
8280 * target-select.cc (instantiate_target): Don't acquire the lock if
8281 the instantiated_target_ field has already been set.
8282
cb010894
ILT
82832009-03-23 Ian Lance Taylor <iant@google.com>
8284
7f055c20
ILT
8285 * gold-threads.h (class Initialize_lock): Define.
8286 * gold-threads.cc (class Initialize_lock_once): Define.
8287 (initialize_lock_control): New static variable.
8288 (initialize_lock_pointer): New static variable.
8289 (initialize_lock_once): New static function.
8290 (Initialize_lock::Initialize_lock): Define.
8291 (Initialize_lock::initialize): Define.
8292 * target-select.h: Include "gold-threads.h".
8293 (class Target_selector): Add lock_ and initialize_lock_ fields.
8294 Don't define instantiate_target, just declare it.
8295 * target-select.cc (Target_selector::Target_selector): Initialize
8296 new fields.
8297 (Target_selector::instantiate_target): Define.
8298 * descriptors.h: Include "gold-threads.h".
8299 (class Descriptors): Add initialize_lock_ field.
8300 * descriptors.cc (Descriptors::Descriptors): Initialize new
8301 field.
8302 (Descriptors::open): Use initialize_lock_ field
8303 * errors.h (class Errors): Add initialize_lock_ field.
8304 * errors.cc (Errors::Errors): Initialize new field.
8305 (Errors::initialize_lock): Use initialize_lock_ field.
8306 * powerpc.cc (class Target_selector_powerpc): Remove
8307 instantiated_target_ field. In do_recognize call
8308 instantiate_target rather than do_instantiate_target. In
8309 do_instantiate_target just allocate a new target.
8310 * sparc.cc (class Target_selector_sparc): Likewise.
8311
36959681
ILT
8312 * freebsd.h: New file.
8313 * i386.cc: Include "freebsd.h".
8314 (Target_i386): Derive from Target_freebsd rather than
8315 Sized_target.
8316 (Target_selector_i386): Derive from Target_selector_freebsd rather
8317 than Target_selector.
8318 * x86_64.cc: Include "freebsd.h".
8319 (Target_x86_64): Derive from Target_freebsd rather than
8320 Sized_target.
8321 (Target_selector_x86_64): Derive from Target_selector_freebsd
8322 rather than Target_selector.
8323 * target.h (class Target): Add adjust_elf_header and
8324 do_adjust_elf_header.
8325 * output.cc (Output_file_header:: do_sized_write): Call target
8326 adjust_elf_header routine.
8327 * configure.tgt: Set targ_osabi.
8328 * configure.ac: Define GOLD_DEFAULT_OSABI.
8329 * parameters.cc (Parameters::default_target): Pass
8330 GOLD_DEFAULT_OSABI to select_target.
8331 * target-select.h (class Target_selector): Make instantiate_target
8332 protected rather than private.
8333 * Makefile.am (HFILES): Add freebsd.h.
8334 * configure, Makefile.in, config.in: Rebuild.
8335
cb010894
ILT
8336 * merge.cc (do_add_input_section): Correct pend value. Change
8337 message about last entry not being null terminated from error to
8338 warning.
8339
0e879927
ILT
83402009-03-20 Mikolaj Zalewski <mikolajz@google.com>
8341
8342 * incremental.cc: New file.
8343 * Makefile.am (CCFILES): Add incremental.cc.
8344 * Makefile.in: Rebuild.
8345
41105937
PP
83462009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
8347
8348 * layout.cc (Layout::output_section_name): Preserve names
8349 of '.note.' sections.
e1df38aa 8350
60439920
ILT
83512009-03-19 Ian Lance Taylor <iant@google.com>
8352
8353 * descriptors.cc (Descriptors::open): Check that the options are
8354 valid before using them.
8355
0d371ad3
ILT
83562009-03-18 Ian Lance Taylor <iant@google.com>
8357
8358 * script-sections.h: Include <list>.
8359 (class Script_sections): Change Sections_elements from std::vector
8360 to std::list. Typedef public Elements_iterator. Add
8361 orphan_section_placement_, data_segment_align_start_, and
8362 saw_data_segment_align_ fields. Remove data_segment_align_index_
8363 field.
8364 * script-sections.cc (class Orphan_section_placement): New class.
8365 (class Sections_element): Add virtual functions is_relro and
8366 orphan_section_init. Remove virtual function place_orphan_here.
8367 (class Output_section_definition): Add is_relro and
8368 orphan_section_init. Remove place_orphan_here.
8369 (class Orphan_output_section): Likewise.
8370 (Script_sections::Script_sections): Update for field changes.
8371 (Script_sections::data_segment_align): Set saw_data_segment_align_
8372 and data_segment_align_start_, not data_segment_align_index.
8373 (Script_sections::data_segment_relro_end): Check
8374 saw_data_segment_align_. Use data_segment_align_start_ rather
8375 than data_segment_align_index_.
8376 (Script_sections::place_orphan): Rewrite to use
8377 Orphan_section_placement.
8378
9201d894
ILT
83792009-03-17 Ian Lance Taylor <iant@google.com>
8380
9c5b8369
ILT
8381 * archive.cc (Archive::add_symbols): Check for a version attached
8382 to the symbol name in the archive map.
8383 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
8384 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
8385 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
8386 (ver_test_11.a): New target.
8387 * testsuite/Makefile.in: Rebuild.
8388
9201d894
ILT
8389 * configure.ac: Check for chsize and posix_fallocate. Replace
8390 ftruncate.
8391 * ftruncate.c: New file, from gnulib.
8392 * output.cc (posix_fallocate): Define dummy version if not
8393 HAVE_POSIX_FALLOCATE.
8394 (Output_file::map): Call posix_fallocate rather than lseek and
8395 write.
8396 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8397 * configure, Makefile.in, config.in: Rebuild.
8398
ef4ab7a8 83992009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8400
ef4ab7a8
PP
8401 * layout.h (Layout::create_note): Add section_name parameter.
8402 * layout.cc (Layout::create_note): Likewise.
8403 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8404
8c500701
ILT
84052009-03-17 Ian Lance Taylor <iant@google.com>
8406
e85b18e1
ILT
8407 * descriptors.cc: Include "options.h".
8408 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8409 (Descriptors::open): Always use O_CLOEXEC when opening a new
8410 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8411 then set FD_CLOEXEC.
8412
9efe6174
ILT
8413 * sparc.cc (class Target_sparc): Add has_got_section.
8414 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8415 make sure we have a GOT section.
8416
8417 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8418 (Target_sparc::Scan::local): Likewise.
8419 (Target_sparc::Scan::global): Likewise.
8420 (Target_sparc::Relocate::relocate): Likewise.
8421 (Target_sparc::Relocate::relocate_tls): Likewise.
8422
8c500701
ILT
8423 * symtab.cc (Symbol_table::define_default_version): New function,
8424 broken out of add_from_object.
8425 (Symbol_table::add_from_object): Call define_default_version.
8426 (Symbol_table::define_special_symbol): Add resolve_oldsym
8427 parameter. Change all callers. If the version for a symbol comes
8428 from a version script, resolve it with the symbol with the same
8429 name with no version. Also add the symbol without a version if
8430 appropriate.
8431 (do_define_in_output_data): If resolving with oldsym, don't delete
8432 sym.
8433 (do_define_in_output_segment): Likewise.
8434 (do_define_as_constant): Likewise.
8435 * symtab.h (class Symbol_table): Update declarations.
8436
f1ed28fb
ILT
84372009-03-13 Ian Lance Taylor <iant@google.com>
8438
15f8229b
ILT
8439 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8440 (Read_symbols::requeue): New function.
8441 (Read_symbols::do_read_symbols): If make_elf_object fails because
8442 the target type is not configured, and the file was searched for,
8443 issue a warning and retry with the next directory.
8444 (Add_symbols::run): If the file has an incompatible format, and
8445 it was searched for, requeue the Read_symbols task. On error,
8446 release the object.
8447 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8448 dirindex parameter to constructor. Change all callers. Declare
8449 incompatible_warning and requeue.
8450 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8451 input_argument_ and input_group_ fields. Add them to
8452 constructor. Change all callers.
8453 (class Read_script): Add dirindex_ field. Add it to constructor.
8454 Change all callers.
8455 * archive.cc (Archive::setup): Remove input_objects parameter.
8456 Change all callers.
8457 (Archive::get_file_and_offset): Likewise.
8458 (Archive::read_all_symbols): Likewise.
8459 (Archive::read_symbols): Likewise.
8460 (Archive::get_elf_object_for_member): Remove input_objects
8461 parameter. Add punconfigured parameter. Change all callers.
8462 (Archive::add_symbols): Change return type to bool. Check return
8463 value of include_member.
8464 (Archive::include_all_members): Likewise.
8465 (Archive::include_member): Change return type to bool. Return
8466 false if first included object has incompatible target. Set
8467 included_member_ field.
8468 (Add_archive_symbols::run): If add_symbols returns false, requeue
8469 Read_symbols task.
8470 * archive.h (class Archive): Add included_member_ field.
8471 Initialize it in constructor. Add input_file and searched_for
8472 methods. Update declarations.
8473 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8474 input_argument_ fields. Add them to constructor. Change all
8475 callers.
8476 * script.cc: Include "target-select.h".
8477 (class Parser_closure): Add skip_on_incompatible_target_ and
8478 found_incompatible_target_ fields. Add
8479 skip_on_incompatible_target parameter to constructor. Change all
8480 callers. Add methods skip_on_incompatible_target,
8481 clear_skip_on_incompatible_target, found_incompatible_target, and
8482 set_found_incompatible_target.
8483 (read_input_script): Add dirindex parameter. Change all callers.
8484 If parser finds an incompatible target, requeue Read_symbols
8485 task.
8486 (script_set_symbol): Clear skip_on_incompatible_target in
8487 closure.
8488 (script_add_assertion, script_parse_option): Likewise.
8489 (script_start_sections, script_add_phdr): Likewise.
8490 (script_check_output_format): New function.
8491 * script.h (read_input_script): Update declaration.
8492 * script-c.h (script_check_output_format): Declare.
8493 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8494 (ignore_cmd): Remove OUTPUT_FORMAT.
8495 * fileread.cc (Input_file::Input_file): Add explicit this.
8496 (Input_file::will_search_for): New function.
8497 (Input_file::open): Add pindex parameter. Change all callers.
8498 * fileread.h (class Input_file): Add input_file_argument method.
8499 Declare will_search_for. Update declarations.
8500 * object.cc (make_elf_object): Add punconfigured parameter.
8501 Change all callers.
8502 * object.h (class Object): Make input_file public. Add
8503 searched_for method.
8504 (make_elf_object): Update declaration.
8505 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8506 restart search.
8507 * dirsearch.h (class Dirsearch): Update declaration.
8508 * options.h (class General_options): Add --warn-search-mismatch.
8509 * parameters.cc (Parameters::is_compatible_target): New function.
8510 * parameters.h (class Parameters): Declare is_compatible_target.
8511 * workqueue.cc (Workqueue::add_blocker): New function.
8512 * workqueue.h (class Workqueue): Declare add_blocker.
8513
f1ed28fb
ILT
8514 * fileread.cc (Input_file::open): Remove options parameter.
8515 Change all callers.
8516 (Input_file::open_binary): Likewise.
8517 * script.cc (read_input_script): Likewise.
8518 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8519 options parameter from constructor. Change all callers.
8520 (class Read_script): Likewise.
8521 * fileread.h (class Input_file): Update declarations.
8522 * script.h (read_input_script): Update declaration.
8523
34dd024a
NC
85242009-03-10 Nick Clifton <nickc@redhat.com>
8525
8526 * po/es.po: New Spanish translation.
8527
6d71b17c
CC
85282009-03-06 Cary Coutant <ccoutant@google.com>
8529
8530 * options.cc (parse_short_option): Keep dash_z from registering itself.
8531
031cdbed
ILT
85322009-03-03 Ian Lance Taylor <iant@google.com>
8533
8534 PR 9918
8535 * target-reloc.h (relocate_section): Pass output_section to
8536 relocate.
8537 * i386.cc (Target_i386::should_apply_static_reloc): Add
8538 output_section parameter. Change all callers.
8539 (Target_i386::Relocate::relocate): Add output_section parameter.
8540 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8541 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8542 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8543 * testsuite/two_file_shared.sh: New script.
8544 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8545 (check_DATA): Add two_file_shared.dbg.
8546 (two_file_shared.dbg): New target.
8547 * testsuite/Makefile.in: Rebuild.
8548
15d5fa16
ILT
85492009-03-01 Ian Lance Taylor <iant@google.com>
8550
8551 * configure.ac: Check for byteswap.h.
8552 * configure: Rebuild.
8553 * config.in: Rebuild.
8554
8a4c0b0d
ILT
85552009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8556
8557 * layout.cc (Layout::find_or_add_kept_section): New function.
8558 (Layout::add_comdat): Removed.
8559 * layout.h (struct Kept_section): Move out of class Layout.
8560 Remove trailing underscores from field names. Add group_sections
8561 field. Rename group_ field to is_group. Change all uses.
8562 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8563 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8564 comdat_groups_ field.
8565 (Sized_relobj::include_section_group): Use
8566 find_or_add_kept_section and Kept_section::group_sections.
8567 (Sized_relobj::include_linkonce_section): Likewise.
8568 * object.cc (class Sized_relobj): Don't define Comdat_group or
8569 Comdat_group_table. Remove find_comdat_group and
8570 add_comdat_group. Remove comdat_groups_ field.
8571 * plugin.cc (include_comdat_group): Use
8572 Layout::find_or_add_kept_section.
8573
b4ecf66b
ILT
85742009-02-28 Ian Lance Taylor <iant@google.com>
8575
14359ca0
ILT
8576 * README: --gc-sections and map files are now supported. Document
8577 some build requirements.
8578
b4ecf66b
ILT
8579 PR 6992
8580 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8581 relocatable link set the value of the section symbol to zero.
8582 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8583 relocatable link don't include the section address in the local
8584 symbol value.
8585
0602e05a
ILT
85862009-02-27 Ian Lance Taylor <iant@google.com>
8587
fd9d194f
ILT
8588 PR 6811
8589 * options.h (class Search_directory): Add is_system_directory.
8590 (class General_options): Declare is_in_system_directory.
8591 * options.cc (get_relative_sysroot): Make static.
8592 (get_default_sysroot): Make static.
8593 (General_optoins::is_in_system_directory): New function.
8594 * fileread.cc (Input_file::is_in_system_directory): New function.
8595 * fileread.h (class Input_file): Declare is_in_system_directory.
8596 * object.h (class Object): Add is_in_system_directory.
8597 (class Input_objects): Remove system_library_directory_ field.
8598 * object.cc (Input_objects::add_object): Don't set
8599 system_library_directory_.
8600 (input_objects::found_in_system_library_directory): Remove.
8601 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8602 parameter. Change all callers.
8603 (Symbol_table::sized_write_globals): Likewise.
8604 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8605 Call Object::is_in_system_directory.
8606 * symtab.h (class Symbol_table): Update declarations.
8607
61edd21f
ILT
8608 PR 5990
8609 * descriptors.h (Open_descriptor): Add is_on_stack field.
8610 * descriptors.cc (Descriptors::open): If the descriptor is on the
8611 top of the stack, remove it. Initialize is_on_stack field.
8612 (Descriptors::release): Only add pod to stack if it is not on the
8613 stack already.
8614 (Descriptors::close_some_descriptor): Clear stack_next and
8615 is_on_stack fields.
8616
e29e076a
ILT
8617 PR 7091
8618 * output.cc (Output_section::find_starting_output_address): Rename
8619 from starting_output_address; add PADDR parameter; change return
8620 type.
8621 * output.h (class Output_section): Declare
8622 find_starting_output_address instead of starting_output_address.
8623 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8624 section symbol for which we can't find a merge section.
8625
0602e05a
ILT
8626 PR 9836
8627 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8628 hidden or internal, force the symbol to be local.
8629 * resolve.cc (Symbol::override_visibility): Define.
8630 (Symbol::override_base): Use override_visibility.
8631 (Symbol_table::resolve): Likewise.
8632 (Symbol::override_base_with_special): Likewise.
8633 (Symbol_table::override_with_special): If the visibility is hidden
8634 or internal, force the symbol to be local.
8635 * symtab.h (class Symbol): Add set_visibility and
8636 override_visibility.
8637 * testsuite/ver_test_1.sh: New file.
8638 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8639 (check_DATA): Add ver_test_1.syms.
8640 (ver_test_1.syms): New target.
8641 * testsuite/Makefile.in: Rebuild.
8642
401a9a73
CC
86432009-02-25 Cary Coutant <ccoutant@google.com>
8644
8645 * layout.cc (Layout::choose_output_section): Don't rename sections
8646 when using a linker script that has a SECTIONS clause.
8647 * Makefile.in: Regenerate.
8648
8649 * testsuite/Makefile.am (script_test_5.sh): New test case.
8650 * testsuite/Makefile.in: Regenerate.
8651 * testsuite/script_test_5.cc: New file.
8652 * testsuite/script_test_5.sh: New file.
8653 * testsuite/script_test_5.t: New file.
8654
f488e4b0
CC
86552009-02-13 Rafael Avila de Espindola <espindola@google.com>
8656
8657 * archive.cc (Archive::include_member): Update calls to add_symbols.
8658 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8659 the Layout argument.
8660 * dynobj.h (do_add_symbols): Add the Layout argument.
8661 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8662 Layout argument.
8663 * object.h (Object::add_symbols): Add the Layout argument.
8664 (Object::do_add_symbols): Add the Layout argument.
8665 (Sized_relobj::do_add_symbols): Add the Layout argument.
8666 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8667 Unify the two versions.
8668 (Add_plugin_symbols): Remove.
8669 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8670 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8671 (Add_plugin_symbols): Remove.
8672 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8673 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8674 (Add_symbols::run): Make it work with Pulginobj.
8675
89dd1680
ILT
86762009-02-06 Ian Lance Taylor <iant@google.com>
8677
8678 * object.cc (Sized_relobj::do_layout): Make info message start
8679 with lower case letter.
8680
266d0a74
ILT
86812009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8682
602b464e
ILT
8683 * binary.cc: Fix file comment.
8684
266d0a74
ILT
8685 * options.h (enum Incremental_disposition): Define.
8686 (class General_options): Add new options: --incremental,
8687 --incremental_changed, --incremental_unchanged,
8688 --incremental_unknown. Add incremental_disposition_ and
8689 implicit_incremental_ fields.
8690 (General_options::incremental_disposition): New function.
8691 (class Position_dependent_options): Add incremental_disposition
8692 option.
8693 (Position_dependent_options::copy_from_options): Set incremental
8694 dispositions.
8695 * options.cc (General_options::parse_incremental_changed): New
8696 function.
8697 (General_options::parse_incremental_unchanged): New function.
8698 (General_options::parse_incremental_unknown): New function.
8699 (General_options::General_options): Initialize new fields
8700 incremental_disposition_ and implicit_incremental_.
8701 (General_options::finalize): Check for uasge of --incremental-*
8702 without --incremental.
8703
f073bbf7
CD
87042009-02-06 Chris Demetriou <cgd@google.com>
8705
8706 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8707 pointer and to report location as the file name associated with
8708 the symbol.
8709 (gold_undefined_symbol_at_location): New function to replace the
8710 old gold_undefined_symbol functionality.
8711 * target-reloc.h (relocate_section): Update to use
8712 gold_undefined_symbol_at_location.
8713 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8714 Call gold_undefined_symbol function rather than gold_error.
8715 * errors.h (Errors::undefined_symbol): Take location as a
8716 string, rather than calculating it from a relocation.
8717 * errors.cc (Errors::fatal): Print "fatal error:" before the
8718 formatted message.
8719 (Errors::error, Errors::error_at_location): Print "error: "
8720 before the formatted message.
8721 (Errors::undefined_symbol): Take location as a string, rather
8722 than calculating it from a relocation.
8723 (gold_undefined_symbol_at_location): New function akin to
8724 old gold_undefined_symbol, calculates location from relocation.
8725 (gold_undefined_symbol): Change to take only a Symbol pointer
8726 and to report location as the file name associated with the symbol.
8727 * testsuite/debug_msg.sh: Update for changed error messages.
8728 * testsuite/undef_symbol.sh: Likewise.
8729
8e94a90c
ILT
87302009-02-04 Duncan Sands <baldrick@free.fr>
8731
8732 PR 9812
8733 * reduced_debug_output.h
8734 (Output_reduced_debug_abbrev_section::failed): Use format for
8735 gold_warning.
8736 (Output_reduced_debug_info_section::faild): Likewise.
8737
88a0e15b
ILT
87382009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8739
8740 * script.cc (Lazy_demangler): New class.
8741 (Version_script_info::get_symbol_version_helper): Demangle a
8742 symbol only once.
8743
5efc7cd2
CC
87442009-01-29 Cary Coutant <ccoutant@google.com>
8745
8746 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8747 to __tls_get_addr.
8748 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8749
e0ebcf42
ILT
87502009-01-28 Ian Lance Taylor <iant@google.com>
8751
5efc7cd2 8752 * version.cc (version_string): Bump to 1.9.
75fe7426 8753
e0ebcf42
ILT
8754 * gold.h: Include <cstring> and <stdint.h>.
8755 * version.cc: Include <cstdio>.
8756 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8757 warning.
8758 * reduced_debug_output.cc (insert_into_vector): Rename from
8759 Insert_into_vector; change all callers. Use Swap_unaligned to
8760 avoid aliasing issue; remove union since it is unnecessary.
8761
8e2813be 87622009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8763
8764 * Makefile.am (CCFILES): Add gc.cc.
8765 (HFILES): Add gc.h.
8766 * Makefile.in: Regenerate.
8767 * gold.cc (Gc_runner): New class.
8768 (queue_initial_tasks): Call garbage collection related tasks
8769 when corresponding options are invoked.
8770 (queue_middle_gc_tasks): New function.
8771 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8772 processed early before laying out sections during garbage collection.
8773 * gold.h (queue_middle_gc_tasks): New function.
8774 (is_prefix_of): Move from "layout.cc".
8775 * i386.cc (Target_i386::gc_process_relocs): New function.
8776 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8777 * main.cc (main): Create object of class "Garbage_collection".
8778 * object.cc (Relobj::copy_symbols_data): New function.
8779 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8780 (Sized_relobj::do_layout): Allow this function to be called twice
8781 during garbage collection and defer layout of section during the
6d03d481
ST
8782 first call.
8783 * object.h (Relobj::get_symbols_data): New function.
8784 (Relobj::is_section_name_included): New function.
8785 (Relobj::copy_symbols_data): New function.
8786 (Relobj::set_symbols_data): New function.
8787 (Relobj::get_relocs_data): New function.
8788 (Relobj::set_relocs_data): New function.
8789 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8790 (Relobj::gc_process_relocs): New function.
8791 (Relobj::do_gc_process_relocs): New pure virtual function.
8792 (Relobj::sd_): New data member.
8793 (Sized_relobj::is_output_section_offset_invalid): New function.
8794 (Sized_relobj::do_gc_process_relocs): New function.
8795 * options.h (General_options::gc_sections): Modify to not be a no-op.
8796 (General_options::print_gc_sections): New option.
8797 * plugin.cc (Plugin_finish::run): Remove function call to
8798 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8799 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8800 * reloc.cc (Read_relocs::run): Add task to process relocs and
8801 determine unreferenced sections when doing garbage collection.
8802 (Gc_process_relocs): New class.
8803 (Sized_relobj::do_gc_process_relocs): New function.
8804 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8805 sections that are garbage collected.
8806 * reloc.h (Gc_process_relocs): New class.
8807 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8808 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8809 symbols whose corresponding sections are garbage collected.
8810 (Symbol_table::Symbol_table): Add new parameter for the garbage
8811 collection object.
8812 (Symbol_table::gc_mark_undef_symbols): New function.
8813 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8814 (Symbol_table::gc_mark_dyn_syms): New function.
8815 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8816 as garbage.
8817 (Symbol_table::add_from_object): Likewise.
8818 (Symbol_table::add_from_relobj): When building shared objects, do not
8819 treat externally visible symbols as garbage.
8820 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8821 table information for static and relocatable links.
8822 * symtab.h (Symbol_table::set_gc): New function.
8823 (Symbol_table::gc): New function.
8824 (Symbol_table::gc_mark_undef_symbols): New function.
8825 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8826 (Symbol_table::gc_mark_dyn_syms): New function.
8827 (Symbol_table::gc_): New data member.
e1df38aa 8828 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8829 function.
8830 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8831 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8832
3b293544
CF
88332009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8834
8835 * options.h (General_options::gc_sections): Define as a no-op for now.
8836 (General_options::no_keep_memory): Ditto.
8837 (General_options::Bshareable): Define.
8838 * options.cc (General_options::finalize): Honor -Bshareable.
8839
83d22aa8
AS
88402009-01-20 Andreas Schwab <schwab@suse.de>
8841
8842 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8843 read the value in the contents, since we don't use it. Use the
8844 template endianness when writing.
8845 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8846
cd536b21
AS
88472009-01-19 Andreas Schwab <schwab@suse.de>
8848
8849 * configure.tgt (powerpc64-*): Fix targ_obj.
8850
99e9a495
ILT
88512009-01-15 Ian Lance Taylor <iant@google.com>
8852
8853 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8854 local symbols when stripping all symbols.
8855
bbbfea06
CC
88562009-01-14 Cary Coutant <ccoutant@google.com>
8857
99e9a495 8858 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8859
0f7c0701
CC
88602009-01-14 Cary Coutant <ccoutant@google.com>
8861
8862 * archive.cc (Archive::get_elf_object_for_member): Remove call
8863 to File_read::claim_for_plugin.
8864 * descriptors.cc (Descriptors::open): Remove reference to
8865 is_claimed.
8866 (Descriptors::claim_for_plugin): Remove.
8867 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8868 (Descriptors::is_claimed): Remove.
8869 (claim_descriptor_for_plugin): Remove.
8870 * fileread.cc (File_read::claim_for_plugin): Remove.
8871 * fileread.h (File_read::claim_for_plugin): Remove.
8872 (File_read::descriptor): Reopen descriptor if necessary.
8873 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8874 (Plugin_manager::all_symbols_read): Add task parameter. Change
8875 all callers.
8876 (Plugin_manager::get_input_file): New function.
8877 (Plugin_manager::release_input_file): New function.
8878 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8879 corresponding data member.
8880 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8881 and pass to base constructor. Change all callers.
8882 (get_input_file, release_input_file): New functions.
8883 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8884 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8885 (Plugin_manager::all_symbols_read): Add task parameter.
8886 (Plugin_manager::get_input_file): New function.
8887 (Plugin_manager::release_input_file): New function.
8888 (Plugin_manager::task_): New data member.
8889 (Pluginobj::Pluginobj): Add filesize parameter.
8890 (Pluginobj::filename): New function.
8891 (Pluginobj::descriptor): New function.
8892 (Pluginobj::filesize): New function.
8893 (Pluginobj::filesize_): New data member.
8894 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8895 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8896 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8897
8898 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8899 with archive libraries.
8900 * testsuite/Makefile.in: Regenerate.
8901 * testsuite/plugin_test.c (struct sym_info): New type.
8902 (get_input_file, release_input_file): New static variables.
8903 (onload): Capture new transfer vector entries.
8904 (claim_file_hook): Stop reading at end of file according to filesize.
8905 Factor out parsing of readelf output into separate function.
8906 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8907 APIs and get the source file name from the symbol table. Convert
8908 source file name to corresponding object file name. Print info
8909 message when adding new input files.
8910 (parse_readelf_line): New function.
8911 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8912 * testsuite/plugin_test_2.sh: Likewise.
8913 * testsuite/plugin_test_3.sh: Likewise.
8914 * testsuite/plugin_test_4.sh: New test case.
8915
62a6d109
ILT
89162009-01-07 Ian Lance Taylor <iant@google.com>
8917
8918 * version.cc (version_string): Bump to 1.8.
8919
483620e8
CC
89202008-12-23 Cary Coutant <ccoutant@google.com>
8921
8922 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8923 * plugin.cc (Plugin_manager::finish): Rename as
8924 layout_deferred_objects. Move cleanup to separate function.
8925 (Plugin_manager::cleanup): New function.
8926 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8927 separately.
8928 * plugin.h (Plugin_manager::finish): Rename as
8929 layout_deferred_objects.
8930 (Plugin_manager::cleanup): New function.
8931 (Plugin_manager::cleanup_done): New field.
8932
d66a9eb3
CC
89332008-12-23 Cary Coutant <ccoutant@google.com>
8934
8935 * plugin.cc (is_visible_from_outside): New function.
8936 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8937 so we don't return "IR only" status for exported symbols or -r links.
8938
8939 * testsuite/Makefile.am (plugin_test_3): New test case.
8940 * testsuite/Makefile.in: Regenerate.
8941 * testsuite/plugin_test_3.sh: New file.
8942
5995b570
CC
89432008-12-22 Cary Coutant <ccoutant@google.com>
8944
8945 * object.cc (Sized_relobj::layout_section): New function.
8946 (Sized_relobj::do_layout): Defer layout of input sections until after
8947 plugin has provided replacement files.
8948 (Sized_relobj::do_layout_deferred_sections): New function.
8949 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8950 (Relobj::layout_deferred_sections): New function.
8951 (Relobj::do_layout_deferred_sections): New function.
8952 (Sized_relobj::do_layout_deferred_sections): New function.
8953 (Sized_relobj::layout_section): New function.
8954 (Sized_relobj::Deferred_layout): New structure.
8955 (Sized_relobj::deferred_layout_): New field.
8956 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8957 Change all callers. Layout deferred sections.
8958 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8959 references.
8960 (Plugin_hook::run): Move code from do_plugin_hook inline.
8961 (Plugin_hook::do_plugin_hook): Remove.
8962 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8963 (Plugin_manager::finish): Renamed, was cleanup.
8964 (Plugin_manager::should_defer_layout): New function.
8965 (Plugin_manager::add_deferred_layout_object): New function.
8966 (Plugin_manager::Deferred_layout_list): New type.
8967 (Plugin_manager::deferred_layout_objects_): New field.
8968 (Plugin_hook::do_plugin_hook): Remove.
8969
ee769c88
ILT
89702008-12-17 Ian Lance Taylor <iant@google.com>
8971
8972 * options.h (class General_options): Add --no case for
8973 --export-dynamic.
8974
abc8dcba
CC
89752008-12-16 Cary Coutant <ccoutant@google.com>
8976
8977 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8978 vector.
8979 (Plugin_manager::claim_file): Create plugin object even if
8980 plugin did not call the add_symbols callback.
8981 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8982 asking for more symbols than were added.
8983 * testsuite/Makefile.am (plugin_test_1): Add test case with
8984 no global symbols.
8985 (empty.syms): New target.
8986 * testsuite/Makefile.in: Regenerate.
8987 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8988 message. Don't call add_symbols if no globals.
8989 (all_symbols_read_hook): Don't provide replacement for empty
8990 claimed file.
8991
b0074644
ILT
89922008-12-12 Ian Lance Taylor <iant@google.com>
8993
68943102
ILT
8994 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8995 r_type == 0 for a local symbol with r_sym == 0.
8996 (scan_relocatable_relocs): Pass r_sym to
8997 local_non_section_strategy.
8998 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8999 r_sym parameter.
9000
b0074644
ILT
9001 * configure.ac: Update test for TLS descriptors: they are
9002 supported as of glibc 2.9.
9003 * configure: Rebuild.
9004
c2508178
ILT
90052008-12-11 Ian Lance Taylor <iant@google.com>
9006
9007 PR 7091
9008 * target-reloc.h (Default_scan_relocatable_relocs): For each
9009 function, map r_type == 0 to RELOC_DISCARD.
9010
2756a258
CC
90112008-12-10 Cary Coutant <ccoutant@google.com>
9012
9013 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
9014 object to override a kept COMDAT group from a plugin object.
9015
bb6f53d3
ILT
90162008-12-09 Ian Lance Taylor <iant@google.com>
9017
fbc558e1
ILT
9018 PR 7088
9019 * yyscript.y (file_cmd): Handle INPUT.
9020
bb6f53d3
ILT
9021 * testsuite/initpri1.c: Change all declarations to be full
9022 prototypes by adding void, to avoid compiler warnings.
9023
4674ecfc
CC
90242008-12-05 Rafael Avila de Espindola <espindola@google.com>
9025
9026 * options.cc (General_options::parse_plugin_opt): New.
9027 (General_options::add_plugin): The argument now is just the filename.
9028 (General_options::add_plugin_option): New.
9029 * options.h (plugin_opt): New.
9030 (add_plugin): Change argument name.
9031 (add_plugin_option): New.
9032 * plugin.cc (Plugin::load): Don't parse the plugin option.
9033 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
9034 (Plugin::add_option): New.
9035 (Plugin::args_): Change type.
9036 (Plugin::filename_): New.
9037 (Plugin_manager::add_plugin_option): New.
9038 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
9039 * testsuite/Makefile.in: Regenerate.
9040
fd06b4aa
CC
90412008-12-05 Cary Coutant <ccoutant@google.com>
9042
9043 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
9044 Handle --strip-lto-sections option.
9045 * options.h (strip_lto_sections): New option.
9046
6c52134c
CC
90472008-12-01 Cary Coutant <ccoutant@google.com>
9048
9049 * plugin.cc (ld_plugin_message): Change format parameter to const.
9050 Fix mismatch between new[] and delete.
9051
a45248e0
CC
90522008-11-14 Cary Coutant <ccoutant@google.com>
9053
9054 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
9055 instead of -1U.
9056
c82fbeee
CS
90572008-11-05 Craig Silverstein <csilvers@google.com>
9058
9059 * options.cc (General_options::parse_dynamic_list): New function.
9060 * options.h (General_options): New flags dynamic_list,
9061 dynamic_list_data, dynamic_list_cpp_new, and
9062 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9063 (General_options::in_dynamic_list): New function.
9064 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9065 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9066 (Lex::can_continue_name): Likewise.
9067 (yylex): Likewise.
9068 (read_script_file): New parameter script_options.
9069 (read_dynamic_list): New function.
9070 (Script_options::define_dynamic_list): New function.
9071 (dynamic_list_keyword_parsecodes): New variable.
9072 (dynamic_list_keywords): New variable.
9073 * script.h (Script_options::define_dynamic_list): New function
9074 prototype.
9075 (read_dynamic_list): New function prototype.
9076 * symtab.cc (strprefix): New macro.
9077 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9078 dynamic_list_data, dynamic_list_cpp_new, and
9079 dynamic_list_cpp_typeinfo.
9080 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9081 (dynamic_list_expr): New rule.
9082 (dynamic_list_nodes): Likewise.
9083 (dynamic_list_node): Likewise.
9084 * testsuite/Makefile.am (dynamic_list): New test.
9085 * testsuite/Makefile.in: Regenerated.
9086 * testsuite/dynamic_list.t: New file.
9087 * testsuite/dynamic_list.sh: New file.
9088
e0bb29a5
CS
90892008-11-05 Craig Silverstein <csilvers@google.com>
9090
9091 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9092 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9093 (t11_last): Likewise.
9094 * testsuite/ver_test_6.c (main): Likewise.
9095
4e1e25e0
CC
90962008-10-07 Cary Coutant <ccoutant@google.com>
9097
9098 * options.c (General_options::finalize): Add check for -static and
9099 -shared.
9100 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9101 is not empty.
9102
92f03fcb
CC
91032008-10-02 Cary Coutant <ccoutant@google.com>
9104
9105 * plugin.cc (make_sized_plugin_object): Fix conditional
9106 compilation to work when not all targets are enabled.
9107
fbd8a257
CC
91082008-09-29 Cary Coutant <ccoutant@google.com>
9109
9110 * archive.cc (Archive::get_file_and_offset): Use filename instead
9111 of name to get library path.
9112 (Archive::include_member): Unlock external member of a thin archive.
9113
9114 * testsuite/Makefile.am (TEST_AR): New variable.
9115 (thin_archive_test_1): New test.
9116 (thin_archive_test_2): New test.
81636b3f
CC
9117 * testsuite/Makefile.in: Regenerate.
9118 * testsuite/thin_archive_main.cc: New file.
9119 * testsuite/thin_archive_test_1.cc: New file.
9120 * testsuite/thin_archive_test_2.cc: New file.
9121 * testsuite/thin_archive_test_3.cc: New file.
9122 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 9123
eff45813
CC
91242008-09-29 Cary Coutant <ccoutant@google.com>
9125
9126 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9127 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9128 instead of -1U.
9129 (Sized_relobj::do_finalize_local_symbols): Likewise.
9130 (Sized_relobj::map_to_kept_section): Likewise.
9131 * object.h (Sized_relobj::invalid_address): New constant.
9132 (Sized_relobj::do_output_section_offset): Check for invalid_address
9133 and return -1ULL.
9134 * output.cc (Output_reloc::local_section_offset): Use constant
9135 invalid_address instead of -1U.
9136 (Output_reloc::get_address): Likewise.
9137 (Output_section::output_address): Change -1U to -1ULL.
9138 * output.h (Output_reloc::invalid_address): New constant.
9139 * reloc.cc (Sized_relobj::write_sections): Use constant
9140 invalid_address instead of -1U.
9141 (Sized_relobj::relocate_sections): Likewise.
9142 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9143 values for merge sections.
9144 * target-reloc.h (relocate_for_relocatable): Use constant
9145 invalid_address instead of -1U.
9146
89fc3421
CC
91472008-09-19 Cary Coutant <ccoutant@google.com>
9148
9149 Add plugin functionality for link-time optimization (LTO).
9150 * configure.ac (plugins): Add --enable-plugins option.
9151 * configure: Regenerate.
9152 * config.in: Regenerate.
9153 * Makefile.am (LIBDL): New variable.
9154 (CCFILES): Add plugin.cc.
9155 (HFILES): Add plugin.h.
9156 (ldadd_var): Add LIBDL.
9157 * Makefile.in: Regenerate.
9158
9159 * archive.cc: Include "plugin.h".
9160 (Archive::setup): Don't preread archive symbols when using a plugin.
9161 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9162 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9163 files.
9164 (Archive::include_member): Add symbols from plugin objects.
9165 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9166 * descriptors.cc (Descriptors::open): Check for file descriptors
9167 abandoned by plugins.
9168 (Descriptors::claim_for_plugin): New function.
9169 * descriptors.h (Descriptors::claim_for_plugin): New function.
9170 (Open_descriptor::is_claimed): New field.
9171 (claim_descriptor_for_plugin): New function.
9172 * fileread.cc (File_read::claim_for_plugin): New function.
9173 * fileread.h (File_read::claim_for_plugin): New function.
9174 (File_read::descriptor): New function.
9175 * gold.cc: Include "plugin.h".
9176 (queue_initial_tasks): Add task to call plugin hooks for generating
9177 new object files.
9178 * main.cc: Include "plugin.h".
9179 (main): Load plugin libraries.
9180 * object.h (Pluginobj): Declare.
9181 (Object::pluginobj): New function.
9182 (Object::do_pluginobj): New function.
9183 (Object::set_target): New function.
9184 * options.cc: Include "plugin.h".
9185 (General_options::parse_plugin): New function.
9186 (General_options::General_options): Initialize plugins_ field.
9187 (General_options::add_plugin): New function.
9188 * options.h (Plugin_manager): Declare.
9189 (General_options): Add --plugin option.
9190 (General_options::has_plugins): New function.
9191 (General_options::plugins): New function.
9192 (General_options::add_plugin): New function.
9193 (General_options::plugins_): New field.
9194 * plugin.cc: New file.
9195 * plugin.h: New file.
9196 * readsyms.cc: Include "plugin.h".
9197 (Read_symbols::do_read_symbols): Check for archive before checking
9198 for ELF file. Call plugin hooks to claim files.
9199 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9200 from a real object file; force override when processing replacement
9201 files.
9202 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9203 (Symbol::init_base_object): Likewise.
9204 (Symbol::init_base_output_data): Likewise.
9205 (Symbol::init_base_output_segment): Likewise.
9206 (Symbol::init_base_constant): Likewise.
9207 (Symbol::init_base_undefined): Likewise.
9208 (Symbol::output_section): Assert that object is not a plugin.
9209 (Symbol_table::add_from_pluginobj): New function.
9210 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9211 undefined.
9212 (Symbol_table::sized_write_globals): Likewise.
9213 (Symbol_table::add_from_pluginobj): Instantiate template.
9214 * symtab.h (Sized_pluginobj): Declare.
9215 (Symbol::in_real_elf): New function.
9216 (Symbol::set_in_real_elf): New function.
9217 (Symbol::in_real_elf_): New field.
9218 (Symbol_table::add_from_pluginobj): New function.
9219
9220 * testsuite/Makefile.am (AM_CFLAGS): New variable.
9221 (LIBDL): New variable.
9222 (LDADD): Add LIBDL.
9223 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
9224 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
9225 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
9226 (MOSTLYCLEANFILES): Likewise.
9227 * testsuite/Makefile.in: Regenerate.
9228 * testsuite/plugin_test.c: New file.
9229 * testsuite/plugin_test_1.sh: New file.
9230 * testsuite/plugin_test_2.sh: New file.
9231
de31bda5
ILT
92322008-09-16 Ian Lance Taylor <iant@google.com>
9233
9c2d0ef9
ILT
9234 * target-reloc.h (relocate_section): Check whether a symbol is
9235 defined by the ABI before reporting an undefined symbol error.
9236 * target.h (Target::is_defined_by_abi): Make parameter const.
9237 (Target::do_is_defined_by_abi): Likewise.
9238 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
9239 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
9240 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
9241 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
9242 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
9243 * testsuite/Makefile.in: Rebuild.
9244
de31bda5
ILT
9245 * fileread.cc (make_view): Add casts to avoid warning.
9246
9fa33bee
AO
92472008-09-16 Alexandre Oliva <aoliva@redhat.com>
9248
9249 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
9250 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9251
183fd0e3
AO
92522008-09-16 Alexandre Oliva <aoliva@redhat.com>
9253
9254 * options.h (General_options::output_is_executable): New.
9255 (General_options::output_is_pie): New.
9256 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
9257 for shared libraries.
9258 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9259
7be8330a
CD
92602008-09-11 Chris Demetriou <cgd@google.com>
9261
9262 * options.h (origin): New -z option.
9263 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
9264 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
9265 in DT_FLAGS_1.
9266
a9caad02
CC
92672008-09-05 Cary Coutant <ccoutant@google.com>
9268
9269 * fileread.cc (File_read::make_view): Add check for attempt to map
9270 beyond end of file.
9271
ae6dce4d
CC
92722008-09-05 Cary Coutant <ccoutant@google.com>
9273
9274 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
9275 explicit instantiations.
9276
d7ab2a47
KVH
92772008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
9278
9279 PR gold/6858
9280 * options.cc (General_options::finalize): Allow undefined symbols
9281 in shlibs if linking -shared.
9282
9283 PR gold/6859
9284 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
9285 symbols as not needing a dynsym entry.
9286
1e52a9c1
CS
92872008-08-20 Craig Silverstein <csilvers@google.com>
9288
9289 * fileread.cc (File_read::open): Do not lock the file unless it
9290 was successfully opened.
9291
d85c80a3
CC
92922008-08-14 Cary Coutant <ccoutant@google.com>
9293
9294 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
9295 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
9296 * testsuite/tls_test.cc (struct int128): 128-bit struct
9297 for testing TLS relocs with non-zero addend.
9298 (v12): New TLS variable.
9299 (t12): New test.
9300 (t_last): Add check for v12.
9301 * testsuite/tls_test.h (t12): New function.
9302 * testsuite/tls_test_main.cc (thread_routine): Call new test.
9303
2d924fd9
ILT
93042008-08-13 Ian Lance Taylor <iant@google.com>
9305
9306 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
9307 set tls_segment_ or relro_segment_.
9308 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
9309 when appropriate.
9310 * output.h (Output_section::clear_is_relro): New function.
9311 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
9312 sections specially even when output_data_ is empty.
9313 (Output_segment::maximum_alignment): When first section is relro,
9314 only force alignment for PT_LOAD segments.
9315 * script.cc (script_data_segment_align): New function.
9316 (script_data_segment_relro_end): New function.
9317 * script-c.h (script_data_segment_align): Declare.
9318 (script_data_segment_relro_end): Declare.
9319 * script-sections.h (class Script_sections): Declare
9320 data_segment_align and data_segment_relro_end. Add fields
9321 segment_align_index_ and saw_relro_end_.
9322 * script-sections.cc (class Sections_element): Add set_is_relro
9323 virtual function. Add new bool* parameter to place_orphan_here.
9324 Add get_output_section virtual function.
9325 (class Output_section_definition): Add set_is_relro. Add new
9326 bool* parameter to place_orphan_here. Add get_output_section.
9327 Add is_relro_ field.
9328 (Output_section_definition::Output_section_definition): Initialize
9329 evaluated_address_, evaluated_load_address, evaluated_addralign_,
9330 and is_relro_ fields.
9331 (Output_section_definition::place_orphan_here): Add is_relro
9332 parameter.
9333 (Output_section_definition::set_section_addresses): Set relro for
9334 output section.
9335 (Output_section_definition::alternate_constraint): Likewise.
9336 (class Orphan_output_section): Add new bool* parameter to
9337 place_orphan_here. Add get_output_section.
9338 (Orphan_output_section::place_orphan_here): Add is_relro
9339 parameter.
9340 (Script_sections::Script_sections): Initialize
9341 data_segment_align_index_ and saw_relro_end_.
9342 (Script_sections::data_segment_align): New function.
9343 (Script_sections::data_segment_relro_end): New function.
9344 (Script_sections::place_orphan): Set or clear is_relro.
9345 (Script_sections::set_section_addresses): Force alignment of first
9346 TLS section.
9347 * yyscript.y (exp): Call script_data_segment_align and
9348 script_data_segment_relro_end.
9349 * testsuite/relro_script_test.t: New file.
9350 * testsuite/relro_test.cc (using_script): Declare.
9351 (t1, t2): Test using_script.
9352 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
9353 (relro_script_test_SOURCES): Define.
9354 (relro_script_test_DEPENDENCIES): Define.
9355 (relro_script_test_LDFLAGS): Define.
9356 (relro_script_test_LDADD): Define.
9357 (relro_script_test.so): New target.
9358 * testsuite/Makefile.in: Rebuild.
9359
f827c9a9
CC
93602008-08-06 Cary Coutant <ccoutant@google.com>
9361
9362 * archive.cc (Archive::total_archives, Archive::total_members)
9363 (Archive::total_members_loaded): New variables.
9364 (Archive::setup): Add parameter. Add option to preread
9365 archive symbols.
9366 (Archive::read_armap): Add counter.
9367 (Archive::get_file_and_offset): New function.
9368 (Archive::get_elf_object_for_member): New function.
9369 (Archive::read_all_symbols): New function.
9370 (Archive::read_symbols): New function.
9371 (Archive::add_symbols): Add counters.
9372 (Archive::include_all_members): Use armap to find members if it's
9373 already built.
9374 (Archive::include_member): Skip reading symbols if already read.
9375 Factored code into Archive::get_file_and_offset and
9376 Archive::get_elf_object_for_member. Changed call to
9377 Mapfile::report_include_archive_member.
9378 (Archive::print_stats): New function.
9379 * archive.h: Declare Object and Read_symbols_data classes.
9380 (Archive::Archive): Add initializers for new members.
9381 (Archive::setup): Add parameter.
9382 (Archive::print_stats): New function.
9383 (Archive::total_archives, Archive::total_members)
9384 (Archive::total_members_loaded): New variables.
9385 (Archive::get_file_and_offset): New function.
9386 (Archive::get_elf_object_for_member): New function.
9387 (Archive::read_all_symbols): New function.
9388 (Archive::read_symbols): New function.
9389 (Archive::Archive_member): New class.
9390 (Archive::members_): New member.
9391 (Archive::num_members_): New member.
9392 * main.cc: Include archive.h.
9393 (main): Call Archive::print_stats.
9394 * mapfile.cc (Mapfile::report_include_archive_member): Delete
9395 archive parameter; member_name is now the fully-decorated name.
9396 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9397 * options.h: (General_options): Add --preread-archive-symbols option.
9398 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9399 Archive::setup.
9400
de4c45bd
ILT
94012008-08-04 Ian Lance Taylor <iant@google.com>
9402
9403 * symtab.h (Symbol::use_plt_offset): New function.
9404 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9405 * powerpc.cc (Relocate::relocate): Likewise.
9406 * sparc.cc (Relocate::relocate): Likewise.
9407 * x86_64.cc (Relocate::relocate): Likewise.
9408 * testsuite/weak_plt.sh: New test.
9409 * testsuite/weak_plt_main.cc: New test.
9410 * testsuite/weak_plt_shared.cc: New test.
9411 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9412 (check_PROGRAMS): Add weak_plt.
9413 (check_DATA): Add weak_plt_shared.so.
9414 (weak_plt_main_pic.o, weak_plt): New targets.
9415 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9416 * testsuite/Makefile.in: Rebuild.
9417
9418 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9419 gcctestdir/ld.
9420 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9421 * testsuite/Makefile.in: Rebuild.
9422
323ee3f4
AM
94232008-08-04 Alan Modra <amodra@bigpond.net.au>
9424
9425 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9426 * Makefile.in: Regenerate.
9427 * po/POTFILES.in: Regenerate.
9428
7c07ecec
ILT
94292008-07-29 Ian Lance Taylor <iant@google.com>
9430
9431 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9432 symbols before other symbols.
9433 * testsuite/script_test_2.cc (test_addr): Declare.
9434 (test_addr_alias): Declare.
9435 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9436 values.
7c07ecec
ILT
9437 * testsuite/script_test_2.t: Define test_addr_alias and
9438 test_addr.
9439
5778530e
ILT
94402008-07-24 Ian Lance Taylor <iant@google.com>
9441
2a00e4fb
ILT
9442 PR 5990
9443 * descriptors.cc: New file.
9444 * descriptors.h: New file.
9445 * gold-threads.h (class Hold_optional_lock): New class.
9446 * fileread.cc: Include "descriptors.h".
9447 (File_read::~File_read): Release descriptor rather than closing
9448 it.
9449 (File_read::open) [file]: Call open_descriptor rather than open.
9450 Set is_descriptor_opened_.
9451 (File_read::open) [memory]: Assert that descriptor is not open.
9452 (File_read::reopen_descriptor): New function.
9453 (File_read::release): Release descriptor.
9454 (File_read::do_read): Make non-const. Reopen descriptor.
9455 (File_read::read): Make non-const.
9456 (File_read::make_view): Reopen descriptor.
9457 (File_read::do_readv): Likewise.
9458 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9459 Update declarations.
9460 * layout.cc: Include "descriptors.h".
9461 (Layout::create_build_id): Use open_descriptor rather than open.
9462 * output.cc: Include "descriptors.h".
9463 (Output_file::open): Use open_descriptor rather than open.
9464 * archive.cc (Archive::const_iterator): Change Archive to be
9465 non-const.
9466 (Archive::begin, Archive::end): Make non-const.
9467 (Archive::count_members): Likewise.
9468 * archive.h (class Archive): Update declarations.
9469 * object.h (Object::read): Make non-const.
9470 * Makefile.am (CCFILES): Add descriptors.cc.
9471 (HFILES): Add descriptors.h.
9472 * Makefile.in: Rebuild.
9473
801647d1
ILT
9474 PR 6716
9475 * gold.h: Always include <clocale>. Add Solaris workarounds
9476 following code in binutils/sysdep.h.
9477
5edd166e
ILT
9478 PR 6048
9479 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9480 this->eh_frame_hdr_ is NULL before using it.
9481
c89ad728
ILT
9482 * dynobj.cc (Versions::Versions): Update comment.
9483
aa86f06b
ILT
9484 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9485 the base version name.
9486
5778530e
ILT
9487 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9488 array size plus one.
9489 (Stringpool_template::set_string_offsets): Subtract one from key
9490 before using it as an array index.
9491 (Stringpool_template::get_offset_with_length): Likewise.
9492 (Stringpool_template::write_to_buffer): Likewise.
9493 * stringpool.h (Stringpool_template::get_offset_from_key):
9494 Likewise.
9495
057ead22
ILT
94962008-07-23 Ian Lance Taylor <iant@google.com>
9497
7f649c59
ILT
9498 PR 6658
9499 * object.h (Merged_symbol_value::value): Do our best to handle a
9500 negative addend.
9501
057ead22
ILT
9502 PR 6647
9503 * script.cc (Version_script_info::get_versions): Don't add empty
9504 version tag to return value.
9505 (Version_script_info::get_symbol_version_helper): Change return
9506 type to bool. Add pversion parameter. Change all callers.
9507 (script_register_vers_node): Don't require a non-NULL tag.
9508 * script.h (class Version_script_info): Update declarations.
9509 (Version_script_info::get_symbol_version): Change return type to
9510 bool. Add version parameter. Change all callers.
9511 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9512 handling. Handle an empty version from a version script.
9513 (Symbol_table::define_special_symbol): Likewise.
9514 * testsuite/ver_test_10.script: New file.
9515 * testsuite/ver_test_10.sh: New file.
9516 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9517 (check_DATA): Add ver_test_10.syms.
9518 (ver_test_10.syms, ver_test_10.so): New target.
9519 * testsuite/Makefile.in: Rebuild.
9520
58e54ac2
CD
95212008-07-23 Simon Baldwin <simonb@google.com>
9522
9523 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9524 to zero for undefined symbols from dynamic libraries.
9525
95d14cd3
ILT
95262008-07-23 Ian Lance Taylor <iant@google.com>
9527
9528 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9529 Change all callers.
9530 * symtab.h (class Symbol_table): Update declaration.
9531 * testsuite/ver_test_9.cc: New file.
9532 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9533 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9534 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9535 (ver_test_9.so, ver_test_9.o): New targets.
9536 * testsuite/Makefile.in: Rebuild.
9537
92de84a6
ILT
95382008-07-22 Ian Lance Taylor <iant@google.com>
9539
34810851
ILT
9540 * options.h (class General_options): Define --check-sections.
9541 * layout.cc (Layout::set_segment_offsets): Handle
9542 --check-sections.
9543
af6156ef
ILT
9544 * options.h (class General_options): Define -n/--nmagic and
9545 -N/--omagic.
9546 * options.cc (General_options::finalize): For -n/--nmagic or
9547 -N/--omagic, set -static.
9548 * layout.cc (Layout::attach_allocated_section_to_segment): If
9549 -N/--omagic, don't put read-only and read-write sections in
9550 different segments.
9551 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9552 finding a read-only segment.
9553 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9554 don't set the minimum segment alignment to the common page size,
9555 and don't set the file offset to the address modulo the page size.
9556 * script-sections.cc (Script_sections::create_segments): If
9557 -n/--omagic, don't put read-only and read-write sections in
9558 different segments.
9559
92de84a6
ILT
9560 * cref.cc: New file.
9561 * cref.h: New file.
9562 * options.h (class General_options): Add --print-symbol-counts.
9563 * main.cc (main): Issue defined symbol report if requested.
9564 * archive.cc (Archive::interpret_header): Make into a const member
9565 function.
9566 (Archive::add_symbols): Call Input_objects::archive_start and
9567 archive_stop.
9568 (Archive::const_iterator): Define new class.
9569 (Archive::begin, Archive::end): New functions.
9570 (Archive::include_all_members): Rewrite to use iterator.
9571 (Archive::count_members): New function.
9572 * archive.h (class Archive): Update declarations.
9573 (Archive::filename): New function.
9574 * object.cc: Include "cref.h".
9575 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9576 (Sized_relobj::do_get_global_symbol_counts): New function.
9577 (Input_objects::add_object): Add object to cross-referencer.
9578 (Input_objects::archive_start): New function.
9579 (Input_objects::archive_stop): New function.
9580 (Input_objects::print_symbol_counts): New function.
9581 * object.h: Declare Cref and Archive.
9582 (Object::get_global_symbol_counts): New function.
9583 (Object::do_get_global_symbol_counts): New pure virtual function.
9584 (class Sized_relobj): Add defined_count_ field. Update
9585 declarations.
9586 (class Input_objects): Add cref_ field. Update constructor.
9587 Update declarations.
9588 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9589 defined_count_.
9590 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9591 symbol counts.
9592 (Sized_dynobj::do_get_global_symbol_counts): New function.
9593 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9594 defined_count_. Update declarations. Define Symbols typedef.
9595 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9596 parameter. Change all callers.
9597 (Symbol_table::add_from_dynobj): Add sympointers and defined
9598 parameters. Change all callers.
9599 * symtab.h (class Symbol_table): Update declarations.
9600 * Makefile.am (CCFILES): Add cref.cc.
9601 (HFILES): Add cref.h.
9602 * Makefile.in: Rebuild.
9603
3f7c5e1d
CD
96042008-07-22 Simon Baldwin <simonb@google.com>
9605
9606 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9607 to zero when writing undefined symbols.
9608
e0b64032
ILT
96092008-07-22 Ian Lance Taylor <iant@google.com>
9610
9611 * output.cc (Output_section::add_input_section): Don't try to
9612 merge empty merge sections.
9613
096b02cf
CS
96142008-07-21 Craig Silverstein <csilvers@google.com>
9615
9616 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9617 Include symbol version in error message.
cd536b21 9618
1d1f116d
CD
96192008-07-20 Chris Demetriou <cgd@google.com>
9620
cd536b21 9621 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9622 (RANDOM_SEED_CFLAGS): New substituted variable.
9623 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9624 * configure: Rebuild.
9625 * Makefile.in: Likewise.
9626 * testsuite/Makefile.in: Likewise.
9627
a18f591e
ILT
96282008-07-18 Ian Lance Taylor <iant@google.com>
9629
9630 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9631 where we see NAME/NULL and NAME/VERSION as separate symbols.
9632 * testsuite/ver_test_main.cc (main): Call t4.
9633 (t4, t4_2a): Define.
9634 * testsuite/ver_test_2.cc (t4_2): Define.
9635 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9636 * testsuite/ver_test_4.cc (t4_2a): Define.
9637 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9638 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9639
c6e3f6ed
ILT
96402008-07-17 Ian Lance Taylor <iant@google.com>
9641
9642 * dynobj.cc (Versions::add_def): If we give an error about a
9643 missing version, go ahead and create the version anyhow.
9644
ef9beddf
ILT
96452008-07-10 Ian Lance Taylor <iant@google.com>
9646
9647 Handle output sections with more than 0x7fffffff bytes.
9648 * object.h (class Relobj): Change map_to_output_ to
9649 output_sections_, and just keep a section pointer. Change all
9650 uses. Move comdat group support to Sized_relobj.
9651 (Relobj::is_section_specially_mapped): Remove.
9652 (Relobj::output_section): Remove poff parameter. Change all
9653 callers.
9654 (Relobj::output_section_offset): New function.
9655 (Relobj::set_section_offset): Rewrite.
9656 (Relobj::map_to_output): Remove.
9657 (Relobj::output_sections): New function.
9658 (Relobj::do_output_section_offset): New pure virtual function.
9659 (Relobj::do_set_section_offset): Likewise.
9660 (class Sized_relobj): Add section_offsets_ field. Add comdat
9661 group support from Relobj. Update declarations.
9662 (Sized_relobj::get_output_section_offset): New function.
9663 (Sized_relobj::do_output_section_offset): New function.
9664 (Sized_relobj::do_set_section_offset): New function.
9665 * object.cc (Relobj::output_section_address): Remove.
9666 (Sized_relobj::Sized_relobj): Initialize new fields.
9667 (Sized_relobj::include_section_group): Cast find_kept_object to
9668 Sized_relobj.
9669 (Sized_relobj::include_linkonce_section): Likewise.
9670 (Sized_relobj::do_layout): Use separate arrays for output section
9671 and output offset.
9672 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9673 output_sections.
9674 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9675 output_sections and section_offsets.
9676 (Sized_relobj::write_local_symbols): Likewise.
9677 (map_to_kept_section): Compute output address directly.
9678 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9679 output_sections and section_offsets.
9680 (Sized_relobj::write_sections): Likewise.
9681 (Sized_relobj::relocate_sections): Likewise.
9682 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9683 * output.h (class Output_reloc): Update declarations. Change
9684 u2_.relobj to Sized_relobj*.
9685 (class Output_data_reloc): Change add functions to use
9686 Sized_relobj*.
9687 * output.cc (Output_reloc::Output_reloc): Change relobj to
9688 Sized_relobj*.
9689 (Output_reloc::local_section_offset): Change return type to
9690 Elf_Addr. Use get_output_section_offset.
9691 (Output_reloc::get_address): Likewise.
9692 (Output_section::is_input_address_mapped): Don't call
9693 is_section_specially_mapped.
9694 (Output_section::output_offset): Likewise.
9695 (Output_section::output_address): Likewise.
9696 (Output_section::starting_output_address): Likewise.
9697 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9698 parameter to Sized_relobj*.
9699 (Copy_relocs::need_copy_reloc): Likewise.
9700 (Copy_relocs::save): Likewise.
9701 * copy-relocs.h (class Copy_relocs): Update declarations.
9702 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9703 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9704 * target-reloc.h (relocate_for_relocatable): Change
9705 offset_in_output_section type to Elf_Addr. Change code that uses
9706 it as well.
9707 * layout.cc (Layout::layout): Always set *off.
9708 * mapfile.cc (Mapfile::print_input_section): Use
9709 output_section_offset.
9710 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9711 Sized_relobj*.
9712 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9713 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9714 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9715
5cb66f97
ILT
97162008-07-03 Ian Lance Taylor <iant@google.com>
9717
9718 * layout.cc (Layout::include_section): Do not discard unrecognized
9719 SHT_STRTAB sections.
9720
afe47622
CS
97212008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9722
9723 * script.cc (Lex::can_continue_name): Make '?' allowable in
9724 version-script names.
9725 * testsuite/version_script.map: Change glob pattern to use '?'
9726
5adf9721
ILT
97272008-06-30 Manish Singh <yosh@gimp.org>
9728
9729 PR 6585
9730 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9731 Correct typo.
9732
e6fde208
ILT
97332008-06-30 Ian Lance Taylor <iant@google.com>
9734
9735 PR 6660
9736 PR 6682
9737 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9738 versions]: Don't try to read the value in the contents, since we
9739 don't use it. Use the template endianness when writing.
9740
3f2e6a2d
CC
97412008-06-25 Cary Coutant <ccoutant@google.com>
9742
9743 * fileread.cc (File_read::make_view): Assert on zero-length view.
9744 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9745 symbol table when there are no symbols to read.
9746
c43d3a48
CS
97472008-06-23 Craig Silverstein <csilvers@google.com>
9748
9749 * version.cc (version_string): Bump to 1.7
9750
5f494ea0
CS
97512008-06-18 Craig Silverstein <csilvers@google.com>
9752
9753 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9754 constant 0xFFFF to type Valtype.
9755 (Powerpc_relocate_functions::rel16_ha): Likewise.
9756
c42e122e
ILT
97572008-06-17 Ian Lance Taylor <iant@google.com>
9758
f34787f8
ILT
9759 * output.h (Output_section::Input_section): Initialize p2align_ to
9760 zero for Output_section_data constructors.
9761 (Output_section::Input_section::addralign): If not an input
9762 section, return the alignment of the Output_section_data.
9763 * testsuite/copy_test.cc: New file.
9764 * testsuite/copy_test_1.cc: New file.
9765 * testsuite/copy_test_2.cc: New file.
9766 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9767 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9768 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9769 (copy_test_1_pic.o, copy_test_1.so): New targets.
9770 (copy_test_2_pic.o, copy_test_2.so): New targets.
9771 * testsuite/Makefile.in: Rebuild.
9772
c42e122e
ILT
9773 * script-sections.cc (Script_sections::place_orphan): Initialize
9774 local variable exact.
9775
ce3ac18a
DE
97762008-06-13 David Edelsohn <edelsohn@gnu.org>
9777
9778 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9779
42cacb20
DE
97802008-06-12 David Edelsohn <edelsohn@gnu.org>
9781 David S. Miller <davem@davemloft.net>
9782
9783 * powerpc.cc: New file.
9784 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9785 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9786 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9787 * Makefile.in: Rebuild.
9788
7b308235
ILT
97892008-06-09 Ian Lance Taylor <iant@google.com>
9790
9791 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9792 <exception>.
9793 (throwing, orig_terminate): New static variables.
9794 (terminate_handler): New static function.
9795 (t2): Set terminate handler.
9796
f0b886e3
ILT
97972008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9798
9799 PR 6584
cd536b21 9800 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9801 alignment.
9802
3e90f135
CC
98032008-05-30 Cary Coutant <ccoutant@google.com>
9804
9805 * archive.cc (Archive::include_all_members) Correct to step
9806 over symbol table and extended name table in thin archives.
9807
e09ad04a
ILT
98082008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9809
9810 PR 6407
9811 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9812 calculation.
9813
62b01cb5
ILT
98142008-05-28 Caleb Howe <cshowe@google.com>
9815
9816 * reduced_debug_output.cc: New file.
9817 * reduced_debug_output.h: New file.
92de84a6 9818 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9819 * options.cc (General_options::finalize): Add strip_debug_non_line
9820 to the strip heirarchy.
9821 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9822 fields.
9823 * layout.cc: Include "reduced_debug_output.h".
9824 (Layout::Layout): Initialize new fields.
9825 (line_only_debug_sections): New static array.
9826 (is_lines_only_debug_sections): New static inline function.
9827 (Layout::include_section): Handle --strip-debug-non-line.
9828 (Layout::make_output_section): If --strip-debug-non-line, build
9829 new output sections for .debug_abbrev and .debug_info.
9830 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9831 gold. Warn about possible overflow.
9832 (read_signed_LEB_128): Likewise.
9833 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9834 (read_signed_LEB_128): Declare.
9835 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9836 (HFILES): Add reduced_debug_output.h.
9837 * Makefile.in: Rebuild.
9838
7d9e3d98
ILT
98392008-05-21 Ian Lance Taylor <iant@google.com>
9840
9841 * mapfile.cc: New file.
9842 * mapfile.h: New file.
9843 * options.h (class General_options): Add -M/--print-map and -Map.
9844 * options.cc (General_options::finalize): Make -M equivalent to
9845 -Map -.
9846 * main.cc: Include <cstdio> and "mapfile.h".
9847 (main): Open mapfile if requested.
9848 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9849 constructor. Change caller.
9850 (queue_initial_tasks): Add mapfile parameter. Change caller.
9851 (queue_middle_tasks): Likewise.
9852 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9853 declarations.
9854 * archive.cc: Include "mapfile.h".
9855 (Archive::add_symbols): Add mapfile parameter. Change all
9856 callers. Pass mapfile, symbol, and reason to include_member.
9857 (Archive::include_all_members): Add mapfile parameter. Change all
9858 callers.
9859 (Archive::include_member): Add mapfile, sym, and why parameters.
9860 Change all callers. Report inclusion to map file.
9861 * archive.h: Include "fileread.h".
9862 (class Archive): Update declarations.
9863 (Archive::file): New const method.
9864 (class Add_archive_symbols): Add mapfile_ field. Update
9865 constructor. Change all callers.
9866 * readsyms.h (class Read_symbols): Likewise.
9867 (class Finish_group): Likewise.
9868 (class Read_script): Likewise.
9869 * common.cc: Include "mapfile.h".
9870 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9871 all callers.
9872 (Symbol_table::do_allocate_commons): Likewise.
9873 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9874 symbol allocation to mapfile.
9875 * common.h (class Allocate_commons_task): Add mapfile_ field.
9876 Update constructor. Change all callers.
9877 * symtab.h (class Symbol_table): Update declarations.
9878 * layout.cc: Include "mapfile.h".
9879 (Layout_task_runner::run): Print information to mapfile.
9880 (Layout::create_gold_note): Change Output_data_fixed_space to
9881 Output_data_zero_fill.
9882 (Layout::create_build_id): Likewise.
9883 (Layout::print_to_mapfile): New function.
9884 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9885 constructor. Change caller.
9886 (class Layout): Declare print_to_mapfile.
9887 * output.cc (Output_section::Input_section::print_to_mapfile): New
9888 function.
9889 (Output_section::add_input_section): If producing a map, always
9890 add to input_sections_ list.
9891 (Output_section::do_print_to_mapfile): New function.
9892 (Output_segment::print_sections_to_mapfile): New function.
9893 (Output_segment::print_section_list_to_mapfile): New function.
9894 * output.h: Include "mapfile.h".
9895 (Output_data::print_to_mapfile): New function.
9896 (Output_data::do_print_to_mapfile): New virtual function.
9897 (Output_segment_headers::do_print_to_mapfile): New function.
9898 (Output_file_header::do_print_to_mapfile): New function.
9899 (Output_data_const::do_print_to_mapfile): New function.
9900 (class Output_data_const_buffer): Add map_name_ field. Update
9901 constructor. Change all callers. Add do_print_to_mapfile
9902 function.
9903 (class Output_data_fixed_space): Likewise.
9904 (class Output_data_space): Likewise.
9905 (class Output_data_zero_fill): New class.
9906 (Output_data_strtab::do_print_to_mapfile): New function.
9907 (Output_data_reloc_base::do_print_to_mapfile): New function.
9908 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9909 (Output_data_group::do_print_to_mapfile): New function.
9910 (Output_data_got::do_print_to_mapfile): New function.
9911 (Output_data_dynamic::do_print_to_mapfile): New function.
9912 (Output_symtab_xindex::do_print_to_mapfile): New function.
9913 (class Output_section): Declare do_print_to_mapflie. Declare
9914 print_to_mapfile in Input_section.
9915 (class Output_segment): Declare new functions.
9916 * object.h (Sized_relobj::symbol_count): New function.
9917 * script-sections.cc
9918 (Output_section_element_dot_assignment::set_section_addresses):
9919 Change Output_data_fixed_space to Output_data_zero_fill.
9920 (Output_data_expression::do_print_to_mapfile): New function.
9921 * script.cc (read_input_script): Add mapfile parameter. Change
9922 all callers.
9923 * script.h (read_input_script): Update declaration.
9924 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9925 (Eh_frame::do_print_to_mapfile): New function.
9926 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9927 (Output_merge_string::do_print_to_mapfile): New function.
9928 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9929 function.
9930 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9931 function.
9932 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9933 function.
9934 * Makefile.am (CCFILES): Add mapfile.cc.
9935 (HFILES): Add mapfile.h.
9936 * Makefile.in: Rebuild.
9937
9f1d377b
ILT
99382008-05-19 Ian Lance Taylor <iant@google.com>
9939
9940 * options.h (class General_options): Add -z relro.
9941 * layout.cc (Layout::Layout): Initialize relro_segment_.
9942 (Layout::add_output_section_data): Return the output section.
9943 (Layout::make_output_section): Rcognize relro sections and mark
9944 them appropriately.
9945 (Layout::attach_allocated_section_to_segment): Put relro sections
9946 in a PT_GNU_RELRO segment.
9947 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9948 section as relro.
9949 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9950 PT_TLS segments.
9951 (Layout::linkonce_mapping): Map d.rel.ro.local to
9952 .data.rel.ro.local.
9953 (Layout::output_section_name): Us .data.rel.ro.local for any
9954 section which begins with that.
9955 * layout.h (class Layout): Update add_output_section_data
9956 declaration. Add relro_segment_ field.
9957 * output.cc (Output_section::Output_section): Initialize is_relro_
9958 and is_relro_local_ fields.
9959 (Output_segment::add_output_section): Group relro sections.
9960 (Output_segment::is_first_section_relro): New function.
9961 (Output_segment::maximum_alignment): If there is a relro section,
9962 align the segment to the common page size.
9963 (Output_segment::set_section_addresses): Track whether we are
9964 looking at relro sections. If the last section is a relro
9965 section, align to the common page size.
9966 (Output_segment::set_section_list_addresses): Add in_relro
9967 parameter. Change all callers. Align to the page size when
9968 moving from relro to non-relro section.
9969 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9970 segment.
9971 * output.h (class Output_section): Add is_relro_ and
9972 is_relro_local_ fields.
9973 (Output_section::is_relro): New function.
9974 (Output_section::set_is_relro): New function.
9975 (Output_section::is_relro_local): New function.
9976 (Output_section::set_is_relro_local): New function.
9977 (class Output_segment): Update declarations.
9978 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9979 * sparc.cc (Target_sparc::got_section): Likewise.
9980 * x86_64.cc (Target_x86_64::got_section): Likewise.
9981 * testsuite/relro_test_main.cc: New file.
9982 * testsuite/relro_test.cc: New file.
9983 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9984 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9985 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9986 (relro_test.so, relro_test_pic.o): New targets.
9987 * testsuite/Makefile.in: Rebuild.
9988
a984ee1d
ILT
99892008-05-16 Ian Lance Taylor <iant@google.com>
9990
01676dcd
ILT
9991 * output.cc (Output_segment::add_output_section): Remove front
9992 parameter.
9993 * output.h (class Output_segment): Remove
9994 add_initial_output_section and overloaded add_output_section.
9995 Update declaration of remaining add_output_section.
9996 * layout.cc (Layout::create_interp): Call add_output_section
9997 rather than add_initial_output_section.
9998 (Layout::finish_dynamic_section): Likewise.
9999
497897f9
ILT
10000 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
10001 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
10002 know the dynamic type.
10003 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
10004 field. Initialize it in constructor.
10005 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
10006 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
10007 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
10008 reloc.
10009
a984ee1d
ILT
10010 * output.cc (Output_reloc::get_address): Change return type to
10011 Elf_Addr.
10012 * output.h (class Output_reloc): Update get_address declaration.
10013 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
10014 for section addresses.
10015
55ba0940
ILT
100162008-05-09 Ian Lance Taylor <iant@google.com>
10017
10018 PR 6493
10019 * gold.cc (gold_nomem): Use return value of write.
10020
75517b77
ILT
100212008-05-08 Ian Lance Taylor <iant@google.com>
10022
10023 * symtab.c (Symbol::init_base_output_data): Add version
10024 parameter. Change all callers.
10025 (Symbol::init_base_output_segment): Likewise.
10026 (Symbol::init_base_constant): Likewise.
10027 (Symbol::init_base_undefined): Likewise.
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): Likewise.
10032 (Symbol_table::do_define_in_output_data): If the new symbol has a
10033 version, mark it as the default.
10034 (Symbol_table::do_define_in_output_segment): Likewise.
10035 (Symbol_table::do_define_as_constant): Likewise.
10036 * symtab.h (class Symbol): Update declarations.
10037 (class Sized_symbol): Likewise.
10038 * resolve.cc (Symbol::override_version): New function.
c42e122e 10039 (Symbol::override_base): Call override_version.
75517b77
ILT
10040 (Symbol::override_base_with_special): Likewise.
10041 * testsuite/ver_script_8.script: New file.
10042 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
10043 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
10044 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
10045 (ver_test_8_1.so, ver_test_8_2.so): New targets.
10046
f1f70eae
ILT
100472008-05-06 Ian Lance Taylor <iant@google.com>
10048
f3e9c5c5
ILT
10049 PR 6049
10050 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
10051 functions.
10052 (class General_options): Remove existing --undefined, and add
10053 --no-undefined instead. Add new --undefined as synonym for -u.
10054 * archive.cc (Archive::add_symbols): Check whether symbol was
10055 named with -u.
10056 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
10057 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
10058 all uses. Add IS_UNDEFINED. Update declarations to split
10059 different versions of init_base. Declare init_base_undefined.
10060 (Symbol::is_defined): Handle IS_UNDEFINED.
10061 (Symbol::is_undefined): Likewise.
10062 (Symbol::is_weak_undefined): Call is_undefined.
10063 (Symbol::is_absolute): Handle IS_CONSTANT.
10064 (class Sized_symbol): Update declarations to split different
10065 versions of init. Declare init_undefined.
10066 (class Symbol_table): Declare new functions.
10067 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10068 Change all callers.
10069 (Symbol::init_base_output_data): Likewise.
10070 (Symbol::init_base_output_segment): Likewise.
10071 (Symbol::init_base_constant): Likewise.
10072 (Symbol::init_base_undefined): New function.
10073 (Sized_symbol::init_object): Rename from init. Change all
10074 callers.
10075 (Sized_symbol::init_output_data): Likewise.
10076 (Sized_symbol::init_output_segment): Likewise.
10077 (Sized_symbol::init_constant): Likewise.
10078 (Sized_symbol::init_undefined): New function.
10079 (Symbol_table::add_undefined_symbols_from_command_line): New
10080 function.
10081 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10082 function.
10083 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10084 (Symbol::output_section): Likewise.
10085 (Symbol::set_output_section): Likewise.
10086 (Symbol_table::sized_finalize_symbol): Likewise.
10087 (Symbol_table::sized_write_globals): Likewise.
10088 * resolve.cc (Symbol_table::should_override): Likewise.
10089 (Symbol::override_base_with_special): Likewise.
10090
8bdcdf2c
ILT
10091 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10092 symbol, change it to have default visibility.
10093 * testsuite/protected_1.cc: New file.
10094 * testsuite/protected_2.cc: New file.
10095 * testsuite/protected_3.cc: New file.
10096 * testsuite/protected_main_1.cc: New file.
10097 * testsuite/protected_main_2.cc: New file.
10098 * testsuite/protected_main_3.cc: New file.
10099 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10100 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10101 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10102 (protected_1.so): New target.
10103 (protected_1_pic.o, protected_2_pic.o): New targets.
10104 (protected_3_pic.o): New target.
10105 (check_PROGRAMS): Add protected_2.
10106 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10107 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10108 * testsuite/Makefile.in: Rebuild.
10109
2b706932
ILT
10110 * options.h (DEFINE_var): Add set_user_set_##varname__.
10111 (DEFINE_bool_alias): New macro.
10112 (class General_options): Define -Bstatic using DEFINE_bool_alias
10113 rather than DEFINE_special. Add --undefined as an alias for -z
10114 defs.
10115 * options.cc (General_options::parse_Bstatic): Remove.
10116
d82a5bcc
ILT
10117 * options.h (class General_options): Add --fatal-warnings.
10118 * main.cc (main): Implement --fatal-warnings.
10119 * errors.h (Errors::warning_count): New function.
10120
f1f70eae
ILT
10121 * options.h (class General_options): Add -Bsymbolic-functions.
10122 * symtab.h (Symbol::is_preemptible): Check for
10123 -Bsymbolic-functions.
10124
8825ac63
ILT
101252008-05-05 Ian Lance Taylor <iant@google.com>
10126
d98bc257
ILT
10127 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10128 as noVARNAME rather than no-VARNAME.
10129 (class General_options): Add option -z combreloc.
10130 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10131 get_address.
10132 (Output_reloc::sort_before) [SHT_REL]: New function.
10133 (Output_reloc::sort_before) [SHT_RELA]: New function.
10134 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10135 Sort_relocs_comparison.
10136 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10137 parameter. Change all callers.
10138 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10139 sort_relocs parameter. Change all callers.
10140 * output.cc (Output_reloc::get_address): New function, broken out
10141 of write_rel.
10142 (Output_reloc::write_rel): Call it.
10143 (Output_reloc::compare): New function.
10144 (Output_data_reloc_base::do_write): Optionally sort relocs.
10145
60b2b4e7
ILT
10146 * configure.ac: If targ_extra_obj is set, link it in.
10147 * configure.tgt: Initialize all variables.
10148 (x86_64*): Set targ_extra_obj and targ_extra_size.
10149 * configure: Rebuild.
10150
8825ac63
ILT
10151 * object.cc (Sized_relobj::include_section_group): Adjust section
10152 indexes read from group data. Build vector to pass to
10153 layout_group.
10154 * layout.cc (Layout::layout_group): Add flags and shndxes
10155 parameters. Remove contents parameter. Change caller. Update
10156 explicit instantiations.
10157 * layout.h (class Layout): Update layout_group declaration.
10158 * output.cc (Output_data_group::Output_data_group): Add flags and
10159 input_shndxes parameters. Remove contents parameter. Change
10160 caller.
10161 (Output_data_group::do_write): Change input_sections_ to
10162 input_shndxes_.
10163 * output.h (class Output_data_group): Update constructor
10164 declaration. Rename input_sections_ to input_shndxes_.
10165 * testsuite/many_sections_test.cc: Add template.
10166
e94cf127
CC
101672008-04-30 Cary Coutant <ccoutant@google.com>
10168
4418b2d5
CC
10169 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10170
e94cf127
CC
10171 * layout.cc (Layout::include_section): Refactored check for debug
10172 info section.
10173 (Layout::add_comdat): Add new parameters. Change type
10174 of signature parameter. Add object and shndx to signatures table.
10175 (Layout::find_kept_object): New function.
10176 * layout.h: Include <cstring>.
10177 (Layout::is_debug_info_section): New function.
10178 (Layout::add_comdat): Add new parameters.
10179 (Layout::find_kept_object): New function.
10180 (Layout::Kept_section): New struct.
10181 (Layout::Signatures): Change type of map range.
10182 * object.cc (Relobj::output_section_address): New function.
10183 (Sized_relobj::include_section_group): Add new parameters. Change
10184 calls to Layout::add_comdat. Change to build table of kept comdat
10185 groups and table mapping discarded sections to kept sections.
10186 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10187 (Sized_relobj::do_layout): Change calls to include_section_group and
10188 include_linkonce_section.
10189 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10190 value to zero when section is discarded.
10191 (Sized_relobj::map_to_kept_section): New function.
10192 * object.h (Relobj::output_section_address): New function.
10193 (Relobj::Comdat_group): New type.
10194 (Relobj::find_comdat_group): New function.
10195 (Relobj::Comdat_group_table): New type.
10196 (Relobj::Kept_comdat_section): New type.
10197 (Relobj::Kept_comdat_section_table): New type.
10198 (Relobj::add_comdat_group): New function.
10199 (Relobj::set_kept_comdat_section): New function.
10200 (Relobj::get_kept_comdat_section): New function.
10201 (Relobj::comdat_groups_): New field.
10202 (Relobj::kept_comdat_sections_): New field.
10203 (Symbol_value::input_value): Update comment.
10204 (Sized_relobj::map_to_kept_section) New function.
10205 (Sized_relobj::include_linkonce_section): Add new parameter.
10206 * target-reloc.h (Comdat_behavior): New type.
10207 (get_comdat_behavior): New function.
10208 (relocate_section): Add code to map a discarded section to the
10209 corresponding kept section when applying a relocation.
10210
e4e5049b
CS
102112008-04-30 Craig Silverstein <csilvers@google.com>
10212
10213 * dwarf_reader.cc (next_generation_count): New static var.
10214 (Addr2line_cache_entry): New struct.
10215 (addr2line_cache): New static var.
10216 (Dwarf_line_info::one_addr2line): Added caching.
10217 (Dwarf_line_info::clear_addr2line_cache): New function.
10218 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
10219 cache-size parameter.
10220 (Dwarf_line_info::one_addr2line_cache): New function.
10221 * symtab.cc (Symbol_table::detect_odr_violations): Pass
10222 new cache-size argument to one_addr2line(), and clear cache.
10223
d09e9154
CC
102242008-04-28 Cary Coutant <ccoutant@google.com>
10225
10226 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
10227 R_386_PC8 relocations.
10228
7ef73768
ILT
102292008-04-23 Ian Lance Taylor <iant@google.com>
10230
55438702
ILT
10231 * object.cc (Sized_relobj::include_section_group): Check for
10232 invalid section group.
10233
c165fb93
ILT
10234 * object.cc (make_elf_object): Correct test for 64-bit ELF file
10235 header size.
10236
7ef73768
ILT
10237 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
10238 than read for file header.
10239 * archive.cc (Archive::include_member): Likewise.
10240
6194aaab
L
102412008-04-23 Paolo Bonzini <bonzini@gnu.org>
10242
10243 * aclocal.m4: Regenerate.
10244 * configure: Regenerate.
10245
d491d34e
ILT
102462008-04-19 Ian Lance Taylor <iant@google.com>
10247
5ea2bac6
ILT
10248 * version.cc (version_string): Bump to 1.6.
10249
7bc3e21a
ILT
10250 * testsuite/Makefile.am (many_sections_r_test): New target.
10251 (many_sections_r_test_SOURCES): Remove.
10252 (many_sections_r_test_DEPENDENCIES): Remove.
10253 (many_sections_r_test_LDFLAGS): Remove.
10254 (many_sections_r_test_LDADD): Remove.
10255
7fcd3aa9
ILT
10256 * object.cc (Sized_relobj::do_add_symbols): Always pass
10257 local_symbol_count_ to add_from_relobj.
10258
4c94d6ae
ILT
10259 * testsuite/Makefile.am (many_sections_check.h): Only check one in
10260 every thousand variables.
10261 * testsuite/Makefile.in: Rebuild.
10262
d491d34e
ILT
10263 * object.cc (Xindex::initialize_symtab_xindex): New function.
10264 (Xindex::read_symtab_xindex): New function.
10265 (Xindex::sym_xindex_to_shndx): New function.
10266 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
10267 available.
10268 (Sized_relobj::do_initialize_xindex): New function.
10269 (Sized_relobj::do_read_symbols): Adjust section links.
10270 (Sized_relobj::symbol_section_and_value): Add is_ordinary
10271 parameter. Change all callers.
10272 (Sized_relobj::include_section_group): Adjust section links and
10273 symbol section indexes.
10274 (Sized_relobj::do_layout): Adjust section links.
10275 (Sized_relobj::do_count_local_symbols): Adjust section links and
10276 symbol section indexes.
10277 (Sized_relobj::do_finalize_local_symbols): Distinguish between
10278 ordinary and special symbols.
10279 (Sized_relobj::write_local_symbols): Add symtab_xindex and
10280 dynsym_xindex parameters. Change all callers. Adjust section
10281 links. Use SHN_XINDEX when needed.
10282 (Sized_relobj::get_symbol_location_info): Adjust section links.
10283 Don't get fooled by special symbols.
10284 * object.h (class Xindex): Define.
10285 (class Object): Add xindex_ parameter. Declare virtual functoin
10286 do_initialize_xindex.
10287 (Object::adjust_sym_shndx): New function.
10288 (Object::set_xindex): New protected function.
10289 (class Symbol_value): Add is_ordinary_shndx_ field.
10290 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
10291 (Symbol_value::value): Assert ordinary section.
10292 (Symbol_value::initialize_input_to_output_map): Likewise.
10293 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
10294 Change all callers.
10295 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
10296 all callers.
10297 (class Sized_relobj): Update declarations.
10298 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
10299 parameter. Change all callers.
10300 (Sized_relobj::adjust_shndx): New function.
10301 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
10302 field.
10303 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
10304 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
10305 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
10306 (Sized_dynobj::read_dynsym_section): Adjust section links.
10307 (Sized_dynobj::read_dynamic): Likewise.
10308 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
10309 section links.
10310 (Sized_dynobj::do_initialize_xindex): New function.
10311 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
10312 do_initialize_xindex.
10313 (Sized_dynobj::adjust_shndx): New function.
10314 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
10315 dynsym_xindex_ fields.
10316 (Layout::finalize): Add a call to set_section_indexes before
10317 creating the symtab sections.
10318 (Layout::set_section_indexes): Don't do anything if the section
10319 already has a section index.
10320 (Layout::create_symtab_sections): Add shnum parameter. Change
10321 caller. Create .symtab_shndx section if needed.
10322 (Layout::create_shdrs): Add shstrtab_section parameter. Change
10323 caller.
10324 (Layout::allocated_output_section_count): New function.
10325 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
10326 needed.
10327 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
10328 fields. Update declarations.
10329 (Layout::symtab_xindex): New function.
10330 (Layout::dynsym_xindex): New function.
10331 (class Write_symbols_task): Add layout_ field.
10332 (Write_symbols_task::Write_symbols_task): Add layout parameter.
10333 Change caller.
10334 * output.cc (Output_section_headers::Output_section_headers): Add
10335 shstrtab_section parameter. Change all callers.
10336 (Output_section_headers::do_sized_write): Store overflow values
10337 for section count and section string table section index in
10338 section header zero.
10339 (Output_file_header::do_sized_write): Check for overflow of
10340 section count and section string table section index.
10341 (Output_symtab_xindex::do_write): New function.
10342 (Output_symtab_xindex::endian_do_write): New function.
10343 * output.h (class Output_section_headers): Add shstrtab_section_.
10344 Update declarations.
10345 (class Output_symtab_xindex): Define.
10346 (Output_section::has_out_shndx): New function.
10347 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
10348 field.
10349 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
10350 Change all callers.
10351 (Sized_symbol::init): Likewise.
10352 (Symbol::output_section): Check for ordinary symbol.
10353 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
10354 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
10355 callers.
10356 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
10357 Change all callers. Simplify handling of symbols from sections
10358 not included in the link.
10359 (Symbol_table::add_from_dynobj): Handle ordinary symbol
10360 distinction.
10361 (Weak_alias_sorter::operator()): Assert that symbols are
10362 ordinary.
10363 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
10364 distinction.
10365 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
10366 parameters. Change all callers.
10367 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
10368 symbol distinction. Use SHN_XINDEX when needed.
10369 (Symbol_table::write_section_symbol): Add symtab_xindex
10370 parameter. Change all callers.
10371 (Symbol_table::sized_write_section_symbol): Likewise. Use
10372 SHN_XINDEX when needed.
10373 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
10374 declarations.
10375 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
10376 (Symbol::is_defined): Check is_ordinary.
10377 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
10378 (Symbol::is_absolute, Symbol::is_common): Likewise.
10379 (class Sized_symbol): Update declarations.
10380 (class Symbol_table): Update declarations.
10381 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
10382 parameters. Change all callers.
10383 (Sized_symbol::override): Likewise.
10384 (Symbol_table::override): Likewise.
10385 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
10386 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
10387 is_ordinary, and orig_st_shndx parameters. Change all callers.
10388 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
10389 to be in an ordinary section.
10390 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
10391 object and is_ordinary parameters. Change all callers.
10392 (Sized_dwarf_line_info::read_relocs): Add object parameter.
10393 Change all callers. Don't add undefined or non-ordinary symbols
10394 to reloc_map_.
10395 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
10396 Change all callers.
10397 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10398 declarations.
10399 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10400 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10401 (Sized_relobj::relocate_sections): Likewise.
10402 * target-reloc.h (scan_relocs): Adjust section symbol index.
10403 (scan_relocatable_relocs): Likewise.
10404 * i386.cc (Scan::local): Check for ordinary symbols.
10405 * sparc.cc (Scan::local): Likewise.
10406 * x86_64.cc (Scan::local): Likewise.
10407 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10408 to symbol_section_and_value.
10409 * testsuite/many_sections_test.cc: New file.
10410 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10411 (check_PROGRAMS): Add many_sections_test.
10412 (many_sections_test_SOURCES): Define.
10413 (many_sections_test_DEPENDENCIES): Define.
10414 (many_sections_test_LDFLAGS): Define.
10415 (BUILT_SOURCES): Add many_sections_define.h.
10416 (many_sections_define.h): New target.
10417 (BUILT_SOURCES): Add many_sections_check.h.
10418 (many_sections_check.h): New target.
10419 (check_PROGRAMS): Add many_sections_r_test.
10420 (many_sections_r_test_SOURCES): Define.
10421 (many_sections_r_test_DEPENDENCIES): Define.
10422 (many_sections_r_test_LDFLAGS): Define.
10423 (many_sections_r_test_LDADD): Define.
10424 (many_sections_r_test.o): New target.
10425 * testsuite/Makefile.in: Rebuild.
10426
c5818ff1
CC
104272008-04-17 Cary Coutant <ccoutant@google.com>
10428
10429 * errors.cc (Errors::info): New function.
10430 (gold_info): New function.
10431 * errors.h (Errors::info): New function.
10432 * gold.h (gold_info): New function.
10433 * object.cc (Input_objects::add_object): Print trace output.
10434 * options.cc (options::parse_set): New function.
10435 (General_options::parse_wrap): Deleted.
10436 (General_options::General_options): Deleted initializer.
10437 * options.h (options::String_set): New typedef.
10438 (options::parse_set): New function.
10439 (DEFINE_set): New macro.
10440 (General_options::wrap): Changed to use DEFINE_set. Changed
10441 callers of any_wrap_symbols and is_wrap_symbol.
10442 (General_options::trace, General_options::trace_symbol):
10443 New options.
10444 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10445 (General_options::wrap_symbols_): Deleted.
10446 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10447
b5be4a7c
DM
104482008-04-17 David S. Miller <davem@davemloft.net>
10449
10450 * options.cc (General_options::parse_V): New function.
10451 * options.h: Add entries for -V and -Qy.
10452
155a0dd7
ILT
104532008-04-17 Ian Lance Taylor <iant@google.com>
10454
10455 * common.cc (Symbol_table::allocate_commons): Remove options
10456 parameter. Change caller.
10457 (Symbol_table::do_allocate_commons): Remove options parameter.
10458 Change caller. Just call do_allocate_commons_list twice.
10459 (Symbol_table::do_allocate_commons_list): New function, broken out
10460 of do_allocate_commons.
10461 * common.h (class Allocate_commons_task): Remove options_ field.
10462 Update constructor.
10463 * symtab.cc (Symbol_table::Symbol_table): Initialize
10464 tls_commons_.
10465 (Symbol_table::add_from_object): Put TLS common symbols on
10466 tls_commons_ list.
10467 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10468 which are IN_OUTPUT_DATA.
10469 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10470 allocate_commons and do_allocate_commons declarations. Declare
10471 do_allocate_commons_list.
10472 * gold.cc (queue_middle_tasks): Update creation of
10473 Allocate_commons_task to not pass options.
10474 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10475 (TLS_TEST_C_FLAGS): New variable.
10476 (tls_test_c_pic.o): New target.
10477 (tls_test_shared.so): Link in tls_test_c_pic.o.
10478 (tls_test_c_pic_ie.o): New target.
10479 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10480 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10481 (tls_test_c.o): New target.
10482 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10483 (tls_pic_test_LDADD): Likewise.
10484 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10485 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10486 (tls_test_c_gnu2.o): New target.
10487 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10488 tls_test_c_gnu2.o.
10489 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10490 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10491 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10492 * testsuite/tls_test.cc: Include "config.h".
10493 (t_last): Call t11_last.
10494 * testsuite/tls_test.h (t11, t11_last): Declare.
10495 * testsuite/tls_test_c.c: New file.
10496 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10497 * configure.ac: Check for OpenMP support.
10498 * configure, config.in, Makefile.in: Rebuild.
10499 * testsuite/Makefile.in: Rebuild.
10500
edfbb029
CC
105012008-04-16 Cary Coutant <ccoutant@google.com>
10502
10503 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10504 (Target_i386::tls_base_symbol_defined_): New field.
10505 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10506 (Target_i386::Scan::global): Likewise.
10507 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10508 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10509 (Target_x86_64::tls_base_symbol_defined_): New field.
10510 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10511 (Target_x86_64::Scan::global): Likewise.
10512
f3c69fca
CC
105132008-04-16 Cary Coutant <ccoutant@google.com>
10514
10515 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10516 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10517 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10518 building shared libraries.
10519 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10520 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10521 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10522 * testsuite/Makefile.in: Rebuild.
10523 * testsuite/weak_undef.h: New file.
10524 * testsuite/weak_undef_file1.cc: Add extra test cases.
10525 * testsuite/weak_undef_file2.cc: Likewise.
10526 * testsuite/weak_undef_test.cc: Likewise.
10527
7c414435
DM
105282008-04-16 David S. Miller <davem@davemloft.net>
10529
32b769e1
DM
10530 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10531 Add issued_non_pic_error_ field. Declare check_non_pic.
10532 (Target_sparc::Scan::check_non_pic): New function.
10533 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10534 (Target_sparc::Scan::global): Likewise.
10535
11936fb1
DM
10536 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10537 * configure: Rebuild.
10538
7c414435
DM
10539 * options.h (DEFINE_enable): New macro.
10540 (new_dtags): New enable option.
10541 (initfirst, interpose, loadfltr, nodefaultlib,
10542 nodelete, nodlopen, nodump): New -z options.
10543 * layout.cc (Layout:finish_dynamic_section): If new
10544 dtags enabled, emit DT_RUNPATH. Also, emit a
10545 DT_FLAGS_1 containing any specified -z flags.
10546
85c7bf8b
ILT
105472008-04-16 Ian Lance Taylor <iant@google.com>
10548
12c0daef
ILT
10549 * copy-relocs.cc: New file.
10550 * copy-relocs.h: New file.
10551 * reloc.cc: Remove Copy_relocs code.
10552 * reloc.h: Likewise.
10553 * reloc-types.h (struct Reloc_types) [both versions]: Add
10554 get_reloc_addend_noerror.
10555 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10556 variants of add_global which take an addend which must be zero.
10557 * i386.cc: Include "copy-relocs.h".
10558 (class Target_i386): Change type of copy_relocs_ to variable,
10559 update initializer.
10560 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10561 Change all callers.
10562 (Target_i386::do_finalize_sections): Change handling of
10563 copy_relocs_.
10564 * sparc.cc: Include "copy-relocs.h".
10565 (class Target_sparc): Change type of copy_relocs_ to variable,
10566 update initializer.
10567 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10568 Change all callers.
10569 (Target_sparc::do_finalize_sections): Change handling of
10570 copy_relocs_.
10571 * x86_64.cc: Include "copy-relocs.h".
10572 (class Target_x86_64): Change type of copy_relocs_ to variable,
10573 update initializer.
10574 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10575 class. Change all callers.
10576 (Target_x86_64::do_finalize_sections): Change handling of
10577 copy_relocs_.
10578 * Makefile.am (CCFILES): Add copy-relocs.cc.
10579 (HFILES): Add copy-relocs.h.
10580
4f4995b6
ILT
10581 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10582
85c7bf8b
ILT
10583 * testsuite/script_test_4.sh: Permit leading zeroes.
10584
4f2a9edd
ILT
105852008-04-15 Ian Lance Taylor <iant@google.com>
10586
e6188289
ILT
10587 * script-sections.cc (Script_sections::create_segments): Use
10588 header_size_adjustment even when there is enough room for the
10589 headers.
10590 * testsuite/script_test_4.sh: New file.
10591 * testsuite/script_test_4.t: New file.
10592 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10593 (check_DATA): Add script_test_4.stdout.
10594 (MOSTLYCLEANFILES): Likewise.
10595 (script_test_4): New target.
10596 (script_test_4.stdout): New target.
10597 * testsuite/Makefile.in: Rebuild.
10598
4f2a9edd
ILT
10599 * sparc.cc: Add definitions for Output_data_plt_sparc class
10600 constants.
10601
f5314dd5
DM
106022008-04-14 David S. Miller <davem@davemloft.net>
10603
10604 * sparc.cc: New file.
10605 * Makefile.am (TARGETSOURCES): Add sparc.cc
10606 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10607 * configure.tgt: Document targ_extra_size and
10608 targ_extra_big_endian. Add entries for sparc-* and
10609 sparc64-*.
10610 * configure.ac: Handle targ_extra_size and
10611 targ_extra_big_endian.
10612 * Makefile.in: Rebuild.
10613 * configure: Likewise.
10614 * po/POTFILES.in: Likewise.
10615 * po/gold.pot: Likewise.
10616
154e0e9a
ILT
106172008-04-14 Ian Lance Taylor <iant@google.com>
10618
10619 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10620 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10621 in the name/type/flags to section mapping. Don't call
10622 allocate_output_section.
10623 (Layout::choose_output_section): Change parameter from adjust_name
10624 to is_input_section. Don't permit input sections after sections
10625 are attached to segments. Don't call allocate_output_section.
10626 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10627 not write_enable_output_section.
10628 (Layout::make_output_section): Don't push to
10629 unattached_section_list_ nor call attach_to_segment. Call
10630 attach_section_to_segment if sections are attached.
10631 (Layout::attach_sections_to_segments): New function.
10632 (Layout::attach_section_to_segment): New function.
10633 (Layout::attach_allocated_section_to_segment): Rename from
10634 attach_to_segment. Remove flags parameter.
10635 (Layout::allocate_output_section): Remove function.
10636 (Layout::write_enable_output_section): Remove function.
10637 * layout.h (class Layout): Update for above changes. Add new
10638 field sections_are_attached_.
10639 * output.h (Output_section::update_flags_for_input_section): New
10640 function.
10641 * output.cc (Output_section::add_input_section): Call
10642 update_flags_for_input_section.
10643 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10644
009a67a2
CC
106452008-04-11 Cary Coutant <ccoutant@google.com>
10646
10647 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10648 thought unnecessary.
10649 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10650
759b1a24
ILT
106512008-04-11 Ian Lance Taylor <iant@google.com>
10652
10653 * output.h (class Output_section_data): Remove inline definition
10654 of set_addralign.
10655 * output.cc (Output_section_data::set_addralign): New function.
10656
c2b45e22
CC
106572008-04-11 Cary Coutant <ccoutant@google.com>
10658
10659 Add support for TLS descriptors for i386 and x86_64.
10660 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10661 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10662 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10663 GOT_TYPE_TLS_DESC.
10664 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10665 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10666 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10667 relocations.
10668 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10669 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10670 Fix problem with initial-exec relocations.
10671 (Target_i386::Relocate::relocate_tls): Likewise.
10672 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10673 relaxation.
10674 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10675 support for section-plus-offset dynamic table entries.
10676 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10677 (Output_data_dynamic::Dynamic_entry): Add support for
10678 section-plus-offset dynamic table entries.
10679 (Output_data_dynamic::Classification): Likewise.
10680 (Output_data_dynamic::classification_): Renamed offset_.
10681 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10682 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10683 (Target_x86_64::make_plt_section): New function.
10684 (Target_x86_64::reserve_tlsdesc_entries): New function.
10685 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10686 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10687 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10688 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10689 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10690 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10691 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10692 add extra PLT entry for TLS descriptors.
10693 (Output_data_plt_x86_64::got_): New field.
10694 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10695 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10696 fields.
10697 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10698 descriptors.
10699 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10700 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10701 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10702 R_386_TLS_DESC_CALL relocations.
10703 (Target_x86_64::Scan::global): Likewise.
10704 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10705 for TLS descriptors.
10706 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10707 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10708 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10709 GD-to-IE relaxation.
10710 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10711 and TLS_DESCRIPTORS.
10712 * Makefile.in: Rebuild.
10713 * configure: Rebuild.
10714 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10715 (tls_test_shared2.so): New target.
10716 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10717 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10718 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10719 (tls_shared_gd_to_ie_test_LDADD): New variable.
10720 (tls_shared_gnu2_gd_to_ie_test): New target.
10721 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10722 New targets.
10723 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10724 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10725 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10726 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10727 (tls_shared_gnu2_test): New target.
10728 (tls_test_gnu2_shared.so): New target.
10729 (tls_shared_gnu2_test_SOURCES): New variable.
10730 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10731 (tls_shared_gnu2_test_LDFLAGS): New variable.
10732 (tls_shared_gnu2_test_LDADD): New variable.
10733 * testsuite/Makefile.in: Rebuild.
10734 * testsuite/Makefile.
10735
83bfb6b7
ILT
107362008-04-11 Ian Lance Taylor <iant@google.com>
10737
10738 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10739 justsyms.t.
10740 * testsuite/Makefile.in: Rebuild.
10741
10742 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10743 long.
10744 * testsuite/script_test_2.cc (main): Adjust test.
10745
706e1f5e
ILT
107462008-04-11 David S. Miller <davem@davemloft.net>
10747 Ian Lance Taylor <iant@google.com>
10748
10749 * options.h (General_options): Add entries for '-Y' and
10750 '-relax'.
10751 * options.cc (General_options:finalize): If -Y was used, add those
10752 entries to the library path instead of the default "/lib" and
10753 "/usr/lib".
10754
7c98e6bb
DM
107552008-04-11 David S. Miller <davem@davemloft.net>
10756
10757 * testsuite/justsyms.t: Start at 0x100.
10758 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10759 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10760 long.
10761 * testsuite/script_test_2.cc: Adjust string and section length
10762 checks.
7c98e6bb 10763
99a37bfd
ILT
107642008-04-09 Ian Lance Taylor <iant@google.com>
10765
2cefc357
ILT
10766 PR gold/5996
10767 * script-sections.cc (Sections_element::allocate_to_segment): Add
10768 orphan parameter.
10769 (Output_section_definition::allocate_to_segment): Likewise.
10770 (Orphan_output_section::allocate_to_segment): Likewise.
10771 (Script_sections::attach_sections_using_phdrs_clause): Don't
10772 propagate non-PT_LOAD segments to orphan sections.
10773 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10774 readelf rather than objdump.
10775 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10776 .interp section and PT_INTERP segment are the same size.
10777 * testsuite/Makefile.in: Rebuild.
10778
99a37bfd
ILT
10779 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10780 aliases for symbols defined in the same object.
10781 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10782 (weak_alias_test_SOURCES): New variable.
10783 (weak_alias_test_DEPENDENCIES): New variable.
10784 (weak_alias_test_LDFLAGS): New variable.
10785 (weak_alias_test_LDADD): New variable.
10786 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10787 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10788 (weak_alias_test_3.o): New target.
10789 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10790 * testsuite/weak_alias_test_main.cc: New file.
10791 * testsuite/weak_alias_test_1.cc: New file.
10792 * testsuite/weak_alias_test_2.cc: New file.
10793 * testsuite/weak_alias_test_3.cc: New file.
10794
780e49c5
ILT
107952008-04-08 Ian Lance Taylor <iant@google.com>
10796
cdb0b8f5
ILT
10797 * options.h (class General_options): Add --noinhibit-exec option.
10798 * main.cc (main): Check --noinhibit-exec.
10799
0864d551
ILT
10800 * options.h (class General_options): Define --wrap as a special
10801 option. Add wrap_symbols_ field.
10802 (General_options::any_wrap_symbols): New function.
10803 (General_options::is_wrap_symbol): New function.
10804 * options.cc (General_options::parse_wrap): New function.
10805 (General_options::General_options): Initialize wrap_symbols_.
10806 * symtab.cc (Symbol_table::wrap_symbol): New function.
10807 (Symbol_table::add_from_object): Handle --wrap.
10808 * symtab.h (class Symbol_table): Declare wrap_symbol.
10809 * target.h (Target::wrap_char): New function.
10810 (Target::Target_info): Add wrap_char field.
10811 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10812 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10813 * testsuite/testfile.cc (Target_test::test_target_info):
10814 Likewise.
10815
789aa6de
ILT
10816 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10817 there is one.
10818
2c38906f
ILT
10819 * layout.h (class Layout): Add added_eh_frame_data_ field.
10820 * layout.cc (Layout::Layout): Initialize new field.
10821 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10822 output section until we find a section we merged successfully.
10823 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10824 that the size be non-zero.
10825
780e49c5
ILT
10826 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10827 qualifier.
10828
7fcd0256
ILT
108292008-04-08 Craig Silverstein <csilvers@google.com>
10830
10831 * configure.ac: Export new conditional variable HAVE_ZLIB.
10832 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10833 on HAVE_ZLIB.
10834 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10835 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10836
6835af53
ILT
108372008-04-07 Ian Lance Taylor <iant@google.com>
10838
e24f324c
ILT
10839 * version.cc (version_string): Set to "1.5".
10840
a036edd8
ILT
10841 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10842 Add issued_non_pic_error_ field. Declare check_non_pic.
10843 (Target_x86_64::Scan::check_non_pic): New function.
10844 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10845 (Target_x86_64::Scan::global): Likewise.
10846
624f8810
ILT
10847 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10848 addend parameter. Change caller. Handle merge sections.
10849 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10850 Address to Addend. Don't add in the result of
10851 local_section_offset, pass down the addend and use the returned
10852 value.
10853 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10854 Update declarations of local_section_offset and symbol_value.
10855 * testsuite/two_file_test_1.cc (t18): New function.
10856 * testsuite/two_file_test_2.cc (f18): New function.
10857 * testsuite/two_file_test_main.cc (main): Call t18.
10858 * testsuite/two_file_test.h (t18, f18): Declare.
10859
6835af53
ILT
10860 * configure.ac: Don't test for objdump, c++filt, or readelf.
10861 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10862 conditionals.
10863 (TEST_READELF): New variable.
10864 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10865 (check_PROGRAMS): Add two_file_strip_test.
10866 (two_file_strip_test): New target.
10867 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10868 (two_file_same_shared_strip_test_SOURCES): New variable.
10869 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10870 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10871 (two_file_same_shared_strip_test_LDADD): New variable.
10872 (two_file_shared_strip.so): New target.
10873 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10874 (ver_test_5.syms, ver_test_7.syms): Likewise.
10875 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10876 (strip_test_3.stdout): Use TEST_OBJDUMP.
10877 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10878
86925eef
CC
108792008-04-04 Cary Coutant <ccoutant@google.com>
10880
10881 * symtab.h (Symbol::is_weak_undefined): New function.
10882 (Symbol::is_strong_undefined): New function.
10883 (Symbol::is_absolute): New function.
10884 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10885 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10886 absolute symbols.
10887 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10888 (weak_undef_test): New target.
10889 * testsuite/Makefile.in: Rebuild.
10890 * testsuite/weak_undef_file1.cc: New file.
10891 * testsuite/weak_undef_file2.cc: New file.
10892 * testsuite/weak_undef_test.cc: New file.
10893
126f3ece
ILT
108942008-04-03 Craig Silverstein <csilvers@google.com>
10895
10896 * compressed_output.h (class Output_compressed_section): Use
10897 unsigned buffer.
10898 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10899 add zlib header.
10900 (zlib_compressed_suffix): Removed.
10901 (Output_compressed_section::set_final_data_size): Use unsigned
10902 buffers.
10903 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10904 Fix linker invocation.
10905 (flagstest_o_specialfile_and_compress_debug_sections):
10906 Likewise.
10907 * testsuite/Makefile.in: Regenerated.
10908
deae2a14
DM
109092008-04-02 David S. Miller <davem@davemloft.net>
10910
10911 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10912 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10913
70752818
ILT
109142008-04-02 Craig Silverstein <csilvers@google.com>
10915
10916 * TODO: New file.
10917
39d0cb0e
ILT
109182008-04-02 Ian Lance Taylor <iant@google.com>
10919
10920 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10921 parameters. Update for new key type to views_. Change all
10922 callers.
10923 (File_read::read): Adjust for byteshift in returned view.
10924 (File_read::add_view): New function, broken out of
10925 find_and_make_view.
10926 (File_read::make_view): New function, broken out of
10927 find_and_make_view.
10928 (File_read::find_or_make_view): Add offset and aligned
10929 parameters. Rewrite accordingly. Change all callers.
10930 (File_read::get_view): Add offset and aligned parameters. Adjust
10931 for byteshift in return value.
10932 (File_read::get_lasting_view): Likewise.
10933 * fileread.h (class File_read): Update declarations.
10934 (class File_read::View): Add byteshift_ field. Add byteshift to
10935 constructor. Add byteshift method.
10936 * archive.h (Archive::clear_uncached_views): New function.
10937 (Archive::get_view): Add aligned parameter. Change all callers.
10938 * object.h (Object::get_view): Add aligned parameter. Change all
10939 callers.
10940 (Object::get_lasting_view): Likewise.
10941
10942 * fileread.cc (File_read::release): Don't call clear_views if
10943 there are multiple objects.
10944 * fileread.h (File_read::clear_uncached_views): New function.
10945 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10946 on the archive.
10947
a1207466
CC
109482008-03-31 Cary Coutant <ccoutant@google.com>
10949
10950 Add thin archive support.
10951 * archive.cc (Archive::armagt): New const.
10952 (Archive::setup): Remove task parameter and calls to unlock.
10953 (Archive::unlock_nested_archives): New function.
10954 (Archive::read_header): Add nested_off parameter. Change
10955 all callers.
10956 (Archive::interpret_header): Likewise.
10957 (Archive::include_all_members): Change to handle thin
10958 archives.
10959 (Archive::include_member): Likewise.
10960 * archive.h (Archive::Archive): Add new parameters and
10961 initializers.
10962 (Archive::armagt): New const.
10963 (Archive::setup): Remove task parameter.
10964 (Archive::unlock_nested_archives): New function.
10965 (Archive::read_header): Add nested_off parameter.
10966 (Archive::interpret_header): Likewise.
10967 (Archive::Nested_archive_table): New typedef.
10968 (Archive::is_thin_archive_): New field.
10969 (Archive::nested_archives_): New field.
10970 (Archive::options_): New field.
10971 (Archive::dirpath_): New field.
10972 (Archive::task_): New field.
10973 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10974 for thin archives. Pass additional parameters to
10975 Archive::Archive. Unlock the archive file after calling
10976 Archive::setup.
cd536b21 10977
479f6503
ILT
109782008-03-29 Ian Lance Taylor <iant@google.com>
10979
686c8caf
ILT
10980 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10981 version symbol to be local.
10982 * testsuite/ver_test_4.sh: New file.
10983 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10984 (check_DATA): Add ver_test_4.syms.
10985 (ver_test_4.syms): New target.
10986 * testsuite/Makefile.in: Rebuild.
10987
ab794b6b
ILT
10988 * output.cc
10989 (Output_section::Input_section_sort_entry::has_priority): New
10990 function.
10991 (Output_section::Input_section_sort_entry::match_file_name): New
10992 function.
10993 (Output_section::Input_section_sort_entry::match_section_name):
10994 Remove.
10995 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10996 Remove.
10997 (Output_section::Input_section_sort_entry::match_section_file):
10998 Remove.
10999 (Output_section::Input_section_sort_compare::operator()): Rewrite
11000 using new Input_section_sort_entry functions. Sort crtbegin and
11001 crtend first. Sort sections with no priority before sections with
11002 a priority.
11003 * testsuite/initpri1.c (d3): Check j != 4.
11004 (cd5): New constructor/destructor function.
11005 (main): Check j != 2.
11006
479f6503
ILT
11007 * symtab.cc (Symbol_table::add_from_object): If we don't use the
11008 new symbol when resolving, don't call set_is_default.
11009 * testsuite/ver_test_7.cc: New file.
11010 * testsuite/ver_test_7.sh: New file.
11011 * testsuite/Makefile.am (ver_test_7.so): New target.
11012 (ver_test_7.o): New target.
11013 (check_SCRIPTS): Add ver_test_7.sh.
11014 (check_DATA): Add ver_test_7.syms.
11015 (ver_test_7.syms): New target.
11016
2fd32231
ILT
110172008-03-28 Ian Lance Taylor <iant@google.com>
11018
11019 * layout.cc (Layout::layout): If we see an input section with a
11020 name that needs sorting, set the must_sort flag for the output
11021 section.
11022 (Layout::make_output_section): If the name of the output section
11023 indicates that it might require sorting, set the may_sort flag.
11024 * output.h (Output_section::may_sort_attached_input_sections): New
11025 function.
11026 (Output_section::set_may_sort_attached_input_sections): New
11027 function.
11028 (Output_section::must_sort_attached_input_sections): New
11029 function.
11030 (Output_section::set_must_sort_attached_input_sections): New
11031 function.
11032 (class Output_section): Declare Input_section_sort_entry. Define
11033 Input_section_sort_compare. Declare
11034 sort_attached_input_sections. Add new fields:
11035 may_sort_attached_input_sections_,
11036 must_sort_attached_input_sections_,
11037 attached_input_sections_are_sorted_.
11038 * output.cc (Output_section::Output_section): Initialize new
11039 fields.
11040 (Output_section::add_input_section): Add an entry to
11041 input_sections_ if may_sort or must_sort are true.
11042 (Output_section::set_final_data_size): Call
11043 sort_attached_input_sections if necessary.
11044 (Output_section::Input_section_sort_entry): Define new class.
11045 (Output_section::Input_section_sort_compare::operator()): New
11046 function.
11047 (Output_section::sort_attached_input_sections): New function.
11048 * configure.ac: Check whether the compiler supports constructor
11049 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
11050 * testsuite/initpri1.c: New file.
11051 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
11052 CONSTRUCTOR_PRIORITY.
11053 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
11054 (initpri1_LDFLAGS): New variable.
11055 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
11056
18e6b24e
ILT
110572008-03-27 Ian Lance Taylor <iant@google.com>
11058
49bdd526
ILT
11059 * common.cc (Sort_commons::operator): Correct sorting algorithm.
11060 * testsuite/common_test_1.c: New file.
11061 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11062 (common_test_1_SOURCES): New variable.
11063 (common_test_1_DEPENDENCIES): New variable.
11064 (common_test_1_LDFLAGS): New variable.
11065
18e6b24e
ILT
11066 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11067 and commons_ correctly when NAME/VERSION does not override
11068 NAME/NULL.
11069 * testsuite/ver_test_6.c: New file.
11070 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11071 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11072 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11073
04bf7072
ILT
110742008-03-26 Ian Lance Taylor <iant@google.com>
11075
5871526f
ILT
11076 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11077 of an undefined symbol from a version script.
11078 * testsuite/Makefile.am (ver_test_5.so): New target.
11079 (ver_test_5.o): New target.
11080 (check_SCRIPTS): Add ver_test_5.sh.
11081 (check_DATA): Add ver_test_5.syms.
11082 (ver_test_5.syms): New target.
11083 * testsuite/ver_test_5.cc: New file.
11084 * testsuite/ver_test_5.script: New file.
11085 * testsuite/ver_test_5.sh: New file.
11086 * Makefile.in, testsuite/Makefile.in: Rebuild.
11087
04bf7072
ILT
11088 PR gold/5986
11089 Fix problems building gold with gcc 4.3.0.
11090 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11091 (gold_error_at_location, gold_warning_at_location): Use it.
11092 * configure.ac: Check whether we can compile and use a template
11093 function with a printf attribute.
11094 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11095 when jumping over bytes.
11096 * object.cc: Instantiate Object::read_section_data.
11097 * debug.h: Include <cstring>
11098 * dwarf_reader.cc: Include <algorithm>
11099 * main.cc: Include <cstring>.
11100 * options.cc: Include <cstring>.
11101 * output.cc: Include <cstring>.
11102 * script.cc: Include <cstring>.
11103 * script.h: Include <string>.
11104 * symtab.cc: Include <cstring> and <algorithm>.
11105 * target-select.cc: Include <cstring>.
11106 * version.cc: Include <string>.
11107 * testsuite/testmain.cc: Include <cstdlib>.
11108 * configure, config.in: Rebuild.
11109
874c5b28
ILT
111102008-03-25 Ian Lance Taylor <iant@google.com>
11111
819d6c3a
ILT
11112 * options.cc: Include "../bfd/bfdver.h".
11113 (options::help): Print bug reporting address.
11114
f4b2c6f5
ILT
11115 * version.cc (print_version): Adjust output for current value of
11116 BFD_VERSION_STRING.
11117
11118 * NEWS: New file.
11119
e96caa79
ILT
11120 * options.cc (options::help): Print list of supported targets.
11121 * target-select.h: Include <vector>.
11122 (class Target_selector): Make machine_, size_, and is_big_endian_
11123 fields const. Add bfd_name_ and instantiated_target_ fields.
11124 (Target_selector::Target_selector): Add bfd_name parameter.
11125 (Target_selector::recognize): Make non-virtual, call
11126 do_recognize.
11127 (Target_selector::recognize_by_name): Make non-virtual, call
11128 do_recognize_by_name.
11129 (Target_selector::supported_names): New function.
11130 (Target_selector::bfd_name): New function.
11131 (Target_selector::do_instantiate_target): New pure virtual
11132 function.
11133 (Target_selector::do_recognize): New virtual function.
11134 (Target_selector::do_recognize_by_name): New virtual function.
11135 (Target_selector::instantiate_target): New private function.
11136 (supported_target_names): Declare.
11137 * target-select.cc (Target_selector::Target_selector): Update for
11138 new parameter and fields.
11139 (select_target_by_name): Check that the name matches before
11140 calling recognize_by_name.
11141 (supported_target_names): New function.
11142 * i386.cc (class Target_selector_i386): Update Target_selector
11143 constructor call. Remove recognize and recognize_by_name. Add
11144 do_instantiate_target.
11145 * x86_64.cc (class Target_selector_x86_64): Likewise.
11146 * testsuite/testfile.cc (class Target_selector_test): Update for
11147 changes to Target_selector.
11148
874c5b28
ILT
11149 * README: Rewrite, with some notes on unsupported features.
11150
0a65a3a7
CC
111512008-03-24 Cary Coutant <ccoutant@google.com>
11152
11153 * i386.cc (Target_i386::Got_type): New enum declaration.
11154 (Target_i386::Scan::local): Updated callers of Output_data_got
11155 member functions.
11156 (Target_i386::Scan::global): Likewise.
11157 (Target_i386::Relocate::relocate): Likewise.
11158 (Target_i386::Relocate::relocate_tls): Likewise.
11159 * object.h (Got_offset_list): New class.
11160 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11161 (Sized_relobj::local_got_offset): Likewise.
11162 (Sized_relobj::set_local_got_offset): Likewise.
11163 (Sized_relobj::local_has_tls_got_offset): Removed.
11164 (Sized_relobj::local_tls_got_offset): Removed.
11165 (Sized_relobj::set_local_tls_got_offset): Removed.
11166 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11167 * output.cc (Output_data_got::add_global): Added got_type parameter.
11168 (Output_data_got::add_global_with_rel): Likewise.
11169 (Output_data_got::add_global_with_rela): Likewise.
11170 (Output_data_got::add_global_pair_with_rel): New function.
11171 (Output_data_got::add_global_pair_with_rela): New function.
11172 (Output_data_got::add_local): Added got_type parameter.
11173 (Output_data_got::add_local_with_rel): Likewise.
11174 (Output_data_got::add_local_with_rela): Likewise.
11175 (Output_data_got::add_local_pair_with_rel): New function.
11176 (Output_data_got::add_local_pair_with_rela): New function.
11177 (Output_data_got::add_global_tls): Removed.
11178 (Output_data_got::add_global_tls_with_rel): Removed.
11179 (Output_data_got::add_global_tls_with_rela): Removed.
11180 (Output_data_got::add_local_tls): Removed.
11181 (Output_data_got::add_local_tls_with_rel): Removed.
11182 (Output_data_got::add_local_tls_with_rela): Removed.
11183 * output.h (Output_data_got::add_global): Added got_type parameter.
11184 (Output_data_got::add_global_with_rel): Likewise.
11185 (Output_data_got::add_global_with_rela): Likewise.
11186 (Output_data_got::add_global_pair_with_rel): New function.
11187 (Output_data_got::add_global_pair_with_rela): New function.
11188 (Output_data_got::add_local): Added got_type parameter.
11189 (Output_data_got::add_local_with_rel): Likewise.
11190 (Output_data_got::add_local_with_rela): Likewise.
11191 (Output_data_got::add_local_pair_with_rel): New function.
11192 (Output_data_got::add_local_pair_with_rela): New function.
11193 (Output_data_got::add_global_tls): Removed.
11194 (Output_data_got::add_global_tls_with_rel): Removed.
11195 (Output_data_got::add_global_tls_with_rela): Removed.
11196 (Output_data_got::add_local_tls): Removed.
11197 (Output_data_got::add_local_tls_with_rel): Removed.
11198 (Output_data_got::add_local_tls_with_rela): Removed.
11199 * resolve.cc (Symbol::override_base_with_special): Removed
11200 reference to has_got_offset_ field.
11201 * symtab.cc (Symbol::init_fields): Replaced initialization
11202 of got_offset_ with got_offsets_. Removed initialization
11203 of has_got_offset_
53fcba31 11204 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11205 (Symbol::got_offset): Likewise.
11206 (Symbol::set_got_offset): Likewise.
11207 (Symbol::has_tls_got_offset): Removed.
11208 (Symbol::tls_got_offset): Removed.
11209 (Symbol::set_tls_got_offset): Removed.
11210 (Symbol::got_offset_): Removed.
11211 (Symbol::tls_mod_got_offset_): Removed.
11212 (Symbol::tls_pair_got_offset_): Removed.
11213 (Symbol::got_offsets_): New field.
11214 (Symbol::has_got_offset): Removed.
11215 (Symbol::has_tls_mod_got_offset): Removed.
11216 (Symbol::has_tls_pair_got_offset): Removed.
11217 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11218 (Target_x86_64::Scan::local): Updated callers of Output_data_got
11219 member functions.
11220 (Target_x86_64::Scan::global): Likewise.
11221 (Target_x86_64::Relocate::relocate): Likewise.
11222 (Target_x86_64::Relocate::relocate_tls): Likewise.
11223
bd52eafb
BE
112242008-03-25 Ben Elliston <bje@au.ibm.com>
11225
11226 * yyscript.y: Fix spelling error in comment.
11227
8b105e34
ILT
112282008-03-24 Ian Lance Taylor <iant@google.com>
11229
8ed814a9
ILT
11230 * options.h (class General_options): Define build_id option.
11231 * layout.h (class Layout): Declare write_build_id, create_note,
11232 create_build_id. Add build_id_note_ member.
11233 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
11234 "libiberty.h", "md5.h", "sha1.h".
11235 (Layout::Layout): Initialize eh_frame_data_,
11236 eh_frame_hdr_section_, and build_id_note_.
11237 (Layout::finalize): Call create_build_id.
11238 (Layout::create_note): New function, broken out of
11239 Layout::create_gold_note.
11240 (Layout::create_gold_note): Call create_note.
11241 (Layout::create_build_id): New function.
11242 (Layout::write_build_id): New function.
11243 (Close_task_runner::run): Call write_build_id.
11244
8b105e34
ILT
11245 * x86_64.cc: Correct license to GPLv3.
11246
086a1841
ILT
112472008-03-23 Ian Lance Taylor <iant@google.com>
11248
11249 * options.cc: Include "demangle.h".
11250 (parse_optional_string): New function.
11251 (parse_long_option): Handle takes_optional_argument.
11252 (parse_short_option): Update dash_z initializer. Handle
11253 takes_optional_argument.
11254 (General_options::General_options): Initialize do_demangle_.
11255 (General_options::finalize): Set do_demangle_. Handle demangling
11256 style.
11257 * options.h (parse_optional_string): Declare.
11258 (struct One_option): Add optional_arg field. Update constructor.
11259 Update call constructor calls. Add takes_optional_argument
11260 function.
11261 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
11262 (DEFINE_optional_string): Define.
11263 (General_options::demangle): Change from DEFINE_bool to
11264 DEFINE_optional_string.
11265 (General_options::no_demangle): New function.
11266 (General_options::do_demangle): New function.
11267 (General_options::set_do_demangle): New function.
11268 (General_options::execstack_status_): Move definition to end of
11269 class definition.
11270 (General_options::static_): Likewise.
11271 (General_options::do_demangle_): New field.
11272 * object.cc (big_endian>::get_symbol_location_info): Call
11273 Options::do_demangle, not Options::demangle.
11274 * symtab.cc (demangle): Likewise.
11275
cbb93e63
ILT
112762008-03-22 Ian Lance Taylor <iant@google.com>
11277
11278 * gold.h: Include <cstddef> and <sys/types.h>
11279 * options.h: Include <cstring>.
11280
ec531623
ILT
112812008-03-21 Ian Lance Taylor <iant@google.com>
11282
11283 * Added source code to GNU binutils.