* MAINTAINERS (Write After Approval): Use default email address.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
487b39df
ILT
12011-06-24 Ian Lance Taylor <iant@google.com>
2
3 * layout.cc: Include "object.h".
4 (ctors_sections_in_init_array): New static variable.
5 (Layout::is_ctors_in_init_array): New function.
6 (Layout::layout): Add entry to ctors_sections_in_init_array if
7 appropriate.
8 * layout.h (class Layout): Declare is_ctors_in_init_array.
9 * reloc.cc (Sized_relobj_file::do_relocate): Call reverse_words if
10 is_ctors_reverse_view is set.
11 (Sized_relobj_file::write_sections): Add layout parameter. Change
12 all callers. Set is_ctors_reverse_view field of View_size.
13 (Sized_relobj_file::reverse_words): New function.
14 * object.h (Sized_relobj_file::View_size): Add
15 is_ctors_reverse_view field.
16 (class Sized_relobj_file): Update declarations.
17 * testsuite/initpri3.c: New test.
18 * testsuite/Makefile.am: (check_PROGRAMS): Add initpri3a and
19 initpri3b.
20 (initpri3a_SOURCES, initpri3a_DEPENDENCIES): New variables.
21 (initpri3a_LDFLAGS, initpri3a_LDADD): New variables.
22 (initpri3b_SOURCES, initpri3b_DEPENDENCIES): New variables.
23 (initpri3b_LDFLAGS, initpri3b_LDADD): New variables.
24 * testsuite/Makefile.in: Rebuild.
25
472076e4
CC
262011-06-24 Cary Coutant <ccoutant@google.com>
27
28 * testsuite/Makefile.am: Add in-tree assembler to gcctestdir.
29 (debug_msg_cdebug.o, odr_violation1_cdebug.o, odr_violation2_cdebug.o)
30 (debug_msg_cdebug.err): New targets.
31 * testsuite/Makefile.in: Regenerate.
32 * testsuite/debug_msg.sh: Check output of link with compressed debug.
33 Fix checks for link with shared library.
34
a60af0db
DK
352011-06-24 Doug Kwan <dougkwan@google.com>
36
37 * arm.cc (Arm_output_section::append_text_sections_to_list): Do not
38 skip empty text sections.
39 * testsuite/arm_exidx_test.s: Test handling of an empty text section.
40
5393d741
ILT
412011-06-22 Ian Lance Taylor <iant@google.com>
42
43 PR gold/12910
44 * options.h (class General_options): Add --ctors-in-init-array.
45 * layout.cc (Layout::get_output_section): Treat SHT_INIT_ARRAY and
46 friends as SHT_PROGBITS for merging sections.
47 (Layout::layout): Remove special handling of .init_array and
48 friends. Don't sort if doing relocatable link. Sort for .ctors
49 and .dtors if ctors_in_init_array.
50 (Layout::make_output_section): Force correct section types for
51 .init_array and friends. Don't sort if doing relocatable link,
52 Don't sort .ctors and .dtors if ctors_in_init_array.
53 (Layout::section_name_mapping): Remove .ctors. and .dtorso.
54 (Layout::output_section_name): Add relobj parameter. Change all
55 callers. Handle .ctors. and .dtors. in code rather than table.
56 Handle .ctors and .dtors if ctors_in_init_array.
57 (Layout::match_file_name): New function, moved from output.cc.
58 * layout.h (class Layout): Update declarations.
59 * output.cc: Include "layout.h".
60 (Input_section_sort_entry::get_priority): New function.
61 (Input_section_sort_entry::match_file_name): Just call
62 Layout::match_file_name.
63 (Output_section::Input_section_sort_init_fini_compare::operator()):
64 Handle .ctors and .dtors. Sort by explicit priority rather than
65 by name.
66 * configure.ac: Remove CONSTRUCTOR_PRIORITY test and conditional.
67 * testsuite/initpri2.c: New test.
68 * testsuite/Makefile.am: Don't test CONSTRUCTOR_PRIORITY.
69 (check_PROGRAMS): Add initpri2.
70 (initpri2_SOURCES, initpri2_DEPENDENCIES): New variables.
71 (initpri2_LDFLAGS, initpri2_LDADD): New variables.
72 * configure, testsuite/Makefile.in: Rebuild.
73
e1f74f98
ILT
742011-06-19 Ian Lance Taylor <iant@google.com>
75
76 PR gold/12880
77 * layout.cc (Layout::attach_allocated_section_to_segment): Add a
78 .interp section to a PT_INTERP segment even if we have seen a
79 --dynamic-linker option. Don't do it if we have seen a PHDRS
80 clause in a linker script.
81 (Layout::finalize): Don't create a .interp section if we've
82 already create a PT_INTERP segment.
83 (Layout::create_interp): Always call choose_output_section (revert
84 patch of 2011-06-17). Don't create PT_INTERP segment.
85 * script-sections.cc
86 (Script_sections::create_note_and_tls_segments): Add a .interp
87 section to a PT_INTERP segment even if we have seen a
88 --dynamic-linker option.
89
766f91bb
ILT
902011-06-18 Ian Lance Taylor <iant@google.com>
91
92 * layout.cc (Layout::finish_dynamic_section): Don't set DT_TEXTREL
93 merely because a non-PT_LOAD segment has a dynamic reloc.
94
0d212c3a
ILT
952011-06-18 Ian Lance Taylor <iant@google.com>
96
97 * layout.cc (Layout::finish_dynamic_section): Don't create
98 DT_FLAGS entry if not needed.
99
911a5072
ILT
1002011-06-18 Ian Lance Taylor <iant@google.com>
101
102 PR gold/12745
103 * layout.cc (Layout::layout_eh_frame): Correct handling of
104 writable .eh_frame section.
105
534b4e5f
ILT
1062011-06-17 Ian Lance Taylor <iant@google.com>
107
108 PR gold/12893
109 * resolve.cc (Symbol_table::resolve): Don't give an error if a
110 symbol is redefined with the exact same object and value.
111
10b4f102
ILT
1122011-06-17 Ian Lance Taylor <iant@google.com>
113
114 PR gold/12880
115 * layout.h (class Layout): Add interp_segment_ field.
116 * layout.cc (Layout::Layout): Initialize interp_segment_ field.
117 (Layout::attach_allocated_section_to_segment): If making shared
118 library, put .interp section in PT_INTERP segment.
119 (Layout::finalize): Also call create_interp if -dynamic-linker
120 option was used.
121 (Layout::create_interp): Assert that there is no PT_INTERP
122 segment. If not using a SECTIONS clause, use make_output_section.
123 (Layout::make_output_segment): Set interp_segment_ if PT_INTERP.
124 * script-sections.cc
125 (Script_sections::create_note_and_tls_segments): If making shared
126 library, put .interp section in PT_INTERP segment.
127
a29b0dad
ILT
1282011-06-17 Ian Lance Taylor <iant@google.com>
129
e588ea8d
ILT
130 * object.cc (Sized_relobj_file::do_layout): Keep warning sections
131 when making a shared library.
132
1332011-06-17 Ian Lance Taylor <iant@google.com>
134
135 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Add gsym
136 parameter. Change all callers. Don't issue warning about PC32
137 against locally defined symbol.
a29b0dad 138
9d3b0698
ILT
1392011-06-16 Ian Lance Taylor <iant@google.com>
140
141 * symtab.cc (Warnings::issue_warning): Don't warn if relocation
142 occurs in same object.
143
85b0f90c
AM
1442011-06-14 Alan Modra <amodra@gmail.com>
145
146 * po/POTFILES.in: Regenerate.
147
a94907d9
ILT
1482011-06-09 Ian Lance Taylor <iant@google.com>
149
150 * script-sections.cc
151 (Orphan_output_section::set_section_addresses): For a relocatable
152 link set address to 0.
153
4fb3a1c3
CC
1542011-06-09 Cary Coutant <ccoutant@google.com>
155
156 PR gold/12804
157 * gold/gold.cc (queue_initial_tasks): Warn if --incremental is
158 used with --compress-debug-sections.
159 * gold/object.cc (Sized_relobj_file::do_layout): Report
160 uncompressed size of compressed input sections.
161
61220854
CC
1622011-06-08 Cary Coutant <ccoutant@google.com>
163
164 PR gold/12804
165 * testsuite/two_file_test_2_v1.cc: Change initialization of
166 v2 to keep it in .data.
167
e6455dfb
CC
1682011-06-07 Cary Coutant <ccoutant@google.com>
169
170 * common.cc (Symbol_table::do_allocate_commons_list): Call
171 gold_fallback.
172 * errors.cc (Errors::fatal): Adjust call to gold_exit.
173 (Errors::fallback): New function.
174 (gold_fallback): New function.
175 * errors.h (Errors::fallback): New function.
176 * gold.cc (gold_exit): Change status parameter to enum; adjust
177 all callers.
178 (queue_initial_tasks): Call gold_fallback.
179 * gold.h: Include cstdlib.
180 (Exit_status): New enum type.
181 (gold_exit): Change status parameter to enum.
182 (gold_fallback): New function.
183 * layout.cc (Layout::set_section_offsets): Call gold_fallback.
184 (Layout::create_symtab_sections): Likewise.
185 (Layout::create_shdrs): Likewise.
186 * main.cc (main): Adjust call to gold_exit.
187 * output.cc (Output_data_got::add_got_entry): Call gold_fallback.
188 (Output_data_got::add_got_entry_pair): Likewise.
189 (Output_section::add_input_section): Likewise.
190 (Output_section::add_output_section_data): Likewise.
191 (Output_segment::set_section_list_addresses): Likewise.
192 * x86_64.cc (Output_data_plt_x86_64::add_entry): Likewise.
193
fb0e076f
CC
1942011-06-07 Cary Coutant <ccoutant@google.com>
195
196 * layout.cc (Layout::set_segment_offsets): Don't adjust layout
197 for incremental links.
198 * output.cc (Output_segment::set_section_list_addresses): Remove
199 FIXME and test for TLS or BSS.
200
a5ee4d5d
CC
2012011-06-07 Cary Coutant <ccoutant@google.com>
202
203 * testsuite/Makefile.am: Add incremental_copy_test,
204 incremental_common_test_1.
205 * testsuite/Makefile.in: Regenerate.
206 * testsuite/common_test_1_v1.c: New source file.
207 * testsuite/common_test_1_v2.c: New source file.
208 * testsuite/copy_test_v1.cc: New source file.
209
5146f448
CC
2102011-06-07 Cary Coutant <ccoutant@google.com>
211
212 * common.cc (Symbol_table::do_allocate_commons_list): For incremental
213 update, allocate common from bss section's free list.
214 * incremental-dump.cc (dump_incremental_inputs): Print flag for
215 linker-defined symbols.
216 * incremental.cc (Sized_incremental_binary::do_process_got_plt):
217 Skip GOT and PLT entries that are no longer referenced.
218 (Output_section_incremental_inputs::write_info_blocks): Mark
219 linker-defined symbols.
220 (Sized_incr_relobj::do_add_symbols): Process linker-defined symbols.
221 * output.cc (Output_section::allocate): New function.
222 * output.h (Output_section::allocate): New function.
223 * resolve.cc (Symbol_table::report_resolve_problem): Add case for
224 linker-defined symbols.
225 (Symbol::override_base_with_special): Copy is_predefined_ flag.
226 * symtab.cc (Symbol::init_fields): Initialize is_predefined_ flag.
227 (Symbol::init_base_output_data): Likewise.
228 (Symbol::init_base_output_segment): Likewise.
229 (Symbol::init_base_constant): Likewise.
230 (Sized_symbol::init_output_data): Likewise.
231 (Sized_symbol::init_output_segment): Likewise.
232 (Sized_symbol::init_constant): Likewise.
233 (Symbol_table::do_define_in_output_data): Likewise.
234 (Symbol_table::do_define_in_output_segment): Likewise.
235 (Symbol_table::do_define_as_constant): Likewise.
236 * symtab.h (Symbol::is_predefined): New function.
237 (Symbol::init_base_output_data): Add is_predefined parameter.
238 (Symbol::init_base_output_segment): Likewise.
239 (Symbol::init_base_constant): Likewise.
240 (Symbol::is_predefined_): New data member.
241 (Sized_symbol::init_output_data): Add is_predefined parameter.
242 (Sized_symbol::init_output_segment): Likewise.
243 (Sized_symbol::init_constant): Likewise.
244 (enum Symbol_table::Defined): Add INCREMENTAL_BASE.
245
26d3c67d
CC
2462011-06-07 Cary Coutant <ccoutant@google.com>
247
248 * copy-relocs.cc (Copy_relocs::copy_reloc): Call make_copy_reloc
249 instead of emit_copy_reloc.
250 (Copy_relocs::emit_copy_reloc): Refactor.
251 (Copy_relocs::make_copy_reloc): New function.
252 (Copy_relocs::add_copy_reloc): Remove.
253 * copy-relocs.h (Copy_relocs::emit_copy_reloc): Move to public
254 section.
255 (Copy_relocs::make_copy_reloc): New function.
256 (Copy_relocs::add_copy_reloc): Remove.
257 * gold.cc (queue_middle_tasks): Emit old COPY relocations from
258 unchanged input files.
259 * incremental-dump.cc (dump_incremental_inputs): Print "COPY" flag.
260 * incremental.cc (Sized_incremental_binary::do_reserve_layout):
261 Reserve BSS space for COPY relocations.
262 (Sized_incremental_binary::do_emit_copy_relocs): New function.
263 (Output_section_incremental_inputs::write_info_blocks): Record
264 whether a symbol is copied from a shared object.
265 (Sized_incr_dynobj::do_add_symbols): Record COPY relocations.
266 * incremental.h (enum Incremental_shlib_symbol_flags): New type.
267 (INCREMENTAL_SHLIB_SYM_FLAGS_SHIFT): New constant.
268 (Incremental_input_entry_reader::get_output_symbol_index): Add
269 is_copy parameter.
270 (Incremental_binary::emit_copy_relocs): New function.
271 (Incremental_binary::do_emit_copy_relocs): New function.
272 (Sized_incremental_binary::Sized_incremental_binary): Initialize
273 new data member.
274 (Sized_incremental_binary::add_copy_reloc): New function.
275 (Sized_incremental_binary::do_emit_copy_relocs): New function.
276 (Sized_incremental_binary::Copy_reloc): New struct.
277 (Sized_incremental_binary::Copy_relocs): New typedef.
278 (Sized_incremental_binary::copy_relocs_): New data member.
279 * symtab.cc (Symbol_table::add_from_incrobj): Change return type.
280 * symtab.h (Symbol_table::add_from_incrobj): Change return type.
281 * target.h (Sized_target::emit_copy_reloc): New function.
282 * x86_64.cc (Target_x86_64::emit_copy_reloc): New function.
283
7cdb37d9
CC
2842011-06-02 Cary Coutant <ccoutant@google.com>
285
286 PR gold/12163
287 * gold/archive.cc (Archive::Archive): Initialize new data member.
288 (Archive::include_all_members): Return if archive has already been
289 included.
290 * gold/archive.h (Archive::include_all_members_): New data member.
291
cc643b88
NC
2922011-06-02 Nick Clifton <nickc@redhat.com>
293
294 * dynobj.h: Fix spelling mistake in comment.
295 * output.cc: Likewise.
296
f62a3ca7
DK
2972011-05-31 Doug Kwan <dougkwan@google.com>
298 Asier Llano
299
300 PR gold/12826
cc643b88 301 * arm.cc (Target_arm::tag_cpu_arch_combine): Fix handling of
f62a3ca7
DK
302 arch value that equals to elfcpp::MAX_TAG_CPU_ARCH.
303 * testsuite/Makefile.am: (MOSTLYCLEANFILES): Clean up. Remove
304 redundant arm_exidx_test.so.
305 * testsuite/Makefile.in: Regenerate.
306 (check_SCRIPTS): Add pr12826.sh
307 (check_DATA): Add pr12826.stdout
308 (pr12826.stdout, pr12826.so, pr12826_1.o, pr12826_2.o): New rules.
309 * testsuite/pr12826.sh: New file.
310 * testsuite/pr12826_1.s: Ditto.
311 * testsuite/pr12826_1.s: Ditto.
312
8dbe1edc
ILT
3132011-05-30 Ian Lance Taylor <iant@google.com>
314
315 * reloc.cc (Sized_relobj_file::do_read_relocs): Ignore empty reloc
316 sections.
317
c49875be
ILT
3182011-05-29 Ian Lance Taylor <iant@google.com>
319
320 PR gold/12804
321 * testsuite/Makefile.am: Use different file name for two_file_test
322 temporary file for each incremental test.
323 * testsuite/Makefile.in: Rebuild.
324
69d53f7a
ILT
3252011-05-29 Ian Lance Taylor <iant@google.com>
326
327 * binary.cc (Binary_to_elf::sized_convert): Don't crash if the
328 binary input file is empty.
329
41d0ab5f
ILT
3302011-05-27 Ian Lance Taylor <iant@google.com>
331
332 * testsuite/Makefile.am (ver_test_2.so): Use -Wl,-R,.
333 (ver_test_9.so): Likewise.
334 * testsuite/Makefile.in: Rebuild.
335
89d8a36b
CC
3362011-05-26 Cary Coutant <ccoutant@google.com>
337
338 * incremental-dump.cc (dump_incremental_inputs): Print COMDAT groups.
339 * incremental.cc (Incremental_inputs::report_input_section): Fix
340 comment, indentation.
341 (Incremental_inputs::report_comdat_group): New function.
342 (Output_section_incremental_inputs::set_final_data_size): Adjust size
343 of data for incremental input file entry.
344 (Output_section_incremental_inputs::write_info_blocks): Write COMDAT
345 group count, COMDAT group signatures.
346 (Sized_incr_relobj::do_layout): Record kept COMDAT group info from
347 an unchanged input file.
348 * incremental.h (Incremental_object_entry::Incremental_object_entry):
349 Initialize new data member.
350 (Incremental_object_entry::add_comdat_group): New function.
351 (Incremental_object_entry::get_comdat_group_count): New function.
352 (Incremental_object_entry::get_comdat_signature_key): New function.
353 (Incremental_object_entry::groups_): New data member.
354 (Incremental_inputs::report_comdat_group): New function.
355 (Incremental_input_entry_reader::get_symbol_offset): Adjust size of
356 data for incremental input file entry.
357 (Incremental_input_entry_reader::get_comdat_group_count): New function.
358 (Incremental_input_entry_reader::get_input_section): Adjust size of
359 data for incremental input file entry.
360 (Incremental_input_entry_reader::get_global_symbol_reader): Likewise.
361 (Incremental_input_entry_reader::get_comdat_group_signature): New
362 function.
363 * object.cc (Sized_relobj::include_section_group): Report kept
364 COMDAT groups for incremental links.
365
1706a06f
ILT
3662011-05-24 David Meyer <pdox@google.com>
367
368 * dirsearch.cc (Dirsearch::find): Replace n1 and n2 parameters
369 with name parameter. Add found_name parameter.
370 * fileread.cc (Input_file::find_file): Adjust code accordingly.
371 * dirsearch.h (class Dirsearch): Update declaration.
372
a10ae760
ILT
3732011-05-24 Ian Lance Taylor <iant@google.com>
374
375 * archive.cc (Library_base::should_include_member): Pull in object
376 from archive if it defines the entry symbol.
377 * parameters.cc (Parameters::entry): New function.
378 * parameters.h (class Parameters): Declare entry.
379 * output.h (class Output_file_header): Remove entry_ field.
380 * output.cc (Output_file_header::Output_file_header): Remove entry
381 parameter. Change all callers.
382 (Output_file_header::entry): Use parameters->entry.
383 * gold.cc (queue_middle_tasks): Likewise.
384 * plugin.cc (Plugin_hook::run): Likewise.
385
aa92d6ed
CC
3862011-05-24 Cary Coutant <ccoutant@google.com>
387
388 * gold.cc (queue_initial_tasks): Pass incremental base filename
389 to Output_file::open_base_file; don't print error message.
390 * incremental-dump.cc (main): Adjust call to
391 Output_file::open_for_modification.
392 * incremental-dump.cc (main): Likewise.
393 * incremental.cc (Incremental_inputs::report_command_line):
394 Ignore --incremental-base option when comparing command lines.
395 Ignore parameter when given as separate argument.
396 * options.h (class General_options): Add --incremental-base.
397 * output.cc (Output_file::Output_file):
398 (Output_file::open_base_file): Add base_name and writable parameters;
399 read base file into new file; print error message here.
400 (Output_file::map_no_anonymous): Add writable parameter; adjust all
401 callers.
402 * output.h (Output_file::open_for_modification): Rename to...
403 (Output_file::open_base_file): ...this; add base_name and
404 writable parameters; adjust all callers.
405 (Output_file::map_no_anonymous): Add writable parameter; adjust all
406 callers.
407 * testsuite/Makefile.am (incremental_test_4): Test
408 --incremental-base.
409 * testsuite/Makefile.in: Regenerate.
410
2eedd706
CC
4112011-05-24 Cary Coutant <ccoutant@google.com>
412
413 * testsuite/Makefile.am: Add incremental_test_2, incremental_test_3,
414 incremental_test_4.
415 * testsuite/Makefile.in: Regenerate.
416 * testsuite/two_file_test_1_v1.cc: New test source file.
417 * testsuite/two_file_test_1b_v1.cc: New test source file.
418 * testsuite/two_file_test_2_v1.cc: New test source file.
419
0f1c85a6
CC
4202011-05-24 Cary Coutant <ccoutant@google.com>
421
422 * dynobj.h (Dynobj::do_dynobj): New function.
423 * incremental-dump.cc (dump_incremental_inputs): Print as_needed
424 flag and soname for shared objects.
425 * incremental.cc (Incremental_inputs::report_object): Make
426 either Incremental_object_entry or Incremental_dynobj_entry; add
427 soname to string table.
428 (Incremental_inputs::report_input_section): Add assertion.
429 (Output_section_incremental_inputs::set_final_data_size): Adjust
430 type of input file entry for shared libraries; adjust size of
431 shared library info entry.
432 (Output_section_incremental_inputs::write_input_files): Write
433 as_needed flag for shared libraries.
434 (Output_section_incremental_inputs::write_info_blocks): Adjust type
435 of input file entry for shared libraries; write soname.
436 (Sized_incr_dynobj::Sized_incr_dynobj): Read as_needed flag and
437 soname from incremental info.
438 * incremental.h (enum Incremental_input_flags): Add
439 INCREMENTAL_INPUT_AS_NEEDED.
440 (Incremental_input_entry::Incremental_input_entry): Initialize new
441 data member.
442 (Incremental_input_entry::set_as_needed): New function.
443 (Incremental_input_entry::as_needed): New function.
444 (Incremental_input_entry::do_dynobj_entry): New function.
445 (Incremental_input_entry::as_needed_): New data member.
446 (Incremental_object_entry::Incremental_object_entry): Don't check
447 for shared library.
448 (Incremental_object_entry::do_type): Likewise.
449 (class Incremental_dynobj_entry): New class.
450 (Incremental_input_entry_reader::as_needed): New function.
451 (Incremental_input_entry_reader::get_soname): New function.
452 (Incremental_input_entry_reader::get_global_symbol_count): Rewrite.
453 (Incremental_input_entry_reader::get_output_symbol_index): Adjust
454 size of shared library info entry.
455 * layout.cc (Layout::finish_dynamic_section): Don't test for
456 incremental link when adding DT_NEEDED entries.
457 * object.h (Object::Object): Initialize new data member.
458 (Object::dynobj): New function.
459 (Object::set_as_needed): New function.
460 (Object::as_needed): New function.
461 (Object::do_dynobj): New function.
462 (Object::as_needed_): New data member.
463
6fa2a40b
CC
4642011-05-24 Cary Coutant <ccoutant@google.com>
465
466 * incremental-dump.cc (dump_incremental_inputs): Print dynamic reloc
467 info; adjust display of GOT entries.
468 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
469 vector of input objects; remove file_status_.
470 (Sized_incremental_binary::do_reserve_layout): Remove file_status_.
471 (Sized_incremental_binary::do_process_got_plt): Adjust calls to
472 got_plt reader; call target hooks to reserve GOT entries.
473 (Output_section_incremental_inputs::set_final_data_size): Adjust size
474 of input file info header and GOT info entry.
475 (Output_section_incremental_inputs::write_info_blocks): Write dynamic
476 relocation info.
477 (Got_plt_view_info::got_descriptor): Remove.
478 (Got_plt_view_info::sym_index): New data member.
479 (Got_plt_view_info::input_index): New data member.
480 (Local_got_offset_visitor::visit): Write input file index.
481 (Global_got_offset_visitor::visit): Write 0 for input file index.
482 (Global_symbol_visitor_got_plt::operator()): Replace got_descriptor
483 with sym_index and input_index.
484 (Output_section_incremental_inputs::write_got_plt): Adjust size of
485 incremental info GOT entry; replace got_descriptor with input_index.
486 (Sized_relobj_incr::Sized_relobj_incr): Adjust initializers; record
487 map from input file index to object.
488 (Sized_relobj_incr::do_layout): Replace direct data member reference
489 with accessor function.
490 (Sized_relobj_incr::do_for_all_local_got_entries): Move to base class.
491 * incremental.h (Incremental_input_entry_reader::get_symbol_offset):
492 Adjust size of input file info header.
493 (Incremental_input_entry_reader::get_first_dyn_reloc): New function.
494 (Incremental_input_entry_reader::get_dyn_reloc_count): New function.
495 (Incremental_input_entry_reader::get_input_section): Adjust size of
496 input file info header.
497 (Incremental_got_plt_reader::Incremental_got_plt_reader): Adjust size
498 of incremental info GOT entry.
499 (Incremental_got_plt_reader::get_got_desc): Remove.
500 (Incremental_got_plt_reader::get_got_symndx): New function.
501 (Incremental_got_plt_reader::get_got_input_index): New function.
502 (Sized_incremental_binary::Sized_incremental_binary): Remove
503 file_status_; add input_objects_.
504 (Sized_incremental_binary::~Sized_incremental_binary): Remove.
505 (Sized_incremental_binary::set_file_is_unchanged): Remove.
506 (Sized_incremental_binary::file_is_unchanged): Remove.
507 (Sized_incremental_binary::set_input_object): New function.
508 (Sized_incremental_binary::input_object): New function.
509 (Sized_incremental_binary::file_status_): Remove.
510 (Sized_incremental_binary::input_objects_): New data member.
511 (Sized_relobj_incr): Rename Sized_incr_relobj to this; adjust all
512 references.
513 (Sized_relobj_incr::invalid_address): Move to base class.
514 (Sized_relobj_incr::is_output_section_offset_invalid): Move to base
515 class.
516 (Sized_relobj_incr::do_output_section_offset): Likewise.
517 (Sized_relobj_incr::do_for_all_local_got_entries): Likewise.
518 (Sized_relobj_incr::section_offsets_): Likewise.
519 * object.cc (Sized_relobj::do_for_all_local_got_entries): New
520 function.
521 (Sized_relobj_file::Sized_relobj_file): Remove local_got_offsets_.
522 (Sized_relobj_file::layout_section): Replace refs to section_offsets_
523 with accessor function.
524 (Sized_relobj_file::do_layout): Likewise.
525 (Sized_relobj_file::do_layout_deferred_sections): Likewise.
526 (Sized_relobj_file::do_for_all_local_got_entries): Move to base class.
527 (Sized_relobj_file::compute_final_local_value): Replace refs to
528 section_offsets_ with accessor function.
529 (Sized_relobj_file::do_finalize_local_symbols): Likewise.
530 * object.h (Relobj::Relobj): Initialize new data members.
531 (Relobj::add_dyn_reloc): New function.
532 (Relobj::first_dyn_reloc): New function.
533 (Relobj::dyn_reloc_count): New function.
534 (Relobj::first_dyn_reloc_): New data member.
535 (Relobj::dyn_reloc_count_): New data member.
536 (Sized_relobj): Rename Sized_relobj_base to this; adjust all
537 references.
538 (Sized_relobj::Address): New typedef.
539 (Sized_relobj::invalid_address): Move here from child class.
540 (Sized_relobj::Sized_relobj): Initialize new data members.
541 (Sized_relobj::sized_relobj): New function.
542 (Sized_relobj::is_output_section_offset_invalid): Move here from
543 child class.
544 (Sized_relobj::get_output_section_offset): Likewise.
545 (Sized_relobj::local_has_got_offset): Likewise.
546 (Sized_relobj::local_got_offset): Likewise.
547 (Sized_relobj::set_local_got_offset): Likewise.
548 (Sized_relobj::do_for_all_local_got_entries): Likewise.
549 (Sized_relobj::clear_got_offsets): New function.
550 (Sized_relobj::section_offsets): Move here from child class.
551 (Sized_relobj::do_output_section_offset): Likewise.
552 (Sized_relobj::do_set_section_offset): Likewise.
553 (Sized_relobj::Local_got_offsets): Likewise.
554 (Sized_relobj::local_got_offsets_): Likewise.
555 (Sized_relobj::section_offsets_): Likewise.
556 (Sized_relobj_file): Rename Sized_relobj to this; adjust all
557 references.
558 (Sized_relobj_file::is_output_section_offset_invalid): Move to base
559 class.
560 (Sized_relobj_file::sized_relobj): New function
561 (Sized_relobj_file::local_has_got_offset): Move to base class.
562 (Sized_relobj_file::local_got_offset): Likewise.
563 (Sized_relobj_file::set_local_got_offset): Likewise.
564 (Sized_relobj_file::get_output_section_offset): Likewise.
565 (Sized_relobj_file::do_for_all_local_got_entries): Likewise.
566 (Sized_relobj_file::do_output_section_offset): Likewise.
567 (Sized_relobj_file::do_set_section_offset): Likewise.
568 (Sized_relobj_file::Local_got_offsets): Likewise.
569 (Sized_relobj_file::local_got_offsets_): Likewise.
570 (Sized_relobj_file::section_offsets_): Likewise.
571 * output.cc (Output_reloc::Output_reloc): Adjust type of relobj
572 (all constructors).
573 (set_needs_dynsym_index): Convert relobj to derived class pointer.
574 (Output_reloc::get_symbol_index): Likewise.
575 (Output_reloc::local_section_offset): Likewise.
576 (Output_reloc::get_address): Likewise.
577 (Output_reloc::symbol_value): Likewise.
578 (Output_data_got::reserve_slot): Move to class definition.
579 (Output_data_got::reserve_local): New function.
580 (Output_data_got::reserve_slot_for_global): Remove.
581 (Output_data_got::reserve_global): New function.
582 * output.h (Output_reloc::Output_reloc): Adjust type of relobj
583 (all constructors, two instantiations).
584 (Output_reloc::get_relobj): New function (two instantiations).
585 (Output_reloc::u1_.relobj, Output_reloc::u2_.relobj): Adjust type.
586 (Output_data_reloc_base::add): Convert relobj to derived class pointer.
587 (Output_data_reloc::add_global): Adjust type of relobj.
588 (Output_data_reloc::add_global_relative): Likewise.
589 (Output_data_reloc::add_symbolless_global_addend): Likewise.
590 (Output_data_reloc::add_local): Likewise.
591 (Output_data_reloc::add_local_relative): Likewise.
592 (Output_data_reloc::add_symbolless_local_addend): Likewise.
593 (Output_data_reloc::add_local_section): Likewise.
594 (Output_data_reloc::add_output_section): Likewise.
595 (Output_data_reloc::add_absolute): Likewise.
596 (Output_data_reloc::add_target_specific): Likewise.
597 (Output_data_got::reserve_slot): Move definition here.
598 (Output_data_got::reserve_local): New function.
599 (Output_data_got::reserve_global): New function.
600 * reloc.cc (Sized_relobj_file::do_read_relocs): Replace refs to
601 section_offsets_ with accessor function.
602 (Sized_relobj_file::write_sections): Likewise.
603 (Sized_relobj_file::do_relocate_sections): Likewise.
604 * target.h (Sized_target::reserve_local_got_entry): New function.
605 (Sized_target::reserve_global_got_entry): New function.
606 * x86_64.cc (Target_x86_64::reserve_local_got_entry): New function.
607 (Target_x86_64::reserve_global_got_entry): New function.
608 (Target_x86_64::init_got_plt_for_update): Create rela_dyn section.
609
4829d394
CC
6102011-05-23 Cary Coutant <ccoutant@google.com>
611
612 * gold.cc (queue_middle_tasks): Process existing GOT/PLT entries.
613 * incremental-dump.cc (dump_incremental_inputs): Mask high-order
614 bit when checking got_type.
615 * incremental.cc (Sized_incremental_binary::setup_readers):
616 Store symbol table and string table locations; initialize bit vector
617 of file status flags.
618 (Sized_incremental_binary::do_reserve_layout): Set bit flag for
619 unchanged files.
620 (Sized_incremental_binary::do_process_got_plt): New function.
621 (Sized_incremental_binary::get_symtab_view): Use stored locations.
622 (Output_section_incremental_inputs::set_final_data_size): Record
623 file index for each input file.
624 (Output_section_incremental_inputs::write_got_plt): Store file index
625 instead of input entry offset for each GOT entry.
626 * incremental.h
627 (Incremental_input_entry::Incremental_input_entry): Initialize new
628 data member.
629 (Incremental_input_entry::set_offset): Store file index.
630 (Incremental_input_entry::get_file_index): New function.
631 (Incremental_input_entry::file_index_): New data member.
632 (Incremental_binary::process_got_plt): New function.
633 (Incremental_binary::do_process_got_plt): New function.
634 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
635 data members.
636 (Sized_incremental_binary::~Sized_incremental_binary): New destructor.
637 (Sized_incremental_binary::set_file_is_unchanged): New function.
638 (Sized_incremental_binary::file_is_unchanged): New function.
639 (Sized_incremental_binary::do_process_got_plt): New function.
640 (Sized_incremental_binary::file_status_): New data member.
641 (Sized_incremental_binary::main_symtab_loc_): New data member.
642 (Sized_incremental_binary::main_strtab_loc_): New data member.
643 * output.cc (Output_data_got::Got_entry::write): Add case
644 RESERVED_CODE.
645 (Output_data_got::add_global): Call add_got_entry.
646 (Output_data_got::add_global_plt): Likewise.
647 (Output_data_got::add_global_with_rel): Likewise.
648 (Output_data_got::add_global_with_rela): Likewise.
649 (Output_data_got::add_global_pair_with_rel): Call add_got_entry_pair.
650 (Output_data_got::add_global_pair_with_rela): Likewise.
651 (Output_data_got::add_local): Call add_got_entry.
652 (Output_data_got::add_local_plt): Likewise.
653 (Output_data_got::add_local_with_rel): Likewise.
654 (Output_data_got::add_local_with_rela): Likewise.
655 (Output_data_got::add_local_pair_with_rel): Call add_got_entry_pair.
656 (Output_data_got::add_local_pair_with_rela): Likewise.
657 (Output_data_got::reserve_slot): New function.
658 (Output_data_got::reserve_slot_for_global): New function.
659 (Output_data_got::add_got_entry): New function.
660 (Output_data_got::add_got_entry_pair): New function.
661 (Output_section::add_output_section_data): Edit FIXME.
662 * output.h
663 (Output_section_data_build::Output_section_data_build): New
664 constructor with size parameter.
665 (Output_data_space::Output_data_space): Likewise.
666 (Output_data_got::Output_data_got): Initialize new data member; new
667 constructor with size parameter.
668 (Output_data_got::add_constant): Call add_got_entry.
669 (Output_data_got::reserve_slot): New function.
670 (Output_data_got::reserve_slot_for_global): New function.
671 (class Output_data_got::Got_entry): Add RESERVED_CODE.
672 (Output_data_got::add_got_entry): New function.
673 (Output_data_got::add_got_entry_pair): New function.
674 (Output_data_got::free_list_): New data member.
675 * target.h (Sized_target::init_got_plt_for_update): New function.
676 (Sized_target::register_global_plt_entry): New function.
677 * x86_64.cc (Output_data_plt_x86_64::Output_data_plt_x86_64):
678 Initialize new data member; call init; add constructor with PLT count.
679 (Output_data_plt_x86_64::init): New function.
680 (Output_data_plt_x86_64::add_relocation): New function.
681 (Output_data_plt_x86_64::reserve_slot): New function.
682 (Output_data_plt_x86_64::free_list_): New data member.
683 (Target_x86_64::init_got_plt_for_update): New function.
684 (Target_x86_64::register_global_plt_entry): New function.
685 (Output_data_plt_x86_64::add_entry): Allocate from free list for
686 incremental updates.
687 (Output_data_plt_x86_64::add_relocation): New function.
688 * testsuite/object_unittest.cc (Object_test): Set default options.
689
ec69d6da
ILT
6902011-05-16 Ian Lance Taylor <iant@google.com>
691
692 * options.h (class General_options): Make -i a synonym for -r.
693
732e31de
ILT
6942011-05-16 Ian Lance Taylor <iant@google.com>
695
696 * testsuite/tls_test_main.cc: Use semaphores instead of mutexes.
697
403676b5
CC
6982011-05-10 Cary Coutant <ccoutant@google.com>
699
700 * object.cc (Sized_relobj::do_count_local_symbols): Check for
701 strip_all (-s).
702
5b7b7d6e
ILT
7032011-05-06 Ian Lance Taylor <iant@google.com>
704
705 * layout.cc (Layout::layout): If the output section flags change,
706 update the ordering.
707
f0f9babf
CC
7082011-04-25 Cary Coutant <ccoutant@google.com>
709
710 * incremental-dump.cc (dump_incremental_inputs): Print local
711 symbol info for each input file.
712 * incremental.cc
713 (Output_section_incremental_inputs::set_final_data_size): Add local
714 symbol info to input file entries in incremental info.
715 (Output_section_incremental_inputs::write_info_blocks): Likewise.
716 (Sized_incr_relobj::Sized_incr_relobj): Initialize new data members.
717 (Sized_incr_relobj::do_add_symbols): Cosmetic change.
718 (Sized_incr_relobj::do_count_local_symbols): Replace stub with
719 implementation.
720 (Sized_incr_relobj::do_finalize_local_symbols): Likewise.
721 (Sized_incr_relobj::do_relocate): Write the local symbols.
722 (Sized_incr_dynobj::do_add_symbols): Cosmetic change.
723 * incremental.h (Incremental_inputs_reader::get_symbol_offset):
724 Adjust size of input file header.
725 (Incremental_inputs_reader::get_local_symbol_offset): New function.
726 (Incremental_inputs_reader::get_local_symbol_count): New function.
727 (Incremental_inputs_reader::get_input_section): Adjust size of input
728 file header.
729 (Incremental_inputs_reader::get_global_symbol_reader): Likewise.
730 (Sized_incr_relobj::This): New typedef.
731 (Sized_incr_relobj::sym_size): New const data member.
732 (Sized_incr_relobj::Local_symbol): New struct.
733 (Sized_incr_relobj::do_output_local_symbol_count): New function.
734 (Sized_incr_relobj::do_local_symbol_offset): New function.
735 (Sized_incr_relobj::local_symbol_count_): New data member.
736 (Sized_incr_relobj::output_local_dynsym_count_): New data member.
737 (Sized_incr_relobj::local_symbol_index_): New data member.
738 (Sized_incr_relobj::local_symbol_offset_): New data member.
739 (Sized_incr_relobj::local_dynsym_offset_): New data member.
740 (Sized_incr_relobj::local_symbols_): New data member.
741 * object.h (Relobj::output_local_symbol_count): New function.
742 (Relobj::local_symbol_offset): New function.
743 (Relobj::do_output_local_symbol_count): New function.
744 (Relobj::do_local_symbol_offset): New function.
745 (Sized_relobj::do_output_local_symbol_count): New function.
746 (Sized_relobj::do_local_symbol_offset): New function.
747
d0a9ace3
ILT
7482011-04-22 Vladimir Simonov <sv@sw.ru>
749
750 * descriptors.cc (set_close_on_exec): New function.
751 (Descriptors::open): Use set_close_on_exec.
752 * output.cc (S_ISLNK): Define if not defined.
753
94a3fc8b
CC
7542011-04-22 Cary Coutant <ccoutant@google.com>
755
756 * incremental.cc (Sized_incremental_binary::setup_readers): Allocate
757 global symbol map.
758 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
759 (Sized_incr_relobj::do_add_symbols): Add symbols to global symbol map.
760 (Sized_incr_relobj::do_relocate): Remap section indices in incremental
761 relocations.
762 (Sized_incr_dynobj::do_add_symbols): Add symbols to global symbol map.
763 (Sized_incr_dynobj::do_for_all_global_symbols): Remove FIXME.
764 (Sized_incr_dynobj::do_for_all_local_got_entries): Likewise.
765 * incremental.h
766 (Incremental_inputs_reader::global_symbol_reader_at_offset): New
767 function.
768 (Incremental_binary::apply_incremental_relocs): New function.
769 (Incremental_binary::do_apply_incremental_relocs): New function.
770 (Sized_incremental_binary::Sized_incremental_binary): Initialize new
771 data member.
772 (Sized_incremental_binary::add_global_symbol): New function.
773 (Sized_incremental_binary::global_symbol): New function.
774 (Sized_incremental_binary::do_apply_incremental_relocs): New function.
775 (Sized_incremental_binary::symbol_map_): New data member.
776 * layout.cc (Layout_task_runner::run): Apply incremental relocations.
777 * target.h (Sized_target::apply_relocation): New function.
778 * target-reloc.h (apply_relocation): New function.
779 * x86_64.cc (Target_x86_64::apply_relocation): New function.
780
c87e4302
DK
7812011-04-22 Doug Kwan <dougkwan@google.com>
782
783 * arm.cc (Arm_output_section::Arm_output_section): Set SHF_LINK_ORDER
784 flag of a SHT_ARM_EXIDX section.
785 * testsuite/Makefile.am (arm_exidx_test): New test rules.
786 * testsuite/Makefile.in: Regenerate.
787 * testsuite/arm_exidx_test.s: New file.
788 * testsuite/arm_exidx_test.sh: Same.
789
e7782cf6
CC
7902011-04-20 Cary Coutant <ccoutant@google.com>
791
792 PR gold/12689
793 * archive.h (Incremental_archive_entry::Archive_member):
794 Initialize arg_serial_ (second constructor).
795
308ecdc7
ILT
7962011-04-17 Ian Lance Taylor <iant@google.com>
797
798 * object.cc (Relocate_info::location): Simplify location string.
799 * errors.cc (Errors::error_at_location): Don't print program
800 name.
801 (Errors::warning_at_location): Likewise.
802 (Errors::undefined_symbol): Likewise.
803 * testsuite/debug_msg.sh: Update accordingly.
804
bec5b579
CC
8052011-04-14 Cary Coutant <ccoutant@google.com>
806
807 * gold/layout.cc (Layout::symtab_section_offset): New function.
808 * gold/layout.h (Layout::symtab_section_offset): New function.
809 * gold/reloc.cc (Sized_relobj::do_relocate): Call it.
810
88597d34
ILT
8112011-04-12 Ian Lance Taylor <iant@google.com>
812
813 * configure.ac: Check for sys/mman.h and mmap. Check for mremap
814 with MREMAP_MAYMOVE.
815 * output.h (class Output_file): Add map_is_allocated_ field.
816 * output.cc: Only #include <sys/mman.h> if it exists. If mmap is
817 not available, provide stubs. If mremap is not available, #define
818 it to gold_mremap.
819 (MREMAP_MAYMOVE): Define if not defined.
820 (Output_file::Output_file): Initialize map_is_allocated_.
821 (Output_file::resize): Check map_is_allocated_.
822 (Output_file::map_anonymous): If mmap fails, use malloc.
823 (Output_file::unmap): Don't do anything for an anonymous map.
824 * fileread.cc: Only #include <sys/mman.h> if it exists. If mmap
825 is not available, provide stubs.
826 (File_read::View::~View): Use free rather than delete[].
827 (File_read::make_view): Use malloc rather than new[]. If mmap
828 fails, use malloc.
829 (File_read::find_or_make_view): Use malloc rather than new[].
830 * gold.h: Remove HAVE_REMAP code.
831 * mremap.c: #include <errno.h>. Only #include <sys/mman.h> if it
832 exists. Rename mremap to gold_mremap. If mmap is not available
833 don't do anything.
834 * configure, config.in: Rebuild.
835
11e361bc
ILT
8362011-04-11 Ian Lance Taylor <iant@google.com>
837
838 * incremental.cc (Sized_incr_relobj::do_add_symbols): Always
839 initialize local variable v.
840
cdc29364
CC
8412011-04-11 Cary Coutant <ccoutant@google.com>
842
843 * archive.cc (Archive::include_member): Adjust call to
844 report_object.
845 (Add_archive_symbols::run): Track argument serial numbers.
846 (Lib_group::include_member): Likewise.
847 (Add_lib_group_symbols::run): Adjust call to report_archive_begin.
848 * archive.h (Incremental_archive_entry::Archive_member):
849 Initialize arg_serial_.
850 (Archive_member::arg_serial_): New data member.
851 * dynobj.cc (Dynobj::Dynobj): Allow input_file_ to be NULL.
852 (Sized_dynobj::do_add_symbols): Track symbols when doing an
853 incremental link.
854 (Sized_dynobj::do_for_all_local_got_entries): New function.
855 * dynobj.h: (Sized_dynobj::do_for_all_local_got_entries): New
856 function.
857 * fileread.cc (get_mtime): New function.
858 * fileread.h (get_mtime): New function.
859 * gold.cc (queue_initial_tasks): Check for incremental update.
860 (process_incremental_input): New function.
861 (queue_middle_tasks): Don't force valid target for incremental
862 update.
863 * incremental-dump.cc (find_input_containing_global): Adjust
864 size of symbol info entry.
865 (dump_incremental_inputs): Dump argument serial number and
866 in_system_directory flag; bias shndx by 1; print symbol names
867 when dumping per-file symbol lists; use new symbol info readers.
868 * incremental.cc
869 (Output_section_incremental_inputs:update_data_size): New function.
870 (Sized_incremental_binary::setup_readers): Setup input readers
871 for each input file; build maps for files added from libraries
872 and scripts.
873 (Sized_incremental_binary::check_input_args): New function.
874 (Sized_incremental_binary::do_check_inputs): Build map of argument
875 serial numbers to input arguments.
876 (Sized_incremental_binary::do_file_has_changed): Rename
877 do_file_is_unchanged to this; compare file modification times.
878 (Sized_incremental_binary::do_init_layout): New function.
879 (Sized_incremental_binary::do_reserve_layout): New function.
880 (Sized_incremental_binary::do_get_input_reader): Remove.
881 (Sized_incremental_binary::get_symtab_view): New function.
882 (Incremental_checker::can_incrementally_link_output_file): Remove.
883 (Incremental_inputs::report_command_line): Exclude --debug options.
884 (Incremental_inputs::report_archive_begin): Add parameter; track
885 argument serial numbers; don't put input file entry for archive
886 before archive members.
887 (Incremental_inputs::report_archive_end): Put input file entry
888 for archive after archive members.
889 (Incremental_inputs::report_object): Add parameter; track argument
890 serial numbers and in_system_directory flag.
891 (Incremental_inputs::report_script): Add parameter; track argument
892 serial numbers.
893 (Output_section_incremental_inputs::set_final_data_size): Adjust
894 size of symbol info entry; check for forwarding symbols.
895 (Output_section_incremental_inputs::write_input_files): Write
896 in_system_directory flag and argument serial number.
897 (Output_section_incremental_inputs::write_info_blocks): Map section
898 indices between incremental info and original input file; store
899 input section index for each symbol.
900 (class Local_got_offset_visitor): Derive from Got_offset_list::Visitor;
901 change operator() to visit().
902 (class Global_got_offset_visitor): Likewise.
903 (class Global_symbol_visitor_got_plt):
904 (Output_section_incremental_inputs::write_got_plt): Use new visitor
905 classes.
906 (Sized_incr_relobj::Sized_incr_relobj): New constructor.
907 (Sized_incr_relobj::do_read_symbols): New function.
908 (Sized_incr_relobj::do_layout): New function.
909 (Sized_incr_relobj::do_layout_deferred_sections): New function.
910 (Sized_incr_relobj::do_add_symbols): New function.
911 (Sized_incr_relobj::do_should_include_member): New function.
912 (Sized_incr_relobj::do_for_all_global_symbols): New function.
913 (Sized_incr_relobj::do_for_all_local_got_entries): New function.
914 (Sized_incr_relobj::do_section_size): New function.
915 (Sized_incr_relobj::do_section_name): New function.
916 (Sized_incr_relobj::do_section_contents): New function.
917 (Sized_incr_relobj::do_section_flags): New function.
918 (Sized_incr_relobj::do_section_entsize): New function.
919 (Sized_incr_relobj::do_section_address): New function.
920 (Sized_incr_relobj::do_section_type): New function.
921 (Sized_incr_relobj::do_section_link): New function.
922 (Sized_incr_relobj::do_section_info): New function.
923 (Sized_incr_relobj::do_section_addralign): New function.
924 (Sized_incr_relobj::do_initialize_xindex): New function.
925 (Sized_incr_relobj::do_get_global_symbol_counts): New function.
926 (Sized_incr_relobj::do_read_relocs): New function.
927 (Sized_incr_relobj::do_gc_process_relocs): New function.
928 (Sized_incr_relobj::do_scan_relocs): New function.
929 (Sized_incr_relobj::do_count_local_symbols): New function.
930 (Sized_incr_relobj::do_finalize_local_symbols): New function.
931 (Sized_incr_relobj::do_set_local_dynsym_indexes): New function.
932 (Sized_incr_relobj::do_set_local_dynsym_offset): New function.
933 (Sized_incr_relobj::do_relocate): New function.
934 (Sized_incr_relobj::do_set_section_offset): New function.
935 (Sized_incr_dynobj::Sized_incr_dynobj): New function.
936 (Sized_incr_dynobj::do_read_symbols): New function.
937 (Sized_incr_dynobj::do_layout): New function.
938 (Sized_incr_dynobj::do_add_symbols): New function.
939 (Sized_incr_dynobj::do_should_include_member): New function.
940 (Sized_incr_dynobj::do_for_all_global_symbols): New function.
941 (Sized_incr_dynobj::do_for_all_local_got_entries): New function.
942 (Sized_incr_dynobj::do_section_size): New function.
943 (Sized_incr_dynobj::do_section_name): New function.
944 (Sized_incr_dynobj::do_section_contents): New function.
945 (Sized_incr_dynobj::do_section_flags): New function.
946 (Sized_incr_dynobj::do_section_entsize): New function.
947 (Sized_incr_dynobj::do_section_address): New function.
948 (Sized_incr_dynobj::do_section_type): New function.
949 (Sized_incr_dynobj::do_section_link): New function.
950 (Sized_incr_dynobj::do_section_info): New function.
951 (Sized_incr_dynobj::do_section_addralign): New function.
952 (Sized_incr_dynobj::do_initialize_xindex): New function.
953 (Sized_incr_dynobj::do_get_global_symbol_counts): New function.
954 (make_sized_incremental_object): New function.
955 (Incremental_library::copy_unused_symbols): New function.
956 (Incremental_library::do_for_all_unused_symbols): New function.
957 * incremental.h (enum Incremental_input_flags): New type.
958 (class Incremental_checker): Remove.
959 (Incremental_input_entry::Incremental_input_entry): Add argument
960 serial number.
961 (Incremental_input_entry::arg_serial): New function.
962 (Incremental_input_entry::set_is_in_system_directory): New function.
963 (Incremental_input_entry::is_in_system_directory): New function.
964 (Incremental_input_entry::arg_serial_): New data member.
965 (Incremental_input_entry::is_in_system_directory_): New data member.
966 (class Script_info): Move here from script.h.
967 (Script_info::Script_info): Add filename parameter.
968 (Script_info::filename): New function.
969 (Script_info::filename_): New data member.
970 (Incremental_script_entry::Incremental_script_entry): Add argument
971 serial number.
972 (Incremental_object_entry::Incremental_object_entry): Likewise.
973 (Incremental_object_entry::add_input_section): Build list of input
974 sections with map to original shndx.
975 (Incremental_object_entry::get_input_section_index): New function.
976 (Incremental_object_entry::shndx_): New data member.
977 (Incremental_object_entry::name_key_): Rename; adjust all refs.
978 (Incremental_object_entry::sh_size_): Rename; adjust all refs.
979 (Incremental_archive_entry::Incremental_archive_entry): Add argument
980 serial number.
981 (Incremental_inputs::report_archive_begin): Likewise.
982 (Incremental_inputs::report_object): Likewise.
983 (Incremental_inputs::report_script): Likewise.
984 (class Incremental_global_symbol_reader): New class.
985 (Incremental_input_entry_reader::Incremental_input_entry_reader): Read
986 and store flags and input file type.
987 (Incremental_input_entry_reader::arg_serial): New function.
988 (Incremental_input_entry_reader::type): Extract type from flags.
989 (Incremental_input_entry_reader::is_in_system_directory): New function.
990 (Incremental_input_entry_reader::get_input_section_count): Call
991 accessor function for type.
992 (Incremental_input_entry_reader::get_symbol_offset): Call accessor
993 function for type; adjust size of global symbol entry.
994 (Incremental_input_entry_reader::get_global_symbol_count): Call
995 accessor function for type.
996 (Incremental_input_entry_reader::get_object_count): Likewise.
997 (Incremental_input_entry_reader::get_object_offset): Likewise.
998 (Incremental_input_entry_reader::get_member_count): Likewise.
999 (Incremental_input_entry_reader::get_unused_symbol_count): Likewise.
1000 (Incremental_input_entry_reader::get_member_offset): Likewise.
1001 (Incremental_input_entry_reader::get_unused_symbol): Likewise.
1002 (Incremental_input_entry_reader::Global_symbol_info): Remove.
1003 (Incremental_input_entry_reader::get_global_symbol_info): Remove.
1004 (Incremental_input_entry_reader::get_global_symbol_reader): New
1005 function.
1006 (Incremental_input_entry_reader::get_output_symbol_index): New
1007 function.
1008 (Incremental_input_entry_reader::type_): Remove.
1009 (Incremental_input_entry_reader::flags_): New data member.
1010 (Incremental_inputs_reader::input_file_offset): New function.
1011 (Incremental_inputs_reader::input_file_index): New function.
1012 (Incremental_inputs_reader::input_file): Call input_file_offset.
1013 (Incremental_inputs_reader::input_file_at_offset): New function.
1014 (Incremental_relocs_reader::get_r_type): Reformat.
1015 (Incremental_relocs_reader::get_r_shndx): Reformat.
1016 (Incremental_relocs_reader::get_r_offset): Reformat.
1017 (Incremental_relocs_reader::data): New function.
1018 (Incremental_binary::Incremental_binary): Initialize new data members.
1019 (Incremental_binary::check_inputs): Add cmdline parameter.
1020 (Incremental_binary::file_is_unchanged): Remove.
1021 (Input_reader::arg_serial): New function.
1022 (Input_reader::get_unused_symbol_count): New function.
1023 (Input_reader::get_unused_symbol): New function.
1024 (Input_reader::do_arg_serial): New function.
1025 (Input_reader::do_get_unused_symbol_count): New function.
1026 (Input_reader::do_get_unused_symbol): New function.
1027 (Incremental_binary::input_file_count): New function.
1028 (Incremental_binary::get_input_reader): Change signature to use
1029 index instead of filename.
1030 (Incremental_binary::file_has_changed): New function.
1031 (Incremental_binary::get_input_argument): New function.
1032 (Incremental_binary::get_library): New function.
1033 (Incremental_binary::get_script_info): New function.
1034 (Incremental_binary::init_layout): New function.
1035 (Incremental_binary::reserve_layout): New function.
1036 (Incremental_binary::output_file): New function.
1037 (Incremental_binary::do_check_inputs): New function.
1038 (Incremental_binary::do_file_is_unchanged): Remove.
1039 (Incremental_binary::do_file_has_changed): New function.
1040 (Incremental_binary::do_init_layout): New function.
1041 (Incremental_binary::do_reserve_layout): New function.
1042 (Incremental_binary::do_input_file_count): New function.
1043 (Incremental_binary::do_get_input_reader): Change signature.
1044 (Incremental_binary::input_args_map_): New data member.
1045 (Incremental_binary::library_map_): New data member.
1046 (Incremental_binary::script_map_): New data member.
1047 (Sized_incremental_binary::Sized_incremental_binary): Initialize
1048 new data members.
1049 (Sized_incremental_binary::output_section): New function.
1050 (Sized_incremental_binary::inputs_reader): Add const.
1051 (Sized_incremental_binary::symtab_reader): Add const.
1052 (Sized_incremental_binary::relocs_reader): Add const.
1053 (Sized_incremental_binary::got_plt_reader): Add const.
1054 (Sized_incremental_binary::get_symtab_view): New function.
1055 (Sized_incremental_binary::Inputs_reader): New typedef.
1056 (Sized_incremental_binary::Input_entry_reader): New typedef.
1057 (Sized_incremental_binary::do_check_inputs): Add cmdline parameter.
1058 (Sized_incremental_binary::do_file_is_unchanged): Remove.
1059 (Sized_incremental_binary::do_file_has_changed): New function.
1060 (Sized_incremental_binary::do_init_layout): New function.
1061 (Sized_incremental_binary::do_reserve_layout): New function.
1062 (Sized_input_reader::Inputs_reader): Remove.
1063 (Sized_input_reader::Input_entry_reader): Remove.
1064 (Sized_input_reader::do_arg_serial): New function.
1065 (Sized_input_reader::do_get_unused_symbol_count): New function.
1066 (Sized_input_reader::do_get_unused_symbol): New function.
1067 (Sized_incremental_binary::do_input_file_count): New function.
1068 (Sized_incremental_binary::do_get_input_reader): Change signature;
1069 use index instead of filename.
1070 (Sized_incremental_binary::section_map_): New data member.
1071 (Sized_incremental_binary::input_entry_readers_): New data member.
1072 (class Sized_incr_relobj): New class.
1073 (class Sized_incr_dynobj): New class.
1074 (make_sized_incremental_object): New function.
1075 (class Incremental_library): New class.
1076 * layout.cc (Free_list::num_lists): New static data member.
1077 (Free_list::num_nodes): New static data member.
1078 (Free_list::num_removes): New static data member.
1079 (Free_list::num_remove_visits): New static data member.
1080 (Free_list::num_allocates): New static data member.
1081 (Free_list::num_allocate_visits): New static data member.
1082 (Free_list::init): New function.
1083 (Free_list::remove): New function.
1084 (Free_list::allocate): New function.
1085 (Free_list::dump): New function.
1086 (Free_list::print_stats): New function.
1087 (Layout_task_runner::run): Resize output file for incremental updates.
1088 (Layout::Layout): Initialize new data members.
1089 (Layout::set_incremental_base): New function.
1090 (Layout::init_fixed_output_section): New function.
1091 (Layout::layout_eh_frame): Do not build .eh_frame_hdr section for
1092 incremental updates.
1093 (Layout::create_gold_note): Do not create gold note section for
1094 incremental updates.
1095 (Layout::set_segment_offsets): Do not recalculate RELRO alignment
1096 for incremental updates.
1097 (Layout::set_section_offsets): For incremental updates, allocate space
1098 from free list.
1099 (Layout::create_symtab_sections): Layout with offsets relative to
1100 start of section; for incremental updates, allocate space from free
1101 list.
1102 (Layout::create_shdrs): For incremental updates, allocate space from
1103 free list.
1104 (Layout::finish_dynamic_section): For incremental updates, do not
1105 check --as-needed (fixed in subsequent patch).
1106 * layout.h (class Free_list): New class.
1107 (Layout::set_incremental_base): New function.
1108 (Layout::incremental_base): New function.
1109 (Layout::init_fixed_output_section): New function.
1110 (Layout::allocate): New function.
1111 (Layout::incremental_base_): New data member.
1112 (Layout::free_list_): New data member.
1113 * main.cc (main): Print Free_list statistics.
1114 * object.cc (Relobj::finalize_incremental_relocs): Add
1115 clear_counts parameter; clear counts only when clear_counts is set.
1116 (Sized_relobj::Sized_relobj): Initialize new base class.
1117 (Sized_relobj::do_layout): Don't report special sections.
1118 (Sized_relobj::do_for_all_local_got_entries): New function.
1119 (Sized_relobj::write_local_symbols): Add symtab_off parameter; add
1120 symtab_off to all symbol table offsets.
1121 (Sized_relobj::do_get_global_symbol_counts): Add typename keyword.
1122 * object.h (class Got_offset_list): Move to top of file.
1123 (Object::Object): Allow case where input_file == NULL.
1124 (Object::~Object): Likewise.
1125 (Object::input_file): Assert that input_file != NULL.
1126 (Object::lock): Allow case where input_file == NULL.
1127 (Object::unlock): Likewise.
1128 (Object::is_locked): Likewise.
1129 (Object::token): Likewise.
1130 (Object::release): Likewise.
1131 (Object::is_incremental): New function.
1132 (Object::get_mtime): New function.
1133 (Object::for_all_local_got_entries): New function.
1134 (Object::clear_view_cache_marks): Allow case where input_file == NULL.
1135 (Object::set_is_in_system_directory): New function.
1136 (Object::is_in_system_directory): New function.
1137 (Object::do_is_incremental): New function.
1138 (Object::do_get_mtime): New function.
1139 (Object::do_for_all_local_got_entries): New function.
1140 (Object::is_in_system_directory_): New data member.
1141 (Relobj::finalize_incremental_relocs): Add clear_counts parameter.
1142 (class Sized_relobj_base): New class.
1143 (class Sized_relobj): Derive from Sized_relobj_base.
1144 (class Sized_relobj::Symbols): Redeclare from base class.
1145 (class Sized_relobj::local_got_offset_list): Remove.
1146 (class Sized_relobj::Output_sections): Redeclare from base class.
1147 (class Sized_relobj::do_for_all_local_got_entries): New function.
1148 (class Sized_relobj::write_local_symbols): Add offset parameter.
1149 (class Sized_relobj::local_symbol_offset_): Update comment.
1150 (class Sized_relobj::local_dynsym_offset_): Update comment.
1151 * options.cc (Input_arguments::add_file): Remove const.
1152 * options.h (Input_file_argument::Input_file_argument):
1153 Initialize arg_serial_ (all constructors).
1154 (Input_file_argument::set_arg_serial): New function.
1155 (Input_file_argument::arg_serial): New function.
1156 (Input_file_argument::arg_serial_): New data member.
1157 (Input_arguments::Input_arguments): Initialize file_count_.
1158 (Input_arguments::add_file): Remove const.
1159 (Input_arguments::number_of_input_files): New function.
1160 (Input_arguments::file_count_): New data member.
1161 (Command_line::number_of_input_files): Call
1162 Input_arguments::number_of_input_files.
1163 * output.cc (Output_segment_headers::Output_segment_headers):
1164 Set current size.
1165 (Output_section::Input_section::current_data_size): New function.
1166 (Output_section::Output_section): Initialize new data members.
1167 (Output_section::add_input_section): Don't do merge sections for
1168 an incremental link; allocate space from free list for an
1169 incremental update.
1170 (Output_section::add_output_section_data): Allocate space from
1171 free list for an incremental update.
1172 (Output_section::update_data_size): New function.
1173 (Output_section::set_fixed_layout): New function.
1174 (Output_section::reserve): New function.
1175 (Output_segment::set_section_addresses): Remove const.
1176 (Output_segment::set_section_list_addresses): Remove const; allocate
1177 space from free list for an incremental update.
1178 (Output_segment::set_offset): Adjust size of RELRO segment for an
1179 incremental update.
1180 * output.h (Output_data::current_data_size): Move here from
1181 child classes.
1182 (Output_data::pre_finalize_data_size): New function.
1183 (Output_data::update_data_size): New function.
1184 (Output_section_headers::update_data_size): new function.
1185 (Output_section_data_build::current_data_size): Move to Output_data.
1186 (Output_data_strtab::update_data_size): New function.
1187 (Output_section::current_data_size): Move to Output_data.
1188 (Output_section::set_fixed_layout): New function.
1189 (Output_section::has_fixed_layout): New function.
1190 (Output_section::reserve): New function.
1191 (Output_section::update_data_size): New function.
1192 (Output_section::has_fixed_layout_): New data member.
1193 (Output_section::free_list_): New data member.
1194 (Output_segment::set_section_addresses): Remove const.
1195 (Output_segment::set_section_list_addresses): Remove const.
1196 * plugin.cc (Sized_pluginobj::do_for_all_local_got_entries):
1197 New function.
1198 * plugin.h (Sized_pluginobj::do_for_all_local_got_entries):
1199 New function.
1200 * readsyms.cc (Read_symbols::do_read_symbols): Add library
1201 parameter when calling Add_symbols constructor; store argument
1202 serial number for members of a lib group.
1203 (Add_symbols::locks): Allow case where token == NULL.
1204 (Add_symbols::run): Report libraries denoted by --start-lib/--end-lib.
1205 (Read_member::~Read_member): New function.
1206 (Read_member::is_runnable): New function.
1207 (Read_member::locks): New function.
1208 (Read_member::run): New function.
1209 (Check_script::~Check_script): New function.
1210 (Check_script::is_runnable): New function.
1211 (Check_script::locks): New function.
1212 (Check_script::run): New function.
1213 (Check_library::~Check_library): New function.
1214 (Check_library::is_runnable): New function.
1215 (Check_library::locks): New function.
1216 (Check_library::run): New function.
1217 * readsyms.h (Add_symbols::Add_symbols): Add library parameter.
1218 (Add_symbols::library_): New data member.
1219 (class Read_member): New class.
1220 (class Check_script): New class.
1221 (class Check_library): New class.
1222 * reloc.cc (Read_relocs::is_runnable): Allow case where
1223 token == NULL.
1224 (Read_relocs::locks): Likewise.
1225 (Scan_relocs::locks): Likewise.
1226 (Relocate_task::locks): Likewise.
1227 (Sized_relobj::do_scan_relocs): Tell finalize_incremental_relocs
1228 to clear counters.
1229 (Sized_relobj::incremental_relocs_scan): Fix comment.
1230 (Sized_relobj::do_relocate): Pass output file offset to
1231 write_local_symbols.
1232 (Sized_relobj::incremental_relocs_write_reltype): Use reloc_size
1233 from class declaration.
1234 * script.cc (read_input_script): Allocate Script_info; pass
1235 argument serial number to report_script.
1236 * script.h (class Script_info): Move to incremental.h.
1237 * symtab.cc (Symbol_table::add_from_incrobj): New function.
1238 * symtab.h (Symbol_table::add_from_incrobj): New function.
1239 (Symbol_table::set_file_offset): New function.
1240
b961d0d7
CC
12412011-04-05 Cary Coutant <ccoutant@google.com>
1242
1243 * incremental-dump.cc (dump_incremental_inputs): Change signature
1244 to take a Sized_incremental_binary; change caller. Use readers
1245 in Sized_incremental_binary.
1246 * incremental.cc
1247 (Sized_incremental_binary::find_incremental_inputs_sections):
1248 Rename do_find_incremental_inputs_sections to this.
1249 (Sized_incremental_binary::setup_readers): New function.
1250 (Sized_incremental_binary::do_check_inputs): Check
1251 has_incremental_info_ flag; move setup code to setup_readers;
1252 use input readers.
1253 (Sized_incremental_binary::do_file_is_unchanged): New function.
1254 (Sized_incremental_binary::do_get_input_reader): New function.
1255 * incremental.h (class Incremental_binary): Move to end of file.
1256 (Incremental_binary::file_is_unchanged): New function.
1257 (Incremental_binary::do_file_is_unchanged): New function.
1258 (Incremental_binary::Input_reader): New class.
1259 (Incremental_binary::get_input_reader): New function.
1260 (class Sized_incremental_binary): Move to end of file.
1261 (Sized_incremental_binary::Sized_incremental_binary): Setup the
1262 input section reader classes.
1263 (Sized_incremental_binary::has_incremental_info): New function.
1264 (Sized_incremental_binary::inputs_reader): New function.
1265 (Sized_incremental_binary::symtab_reader): New function.
1266 (Sized_incremental_binary::relocs_reader): New function.
1267 (Sized_incremental_binary::got_plt_reader): New function.
1268 (Sized_incremental_binary::do_file_is_unchanged): New function.
1269 (Sized_incremental_binary::Sized_input_reader): New class.
1270 (Sized_incremental_binary::get_input_reader): New function.
1271 (Sized_incremental_binary::find_incremental_inputs_sections):
1272 Rename do_find_incremental_inputs_sections to this.
1273 (Sized_incremental_binary::setup_readers): New function.
1274 (Sized_incremental_binary::has_incremental_info_): New data member.
1275 (Sized_incremental_binary::inputs_reader_): New data member.
1276 (Sized_incremental_binary::symtab_reader_): New data member.
1277 (Sized_incremental_binary::relocs_reader_): New data member.
1278 (Sized_incremental_binary::got_plt_reader_): New data member.
1279 (Sized_incremental_binary::current_input_file_): New data member.
1280
a869183f
PP
12812011-04-05 Paul Pluzhnikov <ppluzhnikov@google.com>
1282
1283 PR gold/12640
1284 * dwarf_reader.cc (Sized_dwarf_line_info): Fix vector bounds
1285 violation.
1286
12872011-03-30 Cary Coutant <ccoutant@google.com>
c7975edd
CC
1288
1289 * archive.cc (Archive::include_member): Adjust call to report_object.
1290 (Add_archive_symbols::run): Add script_info to call to
1291 report_archive_begin.
1292 (Lib_group::include_member): Adjust call to report_object.
1293 (Add_lib_group_symbols::run): Adjust call to report_object.
1294 * incremental-dump.cc (dump_incremental_inputs): Remove unnecessary
1295 blocks. Add object count for script input files.
1296 * incremental.cc (Incremental_inputs::report_archive_begin): Add
1297 script_info parameter; change all callers.
1298 (Incremental_inputs::report_object): Add script_info parameter;
1299 change all callers.
1300 (Incremental_inputs::report_script): Store backpointer to
1301 incremental info entry.
1302 (Output_section_incremental_inputs::set_final_data_size): Record
1303 additional information for scripts.
1304 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1305 * incremental.h (Incremental_script_entry::add_object): New function.
1306 (Incremental_script_entry::get_object_count): New function.
1307 (Incremental_script_entry::get_object): New function.
1308 (Incremental_script_entry::objects_): New data member; adjust
1309 constructor.
1310 (Incremental_inputs::report_archive_begin): Add script_info parameter.
1311 (Incremental_inputs::report_object): Add script_info parameter.
1312 (Incremental_inputs_reader::get_object_count): New function.
1313 (Incremental_inputs_reader::get_object_offset): New function.
1314 * options.cc (Input_arguments::add_file): Return reference to
1315 new input argument.
1316 * options.h (Input_argument::set_script_info): New function.
1317 (Input_argument::script_info): New function.
1318 (Input_argument::script_info_): New data member; adjust all
1319 constructors.
1320 (Input_file_group::add_file): Return reference to new input argument.
1321 (Input_file_lib::add_file): Likewise.
1322 (Input_arguments::add_file): Likewise.
1323 * readsyms.cc (Add_symbols::run): Adjust call to report_object.
1324 * script.cc (Parser_closure::Parser_closure): Add script_info
1325 parameter; adjust all callers.
1326 (Parser_closure::script_info): New function.
1327 (Parser_closure::script_info_): New data member.
1328 (read_input_script): Report scripts earlier to incremental info.
1329 (script_add_file): Set script_info in Input_argument.
1330 (script_add_library): Likewise.
1331 * script.h (Script_options::Script_info): Rewrite class.
1332
a869183f 13332011-03-29 Cary Coutant <ccoutant@google.com>
e0c52780
CC
1334
1335 * archive.cc (Library_base::should_include_member): Move
1336 method here from class Archive.
1337 (Archive::Archive): Initialize base class.
1338 (Archive::should_include_member): Move to base class.
1339 (Archive::do_for_all_unused_symbols): New function.
1340 (Add_archive_symbols::run): Remove redundant access to
1341 incremental_inputs.
1342 (Lib_group::Lib_group): Initialize base class.
1343 (Lib_group::do_filename): New function.
1344 (Lib_group::include_member): Pass pointer to Lib_group to
1345 report_object.
1346 (Lib_group::do_for_all_unused_symbols): New function.
1347 (Add_lib_group_symbols::run): Report archive information for
1348 incremental links.
1349 * archive.h (class Library_base): New base class.
1350 (class Archive): Derive from Library_base.
1351 (Archive::filename): Move to base class.
1352 (Archive::set_incremental_info): Likewise.
1353 (Archive::incremental_info): Likewise.
1354 (Archive::Should_include): Likewise.
1355 (Archive::should_include_member): Likewise.
1356 (Archive::Armap_entry): Remove.
1357 (Archive::Unused_symbol_iterator): Remove.
1358 (Archive::unused_symbols_begin): Remove.
1359 (Archive::unused_symbols_end): Remove.
1360 (Archive::do_filename): New function.
1361 (Archive::do_get_mtime): New function.
1362 (Archive::do_for_all_unused_symbols): New function.
1363 (Archive::task_): Move to base class.
1364 (Archive::incremental_info_): Likewise.
1365 (class Lib_group): Derive from Library_base.
1366 (Lib_group::do_filename): New function.
1367 (Lib_group::do_get_mtime): New function.
1368 (Lib_group::do_for_all_unused_symbols): New function.
1369 (Lib_group::task_): Move to base class.
1370 * dynobj.cc (Sized_dynobj::do_for_all_global_symbols): New
1371 function.
1372 * dynobj.h (Sized_dynobj::do_for_all_global_symbols): New
1373 function.
1374 * incremental.cc (Incremental_inputs::report_archive_begin):
1375 Use Library_base; call library's get_mtime; add incremental inputs
1376 entry before members.
1377 (class Unused_symbol_visitor): New class.
1378 (Incremental_inputs::report_archive_end): Use Library_base; use
1379 visitor class to record unused symbols; don't add incremental inputs
1380 entry after members.
1381 (Incremental_inputs::report_object): Use Library_base.
1382 * incremental.h
1383 (Incremental_archive_entry::Incremental_archive_entry): Remove
1384 unused Archive parameter.
1385 (Incremental_inputs::report_archive_begin): Use Library_base.
1386 (Incremental_inputs::report_archive_end): Likewise.
1387 (Incremental_inputs::report_object): Likewise.
1388 * object.cc (Sized_relobj::do_for_all_global_symbols): New
1389 function.
1390 * object.h (Object::for_all_global_symbols): New function.
1391 (Object::do_for_all_global_symbols): New function.
1392 (Sized_relobj::do_for_all_global_symbols): New function.
1393 * plugin.cc (Sized_pluginobj::do_for_all_global_symbols): New
1394 function.
1395 * plugin.h (Sized_pluginobj::do_for_all_global_symbols): New
1396 function.
1397
61ab3e40
ILT
13982011-03-27 Ian Lance Taylor <iant@google.com>
1399
1400 * archive.cc (Archive::interpret_header): Return -1 if something
1401 goes wrong. Change callers accordingly.
1402
30e1f9e6
CC
14032011-03-25 Cary Coutant <ccoutant@google.com>
1404
1405 * testsuite/Makefile.am (final_layout.stdout): Use -n option with nm.
1406 * testsuite/Makefile.in: Regenerate.
1407
9c793f14
RÁE
14082010-03-23 Rafael Ávila de Espíndola <respindola@mozilla.com>
1409
1410 * plugin.cc (get_view): New.
1411 (Plugin::load): Pass get_view to the plugin.
1412 (Plugin_manager::get_view): New.
1413
9312bb0a
ILT
14142011-03-21 Ian Lance Taylor <iant@google.com>
1415
1416 * testsuite/final_layout.sh: Rewrite to not use dc.
07aead7b 1417 * testsuite/relro_test.sh: Fail if dc is not present.
9312bb0a 1418
7e12ba9e
ST
14192011-03-21 Sriraman Tallam <tmsriram@google.com>
1420
1421 * testsuite/icf_safe_so_test.sh: Add #!/bin/sh to start.
1422 Change == to -eq.
1423 * testsuite/icf_string_merge_test.sh: Add #!/bin/sh to start.
1424 * testsuite/icf_safe_test.sh: Add #!/bin/sh to start.
1425 Change == to -eq.
1426 * testsuite/icf_sht_rel_addend_test.sh: Add #!/bin/sh to start.
1427 * testsuite/icf_preemptible_functions_test.sh: Add #!/bin/sh to start.
1428
fd7a005d
ILT
14292011-03-14 Ian Lance Taylor <iant@google.com>
1430
1431 * script-sections.cc (Sort_output_sections::script_compare):
1432 Rename from is_before, change return type.
1433 (Sort_output_sections::operator()): Adjust accordingly.
1434
ed16fd1b
ILT
14352011-03-11 Jeffrey Yasskin <jyasskin@google.com>
1436
1437 PR gold/12572
1438 * testsuite/odr_violation2.cc: Add comment to make all error line
1439 numbers double digits.
1440 * testsuite/debug_msg.sh: Adjust expected errors.
1441
71ff8986
ILT
14422011-03-09 Jeffrey Yasskin <jyasskin@google.com>
1443
1444 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
1445 but mark earlier ones as non-canonical
1446 (offset_to_iterator): Update search target and example
1447 (do_addr2line): Return extra lines in a vector*
1448 (format_file_lineno): Extract from do_addr2line
1449 (one_addr2line): Add vector* out-param
1450 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
1451 when a lineno entry appeared last for its instruction
1452 (Dwarf_line_info): Add vector* out-param
1453 * object.cc (Relocate_info): Pass NULL for the vector* out-param
1454 * symtab.cc (Odr_violation_compare): Include the lineno in the
1455 comparison again.
1456 (linenos_from_loc): New. Combine the canonical line for an
1457 address with its other lines.
1458 (True_if_intersect): New. Helper functor to make
1459 std::set_intersection a query.
1460 (detect_odr_violations): Compare sets of lines instead of just
1461 one line for each function. This became less deterministic, but
1462 has fewer false positives.
1463 * symtab.h: Declarations.
1464 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
1465 mix an optimized and non-optimized object in the same binary
1466 (odr_violation2.so): Same.
1467 * testsuite/Makefile.in: Regenerate from Makefile.am.
1468 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
1469 * testsuite/debug_msg.sh: Update line numbers and add
1470 assertions.
1471 * testsuite/odr_violation1.cc: Use OdrDerived, in a
1472 non-optimized context.
1473 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
1474 isn't inlined, and use OdrDerived in an optimized context.
1475 * testsuite/odr_header1.h: Defines OdrDerived, where
1476 optimization will change the
1477 first-instruction-in-the-destructor's file and line number.
1478 * testsuite/odr_header2.h: Defines OdrBase.
1479
a19fefdc
ILT
14802011-03-09 Ian Lance Taylor <iant@google.com>
1481
1482 * fileread.cc (File_read::clear_views): Don't delete the whole
1483 file view.
1484
ecb351e9
ILT
14852011-03-08 Ian Lance Taylor <iant@google.com>
1486
1487 PR gold/12525
1488 * fileread.cc: #include <climits>.
1489 (GOLD_IOV_MAX): Define.
1490 (File_read::read_multiple): Limit number of entries by iov_max.
1491 * fileread.h (class File_read): Always set max_readv_entries to
1492 128.
1493
b821d13c
ILT
14942011-03-07 Ian Lance Taylor <iant@google.com>
1495
1496 PR gold/12525
1497 * options.h (class General_options): Add -dy and -dn.
1498
89243142
CC
14992011-03-02 Cary Coutant <ccoutant@google.com>
1500
1501 * testsuite/script_test_9.t: Add TLS segment.
1502
d0773f31
ILT
15032011-03-02 Simon Baldwin <simonb@google.com>
1504
1505 * configure.ac: Add check for gnu_indirect_function support in
1506 the toolchain building binutils.
1507 * configure: Rebuild.
1508
badc8139
RÁE
15092010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
1510
1511 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
1512 plugin only symbols.
1513 (Symbol_table::sized_finalize_symbol) Mark symbol only present
1514 in plugin files as not needed in the symbol table.
1515
4cf7a849
ST
15162011-02-11 Sriraman Tallam <tmsriram@google.com>
1517
1518 * output.cc (Output_section::add_input_section): Delay fill
1519 generation for section ordering.
1520
b578bd7d
ILT
15212011-02-09 Ian Lance Taylor <iant@google.com>
1522
1523 PR gold/12316
1524 * object.h (class Sized_relobj): Remove clear_local_symbols.
1525 * reloc.cc (Sized_relobj::do_relocate): Don't call
1526 clear_local_symbols.
1527
84ced98a
RÁE
15282010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
1529
1530 * plugin.cc (is_visible_from_outside): Return true for symbols
1531 in the -u option.
1532
55382fb7
ILT
15332011-02-04 Jeffrey Yasskin <jyasskin@google.com>
1534
1535 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
1536 filename.
1537
4e271fff
ST
15382011-02-02 Sriraman Tallam <tmsriram@google.com>
1539
1540 * icf.h (is_section_foldable_candidate): Change type of parameter
1541 to std::string.
1542 * icf.cc (Icf::find_identical_sections): Change type of local variable
1543 section_name to be std::string.
1544 (is_function_ctor_or_dtor): Change type of parameter to std::string.
1545
d433c3ac
ILT
15462011-01-25 Ian Lance Taylor <iant@google.com>
1547
1548 * script.cc (script_add_extern): Rewrite to use
1549 add_symbol_reference.
1550
880473a6
DK
15512011-01-25 Doug Kwan <dougkwan@google.com>
1552
d433c3ac 1553 * icf.cc (get_section_contents): Always lock section's object.
880473a6 1554
f30f86fa
ILT
15552011-01-24 Ian Lance Taylor <iant@google.com>
1556
1557 * options.h (class General_options): Accept
1558 --no-detect-odr-violations.
1559
8e51a0b9
ILT
15602011-01-24 Ian Lance Taylor <iant@google.com>
1561
1562 * version.cc (version_string): Bump to 1.11.
1563
0f3b89d8
ILT
15642011-01-24 Ian Lance Taylor <iant@google.com>
1565
1566 * plugin.cc (class Plugin_rescan): Define new class.
1567 (Plugin_manager::claim_file): Set any_claimed_.
1568 (Plugin_manager::save_archive): New function.
1569 (Plugin_manager::save_input_group): New function.
1570 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
1571 necessary.
1572 (Plugin_manager::new_undefined_symbol): New function.
1573 (Plugin_manager::rescan): New function.
1574 (Plugin_manager::rescannable_defines): New function.
1575 (Plugin_manager::add_input_file): Set any_added_.
1576 * plugin.h (class Plugin_manager): define new fields rescannable_,
1577 undefined_symbols_, any_claimed_, and any_added_. Declare
1578 Plugin_rescan as friend. Declare new functions.
1579 (Plugin_manager::Rescannable): Define type.
1580 (Plugin_manager::Rescannable_list): Define type.
1581 (Plugin_manager::Undefined_symbol_list): Define type.
1582 (Plugin_manager::Plugin_manager): Initialize new fields.
1583 * archive.cc (Archive::defines_symbol): New function.
1584 (Add_archive_symbols::run): Pass archive to plugins if any.
1585 * archive.h (class Archive): Declare defines_symbol.
1586 * readsyms.cc (Input_group::~Input_group): New function.
1587 (Finish_group::run): Pass input_group to plugins if any.
1588 * readsyms.h (class Input_group): Declare destructor.
1589 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
1590 any.
1591
3bb951e5
ILT
15922011-01-10 Ian Lance Taylor <iant@google.com>
1593
1594 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
1595 section as relro.
1596 (Layout::set_segment_offsets): Reset increase_relro before calling
1597 set_section_addresses a second time.
1598
0aa45fac
CC
15992011-01-04 Cary Coutant <ccoutant@google.com>
1600
1601 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
1602 sections before NOBITS sections.
1603
0db46eb4
L
16042011-01-01 H.J. Lu <hongjiu.lu@intel.com>
1605
1606 * version.cc (print_version): Update copyright to 2011.
1607
829c9745
CC
16082010-12-23 Cary Coutant <ccoutant@google.com>
1609
1610 * output.h (Output_data_reloc::add_output_section): Pass OD instead
1611 of OS to this->add. Add OD parameter to second form of the function.
1612
7500420b
ILT
16132010-12-20 Ian Lance Taylor <iant@google.com>
1614
1615 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
1616 second of two consecutive entries with same offset.
1617
f8e9a930
RW
16182010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1619
1620 * testsuite/Makefile.am (ifuncmain2static_LDADD)
1621 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
1622 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
1623 to avoid unneeded links against $(LDADD).
1624 * testsuite/Makefile.in: Regenerate.
1625
2fbb4320
ILT
16262010-12-15 Ian Lance Taylor <iant@google.com>
1627
1628 PR gold/12324
1629 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
1630 for R_X86_64_32 and R_X86_64_PC32.
1631 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
1632 ver_matching_def_pic.o.
1633 (ver_matching_def_pic.o): New target.
1634
fedb228d
RW
16352010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1636
1637 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
1638 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
1639 Move definition before File_read::View member definitions.
1640 (File_read::View::~View): Initialize and hold lock before
1641 updating current_mapped_bytes.
1642
9b547ce6
RW
16432010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1644
1645 * dwarf_reader.cc: Remove outdated comment.
1646 * gold-threads.cc: Fix typo in error message.
1647 * archive.cc: Fix typos in comments.
1648 * archive.h: Likewise.
1649 * arm-reloc-property.cc: Likewise.
1650 * arm-reloc-property.h: Likewise.
1651 * arm-reloc.def: Likewise.
1652 * arm.cc: Likewise.
1653 * attributes.h: Likewise.
1654 * cref.cc: Likewise.
1655 * ehframe.cc: Likewise.
1656 * fileread.h: Likewise.
1657 * gold.h: Likewise.
1658 * i386.cc: Likewise.
1659 * icf.cc: Likewise.
1660 * incremental.h: Likewise.
1661 * int_encoding.cc: Likewise.
1662 * layout.h: Likewise.
1663 * main.cc: Likewise.
1664 * merge.h: Likewise.
1665 * object.cc: Likewise.
1666 * object.h: Likewise.
1667 * options.cc: Likewise.
1668 * readsyms.cc: Likewise.
1669 * reduced_debug_output.cc: Likewise.
1670 * reloc.cc: Likewise.
1671 * script-sections.cc: Likewise.
1672 * sparc.cc: Likewise.
1673 * symtab.h: Likewise.
1674 * target-reloc.h: Likewise.
1675 * target.cc: Likewise.
1676 * target.h: Likewise.
1677 * timer.cc: Likewise.
1678 * timer.h: Likewise.
1679 * x86_64.cc: Likewise.
1680
83e17bd5
CC
16812010-12-09 Cary Coutant <ccoutant@google.com>
1682
1683 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
1684 stack.
1685 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
1686 parameter; change all callers.
1687 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
1688 * options.h (warn_execstack): New option.
1689
017257f8
DK
16902010-12-07 Doug Kwan <dougkwan@google.com>
1691
1692 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
1693 like function call relocations.
1694
c20cbc06
ILT
16952010-12-07 Ian Lance Taylor <iant@google.com>
1696
1697 * archive.cc (Archive::get_elf_object_for_member): Permit
1698 punconfigured to be NULL.
1699 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
1700 (Archive::include_member): Pass NULL to get_elf_object_for_member
1701 if we searched for the archive and this is the first included
1702 object.
1703
4dbfafcc
ILT
17042010-12-01 Ian Lance Taylor <iant@google.com>
1705
1706 * dwarf_reader.h (class Sized_dwarf_line_info): Add
1707 track_relocs_type_ field.
1708 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1709 Set track_relocs_type_.
1710 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
1711 contents when using RELA relocs.
1712 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
1713 reloc_map_.
1714 * reloc.cc (Track_relocs::next_addend): New function.
1715 * reloc.h (class Track_relocs): Declare next_addend.
1716
e5e19edd
ILT
17172010-12-01 Ian Lance Taylor <iant@google.com>
1718
1719 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
1720 virtual destructor.
1721
9a5ce24c
ILT
17222010-12-01 Ian Lance Taylor <iant@google.com>
1723
1724 * README: Update compilers known to work and fail.
1725
c7791212
NC
17262010-11-23 Matthias Klose <doko@ubuntu.com>
1727
1728 * configure.in: For --enable-gold, handle value `default' instead of
1729 `both*'. Always install ld as ld.bfd, install as ld if gold is
1730 not the default.
1731 * configure: Regenerate.
1732
0ad220c9
DK
17332010-11-18 Doug Kwan <dougkwan@google.com>
1734
1735 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
1736 and right_alignment to be zero. Store result alignment only if it is
1737 greater than existing alignment.
1738
ab8056e0
CC
17392010-11-16 Cary Coutant <ccoutant@google.com>
1740
1741 PR gold/12220
1742 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
1743 Check for ".zdebug_line".
1744
fd064a5b
CC
17452010-11-16 Doug Kwan <dougkwan@google.com>
1746 Cary Coutant <ccoutant@google.com>
1747
1748 * output.h (Output_segment::set_section_addresses): Pass increase_relro
1749 by reference; adjust all callers.
1750 * output.cc (Output_segment::set_section_addresses): Adjust references
1751 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
1752 list is empty.
1753 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
1754 end at page boundary.
1755
6fc6ea19
CC
17562010-11-16 Cary Coutant <ccoutant@google.com>
1757
1758 PR gold/12220
1759 * layout.cc (Layout::choose_output_section): Transform names of
1760 compressed sections even when using a script with a SECTIONS clause.
1761 (Layout::output_section_name): Remove code to transform
1762 compressed debug section names.
1763 * output.cc (Output_section::add_input_section): Use uncompressed
1764 section size when tracking input sections.
1765
95a2c8d6
RS
17662010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
1767
1768 * symtab.h (Symbol::NON_PIC_REF): Remove.
1769 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
1770 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
1771 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
1772 (Symbol::use_plt_offset): Take a flags argument and pass it
1773 directly to needs_dynamic_reloc. Restrict check for undefined
1774 weak symbols to function calls.
1775 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
1776 (Target_arm::Scan::global): Use it.
1777 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
1778 (Target_arm::Relocate::relocate): Likewise.
1779 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
1780 parameter with an r_type parameter. Use get_reference_flags
1781 to get the flags.
1782 (Target_arm::Relocate::relocate): Update accordingly.
1783 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
1784 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
1785 (Target_i386::Scan::global): Likewise.
1786 (Target_i386::Relocate::relocate): Likewise.
1787 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
1788 parameter with an r_type parameter. Use get_reference_flags
1789 to get the flags.
1790 (Target_i386::Relocate::relocate): Update accordingly.
1791 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
1792 (Target_powerpc::Scan::global): Use it.
1793 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
1794 (Target_powerpc::Relocate::relocate): Likewise.
1795 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
1796 (Target_sparc::Scan::global): Use it.
1797 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
1798 (Target_sparc::Relocate::relocate): Likewise.
1799 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
1800 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
1801 (Target_x86_64::Scan::global): Likewise.
1802 (Target_x86_64::Relocate::relocate): Likewise.
1803
f625ae50
DK
18042010-11-08 Doug Kwan <dougkwan@google.com>
1805 Cary Coutant <ccoutant@google.com>
1806
1807 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
1808 (Arm_exidx_merge_section::section_contents_): New data member.
1809 (Arm_input_section::Arm_input_section): Initialize original_contents_.
1810 (Arm_input_section::~Arm_input_section): De-allocate memory.
1811 (Arm_input_section::original_contents_): New data member.
1812 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
1813 in parameters instead of calling Object::section_contents without
1814 locking.
1815 (Arm_output_section::group_section): New parameter TASK. Pass it
1816 to callees that need locking objects.
1817 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
1818 to lock EXIDX input sections. Fix a formatting issue. Call
1819 Arm_exidx_merged_section::build_contents to create merged section
1820 contents.
1821 (Arm_output_section::create_stub_group): New parameter TASK. Use it
1822 to lock object of stub table owner.
1823 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
1824 TEXT_SIZE to initialize data member TEXT_SIZE_.
1825 (Arm_exidx_input_section::addralign): Fix typo in comment.
1826 (Arm_exidx_input_section::text_size): New method.
1827 (Target_arm::do_relax): New parameter TASK. Pass it to callees
1828 that require locking objects. Lock objects before scanning for stubs
1829 and updating local symbols.
1830 (Arm_input_section<big_endian>::init): Copy contents of original
1831 input section.
1832 (Arm_input_section<big_endian>::do_write): Use saved contents of
1833 original input section instead of calling Object::section_contents
1834 without locking.
1835 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
1836 size without calling Object::section_size().
1837 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
1838 for size. Allocate a buffer for merged EXIDX entries.
1839 (Arm_exidx_merged_section::build_contents): New method.
1840 (Arm_exidx_merged_section::do_write): Move merge section contents
1841 building code to Arm_exidx_merged_section::build_contetns. Write
1842 out contetns in buffer instead of building it on the fly.
1843 (Arm_relobj::make_exidx_input_section): Also pass text section size
1844 to Arm_exidx_input_section constructor.
1845 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
1846 (Arm_dynobj::do_read_symbols): Fix memory leak.
1847 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
1848 * target.h: (class Task): Add forward declaration.
1849 (Target::relax): Add new parameter TASK and pass it to
1850 Target::do_relax().
1851 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
1852
5f9bcf58
CC
18532010-11-05 Cary Coutant <ccoutant@google.com>
1854
1855 PR gold/10708
1856 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
1857 object when reading from the file.
1858 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
1859 second layout pass.
1860 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
1861 when reading section contents.
1862 (get_section_contents): Likewise.
1863 (icf::find_identical_sections): Likewise.
1864 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
1865 object when reading from the file.
1866 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
1867 the object when doing deferred section layout.
1868
e597fa08
NC
18692010-11-03 Nick Clifton <nickc@redhat.com>
1870
1871 PR gold/12001
1872 * script.h (class Symbol_assignment: name): New member. Returns
1873 the name of the symbol.
1874 * scrfipt.cc (Script_options::is_pending_assignment): New member.
1875 Returns true if the given symbol name is on the list of
1876 assignments wating to be processed.
1877 * archive.cc (should_incldue_member): If the symbol is undefined,
1878 check to see if it is on the list of symbols pending assignment.
1879
3f9a3278
ILT
18802010-11-03 Ryan Mansfield <rmansfield@qnx.com>
1881
1882 * script-sections.cc (Script_sections::find_memory_region): Check
1883 for a NULL output section pointer.
1884
d06fb4d1
DK
18852010-10-29 Doug Kwan <dougkwan@google.com>
1886
1887 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
1888 Output_section::add_relaxed_input_section.
1889 * output.cc (Output_section::add_relaxed_input_section): Add new
1890 arguments LAYOUT and NAME. Set section order index.
1891 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
1892 Copy section order index.
1893 * output.h (Output_section::add_relaxed_input_section): Add new
1894 arguments LAYOUT and NAME.
1895
90e24de5
ILT
18962010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1897
1898 * testsuite/Makefile.am: Move gcctestdir/ld rule to
1899 NATIVE_OR_CROSS_LINKER.
1900 * testsuite/Makefile.in: Regenerate.
1901
c9484ea5
DK
19022010-10-20 Doug Kwan <dougkwan@google.com>
1903
1904 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
1905 without SHF_LINK_ORDER flags.
1906 * layout.cc (Layout::choose_output_section): Do not filter
1907 SHF_LINK_ORDER flag in a relocatable link.
1908
5bc2f5be
CC
19092010-10-17 Cary Coutant <ccoutant@google.com>
1910
1911 * output.h (Output_segment::set_section_addresses): Change function
1912 signature. Update all callers.
1913 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
1914 sections.
1915 (Output_segment::set_section_addresses): Align after last TLS
1916 section. Add padding before last relro section instead of after.
1917
0c91cf04
DK
19182010-10-17 Doug Kwan <dougkwan@google.com>
1919
1920 * gold/arm.cc (Target_arm::got_section): Use correct order and set
1921 GOT output section to be writable.
1922
8c21d9d3
CC
19232010-10-14 Cary Coutant <ccoutant@google.com>
1924
1925 * debug.h (DEBUG_INCREMENTAL): New flag.
1926 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
1927 * gold.cc (queue_initial_tasks): Check parameters for incremental link
1928 mode.
1929 * incremental.cc (report_command_line): Ignore all forms of
1930 --incremental.
1931 * layout.cc (Layout::Layout): Check parameters for incremental link
1932 mode.
1933 * options.cc (General_options::parse_incremental): New function.
1934 (General_options::parse_no_incremental): New function.
1935 (General_options::parse_incremental_full): New function.
1936 (General_options::parse_incremental_update): New function.
1937 (General_options::incremental_mode_): New data member.
1938 (General_options::finalize): Check incremental_mode_.
1939 * options.h (General_options): Update help text for --incremental.
1940 Add --no-incremental, --incremental-full, --incremental-update.
1941 (General_options::Incremental_mode): New enum type.
1942 (General_options::incremental_mode): New function.
1943 (General_options::incremental_mode_): New data member.
1944 * parameters.cc (Parameters::incremental_mode_): New data member.
1945 (Parameters::set_options): Set incremental_mode_.
1946 (Parameters::set_incremental_full): New function.
1947 (Parameters::incremental): New function.
1948 (Parameters::incremental_update): New function.
1949 (set_parameters_incremental_full): New function.
1950 * parameters.h (Parameters::set_incremental_full): New function.
1951 (Parameters::incremental): New function.
1952 (Parameters::incremental_update): New function.
1953 (Parameters::incremental_mode_): New data member.
1954 (set_parameters_incremental_full): New function.
1955 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
1956 incremental link mode.
1957 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
1958 (Sized_relobj::do_relocate_sections): Likewise.
1959 * testsuite/Makefile.am (incremental_test): Use --incremental-full
1960 option.
1961 * testsuite/Makefile.in: Regenerate.
1962 * testsuite/incremental_test.sh: Filter all forms of --incremental.
1963
bb32aa18 19642010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
1965
1966 * script-sections.h (class Script_sections): Make
1967 Sections_elements typedef public.
1968 * script-sections.cc (class Sort_output_sections): Add elements_
1969 field. Add constructor which sets it; change all callers.
1970 (Sort_output_sections::is_before): New function.
1971 (Sort_output_sections::operator()): Call is_before.
1972 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
1973 conditional.
1974 * testsuite/script_test_10.sh: New test. Test script section
1975 order.
1976 * testsuite/script_test_10.t: Likewise.
1977 * testsuite/script_test_10.s: Likewise.
1978 * testsuite/Makefile.am: Wrap the cross linker tests and the
1979 common tests into NATIVE_OR_CROSS_LINKER.
1980 (check_SCRIPTS): Add script_test_10.sh.
1981 (check_DATA): Add script_test_10.stdout.
1982 (script_test_10.o, script_test_10): New targets.
1983 (script_test_10.stdout): New target.
1984 * configure, testsuite/Makefile.in: Regenerate.
1985
3cef7179
ILT
19862010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1987
1988 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
1989 error for the deprecated relocations.
1990 (Target_arm::Scan::global): Likewise.
1991 (Target_arm::Relocate::relocate): Likewise.
1992
7411e9a8
RS
19932010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
1994
1995 * fileread.cc (Input_file::find_file): Initialize *found_name
1996 and *namep when using the fallback search for case 4.
1997
6a9da32a
CC
19982010-10-11 Cary Coutant <ccoutant@google.com>
1999
2000 * options.h (class General_options): Redefine -z lazy as an alias for
2001 the negation of -z now.
2002
ac897c20
ILT
20032010-10-11 Ian Lance Taylor <iant@google.com>
2004
2005 * resolve.cc (symbol_to_bits): Report the value of the unsupported
2006 binding.
2007
ea5cae92
NC
20082010-10-06 Nick Clifton <nickc@redhat.com>
2009
2010 * script-sections.cc(class Memory_region): Remove
2011 current_lma_offset_ field. Rename current_vma_offset_ to
2012 current_offset_. Add last_section_ field.
2013 (Memory_region::get_current_vma_address): Rename to
2014 get_current_address.
2015 (Memory_region::get_current_lma_address): Delete.
2016 (Memory_region::increment_vma_offset): Rename to
2017 increment_offset.
2018 (Memory_region::increment_lma_offset): Delete.
2019 (Memory_region::attributes_compatible): New method. Returns
2020 true if the provided section is compatible with the region.
2021 (Memory_region::get_last_section): New method. Returns the last
2022 section to use the region.
2023 (Memory_region::set_last_section): New method. Stores the last
2024 section to use the region.
2025 (Script_sections::block_in_region): New method. Returns true if
2026 a block of memory is contained within a region.
2027 (Script_sections::find_memory_region): New method. Locates a
2028 memory region to be used to set a VMA or LMA address.
2029 (Output_section_definition::set_section_addresses): Add code to
2030 check for addresses set by memory regions.
2031 (Output_segment::set_section_addresses): Remove memory region
2032 walking code.
2033 (Script_sections::create_segment): Add a warning if a header
2034 segment is created outside of any region.
2035 * script-sections.h (class Script_sections): Add prototypes for
2036 find_memory_region and block_in_region methods.
2037 * testsuite/memory_test.s: Use .long instead of .word.
2038 * testsuite/memory_test.t: Add some more output sections.
2039 * testsuite/memory_test.sh: Update expected output.
2040
a9bfd952
DK
20412010-10-02 Doug Kwan <dougkwan@google.com>
2042
2043 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
2044 defintion to symtab.h
2045 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
2046 declaration to defintion.
2047
bacff3ab
NC
20482010-10-01 Nick Clifton <nickc@redhat.com>
2049
2050 * expression.cc (eval): Replace dummy argument with NULL.
2051 (eval_maybe_dot): Check for a NULL result section pointer.
2052 (Symbol_expression::value): Likewise.
2053 (Dot_expression::value): Likewise.
2054 (BINARY_EXPRESSION): Likewise.
2055 (Max_expression::value): Likewise.
2056 (Min_expression::value): Likewise.
2057 (Absolute_expression::value): Likewise.
2058 (Addr_expression::value_from_output_section): Likewise.
2059 (Loaddddr_expression::value_from_output_section): Likewise.
2060 (Segment_start_expression::value): Likewise.
2061 * script-sections.cc
2062 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
2063 argument with NULL.
2064 (Sections_elememt_dot_assignment::set_section_addresses):
2065 Likewise.
2066 (Output_data_expression::do_write_to_buffer): Likewise.
2067 (Output_section_definition::finalize_symbols): Likewise.
2068 (Output_section_definition::set_section_addresses): Likewise.
2069
f81bc8b5
DK
20702010-09-30 Doug Kwan <dougkwan@google.com>
2071
2072 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
2073
c95e9f27
ST
20742010-09-28 Sriraman Tallam <tmsriram@google.com>
2075
2076 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 2077 function.
c95e9f27
ST
2078 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
2079 virtual function.
2080 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
2081 virtual function.
2082 * icf.cc (get_section_contents): Inline merge sections only when
2083 target allows it.
2084
3cac54d2
RW
20852010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2086
2087 * configure: Regenerate.
2088
2904037a
ILT
20892010-09-17 Ian Lance Taylor <iant@google.com>
2090
2091 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
2092 * testsuite/Makefile.am (memory_test.o): New target.
2093 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
2094 memory_test.t.
2095 * testsuite/Makefile.in: Rebuild.
2904037a 2096
bca7fb63
DK
20972010-09-17 Doug Kwan <dougkwan@google.com>
2098
2099 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
2100 defintion if relocation uses GOT entries of the symbol.
2101 * testsuite/icf_safe_test.sh: Fix test.
2102 * testsuite/icf_safe_so_test.sh: Fix test.
2103
4ef28648
CC
21042010-09-16 Cary Coutant <ccoutant@google.com>
2105
2106 * script_sections.cc (class Memory_region): Remove "NULL" from
2107 vector initializations.
2108
793990de
CC
21092010-09-15 Cary Coutant <ccoutant@google.com>
2110
2111 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
2112 Resolve forwarding symbols.
2113
81e015e2
DK
21142010-09-15 Doug Kwan <dougkwan@google.com>
2115
2116 * gold/testsuite/script_test_3.t: Add ARM special sections.
2117 * gold/testsuite/script_test_4.t: Same.
2118 * gold/testsuite/script_test_5.t: Same.
2119 * gold/testsuite/script_test_6.t: Same.
2120 * gold/testsuite/script_test_7.t: Same.
2121 * gold/testsuite/script_test_7.t: Same.
2122 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
2123
36171d64
CC
21242010-09-14 Cary Coutant <ccoutant@google.com>
2125
2126 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
2127 (Target_x86_64::Relocate::relocate_tls): Replace check for
2128 saw_tls_block_reloc_ with test for executable section.
2129
d89051bd
CC
21302010-09-12 Cary Coutant <ccoutant@google.com>
2131
2132 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
2133 position-independent executables to shared libraries need dynamic
2134 relocations.
2135 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
2136 position-independent executables.
2137 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
2138 * testsuite/Makefile.in: Regenerate.
2139
fca41f0f
NC
21402010-09-10 Nick Clifton <nickc@redhat.com>
2141
2142 PR gold/11997
2143 * testsuite/memory_test.t: Discard any sections that are not
2144 needed.
2145
6695e4b3
L
21462010-09-09 H.J. Lu <hongjiu.lu@intel.com>
2147
2148 PR gold/11996
2149 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
2150 "This::" to work around a bug in gcc 4.2.
2151
2152 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
2153
0f72bf6f
RÁE
21542010-09-09 Rafael Espindola <espindola@google.com>
2155
2156 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
2157 sections with different PF_X flags in the same segment.
2158 (Layout::find_first_load_seg): Search all segments to find the first
2159 one.
2160 * options.h (rosegment): New.
2161
21622010-09-08 Rafael Espindola <espindola@google.com>
a6577478 2163
05a79166 2164 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 2165
aa98ff75
DK
21662010-09-08 Doug Kwan <dougkwan@google.com>
2167
2168 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
2169 (Arm_relobj::do_relocate_sections): Add new parameter for output
2170 file to match the parent.
2171 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
2172 of local symbols instead of input values. Update code to track
2173 changes in gold::relocate_section.
2174 * object.cc (Sized_relobj::compute_final_local_value): New methods.
2175 (Sized_relobj::compute_final_local_value_internal): New methods.
2176 (Sized_relobj::do_finalize_local_symbols): Move code from loop
2177 body into private version of Sized_relobj::compute_final_local_value.
2178 Call the inline method.
2179 * object.h (Symbol_value::Symbol_value): Define destructor. Free
2180 merged symbol value if there is one.
2181 (Symbol_value::has_output_value): New method defintiion.
2182 (Sized_relobj::Compute_final_local_value_status): New enum type.
2183 (Sized_relobj::compute_final_local_value): New methods.
2184 (Sized_relobj::compute_final_local_value_internal): New methods.
2185 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
2186 and arm_cortex_a8.sh.
2187 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
2188 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
2189 New tests.
2190 * Makefile.in: Regenerate.
2191 * testsuite/arm_bl_out_of_range.s: Update test.
2192 * testsuite/thumb_bl_out_of_range.s: Ditto.
2193 * testsuite/thumb_blx_out_of_range.s: Ditto.
2194 * testsuite/arm_branch_out_of_range.sh: New file.
2195 * testsuite/arm_cortex_a8.sh: Ditto.
2196 * testsuite/arm_cortex_a8_b.s: Ditto.
2197 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
2198 * testsuite/arm_cortex_a8_b_local.s: Ditto.
2199 * testsuite/arm_cortex_a8_bl.s: Ditto.
2200 * testsuite/arm_cortex_a8_blx.s: Ditto.
2201 * testsuite/arm_cortex_a8_local.s: Ditto.
2202 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
2203 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
2204
05a79166
L
22052010-09-08 Rafael Espindola <espindola@google.com>
2206
2207 * Makefile.am (memory_test.stdout): Run readelf with -W.
2208 * Makefile.in: Regenerate.
2209 * testsuite/memory_test.sh: Make the regexps accept both 32 and
2210 64 bit output.
2211
33dbc701
RÁE
22122010-09-08 Rafael Espindola <espindola@google.com>
2213
2214 * script-sections.cc (Script_sections::add_memory_region): Convert
2215 field precision to int.
2216 * script.cc (script_set_section_region, script_set_section_region):
2217 Convert field precision to int.
2218
731ca54a
RÁE
22192010-09-08 Rafael Espindola <espindola@google.com>
2220
2221 * arm.cc (do_finalize_sections): Create the __exidx_start and
2222 __exdix_end symbols even when the section is missing.
2223
7f8cd844
NC
22242010-09-08 Nick Clifton <nickc@redhat.com>
2225
2226 * README: Remove claim that MEMORY is not supported.
2227 * expression.cc (script_exp_function_origin)
2228 (script_exp_function_length): Move from here to ...
2229 * script.cc: ... here.
2230 (script_set_section_region, script_add_memory)
2231 (script_parse_memory_attr, script_include_directive): New
2232 functions.
2233 * script-sections.cc
2234 (class Memory_region): New class.
2235 (class Output_section_definition): Add set_memory_region,
2236 set_section_vma, set_section_lma and get_section_name methods.
2237 (class Script_Sections): Add add_memory_region,
2238 find_memory_region, find_memory_region_origin,
2239 find_memory_region_length and set_memory_region methods.
2240 Have set_section_addresses method walk the list of set memory
2241 regions.
2242 Extend the print methos to display memory regions.
2243 * script-sections.h: Add prototypes for new methods.
2244 Add enum for MEMORY region attributes.
2245 * yyscript.y: Add support for parsing MEMORY regions.
2246 * script-c.h: Add prototypes for new functions.
2247 * testsuite/Makefile.am: Add test of MEMORY region functionality.
2248 * testsuite/Makefile.in: Regenerate.
2249 * testsuite/memory_test.sh: New script.
2250 * testsuite/memory_test.s: New assembler source file.
2251 * testsuite/memory_test.t: New linker script.
2252
a4649286
DK
22532010-08-27 Doug Kwan <dougkwan@google.com>
2254
2255 * gold/resolve.cc (Symbol_table::should_override): Let a weak
2256 reference override an existing dynamic weak reference.
2257 * testsuite/Makefile.am: Add new test dyn_weak_ref.
2258 * testsuite/Makefile.in: Regenerate.
2259 * testsuite/dyn_weak_ref.sh: New file.
2260 * testsuite/dyn_weak_ref_1.c: Ditto.
2261 * testsuite/dyn_weak_ref_2.c: Ditto.
2262
b56648ad
ILT
22632010-08-27 Ian Lance Taylor <iant@google.com>
2264
2265 * incremental.h (class Incremental_input_entry): Add virtual
2266 destructor.
2267
809313cb
ILT
22682010-08-27 Ian Lance Taylor <iant@google.com>
2269
2270 * testsuite/start_lib_test_3.c: Mark t3 as used.
2271
11e32464
NC
22722010-08-27 Nick Clifton <nickc@redhat.com>
2273
2274 * options.cc (version_script): Fix small typo in previous
2275 whitespace tidyup.
2276
ca09d69a
NC
22772010-08-25 Nick Clifton <nickc@redhat.com>
2278
2279 * archive.cc: Formatting fixes: Remove whitespace between
2280 typename and following asterisk. Remove whitespace between
2281 function name and opening parenthesis.
2282 * archive.h: Likewise.
2283 * arm.cc: Likewise.
2284 * attributes.cc: Likewise.
2285 * attributes.h: Likewise.
2286 * common.cc: Likewise.
2287 * copy-relocs.cc: Likewise.
2288 * dirsearch.h: Likewise.
2289 * dynobj.cc: Likewise.
2290 * ehframe.cc: Likewise.
2291 * ehframe.h: Likewise.
2292 * expression.cc: Likewise.
2293 * fileread.cc: Likewise.
2294 * fileread.h: Likewise.
2295 * gc.h: Likewise.
2296 * gold-threads.cc: Likewise.
2297 * gold.cc: Likewise.
2298 * i386.cc: Likewise.
2299 * icf.h: Likewise.
2300 * incremental-dump.cc: Likewise.
2301 * incremental.cc: Likewise.
2302 * layout.cc: Likewise.
2303 * layout.h: Likewise.
2304 * main.cc: Likewise.
2305 * merge.cc: Likewise.
2306 * merge.h: Likewise.
2307 * object.cc: Likewise.
2308 * object.h: Likewise.
2309 * options.cc: Likewise.
2310 * options.h: Likewise.
2311 * output.cc: Likewise.
2312 * output.h: Likewise.
2313 * plugin.cc: Likewise.
2314 * plugin.h: Likewise.
2315 * powerpc.cc: Likewise.
2316 * reloc.cc: Likewise.
2317 * script-c.h: Likewise.
2318 * script-sections.cc: Likewise.
2319 * script.cc: Likewise.
2320 * stringpool.cc: Likewise.
2321 * symtab.cc: Likewise.
2322 * symtab.h: Likewise.
2323 * target.cc: Likewise.
2324 * timer.cc: Likewise.
2325 * timer.h: Likewise.
2326 * version.cc: Likewise.
2327 * x86_64.cc: Likewise.
2328
b8fa8750
NC
23292010-08-24 Nick Clifton <nickc@redhat.com>
2330
2331 PR 11899
2332 * layout.cc (segment_precedes): Sort segments by their physical
2333 addresses, if they have been set.
2334
9919d93b
CC
23352010-08-23 Cary Coutant <ccoutant@google.com>
2336
2337 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
2338 symbols data.
2339 (Lib_group::include_member): Unlock object after deleting its
2340 symbols data.
2341 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
2342 the bug fixed here.
2343
97b4be1c
CC
23442010-08-19 Neil Vachharajani <nvachhar@google.com>
2345 Cary Coutant <ccoutant@google.com>
2346
2347 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
2348 constructor, and set_blocker.
2349 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
2350 readsyms_blocker_.
2351 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
2352 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
2353 * testsuite/Makefile.am (start_lib_test): New test case.
2354 * testsuite/Makefile.in: Regenerate.
2355 * testsuite/start_lib_test_main.c: New file.
2356 * testsuite/start_lib_test_1.c: New file.
2357 * testsuite/start_lib_test_2.c: New file.
2358 * testsuite/start_lib_test_3.c: New file.
2359
dd0b1884
ILT
23602010-08-19 Ian Lance Taylor <iant@google.com>
2361
2362 * Makefile.in: Rebuild with automake 1.11.1.
2363 * aclocal.m4: Likewise.
2364 * testsuite/Makefile.in: Likewise.
2365
7223e9ca
ILT
23662010-08-19 Ian Lance Taylor <iant@google.com>
2367
2368 PR 10893
2369 * i386.cc (class Output_data_plt_i386): Update declarations.
2370 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
2371 local_ifuncs_ fields.
2372 (Target_i386::do_plt_section_for_global): New function.
2373 (Target_i386::do_plt_section_for_local): New function.
2374 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
2375 parameter; change all callers. Initialize global_ifuncs_ and
2376 local_ifuncs_. If doing a static link define __rel_iplt_start and
2377 __rel_iplt_end.
2378 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
2379 (Output_data_plt_i386::add_local_ifunc_entry): New function.
2380 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
2381 symbols.
2382 (Target_i386::make_plt_section): New function, broken out of
2383 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
2384 (Target_i386::make_plt_entry): Call make_plt_section.
2385 (Target_i386::make_local_ifunc_plt_entry): New function.
2386 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
2387 (Target_i386::Scan::local): Handle IFUNC symbols. Add
2388 R_386_IRELATIVE to switch.
2389 (Target_i386::Scan::global): Likewise.
2390 (Target_i386::Relocate::relocate): Likewise.
2391 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
2392 switch.
2393 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
2394 (Target_x86_64::do_plt_section_for_global): New function.
2395 (Target_x86_64::do_plt_section_for_local): New function.
2396 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
2397 parameter; change all callers. If doing a static link define
2398 __rela_iplt_start and __rela_iplt_end.
2399 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
2400 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
2401 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
2402 to point to .plt.
2403 (Target_x86_64::make_local_ifunc_plt_entry): New function.
2404 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
2405 switch.
2406 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
2407 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
2408 R_X86_64_IRELATIVE to switch.
2409 (Target_x86_64::Scan::global): Likewise.
2410 (Target_x86_64::Relocate::relocate): Likewise.
2411 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
2412 switch.
2413 * target.h (class Target): Add plt_section_for_global and
2414 plt_section_for_local functions. Add do_plt_section_for_global
2415 and do_plt_section_for_local virtual functions.
2416 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
2417 clarifying comments.
2418 (Symbol::use_plt_offset): Handle IFUNC symbol.
2419 * object.cc (Sized_relobj::Sized_relobj): Initialize
2420 local_plt_offsets_.
2421 (Sized_relobj::local_has_plt_offset): New function.
2422 (Sized_relobj::local_plt_offset): New function.
2423 (Sized_relobj::set_local_plt_offset): New function.
2424 (Sized_relobj::do_count): Handle IFUNC symbol.
2425 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
2426 a bit away from input_shndx_ field. Add set_is_func_symbol and
2427 is_ifunc_symbol functions.
2428 (class Sized_relobj): Update declarations. Remove Tls_got_entry
2429 and Local_tls_got_offsets. Define Local_plt_offsets. Add
2430 local_plt_offsets_ field.
2431 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
2432 * output.h (class Output_section_data): Add non-const
2433 output_section function.
2434 (class Output_data_got): Update declarations.
2435 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
2436 Add use_plt_offset parameter to global and local constructors.
2437 Change all callers. Change local_sym_index_ field to 31 bits.
2438 Change GSYM_CODE and CONSTANT_CODE accordingly.
2439 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
2440 doing a static link don't set sh_link field.
2441 (Output_data_got::Got_entry::write): Use PLT offset if
2442 appropriate.
2443 (Output_data_got::add_global_plt): New function.
2444 (Output_data_got::add_local_plt): New function.
2445 * target-reloc.h (relocate_section): Handle IFUNC symbol.
2446 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
2447 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
2448 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
2449 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
2450 IFUNC conditional.
2451 * testsuite/ifunc-sel.h: New file.
2452 * testsuite/ifuncmain1.c: New file.
2453 * testsuite/ifuncmain1vis.c: New file.
2454 * testsuite/ifuncmod1.c: New file.
2455 * testsuite/ifuncdep2.c: New file.
2456 * testsuite/ifuncmain2.c: New file.
2457 * testsuite/ifuncmain3.c: New file.
2458 * testsuite/ifuncmod3.c: New file.
2459 * testsuite/ifuncmain4.c: New file.
2460 * testsuite/ifuncmain5.c: New file.
2461 * testsuite/ifuncmod5.c: New file.
2462 * testsuite/ifuncmain6pie.c: New file.
2463 * testsuite/ifuncmod6.c: New file.
2464 * testsuite/ifuncmain7.c: New file.
2465 * configure, testsuite/Makefile.in: Rebuild.
2466
56f75c03
ILT
24672010-08-18 Ian Lance Taylor <iant@google.com>
2468
2469 * incremental.cc
2470 (Output_section_incremental_inputs::write_input_files): Add cast
2471 to avoid signed/unsigned comparison warning.
2472 (Output_section_incremental_inputs::write_info_blocks): Likewise.
2473
55455f89
CC
24742010-08-12 Cary Coutant <ccoutant@google.com>
2475
2476 * common.cc (Sort_commons::operator()): Remove unnecessary code.
2477
e2054bcb
ILT
24782010-08-13 Ian Lance Taylor <iant@google.com>
2479
2480 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
2481
74f67560
DK
24822010-08-12 Cary Coutant <ccoutant@google.com>
2483 Doug Kwan <dougkwan@google.com>
2484
2485 * resolve.cc (Symbol_table::should_override): When a weak dynamic
2486 defintion overrides non-weak undef, remember that the original undef
2487 is not weak.
2488 * symtab.cc (Symbol_table::sized_write_global): For undef without
2489 an original weak binding, set binding to global in output.
2490 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
2491 * testsuite/Makefile.in: Regenerate.
2492 * testsuite/strong_ref_weak_def.sh: New file.
2493 * testsuite/strong_ref_weak_def_1.c: Ditto.
2494 * testsuite/strong_ref_weak_def_2.c: Ditto.
2495
d1238d12
CC
24962010-08-12 Cary Coutant <ccoutant@google.com>
2497
2498 * testsuite/incremental_test.sh: Rewrite.
2499 * testsuite/incremental_test_1.c: Rewrite.
2500 * testsuite/incremental_test_2.c: Rewrite.
2501
0e70b911
CC
25022010-08-12 Cary Coutant <ccoutant@google.com>
2503
2504 * arm.cc (Target_arm::got_size): Add const.
2505 (Target_arm::got_entry_count): New function.
2506 (Target_arm::plt_entry_count): New function.
2507 (Target_arm::first_plt_entry_offset): New function.
2508 (Target_arm::plt_entry_size): New function.
2509 (Output_data_plt_arm::entry_count): New function.
2510 (Output_data_plt_arm::first_plt_entry_offset): New function.
2511 (Output_data_plt_arm::get_plt_entry_size): New function.
2512 * i386.cc (Target_i386::got_size): Add const.
2513 (Target_i386::got_entry_count): New function.
2514 (Target_i386::plt_entry_count): New function.
2515 (Target_i386::first_plt_entry_offset): New function.
2516 (Target_i386::plt_entry_size): New function.
2517 (Output_data_plt_i386::entry_count): New function.
2518 (Output_data_plt_i386::first_plt_entry_offset): New function.
2519 (Output_data_plt_i386::get_plt_entry_size): New function.
2520 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
2521 find_incremental_inputs_sections. Dump incremental_got_plt section.
2522 * incremental.cc: Include target.h.
2523 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
2524 parameter. Adjust all callers. Find incremental_got_plt section.
2525 (Incremental_inputs::create_data_sections): Create incremental_got_plt
2526 section.
2527 (Output_section_incremental_inputs::set_final_data_size): Calculate
2528 size of incremental_got_plt section.
2529 (Output_section_incremental_inputs::do_write): Write the
2530 incremental_got_plt section.
2531 (Got_plt_view_info): New struct.
2532 (Local_got_offset_visitor): New class.
2533 (Global_got_offset_visitor): New class.
2534 (Global_symbol_visitor_got_plt): New class.
2535 (Output_section_incremental_inputs::write_got_plt): New function.
2536 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
2537 Add parameter. Adjust all callers.
2538 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2539 (Incremental_inputs::got_plt_section): New function.
2540 (Incremental_inputs::got_plt_section_): New data member.
2541 (Incremental_got_plt_reader): New class.
2542 * layout.cc (Layout::create_incremental_info_sections): Add the
2543 incremental_got_plt section.
2544 * object.h (Got_offset_list::get_list): New function.
2545 (Got offset_list::for_all_got_offsets): New function.
2546 (Sized_relobj::local_got_offset_list): New function.
2547 * powerpc.cc (Target_powerpc::got_size): Add const.
2548 (Target_powerpc::got_entry_count): New function.
2549 (Target_powerpc::plt_entry_count): New function.
2550 (Target_powerpc::first_plt_entry_offset): New function.
2551 (Target_powerpc::plt_entry_size): New function.
2552 (Output_data_plt_powerpc::entry_count): New function.
2553 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
2554 (Output_data_plt_powerpc::get_plt_entry_size): New function.
2555 * sparc.cc (Target_sparc::got_size): Add const.
2556 (Target_sparc::got_entry_count): New function.
2557 (Target_sparc::plt_entry_count): New function.
2558 (Target_sparc::first_plt_entry_offset): New function.
2559 (Target_sparc::plt_entry_size): New function.
2560 (Output_data_plt_sparc::entry_count): New function.
2561 (Output_data_plt_sparc::first_plt_entry_offset): New function.
2562 (Output_data_plt_sparc::get_plt_entry_size): New function.
2563 * symtab.h (Symbol::got_offset_list): New function.
2564 (Symbol_table::for_all_symbols): New function.
2565 * target.h (Sized_target::got_entry_count): New function.
2566 (Sized_target::plt_entry_count): New function.
2567 (Sized_target::plt_entry_size): New function.
2568 * x86_64.cc (Target_x86_64::got_size): Add const.
2569 (Target_x86_64::got_entry_count): New function.
2570 (Target_x86_64::plt_entry_count): New function.
2571 (Target_x86_64::first_plt_entry_offset): New function.
2572 (Target_x86_64::plt_entry_size): New function.
2573 (Output_data_plt_x86_64::entry_count): New function.
2574 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
2575 (Output_data_plt_x86_64::get_plt_entry_size): New function.
2576
09ec0418
CC
25772010-08-12 Cary Coutant <ccoutant@google.com>
2578
2579 * archive.cc: Include incremental.h.
2580 (Archive::Archive): Initialize incremental_info_.
2581 (Archive::include_member): Record archive members in incremental info.
2582 (Add_archive_symbols::run): Record begin and end of an archive in
2583 incremental info.
2584 (Lib_group::include_member): Record objects in incremental info.
2585 * archive.h (Incremental_archive_entry): Forward declaration.
2586 (Archive::set_incremental_info): New member function.
2587 (Archive::incremental_info): New member function.
2588 (Archive::Unused_symbol_iterator): New class.
2589 (Archive::unused_symbols_begin): New member function.
2590 (Archive::unused_symbols_end): New member function.
2591 (Archive::incremental_info_): New data member.
2592 * incremental-dump.cc (find_input_containing_global): New function.
2593 (dump_incremental_inputs): Dump new incremental info sections.
2594 * incremental.cc: Include symtab.h.
2595 (Output_section_incremental_inputs): New class.
2596 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
2597 new incremental info sections.
2598 (Sized_incremental_binary::do_check_inputs): Likewise.
2599 (Incremental_inputs::report_archive): Remove.
2600 (Incremental_inputs::report_archive_begin): New function.
2601 (Incremental_inputs::report_archive_end): New function.
2602 (Incremental_inputs::report_object): New function.
2603 (Incremental_inputs::finalize_inputs): Remove.
2604 (Incremental_inputs::report_input_section): New function.
2605 (Incremental_inputs::report_script): Rewrite.
2606 (Incremental_inputs::finalize): Do nothing but finalize string table.
2607 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2608 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2609 (Incremental_inputs::create_data_sections): New function.
2610 (Incremental_inputs::relocs_entsize): New function.
2611 (Output_section_incremental_inputs::set_final_data_size): New function.
2612 (Output_section_incremental_inputs::do_write): New function.
2613 (Output_section_incremental_inputs::write_header): New function.
2614 (Output_section_incremental_inputs::write_input_files): New function.
2615 (Output_section_incremental_inputs::write_info_blocks): New function.
2616 (Output_section_incremental_inputs::write_symtab): New function.
2617 * incremental.h (Incremental_script_entry): Forward declaration.
2618 (Incremental_object_entry): Forward declaration.
2619 (Incremental_archive_entry): Forward declaration.
2620 (Incremental_inputs): Forward declaration.
2621 (Incremental_inputs_header_data): Remove.
2622 (Incremental_inputs_header): Remove.
2623 (Incremental_inputs_header_write): Remove.
2624 (Incremental_inputs_entry_data): Remove.
2625 (Incremental_inputs_entry): Remove.
2626 (Incremental_inputs_entry_write): Remove.
2627 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
2628 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
2629 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
2630 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
2631 Likewise.
2632 (Incremental_input_entry): New class.
2633 (Incremental_script_entry): New class.
2634 (Incremental_object_entry): New class.
2635 (Incremental_archive_entry): New class.
2636 (Incremental_inputs::Incremental_inputs): Initialize new data members.
2637 (Incremental_inputs::report_inputs): Remove.
2638 (Incremental_inputs::report_archive): Remove.
2639 (Incremental_inputs::report_archive_begin): New function.
2640 (Incremental_inputs::report_archive_end): New function.
2641 (Incremental_inputs::report_object): Change prototype.
2642 (Incremental_inputs::report_input_section): New function.
2643 (Incremental_inputs::report_script): Change prototype.
2644 (Incremental_inputs::get_reloc_count): New function.
2645 (Incremental_inputs::set_reloc_count): New function.
2646 (Incremental_inputs::create_data_sections): New function.
2647 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
2648 (Incremental_inputs::inputs_section): New function.
2649 (Incremental_inputs::symtab_section): New function.
2650 (Incremental_inputs::relocs_section): New function.
2651 (Incremental_inputs::get_stringpool): Add const.
2652 (Incremental_inputs::command_line): Add const.
2653 (Incremental_inputs::inputs): Remove.
2654 (Incremental_inputs::command_line_key): New function.
2655 (Incremental_inputs::input_file_count): New function.
2656 (Incremental_inputs::input_files): New function.
2657 (Incremental_inputs::relocs_entsize): New function.
2658 (Incremental_inputs::sized_create_inputs_section_data): Remove.
2659 (Incremental_inputs::finalize_inputs): Remove.
2660 (Incremental_inputs::Input_info): Remove.
2661 (Incremental_inputs::lock_): Remove.
2662 (Incremental_inputs::inputs_): Change type.
2663 (Incremental_inputs::inputs_map_): Remove.
2664 (Incremental_inputs::current_object_entry_): New data member.
2665 (Incremental_inputs::inputs_section_): New data member.
2666 (Incremental_inputs::symtab_section_): New data member.
2667 (Incremental_inputs::relocs_section_): New data member.
2668 (Incremental_inputs::reloc_count_): New data member.
2669 (Incremental_inputs_reader): New class.
2670 (Incremental_symtab_reader): New class.
2671 (Incremental_relocs_reader): New class.
2672 * layout.cc (Layout::finalize): Move finalization of incremental info
2673 and creation of incremental info sections to follow finalization of
2674 symbol table. Set offsets for postprocessing sections.
2675 (Layout::create_incremental_info_sections): Call
2676 Incremental_inputs::create_data_sections. Add incremental symtab
2677 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
2678 sections to layout after input sections.
2679 * layout.h (struct Timespec): Forward declaration.
2680 (Layout::incremental_inputs): Add const.
2681 (Layout::create_incremental_info_sections): Add parameter.
2682 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
2683 * object.cc: Include incremental.h.
2684 (Relobj::finalize_incremental_relocs): New function.
2685 (Sized_relobj::do_layout): Record input sections in incremental info.
2686 * object.h (Object::output_section): New function.
2687 (Object::output_section_offset): Moved from Relobj.
2688 (Object::get_incremental_reloc_base): New function.
2689 (Object::get_incremental_reloc_count): New function.
2690 (Object::do_output_section): New function.
2691 (Object::do_output_section_offset): Moved from Relobj.
2692 (Object::do_get_incremental_reloc_base): New function.
2693 (Object::do_get_incremental_reloc_count): New function.
2694 (Object::Object): Initialize new data members.
2695 (Relobj::output_section): Renamed do_output_section and moved to
2696 protected.
2697 (Relobj::output_section_offset): Moved to Object.
2698 (Relobj::do_get_incremental_reloc_base): New function.
2699 (Relobj::do_get_incremental_reloc_count): New function.
2700 (Relobj::allocate_incremental_reloc_counts): New function.
2701 (Relobj::count_incremental_reloc): New function.
2702 (Relobj::finalize_incremental_relocs): New function.
2703 (Relobj::next_incremental_reloc_index): New function.
2704 (Relobj::reloc_counts_): New data member.
2705 (Relobj::reloc_bases_): New data member.
2706 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
2707 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
2708 (Sized_relobj::incremental_relocs_scan): New function.
2709 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2710 (Sized_relobj::incremental_relocs_write): New function.
2711 (Sized_relobj::incremental_relocs_write_reltype): New function.
2712 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
2713 incremental link.
2714 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
2715 archives and object files elsewhere.
2716 (Add_symbols::run): Report object files here.
2717 (Finish_group::run): Report end of archive at end of group.
2718 * reloc.cc: Include layout.h, incremental.h.
2719 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
2720 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
2721 (Sized_relobj::incremental_relocs_scan): New function.
2722 (Sized_relobj::incremental_relocs_scan_reltype): New function.
2723 (Sized_relobj::do_relocate_sections): Write incremental relocations.
2724 (Sized_relobj::incremental_relocs_write): New function.
2725 (Sized_relobj::incremental_relocs_write_reltype): New function.
2726 * script.cc (read_input_script): Rewrite test for incremental link.
2727 Change call to Incremental_inputs::report_script.
2728 * symtab.h (Symbol_table::first_global_index): New function.
2729 (Symbol_table::output_count): New function.
2730
ce0d1972
DK
27312010-08-12 Doug Kwan <dougkwan@google.com>
2732
2733 * arm.cc (Target_arm::merge_object_attributes): Check command line
2734 options --no-wchar-size-warning and --no-enum-size-warning.
2735 * options.h (General_options): Add ld-compatible options
2736 --no-enum-size-warning and --no-wchar-size-warning.
2737
6e5710ce
ILT
27382010-08-04 Ian Lance Taylor <iant@google.com>
2739
2740 * x86_64.cc (Target_x86_64::Scan::local): Use
2741 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
2742 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
2743 (Target_x86_64::Scan::global): Likewise.
2744 (Target_x86_64::Relocate::relocate): Likewise.
2745 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
2746 Likewise.
2747
fef830db
CC
27482010-08-03 Cary Coutant <ccoutant@google.com>
2749
2750 * merge.cc (Output_merge_string::do_add_input_section): Count strings
2751 to reserve space in merged_strings vector. Keep total input size
2752 for stats.
2753 (Output_merge_string::do_print_merge_stats): Print total input size.
2754 * merge.h (Output_merge_string): Add input_size_ field.
2755 * stringpool.cc (Stringpool_template::string_length): Move
2756 implementations out of Stringpool_template class and place in
2757 stringpool.h.
2758 * stringpool.h (string_length): Move out of Stringpool_template.
2759
1e3811b0
ILT
27602010-08-03 Ian Lance Taylor <iant@google.com>
2761
2762 PR 11712
2763 * layout.cc (relaxation_loop_body): If address of load segment is
2764 set, adjust address to include headers if possible.
2765
7af0c620
ILT
27662010-08-03 Ian Lance Taylor <iant@google.com>
2767
2768 * version.cc (version_string): Bump to 1.10.
2769
22f0da72
ILT
27702010-08-03 Ian Lance Taylor <iant@google.com>
2771
2772 PR 11805
2773 * layout.h (enum Output_section_order): Define.
2774 (class Layout): Update declarations.
2775 * layout.cc (Layout::get_output_section): Add order parameter.
2776 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
2777 is_first_non_relro parameters. Change all callers.
2778 (Layout::choose_output_section): Likewise.
2779 (Layout::add_output_section_data): Likewise.
2780 (Layout::make_output_section): Likewise. Set order.
2781 (Layout::default_section_order): New function.
2782 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
2783 * output.cc (Output_section::Output_section): Initialize order_.
2784 Don't initialize deleted fields.
2785 (Output_segment::Output_segment): Don't initialize deleted
2786 fields.
2787 (Output_segment::add_output_section_to_load): New function
2788 replacing add_output_section. Change all callers to call this or
2789 add_output_section_to_nonload.
2790 (Output_segment::add_output_section_to_nonload): New function.
2791 (Output_segment::remove_output_section): Rewrite.
2792 (Output_segment::add_initial_output_data): Likewise.
2793 (Output_segment::has_any_data_sections): Likewise.
2794 (Output_segment::is_first_section_relro): Likewise.
2795 (Output_segment::maximum_alignment): Likewise.
2796 (Output_segment::has_dynamic_reloc): New function replacing
2797 dynamic_reloc_count. Change all callers.
2798 (Output_segment::has_dynamic_reloc_list): New function replacing
2799 dynamic_reloc_count_list. Change all callers.
2800 (Output_segment::set_section_addresses): Rewrite.
2801 (Output_segment::set_offset): Rewrite.
2802 (Output_segment::find_first_and_last_list): Remove.
2803 (Output_segment::set_tls_offsets): Rewrite.
2804 (Output_segment::first_section_load_address): Likewise.
2805 (Output_segment::output_section_count): Likewise.
2806 (Output_segment::section_with_lowest_load_address): Likewise.
2807 (Output_segment::write_section_headers): Likewise.
2808 (Output_segment::print_sections_to_map): Likewise.
2809 * output.h (class Output_data): Remove dynamic_reloc_count_
2810 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
2811 (Output_data::add_dynamic_reloc): Rewrite.
2812 (Output_data::has_dynamic_reloc): New function.
2813 (Output_data::dynamic_reloc_count): Remove.
2814 (class Output_section): Add order_ field. Remvoe is_relro_local_,
2815 is_last_relro_, is_first_non_relro_, is_interp_,
2816 is_dynamic_linker_section_ fields. Add order and set_order
2817 functions. Remove is_relro_local, set_is_relro_local,
2818 is_last_relro, set_is_last_relro, is_first_non_relro,
2819 set_is_first_non_relro functions, is_interp, set_is_interp,
2820 is_dynamic_linker_section, and set_is_dynamic_linker_section
2821 functions.
2822 (class Output_segment): Change Output_data_list from std::list to
2823 std:;vector. Add output_lists_ field. Remove output_data_ and
2824 output_bss_ fields. Update declarations.
2825
3ff2ccb0
ILT
28262010-08-02 Ian Lance Taylor <iant@google.com>
2827
2828 * arm.cc (Target_arm::gc_process_relocs): Use typename.
2829 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
2830 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
2831
88a4108b
ILT
28322010-08-02 Ian Lance Taylor <iant@google.com>
2833
2834 PR 11855
2835 * script.cc (Script_options::Script_options): Initialize
2836 symbol_definitions_ and symbol_references_.
2837 (Script_options::add_symbol_assignment): Update
2838 symbol_definitions_ and symbol_references_.
2839 (Script_options::add_symbol_reference): New function.
2840 (script_symbol): New function.
2841 * script.h (class Script_options): Add symbol_definitions_ and
2842 symbol_references_ fields.
2843 (Script_options::referenced_const_iterator): New type.
2844 (Script_options::referenced_begin): New function.
2845 (Script_options::referenced_end): New function.
2846 (Script_options::is_referenced): New function.
2847 (Script_options::any_unreferenced): New function.
2848 * script-c.h (script_symbol): Declare.
2849 * yyscript.y (exp): Call script_symbol.
2850 * symtab.cc: Include "script.h".
2851 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
2852 Change all callers. Check symbols referenced by scripts.
2853 (Symbol_table::add_undefined_symbols_from_command_line): Add
2854 layout parameter. Change all callers.
2855 (Symbol_table::do_add_undefined_symbols_from_command_line):
2856 Likewise. Break out loop body. Check symbols referenced by
2857 scripts.
2858 (Symbol_table::add_undefined_symbol_from_command_line): New
2859 function broken out of
2860 do_add_undefined_symbols_from_command_line.
2861 * symtab.h (class Symbol_table): Update declarations.
2862 * archive.cc: Include "layout.h".
2863 (Archive::should_include_member): Add layout parameter. Change
2864 all callers. Check for symbol mentioned in expression.
2865 * archive.h (class Archive): Update declaration.
2866 * object.cc (Sized_relobj::do_should_include_member): Add layout
2867 parameter.
2868 * object.h (Object::should_include_member): Add layout parameter.
2869 Change all callers.
2870 (Object::do_should_include_member): Add layout parameter.
2871 (class Sized_relobj): Update declaration.
2872 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
2873 parameter.
2874 * dynobj.h (class Sized_dynobj): Update declaration.
2875 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
2876 layout parameter.
2877 * plugin.h (class Sized_pluginobj): Update declaration.
2878
5f1ab67a
ILT
28792010-08-02 Ian Lance Taylor <iant@google.com>
2880
2881 PR 11866
2882 * output.cc (Output_segment::set_offset): Search for the first and
2883 last sections rather than assuming that the list is in order.
2884 (Output_segment::find_first_and_last_list): New function.
2885 * output.h (class Output_segment): Update declarations.
2886 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
2887 (relro_strip_test_SOURCES): New variable.
2888 (relro_strip_test_DEPENDENCIES): New variable.
2889 (relro_strip_test_LDFLAGS): New variable.
2890 (relro_strip_test_LDADD): New variable.
2891 (relro_strip_test.so): New target.
2892
a8df5856
ILT
28932010-08-02 Ian Lance Taylor <iant@google.com>
2894
2895 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
2896 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
2897 (Target_i386::got_tlsdesc_section): New function.
2898 (Target_i386::got_section): Create space for GOT entries for
2899 TLSDESC relocations.
2900 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
2901 R_386_TLS_GOTDESC.
2902 (Target_i386::Scan::global): Likewise.
2903 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
2904 using TLSDESC GOT.
2905 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
2906 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
2907 (Target_x86_64::got_tlsdesc_section): New function.
2908 (Target_x86_64::got_section): Create space for GOT entries for
2909 TLSDESC relocations.
2910 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
2911 R_386_TLS_GOTDESC.
2912 (Target_x86_64::Scan::global): Likewise.
2913 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
2914 using TLSDESC GOT.
2915
0c10a0a6
ILT
29162010-08-02 Ian Lance Taylor <iant@google.com>
2917
2918 * testsuite/final_layout.sh: Use dc to convert from hex to
2919 decimal.
2920
41cbeecc
ST
29212010-07-29 Sriraman Tallam <tmsriram@google.com>
2922
2923 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
2924 paramter to the call to gold::gc_process_relocs.
2925 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
2926 paramter to the call to gold::gc_process_relocs.
2927 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
2928 parameter to the call to gold::gc_process_relocs.
2929 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
2930 template parameter to the call to gold::gc_process_relocs.
2931 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
2932 paramter to the call to gold::gc_process_relocs.
2933 * gc.h (get_embedded_addend_size): New function.
2934 (gc_process_relocs): Save the size of the reloc for use by ICF.
2935 * icf.cc (get_section_contents): Get the addend from the text section
2936 for SHT_REL relocation sections.
2937 * icf.h (Icf::Reloc_addend_size_info): New typedef.
2938 (Icf::Reloc_info): Add new member reloc_addend_size_info.
2939 * int_encoding.h (read_from_pointer): New overloaded function.
2940 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
2941 * testsuite/icf_sht_rel_addend_test.sh: New file.
2942 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
2943 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
2944
6ea55b82
RW
29452010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2946
2947 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
2948 * Makefile.in: Regenerate.
2949 * testsuite/Makefile.in: Regenerate.
2950
9691462b
ILT
29512010-07-27 Jeffrey Yasskin <jyasskin@google.com>
2952
2953 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
2954 * gold/testsuite/debug_msg.cc: Likewise.
2955 * gold/testsuite/odr_violation1.cc
2956 * gold/testsuite/odr_violation2.cc
2957
76897331
CC
29582010-07-21 Cary Coutant <ccoutant@google.com>
2959
2960 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
2961 string, and length fields.
2962 (Output_merge_string::Merged_strings_list): New type.
2963 (Output_merge_string::Merged_strings_lists): New typedef.
2964 (Output_merge_string): Replace merged_strings_ with
2965 merged_strings_lists_.
2966 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
2967 Merged_strings_list per input object and section. Don't store pointer
2968 to the string. Don't store length with each merged string entry.
2969 (Output_merge_string::finalize_merged_data): Loop over list of merged
2970 strings lists. Recompute length of each merged string.
2971
78384e8f
CC
29722010-07-15 Cary Coutant <ccoutant@google.com>
2973
2974 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
2975 here.
2976
783659f9
ILT
29772010-07-14 Ian Lance Taylor <iant@google.com>
2978
2979 * descriptors.cc (Descriptors::open): Report correct name in error
2980 message.
2981
131687b4
DK
29822010-07-13 Doug Kwan <dougkwan@google.com>
2983
2984 * arm.cc (Arm_input_section::Arm_input_section): For a
2985 SHT_ARM_EXIDX section, always keeps the input sections.
2986 (Arm_input_section::set_exidx_section_link): New method.
2987 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
2988 has_errors_ to false.
2989 (Arm_exidx_input_section::has_errors,
2990 Arm_exidx_input_section::set_has_errors): New methods.
2991 (Arm_exidx_input_section::has_errors_): New data member.
2992 (Arm_relobj::get_exidx_shndx_list): New method.
2993 (Arm_output_section::append_text_sections_to_list): Do not skip
2994 section without SHF_EXECINSTR.
2995 (Arm_output_section::fix_exidx_coverage): Skip input sections with
2996 errors.
2997 (Arm_relobj::make_exidx_input_section): Add new parameter for text
2998 section header. Make error messages more verbose. Check for
2999 a non-executable section linked to an EXIDX section.
3000 (Arm_relobj::do_read_symbols): Remove error checking, which has been
3001 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
3002 check that there is no deferred EXIDX section if we exit early.
3003 Instead of not making an EXIDX section in case of an error, make one
3004 and set the has_errors flag of it.
3005 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
3006 in a relocatable link.
3007 (Target_arm::do_relax): Look for the EXIDX output section instead of
3008 assuming that it is called .ARM.exidx.
3009 (Target_arm::fix_exidx_coverage): Add a new parameter for input
3010 section list. Do not check for SHF_EXECINSTR section flags but
3011 skip any input section with errors.
3012 * output.cc (Output_section::Output_section): Initialize
3013 always_keeps_input_sections_ to false.
3014 (Output_section::add_input_section): Check for
3015 always_keeps_input_sections_.
3016 * output.h (Output_section::always_keeps_input_sections,
3017 Output_section::set_always_keeps_input_sections): New methods.
3018 (Output_section::always_keeps_input_sections): New data member.
3019
69517287
RÁE
30202010-07-13 Rafael Espindola <espindola@google.com>
3021
3022 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
3023 * fileread.h (Input_file): Add try_extra_search_path and find_file.
3024
82742395
ILT
30252010-07-13 Philip Herron <herron.philip@googlemail.com>
3026 Ian Lance Taylor <iant@google.com>
3027
3028 * output.h (Output_section_lookup_maps::add_merge_section):
3029 Correct check of whether value was inserted.
3030 (Output_section_lookup_maps::add_merge_input_section): Likewise.
3031 (Output_section_lookup_maps::add_relaxed_input_section):
3032 Likewise.
3033 * arm.cc (Target_arm::got_section): Remove used local os.
3034 * i386.cc (Target_i386::got_section): Likewise.
3035 * x86_64.cc (Target_x86_64::got_section): Likewise.
3036 * sparc.cc (Target_sparc::got_section): Likewise.
3037 (Target_sparc::relocate): Remove unused local have_got_offset.
3038 * powerpc.cc (Target_powerpc::relocate): Likewise.
3039
f2d707b5
ILT
30402010-07-13 Ian Lance Taylor <iant@google.com>
3041
241531d6
ILT
3042 * compressed_output.cc (zlib_decompress): Fix signature in
3043 !HAVE_ZLIB_H case.
3044
f2d707b5
ILT
3045 * archive.cc (Archive::include_member): Unlock an external member
3046 of a thin archive. Don't bother to delete an object we know is
3047 NULL.
3048
a2e47362
CC
30492010-07-12 Cary Coutant <ccoutant@google.com>
3050
3051 * compressed_output.cc (zlib_decompress): New function.
3052 (get_uncompressed_size): New function.
3053 (decompress_input_section): New function.
3054 * compressed_output.h (get_uncompressed_size): New function.
3055 (decompress_input_section): New function.
3056 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
3057 Handle compressed debug sections.
3058 * layout.cc (is_compressed_debug_section): New function.
3059 (Layout::output_section_name): Map compressed section names to
3060 canonical names.
3061 * layout.h (is_compressed_debug_section): New function.
3062 (is_debug_info_section): Recognize compressed debug sections.
3063 * merge.cc: Include compressed_output.h.
3064 (Output_merge_data::do_add_input_section): Handle compressed
3065 debug sections.
3066 (Output_merge_string::do_add_input_section): Handle compressed
3067 debug sections.
3068 * object.cc: Include compressed_output.h.
3069 (Sized_relobj::Sized_relobj): Initialize new data members.
3070 (build_compressed_section_map): New function.
3071 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
3072 * object.h (Object::section_is_compressed): New method.
3073 (Object::do_section_is_compressed): New method.
3074 (Sized_relobj::Compressed_section_map): New type.
3075 (Sized_relobj::do_section_is_compressed): New method.
3076 (Sized_relobj::compressed_sections_): New data member.
3077 * output.cc (Output_section::add_input_section): Handle compressed
3078 debug sections.
3079 * reloc.cc: Include compressed_output.h.
3080 (Sized_relobj::write_sections): Handle compressed debug sections.
3081
ce279a62
CC
30822010-07-08 Cary Coutant <ccoutant@google.com>
3083
3084 * resolve.cc (Symbol_table::resolve): Remember whether undef was
3085 weak when resolving to a dynamic def.
3086 (Symbol_table::should_override): Add adjust_dyndef flag; set it
3087 for weak undef/dynamic def cases. Adjust callers.
3088 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
3089 undef_binding_weak_.
3090 (Symbol_table::sized_write_globals): Adjust symbol binding.
3091 (Symbol_table::sized_write_symbol): Add binding parameter.
3092 * symtab.h (Symbol::set_undef_binding): New method.
3093 (Symbol::is_undef_binding_weak): New method.
3094 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
3095 (Symbol_table::should_override): Add new parameter.
3096 (Symbol_table::sized_write_symbol): Add new parameter.
3097
3098 * testsuite/weak_undef_file1.cc: Add new test case.
3099 * testsuite/weak_undef_file2.cc: Fix header comment.
3100 * testsuite/weak_undef_test.cc: Add new test case.
3101
b2286c10
DK
31022010-06-29 Doug Kwan <dougkwan@google.com>
3103
3104 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
3105 Initialize USE_SYMBOL_.
3106 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
3107 definition.
3108 (Arm_reloc_property::uses_symbol_): New data member declaration.
3109 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
3110 uses symbol value and symbol is undefined but not weakly undefined.
3111
4802450a
RÁE
31122010-06-28 Rafael Espindola <espindola@google.com>
3113
3114 * plugin.cc (Plugin::load): Use dlerror.
3115
e5ca47ba
ILT
31162010-06-26 Jeffrey Yaskin <jyasskin@google.com>
3117
3118 * symtab.cc (detect_odr_violations): When reporting an ODR
3119 violation, report an object where the symbol is defined.
3120
8a75a161
DK
31212010-06-25 Doug Kwan <dougkwan@google.com>
3122
3123 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
3124 (Target_arm::section_may_have_icf_unsafe_pointers): New method
3125 definition.
3126 (Target_arm::Scan::local_reloc_may_be_function_pointer,
3127 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
3128 target hook to detect function points.
3129 (Target_arm::Scan::possible_function_pointer_reloc): New method.
3130 * icf.h (Icf::check_section_for_function_pointers): Change type of
3131 parameter SECTION_NAME to const reference to std::string. Use
3132 target hook to determine if section may have unsafe pointers.
3133 * target.h (Target::section_may_have_icf_unsafe_pointers): New
3134 method definition.
3135
42218b9f
RÁE
31362010-06-21 Rafael Espindola <espindola@google.com>
3137
3138 * fileread.cc (Input_file::find_fie): New
3139 (Input_file::open): Use Input_file::find_fie.
3140 * fileread.h (Input_file::find_fie): New
3141 * plugin.cc (set_extra_library_path): New.
3142 (Plugin::load): Add set_extra_library_path to the transfer vector.
3143 (Plugin_manager::set_extra_library_path): New.
3144 (Plugin_manager::add_input_file): Use the extra search path if set.
3145 (set_extra_library_path(): New.
3146 * plugin.h (Plugin_manager): Add set_extra_library_path and
3147 extra_search_path_.
3148
a0506cca
CC
31492010-06-19 Cary Coutant <ccoutant@google.com>
3150
3151 * layout.cc (gdb_sections): Add .debug_types.
3152 (lines_only_debug_sections): Likewise.
3153
6508b958
RÁE
31542010-06-18 Rafael Espindola <espindola@google.com>
3155
3156 * plugin.cc (add_input_file,add_input_library)
3157 (Plugin_manager::add_input_file): Make filename arguments const.
3158 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
3159 const.
3160
3e235302
DK
31612010-06-16 Doug Kwan <dougkwan@google.com>
3162
3163 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
3164 .ARM.attributes section if we have not merged any input
3165 attributes sections.
3166
106e8a6c
DK
31672010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3168
3169 * arm.cc: Allow combining objects with no EABI version
3170 information.
3171
91ff43fe
RÁE
31722010-06-15 Rafael Espindola <espindola@google.com>
3173
3174 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
3175
68ed838c
ILT
31762010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3177
3178 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
3179 (struct iovec): Correct !HAVE_READV definition.
3180
f3a2388f
CC
31812010-06-10 Cary Coutant <ccoutant@google.com>
3182
3183 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
3184 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
3185 reloc sections.
3186 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
3187
3188 PR 11683
3189 * symtab.h (Symbol::is_placeholder): New member function.
3190 * target-reloc.h (relocate_section): Check for placeholder symbols.
3191
3192 * testsuite/Makefile.am (plugin_test_8): New test.
3193 (plugin_test_9): New test.
3194 * testsuite/Makefile.in: Regenerate.
3195
e1df38aa
NC
31962010-06-09 Nick Clifton <nickc@redhat.com>
3197
3198 * yyscript.y (input_list_element): Allow strings prefixed with
3199 the '-' character. Treat these as libraries.
3200 * script.cc (script_add_library): New function. Adds a library
3201 specified by "-l<name>" found in an input script.
3202 * script-c.h: Add prototype for script_add_library.
3203
25bbe950
DK
32042010-06-07 Doug Kwan <dougkwan@google.com>
3205
3206 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
3207 Restrict stub-group size to be within long conditional branch
3208 range when working around cortex-A8 erratum.
3209
0f32ea4c
ILT
32102010-06-07 Damien Diederen <dd@crosstwine.com>
3211
3212 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
3213 #ifdef typo.
3214
8fe2a369
ST
32152010-06-03 Sriraman Tallam <tmsriram@google.com>
3216
3217 PR gold/11658
3218 * output.cc
3219 (Output_section::Input_section_sort_entry::compare_section_ordering):
3220 Change to return non-zero correctly.
3221 (Output_section::Input_section_sort_section_order_index_compare
3222 ::operator()): Change to fix ambiguity in comparisons.
3223
6e9ba2ca
ST
32242010-06-01 Sriraman Tallam <tmsriram@google.com>
3225
3226 * gold.h (is_wildcard_string): New function.
3227 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
3228 (Layout::layout_eh_frame): Ditto.
3229 (Layout::find_section_order_index): New method.
3230 (Layout::read_layout_from_file): New method.
3231 * layout.h (Layout::find_section_order_index): New method.
3232 (Layout::read_layout_from_file): New method.
3233 (Layout::input_section_position_): New private member.
3234 (Layout::input_section_glob_): New private member.
3235 * main.cc (main): Call read_layout_from_file here.
3236 * options.h (--section-ordering-file): New option.
3237 * output.cc (Output_section::input_section_order_specified_): New
3238 member.
3239 (Output_section::Output_section): Initialize new member.
3240 (Output_section::add_input_section): Add new parameter.
3241 Keep input sections when --section-ordering-file is used.
3242 (Output_section::set_final_data_size): Sort input sections when
3243 section ordering file is specified.
3244 (Output_section::Input_section_sort_entry): Add new parameter.
3245 Check sorting type.
3246 (Output_section::Input_section_sort_entry::compare_section_ordering):
3247 New method.
3248 (Output_section::Input_section_sort_compare::operator()): Change to
3249 consider section_order_index.
3250 (Output_section::Input_section_sort_init_fini_compare::operator()):
3251 Change to consider section_order_index.
3252 (Output_section::Input_section_sort_section_order_index_compare
3253 ::operator()): New method.
3254 (Output_section::sort_attached_input_sections): Change to sort
3255 according to section order when specified.
e1df38aa
NC
3256 (Output_section::add_input_section<32, true>): Add new parameter.
3257 (Output_section::add_input_section<64, true>): Add new parameter.
3258 (Output_section::add_input_section<32, false>): Add new parameter.
3259 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
3260 * output.h (Output_section::add_input_section): Add new parameter.
3261 (Output_section::input_section_order_specified): New
3262 method.
3263 (Output_section::set_input_section_order_specified): New method.
3264 (Input_section::Input_section): Initialize section_order_index_.
3265 (Input_section::section_order_index): New method.
3266 (Input_section::set_section_order_index): New method.
3267 (Input_section::section_order_index_): New member.
3268 (Input_section::Input_section_sort_section_order_index_compare): New
3269 struct.
3270 (Output_section::input_section_order_specified_): New member.
3271 * script-sections.cc (is_wildcard_string): Delete and move modified
3272 method to gold.h.
3273 (Output_section_element_input::Output_section_element_input): Modify
3274 call to is_wildcard_string.
3275 (Output_section_element_input::Input_section_pattern
3276 ::Input_section_pattern): Ditto.
3277 (Output_section_element_input::Output_section_element_input): Ditto.
3278 * testsuite/Makefile.am (final_layout): New test case.
3279 * testsuite/Makefile.in: Regenerate.
3280 * testsuite/final_layout.cc: New file.
3281 * testsuite/final_layout.sh: New file.
3282
3537c84b
RÁE
32832010-06-01 Rafael Espindola <espindola@google.com>
3284
3285 * plugin.cc (Plugin::load): Pass the output name to the plugin.
3286
105b6afd
RÁE
32872010-06-01 Rafael Espindola <espindola@google.com>
3288
3289 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
3290 visibility of symbols.
3291
29e11421
DK
32922010-05-27 Doug Kwan <dougkwan@google.com>
3293
3294 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
3295 from start of output section instead of address for a local symbol
3296 in a merged or relaxed section when doing a relocatable link.
3297
5e0f337e
RÁE
32982010-05-26 Rafael Espindola <espindola@google.com>
3299
3300 PR 11604
3301 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
3302 adding sections the garbage collector removed.
3303 * gold/testsuite/Makefile.am: Add test.
3304 * gold/testsuite/Makefile.in: Regenerate.
3305 * gold/testsuite/plugin_test_7.sh: New.
3306 * gold/testsuite/plugin_test_7_1.c: New.
3307 * gold/testsuite/plugin_test_7_2.c: New.
3308
f4187277
RÁE
33092010-05-26 Rafael Espindola <espindola@google.com>
3310
3311 * script-sections.cc (Output_section_definition::set_section_addresses):
3312 Check for --section-start.
3313
5c388529
DK
33142010-05-26 Doug Kwan <dougkwan@google.com>
3315
3316 * arm.cc (Arm_scan_relocatable_relocs): New class.
3317 (Target_arm::relocate_special_relocatable): New method.
3318 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
3319 (Arm_relocate_functions::thumb_branch_common): Same.
3320 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
3321 instead of Default_scan_relocatable_relocs.
3322 * target-reloc.h (relocate_for_relocatable): Let target handle
3323 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
3324 * target.h (Sized_target::relocate_special_relocatable): New method.
3325
bca1c3ae
ILT
33262010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3327
3328 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
3329
0439c796
DK
33302010-05-23 Doug Kwan <dougkwan@google.com>
3331
3332 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
3333 instead of a cast.
3334 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
3335 with a direct branch, not a conditional branch, to a stub.
3336 * merge.cc (Output_merge_base::record_input_section): New method
3337 defintion.
3338 (Output_merge_data::do_add_input_section): Record input section if
3339 keeps-input-sections flag is set.
3340 (Output_merge_string::do_add_input_section): Ditto.
3341 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
3342 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
3343 INPUT_SECTIONS_.
3344 (Output_merge_base::keeps_input_sections,
3345 Output_merge_base::set_keeps_input_sections,
3346 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
3347 method definitions.
3348 (Output_merge_base::Input_sections): New type declaration.
3349 (Output_merge_base::input_sections_begin,
3350 Output_merge_base::input_sections_end,
3351 Output_merge_base::do_set_keeps_input_sections): New method definitions.
3352 (Output_merge_base::bool keeps_input_sections_,
3353 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
3354 Output_merge_base::input_sections_): New data members.
3355 (Output_merge_data::do_set_keeps_input_sections): New method
3356 defintion.
3357 (Output_merge_string::do_set_keeps_input_sections): Ditto.
3358 * output.cc (Output_section::Input_section::relobj): Move method
3359 defintion from class declaration to here and handle merge sections.
3360 (Output_section::Input_section::shndx): Ditto.
3361 (Output_section::Output_section): Remove initializations of removed
3362 data members and initialize new data member LOOKUP_MAPS_.
3363 (Output_section::add_input_section): Set keeps-input-sections flag
3364 for a newly created merge output section as appropriate. Adjust code
3365 to use Output_section_lookup_maps class.
3366 (Output_section::add_relaxed_input_section): Adjst code for lookup
3367 maps code refactoring.
3368 (Output_section::add_merge_input_section): Add a new parameter
3369 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
3370 class. If adding input section to a newly created merge output
3371 section fails, remove the new merge section.
3372 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 3373 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
3374 (Output_section::find_merge_section): Ditto.
3375 (Output_section::build_lookup_maps): New method defintion.
3376 (Output_section::find_relaxed_input_section): Adjust code to use
3377 Output_section_lookup_maps class.
3378 (Output_section::get_input_sections): Export merge sections. Adjust
3379 code to use Output_section_lookup_maps class.
3380 (Output_section:::add_script_input_section): Adjust code to use
3381 Output_section_lookup_maps class. Update lookup maps for merge
3382 sections also.
3383 (Output_section::discard_states): Use Output_section_lookup_maps.
3384 (Output_section::restore_states): Same.
3385 * output.h (Merge_section_properties): Move class defintion out of
3386 Output_section.
3387 (Output_section_lookup_maps): New class.
3388 (Output_section::Input_section::is_merge_section): New method
3389 defintion.
3390 (Output_section::Input_section::relobj): Move defintion out of class
3391 defintion. Declare method only.
3392 (Output_section::Input_section::shndx): Ditto.
3393 (Output_section::Input_section::output_merge_base): New method defintion.
3394 (Output_section::Input_section::u2_.pomb): New union field.
3395 (Output_section::Merge_section_by_properties_map,
3396 Output_section::Output_section_data_by_input_section_map,
3397 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
3398 Remove types.
3399 (Output_section::add_merge_input_section): Add new parameter
3400 KEEPS_INPUT_SECTIONS.
3401 (Output_section::build_lookup_maps): New method declaration.
3402 (Output_section::merge_section_map_,
3403 Output_section::merge_section_by_properties_map_,
3404 Output_section::relaxed_input_section_map_,
3405 Output_section::is_relaxed_input_section_map_valid_): Remove data
3406 members.
3407 (Output_section::lookup_maps_): New data member.
3408
76295588
L
34092010-05-21 Doug Kwan <dougkwan@google.com>
3410
3411 PR gold/11619
3412 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
3413 avoid a compilation error.
3414
d103a984
RÁE
34152010-05-19 Rafael Espindola <espindola@google.com>
3416
3417 * script-sections.cc (Output_section_definition::allocate_to_segment):
3418 Update the phdrs_list even when the output section is NULL.
3419 * testsuite/Makefile.am: Add test.
3420 * testsuite/Makefile.in: Regenerate.
3421 * testsuite/script_test_9.cc: New.
3422 * testsuite/script_test_9.sh: New.
3423 * testsuite/script_test_9.t: New.
3424
6625d24e
DK
34252010-05-19 Doug Kwan <dougkwan@google.com>
3426
3427 * arm.cc (Arm_input_section::original_size): New method.
3428 (Arm_input_section::do_addralign): Add a cast.
3429 (Arm_input_section::do_output_offset): Remove static cast.
3430 (Arm_input_section::original_addralign,
3431 Arm_input_section::original_size_): Change type to uint32_t.
3432 (Arm_input_section::init): Add safe casts for section alignment
3433 and size.
3434 (Arm_input_section::set_final_data_size): Do not set address and
3435 offset of stub table.
3436 (Arm_output_section::fix_exidx_coverage): Change use of of
3437 Output_section::Simple_input_section to that of
3438 Output_section::Input_section.
3439 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
3440 except for the first pass.
3441 * output.cc (Output_section::get_input_sections): Change type of
3442 input_sections to std::list<Input_section>.
3443 (Output_section::add_script_input_section): Rename from
3444 Output_section::add_simple_input_section. Change type of SIS
3445 parameter from Simple_input_section to Input_section.
3446 * output.h (Output_section::Simple_input_section): Remove class.
3447 (Output_section::Input_section): Change class visibility to public.
3448 (Output_section::Input_section::addralign): Use stored alignments
3449 for special input sections if set.
3450 (Output_section::Input_section::set_addralign): New method.
3451 (Output_section::get_input_sections): Change parameter type from
3452 list of Simple_input_section to list of Input_section.
3453 (Output_section::add_script_input_section): Rename from
3454 Output_section::add_simple_input_section. Change first parameter's
3455 type from Simple_input_section to Input_section and remove the
3456 second and third parameters.
3457 * script-sections.cc (Input_section::Input_section_list): Change
3458 type to list of Output_section::Input_section/
3459 (Input_section_info::Input_section_info): Change parameter type of
3460 INPUT_SECTION to Output_section::Input_section.
3461 (Input_section_info::input_section): Change return type.
3462 (Input_section_info::input_section_): Change type to
3463 Output_section::Input_section.
3464 (Output_section_element_input::set_section_addresses): Adjust code
3465 to use Output_section::Input_section instead of
3466 Output_section::Simple_input_section. Adjust code for renaming
3467 of Output_section::add_simple_input_section.
3468 (Orphan_output_section::set_section_addresses): Ditto.
3469
e1e82ea4
RW
34702010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3471
3472 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
3473 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
3474
91e75c8a
RÁE
34752010-05-18 Rafael Espindola <espindola@google.com>
3476
3477 * options.cc (General_options::finalize): Handle -nostdlib.
3478 * options.h (nostdlib): New option.
3479 * script.cc (script_add_search_dir): Handle -nostdlib.
3480
da59ad79
DK
34812010-05-12 Doug Kwan <dougkwan@google.com>
3482
3483 * arm.cc (Target_arm::do_finalize_sections): Create an empty
3484 attributes section only if there no attributes section after merging.
3485 (Target_arm::merge_object_attributes): Move value of
e1df38aa 3486 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
3487 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
3488 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
3489 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
3490 and arm_attr_merge_7.stdout.
3491 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
3492 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
3493 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
3494 arm_attr_merge_7b.o): New rules.
3495 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
3496 arm_attr_merge_7
3497 * testsuite/Makefile.in: Regenerate.
3498 * testsuite/arm_attr_merge.sh: New file.
3499 * testsuite/arm_attr_merge_[67][ab].s: Same.
3500
3e01a7fd
NC
35012010-05-05 Nick Clifton <nickc@redhat.com>
3502
3503 * po/es.po: Updated Spanish translation.
3504
7ad2014a
L
35052010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3506
3507 * Makefile.am (install-exec-local): Properly install gold as
3508 default cross linker.
3509 * Makefile.in: Regenerated.
3510
4fda8867
NC
35112010-04-27 H.J. Lu <hongjiu.lu@intel.com>
3512 Nick Clifton <nickc@redhat.com>
3513
3514 * configure.ac (install_as_default): Define and set to false
3515 unless --enable-gold or --enable-gold=both/gold has been
3516 specified.
3517 * configure: Regenerate.
3518
3519 * Makefile.am (install-exec-local): Install the executable as
3520 'ld.gold'. If install_as_default is true then also install it as
3521 'ld'.
3522 * Makefile.in: Regenerated.
3523
bd288ea2
ILT
35242010-04-24 Ian Lance Taylor <iant@google.com>
3525
3526 * layout.cc (Layout::layout_reloc): In relocatable link don't
3527 combine reloc sections for grouped sections.
3528
ef38fd8a
ST
35292010-04-23 Sriraman Tallam <tmsriram@google.com>
3530
3531 * gc.h (gc_process_relocs): Pass information on relocs pointing to
3532 sections that are not ordinary to icf.
3533 * icf.cc (get_section_contents): Handle relocation pointing to section
3534 with no object or shndx information.
3535 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
3536 * testsuite/Makefile.in: Regenerate.
3537 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
3538 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
3539
f6973bdc
ILT
35402010-04-22 Ian Lance Taylor <iant@google.com>
3541
3542 * expression.cc (Expression::Expression_eval_info): Add
3543 result_alignment_pointer field.
3544 (Expression::eval_with_dot): Add result_alignment_pointer
3545 parameter. Change all callers.
3546 (Expression::eval_maybe_dot): Likewise.
3547 (class Binary_expression): Add alignment_pointer parameter to
3548 left_value and right_value. Change all callers.
3549 (BINARY_EXPRESSION): Set result alignment.
3550 (class Trinary_expression): Add alignment_pointer parameter to
3551 arg2_value and arg3_value. Change all callers.
3552 (Trinary_cond::value): Set result alignment.
3553 (Max_expression::value, Min_expression::value): Likewise.
3554 (Align_expression::value): Likewise.
3555 * script-sections.cc (class Sections_element): Add dot_alignment
3556 parameter to set_section_addresses virtual function. Update
3557 instantiations.
3558 (class Output_section_element): Likewise.
3559 (Script_sections::create_segments): Add dot_alignment parameter.
3560 Change all callers.
3561 (Script_sections::create_segments_from_phdrs_clause): Likewise.
3562 (Script_sections::set_phdrs_clause_addresses): Likewise.
3563 * script-sections.h: Update declarations.
3564 * script.h: Update declarations.
3565 * output.h (Output_segment::set_minimum_p_align): Don't decrease
3566 min_p_align.
3567 * testsuite/script_test_3.t: Set large alignment.
3568 * testsuite/script_test_3.sh: Make sure that at least one LOAD
3569 segment has expected alignment.
3570
9c9c98a5
NC
35712010-04-22 Nick Clifton <nickc@redhat.com>
3572
3573 * po/gold.pot: Updated by the Translation project.
3574 * po/vi.po: Updated Vietnamese translation.
3575
2253bfba
L
35762010-04-22 H.J. Lu <hongjiu.lu@intel.com>
3577
3578 * testsuite/Makefile.am (check_PROGRAMS): Add
3579 icf_virtual_function_folding_test.
3580 * testsuite/Makefile.in: Regenerated.
3581
85fdf906
AH
35822010-04-15 Andrew Haley <aph@redhat.com>
3583
3584 * options.h (merge_exidx_entries): New option.
3585 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
3586 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
3587 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
3588 (Target_arm::merge_exidx_entries): New function.
3589 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
3590 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
3591 to Arm_exidx_fixup constructor.
3592 Add new arg, merge_exidx_entries.
3593 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
3594 Arm_output_section::fix_exidx_coverage.
3595
ce97fa81
ST
35962010-04-18 Sriraman Tallam <tmsriram@google.com>
3597
3598 * icf.cc (get_section_contents): Check for preemptible functions.
3599 Ignore addend when appropriate.
3600 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
3601 section folded.
3602 (add_from_relobj): Check for section folded.
3603 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
3604 * symtab.h (should_add_dynsym_entry): Add new parameter.
3605 * target-reloc.h (scan_relocs): Check for section folded.
3606 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
3607 Check reloc types for function pointers in shared objects.
3608 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
3609 case.
3610 (icf_preemptible_functions_test): New test case.
3611 (icf_string_merge_test): New test case.
3612 * testsuite.Makefile.in: Regenerate.
3613 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
3614 bar_glob. Refactor code.
3615 * testsuite/icf_preemptible_functions_test.cc: New file.
3616 * testsuite/icf_preemptible_functions_test.sh: New file.
3617 * testsuite/icf_string_merge_test.cc: New file.
3618 * testsuite/icf_string_merge_test.sh: New file.
3619 * testsuite/icf_virtual_function_folding_test.cc: New file.
3620 * testsuite/icf_virtual_function_folding_test.sh: New file.
3621
04ceb17c
DK
36222010-04-14 Doug Kwan <dougkwan@google.com>
3623
3624 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
3625 for local symbol recounting if we remove a section due to ICF.
3626 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
3627 there are no regular objects in input.
3628
153e7da4
DK
36292010-04-13 Doug Kwan <dougkwan@google.com>
3630
3631 * arm.cc (Arm_input_section::set_final_data_size): Compute
3632 accurate final data size instead of using current data size.
3633
4dbd9faf
DK
36342010-04-09 Doug Kwan <dougkwan@google.com>
3635
3636 * layout.cc (Layout::choose_output_section): Handle script section
3637 types.
3638 (Layout::make_output_section_for_script): Add section type parameter.
3639 Handle script section types.
3640 * layout.h (Layout::make_output_section_for_script): Add section
3641 type parameter.
3642 * output.cc (Output_section::Output_section): Initialize data member
3643 is_noload_.
3644 (Output_section::do_reset_address_and_file_offset): Do not set address
3645 to 0 if section is a NOLOAD section.
3646 * output.h (Output_section::is_noload): New method.
3647 (Output_section::set_is_noload): Ditto.
3648 (Output_section::is_noload_): New data member.
3649 * script-c.h (Script_section_type): New enum type.
3650 (struct Parser_output_section_header): Add new file section_type.
3651 * script-sections.cc (Sections_element::output_section_name): Add
3652 parameter for returning script section type.
3653 (Output_section_definition::output_section_name): Ditto.
3654 (Output_section_definition::section_type)P; New method.
3655 (Output_section_definiton::script_section_type_name): Ditto.
3656 (Output_section_definition::script_section_type_): New data member.
3657 (Output_section_definition::Output_section_definition): Initialize
3658 data member Output_section_definition::script_section_type_.
3659 (Output_section_definition::create_sections): Pass script section type
3660 to Layout::make_output_section_for_script.
3661 (Output_section_definition::output_section_name): Return script
3662 section type to caller.
3663 (Output_section_definition::set_section_address): Do not advance
3664 dot value and load address if section type is NOLOAD. Set address
3665 of NOLOAD sections regardless of section flags.
3666 (Output_section_definition::print): Print section type if it is
3667 not SCRIPT_SECTION_TYPE_NONE.
3668 (Output_section_definition::section_type): New method.
3669 (Output_section_definition::script_section_type_name): Ditto.
3670 (Script_sections::output_section_name): Add new parameter
3671 PSECTION_TYPE for returning script section type. Pass it to
3672 section elements. Handle discard sections.
3673 (Sort_output_sections::operator()): Handle NOLOAD sections.
3674 * script-sections.h (Script_sections::Section_type): New enum type.
3675 (Script_sections::output_section_name): Add a new parameter for
3676 returning script section type.
3677 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
3678 INFO and NOLOAD.
3679 * yyscript.y (union): Add new field SECTION_TYPE.
3680 (COPY, DSECT, INFO, NOLOAD): New tokens.
3681 (opt_address_and_section_type): Change type to output_section_header.
3682 (section_type): New non-terminal
3683 (section_header): Handle section type.
2253bfba 3684 (opt_address_and_section_type): Return section type value.
4dbd9faf 3685
721ea635
L
36862010-04-09 H.J. Lu <hongjiu.lu@intel.com>
3687
3688 * testsuite/plugin_common_test_1.c (foo): Add prototype.
3689 * testsuite/plugin_common_test_2.c (foo): Likewise.
3690
6bf924b0
DK
36912010-04-08 Doug Kwan <dougkwan@google.com>
3692
3693 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
3694 Output_merge_data.
3695 * output.cc (Output_section::add_merge_input_section): Simplify
3696 code and return status of Output_merge_base::add_input_section.
e1df38aa 3697 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
3698 returns true.
3699
24af6f92
DK
37002010-04-07 Doug Kwan <dougkwan@google.com>
3701
3702 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
3703 if section is marked as containing instructions but has no mapping
3704 symbols.
3705 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
3706 correct section index.
3707 (Arm_relobj::find_linked_text_section): Ditto.
3708
00698fc5
CC
37092010-04-07 Cary Coutant <ccoutant@google.com>
3710
3711 * archive.cc (include_member): Destroy Read_symbols_data object before
3712 releasing file.
3713 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
3714 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
3715 (Read_symbols_data::~Read_symbols_data) New destructor.
3716 (Section_relocs::Section_relocs) New constructor.
3717 (Section_relocs::~Section_relocs) New destructor.
3718 (Read_relocs_data::Read_relocs_data) New constructor.
3719 (Read_relocs_data::~Read_relocs_data) New destructor.
3720 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
3721 pointers to NULL after deleting.
3722
7296d933
DK
37232010-04-07 Doug Kwan <dougkwan@google.com>
3724
3725 * arm.cc: Replace "endianity" with "endianness" in comments.
3726 (Arm_exidx_cantunwind): Ditto.
3727 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
3728 (Arm_relobj::merge_flags_and_attributes): New method.
3729 (Arm_relobj::merge_flags_and_attributes_): New data member.
3730 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
3731 (Arm_relobj::scan_sections_for_stubs): Ditto.
3732 (Arm_relobj::do_read_symbols): Check to see if we really want to
3733 merge processor-specific flags and attributes. Exit early if
3734 an object is empty except for section names and the undefined symbol.
3735 (Target_arm::do_finalize_sections): Move check for ELF format to
3736 Arm_relobj::do_read_symbols. Merge processor specific flags and
3737 attributes from a regular object only when we have determined that
3738 it is aapropriate. Do not create an .ARM.attributes section in
3739 output if there is no regular input object.
3740 (Target_arm::merge_processor_specific_flags): Check
3741 --warn-mismatch before printing any error.
3742 (Target_arm::merge_object_attributes): Ditto.
3743 * gold.cc (queue_middle_tasks): Handle the case in which there is
3744 no regular object in input.
3745 * options.cc (General_options::parse_EB): New method.
3746 (General_options::parse_EL): Same.
3747 (General_options::General_options): Initialize endianness_.
3748 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
3749 New options.
3750 (General_options::Endianness): New enum.
3751 (General_options::endianness): New method.
3752 (General_options::endianness_): New data member.
3753 * parameters.cc (Parameters::set_options): Check target endianness.
3754 (Parameters::set_target_once): Ditto.
3755 (Parameters::check_target_endianness): New method.
3756 (parameters_force_valid_target): If either -EL or -EB is specified,
3757 use it to define endianness of default target.
3758 * parameters.h (Parameters::check_target_endianness): New method
3759 declaration.
3760 * target.h (class Target): Change "endianity" to "endianness"
3761 in comments.
3762
efc8d4f2
RW
37632010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
3764
3765 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
3766 * configure: Regenerate.
3767 * Makefile.in: Regenerate.
3768 * testsuite/Makefile.in: Regenerate.
3769
be234d88
CC
37702010-04-06 Cary Coutant <ccoutant@google.com>
3771
3772 gcc PR lto/42757
3773 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
3774 prevailing definitions of common symbols.
3775 * testsuite/plugin_test_6.sh: New test case.
3776 * testsuite/plugin_common_test_1.c: New test case.
3777 * testsuite/plugin_common_test_2.c: New test case.
3778 * testsuite/Makefile.am (plugin_test_6): New test case.
3779 * testsuite/Makefile.in: Regenerate.
3780
bd32c6bd
NC
37812010-04-06 Nick Clifton <nickc@redhat.com>
3782
3783 * po/vi.po: New Vietnamese translation.
3784
323c532f
DK
37852010-03-30 Doug Kwan <dougkwan@google.com>
3786
3787 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
3788
4fcd97eb
DK
37892010-03-25 Doug Kwan <dougkwan@google.com>
3790
3791 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
3792 to avoid a conversion warning on a 32-bit host.
3793
4ebf39db
ILT
37942010-03-24 Ian Lance Taylor <iant@google.com>
3795
3796 * testsuite/script_test_3.t: Add a TLS segment.
3797 * testsuite/Makefile.am (check_PROGRAMS): Add
3798 tls_phdrs_script_test.
3799 (tls_phdrs_script_test_SOURCES): Define.
3800 (tls_phdrs_script_test_DEPENDENCIES): Define.
3801 (tls_phdrs_script_test_LDFLAGS): Define.
3802 (tls_phdrs_script_test_LDADD): Define.
3803 * testsuite/Makefile.in: Rebuild.
3804
4a599bdd
CC
38052010-03-23 Cary Coutant <ccoutant@google.com>
3806
3807 * fileread.cc (find_or_make_view): Fix comment.
3808
6c93b22c
ILT
38092010-03-23 Ian Lance Taylor <iant@google.com>
3810
3811 * script-sections.cc (class Orphan_section_placement): Define
3812 PLACE_TLS and PLACE_TLS_BSS.
3813 (Orphan_section_placement::Orphan_section_placement): Initialize
3814 new places.
3815 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
3816 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
3817 (tls_script_test_SOURCES): Define.
3818 (tls_script_test_DEPENDENCIES): Define.
3819 (tls_script_test_LDFLAGS): Define.
3820 (tls_script_test_LDADD): Define.
3821 * testsuite/Makefile.in: Rebuild.
3822
a2c7281b
DK
38232010-03-22 Doug Kwan <dougkwan@google.com>
3824
3825 * arm.cc (Arm_relocate_functions::abs8,
3826 Arm_relocate_functions::abs16): Use correct check for overflow
3827 specified in the ARM ELF specs.
3828 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
3829 target of a BLX instruction specially.
3830 (Reloc_stub::stub_type_for_reloc): Ditto.
3831 (Relocate::relocate): Use symbolic names instead of numeric relocation
3832 codes to report error.
3833 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
3834 workaround.
3835 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
3836 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
3837 thumb2_blx_out_of_range.stdout
3838 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
3839 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
3840 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
3841 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
3842 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
3843 thumb2_blx_in_range, thumb2_blx_in_range.o,
3844 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
3845 thumb2_blx_out_of_range.o): New rules.
3846 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
3847 thumb2_blx_in_range and thumb2_blx_out_of_range.
3848 * testsuite/Makefile.in: Regenerate.
3849 * arm_branch_in_range.sh: Add tests for THUMB BLX.
3850 * testsuite/thumb_blx_in_range.s: New file.
3851 * testsuite/thumb_blx_out_of_range.s: New file.
3852
b0193076
RÁE
38532010-03-22 Rafael Espindola <espindola@google.com>
3854
3855 * archive.cc (Should_include): Move to archive.h.
3856 (should_include_member): Make it a member of Archive.
3857 (Lib_group): New.
3858 (Add_lib_group_symbols): New.
3859 * archive.h: Include options.h.
3860 (Archive_member): Moved from Archive.
3861 (Should_include): Moved from archive.cc.
3862 (Lib_group): New.
3863 (Add_lib_group_symbols): New.
3864 * dynobj.cc (do_should_include_member): New.
3865 * dynobj.h (do_should_include_member): New.
3866 * gold.cc (queue_initial_tasks): Update call to queue.
3867 * main.cc (main): Print lib group stats.
3868 * object.cc (do_should_include_member): New.
3869 * object.h: Include archive.h.
3870 (Object::should_include_member): New.
3871 (Object::do_should_include_member): New.
3872 (Sized_relobj::do_should_include_member): New.
3873 * options.cc (General_options::parse_start_lib): New.
3874 (General_options::parse_end_lib): New.
3875 (Input_arguments::add_file): Handle lib groups.
3876 (Input_arguments::start_group): Check we are not in a lib.
3877 (Input_arguments::start_lib): New.
3878 (Input_arguments::end_lib): New.
3879 * options.h (General_options): Add start_lib and end_lib.
3880 (Input_argument::lib_): New.
3881 (Input_argument::lib): New.
3882 (Input_argument::is_lib): New.
3883 (Input_file_lib): New.
3884 (Input_arguments::in_lib_): New.
3885 (Input_arguments::in_lib): New.
3886 (Input_arguments::start_lib): New.
3887 (Input_arguments::end_lib_): New.
3888 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
3889 in unused members as preempted.
3890 (Sized_pluginobj::do_should_include_member): New.
3891 * plugin.h (Sized_pluginobj::do_should_include_member): New.
3892 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
3893 return the blocker.
3894 (Read_symbols::do_whole_lib_group): New.
3895 (Read_symbols::do_lib_group): New.
3896 (Read_symbols::do_read_symbols): Handle lib groups.
3897 (Read_symbols::get_name): Handle lib groups.
3898 * readsyms.h (Read_symbols): Add an archive member pointer.
3899 (Read_symbols::do_whole_lib_group): New.
3900 (Read_symbols::do_lib_group): New.
3901 (Read_symbols::member_): New.
3902 * script.cc (read_input_script): Update call to queue_soon.
3903
d099120c
DK
39042010-03-19 Doug Kwan <dougkwan@google.com>
3905
3906 * arm.cc (Stub_table::Stub_table): Initialize new data members
3907 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3908 (Stub_table::add_reloc_stub): Assign stub offset and update
3909 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
3910 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
3911 New data members.
3912 (Stub_table::update_data_size_and_addralign): Use
3913 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
3914 instead of going over all reloc stubs.
3915 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
3916 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3917 Stringpool_template::offset_ to size of Stringpool_char.
3918 (Stringpool_template::new_key_offset): Remove code to initialize
3919 Stringpool_template::offset_.
3920 * stringpool.h (Stringpool_template::set_no_zero_null): Set
3921 Stringpool_template::offset_ to zero.
3922
1aa37384
DK
39232010-03-15 Doug Kwan <dougkwan@google.com>
3924
3925 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
3926 offset_.
3927 (Stringpool_template::new_key_offset): New method.
3928 (Stringpool_template::add_string): Assign offsets when adding new
3929 strings.
3930 (Stringpool_template::set_string_offsets): Do not set string offsets
3931 when not optimizing.
3932 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
3933 member size_.
3934 (Chunked_vector::clear): Clear size_.
3935 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
3936 (Chunked_vector::size): Return size_.
3937 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 3938 (Chunked_vector::size_): New data member.
1aa37384
DK
3939 (Stringpool_template::set_no_zero_null): Assert string set is empty.
3940 (Stringpool_template::new_key_offset): New method declaration.
3941 (Stringpool_template::offset_): New data member.
3942
b672b057
RÁE
39432010-03-15 Rafael Espindola <espindola@google.com>
3944
3945 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
3946 Add_symbols' constructor.
3947 * readsyms.h (Add_symbols): Remove the input_group member.
3948
b6848d3c
ILT
39492010-03-10 Ian Lance Taylor <iant@google.com>
3950
3951 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
3952 target to ask whether a reference to a symbol requires a stack
3953 split.
3954 * target.h (Target::is_call_to_non_split): New function.
3955 (Target::do_is_call_to_non_split): Declare virtual function.
3956 * target.cc: Include "symtab.h".
3957 (Target::do_is_call_to_non_split): New function.
3958 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
3959
a2a5469e
CC
39602010-03-10 Cary Coutant <ccoutant@google.com>
3961
3962 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
3963 (File_read::open[1]): Remove initial mapping of whole_file_view_.
3964 (File_read::open[2]): Add whole_file_view_ to list of views.
3965 (File_read::make_view): Remove test of whole_file_view_.
3966 (File_read::find_or_make_view): Create whole_file_view_ if
3967 necessary.
3968 (File_read::clear_views): Replace bool parameter with enum;
3969 adjust all callers. Don't delete views with permanent data;
3970 do delete cached views and views from archives if
3971 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
3972 if clearing the corresponding view.
3973 * fileread.h (File_read::Clear_views_mode): New enum.
3974 (File_read::View::is_permanent_view): New method.
3975 (File_read::clear_views): Replace bool parameter
3976 with enum; adjust all callers.
3977 * options.h (General_options): Change keep_files_mapped option;
3978 add map_whole_files.
3979 * readsyms.cc (Add_symbols::run): Delete sd_ object before
3980 releasing the file.
3981 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
3982 the file.
3983
8861f32b
DM
39842010-03-10 David S. Miller <davem@davemloft.net>
3985
3986 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
3987
d62d0f5f
ST
39882010-03-09 Sriraman Tallam <tmsriram@google.com>
3989
3990 * icf.cc (get_section_contents): Add '@' marker after processing the
3991 merge reloc.
3992
9177756d
DK
39932010-03-08 Doug Kwan <dougkwan@google.com>
3994
3995 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
3996 due to a conversion warning.
3997 (Arm_relobj::update_output_local_symbol_count): Check for local
3998 symbol with unset output index.
3999
9e9e071b
ILT
40002010-03-05 Ian Lance Taylor <iant@google.com>
4001
4002 * options.h (class General_options): Add --spare-dynamic-tags.
4003 * output.cc (Output_data_dynamic::set_final_data_size): Implement
4004 --spare-dynamic-tags.
4005
a81ee015
ILT
40062010-03-05 Ian Lance Taylor <iant@google.com>
4007
4008 * incremental.cc: Include "libiberty.h".
4009
44ec90b9
RO
40102010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
4011
4012 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
4013 function, is_info_ member.
4014 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
4015 (Versions::Versions): Update caller.
4016 (Versions::define_base_version): Likewise.
4017 (Versions::add_def): Likewise.
4018
0897ed3b
ST
40192010-03-03 Sriraman Tallam <tmsriram@google.com>
4020
4021 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
4022 (Scan::possible_function_pointer_reloc): New function.
4023 (Scan::local_reloc_may_be_function_pointer): Change to call
4024 possible_function_pointer_reloc.
4025 (Scan::global_reloc_may_be_function_pointer): Ditto.
4026 * icf.h (Icf::check_section_for_function_pointers): Change to reject
4027 relocations in ".data.rel.ro._ZTV" section.
4028 * testsuite/icf_safe_so_test.sh: Change to pass i386.
4029 * testsuite/icf_safe_so_test.cc: Ditto.
4030 * testsuite/icf_safe_test.cc: Ditto.
4031 * testsuite/icf_safe_test.sh: Ditto.
4032
d3bbad62
ILT
40332010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4034 Ian Lance Taylor <iant@google.com>
4035
4036 * target-reloc.h (relocate_section): Check the symbol table index
4037 for -1U before setting the local symbol index.
4038 (scan_relocatable_relocs): If copying the relocation, record that
4039 the local symbol is required.
4040 * object.h (Symbol_value::is_output_symtab_index_set): New
4041 function.
4042 (Symbol_value::may_be_discarded_from_output_symtab): New
4043 function.
4044 (Symbol_value::has_output_symtab_entry): New function.
4045 (Symbol_value::needs_output_symtab_entry): Remove.
4046 (Symbol_value::output_symtab_index): Make sure the symbol index is
4047 set.
4048 (Symbol_value::set_output_symtab_index): Make sure the symbol
4049 index is not set. Make sure the new index is valid.
4050 (Symbol_value::set_must_have_output_symtab_entry): New function.
4051 (Symbol_value::has_output_dynsym_entry): New function.
4052 (Symbol_value::set_output_dynsym_index): Make sure the new index
4053 is valid.
4054 (Sized_relobj::set_must_have_output_symtab_entry): New function.
4055 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
4056 local symbol if permitted.
4057 (Sized_relobj::do_finalize_local_symbols): Call
4058 is_output_symtab_index_set rather than needs_output_symtab_entry.
4059 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
4060 rather than needs_output_symtab_entry. Call
4061 has_output_dynsym_entry rather than needs_output_dynsym_entry.
4062 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
4063 is_output_symtab_index_set rather than needs_output_symtab_entry.
4064 * testsuite/discard_locals_relocatable_test.c: New file.
4065 * testsuite/discard_locals_test.sh: Test -r.
4066 * testsuite/Makefile.am (check_DATA): Add
4067 discard_locals_relocatable_test1.syms,
4068 discard_local_relocatable_test2.syms.
4069 (MOSTLYCLEANFILES): Likewise. Also add
4070 discard_locals_relocatable_test1.lout and
4071 discard_locals_relocatable_test2.out.
4072 (discard_locals_relocatable_test1.syms): New target.
4073 (discard_locals_relocatable_test.o): New target.
4074 (discard_locals_relocatable_test1.out): New target.
4075 (discard_locals_relocatable_test2.syms): New target.
4076 (discard_locals_relocatable_test2.out): New target.
4077 (various): Add missing ../ld-new dependencies.
4078 * testsuite/Makefile.in: Rebuild.
4079
7e8ccf26
NC
40802010-03-03 Nick Clifton <nickc@redhat.com>
4081
4082 * po/fi.po: New Finnish translation.
4083
2a0ff005
DK
40842010-03-01 Doug Kwan <dougkwan@google.com>
4085
4086 * layout.cc (Layout::Layout): Force section types of .init_array*,
4087 .preinit_array* and .fini_array* sections.
4088 * output.cc (Output_section::Input_section_sort_entry::has_priority):
4089 Fix check of return value of std::string::find.().
4090 (Output_section::Input_section_sort_compare::operator()): Remove
4091 comment about .init_array.
4092 (Output_section::Input_section_sort_init_fini_compare::operator()):
4093 New method.
4094 (Output_section::sort_attached_input_sections): Handle .init_array
4095 and .fini_array specially.
4096 * output.h (Output_section::Inut_section_sort_compare): Update
4097 comment.
4098 (Output_section::Input_section_sort_init_fini_compare): New struct.
4099
c3e4ae29
DK
41002010-02-26 Doug Kwan <dougkwan@google.com>
4101
4102 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
4103 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
4104 * testsuite/debug_msg.sh: Avoid matching source line number for
4105 use of global variable undef_int.
4106
2fd9ae7a
DK
41072010-02-26 Doug Kwan <dougkwan@google.com>
4108
4109 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
4110 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
4111 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
4112 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
4113 * options.cc (General_options::General_options): Initialize member
4114 fix_v4bx_.
4115 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
4116 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
4117 and rm_no_fix_v4bx.stdout
4118 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
4119 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
4120 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
4121 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
4122 and arm_no_fix_v4bx.
4123 * Makefile.in: Regenerate.
4124 * testsuite/arm_fix_v4bx.s: New file.
4125 * testsuite/arm_fix_v4bx.sh: Ditto.
4126
67ec7d0b
DK
41272010-02-24 Doug Kwan <dougkwan@google.com>
4128
4129 * arm.cc (Target_arm::got_section): Make the .got section the first
4130 non RELRO section in the data segment.
4131 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
4132 suffixes of section names.
4133
10165461
DK
41342010-02-24 Doug Kwan <dougkwan@google.com>
4135
4136 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
4137 flags and attributes merging if an input file is a binary file.
4138 * fileread.cc (Input_file::open): Record format of original file.
4139 * fileread.h (Input_file::Format): New enum type.
4140 (Input_file::Input_file): Initialize data member format_.
4141 (Input_file::format): New method definition.
4142 (Input_file::format_):: New data member.
4143
4a54abbb
DK
41442010-02-24 Doug Kwan <dougkwan@google.com>
4145
4146 * arm.cc (Arm_output_data_got): New class.
4147 (ARM_TCB_SIZE): New constant
4148 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
4149 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
4150 If user uses a script with a SECTIONS clause, issue only a warning
4151 for a misplaced EXIDX input section. Otherwise, issue an error.
4152 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
4153 garbage collection.
4154 (Target_arm::got_mode_index_entry): Handle static linking.
4155 (Target_arm::Scan::local): Ditto.
4156 (Target_arm::Scan::global): Ditto.
4157 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
4158 all incorrectly implemented relocations.
e1df38aa 4159 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
4160 Arm_output_section::fix_exidx_coverage.
4161 * layout.cc (Layout::section_name_mapping): Remove trailing dots
4162 from ".ARM.exidx." and ".ARM.extab.".
4163
ca419a6f
ILT
41642010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4165
4166 * arm.cc (Target_arm::do_finalize_sections): Create attribute
4167 section if it does not already exist.
4168 * attributes.cc (Attributes_section_data::Attributes_section_data):
4169 Don't crash if size is zero.
4170
135b9c78
ILT
41712010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4172 Ian Lance Taylor <iant@google.com>
4173
4174 * gold.cc (queue_middle_tasks): If no input files were opened,
4175 exit.
4176 * workqueue.h (Task_function::Task_function): Assert that there is
4177 a blocker.
4178
bb0bfe4f
DK
41792010-02-22 Doug Kwan <dougkwan@google.com>
4180
4181 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
4182 * icf.cc (get_section_contents): Cast snprintf arguments to long long
4183 types to avoid warnings due to different uint64_t implementations
4184 on different hosts.
4185
2a2b6d42
DK
41862010-02-21 Doug Kwan <dougkwan@google.com>
4187
4188 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
4189 handling of the maximum backward branch offset.
4190 (Arm_relocate_functions::thumb_branch_common): Ditto.
4191 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
4192 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 4193 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
4194 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
4195 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
4196 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
4197 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
4198 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
4199 thumb_bl_out_of_range thumb_bl_out_of_range.o,
4200 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
4201 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
4202 thumb2_bl_out_of_range.o): New rules.
4203 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
4204 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
4205 thumb2_bl_out_of_range
4206 * testsuite/Makefile.in: Regenerate.
4207 * testsuite/arm_bl_in_range.s: New file.
4208 * testsuite/arm_bl_out_of_range.s: Ditto.
4209 * testsuite/arm_branch_in_range.sh: Ditto.
4210 * testsuite/arm_branch_range.t: Ditto.
4211 * testsuite/thumb2_branch_range.t: Ditto.
4212 * testsuite/thumb_bl_in_range.s: Ditto.
4213 * testsuite/thumb_bl_out_of_range.s: Ditto.
4214 * testsuite/thumb_branch_range.t: Ditto.
4215
b487ad64
ST
42162010-02-20 Sriraman Tallam <tmsriram@google.com>
4217
4218 * gc.h (gc_process_relocs): Change vectors to point to the new list.
4219 Add reloc offset information.
4220 * icf.cc (get_section_contents): Change iterators to point to the new
4221 vectors. Add reloc offset information to the contents.
4222 * icf.h (Icf::Sections_reachable_info): New typedef.
4223 (Icf::Sections_reachable_list): New typedef.
4224 (Icf::Offset_info): New typedef.
4225 (Icf::Reloc_info): New struct typedef.
4226 (Icf::Reloc_info_list): New typedef.
4227 (Icf::symbol_reloc_list): Delete method.
4228 (Icf::addend_reloc_list): Delete method.
4229 (Icf::section_reloc_list): Delete method.
4230 (Icf::reloc_info_list): New method.
4231 (Icf::reloc_info_list_): New member.
4232
f96accdf
DK
42332010-02-19 Doug Kwan <dougkwan@google.com>
4234
4235 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
4236 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
4237 * arm.cc (Arm_relocation_functions): New forward declaration.
4238 (Target_arm::Target_arm): Initialize new data members
4239 got_mod_index_offset_ and tls_base_symbol_defined_.
4240 (Target_arm::Relocate::relocate_tls): New method.
4241 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
4242 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
4243 New methods.
4244 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
4245 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
4246 (Target_arm::got_mod_index_offset_,
4247 Target_arm::tls_base_symbol_defined_): New data members.
4248 (Target_arm::Scan::local, Target::Scan::global,
4249 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
4250 relocations.
4251
c8761b9a
DK
42522010-02-18 Doug Kwan <dougkwan@google.com>
4253
4254 * arm.cc (Arm_relobj::find_linked_text_section): New method.
4255 (Arm_relobj::make_exidx_input_section): Pass section index of linked
4256 text section as a parameter becuase some broken tools may not set
4257 the link in section header.
4258 (Target_arm::has_got_section): New method.
4259 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
4260 without any mapping symbol as data only. Remove warning.
4261 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
4262 link in its section header, try to discover the link by inspecting the
4263 REL31 relocation at the beginning of the section.
4264 (Target_arm::Scan::check_non_pic): Report name of offending relocation
4265 in error message.
4266 (Target_arm::Scan::global): Treat any reference to the symbol
4267 _GLOBAL_OFFSET_TABLE_ as a GOT access.
4268
21bb3914
ST
42692010-02-12 Sriraman Tallam <tmsriram@google.com>
4270
4271 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
4272 (Scan::global_reloc_may_be_function_pointer): New function.
4273 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4274 (Scan::global_reloc_may_be_function_pointer): New function.
4275 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
4276 (Scan::global_reloc_may_be_function_pointer): New function.
4277 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
4278 (Scan::global_reloc_may_be_function_pointer): New function.
4279 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
4280 (Scan::global_reloc_may_be_function_pointer): New function.
4281 (Scan::possible_function_pointer_reloc): New function.
4282 (Target_x86_64::can_check_for_function_pointers): New function.
4283 * gc.h (gc_process_relocs): Scan relocation types to determine if
4284 function pointers were taken for targets that support it.
4285 * icf.cc (Icf::find_identical_sections): Include functions for
4286 folding in safe ICF whose pointer is not taken.
4287 * icf.h (Secn_fptr_taken_set): New typedef.
4288 (fptr_section_id_): New member.
4289 (section_has_function_pointers): New function.
4290 (set_section_has_function_pointers): New function.
4291 (check_section_for_function_pointers): New function.
4292 * options.h: Fix comment for safe ICF option.
4293 * target.h (can_check_for_function_pointers): New function.
4294 * testsuite/Makefile.am: Add icf_safe_so_test test case.
4295 Modify icf_safe_test for X86-64.
4296 * testsuite/Makefile.in: Regenerate.
4297 * testsuite/icf_safe_so_test.cc: New file.
4298 * testsuite/icf_safe_so_test.sh: New file.
4299 * testsuite/icf_safe_test.cc (kept_func_3): New function.
4300 (main): Change to take pointer to function kept_func_3.
4301 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
4302 folding is done correctly for X86-64.
4303
0da6fa6c
DM
43042010-02-12 David S. Miller <davem@davemloft.net>
4305
4306 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
4307 is_symbolless parameter.
4308 (Output_reloc<SHT_REL>::is_symbolless): New.
4309 (Output_reloc<SHT_REL>::is_symbolless_): New.
4310 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
4311 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
4312 (Output_reloc<SHT_RELA>::is_symbolless): New.
4313 (Output_data_reloc::add_global): Handle is_symbolless.
4314 (Output_data_reloc::add_global_relative): Likewise.
4315 (Output_data_reloc::add_local): Likewise.
4316 (Output_data_reloc::add_local_relative): Likewise.
4317 (Output_data_reloc::add_symbolless_global_addend): New.
4318 (Output_data_reloc::add_symbolless_local_addend): New.
4319 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
4320 is_symbolless.
4321 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
4322 instead of ->is_relative_
4323 (Output_reloc::write): Likewise.
4324 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
4325 (Output_reloc::write_rel): Simplify.
4326
4327 * sparc.cc (Target_sparc::Scan::local): Use
4328 ->add_symbolless_local_addend as needed.
4329 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
4330 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
4331 based upon relocation offset.
4332
e4782e83
DK
43332010-02-11 Doug Kwan <dougkwan@google.com>
4334
4335 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
4336 (Target_arm::Scan::global): Ditto. Also remove a comment before the
4337 beginning of function.
4338 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
4339 and MOVT_ABS relocations. Those are non issued in scanning. Fix
4340 parameter is_32bit in calls to should_apply_static_reloc.
4341 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
4342 (check_DATA): Add arm_abs_global.stdout.
4343 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
4344 arm_abs_global.stdout): New rules.
4345 (MOSTLLYCLEANFILES): Add arm_abs_global
4346 * Makefile.in: Regenerate.
4347 * testsuite/arm_abs_global.s: New file.
4348 * testsuite/arm_abs_global.sh: Ditto.
4349 * testsuite/arm_abs_lib.s: Ditto.
4350
93ceb764
ILT
43512010-02-11 Ian Lance Taylor <iant@google.com>
4352
4353 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
4354 Read_relocs task.
4355 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
4356 Allocate_commons_task first.
4357 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
4358 task, rather than symtab_lock_.
4359 (Gc_process_relocs::~Gc_process_relocs): New function.
4360 (Gc_process_relocs::is_runnable): Check this_blocker_.
4361 (Gc_process_relocs::locks): Use next_blocker_ rather than
4362 blocker_.
4363 (Scan_relocs::~Scan_relocs): New function.
4364 (Scan_relocs::is_runnable): Check this_blocker_ rather than
4365 symtab_lock_.
4366 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
4367 next_blocker_.
4368 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
4369 fields. Add this_blocker_ and next_blocker_ fields. Adjust
4370 constructor accordingly.
4371 (class Gc_process_relocs): Likewise.
4372 (class Scan_relocs): Likewise.
4373 * common.h (class Allocate_commons_task): Remove symtab_lock_
4374 field, and corresponding constructor parameter.
4375 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
4376 symtab_lock_.
4377 (Allocate_commons_task::locks): Likewise.
4378
114dfbe1
ILT
43792010-02-11 Ian Lance Taylor <iant@google.com>
4380
4381 * gold-threads.h (class Once): Define.
4382 (class Initialize_lock): Rewrite as child of Once.
4383 * gold-threads.cc (class Once_initialize): Define.
4384 (once_pointer_control): New static variable.
4385 (once_pointer, once_arg): New static variables.
4386 (c_run_once): New static function.
4387 (Once::Once, Once::run_once, Once::internal_run): New functions.
4388 (class Initialize_lock_once): Remove.
4389 (initialize_lock_control): Remove.
4390 (initialize_lock_pointer): Remove.
4391 (initialize_lock_once): Remove.
4392 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
4393 (Initialize_lock::initialize): Rewrite.
4394 (Initialize_lock::do_run_once): New function.
4395 * archive.cc (Archive::interpret_header): Only clear name if it is
4396 not already empty.
4397 * fileread.cc: Include "gold-threads.h"
4398 (file_counts_lock): New static variable.
4399 (file_counts_initialize_lock): Likewise.
4400 (File_read::release): Only increment counts when using --stats.
4401 Use a lock around the increment.
4402 * parameters.cc (class Set_parameters_target_once): Define.
4403 (set_parameters_target_once): New static variable.
4404 (Parameters::Parameters): Move here from parameters.h.
4405 (Parameters::set_target): Rewrite.
4406 (Parameters::set_target_once): New function.
4407 (Parameters::clear_target): Move here and rewrite.
4408 * parameters.h (class Parameters): Update declarations. Add
4409 set_parameters_target_once_ field.
4410 (Parameters::Parameters): Move to parameters.cc.
4411 (Parameters::clear_target): Likewise.
4412 * readsyms.cc (Read_symbols::do_group): Create a Start_group
4413 task.
4414 (Start_group::~Start_group): New function.
4415 (Start_group::is_runnable): New function.
4416 (Start_group::locks, Start_group::run): New functions.
4417 (Finish_group::run): Change saw_undefined to size_t.
4418 * readsyms.h (class Start_group): Define.
4419 (class Finish_group): Change saw_undefined_ field to size_t.
4420 (Finish_group::Finish_group): Remove saw_undefined and
4421 this_blocker parameters. Change all callers.
4422 (Finish_group::set_saw_undefined): New function.
4423 (Finish_group::set_blocker): New function.
4424 * symtab.h (class Symbol_table): Change saw_undefined to return
4425 size_t. Change saw_undefined_ field to size_t.
4426 * target-select.cc (Set_target_once::do_run_once): New function.
4427 (Target_selector::Target_selector): Initialize set_target_once_
4428 field. Don't initialize lock_ and initialize_lock_ fields.
4429 (Target_selector::instantiate_target): Rewrite.
4430 (Target_selector::set_target): New function.
4431 * target-select.h (class Set_target_once): Define.
4432 (class Target_selector): Update declarations. Make
4433 Set_target_once a friend. Remove lock_ and initialize_lock_
4434 fields. Add set_target_once_ field.
4435
fa17a3f4
ILT
44362010-02-10 Ian Lance Taylor <iant@google.com>
4437
4438 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
4439 queueing any tasks.
4440 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
4441 (queue_middle_tasks): Add all blockers before queueing any tasks.
4442 (queue_final_tasks): Likewise.
4443 * token.h (Task_token::add_blockers): New function.
4444 * object.h (Input_objects::number_of_relobjs): New function.
4445
c7177d31
ILT
44462010-02-10 Ian Lance Taylor <iant@google.com>
4447
5de0e392
ILT
4448 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
4449 shared, not if not position independent.
4450 * x86_64.cc (Relocate::relocate_tls): Likewise.
4451 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
4452 (tls_pie_pic_test): New target.
4453 * testsuite/Makefile.in: Rebuild.
4454
c7177d31
ILT
4455 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
4456 (tls_test_main_pie.o, tls_test_pie.o): New targets.
4457 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
4458 * testsuite/Makefile.in: Rebuild.
4459
684b268a
DM
44602010-02-09 David S. Miller <davem@davemloft.net>
4461
4462 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
4463 R_SPARC_RELATIVE using ->add_local_relative().
4464 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
4465
612a8d3d
DM
4466 * output.h (Output_data_dynamic::add_section_size): New method
4467 that takes two Output_data objects.
4468 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
4469 entry param. Handle it in initializers.
4470 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
4471 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
4472 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
4473 arg.
4474 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
4475 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
4476 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
4477 for dynrel_includes_plt.
4478 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4479 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4480 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
4481 before .rela.plt
4482 (Target_sparc::do_finalize_sections): Update to pass true for
4483 dynrel_includes_plt.
4484 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
4485 output before .rela.plt
4486 (Target_powerpc::do_finalize_sections): Update to pass true for
4487 dynrel_includes_plt when 32-bit.
4488
cb1be87e
DK
44892010-02-08 Doug Kwan <dougkwan@google.com>
4490
4491 * arm.cc (Arm_relobj::simple_input_section_output_address): New
4492 method.
4493 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
4494 Arm_relobj::scan_section_for_cortex_a8_stubs,
4495 Arm_relobj::do_relocation_section): Instead of calling
4496 Output_section::output_address, use faster
4497 Arm_relobj::simple_input_section_output_address.
4498
705b5121
DM
44992010-02-08 David S. Miller <davem@davemloft.net>
4500
4501 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
4502 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
4503 relocation helper function.
4504
024c4466
DM
4505 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
4506 just like R_SPARC_GOT{10,13,22}.
4507 (Target_sparc::Scan::local): Likewise.
4508 (Target_sparc::Relocate:relocate): Likewise.
4509
9109c078
ILT
45102010-02-06 Ian Lance Taylor <iant@google.com>
4511
4512 * configure.ac: Rewrite targetobjs duplicate removal code to use
4513 only shell constructs.
4514 * configure: Rebuild.
4515
cf846138
DK
45162010-02-05 Doug Kwan <dougkwan@google.com>
4517
4518 PR 11247
4519 * arm.cc (Arm_relobj::section_is_scannable): New method.
4520 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
4521 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
4522
6cfaf60b
DK
45232010-02-04 Doug Kwan <dougkwan@google.com>
4524
4525 PR 11247
4526 * arm-reloc-property.cc (cstdio): Include.
4527 * configure.ac (targetobjs): Remove duplicates.
4528 * configure: Regenerate.
4529 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
4530 big and little endian version for a given address size.
4531
5c57f1be
DK
45322010-02-03 Doug Kwan <dougkwan@google.com>
4533
4534 * arm-reloc-property.cc
4535 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4536 definition.
4537 * arm-reloc-property.h
4538 (Arm_reloc_property_table::get_implemented_static_reloc_property):
4539 New method definition.
4540 (Arm_reloc_property_table::reloc_name_in_error_message): New method
4541 declaration.
4542 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
4543 overflow to N.
4544 (GOT_PREL): Change implemented to Y.
4545 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
4546 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
4547 (Arm_relocate_functions::movw_abs_nc): Remove method.
4548 (Arm_relocate_functions::movt_abs): Ditto.
4549 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
4550 (Arm_relocate_functions::thm_movt_abs): Ditto.
4551 (Arm_relocate_functions::movw_rel_nc): Ditto.
4552 (Arm_relocate_functions::movw_rel): Ditto.
4553 (Arm_relocate_functions::movt_rel): Ditto.
4554 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
4555 (Arm_relocate_functions:thm_movw_rel): Ditto.
4556 (Arm_relocate_functions:thm_movt_rel): Ditto.
4557 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
4558 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
4559 New method definitions.
4560 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
4561 (Arm_relocation_functions::arm_grp_ldr): Ditto.
4562 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
4563 (Arm_relocation_functions::arm_grp_ldc): Ditto.
4564 (Target_arm::Relocate::relocate): Check for non-static or
4565 unimplemented relocation code and exit early. Change calls to
4566 Target_arm::reloc_uses_thumb_bit and
4567 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
4568 instead. Refactor code to handle similar relocations to increase
4569 code sharing. Remove check for unsupported relocation code in switch
4570 statement.
4571 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
4572 relocation property table to find out size. Change error message to
4573 print out the name of a relocation code instead of the numeric value.
4574 (Target_arm::scan_reloc_for_stub): Use relocation property table
4575 instead of calling Target_arm::reloc_uses_thumb_bit().
4576
218c5831
DK
45772010-02-02 Doug Kwan <dougkwan@google.com>
4578
4579 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
4580 types of relaxed input section.
4581
0d31c79d
DK
45822010-02-02 Doug Kwan <dougkwan@google.com>
4583
4584 * Makefile.am (HFILES): Add arm-reloc-property.h.
4585 (DEFFILES): New.
4586 (TARGETSOURCES): Add arm-reloc-property.cc
4587 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
4588 (libgold_a_SOURCES): $(DEFFILES)
4589 * Makefile.in: Regenerate.
4590 * arm-reloc-property.cc: New file.
4591 * arm-reloc-property.h: New file.
4592 * arm-reloc.def: New file.
4593 * arm.cc: Update comments.
4594 (arm-reloc-property.h): New included header.
4595 (arm_reloc_property_table): New global variable.
4596 (Target_arm::do_select_as_default_target): New method definition.
4597 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
4598 arm-reloc-property to targ_extra_obj.
4599 * parameters.cc (set_parameters_target): Call
4600 Target::select_as_default_target().
4601 * target.h (Target::select_as_default_target): New method definition.
4602 (Target::do_select_as_default_target): Same.
4603
546c7457
DK
46042010-02-01 Doug Kwan <dougkwan@google.com>
4605
4606 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
4607 first_output_text_section_.
4608 (Arm_exidx_fixup::first_output_text_section): New method definition.
4609 (Arm_exidx_fixup::first_output_text_section_): New data member.
4610 (Arm_exidx_fixup::process_exidx_section): Record the first text
4611 output section seen.
4612 (Arm_output_section::fix_exidx_coverage): Set correct linked section
4613 and entsize in output section header.
4614
11b861d5
DK
46152010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4616
4617 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
4618 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
4619 (Arm_relocate_functions::thm_alu11): New Method.
4620 (Arm_relocate_functions::thm_pc8): New Method.
4621 (Arm_relocate_functions::thm_pc12): New Method.
4622 (Target_arm::Scan::local): Handle the relocations.
4623 (Target_arm::Scan::global): Likewise.
4624 (Target_arm::Relocate::relocate): Likewise.
4625 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
4626
c9a2c125
DK
46272010-01-29 Doug Kwan <dougkwan@google.com>
4628
4629 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
4630 of relocation types as ld.
4631
1521477a
DK
46322010-01-29 Doug Kwan <dougkwan@google.com>
4633
4634 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
4635 to public.
4636 (Arm_relocate_functions::thumb_branch_common): Ditto.
4637 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
4638 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
4639 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
4640 Arm_relocate_functions::jump24): Remove.
4641 (Target_arm::Relocate::relocate): Adjust code to call
4642 Arm_relocation_functions::arm_branch_common and
4643 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 4644 wrappers. Merge switch-cases together to reduce source code size.
1521477a 4645
e7eca48c
DK
46462010-01-29 Doug Kwan <dougkwan@google.com>
4647
4648 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
4649 output_local_symbol_count_needs_update_.
4650 (Arm_relobj::output_local_symbol_count_needs_update,
4651 Arm_relobj::set_output_local_symbol_count_needs_update,
4652 Arm_relobj::update_output_local_symbol_count): New methods.
4653 (Arm_relobj::output_local_symbol_count_needs_update_): New data
4654 member.
4655 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
4656 of pointed function as in a R_ARM_PREL31 relocation.
4657 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
4658 for output local symbol count updating.
4659 (Target_arm::do_relax): Update output local symbol counts in objects
4660 if necessary.
4661 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
4662
02961d7e
ILT
46632010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4664
4665 * arm.cc: Added support for the ARM relocations:
4666 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
4667 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
4668 (Arm_relocate_functions::movw_rel_nc): Renamed (was
4669 movw_prel_nc).
4670 (Arm_relocate_functions::movw_rel): New method.
4671 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
4672 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
4673 thm_movw_prel_nc).
4674 (Arm_relocate_functions::thm_movw_rel): New method.
4675 (Arm_relocate_functions::thm_movt_rel): Renamed (was
4676 thm_movt_prel).
4677 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
4678 relocations.
4679 (Target_arm::Scan::global): Likewise.
4680 (Target_arm::Relocate::relocate): Likewise.
4681 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4682 Likewise.
4683
b10d2873
ILT
46842010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4685
4686 * arm.cc: Added support for ARM group relocations.
4687 (Target_arm::reloc_needs_sym_origin): New method.
4688 (Arm_relocate_functions::calc_grp_kn): New method.
4689 (Arm_relocate_functions::calc_grp_residual): New method.
4690 (Arm_relocate_functions::calc_grp_gn): New method.
4691 (Arm_relocate_functions::arm_grp_alu): New Method.
4692 (Arm_relocate_functions::arm_grp_ldr): New Method.
4693 (Arm_relocate_functions::arm_grp_ldrs): New Method.
4694 (Arm_relocate_functions::arm_grp_ldc): New Method.
4695 (Target_arm::Scan::local): Handle the ARM group relocations.
4696 (Target_arm::Scan::global): Likewise.
4697 (Target_arm::Relocate::relocate): Likewise.
4698 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4699 Likewise.
4700
2b328d4e
DK
47012010-01-26 Doug Kwan <dougkwan@google.com>
4702
4703 * arm.cc (set): Include.
4704 (class Arm_exidx_fixup): Change type of last_input_section_ to const
4705 pointer type.
4706 (Arm_output_section::Text_section_list): New type.
4707 (Arm_output_section::append_text_sections_to_list): New method.
4708 (Arm_output_section::fix_exidx_coverage): Ditto.
4709 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
4710 (Arm_relobj::convert_input_section_to_relaxed_section): Use
4711 Relobj::set_section_offset() instead of
4712 Sized_relobj::invalidate_section_offset().
4713 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
4714 parameter for section headers. Ignore relocation sections for
4715 unallocated sections and EXIDX sections.
4716 (Target_arm::fix_exidx_coverage): New method.
4717 (Target_arm::output_section_address_less_than): New type.
4718 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
4719 linked text section instead of the EXIDX section.
4720 (Arm_output_section::create_stub_group): Add an assertion to check
4721 that this is not an EXIDX output section.
4722 (Arm_output_section::append_text_sections_to_list): New method.
4723 (Arm_output_section::fix_exidx_coverage): Ditto.
4724 (Arm_relobj::scan_sections_for_stubs): Adjust call to
4725 Arm_relobj::section_needs_reloc_stub_scanning.
4726 (Target_arm::do_relax): Fix EXIDX output section coverage in the
4727 first pass.
4728 (Target_arm::fix_exidx_coverage): New method.
4729 * object.h (Relobj::set_output_section): New method.
4730 (Sized_relobj::invalidate_section_offset): Remove method.
4731 (Sized_relobj::do_invalidate_section_offset): Remove method.
4732 (Sized_relobj::do_set_section_offset): Handle offset value -1.
4733
c7f3c371
DK
47342010-01-25 Doug Kwan <dougkwan@google.com>
4735
4736 * arm.cc (Arm_exidx_merged_section::do_output_offset):
4737 Fix warning due to signed and unsigned comparison on a 32-bit host.
4738
8923b24c
DK
47392010-01-22 Doug Kwan <dougkwan@google.com>
4740
4741 * arm.cc (Target_arm::do_relax): Record an output section for section
4742 offset adjustment it contains any stub table that has changed.
4743 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
4744 offsets in an output section if necessary.
4745 * output.cc (Output_section::Output_section): Initialize
4746 section_offsets_need_adjustments_.
4747 (Output_section::add_input_section_for_script): Renamed to
4748 Output_section::add_simple_input_section.
4749 (Output_section::save_states): Add a comment.
4750 (Output_section::discard_states): New method defintion.
4751 (Output_section::adjust_section_offsets): Same.
4752 * output.h (Output_section::add_input_section_for_script): Renamed to
4753 Output_section::add_simple_input_section.
4754 (Output_section::discard_states): New method declaration.
4755 (Output_section::adjust_section_offsets): Same.
4756 (Output_section::section_offsets_need_adjustment,
4757 Output_section::set_section_offsets_need_adjustment): New method
4758 definitions.
4759 (Output_section::section_offsets_need_adjustment_): New data member.
4760 * script-sections.cc
4761 (Output_section_element_input::set_section_address): Adjust code for
4762 renaming of Output_section::add_input_section_for_script.
4763 (Orphan_output_section::set_section_address): Same.
4764
9b2fd367
DK
47652010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4766
4767 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
4768 Fix_v4bx enum values .
4769 * gold/options.h (General_options): New option definitions.
4770 (General_options::fix_v4bx): New method.
4771 (General_options::Fix_v4bx): New enum.
4772 * gold/options.cc (General_options::parse_fix_v4bx): New method.
4773 (General_options::parse_fix_v4bx_interworking): New method.
4774
80d0d023
DK
47752010-01-22 Doug Kwan <dougkwan@google.com>
4776
4777 * arm.cc (Arm_exidx_fixup): New class.
4778
af2cdeae
DK
47792010-01-21 Doug Kwan <dougkwan@google.com>
4780
4781 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
4782 classes.
4783 (Arm_exidx_section_offset_map): New type.
4784
993d07c1
DK
47852010-01-21 Doug Kwan <dougkwan@google.com>
4786
4787 * arm.cc (Arm_exidx_input_section): New class.
4788 (Arm_relobj::exidx_input_section_by_link,
4789 Arm_relobj::exidx_input_section_by_shndx,
4790 Arm_relobj::make_exidx_input_section): New methods.
4791 (read_arm_attributes_section): Remove.
4792 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
4793 information about them.
4794 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
4795 to here.
4796
5ac169d4
DK
47972010-01-20 Doug Kwan <dougkwan@google.com>
4798
4799 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
4800 Input_section_specifier to Section_id.
4801 (Target_arm::new_arm_input_section: Adjust code for change of key
4802 type.
4803 (Target_arm::find_arm_input_section): Ditto.
4804 * gc.h (object.h): Include for Section_id nand Section_id_hash.
4805 (Section_id): Remove.
4806 (Garbage_collection::Section_id_hash): Remove.
4807 * icf.h (object.h): Include for Section_id nand Section_id_hash.
4808 (Section_id): Remove.
4809 (Icf::Section_id_hash): Remove.
4810 * object.h (Section_id, Const_section_id, Section_id_hash,
4811 Const_section_id_hash): New type definitions.
4812 * output.cc (Output_section::add_relaxed_input_section): Change to
4813 use Const_section_id instead of Input_section_specifier as key type.
4814 (Output_section::add_merge_input_section): Ditto.
4815 (Output_section::build_relaxation_map): Change to use Section_id
4816 instead of Input_section_specifier as key type.
4817 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
4818 Ditto.
4819 (Output_section::convert_input_sections_to_relaxed_sections): Change
4820 to use Const_section_id instead of Input_section_specifier as key type.
4821 (Output_section::find_merge_section): Ditto.
4822 (Output_section::find_relaxed_input_section): Ditto.
4823 * output.h (Input_section_specifier): Remove class.
4824 (Output_section::Output_section_data_by_input_section_map): Change
4825 key type to Const_section_id.
4826 (Output_section::Output_relaxed_input_section_by_input_section_map):
4827 Ditto.
4828 (Output_section::Relaxation_map): Change key type to Section_id.
4829
a2162063
ILT
48302010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4831
4832 * gold/arm.cc: Added support for R_ARM_V4BX relocation
4833 (class Arm_v4bx_stub): New class.
4834 (DEF_STUBS): Updated definition to support v4_veneer_bx.
4835 (Stub_factory::make_arm_v4bx_stub): New method.
4836 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
4837 (Stub_table::empty): Handle v4bx stubs.
4838 (Stub_table::add_arm_v4bx_stub): New method.
4839 (Stub_table::find_arm_v4bx_stub): New method.
4840 (Arm_relocate_functions::v4bx): New method.
4841 (Target_arm::fix_v4bx): New method.
4842 (Target_arm::Target_arm): Handle R_ARM_V4BX.
4843 (Stub_table::relocate_stubs): Likewise.
4844 (Stub_table::do_write): Likewise.
4845 (Stub_table::update_data_size_and_addralign): Likewise.
4846 (Stub_table::finalize_stubs): Likewise.
4847 (Target_arm::Scan::local): Likewise.
4848 (Target_arm::Scan::global): Likewise.
4849 (Target_arm::do_finalize_sections): Likewise.
4850 (Target_arm::Relocate::relocate): Likewise.
4851 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4852 Likewise.
4853 (Target_arm::scan_reloc_for_stub): Likewise.
4854 (Target_arm::scan_reloc_section_for_stubs): Likewise.
4855
5696ab0b
ILT
48562010-01-19 Ian Lance Taylor <iant@google.com>
4857
4858 * output.cc (Output_section_headers::do_sized_write): Write large
4859 segment count to sh_info field.
4860 (Output_file_header::do_sized_write): For large segment count,
4861 write PN_XNUM to e_phnum field.
4862
800d0f56
ILT
48632010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
4864
4865 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
4866 (Arm_relocate_functions::thm_jump8): New function.
4867 (Arm_relocate_functions::thm_jump11): New function.
4868 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
4869 R_ARM_THM_JUMP11.
4870 (Target_arm::Scan::global): Likewise.
4871 (Target_arm::Relocate::relocate): Likewise.
4872 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4873 Likewise.
4874
41263c05
DK
48752010-01-14 Doug Kwan <dougkwan@google.com>
4876
4877 * arm.cc (map, utility): Include headers.
4878 (Target_arm::apply_cortex_a8_workaround): New method.
4879 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
4880 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
4881 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
4882 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
4883 the --[no-]fix-cortex-a8 command line options.
4884 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
4885 (Target_arm::relocate_stub): Use addend in instruction template.
4886 * options.h (DEFINE_bool): Set the user-set flag.
4887 (General_options): Add --[no-]-fix-cortex options.
4888 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 4889 : Update fast look-up map after conversion.
41263c05 4890
459e9b03
ST
48912010-01-14 Sriraman Tallam <tmsriram@google.com>
4892
4893 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
4894 in the first pass of do_layout.
4895
b521dfe4
DK
48962010-01-13 Doug Kwan <dougkwan@google.com>
4897
4898 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4899 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
4900 apparent compiler problem of not folding static constant integral
4901 data members of elfcpp::Elf_sizes<32>.
4902
44272192
DK
49032010-01-13 Doug Kwan <dougkwan@google.com>
4904
4905 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
4906 Arm_relobj::section_needs_cortex_a8_stub_scanning,
4907 Arm_relobj::scan_section_for_cortex_a8_erratum,
4908 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
4909 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
4910 sections to scan for relocation stubs into a new method
4911 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
4912 relocation and Cortex-A8 stub scanning.
4913 (Target_arm::do_relax): Force stubs to be after stubbed sections
4914 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 4915 the beginning of a new relaxation pass. Update a comment.
44272192
DK
4916 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
4917
44b71ece
ILT
49182010-01-12 Ian Lance Taylor <iant@google.com>
4919
4920 * target-reloc.h (visibility_error): New inline function.
4921 (relocate_section): Call visibility_error.
4922 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
4923 (MOSTLYCLEANFILES): Likewise.
4924 (protected_4_pic.o, protected_3.err): New targets.
4925 * testsuite/protected_4.cc: New file.
4926
a120bc7f
DK
49272010-01-12 Doug Kwan <dougkwan@google.com>
4928
4929 * arm.cc (Cortex_a8_reloc): New class.
4930 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
4931 and cortex_a8_relocs_info_.
4932 (Target_arm::fix_cortex_a8): New method definition.
4933 (Target_arm::Cortex_a8_relocs_info): New type.
4934 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
4935 New data member declarations.
4936 (Target_arm::scan_reloc_for_stub): Record information about
4937 relocations for THUMB branches that might be exempted from the
4938 Cortex-A8 workaround.
4939 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
4940 at the beginning of a relaxation pass.
4941
20138696
DK
49422010-01-12 Doug Kwan <dougkwan@google.com>
4943
4944 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
4945 (Arm_relobj::Mapping_symbol_position,
4946 Arm_reloj::Mapping_symbol_position_less,
4947 Arm_relobj::Mapping_symbols_info): New types.
4948 (Target_arm::is_mapping_symbol_name): New method definition.
4949 (Arm_relobj::do_count_local_symbols): Save information about mapping
4950 symbols.
4951
089d69dc
DK
49522010-01-11 Doug Kwan <dougkwan@google.com>
4953
4954 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
4955 Arm_relocate_functions::thumb32_branch_upper,
4956 Arm_relocate_functions::thumb32_branch_lower,
4957 Arm_relocate_functions::thumb32_cond_branch_offset,
4958 Arm_relocate_functions::thumb32_cond_branch_upper,
4959 Arm_relocate_functions::thumb32_cond_branch_lower,
4960 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
4961 branch offset encoding.
4962 (Arm_relocate_functions::thumb_branch_common): Use new branch
4963 offset encoding methods to avoid code duplication.
4964 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
4965 (Stub_addend_reader::operator()): Use new branch encoding method
4966 to avoid code duplication.
4967
99e5bff2
DK
49682010-01-11 Doug Kwan <dougkwan@google.com>
4969
4970 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
4971 (Target_arm::do_finalize_sections): Define special EXIDX section
4972 symbols only if referenced.
4973 * gc.h (Garbage_collection::add_reference): New method.
4974 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
4975 code duplication.
4976
98e090bd
ILT
49772010-01-11 Ian Lance Taylor <iant@google.com>
4978
d0a91bd8
ILT
4979 * script.cc (Version_script_info::build_expression_list_lookup):
4980 Change complaing about duplicate wildcard match from error to
4981 warning.
4982
98e090bd
ILT
4983 * script.cc (class Lazy_demangler): Recreate--revert part of patch
4984 of 2009-12-30.
4985 (Version_script_info::Version_script_info): Initialize globs_,
4986 default_version_, default_is_global_, and exact_. Don't
4987 initialize globals_ or locals_.
4988 (Version_script_info::build_lookup_tables): Build local symbols
4989 first.
4990 (Version_script_info::unquote): New function.
4991 (Version_script_info::add_exact_match): New function.
4992 (Version_script_info::build_expression_list_lookup): Remove lookup
4993 parameter. Add is_global parameter. Change all callers. Handle
4994 wildcard pattern specially. Unquote pattern. Call
4995 add_exact_match.
4996 (Version_script_info::get_name_to_match): New function.
4997 (Version_script_info::get_symbol_version): New function.
4998 (Version_script_info::get_symbol_version_helper): Remove.
4999 (Version_script_info::check_unmatched_names): Call unquote.
5000 * script.h (class Version_script_info): Change get_symbol_version
5001 to be non-inline and add is_global parameter; change all callers.
5002 Rewrite symbol_is_local. Update declarations. Define struct
5003 Version_tree_match, Exact, Globs. Don't define struct Lookup.
5004 Remove globals_ and locals_ members. Add exact_, globs_,
5005 default_version_, is_global_.
5006 (Version_script_info::Glob): Remove pattern, add expression and
5007 is_global. Update constructor. Change all callers.
5008 * dynobj.cc (Versions::finalize): Mark the version symbol as the
5009 default version.
5010 (Versions::symbol_section_contents): If a symbol is undefined, or
5011 defined in a dynamic object, set the version index to
5012 VER_NDX_LOCAL.
5013 * symtab.cc (Symbol_table::add_from_relobj): Don't call
5014 symbol_is_local.
5015 (Symbol_table::add_from_pluginobj): Likewise.
5016 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
5017
d56962d3
DK
50182010-01-11 Doug Kwan <dougkwan@google.com>
5019
5020 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
5021 (incremental_dump_LDADD): Add linking option for libintl.
5022 * Makefile.in: Regenerate.
5023
94e6ee91
L
50242010-01-11 H.J. Lu <hongjiu.lu@intel.com>
5025
5026 PR gold/11144
5027 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
5028 instead of -Ds.
5029 * testsuite/Makefile.in: Regenerated.
5030
e96c574b
DK
50312010-01-10 Doug Kwan <dougkwan@google.com>
5032
5033 * options.h (DEFINE_var): Use parentheses around argument varname__
5034 in macro body to avoid any unintended subsequent substitutions.
5035
7198066b
ILT
50362010-01-10 Ian Lance Taylor <iant@google.com>
5037
ba4d53bf
ILT
5038 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
5039 candidates before doing symbol resolution.
5040
7198066b
ILT
5041 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
5042 ODR candidates if only one is weak.
5043
a2beed37
ILT
50442010-01-08 Ian Lance Taylor <iant@google.com>
5045
5046 * script.cc (Version_script_info::build_expression_list_lookup):
5047 Don't warn about ambiguous version, just record the ambiguity.
5048 (Version_script_info::get_symbol_version_helper): Give error if
5049 version is ambiguous.
5050
2fb7225c
DK
50512010-01-08 Doug Kwan <dougkwan@google.com>
5052
5053 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
5054 prev_data_size_ and prev_addralign_. Remove initializer for
5055 deleted data member has_been_changed_.
5056 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
5057 to determine if the table is empty.
5058 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
5059 Remove.
5060 (Stub_table::add_reloc_stub): Define method in class definition
5061 instead of just declaring it there.
5062 (Stub_table::add_cortex_a8_stub): New method definition.
5063 (Stub_table::update_data_size_and_addralign): Ditto.
5064 (Stub_table::finalize_stubs): Ditto.
5065 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
5066 (Stub_table::do_addralign_): Return address alignment in the
5067 (Stub_table::do_reset_address_and_file_offset): Define method in
5068 class definition instead of declaring it there. Set current data
5069 size to be the data size of the previous pass.
5070 (Stub_table::set_final_data_size): Use current data size as the
5071 final data size.
5072 (Stub_table::relocate_stub): Change parameter type of stub from
5073 Reloc_stub pointer to Stub pointer.
5074 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
5075 (Stub_table::Cortex_a8_stub_list): New typedef.
5076 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
5077 Stub_table::prev_addralign_): New data member.
5078 (Arm_relobj::Arm_relobj): Initialize data member
5079 section_has_cortex_a8_workaround_.
5080 (Arm_relobj::section_has_cortex_a8_workaround,
5081 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
5082 definitions.
5083 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
5084 declarations.
5085 (Target_arm::relocate_stub): Change parameter type of stub from
5086 Reloc_stub pointer to Stub pointer.
5087 (Insn_template::size, Insn_template::alignment): Handle
5088 THUMB16_SPECIAL_TYPE.
5089 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
5090 Stub_table::update_data_size_and_addralign,
5091 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
5092 definitions.
5093 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
5094 (Stub_table::do_write): Ditto.
5095 (Target_arm::do_relax): Adjust code for changes in Stub_table.
5096
880cd20d
ILT
50972010-01-08 Ian Lance Taylor <iant@google.com>
5098
5099 PR 11108
5100 * symtab.h (class Symbol): Remove fields is_target_special_ and
5101 has_plt_offset_. Add field is_defined_in_discarded_section_.
5102 (Symbol::is_defined_in_discarded_section): New function.
5103 (Symbol::set_is_defined_in_discarded_section): New function.
5104 (Symbol::has_plt_offset): Rewrite.
5105 (Symbol::set_plt_offset): Verify that new offset is not -1U.
5106 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
5107 Don't initialize is_target_special_ or has_plt_offset_.
5108 Initialize is_defined_in_discarded_section_.
5109 (Symbol_table::add_from_relobj): If appropriate, set
5110 is_defined_in_discarded_section.
5111 * resolve.cc (Symbol::override_base_with_special): Don't test
5112 is_target_special_. Change has_plt_offset_ to has_plt_offset().
5113 * target-reloc.h (relocate_section): Do special handling for
5114 symbols defined in discarded sections for global symbols as well
5115 as local symbols.
5116
2703e3eb
ILT
51172010-01-08 Ian Lance Taylor <iant@google.com>
5118
5119 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
5120 the SHT_SYMTAB case.
5121
339d40a3
ILT
51222010-01-08 Ian Lance Taylor <iant@google.com>
5123
5124 * object.cc (Sized_relobj::do_layout): Don't get confused if
5125 layout_eh_frame returns NULL.
5126
abecea76
ILT
51272010-01-08 Ian Lance Taylor <iant@google.com>
5128
5129 PR 11084
5130 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
5131 dynamic symbol table, use the normal symbol table.
5132 (Sized_dynobj::do_read_symbols): Remove assertion about type of
5133 symbol table.
5134
6b7dd3f3
ILT
51352010-01-08 Ian Lance Taylor <iant@google.com>
5136
5137 PR 11072
5138 * layout.cc (Layout::include_section): Remove .gnu_debuglink
5139 sections.
5140
36c50e63
L
51412010-01-08 H.J. Lu <hongjiu.lu@intel.com>
5142
5143 * version.cc (print_version): Change to "Copyright 2010".
5144
e291e7b9
ILT
51452010-01-08 Ian Lance Taylor <iant@google.com>
5146
5147 PR 10287
5148 PR 11063
5149 * i386.cc (class Target_i386): Change return type of plt_section
5150 to be non-const.
5151 (class Output_data_plt_i386): Add tls_desc_rel_ field.
5152 (Output_data_plt_i386::Output_data_plt_i386): Initialize
5153 tls_desc_rel_ field.
5154 (Output_data_plt_i386::rel_tls_desc): New function.
5155 (Target_i386::rel_tls_desc_section): New function.
5156 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
5157 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
5158 R_386_TLS_DESC reloc in rel_tls_desc_section.
5159 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
5160 Define struct Tlsdesc_info.
5161 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
5162 (Target_x86_64::do_reloc_symbol_index): New function.
5163 (Target_x86_64::add_tlsdesc_info): New function.
5164 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
5165 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
5166 tlsdesc_rel_ field.
5167 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
5168 all callers.
5169 (Output_data_plt_x86_64::rela_tlsdesc): New function.
5170 (Target_x86_64::rela_tlsdesc_section): New function.
5171 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
5172 handling.
5173 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
5174 (Target_x86_64::do_reloc_addend): New function.
5175 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
5176 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
5177 declarations. Define TARGET_CODE. Add arg field to u1_ union.
5178 (Output_reloc::type): New function.
5179 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
5180 (Output_reloc::is_target_specific): New function.
5181 (Output_reloc::target_arg): New function.
5182 (class Output_reloc) [SHT_RELA]: Add four new constructors for
5183 absolute relocs and target specific relocs.
5184 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
5185 add_target_specific.
5186 (class Output_data_reloc) [SHT_RELA]: Likewise.
5187 * output.cc (Output_reloc::Output_reloc): Add four new versions
5188 for absolute relocs and target specific relocs.
5189 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
5190 (Output_reloc::get_symbol_index): Likewise.
5191 (Output_reloc::local_section_offset): Check that local_sym_index_
5192 is not TARGET_CODE or 0.
5193 (Output_reloc::symbol_value): Likewise.
5194 (Output_reloc::write) [SHT_RELA]: Call target for target specific
5195 reloc.
5196 * target.h (class Target): Add reloc_symbol_index and reloc_addend
5197 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
5198 functions.
5199 * layout.cc (add_target_dynamic_tags): Use output section for
5200 DT_PLTRELSZ and DT_JMPREL.
5201
3a44184e
ILT
52022010-01-07 Ian Lance Taylor <iant@google.com>
5203
5204 PR 11061
5205 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
5206 function.
5207 (class Output_data_reloc_generic): Define.
5208 (class Output_data_reloc_base): Change base class to
5209 Output_data_reloc_generic. Change add() method to call
5210 bump_relative_reloc_count for a relative reloc. Remove
5211 sort_relocs_ field.
5212 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
5213 to sort_relocs().
5214 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
5215 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
5216 appropriate.
5217 * layout.h (class Layout): Update declaration.
5218
ea715a34
ILT
52192010-01-07 Ian Lance Taylor <iant@google.com>
5220
5221 * output.h (class Output_data): Add const version of
5222 output_section and do_output_section.
5223 (class Output_section_data): Add const version of
5224 do_output_section.
5225 (class Output_section): Likewise.
5226 * layout.cc (Layout::add_target_dynamic_tags): New function.
5227 * layout.h (class Layout): Update declarations.
5228 * arm.cc (Target_arm::do_finalize_sections): Use
5229 add_target_dynamic_tags.
5230 * i386.cc (Target_i386::do_finalize_sections): Likewise.
5231 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
5232 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
5233 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
5234
659948a4
ILT
52352010-01-07 Ian Lance Taylor <iant@google.com>
5236
5237 PR 11042
5238 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
5239 object as needed.
5240
9d3b86f6
ILT
52412010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
5242 Ian Lance Taylor <iant@google.com>
5243
5244 PR 11019
5245 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
5246 Xindex::read_symtab_xindex.
5247
bb0d3eb0
DK
52482010-01-07 Doug Kwan <dougkwan@google.com>
5249
5250 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
5251 (Insn_template::thumb16_bcond_insn): New method declaration.
5252 (Insn_template): Fix spelling.
5253 (Stub::thumb16_special): New method declaration.
5254 (Stub::do_write): Define virtual method which was previously pure
5255 virtual.
5256 (Stub::do_thumb16_special): New method declaration.
5257 (Stub::do_fixed_endian_write): New template member.
5258 (Reloc_stub::do_write): Remove.
5259 (Reloc_stub::do_fixed_endian_write): Remove.
5260 (Cortex_a8_stub): New class definition.
5261 (Stub_factory::make_cortex_a8_stub): New method definition.
5262 (Stub_factory::Stub_factory): Add missing static storage class
5263 qualifier for elf32_arm_stub_a8_veneer_blx.
5264
ffeef7df
ILT
52652010-01-07 Ian Lance Taylor <iant@google.com>
5266
dc3f80fe
ILT
5267 PR 10980
5268 * options.h (class General_options): Add --warn-unresolved-symbols
5269 and --error-unresolved-symbols.
5270 * errors.cc (Errors::undefined_symbol): Implement
5271 --warn-unresolved-symbols.
5272
ffeef7df
ILT
5273 * options.h (class General_options): Add -z text and -z textoff.
5274 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
5275
f1ec9ded
ST
52762010-01-06 Sriraman Tallam <tmsriram@google.com>
5277
5278 * gc.h (Garbage_collection::Cident_section_map): New typedef.
5279 (Garbage_collection::cident_sections): New function.
5280 (Garbage_collection::add_cident_section): New function.
5281 (Garbage_collection::cident_sections_): New member.
5282 (gc_process_relocs): Add references to sections whose names are C
5283 identifiers.
5284 * gold.h (cident_section_start_prefix): New constant.
5285 (cident_section_stop_prefix): New constant.
5286 (is_cident): New function.
5287 * layout.cc (Layout::define_section_symbols): Replace string constants
5288 with the newly defined constants.
5289 * object.cc (Sized_relobj::do_layout): Track sections whose names are
5290 C identifiers.
5291 * testsuite/Makefile.am: Add gc_orphan_section_test.
5292 * testsuite/Makefile.in: Regenerate.
5293 * testsuite/gc_orphan_section_test.cc: New file.
5294 * testsuite/gc_orphan_section_test.sh: New file.
5295
6eda8c29
ILT
52962010-01-06 Ian Lance Taylor <iant@google.com>
5297
b9674e17
ILT
5298 PR 10980
5299 * options.h (class General_options): Add --warn-shared-textrel.
5300 * layout.cc (Layout::finish_dynamic_section): Implement
5301 --warn-shared-textrel.
5302
6eda8c29
ILT
5303 PR 10980
5304 * options.h (class General_options): Add --warn-multiple-gp.
5305
32dcd44e
ILT
53062010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5307
5308 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
5309 $(THREADSLIB) and $(LIBDL).
5310 * Makefile.in: Rebuild.
5311
a192ba05
ILT
53122010-01-06 Ian Lance Taylor <iant@google.com>
5313
5314 PR 10980
5315 * options.cc (General_options::parse_section_start): New function.
5316 (General_options::section_start): New function.
5317 (General_options::General_options): Initialize all members.
5318 * options.h: Include <map>
5319 (class General_options): Add --section-start. Add section_starts_
5320 member.
5321 * layout.cc (Layout::attach_allocated_section_to_segment): If
5322 --section-start was used, set the address of the segment. Remove
5323 local sort_sections.
5324 (Layout::relaxation_loop_body): If the address of the load segment
5325 has been set by --section-start, don't use it.
5326 * output.h (Output_segment::update_flags_for_output_section): New
5327 function.
5328 * output.cc (Output_segment::add_output_section): Call
5329 update_flags_for_output_section.
5330
dde3f402
ILT
53312010-01-05 Ian Lance Taylor <iant@google.com>
5332
62dfdd4d
ILT
5333 PR 10980
5334 * options.h (class General_options): Add --undefined-version.
5335 * script.cc (struct Version_expression): Add was_matched_by_symbol
5336 field.
5337 (Version_script_info::matched_symbol): New function.
5338 (Version_script_info::get_symbol_version_helper): Call
5339 matched_symbol.
5340 (Version_script_info::check_unmatched_names): New function.
5341 * script.h (class Version_script_info): Update declarations.
5342 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
5343
9c4ae156
ILT
5344 * options.h (class General_options): Use DEFINE_bool_alias for
5345 allow_multiple_definition.
5346 * resolve.cc (Symbol_table::should_override): Don't test
5347 allow_multiple_definition.
5348
dde3f402
ILT
5349 PR 10980
5350 * options.h (class General_options): Add --cref.
5351 * main.cc (main): Print cref table if --cref. Don't close mapfile
5352 until after printing cref table.
5353 * cref.cc: Include "symtab.h".
5354 (class Cref_inputs): Define Cref_table_compare and Cref_table.
5355 (Cref_table_compare::operator()): New function.
5356 (Cref_inputs::gather_cref): New function.
5357 (filecol): New static const.
5358 (Cref_inputs::print_cref): New function.
5359 (Cref::print_cref): New function.
5360 * cref.h: Include <cstdio>.
5361 (class Cref): Update declarations.
5362 * mapfile.h (Mapfile::file): New function.
5363 * object.h (class Object): Define Symbols. Declare virtual
5364 do_get_global_symbols.
5365 (Object::get_global_symbols): New function.
5366 * object.cc (Input_objects::add_object): Pass object to cref_ if
5367 --cref.
5368 (Input_objects::archive_start): Likewise.
5369 (Input_objects::archive_stop): Likewise.
5370 (Input_objects::print_cref): New function.
5371 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
5372 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
5373 --cref.
5374 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
5375 function.
5376 * plugin.h (class Sized_pluginobj): Update declarations.
5377
8781f709
ILT
53782010-01-05 Ian Lance Taylor <iant@google.com>
5379
5380 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
5381 to is_default_version. Rename insdef to insdefault.
5382 (Symbol_table::add_from_relobj): Rename def to is_default_version
5383 and local to is_forced_local.
5384 (Symbol_table::add_from_pluginobj): Likewise.
5385 (Symbol_table::add_from_dynobj): Likewise.
5386 (Symbol_table::define_special_symbol): Rename insdef to
5387 insdefault.
5388
fe35d28d
ILT
53892010-01-04 Ian Lance Taylor <iant@google.com>
5390
30bc8c46
ILT
5391 PR 10980
5392 * options.h (class General_options): Add
5393 --allow-multiple-definition and -z muldefs.
5394 * resolve.cc (Symbol_table::should_override): Don't warn about a
5395 multiple symbol definition if --allow-multiple-definition or -z
5396 muldefs.
5397
7eaea549
ILT
5398 PR 10980
5399 * options.h (class General_options): Add --add-needed and
5400 --copy-dt-needed-entries. Tweak --as-needed help entry.
5401 * object.cc (Input_objects::check_dynamic_dependencies): Give an
5402 error if --copy-dt-needed-entries aka --add-needed is used and
5403 would cause a change in behaviour.
5404
fe35d28d
ILT
5405 PR 10980
5406 * options.h (class General_options): Add -G as a short version of
5407 --shared. Add no-op options -assert, -g, and -i.
5408
55a2bb35
ST
54092010-01-04 Sriraman Tallam <tmsriram@google.com>
5410
5411 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
5412 check for .text or .gnu.linkonce.t sections.
5413 * icf.cc (Icf::find_identical_sections): Ditto.
5414 Change the detection for mangled function name within the section
5415 name.
5416 * icf.h (is_section_foldable_candidate): New function.
5417
719328e1
ILT
54182009-12-30 Ian Lance Taylor <iant@google.com>
5419
5420 PR 10980
5421 * options.h (class General_options): Permit two dashes with
5422 --retain-symbols-file.
5423
d7bb5745
ILT
54242009-12-30 Ian Lance Taylor <iant@google.com>
5425
403a15dd
ILT
5426 PR 10979
5427 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
5428 don't put the file header and segment headers in the text
5429 segment.
5430
eda294df
ILT
5431 PR 10979
5432 * common.cc (Sort_commons::operator()): Stabilize sort when both
5433 entries are NULL.
5434 (Symbol_table::do_allocate_commons_list): When allocating common
5435 symbols, skip a symbol which is no longer common.
5436 * symtab.h (Symbol::is_common): Test whether the symbol comes from
5437 an object before checking its type.
5438 * testsuite/common_test_2.c: New file.
5439 * testsuite/common_test_3.c: New file.
5440 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
5441 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
5442 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
5443 (common_test_2_pic.o, common_test_2.so): New targets.
5444 (common_test_3_pic.o, common_test_3.so): New targets.
5445 * testsuite/Makefile.in: Rebuild.
5446
d7bb5745
ILT
5447 PR 10979
5448 * script.cc (read_input_script): If we see a new SECTIONS clause,
5449 and we have added an input section, give an error.
5450 * layout.h (class Layout): Add have_added_input_section function.
5451 Add have_added_input_section_ field.
5452 * layout.cc (Layout::Layout): Initialize
5453 have_added_input_section_.
5454 (Layout::layout): Set have_added_input_section_.
5455 (Layout::layout_eh_frame): Likewise.
5456
fc59c572
ILT
54572009-12-30 Ian Lance Taylor <iant@google.com>
5458
5459 PR 10931
5460 * options.h (class General_options): Add --sort-common option.
5461 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
5462 * common.cc (Sort_common): Add sort_order parameter to
5463 constructor. Add sort_order_ field.
5464 (Sort_commons::operator): Check sort_order_.
5465 (Symbol_table::allocate_commons): Determine the sort order.
5466 (Symbol_table::do_allocate_commons): Add sort_order parameter.
5467 Change all callers.
5468 (Symbol_table::do_allocate_commons_list): Likewise.
5469
1c74fab0
ILT
54702009-12-30 Ian Lance Taylor <iant@google.com>
5471
5472 PR 10916
5473 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
5474 symbols from this object, don't change the visibility of an
5475 undefined symbol.
5476 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
5477
6affe781
ILT
54782009-12-30 Ian Lance Taylor <iant@google.com>
5479
5480 PR 10861
5481 * script.h (class Version_script_info): Define Language enum.
5482 Update declarations. Define Glob, Exact, and Lookup types. Add
5483 new fields globals_, locals_, and is_finalized_.
5484 * script.cc: Various formatting fixes.
5485 (class Parser_closure): Change language_stack_ from a vector of
5486 std::string to one of Version_script_info::Language. Adjust all
5487 uses accordingly.
5488 (class Lazy_demangler): Remove.
5489 (struct Version_expression): Change language from std::string to
5490 Version_script_info::Language.
5491 (Version_script_info::Version_script_info): New function.
5492 (Version_script_info::~Version_script_info): Don't call clear.
5493 (Version_script_info::finalize): New function.
5494 (Version_script_info::build_lookup_tables): New function.
5495 (Version_script_info::build_expression_list_lookup): New
5496 function.
5497 (Version_script_info::get_symbol_version_helper): Rewrite to use
5498 lookup tables.
5499 (Version_script_info::print_expression_list): Adjust to use
5500 Version_script_info::Language.
5501 (script_push_lex_into_version_mode): Check that the version script
5502 has not been finalized.
5503 (version_script_push_lang): Change language string to
5504 Version_script_info::Language.
5505 * options.cc (Command_line::version_script): New function.
5506 * options.h (class General_options): Add finalize_dynamic_list
5507 function. Change version_script from declaration to definition.
5508 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
5509 * testsuite/version_script.map: Remove duplicate def of foo.
5510 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
5511 version_script.map.
5512 * testsuite/Makefile.in: Rebuild.
5513
818bf354
ILT
55142009-12-30 Ian Lance Taylor <iant@google.com>
5515
5516 PR 10843
5517 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
5518 if the input symbol index is 0, make the output symbol index 0.
5519
ebcc8304
ILT
55202009-12-30 Ian Lance Taylor <iant@google.com>
5521
5522 PR 10670
5523 * options.h (class General_options): Add -x/--discard-all.
5524 * object.cc (Sized_relobj::do_count_local_symbols): Handle
5525 --discard-all. If the local symbol needs a dynamic entry, check
5526 that before handling --discard-locals.
5527
176fe33f
ILT
55282009-12-30 Ian Lance Taylor <iant@google.com>
5529
bb321bb1
ILT
5530 PR 10450
5531 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
5532 flags to PF_R.
5533 (Output_segment::add_output_section): Don't change the flags if
5534 the type is PT_TLS.
5535
176fe33f
ILT
5536 PR 10450
5537 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
5538 GNU hash table if they need a dynamic value. Otherwise, don't add
5539 them if they are defined in a dynamic object or are forced local.
5540
e8cd95c7
ILT
55412009-12-29 Ian Lance Taylor <iant@google.com>
5542
1b81fb71
ILT
5543 PR 10450
5544 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
5545 .gnu.hash table for a 32-bit target.
5546
8d6d383d
ILT
5547 PR 10450
5548 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
5549 regular and a dynamic object only needs a dynamic symbol table
5550 entry if it is externally visible.
5551
e785ec03
ILT
5552 PR 10450
5553 * i386.cc (class Target_i386): Initialize global_offset_table_ in
5554 constructor. Add global_offset_table_ field.
5555 (Target_i386::got_section): Set global_offset_table_.
5556 (Target_i386::do_finalize_sections): Set global_offset_table_
5557 size.
5558 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
5559 in constructor. Add global_offset_table_ field.
5560 (Target_x86_64::got_section): Set global_offset_table_.
5561 (Target_x86_64::do_finalize_sections): Set global_offset_table_
5562 size.
5563
1a2dff53
ILT
5564 * layout.cc (Layout::Layout): Initialize increase_relro_.
5565 (Layout::get_output_section): Add is_relro, is_last_relro, and
5566 is_first_non_relro parameters. Change all callers.
5567 (Layout::choose_output_section): Likewise.
5568 (Layout::add_output_section_data): Likewise.
5569 (Layout::make_output_section): Likewise.
5570 (Layout::set_segment_offsets): Clear increase_relro when using a
5571 linker script.
5572 * layout.h (class Layout): Add increase_relro method. Add
5573 increase_relro_ field. Update declarations.
5574 * output.cc (Output_section::Output_section): Initialize
5575 is_last_relro_ and is_first_non_relro_.
5576 (Output_segment::add_output_section): Group relro sections is
5577 do_sort is true. Handle is_last_relro and is_first_non_relro.
5578 (Output_segment::maximum_alignment): Remove relro handling.
5579 (Output_segment::set_section_addresses): Add increase_relro
5580 parameter. Change all callers. Add initial alignment to align
5581 relro sections on separate page. Remove old relro handling.
5582 (Output_segment::set_section_list_addresses): Remove in_relro
5583 parameter. Change all callers.
5584 (Output_segment::set_offset): Add increase parameter. Change all
5585 callers. Remove old relro handling.
5586 * output.h (class Output_section): Add new methods: is_last_relro,
5587 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
5588 Add is_last_relro_ and is_first_non_relro_ fields.
5589 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
5590 Create separate .got.plt section. Call increase_relro.
5591 * x86_64.cc (Target_x86_64::got_section): Likewise.
5592 * testsuite/relro_script_test.t: Add .got.plt.
5593
f0ba79e2
ILT
5594 PR 10450
5595 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
5596 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
5597 (Layout::finalize): Call set_dynamic_symbol_size.
5598 (Layout::set_dynamic_symbol_size): New function.
5599 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
5600 set_dynamic_symbol_size.
5601
e8cd95c7
ILT
5602 PR 10450
5603 * output.h (class Output_section): Add is_entsize_zero_ field.
5604 * output.cc (Output_section::Output_section): Initialize
5605 is_entsize_zero_.
5606 (Output_section::set_entsize): If two different entsizes are
5607 requested, force it to zero.
5608 (Output_section::add_input_section): Set flags for .debug_str
5609 before updating section flags. Set entsize.
5610 (Output_section::update_flags_for_input_section): Set SHF_MERGE
5611 and SHF_STRING if all input sections have those flags.
5612
3e1b9a8a
RÁE
56132009-12-29 Rafael Espindola <espindola@google.com>
5614
5615 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
5616 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
5617 reporting.
3e1b9a8a 5618
3dcad376
ST
56192009-12-29 Sriraman Tallam <tmsriram@google.com>
5620
5621 * options.cc (General_options::parse_version): Allow -v to exit
5622 without an error if there is nothing to link.
5623
084e2665
ILT
56242009-12-29 Ian Lance Taylor <iant@google.com>
5625
5626 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
5627 using a version of gcc before 4.1.
5628 * configure: Rebuild.
5629
250acde3
CD
56302009-12-28 Chris Demetriou <cgd@google.com>
5631
5632 * attributes.cc (Output_attributes_section_data::do_write): Use
5633 std::vector::front rather than std::vector::data.
5634
99fff23b
ILT
56352009-12-28 Ian Lance Taylor <iant@google.com>
5636
5637 * symtab.h (class Symbol_table): Add enum Defined.
5638 * resolve.cc (Symbol_table::should_override): Add defined
5639 parameter. Change all callers. Test whether object is NULL
5640 before calling a method on it.
5641 (Symbol_table::report_resolve_problem): Add defined parameter.
5642 Change all callers.
5643 (Symbol_table::should_override_with_special): Likewise.
5644 * symtab.cc (Symbol_table::define_in_output_data): Add defined
5645 parameter. Change all callers.
5646 (Symbol_table::do_define_in_output_data): Likewise.
5647 (Symbol_table::define_in_output_segment): Likewise.
5648 (Symbol_table::do_define_in_output_segment): Likewise.
5649 (Symbol_table::define_as_constant): Likewise.
5650 (Symbol_table::do_define_as_constant): Likewise.
5651 * script.h (class Symbol_assignment): Add is_defsym parameter to
5652 constructor; change all callers.
5653 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
5654 parameter. Change all callers. Add is_defsym_ field.
5655 (class Parser_closure): Add parsing_defsym parameter to
5656 constructor; change all callers. Add parsing_defsym accessor
5657 function. Add parsing_defsym_ field.
5658
556bd683
ILT
56592009-12-28 Ian Lance Taylor <iant@google.com>
5660
5661 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 5662 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 5663
1782c879
ILT
56642009-12-23 Ian Lance Taylor <iant@google.com>
5665
5666 * i386.cc (Target_i386::do_calls_non_split): Recognize
5667 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
5668 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
5669 -fsplit-stack prologue when using %r11.
1782c879 5670
329ca2b1
ST
56712009-12-21 Sriraman Tallam <tmsriram@google.com>
5672
5673 * options.cc (General_options::parse_version): Make -v continue and do
5674 the link like GNU ld does.
5675
d675ff46
RÁE
56762009-12-17 Rafael Avila de Espindola <espindola@google.com>
5677
5678 * Makefile.am (CCFILES): Add timer.cc.
5679 (HFILES): Add timer.h.
5680 * configure.ac: Check for sysconf and times.
5681 * main.cc: include timer.h.
5682 (main): Use Timer instead of get_run_time.
5683 * timer.cc: New.
5684 * timer.h: New.
5685 * workqueue.cc: include timer.h.
5686 (Workqueue::find_and_run_task):
5687 Report user, sys and wall time.
5688 * Makefile.in: Regenerate.
5689 * config.in: Regenerate.
5690 * configure: Regenerate.
5691
d6344fb5
DK
56922009-12-16 Doug Kwan <dougkwan@google.com>
5693
5694 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
5695 sections.
5696 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
5697 relaxed input sections.
5698 * output.cc (Output_section::find_relaxed_input_section): Change
5699 return type to Output_relaxed_input_section pointer. Adjust code
5700 for new type of relaxed_input_section_map_.
5701 * output.h (Output_section::find_relaxed_input_section): Change
5702 return type to Output_relaxed_input_section pointer.
5703 (Output_section::Output_relaxed_input_section_by_input_section_map):
5704 New type.
5705 (Output_section::relaxed_input_section_map_): Change type to
5706 Output_section::Output_relaxed_input_section_by_input_section_map.
5707 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
5708 input section.
5709
0e0d5469
ILT
57102009-12-15 Ian Lance Taylor <iant@google.com>
5711
5712 * layout.cc (Layout::create_shstrtab): Only write out after input
5713 sections if we are compressing debug sections.
5714
0649a889
ILT
57152009-12-15 Ian Lance Taylor <iant@google.com>
5716
5717 * archive.cc (Archive::add_symbols): Only look up a symbol without
5718 a version if there is, in fact, a version.
5719
2ea97941
ILT
57202009-12-14 Ian Lance Taylor <iant@google.com>
5721
5722 Revert -Wshadow changes, all changes from:
5723 2009-12-11 Doug Kwan <dougkwan@google.com>
5724 2009-12-11 Nick Clifton <nickc@redhat.com>
5725 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
5726
b0eec2cc
DK
57272009-12-11 Doug Kwan <dougkwan@google.com>
5728
5729 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
5730 due to -Wshadow.
5731 * attributes.cc (Object_attribute::size): Ditto.
5732 (Attributes_section_data::size): Ditto.
5733 (Attributes_section_data::Attributes_section_data): Ditto.
5734 (Output_attributes_section_data::do_write): Ditto.
5735 * attributes.h (Object_attribute::set_type): Ditto.
5736 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
5737
91d6fa6a
NC
57382009-12-11 Nick Clifton <nickc@redhat.com>
5739
5740 * archive.cc: Fix shadowed variable warnings.
5741 * arm.cc: Likewise.
5742 * compressed_output.cc: Likewise.
5743 * compressed_output.h: Likewise.
5744 * configure: Likewise.
5745 * dwarf_reader.cc: Likewise.
5746 * dynobj.cc: Likewise.
5747 * dynobj.h: Likewise.
5748 * ehframe.cc: Likewise.
5749 * ehframe.h: Likewise.
5750 * errors.cc: Likewise.
5751 * expression.cc: Likewise.
5752 * fileread.cc: Likewise.
5753 * fileread.h: Likewise.
5754 * freebsd.h: Likewise.
5755 * i386.cc: Likewise.
5756 * icf.cc: Likewise.
5757 * incremental.h: Likewise.
5758 * layout.cc: Likewise.
5759 * layout.h: Likewise.
5760 * mapfile.cc: Likewise.
5761 * merge.cc: Likewise.
5762 * merge.h: Likewise.
5763 * object.cc: Likewise.
5764 * object.h: Likewise.
5765 * options.h: Likewise.
5766 * output.cc: Likewise.
5767 * output.h: Likewise.
5768 * parameters.cc: Likewise.
5769 * plugin.cc: Likewise.
5770 * powerpc.cc: Likewise.
5771 * reduced_debug_output.cc: Likewise.
5772 * reduced_debug_output.h: Likewise.
5773 * reloc.cc: Likewise.
5774 * reloc.h: Likewise.
5775 * resolve.cc: Likewise.
5776 * script-sections.cc: Likewise.
5777 * script.cc: Likewise.
5778 * script.h: Likewise.
5779 * sparc.cc: Likewise.
5780 * symtab.cc: Likewise.
5781 * symtab.h: Likewise.
5782 * target-select.cc: Likewise.
5783 * target-select.h: Likewise.
5784 * token.h: Likewise.
5785 * workqueue.cc: Likewise.
5786 * workqueue.h: Likewise.
5787 * x86_64.cc: Likewise.
5788
a0351a69
DK
57892009-12-10 Doug Kwan <dougkwan@google.com>
5790
5791 * arm.cc (attributes.h): New include.
5792 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
5793 (Arm_relobj::~Arm_relobj): Delete object pointed by
5794 attributes_section_data_.
5795 (Arm_relobj::attributes_section_data): New method definition.
5796 (Arm_relobj::attributes_section_data_): New data member declaration.
5797 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
5798 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
5799 attributes_section_data_.
5800 (Arm_dynobj::attributes_section_data): New method definition.
5801 (Arm_dynobj::attributes_section_data_): New data member declaration.
5802 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
5803 initialization value of may_use_blx_ to false.
5804 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
5805 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
5806 object attributes to compute results instead of hard-coding.
5807 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
5808 Target_arm::get_secondary_compatible_arch,
5809 Target_arm::set_secondary_compatible_arch
5810 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5811 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
5812 New method declarations.
5813 (Target_arm::get_aeabi_object_attribute): New method definition.
5814 (Target_arm::attributes_section_data_): New data member declaration.
5815 (read_arm_attributes_section): New template definition.
5816 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
5817 (Arm_dynobj::do_read_symbols): Ditto.
5818 (Target_arm::do_finalize_sections): Merge attributes sections from
5819 input. Check for BLX use after attributes section merging.
5820 Fix __exidx_start and __exidx_end visibility. Create an
5821 .ARM.attributes section if necessary.
5822 (Target_arm::get_secondary_compatible_arch,
5823 Target_arm::set_secondary_compatible_arch,
5824 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
5825 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 5826 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
5827 New method definitions.
5828
b59befec
ILT
58292009-12-09 Ian Lance Taylor <iant@google.com>
5830
5831 * plugin.cc (Plugin::load): Don't cast from void* to a function
5832 pointer.
5833
1276bc89
ILT
58342009-12-09 Ian Lance Taylor <iant@google.com>
5835
5836 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
5837 information fields.
5838
2f2de248
L
58392009-12-09 H.J. Lu <hongjiu.lu@intel.com>
5840
5841 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
5842 Replace two_file_shared_1.so with two_file_shared_2.so.
5843 * testsuite/Makefile.in: Regenerated.
5844
4f787271
DK
58452009-12-08 Doug Kwan <dougkwan@google.com>
5846
5847 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
5848 (HFILES): Add attributes.h and int_encoding.h.
5849 * Makefile.in: Regenerate.
5850 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
5851 function definitions to int_encoding.cc
5852 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
5853 prototypes to int_encoding.h
5854 * reduced_debug_output.cc (int_encoding.h): New include.
5855 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
5856 function definitions to int_encoding.cc
5857 (insert_into_vector, read_from_pointer): Move template definitions to
5858 int_encoding.h
5859 * attributes.cc: New file.
5860 * attributes.h: New file.
5861 * int_encoding.cc: New file.
5862 * int_encoding.h: New file.
5863
20b52f1a
RÁE
58642009-12-07 Rafael Avila de Espindola <espindola@google.com>
5865
5866 PR gold/11055
5867 * incremental-dump.cc (dump_incremental_inputs): New.
5868 (main): Use dump_incremental_inputs.
5869
53d7974c
L
58702009-12-07 H.J. Lu <hongjiu.lu@intel.com>
5871
5872 PR gold/10893
5873 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
5874 checking elfcpp::STT_FUNC.
5875 (Target_i386::Relocate::relocate): Likewise.
5876 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
5877
5878 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
5879 symbols from shared libraries into normal FUNC symbols.
5880
5881 * symtab.h (Symbol): Add is_func and use it.
5882
05a352e6
DK
58832009-12-05 Doug Kwan <dougkwan@google.com>
5884
5885 * arm.cc (Target_arm::arm_info): Initialize new fields
5886 attributes_section and attributes_vendor.
5887 * i386.cc (Target_i386::i386_info): Same.
5888 * object.cc (Sized_relobj::do_layout): Skip attribute section.
5889 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
5890 fields attributes_section and attributes_vendor.
53d7974c 5891 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
5892 * target.h (Target::attributes_section, Target::attributes_vendor,
5893 Target::is_attributes_section, Target::attribute_arg_type,
5894 Target::attributes_order): New method definitions.
5895 (Target::Target_info::attributes_section,
5896 Target::Target_info::attributes_vendor): New fields.
5897 (Target::do_attribute_arg_type, Target::do_attributes_order): New
5898 virtual method definitions.
5899 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
5900 attributes_section and attributes_vendor.
5901 * testsuite/testfile.cc (Target_test::test_target_info): Same.
5902
f4e5969c
DK
59032009-12-05 Doug Kwan <dougkwan@google.com>
5904
5905 * arm.cc: Update comments about interworking and stub generation.
5906 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
5907 considered as non-PIC.
5908 (Arm_relocate_functions::base_abs): Fix formatting.
5909 (Arm_relocate_functions::got_prel): Fix comment. Change interface
5910 of function to use GOT entry address instead of offset.
5911 (Target_arm::Scan::global): Issue an error if a symbol would need a
5912 PLT does not get one because it is untyped. Remove code to create
5913 dynamic symbols for relative branches.
5914 (Target_arm::Relocate::relocate: Use 0 instead of false since function
5915 takes unsigned integer instead of boolean.
5916
1abce4a6
L
59172009-12-05 H.J. Lu <hongjiu.lu@intel.com>
5918
5919 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
5920 (two_file_test_LDADD): Likewise.
5921 (common_test_1_LDADD): Likewise.
5922 (exception_test_LDADD) Likewise.
5923 (weak_test_LDADD): Likewise.
5924 (many_sections_test_LDADD): Likewise.
5925 (initpri1_LDADD): Likewise.
5926 (script_test_1_LDADD): Likewise.
5927 (script_test_2_LDADD): Likewise.
5928 (justsyms_LDADD): Likewise.
5929 (binary_test_LDADD): Likewise.
5930 (large_LDADD): Likewise.
5931 * testsuite/Makefile.in: Regenerated.
5932
adcf2816 59332009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 5934
adcf2816
L
5935 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
5936 (Symbol_table::override_with_special): Likewise.
5937 (Symbol_table::add_from_object): Likewise.
5938
28e67f5d
RÁE
59392009-12-04 Rafael Avila de Espindola <espindola@google.com>
5940
5941 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5942 Don't set the data_offset twice.
5943
ae10a101
RÁE
59442009-12-04 Rafael Avila de Espindola <espindola@google.com>
5945
5946 * testsuite/Makefile.in: Regenerate.
5947
f59f41f3
DK
59482009-12-03 Doug Kwan <dougkwan@google.com>
5949
5950 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
5951 (Target_arm::do_finalize_sections): Add parameter for symbol table
5952 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
5953 * i386.cc (Target_i386::do_finalize_sections): Add an additional
5954 parameter for symbol table pointer.
5955 * layout.cc (Layout::finalize): Call Target::finalize_sections with
5956 an additional parameter for a pointer to symbol table.
5957 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
5958 parameter for a symbol table pointer.
5959 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
5960 * target.h (Target::finalize_sections, Target::do_finalize_sections):
5961 Ditto.
5962 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
5963 parameter for a symbol table pointer.
5964
ca55d848
RÁE
59652009-12-03 Rafael Avila de Espindola <espindola@google.com>
5966
5967 * incremental.cc (Incremental_inputs_header)
5968 (Incremental_inputs_header_write, Incremental_inputs_entry)
5969 (Incremental_inputs_entry_write): Move ...
5970 * incremental.h (Incremental_inputs_header)
5971 (Incremental_inputs_header_write, Incremental_inputs_entry)
5972 (Incremental_inputs_entry_write): here.
5973
3aec4f9c
RÁE
59742009-12-02 Rafael Avila de Espindola <espindola@google.com>
5975
5976 * incremental.cc (make_sized_incremental_binary): Set the target.
5977 Error if it is incompatible.
5978 * output.h (Output_file): Add filename method.
5979
9c0ae74d
RÁE
59802009-12-02 Rafael Avila de Espindola <espindola@google.com>
5981
5982 * incremental.cc (Incremental_inputs_entry): Remove unused argument
5983 from the get_* methods.
5984
a45500ae
RÁE
59852009-12-02 Rafael Avila de Espindola <espindola@google.com>
5986
5987 * incremental-dump.cc (main): Check that the offeset of a script is 0.
5988 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
5989 Write 0 for the data_offset of scripts.
5990
325e6408
RÁE
59912009-12-02 Rafael Avila de Espindola <espindola@google.com>
5992
5993 * testsuite/Makefile.am: Add the incremental_test.sh test.
5994 * testsuite/incremental_test.sh: New.
5995 * testsuite/incremental_test_1.c: New.
5996 * testsuite/incremental_test_2.c: New.
5997
954c3e2e
RÁE
59982009-12-01 Rafael Avila de Espindola <espindola@google.com>
5999
6000 * incremental-dump.cc (main): Fix typos.
6001
f8086623
RÁE
60022009-11-27 Rafael Avila de Espindola <espindola@google.com>
6003
6004 PR gold/11025
6005 * incremental-dump.cc (main): Use llu to print 64 bit values.
6006
3b0dd6ac
L
60072009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
6008 H.J. Lu <hongjiu.lu@intel.com>
6009
6010 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
6011 $(LIBDL).
6012 (incremental_dump_LDADD): Likewise.
6013 * Makefile.in: Regenerated.
6014
a6d1ef57 60152009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 6016
a6d1ef57
DK
6017 Revert:
6018
6019 2009-11-25 Doug Kwan <dougkwan@google.com>
6020
6021 * arm.cc (Target_arm::Target_arm): Move method definition
6022 outside of class definition. Add code to handle
6023 --target1-rel, --target1-abs and --target2= options.
6024 (Target_arm::get_reloc_reloc_type): Change method to be
6025 non-static and const.
6026 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
6027 New data member declaration.
6028 (Target_arm::Scan::local, Target_arm::Scan::global,
6029 Target_arm::Relocate::relocate,
6030 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
6031 Adjust call to Target_arm::get_real_reloc_type.
6032 (Target_arm::get_real_reloc_type): Use command line options
6033 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6034 * options.h (--target1-rel, --target1-abs, --target2): New
6035 ARM-only options.
6036
50aeb7d4
DK
60372009-11-25 Doug Kwan <dougkwan@google.com>
6038
6039 * arm.cc (Target_arm::Target_arm): Move method definition outside of
6040 class definition. Add code to handle --target1-rel, --target1-abs
6041 and --target2= options.
6042 (Target_arm::get_reloc_reloc_type): Change method to be non-static
6043 and const.
6044 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
6045 member declaration.
6046 (Target_arm::Scan::local, Target_arm::Scan::global,
6047 Target_arm::Relocate::relocate,
6048 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
6049 call to Target_arm::get_real_reloc_type.
6050 (Target_arm::get_real_reloc_type): Use command line options to
6051 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
6052 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
6053 options.
6054
51938283
DK
60552009-11-25 Doug Kwan <dougkwan@google.com>
6056
6057 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
6058 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
6059 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
6060 formatting.
6061 (Arm_relocate_functions::thm_call): Replace body with a call to
6062 Arm_relocate_functions::thumb_branch_common.
6063 (Arm_relocate_functions::thm_jump24,
6064 Arm_relocate_functions::thm_xpc22): New method definitions.
6065 (Arm_relocate_functions::thumb_branch_common): New method definition.
6066 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
6067 operator.
6068 (Target_arm::Relocate::relocate): Adjust call to thm_call.
6069 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
6070
e2b8f3c4
RÁE
60712009-11-24 Rafael Avila de Espindola <espindola@google.com>
6072
6073 * Makefile.am: Build incremental-dump
6074 * Makefile.in: Regenerate.
6075 * incremental-dump.cc: New.
6076 * incremental.cc (Incremental_inputs_header_data,
6077 Incremental_inputs_entry_data): Move to incremental.h
6078 * incremental.h: (Incremental_inputs_header_data,
6079 Incremental_inputs_entry_data): Move from incremental.cc
6080
bcba9aec
RÁE
60812009-11-24 Rafael Avila de Espindola <espindola@google.com>
6082
6083 * incremental.cc (Incremental_inputs_header,
6084 Incremental_inputs_header_write, Incremental_inputs_entry,
6085 Incremental_inputs_entry_write): Add a typedef with the data type.
6086
7c3afe08
RÁE
60872009-11-24 Rafael Avila de Espindola <espindola@google.com>
6088
6089 * incremental.cc (Incremental_inputs_header,
6090 Incremental_inputs_header_write, Incremental_inputs_entry,
6091 Incremental_inputs_entry_write): Update comment about which
6092 type has the filed descriptions.
6093
d204b6e9
DK
60942009-11-15 Doug Kwan <dougkwan@google.com>
6095
6096 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
6097 (Arm_relocate_functions::arm_branch_common): Change method defintion
6098 in class definition to a method declaration and update list of formal
6099 parameters.
6100 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
6101 Arm_relocation_functions::jump24): Adjust call to
6102 Arm_relocate_functions::arm_branch_common. Update list of formal
6103 parameters.
6104 (Arm_relocate_functions::xpc25): New method definition.
6105 (Arm_relocate_functions::arm_branch_common): Move method defintion
6106 out from class definition. Use stubs for mode-switching and extending
6107 branch ranges.
6108 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
6109 specially. Change code to enable use of stubs in ARM branches.
6110
43d12afe
DK
61112009-11-10 Doug Kwan <dougkwan@google.com>
6112
6113 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
6114 in method declaration.
6115 (Target_arm::relocate_stub): New method declaration.
6116 (Target_arm::default_target): Change to return a pointer instead of
6117 a const reference.
6118 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
6119 Target_arm::default_target.
6120 (Arm_Relobj::do_relocate_sections): Remove options paramater in
6121 method definition.
6122 (Target_arm::relocate_section): Adjust view.
6123 (Target_arm::relocate_stub): New method definition.
6124
ac33a407
DK
61252009-11-10 Doug Kwan <dougkwan@google.com>
6126
6127 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
6128 a format warning.
6129 * incremental.cc (open_incremental_binary): Initialized local
6130 variables to avoid warnings.
6131 * object.cc (make_elf_object): Ditto.
6132 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
6133 a format warning.
e1df38aa 6134
88ee28e9
L
6135009-11-09 H.J. Lu <hongjiu.lu@intel.com>
6136
6137 PR gold/10930
6138 * testsuite/plugin_test.c: Include "config.h".
6139
2daedcd6
DK
61402009-11-09 Doug Kwan <dougkwan@google.com>
6141
6142 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
6143 (arm_symbol_value): Remove.
6144 (Arm_relocate_functions::arm_branch_common,
6145 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
6146 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
6147 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
6148 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
6149 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
6150 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
6151 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
6152 Arm_relocate_functions::thm_mobw_abs_nc,
6153 Arm_relocate_functions::thm_mov_abs,
6154 Arm_relocate_functions::movw_prel_nc,
6155 Arm_relocate_functions::thm_movt_abs,
6156 Arm_relocate_functions::movt_prel,
6157 Arm_relocate_functions::thm_movw_prel_nc,
6158 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
6159 (Target_arm::Relocate::relocate): Only decompose address into two
6160 parts if relocation type uses the thumb-bit and pass the actual
6161 bit instead of a flag indicating that the thumb-bit is used. Adjust
6162 calls to methods in Arm_relocate_functions for this change.
6163
1276bc89 61642009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
6165
6166 PR 10925
6167 * reloc.cc: Instantiate
6168 Sized_relobj::initialize_input_to_output_maps and
6169 Sized_relobj:free_input_to_output_maps.
6170
e53ad1b5
ILT
61712009-11-06 Ian Lance Taylor <iant@google.com>
6172
6173 PR 10876
6174 * defstd.cc (in_segment): Set only_if_ref true for "end".
6175
eb44217c
DK
61762009-11-06 Doug Kwan <dougkwan@google.com>
6177
6178 * arm.cc (class Reloc_stub): Correct a comment.
6179 (Target_arm::Target_arm): Initialize arm_input_section_map_.
6180 (Target_arm::scan_section_for_stubs): New method declaration.
6181 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
6182 Change methods from private to protected.
6183 (Target_arm::do_may_relax): New method definition.
6184 (Target_arm::do_relax, Target_arm::group_sections,
6185 Target_arm::scan_reloc_for_stub,
6186 Target_arm::scan_reloc_section_for_stubs): New method declarations.
6187 (Target_arm::arm_input_section_map_): New data member declaration.
6188 (Target_arm::scan_reloc_for_stub,
6189 Target_arm::scan_reloc_section_for_stubs,
6190 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
6191 Target_arm::do_relax): New method definitions.
6192
5d329b7d
ILT
61932009-11-06 Mikolaj Zalewski <mikolaj@google.com>
6194
6195 * configure.ac: Check for (struct stat)::st_mtim
6196 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
6197 * config.in: Regenerate.
6198 * configure: Regenerate.
6199
96a0d71b
ILT
62002009-11-05 Ian Lance Taylor <iant@google.com>
6201
6202 PR 10910
6203 * output.cc (Output_segment::add_output_section): Add missing
6204 return statement.
6205
594c8e5e
ILT
62062009-11-04 Ian Lance Taylor <iant@google.com>
6207
6208 PR 10880
6209 * object.h (class Object): Add is_needed and set_is_needed
6210 methods. Add is_needed_ field. Make bool fields into bitfields.
6211 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
6212 defined in a dynamic object and referenced by a regular object,
6213 set is_needed for the dynamic object.
6214 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
6215 if the file is marked with as_needed and it is not needed.
6216
22b127cc
ILT
62172009-11-04 Ian Lance Taylor <iant@google.com>
6218
6219 PR 10887
6220 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
6221 tags if data is discarded by linker script.
6222 * i386.cc (Target_i386::do_finalize_sections): Likewise.
6223 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
6224 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
6225 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
6226
f5c870d2
ILT
62272009-11-04 Ian Lance Taylor <iant@google.com>
6228
6229 * layout.cc (Layout::get_output_section): Add is_interp and
6230 is_dynamic_linker_section parameters. Change all callers.
6231 (Layout::choose_output_section): Likewise.
6232 (Layout::make_output_section): Likewise.
6233 (Layout::add_output_section_data): Add is_dynamic_linker_section
6234 parameter. Change all callers.
6235 * layout.h (class Layout): Update declarations.
6236 * output.h (class Output_section): Add is_interp, set_is_interp,
6237 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
6238 Add is_interp_, is_dynamic_linker_section_ fields. Change
6239 generate_code_fills_at_write_ to a bitfield.
6240 * output.cc (Output_section::Output_sections): Initialize new
6241 fields.
6242 (Output_segment::add_output_section): Add do_sort parameter.
6243 Change all callers.
6244
1ae4d23b
ILT
62452009-11-03 Ian Lance Taylor <iant@google.com>
6246
6247 PR 10860
6248 * options.h (class General_options): Add --warn-common.
6249 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
6250 merging two common symbols.
6251 (Symbol_table::should_override): Handle --warn-common when merging
6252 a common symbol with a defined symbol. Use report_resolve_problem
6253 for multiple definitions.
6254 (Symbol_table::report_resolve_problem): New function.
6255 * symtab.h (class Symbol_table): Declare report_resolve_problem.
6256
55da9579
DK
62572009-11-03 Doug Kwan <dougkwan@google.com>
6258
6259 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
6260 stub_factory_.
6261 (Target_arm::stub_factory): New method definition.
6262 (Target_arm::new_arm_input_section,
6263 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
6264 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 6265 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
6266 New type definitions.
6267 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
6268 member declarations.
6269 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
6270 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
6271 New method definitions.
6272
37a9ac43
ILT
62732009-11-03 Ian Lance Taylor <iant@google.com>
6274
6275 * options.h (class General_options): Add --warn_constructors.
6276
b3d6a3d4
ILT
62772009-11-03 Ian Lance Taylor <iant@google.com>
6278
6279 PR 10893
6280 * defstd.cc (in_section): Add entries for __rel_iplt_start,
6281 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
6282
934b01dd
ILT
62832009-11-03 Ian Lance Taylor <iant@google.com>
6284
6285 PR 10895
6286 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
6287 --msgid-bugs-address.
6288 (install-pdf): New target.
6289 (install-data_yes): Look up one directory to find mkinstalldirs.
6290
03c1939b
L
62912009-11-03 H.J. Lu <hongjiu.lu@intel.com>
6292
6293 * po/Make-in (.po.gmo): Don't generate .gmo files in source
6294 tree.
6295
ebd95253
DK
62962009-10-30 Doug Kwan <dougkwan@google.com>
6297
6298 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
6299
e9bbb538
DK
63002009-10-30 Doug Kwan <dougkwan@google.com>
6301
6302 * arm.cc (Stub_addend_reader): New struct template definition
6303 and partial specializations.
6304 (Stub_addend_reader::operator()): New method definition for a
6305 partially specialized template.
6306
d5b40221
DK
63072009-10-30 Doug Kwan <dougkwan@google.com>
6308
6309 * arm.cc (Arm_relobj::processor_specific_flags): New method
6310 definition.
6311 (Arm_relobj::do_read_symbols): New method declaration.
6312 (Arm_relobj::processor_specific_flags_): New data member declaration.
6313 (Arm_dynobj): New class definition.
6314 (Target_arm::do_finalize_sections): Add input_objects parameter.
6315 (Target_arm::do_adjust_elf_header): New method declaration.
6316 (Target_arm::are_eabi_versions_compatible,
6317 (Target_arm::merge_processor_specific_flags): New method declaration.
6318 (Target_arm::do_make_elf_object): New overloaded method definitions
6319 and declaration.
6320 (Arm_relobj::do_read_symbols): New method definition.
6321 (Arm_dynobj::do_read_symbols): Ditto.
6322 (Target_arm::do_finalize_sections): Add input_objects parameters.
6323 Merge processor-specific flags from all input objects.
6324 (Target_arm::are_eabi_versions_compatible,
6325 Target_arm::merge_processor_specific_flags,
6326 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
6327 New method definitions.
6328 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
6329 Input_objects pointer type parameter.
6330 * layout.cc (Layout::finalize): Pass input objects to target's.
6331 finalize_sections function.
6332 * output.cc (Output_file_header::do_sized_write): Set ELF file
6333 header's processor-specific flags.
6334 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
6335 Input_objects pointer type parameter.
6336 * sparc.cc (Target_sparc::do_finalize_sections): Same.
6337 * target.h (Input_objects): New forward class declaration.
6338 (Target::processor_specific_flags,
6339 Target::are_processor_specific_flags_sect): New method definitions.
6340 (Target::finalize_sections): Add input_objects parameter.
6341 (Target::Target): Initialize processor_specific_flags_ and
6342 are_processor_specific_flags_set_.
6343 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
6344 parameter.
6345 (Target::set_processor_specific_flags): New method definition.
6346 (Target::processor_specific_flags_,
6347 Target::are_processor_specific_flags_set_): New data member
6348 declarations.
6349 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
6350 Input_objects pointer type parameter.
6351
ebabffbd
DK
63522009-10-30 Doug Kwan <dougkwan@google.com>
6353
6354 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
6355
ad0f2072
ILT
63562009-10-28 Ian Lance Taylor <iant@google.com>
6357
6358 * object.h (class Relobj): Drop options parameter from
6359 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
6360 do_scan_relocs, do_relocate. Change all callers.
6361 (class Sized_relobj): Drop options parameters from
6362 do_gc_process_relocs, do_scan_relocs, do_relocate,
6363 do_relocate_sections, relocate_sections, emit_relocs_scan,
6364 emit_relocs_scan_reltype. Change all callers.
6365 (struct Relocate_info): Remove options field and all references to
6366 it.
6367 * reloc.h (class Read_relocs): Remove options constructor
6368 parameter and options_ field. Change all callers.
6369 (class Gc_process_relocs, class Scan_relocs): Likewise.
6370 (class Relocate_task): Likewise.
6371 * target-reloc.h (scan_relocs): Remove options parameter. Change
6372 all callers.
6373 (scan_relocatable_relocs): Likewise.
6374 * target.h (class Sized_target): Remove options parameter from
6375 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
6376 all callers.
6377 * gc.h (gc_process_relocs): Remove options parameter. Change all
6378 callers.
6379 * arm.cc: Update functions to remove options parameters.
6380 * i386.cc: Likewise.
6381 * powerpc.cc: Likewise.
6382 * sparc.cc: Likewise.
6383 * x86_64.cc: Likewise.
6384 * testsuite/testfile.cc: Likewise.
6385
8ffa3667
DK
63862009-10-28 Doug Kwan <dougkwan@google.com>
6387
6388 * arm.cc (Arm_relobj): New class definition.
e1df38aa 6389 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
6390 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
6391 New method definitions.
6392
40f36857
CC
63932009-10-28 Cary Coutant <ccoutant@google.com>
6394
6395 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
6396 (Plugin::cleanup_done_): New member.
6397 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
6398 (Plugin_manager::cleanup_done_): Remove.
6399 (Plugin_manager::add_input_file): Edit error message.
6400 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
6401 (Plugin_manager::cleanup): Remove use of cleanup_done_.
6402
2c849493
ILT
64032009-10-27 Mikolaj Zalewski <mikolajz@google.com>
6404
6405 * fileread.cc: (File_read::View::~View): Use the new
6406 data_ownership_ filed.
6407 (File_read::~File_read): Dispose the new whole_file_view_.
6408 (File_read::open): Mmap the whole file if needed.
6409 (File_read::open): Use whole_file_view_ instead of contents_.
6410 (File_read::find_view): Use whole_file_view_ if applicable.
6411 (File_read::do_read): Use whole_file_view_ instead of contents_.
6412 (File_read::make_view): Use whole_file_view_ instead of contents_,
6413 update File_read::View::View call.
6414 (File_read::find_or_make_view): Update File_read::View::View
6415 call.
6416 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
6417 remove contents_
6418 (File_read::View::Data_ownership): New enum.
6419 (File_read::View::View): Replace bool mapped_ with Data_ownership
6420 argument.
6421 (File_read::View::mapped_): Remove (replaced by data_ownership_).
6422 (File_read::View::data_ownership_): New field.
6423 (File_read::contents_): Remove (replaced by whole_file_view_).
6424 (File_read::whole_file_view_): New field.
6425 * options.h (class General_options): Add --keep-files-mapped.
6426
24998053
CC
64272009-10-27 Cary Coutant <ccoutant@google.com>
6428
6429 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
6430 * testsuite/Makefile.am (plugin_test_5): New test case.
6431 * testsuite/Makefile.in: Regenerate.
6432
72adc4fa
DK
64332009-10-25 Doug Kwan <dougkwan@google.com>
6434
6435 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
6436 from private to protected to allow access by child class.
6437 (Sized_relobj::do_relocate_sections): New method declaration.
6438 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 6439 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
6440 Sized_relobj::relocate_sections. Instantiate template explicitly
6441 for different target sizes and endianity.
6442
07f508a2
DK
64432009-10-24 Doug Kwan <dougkwan@google.com>
6444
6445 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
6446 (Arm_input_section::as_arm_input_section): New method.
6447 (Arm_output_section): New class definition.
6448 (Arm_output_section::create_stub_group,
6449 Arm_output_section::group_sections): New method definitions.
6450
10ad9fe5
DK
64512009-10-22 Doug Kwan <dougkwan@google.com>
6452
6453 * arm.cc (Arm_input_section): New class definition.
6454 (Arm_input_section::init, Arm_input_section:do_write,
6455 Arm_input_section::set_final_data_size,
6456 Arm_input_section::do_reset_address_and_file_offset): New method
6457 definitions.
6458
56ee5e00
DK
64592009-10-21 Doug Kwan <dougkwan@google.com>
6460
6461 * arm.cc (Stub_table, Arm_input_section): New forward class
6462 declarations.
6463 (Stub_table): New class defintion.
6464 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
6465 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
6466 New method definition.
6467
b569affa
DK
64682009-10-21 Doug Kwan <dougkwan@google.com>
6469
6470 * arm.cc: Update copyright comments.
6471 (Target_arm): New forward class template declaration.
6472 (Arm_address): New type.
6473 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
6474 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
6475 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
6476 constants.
6477 (Insn_template): Same.
6478 (DEF_STUBS): New macro.
6479 (Stub_type): New enum type.
6480 (Stub_template): New class definition.
6481 (Stub): Same.
6482 (Reloc_stub): Same.
6483 (Stub_factory): Same.
6484 (Target_arm::Target_arm): Initialize may_use_blx_ and
6485 should_force_pic_veneer_.
6486 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
6487 Target_arm::should_force_pic_veneer,
6488 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
6489 Target_arm::using_thumb_only, Target_arm:;default_target): New
6490 method defintions.
6491 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
6492 New data member declarations.
6493 (Insn_template::size, Insn_template::alignment): New method defintions.
6494 (Stub_template::Stub_template): New method definition.
6495 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
6496 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
6497 (Stub_factory::Stub_factory): New method definition.
6498 * gold.h (string_hash): New template.
6499 * output.h (Input_section_specifier::hash_value): Use
6500 gold::string_hash.
6501 (Input_section_specifier::string_hash): Remove.
6502 * stringpool.cc (Stringpool_template::string_hash): Use
6503 gold::string_hash.
6504
6c172549
DK
65052009-10-20 Doug Kwan <dougkwan@google.com>
6506
6507 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
6508 symbols of relaxed input sections.
6509 * output.h (Output_section::find_relaxed_input_section): Make
6510 method public.
6511
c5617f2f
DK
65122009-10-16 Doug Kwan <dougkwan@google.com>
6513
6514 * dynobj.cc (Versions::Versions): Initialize version_script_.
6515 Only insert base version symbol definition for a shared object
6516 if version script defines any version versions.
6517 (Versions::define_base_version): New method definition.
6518 (Versions::add_def): Check that base version is not needed.
6519 (Versions::add_need): Define base version lazily.
6520 * dynobj.h (Versions::define_base_version): New method declaration.
6521 (Versions::needs_base_version_): New data member declaration.
6522 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
6523 (check_DATA): Add no_version_test.stdout.
6524 (libno_version_test.so, no_version_test.o no_version_test.stdout):
6525 New make rules.
6526 * testsuite/Makefile.in: Regenerate.
6527 * testsuite/no_version_test.c: New file.
6528 * testsuite/no_version_test.sh: Ditto.
6529
3c12dcdb
DK
65302009-10-16 Doug Kwan <dougkwan@google.com>
6531
6532 * expression.cc (class Segment_start_expression): New class definition.
6533 (Segment_start_expression::value): New method definition.
6534 (script_exp_function_segment_start): Return a new
6535 Segment_start_expression.
6536 * gold/script-c.h (script_saw_segment_start_expression): New function
6537 prototype.
6538 * script-sections.cc (Script_sections::Script_sections): Initialize
6539 SAW_SEGMENT_START_EXPRESSION_ to false.
6540 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
6541 and -Tbbs options to specify section addresses if given in
6542 command line and no SEGMENT_START expression is seen in a script.
6543 * script-sections.h (Script_sections::saw_segment_start_expression,
6544 Script_sections::set_saw_segment_start_expression): New method
6545 definition.
6546 (Script_sections::saw_segment_start_expression_): New data member
6547 declaration.
6548 * script.cc (script_saw_segment_start_expression): New function.
6549 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
6550 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
6551 script_test_7.sh and script_test_8.sh.
6552 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
6553 script_test_8.stdout.
6554 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
6555 (script_test_6, script_test_6.stdout, script_test_7,
6556 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
6557 * Makefile.in: Regenerate.
6558 * testsuite/script_test_6.sh: New file.
6559 * testsuite/script_test_6.t: Same.
6560 * testsuite/script_test_7.sh: Same.
6561 * testsuite/script_test_7.t: Same.
6562 * testsuite/script_test_8.sh: Same.
6563
64b1ae37
DK
65642009-10-16 Doug Kwan <dougkwan@google.com>
6565
6566 * output.cc (Output_segment::set_section_list_address): Cast
6567 expressions to unsigned long long type to avoid format warnings.
6568
661be1e2
ILT
65692009-10-15 Ian Lance Taylor <iant@google.com>
6570
12edd763 6571 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 6572 dot assignment to script_sections_.
12edd763
ILT
6573 * script-sections.cc (Script_sections::add_dot_assignment):
6574 Initialize if necessary.
6575
68b6574b
ILT
6576 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
6577 program headers with no load segment if there is a linker script.
6578
661be1e2
ILT
6579 * layout.cc (Layout::set_segment_offsets): Align the file offset
6580 to the segment aligment for -N or -n with no load segment.
6581 * output.cc (Output_segment::add_output_section): Don't crash if
6582 the first section is a TLS section.
6583 (Output_segment::set_section_list_addresses): Print an error
6584 message if the address moves backward in a linker script.
6585 * script-sections.cc
6586 (Output_section_element_input::set_section_addresses): Don't
6587 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
6588 (Orphan_output_section::set_section_addresses): Likewise.
6589
f15f61a7
DK
65902009-10-15 Doug Kwan <dougkwan@google.com>
6591
6592 * layout.cc (Layout::finish_dynamic_section): Generate tags
6593 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
6594 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
6595 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
6596
82bb573a
ILT
65972009-10-14 Ian Lance Taylor <iant@google.com>
6598
6599 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
6600 fields.
6601 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
6602 data_shdr fields of relinfo.
6603 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
6604 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
6605 R_386_TLS_LDO_32, adjust based on section flags.
6606 (Target_i386::Relocate::fix_up_ldo): Remove.
6607
374ad285
ILT
66082009-10-13 Ian Lance Taylor <iant@google.com>
6609
6610 Add support for -pie.
6611 * options.h (class General_options): Add -pie and
6612 --pic-executable.
6613 (General_options::output_is_position_independent): Test -pie.
6614 (General_options::output_is_executable): Return true if not shared
6615 and not relocatable.
6616 (General_options::output_is_pie): Remove.
6617 * options.cc (General_options::finalize): Reject incompatible uses
6618 of -pie.
6619 * gold.cc (queue_middle_tasks): A -pie link is not static.
6620 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
6621 * symtab.cc (Symbol::final_value_is_known): Return false if
6622 output_is_position_independent.
6623 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
6624 output_is_position_independent.
6625 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
6626 output_is_position_independent.
6627 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
6628 output_is_position_independent.
6629 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
6630 two_file_pie_test.
6631 (basic_pie_test.o, basic_pie_test): New targets.
6632 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
6633 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
6634 (two_file_pie_test): New target.
6635 * testsuite/Makefile.in: Rebuild.
6636 * README: Remove note saying that -pie is not supported.
6637
c6585162
ILT
66382009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
6639
6640 * options.h (class General_options): Add -init and -fini.
6641 * layout.cc (Layout::finish_dynamic_section): Emit
6642 given init and fini functions.
6643
032ce4e9
ST
66442009-10-13 Sriraman Tallam <tmsriram@google.com>
6645
6646 * gc.h (gc_process_relocs): Check if icf is enabled using new
6647 function.
6648 * gold.cc (queue_initial_tasks): Likewise.
6649 (queue_middle_tasks): Likewise.
6650 * object.cc (do_layout): Likewise.
6651 * symtab.cc (is_section_folded): Likewise.
6652 * main.cc (main): Likewise.
6653 * reloc.cc (Read_relocs::run): Likewise.
6654 (Sized_relobj::do_scan_relocs): Likewise.
6655 * icf.cc (is_function_ctor_or_dtor): New function.
6656 (Icf::find_identical_sections): Check if function is ctor or dtor when
6657 safe icf is chosen.
6658 * options.h (General_options::icf): Change option to be an enum.
6659 (Icf_status): New enum.
6660 (icf_enabled): New method.
6661 (icf_safe_folding): New method.
6662 (set_icf_status): New method.
6663 (icf_status_): New variable.
6664 * (options.cc) (General_options::finalize): Set icf_status_.
6665 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
6666 icf_test and icf_keep_unique_test to use the --icf enum flag.
6667 * testsuite/icf_safe_test.sh: New file.
e1df38aa 6668 * testsuite/icf_safe_test.cc: New file.
032ce4e9 6669
f345227a
ST
66702009-10-12 Sriraman Tallam <tmsriram@google.com>
6671
6672 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
6673 includes to gc.h and icf.h.
6674 * arm.cc: Include gc.h.
6675 * gold.cc: Likewise.
6676 * i386.cc: Likewise.
6677 * powerpc.cc: Likewise.
6678 * sparc.cc: Likewise.
6679 * x86_64.cc: Likewise.
6680 * gc.h: Include icf.h.
6681
1c7814ed
ILT
66822009-10-11 Ian Lance Taylor <iant@google.com>
6683
6684 * plugin.cc: Include "gold.h" before other header files.
6685
ae3b5189
CD
66862009-10-10 Chris Demetriou <cgd@google.com>
6687
6688 * options.h (Input_file_argument::Input_file_type): New enum.
6689 (Input_file_argument::is_lib_): Replace with...
6690 (Input_file_argument::type_): New member.
6691 (Input_file_argument::Input_file_argument): Take Input_file_type
6692 'type' rather than boolean 'is_lib' as second argument.
6693 (Input_file_argument::is_lib): Use type_.
6694 (Input_file_argument::is_searched_file): New function.
6695 (Input_file_argument::may_need_search): Handle is_searched_file.
6696 * options.cc (General_options::parse_library): Support -l:filename.
6697 (General_options::parse_just_symbols): Update for Input_file_argument
6698 changes.
6699 (Command_line::process): Likewise.
6700 * archive.cc (Archive::get_file_and_offset): Likewise.
6701 * plugin.cc (Plugin_manager::release_input_file): Likewise.
6702 * script.cc (read_script_file, script_add_file): Likewise.
6703 * fileread.cc (Input_file::Input_file): Likewise.
6704 (Input_file::will_search_for): Handle is_searched_file.
6705 (Input_file::open): Likewise.
6706 * readsyms.cc (Read_symbols::get_name): Likewise.
6707 * testsuite/Makefile.am (searched_file_test): New test.
6708 * testsuite/Makefile.in: Regenerate.
6709 * testsuite/searched_file_test.cc: New file.
6710 * testsuite/searched_file_test_lib.cc: New file.
6711
f3048a1d
ILT
67122009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6713 Ian Lance Taylor <iant@google.com>
6714
6715 * descriptor.cc: Include <cstdio> and "binary-io.h".
6716 (Descriptors::open): Open the files in binary mode always.
6717 * script.cc (Lex::get_token): Treat \r as whitespace.
6718
d4780e57
ILT
67192009-10-09 Ian Lance Taylor <iant@google.com>
6720
6721 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
6722
d9a893b8
ILT
67232009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6724 Ian Lance Taylor <iant@google.com>
6725
6726 * configure.ac: Check for readv function also.
6727 * fileread.cc (readv): Define if not HAVE_READV.
6728 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
6729 does not exist.
6730 * config.in: Regenerate.
6731 * configure: Regenerate.
6732
c0a62865
DK
67332009-10-09 Doug Kwan <dougkwan@google.com>
6734
6735 * layout.cc (Layout::make_output_section): Call target hook to make
6736 ordinary output section.
6737 (Layout::finalize): Adjust parameter list of call the
6738 Target::may_relax().
6739 * layout.h (class Layout::section_list): New method.
6740 * merge.h (Output_merge_base::entsize): Change visibility to public.
6741 (Output_merge_base::is_string, Output_merge_base::do_is_string):
6742 New methods.
6743 (Output_merge_string::do_is_string): New method.
6744 * object.cc (Sized_relobj::do_setup): renamed from
6745 Sized_relobj::set_up.
6746 * object.h (Sized_relobj::adjust_shndx,
6747 Sized_relobj::initializ_input_to_output_maps,
6748 Sized_relobj::free_input_to_output_maps): Change visibilities to
6749 protected.
6750 (Sized_relobj::setup): Virtualize.
6751 (Sized_relobj::do_setup): New method declaration.
6752 (Sized_relobj::invalidate_section_offset,
6753 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
6754 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
6755 * options.cc (parse_int): New function.
6756 * options.h (parse_int): New declaration.
6757 (DEFINE_int): New macro.
6758 (stub_group_size): New option.
6759 * output.cc (Output_section::Output_section): Initialize memebers
6760 merge_section_map_, merge_section_by_properties_map_,
6761 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
6762 (Output_section::add_input_section): Handled deferred code-fill
6763 generation and remove an old comment.
6764 (Output_section::add_relaxed_input_section): New method definition.
6765 (Output_section::add_merge_input_section): Use merge section by
6766 properties map to speed to search. Update merge section maps
6767 as appropriate.
6768 (Output_section::build_relaxation_map): New method definition.
6769 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
6770 Same.
6771 (Output_section::relax_input_section): Renamed to
6772 Output_section::convert_input_sections_to_relaxed_sections and change
6773 interface to take a vector of pointers to relaxed sections.
6774 (Output_section::find_merge_section,
6775 Output_section::find_relaxed_input_section): New method definitions.
6776 (Output_section::is_input_address_mapped,
6777 Output_section::output_offset, Output_section::output_address):
6778 Use output section data maps to speed up searching.
6779 (Output_section::find_starting_output_address): Add comments.
6780 (Output_section::do_write,
6781 Output_section::write_to_postprocessing_buffer): Do code-fill
6782 generation as appropriate.
6783 (Output_section::get_input_sections): Invalidate relaxed input section
6784 map.
6785 (Output_section::restore_states): Adjust type of checkpoint .
6786 Invalidate relaxed input section map.
6787 * output.h (Output_merge_base): New class declaration.
6788 (Input_section_specifier): New class defintion.
6789 (class Output_relaxed_input_section) Change base class to
6790 Output_section_data_build.
6791 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
6792 base class initializer.
6793 (Output_section::add_relaxed_input_section): New method declaration.
6794 (Output_section::Input_section): Change visibility to protected.
6795 (Output_section::Input_section::relobj,
6796 Output_section::Input_section::shndx): Handle relaxed input sections.
6797 Output_section::input_sections) Change visibility to protected. Also
6798 define overload to return a non-const pointer.
6799 (Output_section::Merge_section_properties): New class defintion.
6800 (Output_section::Merge_section_by_properties_map,
6801 Output_section::Output_section_data_by_input_section_map,
6802 Output_section::Relaxation_map): New types.
6803 (Output_section::relax_input_section): Rename method to
6804 Output_section::convert_input_sections_to_relaxed_sections and change
6805 interface to take a vector of relaxed section pointers.
6806 (Output_section::find_merge_section,
6807 Output_section::find_relaxed_input_section,
6808 Output_section::build_relaxation_map,
6809 Output_section::convert_input_sections_in_list_to_relaxed_sections):
6810 New method declarations.
6811 (Output_section::merge_section_map_
6812 Output_section::merge_section_by_properties_map_,
6813 Output_section::relaxed_input_section_map_,
6814 Output_section::is_relaxed_input_section_map_valid_,
6815 Output_section::generate_code_fills_at_write_): New data members.
6816 * script-sections.cc
6817 (Output_section_element_input::set_section_addresses): Call
6818 current_data_size and addralign methods of relaxed input sections.
6819 (Orphan_output_section::set_section_addresses): Call current_data_size
6820 and addralign methods of relaxed input sections.
6821 * symtab.cc (Symbol_table::compute_final_value): Extract template
6822 from the body of Symbol_table::sized_finalize_symbol.
6823 (Symbol_table::sized_finalized_symbol): Call
6824 Symbol_table::compute_final_value.
6825 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
6826 (Symbol_table::compute_final_value): New templated method declaration.
6827 * target.cc (Target::do_make_output_section): New method defintion.
6828 * target.h (Target::make_output_section): New method declaration.
6829 (Target::relax): Add more parameters for input objects, symbol table
6830 and layout. Adjust call to do_relax.
6831 (Target::do_make_output_section): New method declaration.
6832 (Target::do_relax): Add parameters for input objects, symbol table
6833 and layout.
6834
d446d6c4
ILT
68352009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6836
6837 * pread.c: Include stdio.h.
6838
bc06c745
ILT
68392009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6840
6841 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
6842 defined.
6843
75aea3d0
ILT
68442009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
6845
6846 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
6847 Change read_shndx type to unsigned int.
6848 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6849 int.
6850 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6851 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
6852 Change read_shndx type to unsigned int.
6853 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
6854 int.
6855 (Sized_dwarf_line_info::read_line_mappings): Likewise.
6856 * layout.cc (Layout::create_symtab_sections): Cast the result of
6857 local_symcount * symsize to off_t in the gold_assert.
6858
be8fcb75
ILT
68592009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6860
6861 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
6862 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
6863 R_ARM_BASE_ABS.
6864 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
6865 (Arm_relocate_functions::thm_abs5): New function.
6866 (Arm_relocate_functions::abs12): New function.
6867 (Arm_relocate_functions::abs16): New function.
6868 (Arm_relocate_functions::base_abs): New function.
6869 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
6870 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
6871 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
6872 R_ARM_BASE_ABS.
6873 (Scan::global): Likewise.
6874 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
6875 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
6876 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
6877 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
6878 R_ARM_BASE_ABS.
6879
c2a122b6
ILT
68802009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6881
6882 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
6883 (Arm_relocate_functions::movt_prel): New function.
6884 (Arm_relocate_functions::thm_movw_prel_nc): New function.
6885 (Arm_relocate_functions::thm_movt_prel): New function.
6886 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
6887 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
6888 (Scan::global, Relocate::relocate): Likewise.
6889 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6890
c4aa1e2d
ILT
68912009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6892
6893 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
6894 Incremental_checker.
6895 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
6896 unsigned int.
6897 (class Incremental_inputs_header): New class.
6898 (Incremental_inputs_header_writer): Edit comment.
6899 (Incremental_inputs_entry): New class.
6900 (Incremental_inputs_entry_writer): Edit comment.
6901 (Sized_incremental_binary::do_find_incremental_inputs_section):
6902 Add *strtab_shndx parameter, fill it.
6903 (Sized_incremental_binary::do_check_inputs): New method.
6904 (Incremental_checker::can_incrementally_link_output_file): Use
6905 Sized_incremental_binary::check_inputs.
6906 (Incremental_inputs::report_command_line): Save command line in
6907 command_line_.
6908 * incremental.h:
6909 (Incremental_binary::find_incremental_inputs_section): New
6910 method.
6911 (Incremental_binary::do_find_incremental_inputs_section): Add
6912 strtab_shndx parameter.
6913 (Incremental_binary::do_check_inputs): New pure virtual method.
6914 (Sized_incremental_binary::do_check_inputs): Declare.
6915 (Incremental_checker::Incremental_checker): Add incremental_inputs
6916 parameter, use it to initialize incremental_inputs_.
6917 (Incremental_checker::incremental_inputs_): New field.
6918 (Incremental_checker::command_line): New method.
6919 (Incremental_checker::inputs): New method.
6920 (Incremental_checker::command_line_): New field.
6921
c549a694
ILT
69222009-10-09 Mikolaj Zalewski <mikolajz@google.com>
6923
6924 * incremental.cc: Include <cstdarg> and "target-select.h".
6925 (vexplain_no_incremental): New function.
6926 (explain_no_incremental): New function.
6927 (Incremental_binary::error): New method.
6928 (Sized_incremental_binary::do_find_incremental_inputs_section): New
6929 method.
6930 (make_sized_incremental_binary): New function.
6931 (open_incremental_binary): New function.
6932 (can_incrementally_link_file): Add checks if output is ELF and has
6933 inputs section.
6934 * incremental.h: Include "elfcpp_file.h" and "output.h".
6935 (Incremental_binary): New class.
6936 (Sized_incremental_binary): New class.
6937 (open_incremental_binary): Declare.
6938 * object.cc (is_elf_object): Use
6939 elfcpp::Elf_recognizer::is_elf_file.
6940 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
6941 * output.h (Output_file::filesize): New method.
6942
fd3c5f0b
ILT
69432009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6944
6945 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
6946 New function.
6947 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
6948 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
6949 function.
6950 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
6951 function.
6952 (Arm_relocate_functions::movw_abs_nc): New function.
6953 (Arm_relocate_functions::movt_abs): New function.
6954 (Arm_relocate_functions::thm_movw_abs_nc): New function.
6955 (Arm_relocate_functions::thm_movt_abs): New function.
6956 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
6957 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
6958 (Scan::global): Likewise.
6959 (Relocate::relocate): Likewise.
6960 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6961
7f5309a5
ILT
69622009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
6963
6964 * arm.cc (Arm_relocate_functions::got_prel) New function.
6965 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
6966 (Relocate::relocate): Likewise.
6967 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
6968
364c7fa5
ILT
69692009-10-06 Ian Lance Taylor <iant@google.com>
6970
6971 * options.h (class General_options): Define
6972 split_stack_adjust_size parameter.
6973 * object.h (class Object): Add uses_split_stack_ and
6974 has_no_split_stack_ fields. Add uses_split_stack and
6975 has_no_split_stack accessor functions. Declare
6976 handle_split_stack_section.
6977 (class Reloc_symbol_changes): Define.
6978 (class Sized_relobj): Define Function_offsets. Declare
6979 split_stack_adjust, split_stack_adjust_reltype, and
6980 find_functions.
6981 * object.cc (Object::handle_split_stack_section): New function.
6982 (Sized_relobj::do_layout): Call handle_split_stack_section.
6983 * dynobj.cc (Sized_dynobj::do_layout): Call
6984 handle_split_stack_section.
6985 * reloc.cc (Sized_relobj::relocate_sections): Call
6986 split_stack_adjust for executable sections in split_stack
6987 objects. Pass reloc_map to relocate_section.
6988 (Sized_relobj::split_stack_adjust): New function.
6989 (Sized_relobj::split_stack_adjust_reltype): New function.
6990 (Sized_relobj::find_functions): New function.
6991 * target-reloc.h: Include "object.h".
6992 (relocate_section): Add reloc_symbol_changes parameter. Change
6993 all callers.
6994 * target.h (class Target): Add calls_non_split method. Declare
6995 do_calls_non_split virtual method. Declare match_view and
6996 set_view_to_nop.
6997 * target.cc: Include "elfcpp.h".
6998 (Target::do_calls_non_split): New function.
6999 (Target::match_view): New function.
7000 (Target::set_view_to_nop): New function.
7001 * gold.cc (queue_middle_tasks): Give an error if mixing
7002 split-stack and non-split-stack objects with -r.
7003 * i386.cc (Target_i386::relocate_section): Add
7004 reloc_symbol_changes parameter.
7005 (Target_i386::do_calls_non_split): New function.
7006 * x86_64.cc (Target_x86_64::relocate_section): Add
7007 reloc_symbol_changes parameter.
7008 (Target_x86_64::do_calls_non_split): New function.
7009 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
7010 parameter.
7011 * powerpc.cc (Target_powerpc::relocate_section): Add
7012 reloc_symbol_changes parameter.
7013 * sparc.cc (Target_sparc::relocate_section): Add
7014 reloc_symbol_changes parameter.
7015 * configure.ac: Call AM_CONDITIONAL for the default target.
7016 * configure: Rebuild.
7017 * testsuite/Makefile.am (TEST_AS): New variable.
7018 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
7019 (check_DATA): Add split_i386 and split_x86_64 files.
7020 (SPLIT_DEFSYMS): Define.
7021 (split_i386_[1234n].o): New targets.
7022 (split_i386_[124]): New targets.
7023 (split_i386_[1234r].stdout): New targets.
7024 (split_x86_64_[1234n].o): New targets.
7025 (split_x86_64_[124]): New targets.
7026 (split_x86_64_[1234r].stdout): New targets.
7027 (MOSTLYCLEANFILES): Add new executables.
7028 * testsuite/split_i386.sh: New file.
7029 * testsuite/split_x86_64.sh: New file.
7030 * testsuite/split_i386_1.s: New file.
7031 * testsuite/split_i386_2.s: New file.
7032 * testsuite/split_i386_3.s: New file.
7033 * testsuite/split_i386_4.s: New file.
7034 * testsuite/split_i386_n.s: New file.
7035 * testsuite/split_x86_64_1.s: New file.
7036 * testsuite/split_x86_64_2.s: New file.
7037 * testsuite/split_x86_64_3.s: New file.
7038 * testsuite/split_x86_64_4.s: New file.
7039 * testsuite/split_x86_64_n.s: New file.
7040 * testsuite/testfile.cc (Target_test): Update relocation_section
7041 function.
7042 * testsuite/Makefile.in: Rebuild.
7043
e8a9fcda
ILT
70442009-10-06 Ian Lance Taylor <iant@google.com>
7045
7046 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
7047 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
7048 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
7049 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
7050 the address on ldo_addrs_.
7051 (Target_i386::Relocate::fix_up_ldo): New function.
7052
e99daf92
ILT
70532009-10-06 Rafael Espindola <espindola@google.com>
7054
7055 * plugin.cc (add_input_library): New.
7056 (Plugin::load): Add add_input_library to tv.
7057 (Plugin_manager::add_input_file): Add the is_lib argument.
7058 (add_input_file): Update call to Plugin_manager::add_input_file.
7059 (add_input_library): New.
7060 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
7061
966d4097
DK
70622009-09-30 Doug Kwan <dougkwan@google.com>
7063
7064 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
7065 symbol and call Symbol::may_need_copy_reloc to determine if
7066 a copy reloc is needed.
7067 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
7068 nocopyreloc is given in command line.
7069 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
7070 given in command line.
7071 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
7072 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
7073 of the removed Target_i386::may_need_copy_reloc.
7074 * options.h (copyreloc): New option with default value false.
7075 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7076 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
7077 instead of the removed Target_powerpc::may_need_copy_reloc.
7078 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
7079 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
7080 instead of the removed Target_sparc::may_need_copy_reloc.
7081 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
7082 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
7083 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
7084 instead of the removed Target_x86_64::may_need_copy_reloc.
7085
029ba973
ILT
70862009-09-30 Ian Lance Taylor <iant@google.com>
7087
7088 * object.h (class Object): Remove target_ field, and target,
7089 sized_target, and set_target methods.
7090 (Object::sized_target): Remove.
7091 (class Sized_relobj): Update declarations. Remove sized_target.
7092 * object.cc (Sized_relobj::setup): Remove target parameter.
7093 Change all callers.
7094 (Input_objects::add_object): Don't do anything with the target.
7095 (make_elf_sized_object): Add punconfigured parameter. Change all
7096 callers. Set or test parameter target.
7097 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
7098 Change all callers.
7099 * parameters.cc (Parameters::set_target): Change parameter type to
7100 be non-const.
7101 (Parameters::default_target): Remove.
7102 (set_parameters_target): Change parameter type to be non-const.
7103 (parameters_force_valid_target): New function.
7104 (parameters_clear_target): New function.
7105 * parameters.h (class Parameters): Update declarations. Remove
7106 default_target method. Add sized_target and clear_target
7107 methods. Change target_ to be non-const.
7108 (set_parameters_target): Update declaration.
7109 (parameters_force_valid_target): Declare.
7110 (parameters_clear_target): Declare.
7111 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
7112 as NULL if we aren't searching.
7113 (Add_symbols::run): Don't check for compatible target.
7114 * fileread.cc (Input_file::open_binary): Call
7115 parameters_force_valid_target.
7116 * gold.cc (queue_middle_tasks): Likewise.
7117 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
7118 set_target on object.
7119 * dynobj.h (class Sized_dynobj): Update declarations.
7120 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
7121 make_elf_object returns NULL.
7122 (Archive::include_member): Don't check whether object target is
7123 compatible.
7124 * output.cc (Output_section::add_input_section): Get target from
7125 parameters.
7126 (Output_section::relax_input_section): Likewise.
7127 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
7128 parameters.
7129 (Sized_relobj::do_scan_relocs): Likewise.
7130 (Sized_relobj::relocate_sections): Likewise.
7131 * resolve.cc (Symbol_table::resolve): Likewise.
7132 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
7133 parameter. Change all callers.
7134 (Symbol_table::add_from_object): Get target from parameters.
7135 (Symbol_table::add_from_relobj): Don't check object target.
7136 (Symbol_table::add_from_dynobj): Likewise.
7137 (Symbol_table::define_special_symbol): Get target from
7138 parameters.
7139 * symtab.h (class Symbol_table): Update declaration.
7140 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
7141 parameter. Change all callers. Clear parameter target.
7142 (Binary_test): Test target here.
7143 * testsuite/object_unittest.cc (gold_testsuite): Remove
7144 target_test_pointer parameter. Change all callers.
7145 (Object_test): Test target here.
7146
a6a22b83
ILT
71472009-09-26 Ian Lance Taylor <iant@google.com>
7148
7149 * testsuite/initpri1.c: Don't try to use constructor priorities if
7150 compiling with gcc before 4.3.
7151
6a8f49fe
ILT
71522009-09-22 Mikolaj Zalewski <mikolajz@google.com>
7153
7154 * testsuite/retain_symbols_file_test.sh (check_present): Change
7155 output file name to retain_symbols_file_test.stdout.
7156 (check_absent): Likewise.
7157
8c604651
CS
71582009-09-18 Craig Silverstein <csilvers@google.com>
7159
7160 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
7161 * options.cc: Include <cerrno> and <fstream>.
7162 (General_options::finalize): Parse -retain-symbols-file tag.
7163 * options.h: New flag.
7164 (General_options): New method should_retain_symbol, new
7165 variable symbols_to_retain.
7166 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
7167 should_retain_symbol map.
7168 * testsuite/Makefile.am (retain_symbols_file_test): New test.
7169 * testsuite/Makefile.in: Regenerate.
7170 * testsuite/retain_symbols_file_test.sh: New file.
7171
ca58b19f
NC
71722009-09-18 Nick Clifton <nickc@redhat.com>
7173
7174 * po/es.po: Updated Spanish translation.
7175
20e6d0d6
DK
71762009-09-17 Doug Kwan <dougkwan@google.com>
7177
7178 * debug.h (DEBUG_RELAXATION): New constant.
7179 (DEBUG_ALL): Add DEBUG_RELAXATION.
7180 (debug_string_to_enum): Add relaxation debug option.
7181 * layout.cc
7182 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
7183 Layout::Relaxation_debug_check::read_sections,
7184 Layout::Relaxation_debug_check::read_sections): New method definitions.
7185 (Layout::Layout): Initialize data members
7186 record_output_section_data_from_scrips_,
7187 script_output_section_data_list_ and relaxation_debug_check_.
7188 (Layout::save_segments, Layout::restore_segments,
7189 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7190 Layout::relaxation_loop_body): New method definitions.
7191 (Layout::finalize): Support relaxation. Move section layout code to
7192 Layout::relaxation_loop_body.
7193 (Layout::set_asection_address_from_script): Move code for orphan
7194 section placement out.
7195 (Layout::place_orphan_sections_in_script): New method definition.
7196 * layout.h (Output_segment_headers, Output_file_header):
7197 New forward class declarations.
7198 (Layout::~Layout): Define.
7199 (Layout::new_output_section_data_from_script): New method definition.
7200 (Layout::place_orphan_sections_in_script): New method declaration.
7201 (Layout::Segment_states): New type declaration.
7202 (Layout::save_segments, Layout::restore_segments,
7203 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
7204 Layout::relaxation_loop_body): New method declarations.
7205 (Layout::Output_section_data_list): New type declaration.
7206 (Layout::Relaxation_debug_check): New class definition.
7207 (Layout::record_output_section_data_from_script_,
7208 Layout::script_output_section_data_list_, Layout::segment_states_,
7209 Layout::relaxation_debug_check_): New data members.
7210 * output.cc: (Output_section_headers::do_size): New method definition.
7211 (Output_section_headers::Output_section_headers): Move size
7212 computation to Output_section_headers::do_size.
7213 (Output_segment_headers::do_size): New method definition.
e1df38aa 7214 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
7215 Output_file_header::do_size and call it.
7216 (Output_file_header::do_size): New method definition.
7217 (Output_data_group::Output_data_group): Adjust call to
7218 Output_section_data.
7219 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
7220 (Output_symtab_xindex::do_write): Add array bound check.
7221 (Output_section::Input_section::print_to_mapfile): Handle
7222 RELAXED_INPUT_SECTION_CODE.
7223 (Output_section::Output_section): Initialize data member checkpoint_.
7224 (Output_section::~Output_section): Delete checkpoint object pointed
7225 by checkpoint_.
7226 (Output_section::add_input_section): Always add an Input_section if
7227 relaxing.
7228 (Output_section::add_merge_input_section): Add assert.
7229 (Output_section::relax_input_section): New method definition.
7230 (Output_section::set_final_data_size): Set load address to zero for
7231 an unallocated section.
7232 (Output_section::do_address_and_file_offset_have_reset_values):
7233 New method definition.
7234 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
7235 Handle relaxed input section.
7236 (Output_section::sort_attached_input_sections): Checkpoint input
7237 section list lazily.
7238 (Output_section::get_input_sections): Change type of input_sections to
7239 list of Simple_input_section pointers. Checkpoint input section list
7240 lazily. Also handle relaxed input sections.
7241 (Output_section::add_input_section_for_script): Take a reference to
7242 a Simple_input_section object instead of Relobj pointer and section
7243 index as parameter. Handle relaxed input sections.
7244 (Output_section::save_states, Output_section::restore_states): New
7245 method definitions.
7246 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
7247 (Output_data::is_data_size_fixed): New method definition.
7248 (Output_data::reset_addresss_and_file_offset): Do not reset data size
7249 if it is fixed.
7250 (Output_data::address_and_file_offset_have_reset_values): New method
7251 definition.
7252 (Output_data::do_address_and_file_offset_have_reset_values): New method
7253 definition.
7254 (Output_data::set_data_size): Check that data size is not fixed.
7255 (Output_data::fix_data_size): New method definition.
7256 (Output_data::is_data_size_fixed_): New data member.
7257 (Output_section_headers::set_final_data_size): New method definition.
7258 (Output_section_headers::do_size): New method declaration.
7259 (Output_segment_headers::set_final_data_size): New method definition.
7260 (Output_segment_headers::do_size): New method declaration.
7261 (Output_file_header::set_final_data_size)::New method definition.
7262 (Output_file_header::do_size)::New method declaration.
7263 (Output_section_data::Output_section_data): Add new parameter
7264 is_data_size_fixed and use it to fix data size.
7265 (Output_data_const::Output_data_const): Adjust call to base class
7266 constructor and fix data size.
7267 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
7268 base class constructor and fix data size.
7269 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
7270 base class constructor and fix data size.
7271 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
7272 class constructor and fix data size.
7273 (Output_data_group::set_final_data_size): New method definition.
7274 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
7275 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
7276 class constructor and fix data size.
7277 (Output_relaxed_input_section): New class definition.
7278 (Output_section::Simple_input_section): New class definition.
7279 (Output_section::get_input_sections): Adjust parameter list.
7280 (Output_section::add_input_section_for_script): Same.
7281 (Output_section::save_states, Output_section::restore_states,
7282 Output_section::do_address_and_file_offset_have_reset_values,
7283 (Output_section::Input_section::Input_section): Handle
7284 RELAXED_INPUT_SECTION_CODE. Add new overload for
7285 Output_relaxed_input_section.
7286 (Output_section::Input_section::is_input_section,
7287 Output_section::Input_section::set_output_section): Handle relaxed
7288 input section.
7289 (Output_section::Input_section::is_relaxed_input_section,
7290 Output_section::Input_section::output_section_data,
7291 Output_section::Input_section::relaxed_input_section): New method
7292 definitions.
7293 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
7294 value.
7295 (Output_section::Input_section::u1_): Update comments.
7296 (Output_section::Input_section::u2_): Add new union member poris.
7297 (Output_section::Checkpoint_output_section): New classs definition.
7298 (Output_section::relax_input_section): New method declaration.
7299 (Output_section::checkpoint_): New data member.
7300 (Output_segment): Update comments.
7301 (Output_segment::Output_segment): Un-privatize copy constructor.
7302 (Output_segment::operator=): Un-privatize.
7303 * script-sections.cc (Output_section_element::Input_section_list):
7304 Change element type to Output_section::Simple_input_section.
7305 (Output_section_element_dot_assignment::set_section_addresses):
7306 Register output section data for relaxation clean up.
7307 (Output_data_exression::Output_data_expression): Adjust call to base
7308 constructor to fix data size.
7309 (Output_section_element_data::set_section_addresses): Register
7310 Output_data_expression object for relaxation clean up.
7311 (struct Input_section_info): Replace Relobj pointer and section index
7312 pair with Output_section::Simple_input_section and Convert struct to a
7313 class.
7314 (Input_section_sorter::operator()): Adjust access to
e1df38aa 7315 Input_section_info data member to use accessors.
20e6d0d6
DK
7316 (Output_section_element_input::set_section_addresses): Use layout
7317 parameter. Adjust code to use Output_section::Simple_input_section
7318 and Input_secction_info classes. Register filler for relaxation
7319 clean up.
7320 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
7321 and section index pair with Output_section::Simple_input_section
7322 class. Adjust code accordingly.
7323 (Phdrs_element::release_segment): New method definition.
7324 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
7325 segment list.
7326 (Script_sections::release_segments): New method definition.
7327 * gold/script-sections.h (Script_sections::release_segments): New
7328 method declaration.
7329 * gold/target.h (Target::may_relax, Target::relax,
7330 Target::do_may_relax, Target::do_relax): New method definitions.
7331
5e445df6
ILT
73322009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
7333
7334 * arm.cc (has_signed_unsigned_overflow): New function.
7335 (Arm_relocate_functions::abs8): New function.
7336 (Target_arm::Scan::local): Handle R_ARM_ABS8.
7337 (Target_arm::Scan::global): Likewise.
7338 (Target_arm::relocate::relocate): Likewise.
7339 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
7340 Likewise.
7341
8c604651 73422009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
7343
7344 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
7345 * testsuite/Makefile.in: Regenerate.
7346
1e9cc1c2
NC
73472009-09-11 Nick Clifton <nickc@redhat.com>
7348
7349 * po/gold.pot: Updated by the Translation project.
7350
6a89f575
CC
73512009-09-08 Cary Coutant <ccoutant@google.com>
7352
7353 * output.cc (Output_file::open): Add execute permission to empty file.
7354 * testsuite/Makefile.am (permission_test): New test.
7355 * testsuite/Makefile.in: Regenerate.
7356
fdcac5af
ILT
73572009-09-02 Ian Lance Taylor <iant@google.com>
7358
7359 * output.cc (Output_file::resize): Call map_no_anonymous rather
7360 than map.
7361
44453f85
ILT
73622009-09-01 Mikolaj Zalewski <mikolajz@google.com>
7363
7364 * gold.cc: Include "incremental.h".
7365 (queue_initial_tasks): Call Incremental_checker methods.
7366 * incremental.cc: Include "output.h".
7367 (Incremental_checker::can_incrementally_link_output_file): New
7368 method.
7369 * incremental.h (Incremental_checker): New class.
7370
7371 * output.cc (Output_file::open_for_modification): New method.
7372 (Output_file::map_anonymous): Changed return type to bool. Record
7373 map in base_ field.
7374 (Output_file::map_no_anonymous): New method, broken out of map.
7375 (Output_file::map): Use map_no_anonymous and map_anonymous.
7376 * output.h (class Output_file): Update declarations.
7377
293c1386
CC
73782009-08-24 Cary Coutant <ccoutant@google.com>
7379
7380 * options.h (Command_line::Pre_options): New class.
7381 (Command_line::pre_options): New member.
7382 * options.cc (gold::options::ready_to_register): New variable.
7383 (One_option::register_option): Do nothing if not registering options.
7384 Assert if same short option registered twice.
7385 (General_options::General_options): Turn off option registration when
7386 done constructing.
7387 (Command_line::Pre_options::Pre_options): New constructor.
7388
f773f3d2
CC
73892009-08-24 Cary Coutant <ccoutant@google.com>
7390
06a73cfe
CC
7391 * options.h (General_options::no_keep_memory): Remove incorrect
7392 short option.
f773f3d2 7393
a15af8e2
RW
73942009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7395
7396 * Makefile.am (am__skiplex, am__skipyacc): New.
7397 * Makefile.in: Regenerate.
7398
c462b41b
RW
73992009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
7400
14ec8efd
RW
7401 * Makefile.am (AM_CPPFLAGS): Renamed from ...
7402 (INCLUDES): ... this.
7403 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
7404 (AM_CPPFLAGS): Renamed from ...
7405 (INCLUDE): ... this.
7406 * Makefile.in, testsuite/Makefile.in: Regenerate.
7407
81ecdfbb
RW
7408 * Makefile.in: Regenerate.
7409 * aclocal.m4: Likewise.
7410 * config.in: Likewise.
7411 * configure: Likewise.
7412 * testsuite/Makefile.in: Likewise.
7413
c462b41b
RW
7414 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7415 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
7416 * Makefile.in: Regenerate.
7417 * testsuite/Makefile.in: Regenerate.
7418
2da73f13
CC
74192009-08-19 Cary Coutant <ccoutant@google.com>
7420
7421 * resolve.cc (Symbol_table::resolve): Don't complain about defined
7422 symbols in shared libraries overridden by hidden or internal symbols
7423 in the main program.
7424
2db70501
CD
74252009-08-19 Chris Demetriou <cgd@google.com>
7426
7427 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
7428 checking source file names in error messages.
7429
f733487b
DK
74302009-08-18 Doug Kwan <dougkwan@google.com>
7431
7432 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
7433 an elcpp::Ehdr as parameter. Adjust call to set_target.
7434 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
7435 an elfcpp::Ehdr as parameter.
7436 * object.cc (Object::set_target): Remove the version that looks up
7437 a target and sets it.
7438 (Sized_relobj::setup): Take a Target object instead of
7439 an elfcpp::Ehdr as parameter. Adjust call to set_target.
7440 (make_elf_sized_object): Find target and ask target to
7441 make an ELF object.
7442 * object.h: (Object::set_target): Remove the version that looks up
7443 a target and sets it.
7444 (Sized_relobj::setup): Take a Target object instead of
7445 an elfcpp:Ehdr as parameter.
7446 * target.cc: Include dynobj.h.
7447 (Target::do_make_elf_object_implementation): New.
7448 (Target::do_make_elf_object): New.
7449 * target.h (Target::make_elf_object): New template declaration.
7450 (Target::do_make_elf_object): New method declarations.
7451 (Target::do_make_elf_object_implementation): New template declaration.
7452
cc70f101
ILT
74532009-08-14 Ian Lance Taylor <iant@google.com>
7454
7455 * gold.h (FUNCTION_NAME): Define.
7456 (gold_unreachable): Use FUNCTION_NAME.
7457
ef5e0cb1
ST
74582009-08-12 Sriraman Tallam <tmsriram@google.com>
7459
7460 * icf.cc (Icf::find_identical_sections): Issue a warning when a
7461 symbol in the --keep-unique list is not found.
7462
48c187ce
ST
74632009-08-12 Sriraman Tallam <tmsriram@google.com>
7464
7465 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
7466 been maked as --keep-unique.
7467 (Icf::unfold_section): New function.
7468 * icf.h (Icf::unfold_section): New function.
7469 * options.h (General_options::keep_unique): New option.
7470 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
7471 * testsuite/Makefile.in: Regenerate.
7472 * testsuite/icf_keep_unique_test.sh: New file.
7473 * testsuite/icf_keep_unique_test.cc: New file.
7474
645afe0c
CC
74752009-08-12 Cary Coutant <ccoutant@google.com>
7476
7477 PR 10471
7478 * resolve.cc (Symbol_table::resolve): Check for references from
7479 dynamic objects to hidden and internal symbols.
7480 * testsuite/Makefile.am (hidden_test.sh): New test.
7481 * testsuite/Makefile.in: Regenerate.
7482 * testsuite/hidden_test.sh: New script.
7483 * testsuite/hidden_test_1.c: New test source.
7484 * testsuite/hidden_test_main.c: New test source.
7485
11af873f
DK
74862009-08-11 Doug Kwan <dougkwan@google.com>
7487
7488 * arm.cc: Update comments.
7489 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
7490 segment to locate the .ARM.exidx section if present.
7491
b9f7d72d
DK
74922009-08-09 Doug Kwan <dougkwan@google.com>
7493
7494 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
7495 patch.
7496
ddd3c53c
ST
74972009-08-07 Sriraman Tallam <tmsriram@google.com>
7498 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
7499 compiler warnings.
7500
27721062
ST
75012009-08-06 Sriraman Tallam <tmsriram@google.com>
7502
7503 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
7504 valid tls_segment only for non-debug-section relocations.
7505 * testsuite/Makefile.am: Add gc_tls_test.
7506 * testsuite/Makefile.in: Regenerate.
7507 * testsuite/gc_tls_test.cc: New file.
7508 * testsuite/gc_tls_test.sh: New file.
7509
ef15dade 75102009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 7511
ef15dade
ST
7512 * icf.cc: New file.
7513 * icf.h: New file.
7514 * Makefile.am (CCFILES): Add icf.cc.
7515 (HFILES): Add icf.h
7516 * Makefile.in: Regenerate.
7517 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
7518 * gc.h (gc_process_relocs): Populate lists used by icf to contain
7519 section, symbol and addend information for the relocs.
7520 * gold.cc (queue_middle_tasks): Call identical code folding.
7521 * gold.h: Add defines for multimap.
7522 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
7523 to the call of finalize_local_symbols.
7524 * main.cc (main): Create object of class Icf.
7525 * object.cc (Sized_relobj::do_layout): Allow this function to be
7526 called twice during icf.
7527 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
7528 to sections marked as identical by icf.
7529 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
7530 when available.
7531 (Sized_relobj::do_section_entsize): New function.
7532 * object.h (Object::section_entsize): New function.
7533 (Object::do_section_entsize): New pure virtual function.
7534 (Relobj::finalize_local_symbols): Add new parameter.
7535 (Relobj::do_section_entsize): New function.
7536 * options.h (General_options::icf): New option.
7537 (General_options::icf_iterations): New option.
7538 (General_options::print_icf_sections): New option.
7539 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
7540 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
7541 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
7542 icf.
7543 * symtab.cc (Symbol_table::is_section_folded): New function.
7544 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
7545 to sections marked as identical by icf.
7546 * symtab.h (Symbol_table::set_icf): New function.
7547 (Symbol_table::icf): New function.
7548 (Symbol_table::is_section_folded): New function.
7549 (Symbol_table::icf_): New data member.
7550 * target-reloc.h (relocate_section): Ignore sections folded by icf.
7551 * testsuite/Makefile.am: Add commands to build icf_test.
7552 * testsuite/Makefile.in: Regenerate.
7553 * testsuite/icf_test.sh: New file.
7554 * testsuite/icf_test.cc: New file.
7555
c3b65ac4
CD
75562009-07-24 Chris Demetriou <cgd@google.com>
7557
7558 * layout.cc (is_compressible_debug_section): Fix incorrect
7559 comment about compressed section names.
7560
1caf2c51
ILT
75612009-07-20 Ian Lance Taylor <ian@airs.com>
7562
7563 PR 10419
7564 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
7565
1ef4d87f
ILT
75662009-07-16 Ian Lance Taylor <iant@google.com>
7567
7568 PR 10400
7569 * layout.h: #include <map>.
7570 (class Kept_section): Change from struct to class. Add accessors
7571 and setters. Add section size to Comdat_group mapping. Change
7572 Comdat_group to std::map. Add is_comdat_ field. Add
7573 linkonce_size field in union.
7574 (class Layout): Update declaration of find_or_add_kept_section.
7575 Don't declare find_kept_object.
7576 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
7577 parameter. Add object, shndx, is_comdat, and is_group_name
7578 parameters. Change all callers. Adjust for new Kept_section.
7579 (Layout::find_kept_object): Remove.
7580 * object.cc (Sized_relobj::include_section_group): Update use of
7581 Kept_section. Rename secnum to shndx. Only record
7582 Kept_comdat_section if sections are the same size.
7583 (Sized_relobj::include_linkonce_section): Update use of
7584 Kept_section. Only record Kept_comdat_section if sections are the
7585 same size. Set size of linkonce section.
7586 (Sized_relobj::map_to_kept_section): Update call to
7587 get_kept_comdat_section.
7588 * object.h (class Sized_relobj): Rename fields in
7589 Kept_comdat_section to drop trailing underscores; change object
7590 field to Relobj*. Change Kept_comdat_section_table to store
7591 struct rather than pointer.
7592 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
7593 Add kept_object and kept_shndx parameters. Change all callers.
7594 (Sized_relobj::get_kept_comdat_section): Change return type to
7595 bool. Add kept_object and kept_shndx parameters. Change all
7596 callers.
7597 * plugin.cc (Pluginobj::include_comdat_group): Update call to
7598 Layout::find_or_add_kept_section.
7599
37c3b7b0
ILT
76002009-07-09 Ian Lance Taylor <iant@google.com>
7601
7602 * merge.cc (Object_merge_map::initialize_input_to_output_map):
7603 Reserve space in the hash table.
7604
98fa85cb
ILT
76052009-07-06 Mikolaj Zalewski <mikolajz@google.com>
7606
7607 * fileread.cc (File_read::get_mtime): New method.
7608 * fileread.h (Timespec): New structure.
7609 (File_read::get_mtime): New method.
7610 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
7611 Renamed from timestamp_nsec.
7612 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
7613 Elf_Xword.
e1df38aa 7614 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 7615 timestamp_nsec.
e1df38aa 7616 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
7617 (Incremental_inputs::report_obejct): Save mtime; style fix.
7618 (Incremental_inputs::report_script): Save mtime; style fix.
7619 (Incremental_inputs::finalize_inputs): Style fix.
7620 (Incremental_inputs::finalize): Style fix.
7621 (Incremental_inputs::create_input_section_data): Store inputs
7622 mtime.
7623 * incremental.h (Incremental_inputs::report_script): Add mtime
7624 argument.
7625 (Incremental_inputs::Input_info::Input_info): Intialize only one
7626 union member.
7627 (Incremental_inputs::Input_info::archive): Move to nameless
7628 union.
7629 (Incremental_inputs::Input_info::obejct): Move to nameless union.
7630 (Incremental_inputs::Input_info::script): Move to nameless union.
7631 (Incremental_inputs::mtime): New field.
7632 * script.cc (read_input_script): Pass file mtime to
7633 Incremental_input.
7634 * script.h (Script_info::inputs): Style fix.
7635
c9d70757
ILT
76362009-07-01 Ian Lance Taylor <ian@airs.com>
7637
7638 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
7639 instead of 32.
7640
9c547ec3
ILT
76412009-06-24 Ian Lance Taylor <iant@google.com>
7642
7643 PR 10156
7644 * layout.cc (Layout::choose_output_section): If we find an
7645 existing section, update the flags.
7646 (Layout::create_notes): New function, broken out of
7647 Layout::finalize.
7648 (Layout::finalize): Don't create note sections.
7649 (Layout::create_note): Don't crash if linker script discards
7650 section.
7651 (Layout::create_gold_note): Likewise.
7652 (Layout::create_build_id): Likewise. Don't set
7653 after_input_sections on the section.
7654 (Layout::create_executable_stack_info): Remove target parameter.
7655 Change caller.
7656 * layout.h (class Layout): Declare create_notes. Update
7657 declaration of create_executable_stack_info.
7658 * gold.cc (queue_middle_tasks): Call create_notes.
7659 * output.cc (Output_section::update_flags_for_input_section): Move
7660 here from output.h. If SHF_ALLOC flag is newly set, mark address
7661 invalid.
7662 * output.h (Output_data::mark_address_invalid): New function.
7663 (class Output_section): Only declare, not define,
7664 update_flags_for_input_section. Remove set_flags.
7665
55458500
ILT
76662009-06-24 Ian Lance Taylor <iant@google.com>
7667
7668 * script-sections.cc (Output_section_definition::
7669 set_section_addresses): Rename shadowing local load_address to
7670 laddr.
7671
1307d6cd
ILT
76722009-06-24 Ian Lance Taylor <iant@google.com>
7673
7674 PR 10244
7675 * reloc.cc (relocate_sections): Skip empty relocation sections.
7676
ec3f783e
ILT
76772009-06-23 Ian Lance Taylor <iant@google.com>
7678
7679 PR 10156
7680 * layout.cc (Layout::create_note): Use choose_output_section
7681 rather than make_output_section.
7682
459c9f1c
ILT
76832009-06-23 Ian Lance Taylor <iant@google.com>
7684
7685 PR 10237
7686 * options.cc (General_options::parse_V): Set printed_version_.
7687 (General_options::General_options): Initialize printed_version_.
7688 * options.h (class General_options): Add printed_version_ field.
7689 * gold.cc (queue_initial_tasks): If there are no input files,
7690 don't give a fatal error if we printed the version information.
7691 (queue_middle_tasks): If using -r with a shared object, give a
7692 fatal error rather than an ordinary error.
7693
1518dc8f
ILT
76942009-06-23 Ian Lance Taylor <iant@google.com>
7695
7696 PR 10219
7697 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
7698 (Layout::make_output_section): Set have_stabstr_section_ if we see
7699 a .stab*str section.
7700 (Layout::finalize): Call link_stabs_sections.
7701 (Layout::link_stabs_sections): New file.
7702 * layout.h (class Layout): Add have_stabstr_section_ field.
7703 Declare link_stabs_sections.
7704
3d857b98
DK
77052009-06-23 Doug Kwan <dougkwan@google.com>
7706
7707 * Makefile.am (libgold_a_LIBADD): New.
7708 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
7709 * Makefile.in: Regenerate.
7710 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
7711 * configure: Regenerate.
7712 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
7713 * fileread.cc: Include sys/state.h
7714 * gold.h: Declare memmem and strndup if found missing.
7715 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
7716
0639a6f6
ILT
77172009-06-23 Ian Lance Taylor <iant@google.com>
7718
7719 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
7720 * configure: Rebuild.
7721
8d63875c
ILT
77222009-06-23 Ian Lance Taylor <iant@google.com>
7723
7724 PR 10147
7725 * object.cc (Object::section_contents): Don't try to get a view if
7726 the section has length zero.
7727 (Object::handle_gnu_warning_section): If the section is empty, use
7728 the name of the section as the warning.
7729
f7c8a183
ILT
77302009-06-23 Ian Lance Taylor <iant@google.com>
7731
7732 PR 10133
7733 * stringpool.h (class Stringpool_template): Add optimize_ field.
7734 (Stringpool_template::set_optimize): New function.
7735 * stringpool.cc (Stringpool_template::Stringpool_template):
7736 Initialize optimize_ field.
7737 (Stringpool_template::set_string_offsets): Test local optimize
7738 fild rather than parameter.
7739 * layout.cc (Layout::Layout): Call set_optimize on the section
7740 name stringpool.
7741
e6a307ba
ILT
77422009-06-22 Ian Lance Taylor <iant@google.com>
7743
7744 PR 10030
7745 * yyscript.y: Parse TARGET.
7746 * script.cc (script_set_target): New function.
7747 * script-c.h (script_set_target): Declare.
7748 * options.cc (General_options::string_to_object_format): Rename
7749 from string_to_object_format in anonymous namespace. Change
7750 callers.
7751 * options.h (class General_options): Declare
7752 string_to_object_format.
7753
3ee173de
ILT
77542009-06-22 Ian Lance Taylor <iant@google.com>
7755
7756 * script-sections.cc (Script_sections::create_segments): Don't put
7757 program headers in a PT_LOAD segment if -n or -N.
7758
77592009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
7760
7761 PR 10141
7762 * options.h (class General_options): Add -z lazy and -z now. Sort
7763 -z options into alphabetical order.
7764 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
7765
cd6739a1 77662009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
7767
7768 * layout.cc (Layout::make_output_section): Call
7769 Target::new_output_section.
7770 (Layout::attach_allocated_section_to_segment): Put large section
7771 sections in a separate load segment with the large segment flag
7772 set.
7773 (Layout::segment_precedes): Sort large data segments after other
7774 load segments.
7775 (align_file_offset): New static function.
7776 (Layout::set_segment_offsets): Use align_file_offset.
7777 * output.h (class Output_section): Add is_small_section_ and
7778 is_large_section_ fields.
7779 (Output_section::is_small_section): New function.
7780 (Output_section::set_is_small_section): New function.
7781 (Output_section::is_large_section): New function.
7782 (Output_section::set_is_large_section): New function.
7783 (Output_section::is_large_data_section): New function.
7784 (class Output_segment): Add is_large_data_segment_ field.
7785 (Output_segment::is_large_data_segment): New function.
7786 (Output_segment::set_is_large_data_segment): New function.
7787 * output.cc (Output_section::Output_section): Initialize new
7788 fields.
7789 (Output_segment::Output_segment): Likewise.
7790 (Output_segment::add_output_section): Add assertion that large
7791 data sections always go in large data segments. Force small data
7792 sections to the end of the list of data sections. Force small BSS
7793 sections to the start of the list of BSS sections. For large BSS
7794 sections to the end of the list of BSS sections.
7795 * symtab.h (class Symbol): Declare is_common_shndx.
7796 (Symbol::is_defined): Check Symbol::is_common_shndx.
7797 (Symbol::is_common): Likewise.
7798 (class Symbol_table): Define enum Commons_section_type. Update
7799 declarations. Add small_commons_ and large_commons_ fields.
7800 * symtab.cc (Symbol::is_common_shndx): New function.
7801 (Symbol_table::Symbol_table): Initialize new fields.
7802 (Symbol_table::add_from_object): Put small and large common
7803 symbols in the right list.
7804 (Symbol_table::sized_finalized_symbol): Check
7805 Symbol::is_common_shndx.
7806 (Symbol_table::sized_write_globals): Likewise.
7807 * common.cc (Symbol_table::do_allocate_commons): Allocate new
7808 common symbol lists. Don't call do_allocate_commons_list if the
7809 list is empty.
7810 (Symbol_table::do_allocate_commons_list): Remove is_tls
7811 parameter. Add comons_section_type parameter. Change all
7812 callers. Handle small and large common symbols.
7813 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
7814 Symbol::is_common_shndx.
7815 * resolve.cc (symbol_to_bits): Likewise.
7816 * target.h (Target::small_common_shndx): New function.
7817 (Target::small_common_section_flags): New function.
7818 (Target::large_common_shndx): New function.
7819 (Target::large_common_section_flags): New function.
7820 (Target::new_output_section): New function.
7821 (Target::Target_info): Add small_common_shndx, large_common_shndx,
7822 small_common_section_flags, and large_common_section_flags
7823 fields.
7824 (Target::do_new_output_section): New virtual function.
7825 * arm.cc (Target_arm::arm_info): Initialize new fields.
7826 * i386.cc (Target_i386::i386_info): Likewise.
7827 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
7828 Likewise.
7829 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
7830 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
7831 (Target_x86_64::do_new_output_section): New function.
7832 * configure.ac: Define conditional MCMODEL_MEDIUM.
7833 * testsuite/Makefile.am (check_PROGRAMS): Add large.
7834 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
7835 (large_LDFLAGS): Define.
7836 * testsuite/large.c: New file.
7837 * testsuite/testfile.cc (Target_test::test_target_info):
7838 Initialize new fields.
7839 * configure, testsuite/Makefile.in: Rebuild.
7840
bb04269c
DK
78412009-06-05 Doug Kwan <dougkwan@google.com>
7842
7843 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 7844 * Makefile.in: Regenerate.
bb04269c
DK
7845 * i386.cc (class Target_i386): Define new virtual method to
7846 override do_is_local_label_name in parent.
7847 * object.cc (Sized_relobj::do_count_local_symbols): Discard
7848 local symbols if --discard-locals or -X is given.
7849 * options.h (class General_options): Declare new options
7850 '--discard-locals' and '-X' for discarding locals.
7851 * target.h (class Target): Define new methods is_local_label_name.
7852 Declare new virtual method do_is_local_label_name.
7853 * target.cc: New file.
7854 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
7855 (check_SCRIPTS): Add discard_locals_test.sh.
7856 (check_DATA): Add discard_local_tests.syms.
7857 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
7858 (discard_local_tests.syms, discard_locals_test.o): New make rules.
7859 * testsuite/Makefile.in: Regenerate.
7860 * testsuite/discard_locals_test.c: New file.
7861 * testsuite/discard_locals_test.sh: Same.
7862
805bb01c
DK
78632009-06-05 Doug Kwan <dougkwan@google.com>
7864
7865 * object.cc (Sized_relobj::Sized_relobj): Initialize
7866 discarded_eh_frame_shndx_ to -1U.
7867 (Sized_relobj::do_layout): Record index of a discard .eh_frame
7868 section.
7869 (Sized_relobj::do_count_local_symbols): Skip local symbols in
7870 a discarded .eh_frame section.
7871 (Sized_relobj::do_finalize_local_symbols): Ditto.
7872 * object.h (class Sized_relobj): Declare new member
7873 discarded_eh_frame_shndx_.
7874 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
7875 (local_labels_test.o, local_labels_test): New rules.
7876 * testsuite/Makefile.in: Regenerate.
7877
1dcd334d
DK
78782009-06-04 Doug Kwan <dougkwan@google.com>
7879
7880 * layout.cc (Layout::section_name_mapping): Add mapping for
7881 special ARM sections.
7882
96d49306
DK
78832009-06-03 Doug Kwan <dougkwan@google.com>
7884
7885 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
7886 (utils::has_overflow): Same.
7887
dff16297
ILT
78882009-06-03 Ian Lance Taylor <iant@google.com>
7889
7890 * layout.cc (Layout::section_name_mapping): New array, replacing
7891 Layout::linkonce_mapping.
7892 (Layout::section_name_mapping_count): New variable, replacing
7893 Layout::linkonce_mapping_count.
7894 (Layout::linkonce_output_name): Remove.
7895 (Layout::output_section_name): Rewrite.
7896 * layout.h (class Layout): Rename Linkonce_mapping to
7897 Section_name_mapping, linkonce_mapping to section_name_mapping,
7898 linkonce_mapping_count to section_name_mapping_count. Don't
7899 declare linkonce_output_name.
7900
c121c671
DK
79012009-06-03 Doug Kwan <dougkwan@google.com>
7902
7903 * gold/arm.cc (namespace utils): New.
7904 (Target_arm::reloc_is_non_pic): Define new method.
7905 (class Arm_relocate_functions): New.
7906 (Target_arm::Relocate::relocate): Handle relocation types used by
7907 Android.
7908
07800fab
ILT
79092009-06-03 Ian Lance Taylor <iant@google.com>
7910
7911 * arm.cc (Target_arm::scan::global): Use || instead of |.
7912
c121c671
DK
79132009-06-02 Doug Kwan <dougkwan@google.com>
7914
7915 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
7916 issued_non_pic_error_.
7917 (class Target_arm::Scan): Declare new method check_non_pic.
7918 Define new method symbol_needs_plt_entry.
7919 Declare new data member issued_non_pic_error_.
7920 (class Target_arm::Relocate): Declare new method
7921 should_apply_static_reloc.
7922 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
7923 (Target_arm::Scan::check_non_pic): Define new method.
7924 (Target_arm::Scan::local): Handle a small subset of reloc types used
7925 by Android.
7926 (Target_arm::Scan::local): Same.
7927 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
7928
b19b0c6d
ILT
79292009-05-31 Mikolaj Zalewski <mikolajz@google.com>
7930
7931 * incremental.cc (Incremental_inputs::report_command_line): Filter
7932 out --incremental-* options.
7933
94cdfcff
DK
79342009-05-29 Doug Kwan <dougkwan@google.com>
7935
7936 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
7937 template class.
7938 (class Target_arm): Update comment.
7939 (Target_arm::Target_arm): Initialize new data members GOT_,
7940 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
7941 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
7942 and Target_arm::rel_dyn_section.
7943 Declare new_enum Target_arm::Got_type.
7944 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
7945 and DYNBSS_.
7946 Update commments for member do_dynsym_value.
7947 (Target_arm::got_size, Target_arm::plt_section,
7948 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
7949 new methods inside class defintion.
7950 (Target_arm::got_section): Define new method.
7951 (Target_arm::rel_dyn_section): Same.
7952 (Output_data_plt_arm): New template class.
7953 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
7954 (Output_data_plt_arm:do_adjust_output_section): Define new method.
7955 (Output_data_plt_arm::add_entry): Same.
7956 (Output_data_plt_arm::first_plt_entry): Define new
7957 static data member for PLT instruction template.
7958 (Output_data_plt_arm::plt_entry): Same.
7959 (Output_data_plt_arm::do_write): Define new method.
7960 (Target_arm::make_plt_entry): Same.
7961 (Target_arm::do_finalize_sections): Same.
7962 (Target_arm::do_dynsym_value): Same.
7963
4a657b0d
DK
79642009-05-28 Doug Kwan <dougkwan@google.com>
7965
7966 * Makefile.am (TARGETSOURCES): Add arm.cc.
7967 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
7968 * Makefile.in: Regenerate.
7969 * arm.cc: New file.
7970 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
7971
e7ae8c36
DK
79722009-05-26 Doug Kwan <dougkwan@google.com>
7973
7974 * options.cc (General_options::parse_exclude_libs). Fix a comment.
7975 (General_options::check_excluded_libs): Strip off directories in
7976 archive name before matching like GNU ld does.
7977 * testsuite/Makefile.am (MOSTLYCLEANFILES,
7978 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
7979 (exclude_libs_test_LDFLAGS): Add linker option
7980 -Wl,--exclude-libs,libexclude_libs_test_3
7981 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
7982 an explicit archive without using -l.
7983 (alt/libexclude_libs_test_3.a): New make rule.
7984 * testsuite/Makefile.in: Regenerate.
7985 * testsuite/exclude_libs_test.c : Declare lib3_default().
7986 (main): Call it.
7987 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
7988 * exclude_libs_test_3.c: New file.
7989
f12e7348
NC
79902009-05-26 Nick Clifton <nickc@redhat.com>
7991
7992 * po/id.po: New Indonesian translation.
7993 * po/gold.pot: Updated template file.
7994
4daadc0d
ST
79952009-05-22 Sriraman Tallam <tmsriram@google.com>
7996
e1df38aa 7997 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
7998 gc_comdat_test files. Add -Wl,--gc-sections to build
7999 gc_comdat_test.
8000 * testsuite/Makefile.in: Regenerate.
8001 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
8002
531813ad
ST
80032009-05-21 Sriraman Tallam <tmsriram@google.com>
8004
8005 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
8006 kept comdat section was garbage collected.
8007 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
8008 * testsuite/Makefile.in: Regenerate.
8009 * testsuite/gc_comdat_test.sh: New file.
8010 * testsuite/gc_comdat_test_1.cc: New file.
8011 * testsuite/gc_comdat_test_2.cc: New file.
8012
65514900
CC
80132009-05-19 Doug Kwan <dougkwan@google.com>
8014
8015 * archive.cc (Archive::Archive): Move constructor from archive.h
8016 to here. Initialize no_export_.
8017 (Archive::get_elf_object_for_member): Set no_export flag of object.
8018 * archive.h (Archive::Archive): Move constructor body to
8019 archive.cc.
8020 (Archive::no_export): New method.
8021 (Archive::no_export_): New field.
8022 * object.h (Object::Object): Initialize no_export_ to false.
8023 (Object::no_export, Object::set_no_export): New methods.
8024 (Object::no_export_): New field.
8025 * options.cc (General_options::parse_exclude_libs): New method.
8026 (General_options::check_excluded_libs) Same.
8027 * options.h (exclude_libs): New option.
8028 (General_options::check_excluded_libs): New method declaration.
8029 (General_options::excluded_libs_): New field.
8030 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
8031 default or protected visibility if an object has no-export flag set.
8032 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
8033 (check_SCRIPTS): Add exclude_libs_test.sh.
8034 (check_DATA): Add exclude_libs_test.syms.
8035 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
8036 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
8037 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
8038 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
8039 (exclude_libs_test.syms, libexclude_libs_test_1.a,
8040 libexclude_libs_test_2.a): New rules.
8041 * testsuite/Makefile.in: Regenerate.
8042 * testsuite/exclude_libs_test.c: New file.
8043 * testsuite/exclude_libs_test.sh: Ditto.
8044 * testsuite/exclude_libs_test_1.c: Ditto.
8045 * testsuite/exclude_libs_test_2.c: Ditto.
8046
1b77ea50
ILT
80472009-05-15 Ian Lance Taylor <iant@google.com>
8048
8049 * configure.ac: Check for declarations for cases where libiberty.h
8050 checks HAVE_DECL_xxx.
8051 * configure, config.in: Rebuild.
8052
072fe7ce
ILT
80532009-05-15 Mikolaj Zalewski <mikolajz@google.com>
8054
8055 * gold.h (Incremental_argument_list): Remove (invalid) forward
8056 declaration.
8057 * incremental.cc (Incremental_inputs::report_achive): New method.
8058 (Incremental_inputs::report_object): New method.
8059 (Incremental_inputs::report_script): New method.
8060 (Incremental_inputs::finalize_inputs): New method.
8061 (Incremental_inputs::finalize): Call finalize_inputs().
8062 (Incremental_inputs::sized_create_incremental_inputs_section_data):
8063 Create inputs entries.
8064 * incremental.h (Incremental_input_type): New enum.
8065 (Incremental_inputs::Incremental_input): Initialize new fields.
8066 (Incremental_inputs::report_inputs): New method.
8067 (Incremental_inputs::report_achive): New method.
8068 (Incremental_inputs::report_object): New method.
8069 (Incremental_inputs::report_script): New method.
8070 (Incremental_inputs::finalize_inputs): New method.
8071 (Incremental_inputs::Input_info): New struct.
8072 (Incremental_inputs::Input_info_map): New typedef.
8073 (Incremental_inputs::lock_): New field.
8074 (Incremental_inputs::Inputs_): New field.
8075 (Incremental_inputs::Inputs_map): New field.
8076 * main.cc (main): Call Incremental_input::report_inputs.
8077 * options.h (Input_argument_list): Typedef moved from
8078 Input_arguments.
8079 (Input_file_group::Files): Remove, use ::Input_argument_list.
8080 (Input_file_group::Input_argument_list): Remove, use
8081 ::Input_argument_list.
8082 * plugin.cc (Plugin_manager::add_input_file): Add error in
8083 incremental build.
8084 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
8085 functions.
8086 * script.cc (read_input_script): Call
8087 Incremental_input::report_script.
8088 * script.h (Script_info): New class.
8089
b0481b0b
ILT
80902009-04-27 Ian Lance Taylor <iant@google.com>
8091
8092 * x86_64.cc (do_adjust_output_section): Set entsize to
8093 plt_entry_size.
8094
b22a5a41 80952009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
8096
8097 * output.cc (Output_file::close): After short writes, continue
8098 writing from the correct offset in the buffer being written.
8099
40fde488
CD
81002009-04-23 Chris Demetriou <cgd@google.com>
8101
8102 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
8103 * configure: Regenerate.
8104 * config.in: Regenerate.
8105 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
8106 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
8107
3ce2c28e
ILT
81082009-04-21 Mikolaj Zalewski <mikolajz@google.com>
8109
8110 * incremental.cc (Incremental_inputs_header_data): Renamed from
8111 Incremental_input_header_data.
8112 (Incremental_inputs_header_data::data_size): New field.
8113 (Incremental_inputs_header_data::put_input_file_count): Renamed
8114 from input_file_count.
8115 (Incremental_inputs_header_data::put_command_line_offset): Renamed
8116 from command_line_offset.
8117 (Incremental_inputs_header_data::put_reserved): Renamed from
8118 put_reserved.
8119 (Incremental_inputs_entry_data): Renamed from
8120 Incremental_input_entry_data.
8121 (Incremental_inputs_entry_data::data_size): New field.
8122 (Incremental_inputs::report_command_line): New method.
8123 (Incremental_inputs::finalize): New method.
8124 (Incremental_inputs::create_incremental_inputs_data): New method.
8125 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
8126 * incremental.h: New file.
8127 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
8128 (Layout::finalize): Create incremental inputs section in
8129 incremental builds.
8130 (Layout::create_incremental_info_sections): New method.
8131 * layout.h (Layout::incremental_inputs): New method.
8132 (Layout::create_incremental_info_sections): New method.
8133 (Layout::incremental_inputs_): New field.
8134 * main.cc (main): Notify Incremental_input of the command line.
8135
e55bde5e
ILT
81362009-04-01 Ian Lance Taylor <iant@google.com>
8137 Mikolaj Zalewski <mikolajz@google.com>
8138
8139 * gold.h (reserve_unordered_map): Define, three versions, one for
8140 each version of Unordered_map.
8141 * layout.cc (Layout::Layout): Remove options parameter. Add
8142 number_of_input_files parameter. Don't initialize options_.
8143 Initialize number_of_input_files_ and resized_signatures_. Move
8144 sections_are_attached_.
8145 (Layout::layout_group): Reserve space for group_signatures_.
8146 (Layout::find_or_add_kept_section): Change name parameter to be a
8147 reference. Resize signatures_ map when it gets large enough.
8148 (Layout::layout_eh_frame): Use parameters->options() instead of
8149 this->options_.
8150 (Layout::make_output_section): Likewise.
8151 (Layout::attach_allocated_section_to_segment): Likewise.
8152 (Layout::finalize, Layout::create_executable_stack): Likewise.
8153 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
8154 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
8155 * layout.h (class Layout): Update declarations. Remove options_
8156 field. Add number_of_input_files_ and resized_signatures_
8157 fields. Move sections_are_attached_ field.
8158 * main.cc (main): Pass number of input files to Layout
8159 constructor. Don't pass options.
8160
154b857c
ILT
81612009-03-30 Ian Lance Taylor <iant@google.com>
8162
8163 * ffsll.c (ffsll): Correct implementation.
8164
2f35ab9b
ILT
81652009-03-27 Ian Lance Taylor <iant@google.com>
8166
fd03461a
ILT
8167 * ffsll.c: New file.
8168 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
8169 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
8170 * ftruncate.c (ftruncate): Declare before definition.
8171 * mremap.c (mremap): Likewise.
8172 * pread.c (pread): Likewise.
8173 * configure, Makefile.in, config.in: Rebuild.
8174
2f35ab9b
ILT
8175 * mremap.c: New file.
8176 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
8177 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
8178 (mremap): Declare if HAVE_MREMAP is not defined.
8179 * configure, Makefile.in, config.in: Rebuild.
8180
33aea2fd
CC
81812009-03-27 Cary Coutant <ccoutant@google.com>
8182
8183 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
8184 position independent.
8185 * sparc.cc (Target_sparc::check_non_pic): Likewise.
8186 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
8187
6d479619
CC
81882009-03-24 Cary Coutant <ccoutant@google.com>
8189
8190 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
8191 an executable.
8192 (needs_dynamic_reloc): Likewise.
8193
afc06bb8
ILT
81942009-03-24 Ian Lance Taylor <iant@google.com>
8195
8196 * yyscript.y (file_cmd): Recognize EXTERN.
8197 (extern_name_list, extern_name_list_body): New nonterminals.
8198 * script.cc (script_add_extern): Define.
8199 * script-c.h (script_add_extern): Declare.
8200
f6060a4d
ILT
82012009-03-24 Rafael Avila de Espindola <espindola@google.com>
8202
8203 * object.cc (is_elf_object): Define.
8204 * object.h (is_elf_object): Declare.
8205 * archive.cc (Archive::get_elf_object_for_member): Call
8206 is_elf_object.
33aea2fd 8207 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 8208
26736d8e
ILT
82092009-03-24 Elliott Hughes <enh@google.com>
8210
8211 * output.cc (Output_file::map_anonymous): Define.
8212 (Output_file::map): Use map_anonymous. If the regular mmap fails,
8213 try an anonymous one. Report the size if the mmap fails.
8214 * output.h (class Output_file): Declare map_anonymous.
8215
22fd9730
ILT
82162009-03-24 Ian Lance Taylor <iant@google.com>
8217
8218 * target-select.cc (instantiate_target): Don't acquire the lock if
8219 the instantiated_target_ field has already been set.
8220
cb010894
ILT
82212009-03-23 Ian Lance Taylor <iant@google.com>
8222
7f055c20
ILT
8223 * gold-threads.h (class Initialize_lock): Define.
8224 * gold-threads.cc (class Initialize_lock_once): Define.
8225 (initialize_lock_control): New static variable.
8226 (initialize_lock_pointer): New static variable.
8227 (initialize_lock_once): New static function.
8228 (Initialize_lock::Initialize_lock): Define.
8229 (Initialize_lock::initialize): Define.
8230 * target-select.h: Include "gold-threads.h".
8231 (class Target_selector): Add lock_ and initialize_lock_ fields.
8232 Don't define instantiate_target, just declare it.
8233 * target-select.cc (Target_selector::Target_selector): Initialize
8234 new fields.
8235 (Target_selector::instantiate_target): Define.
8236 * descriptors.h: Include "gold-threads.h".
8237 (class Descriptors): Add initialize_lock_ field.
8238 * descriptors.cc (Descriptors::Descriptors): Initialize new
8239 field.
8240 (Descriptors::open): Use initialize_lock_ field
8241 * errors.h (class Errors): Add initialize_lock_ field.
8242 * errors.cc (Errors::Errors): Initialize new field.
8243 (Errors::initialize_lock): Use initialize_lock_ field.
8244 * powerpc.cc (class Target_selector_powerpc): Remove
8245 instantiated_target_ field. In do_recognize call
8246 instantiate_target rather than do_instantiate_target. In
8247 do_instantiate_target just allocate a new target.
8248 * sparc.cc (class Target_selector_sparc): Likewise.
8249
36959681
ILT
8250 * freebsd.h: New file.
8251 * i386.cc: Include "freebsd.h".
8252 (Target_i386): Derive from Target_freebsd rather than
8253 Sized_target.
8254 (Target_selector_i386): Derive from Target_selector_freebsd rather
8255 than Target_selector.
8256 * x86_64.cc: Include "freebsd.h".
8257 (Target_x86_64): Derive from Target_freebsd rather than
8258 Sized_target.
8259 (Target_selector_x86_64): Derive from Target_selector_freebsd
8260 rather than Target_selector.
8261 * target.h (class Target): Add adjust_elf_header and
8262 do_adjust_elf_header.
8263 * output.cc (Output_file_header:: do_sized_write): Call target
8264 adjust_elf_header routine.
8265 * configure.tgt: Set targ_osabi.
8266 * configure.ac: Define GOLD_DEFAULT_OSABI.
8267 * parameters.cc (Parameters::default_target): Pass
8268 GOLD_DEFAULT_OSABI to select_target.
8269 * target-select.h (class Target_selector): Make instantiate_target
8270 protected rather than private.
8271 * Makefile.am (HFILES): Add freebsd.h.
8272 * configure, Makefile.in, config.in: Rebuild.
8273
cb010894
ILT
8274 * merge.cc (do_add_input_section): Correct pend value. Change
8275 message about last entry not being null terminated from error to
8276 warning.
8277
0e879927
ILT
82782009-03-20 Mikolaj Zalewski <mikolajz@google.com>
8279
8280 * incremental.cc: New file.
8281 * Makefile.am (CCFILES): Add incremental.cc.
8282 * Makefile.in: Rebuild.
8283
41105937
PP
82842009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
8285
8286 * layout.cc (Layout::output_section_name): Preserve names
8287 of '.note.' sections.
e1df38aa 8288
60439920
ILT
82892009-03-19 Ian Lance Taylor <iant@google.com>
8290
8291 * descriptors.cc (Descriptors::open): Check that the options are
8292 valid before using them.
8293
0d371ad3
ILT
82942009-03-18 Ian Lance Taylor <iant@google.com>
8295
8296 * script-sections.h: Include <list>.
8297 (class Script_sections): Change Sections_elements from std::vector
8298 to std::list. Typedef public Elements_iterator. Add
8299 orphan_section_placement_, data_segment_align_start_, and
8300 saw_data_segment_align_ fields. Remove data_segment_align_index_
8301 field.
8302 * script-sections.cc (class Orphan_section_placement): New class.
8303 (class Sections_element): Add virtual functions is_relro and
8304 orphan_section_init. Remove virtual function place_orphan_here.
8305 (class Output_section_definition): Add is_relro and
8306 orphan_section_init. Remove place_orphan_here.
8307 (class Orphan_output_section): Likewise.
8308 (Script_sections::Script_sections): Update for field changes.
8309 (Script_sections::data_segment_align): Set saw_data_segment_align_
8310 and data_segment_align_start_, not data_segment_align_index.
8311 (Script_sections::data_segment_relro_end): Check
8312 saw_data_segment_align_. Use data_segment_align_start_ rather
8313 than data_segment_align_index_.
8314 (Script_sections::place_orphan): Rewrite to use
8315 Orphan_section_placement.
8316
9201d894
ILT
83172009-03-17 Ian Lance Taylor <iant@google.com>
8318
9c5b8369
ILT
8319 * archive.cc (Archive::add_symbols): Check for a version attached
8320 to the symbol name in the archive map.
8321 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
8322 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
8323 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
8324 (ver_test_11.a): New target.
8325 * testsuite/Makefile.in: Rebuild.
8326
9201d894
ILT
8327 * configure.ac: Check for chsize and posix_fallocate. Replace
8328 ftruncate.
8329 * ftruncate.c: New file, from gnulib.
8330 * output.cc (posix_fallocate): Define dummy version if not
8331 HAVE_POSIX_FALLOCATE.
8332 (Output_file::map): Call posix_fallocate rather than lseek and
8333 write.
8334 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
8335 * configure, Makefile.in, config.in: Rebuild.
8336
ef4ab7a8 83372009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 8338
ef4ab7a8
PP
8339 * layout.h (Layout::create_note): Add section_name parameter.
8340 * layout.cc (Layout::create_note): Likewise.
8341 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 8342
8c500701
ILT
83432009-03-17 Ian Lance Taylor <iant@google.com>
8344
e85b18e1
ILT
8345 * descriptors.cc: Include "options.h".
8346 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
8347 (Descriptors::open): Always use O_CLOEXEC when opening a new
8348 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
8349 then set FD_CLOEXEC.
8350
9efe6174
ILT
8351 * sparc.cc (class Target_sparc): Add has_got_section.
8352 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
8353 make sure we have a GOT section.
8354
8355 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
8356 (Target_sparc::Scan::local): Likewise.
8357 (Target_sparc::Scan::global): Likewise.
8358 (Target_sparc::Relocate::relocate): Likewise.
8359 (Target_sparc::Relocate::relocate_tls): Likewise.
8360
8c500701
ILT
8361 * symtab.cc (Symbol_table::define_default_version): New function,
8362 broken out of add_from_object.
8363 (Symbol_table::add_from_object): Call define_default_version.
8364 (Symbol_table::define_special_symbol): Add resolve_oldsym
8365 parameter. Change all callers. If the version for a symbol comes
8366 from a version script, resolve it with the symbol with the same
8367 name with no version. Also add the symbol without a version if
8368 appropriate.
8369 (do_define_in_output_data): If resolving with oldsym, don't delete
8370 sym.
8371 (do_define_in_output_segment): Likewise.
8372 (do_define_as_constant): Likewise.
8373 * symtab.h (class Symbol_table): Update declarations.
8374
f1ed28fb
ILT
83752009-03-13 Ian Lance Taylor <iant@google.com>
8376
15f8229b
ILT
8377 * readsyms.cc (Read_symbols::incompatible_warning): New function.
8378 (Read_symbols::requeue): New function.
8379 (Read_symbols::do_read_symbols): If make_elf_object fails because
8380 the target type is not configured, and the file was searched for,
8381 issue a warning and retry with the next directory.
8382 (Add_symbols::run): If the file has an incompatible format, and
8383 it was searched for, requeue the Read_symbols task. On error,
8384 release the object.
8385 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
8386 dirindex parameter to constructor. Change all callers. Declare
8387 incompatible_warning and requeue.
8388 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
8389 input_argument_ and input_group_ fields. Add them to
8390 constructor. Change all callers.
8391 (class Read_script): Add dirindex_ field. Add it to constructor.
8392 Change all callers.
8393 * archive.cc (Archive::setup): Remove input_objects parameter.
8394 Change all callers.
8395 (Archive::get_file_and_offset): Likewise.
8396 (Archive::read_all_symbols): Likewise.
8397 (Archive::read_symbols): Likewise.
8398 (Archive::get_elf_object_for_member): Remove input_objects
8399 parameter. Add punconfigured parameter. Change all callers.
8400 (Archive::add_symbols): Change return type to bool. Check return
8401 value of include_member.
8402 (Archive::include_all_members): Likewise.
8403 (Archive::include_member): Change return type to bool. Return
8404 false if first included object has incompatible target. Set
8405 included_member_ field.
8406 (Add_archive_symbols::run): If add_symbols returns false, requeue
8407 Read_symbols task.
8408 * archive.h (class Archive): Add included_member_ field.
8409 Initialize it in constructor. Add input_file and searched_for
8410 methods. Update declarations.
8411 (class Add_archive_symbols): Add dirpath_, dirindex_, and
8412 input_argument_ fields. Add them to constructor. Change all
8413 callers.
8414 * script.cc: Include "target-select.h".
8415 (class Parser_closure): Add skip_on_incompatible_target_ and
8416 found_incompatible_target_ fields. Add
8417 skip_on_incompatible_target parameter to constructor. Change all
8418 callers. Add methods skip_on_incompatible_target,
8419 clear_skip_on_incompatible_target, found_incompatible_target, and
8420 set_found_incompatible_target.
8421 (read_input_script): Add dirindex parameter. Change all callers.
8422 If parser finds an incompatible target, requeue Read_symbols
8423 task.
8424 (script_set_symbol): Clear skip_on_incompatible_target in
8425 closure.
8426 (script_add_assertion, script_parse_option): Likewise.
8427 (script_start_sections, script_add_phdr): Likewise.
8428 (script_check_output_format): New function.
8429 * script.h (read_input_script): Update declaration.
8430 * script-c.h (script_check_output_format): Declare.
8431 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
8432 (ignore_cmd): Remove OUTPUT_FORMAT.
8433 * fileread.cc (Input_file::Input_file): Add explicit this.
8434 (Input_file::will_search_for): New function.
8435 (Input_file::open): Add pindex parameter. Change all callers.
8436 * fileread.h (class Input_file): Add input_file_argument method.
8437 Declare will_search_for. Update declarations.
8438 * object.cc (make_elf_object): Add punconfigured parameter.
8439 Change all callers.
8440 * object.h (class Object): Make input_file public. Add
8441 searched_for method.
8442 (make_elf_object): Update declaration.
8443 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
8444 restart search.
8445 * dirsearch.h (class Dirsearch): Update declaration.
8446 * options.h (class General_options): Add --warn-search-mismatch.
8447 * parameters.cc (Parameters::is_compatible_target): New function.
8448 * parameters.h (class Parameters): Declare is_compatible_target.
8449 * workqueue.cc (Workqueue::add_blocker): New function.
8450 * workqueue.h (class Workqueue): Declare add_blocker.
8451
f1ed28fb
ILT
8452 * fileread.cc (Input_file::open): Remove options parameter.
8453 Change all callers.
8454 (Input_file::open_binary): Likewise.
8455 * script.cc (read_input_script): Likewise.
8456 * readsyms.h (class Read_symbols): Remove options_ field. Remove
8457 options parameter from constructor. Change all callers.
8458 (class Read_script): Likewise.
8459 * fileread.h (class Input_file): Update declarations.
8460 * script.h (read_input_script): Update declaration.
8461
34dd024a
NC
84622009-03-10 Nick Clifton <nickc@redhat.com>
8463
8464 * po/es.po: New Spanish translation.
8465
6d71b17c
CC
84662009-03-06 Cary Coutant <ccoutant@google.com>
8467
8468 * options.cc (parse_short_option): Keep dash_z from registering itself.
8469
031cdbed
ILT
84702009-03-03 Ian Lance Taylor <iant@google.com>
8471
8472 PR 9918
8473 * target-reloc.h (relocate_section): Pass output_section to
8474 relocate.
8475 * i386.cc (Target_i386::should_apply_static_reloc): Add
8476 output_section parameter. Change all callers.
8477 (Target_i386::Relocate::relocate): Add output_section parameter.
8478 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8479 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
8480 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
8481 * testsuite/two_file_shared.sh: New script.
8482 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
8483 (check_DATA): Add two_file_shared.dbg.
8484 (two_file_shared.dbg): New target.
8485 * testsuite/Makefile.in: Rebuild.
8486
15d5fa16
ILT
84872009-03-01 Ian Lance Taylor <iant@google.com>
8488
8489 * configure.ac: Check for byteswap.h.
8490 * configure: Rebuild.
8491 * config.in: Rebuild.
8492
8a4c0b0d
ILT
84932009-03-01 Mikolaj Zalewski <mikolajz@google.com>
8494
8495 * layout.cc (Layout::find_or_add_kept_section): New function.
8496 (Layout::add_comdat): Removed.
8497 * layout.h (struct Kept_section): Move out of class Layout.
8498 Remove trailing underscores from field names. Add group_sections
8499 field. Rename group_ field to is_group. Change all uses.
8500 (class Layout): Declare find_or_add_kept_section, not add_comdat.
8501 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
8502 comdat_groups_ field.
8503 (Sized_relobj::include_section_group): Use
8504 find_or_add_kept_section and Kept_section::group_sections.
8505 (Sized_relobj::include_linkonce_section): Likewise.
8506 * object.cc (class Sized_relobj): Don't define Comdat_group or
8507 Comdat_group_table. Remove find_comdat_group and
8508 add_comdat_group. Remove comdat_groups_ field.
8509 * plugin.cc (include_comdat_group): Use
8510 Layout::find_or_add_kept_section.
8511
b4ecf66b
ILT
85122009-02-28 Ian Lance Taylor <iant@google.com>
8513
14359ca0
ILT
8514 * README: --gc-sections and map files are now supported. Document
8515 some build requirements.
8516
b4ecf66b
ILT
8517 PR 6992
8518 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
8519 relocatable link set the value of the section symbol to zero.
8520 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
8521 relocatable link don't include the section address in the local
8522 symbol value.
8523
0602e05a
ILT
85242009-02-27 Ian Lance Taylor <iant@google.com>
8525
fd9d194f
ILT
8526 PR 6811
8527 * options.h (class Search_directory): Add is_system_directory.
8528 (class General_options): Declare is_in_system_directory.
8529 * options.cc (get_relative_sysroot): Make static.
8530 (get_default_sysroot): Make static.
8531 (General_optoins::is_in_system_directory): New function.
8532 * fileread.cc (Input_file::is_in_system_directory): New function.
8533 * fileread.h (class Input_file): Declare is_in_system_directory.
8534 * object.h (class Object): Add is_in_system_directory.
8535 (class Input_objects): Remove system_library_directory_ field.
8536 * object.cc (Input_objects::add_object): Don't set
8537 system_library_directory_.
8538 (input_objects::found_in_system_library_directory): Remove.
8539 * symtab.cc (Symbol_table::write_globals): Remove input_objects
8540 parameter. Change all callers.
8541 (Symbol_table::sized_write_globals): Likewise.
8542 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
8543 Call Object::is_in_system_directory.
8544 * symtab.h (class Symbol_table): Update declarations.
8545
61edd21f
ILT
8546 PR 5990
8547 * descriptors.h (Open_descriptor): Add is_on_stack field.
8548 * descriptors.cc (Descriptors::open): If the descriptor is on the
8549 top of the stack, remove it. Initialize is_on_stack field.
8550 (Descriptors::release): Only add pod to stack if it is not on the
8551 stack already.
8552 (Descriptors::close_some_descriptor): Clear stack_next and
8553 is_on_stack fields.
8554
e29e076a
ILT
8555 PR 7091
8556 * output.cc (Output_section::find_starting_output_address): Rename
8557 from starting_output_address; add PADDR parameter; change return
8558 type.
8559 * output.h (class Output_section): Declare
8560 find_starting_output_address instead of starting_output_address.
8561 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
8562 section symbol for which we can't find a merge section.
8563
0602e05a
ILT
8564 PR 9836
8565 * symtab.cc (Symbol_table::add_from_object): If the visibility is
8566 hidden or internal, force the symbol to be local.
8567 * resolve.cc (Symbol::override_visibility): Define.
8568 (Symbol::override_base): Use override_visibility.
8569 (Symbol_table::resolve): Likewise.
8570 (Symbol::override_base_with_special): Likewise.
8571 (Symbol_table::override_with_special): If the visibility is hidden
8572 or internal, force the symbol to be local.
8573 * symtab.h (class Symbol): Add set_visibility and
8574 override_visibility.
8575 * testsuite/ver_test_1.sh: New file.
8576 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
8577 (check_DATA): Add ver_test_1.syms.
8578 (ver_test_1.syms): New target.
8579 * testsuite/Makefile.in: Rebuild.
8580
401a9a73
CC
85812009-02-25 Cary Coutant <ccoutant@google.com>
8582
8583 * layout.cc (Layout::choose_output_section): Don't rename sections
8584 when using a linker script that has a SECTIONS clause.
8585 * Makefile.in: Regenerate.
8586
8587 * testsuite/Makefile.am (script_test_5.sh): New test case.
8588 * testsuite/Makefile.in: Regenerate.
8589 * testsuite/script_test_5.cc: New file.
8590 * testsuite/script_test_5.sh: New file.
8591 * testsuite/script_test_5.t: New file.
8592
f488e4b0
CC
85932009-02-13 Rafael Avila de Espindola <espindola@google.com>
8594
8595 * archive.cc (Archive::include_member): Update calls to add_symbols.
8596 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
8597 the Layout argument.
8598 * dynobj.h (do_add_symbols): Add the Layout argument.
8599 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
8600 Layout argument.
8601 * object.h (Object::add_symbols): Add the Layout argument.
8602 (Object::do_add_symbols): Add the Layout argument.
8603 (Sized_relobj::do_add_symbols): Add the Layout argument.
8604 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
8605 Unify the two versions.
8606 (Add_plugin_symbols): Remove.
8607 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
8608 (Sized_pluginobj::do_add_symbols): Unify the two versions.
8609 (Add_plugin_symbols): Remove.
8610 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
8611 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
8612 (Add_symbols::run): Make it work with Pulginobj.
8613
89dd1680
ILT
86142009-02-06 Ian Lance Taylor <iant@google.com>
8615
8616 * object.cc (Sized_relobj::do_layout): Make info message start
8617 with lower case letter.
8618
266d0a74
ILT
86192009-02-06 Mikolaj Zalewski <mikolajz@google.com>
8620
602b464e
ILT
8621 * binary.cc: Fix file comment.
8622
266d0a74
ILT
8623 * options.h (enum Incremental_disposition): Define.
8624 (class General_options): Add new options: --incremental,
8625 --incremental_changed, --incremental_unchanged,
8626 --incremental_unknown. Add incremental_disposition_ and
8627 implicit_incremental_ fields.
8628 (General_options::incremental_disposition): New function.
8629 (class Position_dependent_options): Add incremental_disposition
8630 option.
8631 (Position_dependent_options::copy_from_options): Set incremental
8632 dispositions.
8633 * options.cc (General_options::parse_incremental_changed): New
8634 function.
8635 (General_options::parse_incremental_unchanged): New function.
8636 (General_options::parse_incremental_unknown): New function.
8637 (General_options::General_options): Initialize new fields
8638 incremental_disposition_ and implicit_incremental_.
8639 (General_options::finalize): Check for uasge of --incremental-*
8640 without --incremental.
8641
f073bbf7
CD
86422009-02-06 Chris Demetriou <cgd@google.com>
8643
8644 * gold.h (gold_undefined_symbol): Change to take only a Symbol
8645 pointer and to report location as the file name associated with
8646 the symbol.
8647 (gold_undefined_symbol_at_location): New function to replace the
8648 old gold_undefined_symbol functionality.
8649 * target-reloc.h (relocate_section): Update to use
8650 gold_undefined_symbol_at_location.
8651 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8652 Call gold_undefined_symbol function rather than gold_error.
8653 * errors.h (Errors::undefined_symbol): Take location as a
8654 string, rather than calculating it from a relocation.
8655 * errors.cc (Errors::fatal): Print "fatal error:" before the
8656 formatted message.
8657 (Errors::error, Errors::error_at_location): Print "error: "
8658 before the formatted message.
8659 (Errors::undefined_symbol): Take location as a string, rather
8660 than calculating it from a relocation.
8661 (gold_undefined_symbol_at_location): New function akin to
8662 old gold_undefined_symbol, calculates location from relocation.
8663 (gold_undefined_symbol): Change to take only a Symbol pointer
8664 and to report location as the file name associated with the symbol.
8665 * testsuite/debug_msg.sh: Update for changed error messages.
8666 * testsuite/undef_symbol.sh: Likewise.
8667
8e94a90c
ILT
86682009-02-04 Duncan Sands <baldrick@free.fr>
8669
8670 PR 9812
8671 * reduced_debug_output.h
8672 (Output_reduced_debug_abbrev_section::failed): Use format for
8673 gold_warning.
8674 (Output_reduced_debug_info_section::faild): Likewise.
8675
88a0e15b
ILT
86762009-01-31 Mikolaj Zalewski <mikolajz@google.com>
8677
8678 * script.cc (Lazy_demangler): New class.
8679 (Version_script_info::get_symbol_version_helper): Demangle a
8680 symbol only once.
8681
5efc7cd2
CC
86822009-01-29 Cary Coutant <ccoutant@google.com>
8683
8684 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
8685 to __tls_get_addr.
8686 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
8687
e0ebcf42
ILT
86882009-01-28 Ian Lance Taylor <iant@google.com>
8689
5efc7cd2 8690 * version.cc (version_string): Bump to 1.9.
75fe7426 8691
e0ebcf42
ILT
8692 * gold.h: Include <cstring> and <stdint.h>.
8693 * version.cc: Include <cstdio>.
8694 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
8695 warning.
8696 * reduced_debug_output.cc (insert_into_vector): Rename from
8697 Insert_into_vector; change all callers. Use Swap_unaligned to
8698 avoid aliasing issue; remove union since it is unnecessary.
8699
8e2813be 87002009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
8701
8702 * Makefile.am (CCFILES): Add gc.cc.
8703 (HFILES): Add gc.h.
8704 * Makefile.in: Regenerate.
8705 * gold.cc (Gc_runner): New class.
8706 (queue_initial_tasks): Call garbage collection related tasks
8707 when corresponding options are invoked.
8708 (queue_middle_gc_tasks): New function.
8709 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
8710 processed early before laying out sections during garbage collection.
8711 * gold.h (queue_middle_gc_tasks): New function.
8712 (is_prefix_of): Move from "layout.cc".
8713 * i386.cc (Target_i386::gc_process_relocs): New function.
8714 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
8715 * main.cc (main): Create object of class "Garbage_collection".
8716 * object.cc (Relobj::copy_symbols_data): New function.
8717 (Relobj::is_section_name_included): New function.
e1df38aa
NC
8718 (Sized_relobj::do_layout): Allow this function to be called twice
8719 during garbage collection and defer layout of section during the
6d03d481
ST
8720 first call.
8721 * object.h (Relobj::get_symbols_data): New function.
8722 (Relobj::is_section_name_included): New function.
8723 (Relobj::copy_symbols_data): New function.
8724 (Relobj::set_symbols_data): New function.
8725 (Relobj::get_relocs_data): New function.
8726 (Relobj::set_relocs_data): New function.
8727 (Relobj::is_output_section_offset_invalid): New pure virtual function.
8728 (Relobj::gc_process_relocs): New function.
8729 (Relobj::do_gc_process_relocs): New pure virtual function.
8730 (Relobj::sd_): New data member.
8731 (Sized_relobj::is_output_section_offset_invalid): New function.
8732 (Sized_relobj::do_gc_process_relocs): New function.
8733 * options.h (General_options::gc_sections): Modify to not be a no-op.
8734 (General_options::print_gc_sections): New option.
8735 * plugin.cc (Plugin_finish::run): Remove function call to
8736 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
8737 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
8738 * reloc.cc (Read_relocs::run): Add task to process relocs and
8739 determine unreferenced sections when doing garbage collection.
8740 (Gc_process_relocs): New class.
8741 (Sized_relobj::do_gc_process_relocs): New function.
8742 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
8743 sections that are garbage collected.
8744 * reloc.h (Gc_process_relocs): New class.
8745 * sparc.cc (Target_sparc::gc_process_relocs): New function.
8746 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
8747 symbols whose corresponding sections are garbage collected.
8748 (Symbol_table::Symbol_table): Add new parameter for the garbage
8749 collection object.
8750 (Symbol_table::gc_mark_undef_symbols): New function.
8751 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8752 (Symbol_table::gc_mark_dyn_syms): New function.
8753 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
8754 as garbage.
8755 (Symbol_table::add_from_object): Likewise.
8756 (Symbol_table::add_from_relobj): When building shared objects, do not
8757 treat externally visible symbols as garbage.
8758 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
8759 table information for static and relocatable links.
8760 * symtab.h (Symbol_table::set_gc): New function.
8761 (Symbol_table::gc): New function.
8762 (Symbol_table::gc_mark_undef_symbols): New function.
8763 (Symbol_table::gc_mark_symbol_for_shlib): New function.
8764 (Symbol_table::gc_mark_dyn_syms): New function.
8765 (Symbol_table::gc_): New data member.
e1df38aa 8766 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
8767 function.
8768 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
8769 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
8770
3b293544
CF
87712009-01-20 Chris Faylor <me.sourceware@sourceware.org>
8772
8773 * options.h (General_options::gc_sections): Define as a no-op for now.
8774 (General_options::no_keep_memory): Ditto.
8775 (General_options::Bshareable): Define.
8776 * options.cc (General_options::finalize): Honor -Bshareable.
8777
83d22aa8
AS
87782009-01-20 Andreas Schwab <schwab@suse.de>
8779
8780 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
8781 read the value in the contents, since we don't use it. Use the
8782 template endianness when writing.
8783 (Relocate::relocate): Use it for R_PPC_REL16_HA.
8784
cd536b21
AS
87852009-01-19 Andreas Schwab <schwab@suse.de>
8786
8787 * configure.tgt (powerpc64-*): Fix targ_obj.
8788
99e9a495
ILT
87892009-01-15 Ian Lance Taylor <iant@google.com>
8790
8791 * object.cc (Sized_relobj::write_local_symbols): Don't write out
8792 local symbols when stripping all symbols.
8793
bbbfea06
CC
87942009-01-14 Cary Coutant <ccoutant@google.com>
8795
99e9a495 8796 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 8797
0f7c0701
CC
87982009-01-14 Cary Coutant <ccoutant@google.com>
8799
8800 * archive.cc (Archive::get_elf_object_for_member): Remove call
8801 to File_read::claim_for_plugin.
8802 * descriptors.cc (Descriptors::open): Remove reference to
8803 is_claimed.
8804 (Descriptors::claim_for_plugin): Remove.
8805 * descriptors.h (Descriptors::claim_for_plugin): Remove.
8806 (Descriptors::is_claimed): Remove.
8807 (claim_descriptor_for_plugin): Remove.
8808 * fileread.cc (File_read::claim_for_plugin): Remove.
8809 * fileread.h (File_read::claim_for_plugin): Remove.
8810 (File_read::descriptor): Reopen descriptor if necessary.
8811 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
8812 (Plugin_manager::all_symbols_read): Add task parameter. Change
8813 all callers.
8814 (Plugin_manager::get_input_file): New function.
8815 (Plugin_manager::release_input_file): New function.
8816 (Pluginobj::Pluginobj): Add filesize parameter and initialize
8817 corresponding data member.
8818 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
8819 and pass to base constructor. Change all callers.
8820 (get_input_file, release_input_file): New functions.
8821 (make_sized_plugin_object): Add filesize parameter. Change all callers.
8822 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
8823 (Plugin_manager::all_symbols_read): Add task parameter.
8824 (Plugin_manager::get_input_file): New function.
8825 (Plugin_manager::release_input_file): New function.
8826 (Plugin_manager::task_): New data member.
8827 (Pluginobj::Pluginobj): Add filesize parameter.
8828 (Pluginobj::filename): New function.
8829 (Pluginobj::descriptor): New function.
8830 (Pluginobj::filesize): New function.
8831 (Pluginobj::filesize_): New data member.
8832 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
8833 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
8834 File_read::claim_for_plugin; use Object::unlock to unlock the file.
8835
8836 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
8837 with archive libraries.
8838 * testsuite/Makefile.in: Regenerate.
8839 * testsuite/plugin_test.c (struct sym_info): New type.
8840 (get_input_file, release_input_file): New static variables.
8841 (onload): Capture new transfer vector entries.
8842 (claim_file_hook): Stop reading at end of file according to filesize.
8843 Factor out parsing of readelf output into separate function.
8844 (all_symbols_read_hook): Exercise get_input_file and release_input_file
8845 APIs and get the source file name from the symbol table. Convert
8846 source file name to corresponding object file name. Print info
8847 message when adding new input files.
8848 (parse_readelf_line): New function.
8849 * testsuite/plugin_test_1.sh: Add checks for new info messages.
8850 * testsuite/plugin_test_2.sh: Likewise.
8851 * testsuite/plugin_test_3.sh: Likewise.
8852 * testsuite/plugin_test_4.sh: New test case.
8853
62a6d109
ILT
88542009-01-07 Ian Lance Taylor <iant@google.com>
8855
8856 * version.cc (version_string): Bump to 1.8.
8857
483620e8
CC
88582008-12-23 Cary Coutant <ccoutant@google.com>
8859
8860 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
8861 * plugin.cc (Plugin_manager::finish): Rename as
8862 layout_deferred_objects. Move cleanup to separate function.
8863 (Plugin_manager::cleanup): New function.
8864 (Plugin_finish::run): Call layout_deferred_objects and cleanup
8865 separately.
8866 * plugin.h (Plugin_manager::finish): Rename as
8867 layout_deferred_objects.
8868 (Plugin_manager::cleanup): New function.
8869 (Plugin_manager::cleanup_done): New field.
8870
d66a9eb3
CC
88712008-12-23 Cary Coutant <ccoutant@google.com>
8872
8873 * plugin.cc (is_visible_from_outside): New function.
8874 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
8875 so we don't return "IR only" status for exported symbols or -r links.
8876
8877 * testsuite/Makefile.am (plugin_test_3): New test case.
8878 * testsuite/Makefile.in: Regenerate.
8879 * testsuite/plugin_test_3.sh: New file.
8880
5995b570
CC
88812008-12-22 Cary Coutant <ccoutant@google.com>
8882
8883 * object.cc (Sized_relobj::layout_section): New function.
8884 (Sized_relobj::do_layout): Defer layout of input sections until after
8885 plugin has provided replacement files.
8886 (Sized_relobj::do_layout_deferred_sections): New function.
8887 * object.h (Relobj::set_section_offset): Remove virtual keyword.
8888 (Relobj::layout_deferred_sections): New function.
8889 (Relobj::do_layout_deferred_sections): New function.
8890 (Sized_relobj::do_layout_deferred_sections): New function.
8891 (Sized_relobj::layout_section): New function.
8892 (Sized_relobj::Deferred_layout): New structure.
8893 (Sized_relobj::deferred_layout_): New field.
8894 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
8895 Change all callers. Layout deferred sections.
8896 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
8897 references.
8898 (Plugin_hook::run): Move code from do_plugin_hook inline.
8899 (Plugin_hook::do_plugin_hook): Remove.
8900 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
8901 (Plugin_manager::finish): Renamed, was cleanup.
8902 (Plugin_manager::should_defer_layout): New function.
8903 (Plugin_manager::add_deferred_layout_object): New function.
8904 (Plugin_manager::Deferred_layout_list): New type.
8905 (Plugin_manager::deferred_layout_objects_): New field.
8906 (Plugin_hook::do_plugin_hook): Remove.
8907
ee769c88
ILT
89082008-12-17 Ian Lance Taylor <iant@google.com>
8909
8910 * options.h (class General_options): Add --no case for
8911 --export-dynamic.
8912
abc8dcba
CC
89132008-12-16 Cary Coutant <ccoutant@google.com>
8914
8915 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
8916 vector.
8917 (Plugin_manager::claim_file): Create plugin object even if
8918 plugin did not call the add_symbols callback.
8919 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
8920 asking for more symbols than were added.
8921 * testsuite/Makefile.am (plugin_test_1): Add test case with
8922 no global symbols.
8923 (empty.syms): New target.
8924 * testsuite/Makefile.in: Regenerate.
8925 * testsuite/plugin_test.c (claim_file_hook): Add new debug
8926 message. Don't call add_symbols if no globals.
8927 (all_symbols_read_hook): Don't provide replacement for empty
8928 claimed file.
8929
b0074644
ILT
89302008-12-12 Ian Lance Taylor <iant@google.com>
8931
68943102
ILT
8932 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
8933 r_type == 0 for a local symbol with r_sym == 0.
8934 (scan_relocatable_relocs): Pass r_sym to
8935 local_non_section_strategy.
8936 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
8937 r_sym parameter.
8938
b0074644
ILT
8939 * configure.ac: Update test for TLS descriptors: they are
8940 supported as of glibc 2.9.
8941 * configure: Rebuild.
8942
c2508178
ILT
89432008-12-11 Ian Lance Taylor <iant@google.com>
8944
8945 PR 7091
8946 * target-reloc.h (Default_scan_relocatable_relocs): For each
8947 function, map r_type == 0 to RELOC_DISCARD.
8948
2756a258
CC
89492008-12-10 Cary Coutant <ccoutant@google.com>
8950
8951 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
8952 object to override a kept COMDAT group from a plugin object.
8953
bb6f53d3
ILT
89542008-12-09 Ian Lance Taylor <iant@google.com>
8955
fbc558e1
ILT
8956 PR 7088
8957 * yyscript.y (file_cmd): Handle INPUT.
8958
bb6f53d3
ILT
8959 * testsuite/initpri1.c: Change all declarations to be full
8960 prototypes by adding void, to avoid compiler warnings.
8961
4674ecfc
CC
89622008-12-05 Rafael Avila de Espindola <espindola@google.com>
8963
8964 * options.cc (General_options::parse_plugin_opt): New.
8965 (General_options::add_plugin): The argument now is just the filename.
8966 (General_options::add_plugin_option): New.
8967 * options.h (plugin_opt): New.
8968 (add_plugin): Change argument name.
8969 (add_plugin_option): New.
8970 * plugin.cc (Plugin::load): Don't parse the plugin option.
8971 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
8972 (Plugin::add_option): New.
8973 (Plugin::args_): Change type.
8974 (Plugin::filename_): New.
8975 (Plugin_manager::add_plugin_option): New.
8976 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
8977 * testsuite/Makefile.in: Regenerate.
8978
fd06b4aa
CC
89792008-12-05 Cary Coutant <ccoutant@google.com>
8980
8981 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
8982 Handle --strip-lto-sections option.
8983 * options.h (strip_lto_sections): New option.
8984
6c52134c
CC
89852008-12-01 Cary Coutant <ccoutant@google.com>
8986
8987 * plugin.cc (ld_plugin_message): Change format parameter to const.
8988 Fix mismatch between new[] and delete.
8989
a45248e0
CC
89902008-11-14 Cary Coutant <ccoutant@google.com>
8991
8992 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
8993 instead of -1U.
8994
c82fbeee
CS
89952008-11-05 Craig Silverstein <csilvers@google.com>
8996
8997 * options.cc (General_options::parse_dynamic_list): New function.
8998 * options.h (General_options): New flags dynamic_list,
8999 dynamic_list_data, dynamic_list_cpp_new, and
9000 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
9001 (General_options::in_dynamic_list): New function.
9002 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
9003 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
9004 (Lex::can_continue_name): Likewise.
9005 (yylex): Likewise.
9006 (read_script_file): New parameter script_options.
9007 (read_dynamic_list): New function.
9008 (Script_options::define_dynamic_list): New function.
9009 (dynamic_list_keyword_parsecodes): New variable.
9010 (dynamic_list_keywords): New variable.
9011 * script.h (Script_options::define_dynamic_list): New function
9012 prototype.
9013 (read_dynamic_list): New function prototype.
9014 * symtab.cc (strprefix): New macro.
9015 (Symbol::should_add_dynsym_entry): Support dynamic_list,
9016 dynamic_list_data, dynamic_list_cpp_new, and
9017 dynamic_list_cpp_typeinfo.
9018 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
9019 (dynamic_list_expr): New rule.
9020 (dynamic_list_nodes): Likewise.
9021 (dynamic_list_node): Likewise.
9022 * testsuite/Makefile.am (dynamic_list): New test.
9023 * testsuite/Makefile.in: Regenerated.
9024 * testsuite/dynamic_list.t: New file.
9025 * testsuite/dynamic_list.sh: New file.
9026
e0bb29a5
CS
90272008-11-05 Craig Silverstein <csilvers@google.com>
9028
9029 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
9030 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
9031 (t11_last): Likewise.
9032 * testsuite/ver_test_6.c (main): Likewise.
9033
4e1e25e0
CC
90342008-10-07 Cary Coutant <ccoutant@google.com>
9035
9036 * options.c (General_options::finalize): Add check for -static and
9037 -shared.
9038 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
9039 is not empty.
9040
92f03fcb
CC
90412008-10-02 Cary Coutant <ccoutant@google.com>
9042
9043 * plugin.cc (make_sized_plugin_object): Fix conditional
9044 compilation to work when not all targets are enabled.
9045
fbd8a257
CC
90462008-09-29 Cary Coutant <ccoutant@google.com>
9047
9048 * archive.cc (Archive::get_file_and_offset): Use filename instead
9049 of name to get library path.
9050 (Archive::include_member): Unlock external member of a thin archive.
9051
9052 * testsuite/Makefile.am (TEST_AR): New variable.
9053 (thin_archive_test_1): New test.
9054 (thin_archive_test_2): New test.
81636b3f
CC
9055 * testsuite/Makefile.in: Regenerate.
9056 * testsuite/thin_archive_main.cc: New file.
9057 * testsuite/thin_archive_test_1.cc: New file.
9058 * testsuite/thin_archive_test_2.cc: New file.
9059 * testsuite/thin_archive_test_3.cc: New file.
9060 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 9061
eff45813
CC
90622008-09-29 Cary Coutant <ccoutant@google.com>
9063
9064 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
9065 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
9066 instead of -1U.
9067 (Sized_relobj::do_finalize_local_symbols): Likewise.
9068 (Sized_relobj::map_to_kept_section): Likewise.
9069 * object.h (Sized_relobj::invalid_address): New constant.
9070 (Sized_relobj::do_output_section_offset): Check for invalid_address
9071 and return -1ULL.
9072 * output.cc (Output_reloc::local_section_offset): Use constant
9073 invalid_address instead of -1U.
9074 (Output_reloc::get_address): Likewise.
9075 (Output_section::output_address): Change -1U to -1ULL.
9076 * output.h (Output_reloc::invalid_address): New constant.
9077 * reloc.cc (Sized_relobj::write_sections): Use constant
9078 invalid_address instead of -1U.
9079 (Sized_relobj::relocate_sections): Likewise.
9080 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
9081 values for merge sections.
9082 * target-reloc.h (relocate_for_relocatable): Use constant
9083 invalid_address instead of -1U.
9084
89fc3421
CC
90852008-09-19 Cary Coutant <ccoutant@google.com>
9086
9087 Add plugin functionality for link-time optimization (LTO).
9088 * configure.ac (plugins): Add --enable-plugins option.
9089 * configure: Regenerate.
9090 * config.in: Regenerate.
9091 * Makefile.am (LIBDL): New variable.
9092 (CCFILES): Add plugin.cc.
9093 (HFILES): Add plugin.h.
9094 (ldadd_var): Add LIBDL.
9095 * Makefile.in: Regenerate.
9096
9097 * archive.cc: Include "plugin.h".
9098 (Archive::setup): Don't preread archive symbols when using a plugin.
9099 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
9100 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
9101 files.
9102 (Archive::include_member): Add symbols from plugin objects.
9103 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
9104 * descriptors.cc (Descriptors::open): Check for file descriptors
9105 abandoned by plugins.
9106 (Descriptors::claim_for_plugin): New function.
9107 * descriptors.h (Descriptors::claim_for_plugin): New function.
9108 (Open_descriptor::is_claimed): New field.
9109 (claim_descriptor_for_plugin): New function.
9110 * fileread.cc (File_read::claim_for_plugin): New function.
9111 * fileread.h (File_read::claim_for_plugin): New function.
9112 (File_read::descriptor): New function.
9113 * gold.cc: Include "plugin.h".
9114 (queue_initial_tasks): Add task to call plugin hooks for generating
9115 new object files.
9116 * main.cc: Include "plugin.h".
9117 (main): Load plugin libraries.
9118 * object.h (Pluginobj): Declare.
9119 (Object::pluginobj): New function.
9120 (Object::do_pluginobj): New function.
9121 (Object::set_target): New function.
9122 * options.cc: Include "plugin.h".
9123 (General_options::parse_plugin): New function.
9124 (General_options::General_options): Initialize plugins_ field.
9125 (General_options::add_plugin): New function.
9126 * options.h (Plugin_manager): Declare.
9127 (General_options): Add --plugin option.
9128 (General_options::has_plugins): New function.
9129 (General_options::plugins): New function.
9130 (General_options::add_plugin): New function.
9131 (General_options::plugins_): New field.
9132 * plugin.cc: New file.
9133 * plugin.h: New file.
9134 * readsyms.cc: Include "plugin.h".
9135 (Read_symbols::do_read_symbols): Check for archive before checking
9136 for ELF file. Call plugin hooks to claim files.
9137 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
9138 from a real object file; force override when processing replacement
9139 files.
9140 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
9141 (Symbol::init_base_object): Likewise.
9142 (Symbol::init_base_output_data): Likewise.
9143 (Symbol::init_base_output_segment): Likewise.
9144 (Symbol::init_base_constant): Likewise.
9145 (Symbol::init_base_undefined): Likewise.
9146 (Symbol::output_section): Assert that object is not a plugin.
9147 (Symbol_table::add_from_pluginobj): New function.
9148 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
9149 undefined.
9150 (Symbol_table::sized_write_globals): Likewise.
9151 (Symbol_table::add_from_pluginobj): Instantiate template.
9152 * symtab.h (Sized_pluginobj): Declare.
9153 (Symbol::in_real_elf): New function.
9154 (Symbol::set_in_real_elf): New function.
9155 (Symbol::in_real_elf_): New field.
9156 (Symbol_table::add_from_pluginobj): New function.
9157
9158 * testsuite/Makefile.am (AM_CFLAGS): New variable.
9159 (LIBDL): New variable.
9160 (LDADD): Add LIBDL.
9161 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
9162 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
9163 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
9164 (MOSTLYCLEANFILES): Likewise.
9165 * testsuite/Makefile.in: Regenerate.
9166 * testsuite/plugin_test.c: New file.
9167 * testsuite/plugin_test_1.sh: New file.
9168 * testsuite/plugin_test_2.sh: New file.
9169
de31bda5
ILT
91702008-09-16 Ian Lance Taylor <iant@google.com>
9171
9c2d0ef9
ILT
9172 * target-reloc.h (relocate_section): Check whether a symbol is
9173 defined by the ABI before reporting an undefined symbol error.
9174 * target.h (Target::is_defined_by_abi): Make parameter const.
9175 (Target::do_is_defined_by_abi): Likewise.
9176 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
9177 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
9178 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
9179 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
9180 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
9181 * testsuite/Makefile.in: Rebuild.
9182
de31bda5
ILT
9183 * fileread.cc (make_view): Add casts to avoid warning.
9184
9fa33bee
AO
91852008-09-16 Alexandre Oliva <aoliva@redhat.com>
9186
9187 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
9188 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9189
183fd0e3
AO
91902008-09-16 Alexandre Oliva <aoliva@redhat.com>
9191
9192 * options.h (General_options::output_is_executable): New.
9193 (General_options::output_is_pie): New.
9194 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
9195 for shared libraries.
9196 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
9197
7be8330a
CD
91982008-09-11 Chris Demetriou <cgd@google.com>
9199
9200 * options.h (origin): New -z option.
9201 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
9202 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
9203 in DT_FLAGS_1.
9204
a9caad02
CC
92052008-09-05 Cary Coutant <ccoutant@google.com>
9206
9207 * fileread.cc (File_read::make_view): Add check for attempt to map
9208 beyond end of file.
9209
ae6dce4d
CC
92102008-09-05 Cary Coutant <ccoutant@google.com>
9211
9212 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
9213 explicit instantiations.
9214
d7ab2a47
KVH
92152008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
9216
9217 PR gold/6858
9218 * options.cc (General_options::finalize): Allow undefined symbols
9219 in shlibs if linking -shared.
9220
9221 PR gold/6859
9222 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
9223 symbols as not needing a dynsym entry.
9224
1e52a9c1
CS
92252008-08-20 Craig Silverstein <csilvers@google.com>
9226
9227 * fileread.cc (File_read::open): Do not lock the file unless it
9228 was successfully opened.
9229
d85c80a3
CC
92302008-08-14 Cary Coutant <ccoutant@google.com>
9231
9232 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
9233 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
9234 * testsuite/tls_test.cc (struct int128): 128-bit struct
9235 for testing TLS relocs with non-zero addend.
9236 (v12): New TLS variable.
9237 (t12): New test.
9238 (t_last): Add check for v12.
9239 * testsuite/tls_test.h (t12): New function.
9240 * testsuite/tls_test_main.cc (thread_routine): Call new test.
9241
2d924fd9
ILT
92422008-08-13 Ian Lance Taylor <iant@google.com>
9243
9244 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
9245 set tls_segment_ or relro_segment_.
9246 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
9247 when appropriate.
9248 * output.h (Output_section::clear_is_relro): New function.
9249 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
9250 sections specially even when output_data_ is empty.
9251 (Output_segment::maximum_alignment): When first section is relro,
9252 only force alignment for PT_LOAD segments.
9253 * script.cc (script_data_segment_align): New function.
9254 (script_data_segment_relro_end): New function.
9255 * script-c.h (script_data_segment_align): Declare.
9256 (script_data_segment_relro_end): Declare.
9257 * script-sections.h (class Script_sections): Declare
9258 data_segment_align and data_segment_relro_end. Add fields
9259 segment_align_index_ and saw_relro_end_.
9260 * script-sections.cc (class Sections_element): Add set_is_relro
9261 virtual function. Add new bool* parameter to place_orphan_here.
9262 Add get_output_section virtual function.
9263 (class Output_section_definition): Add set_is_relro. Add new
9264 bool* parameter to place_orphan_here. Add get_output_section.
9265 Add is_relro_ field.
9266 (Output_section_definition::Output_section_definition): Initialize
9267 evaluated_address_, evaluated_load_address, evaluated_addralign_,
9268 and is_relro_ fields.
9269 (Output_section_definition::place_orphan_here): Add is_relro
9270 parameter.
9271 (Output_section_definition::set_section_addresses): Set relro for
9272 output section.
9273 (Output_section_definition::alternate_constraint): Likewise.
9274 (class Orphan_output_section): Add new bool* parameter to
9275 place_orphan_here. Add get_output_section.
9276 (Orphan_output_section::place_orphan_here): Add is_relro
9277 parameter.
9278 (Script_sections::Script_sections): Initialize
9279 data_segment_align_index_ and saw_relro_end_.
9280 (Script_sections::data_segment_align): New function.
9281 (Script_sections::data_segment_relro_end): New function.
9282 (Script_sections::place_orphan): Set or clear is_relro.
9283 (Script_sections::set_section_addresses): Force alignment of first
9284 TLS section.
9285 * yyscript.y (exp): Call script_data_segment_align and
9286 script_data_segment_relro_end.
9287 * testsuite/relro_script_test.t: New file.
9288 * testsuite/relro_test.cc (using_script): Declare.
9289 (t1, t2): Test using_script.
9290 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
9291 (relro_script_test_SOURCES): Define.
9292 (relro_script_test_DEPENDENCIES): Define.
9293 (relro_script_test_LDFLAGS): Define.
9294 (relro_script_test_LDADD): Define.
9295 (relro_script_test.so): New target.
9296 * testsuite/Makefile.in: Rebuild.
9297
f827c9a9
CC
92982008-08-06 Cary Coutant <ccoutant@google.com>
9299
9300 * archive.cc (Archive::total_archives, Archive::total_members)
9301 (Archive::total_members_loaded): New variables.
9302 (Archive::setup): Add parameter. Add option to preread
9303 archive symbols.
9304 (Archive::read_armap): Add counter.
9305 (Archive::get_file_and_offset): New function.
9306 (Archive::get_elf_object_for_member): New function.
9307 (Archive::read_all_symbols): New function.
9308 (Archive::read_symbols): New function.
9309 (Archive::add_symbols): Add counters.
9310 (Archive::include_all_members): Use armap to find members if it's
9311 already built.
9312 (Archive::include_member): Skip reading symbols if already read.
9313 Factored code into Archive::get_file_and_offset and
9314 Archive::get_elf_object_for_member. Changed call to
9315 Mapfile::report_include_archive_member.
9316 (Archive::print_stats): New function.
9317 * archive.h: Declare Object and Read_symbols_data classes.
9318 (Archive::Archive): Add initializers for new members.
9319 (Archive::setup): Add parameter.
9320 (Archive::print_stats): New function.
9321 (Archive::total_archives, Archive::total_members)
9322 (Archive::total_members_loaded): New variables.
9323 (Archive::get_file_and_offset): New function.
9324 (Archive::get_elf_object_for_member): New function.
9325 (Archive::read_all_symbols): New function.
9326 (Archive::read_symbols): New function.
9327 (Archive::Archive_member): New class.
9328 (Archive::members_): New member.
9329 (Archive::num_members_): New member.
9330 * main.cc: Include archive.h.
9331 (main): Call Archive::print_stats.
9332 * mapfile.cc (Mapfile::report_include_archive_member): Delete
9333 archive parameter; member_name is now the fully-decorated name.
9334 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
9335 * options.h: (General_options): Add --preread-archive-symbols option.
9336 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
9337 Archive::setup.
9338
de4c45bd
ILT
93392008-08-04 Ian Lance Taylor <iant@google.com>
9340
9341 * symtab.h (Symbol::use_plt_offset): New function.
9342 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
9343 * powerpc.cc (Relocate::relocate): Likewise.
9344 * sparc.cc (Relocate::relocate): Likewise.
9345 * x86_64.cc (Relocate::relocate): Likewise.
9346 * testsuite/weak_plt.sh: New test.
9347 * testsuite/weak_plt_main.cc: New test.
9348 * testsuite/weak_plt_shared.cc: New test.
9349 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
9350 (check_PROGRAMS): Add weak_plt.
9351 (check_DATA): Add weak_plt_shared.so.
9352 (weak_plt_main_pic.o, weak_plt): New targets.
9353 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
9354 * testsuite/Makefile.in: Rebuild.
9355
9356 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
9357 gcctestdir/ld.
9358 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
9359 * testsuite/Makefile.in: Rebuild.
9360
323ee3f4
AM
93612008-08-04 Alan Modra <amodra@bigpond.net.au>
9362
9363 * Makefile.am (POTFILES.in): Set LC_ALL=C.
9364 * Makefile.in: Regenerate.
9365 * po/POTFILES.in: Regenerate.
9366
7c07ecec
ILT
93672008-07-29 Ian Lance Taylor <iant@google.com>
9368
9369 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
9370 symbols before other symbols.
9371 * testsuite/script_test_2.cc (test_addr): Declare.
9372 (test_addr_alias): Declare.
9373 (main): Check that test_addr and test_addr_alias have the right
cd536b21 9374 values.
7c07ecec
ILT
9375 * testsuite/script_test_2.t: Define test_addr_alias and
9376 test_addr.
9377
5778530e
ILT
93782008-07-24 Ian Lance Taylor <iant@google.com>
9379
2a00e4fb
ILT
9380 PR 5990
9381 * descriptors.cc: New file.
9382 * descriptors.h: New file.
9383 * gold-threads.h (class Hold_optional_lock): New class.
9384 * fileread.cc: Include "descriptors.h".
9385 (File_read::~File_read): Release descriptor rather than closing
9386 it.
9387 (File_read::open) [file]: Call open_descriptor rather than open.
9388 Set is_descriptor_opened_.
9389 (File_read::open) [memory]: Assert that descriptor is not open.
9390 (File_read::reopen_descriptor): New function.
9391 (File_read::release): Release descriptor.
9392 (File_read::do_read): Make non-const. Reopen descriptor.
9393 (File_read::read): Make non-const.
9394 (File_read::make_view): Reopen descriptor.
9395 (File_read::do_readv): Likewise.
9396 * fileread.h (class File_read): Add is_descriptor_opened_ field.
9397 Update declarations.
9398 * layout.cc: Include "descriptors.h".
9399 (Layout::create_build_id): Use open_descriptor rather than open.
9400 * output.cc: Include "descriptors.h".
9401 (Output_file::open): Use open_descriptor rather than open.
9402 * archive.cc (Archive::const_iterator): Change Archive to be
9403 non-const.
9404 (Archive::begin, Archive::end): Make non-const.
9405 (Archive::count_members): Likewise.
9406 * archive.h (class Archive): Update declarations.
9407 * object.h (Object::read): Make non-const.
9408 * Makefile.am (CCFILES): Add descriptors.cc.
9409 (HFILES): Add descriptors.h.
9410 * Makefile.in: Rebuild.
9411
801647d1
ILT
9412 PR 6716
9413 * gold.h: Always include <clocale>. Add Solaris workarounds
9414 following code in binutils/sysdep.h.
9415
5edd166e
ILT
9416 PR 6048
9417 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
9418 this->eh_frame_hdr_ is NULL before using it.
9419
c89ad728
ILT
9420 * dynobj.cc (Versions::Versions): Update comment.
9421
aa86f06b
ILT
9422 * dynobj.cc (Versions::Versions): If there is an soname, use it as
9423 the base version name.
9424
5778530e
ILT
9425 * stringpool.cc (Stringpool_template::add_with_length): Set key to
9426 array size plus one.
9427 (Stringpool_template::set_string_offsets): Subtract one from key
9428 before using it as an array index.
9429 (Stringpool_template::get_offset_with_length): Likewise.
9430 (Stringpool_template::write_to_buffer): Likewise.
9431 * stringpool.h (Stringpool_template::get_offset_from_key):
9432 Likewise.
9433
057ead22
ILT
94342008-07-23 Ian Lance Taylor <iant@google.com>
9435
7f649c59
ILT
9436 PR 6658
9437 * object.h (Merged_symbol_value::value): Do our best to handle a
9438 negative addend.
9439
057ead22
ILT
9440 PR 6647
9441 * script.cc (Version_script_info::get_versions): Don't add empty
9442 version tag to return value.
9443 (Version_script_info::get_symbol_version_helper): Change return
9444 type to bool. Add pversion parameter. Change all callers.
9445 (script_register_vers_node): Don't require a non-NULL tag.
9446 * script.h (class Version_script_info): Update declarations.
9447 (Version_script_info::get_symbol_version): Change return type to
9448 bool. Add version parameter. Change all callers.
9449 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
9450 handling. Handle an empty version from a version script.
9451 (Symbol_table::define_special_symbol): Likewise.
9452 * testsuite/ver_test_10.script: New file.
9453 * testsuite/ver_test_10.sh: New file.
9454 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
9455 (check_DATA): Add ver_test_10.syms.
9456 (ver_test_10.syms, ver_test_10.so): New target.
9457 * testsuite/Makefile.in: Rebuild.
9458
58e54ac2
CD
94592008-07-23 Simon Baldwin <simonb@google.com>
9460
9461 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
9462 to zero for undefined symbols from dynamic libraries.
9463
95d14cd3
ILT
94642008-07-23 Ian Lance Taylor <iant@google.com>
9465
9466 * symtab.cc (Symbol_table::resolve): Remove version parameter.
9467 Change all callers.
9468 * symtab.h (class Symbol_table): Update declaration.
9469 * testsuite/ver_test_9.cc: New file.
9470 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
9471 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
9472 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
9473 (ver_test_9.so, ver_test_9.o): New targets.
9474 * testsuite/Makefile.in: Rebuild.
9475
92de84a6
ILT
94762008-07-22 Ian Lance Taylor <iant@google.com>
9477
34810851
ILT
9478 * options.h (class General_options): Define --check-sections.
9479 * layout.cc (Layout::set_segment_offsets): Handle
9480 --check-sections.
9481
af6156ef
ILT
9482 * options.h (class General_options): Define -n/--nmagic and
9483 -N/--omagic.
9484 * options.cc (General_options::finalize): For -n/--nmagic or
9485 -N/--omagic, set -static.
9486 * layout.cc (Layout::attach_allocated_section_to_segment): If
9487 -N/--omagic, don't put read-only and read-write sections in
9488 different segments.
9489 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
9490 finding a read-only segment.
9491 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
9492 don't set the minimum segment alignment to the common page size,
9493 and don't set the file offset to the address modulo the page size.
9494 * script-sections.cc (Script_sections::create_segments): If
9495 -n/--omagic, don't put read-only and read-write sections in
9496 different segments.
9497
92de84a6
ILT
9498 * cref.cc: New file.
9499 * cref.h: New file.
9500 * options.h (class General_options): Add --print-symbol-counts.
9501 * main.cc (main): Issue defined symbol report if requested.
9502 * archive.cc (Archive::interpret_header): Make into a const member
9503 function.
9504 (Archive::add_symbols): Call Input_objects::archive_start and
9505 archive_stop.
9506 (Archive::const_iterator): Define new class.
9507 (Archive::begin, Archive::end): New functions.
9508 (Archive::include_all_members): Rewrite to use iterator.
9509 (Archive::count_members): New function.
9510 * archive.h (class Archive): Update declarations.
9511 (Archive::filename): New function.
9512 * object.cc: Include "cref.h".
9513 (Sized_relobj::Sized_relobj): Initialize defined_count_.
9514 (Sized_relobj::do_get_global_symbol_counts): New function.
9515 (Input_objects::add_object): Add object to cross-referencer.
9516 (Input_objects::archive_start): New function.
9517 (Input_objects::archive_stop): New function.
9518 (Input_objects::print_symbol_counts): New function.
9519 * object.h: Declare Cref and Archive.
9520 (Object::get_global_symbol_counts): New function.
9521 (Object::do_get_global_symbol_counts): New pure virtual function.
9522 (class Sized_relobj): Add defined_count_ field. Update
9523 declarations.
9524 (class Input_objects): Add cref_ field. Update constructor.
9525 Update declarations.
9526 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
9527 defined_count_.
9528 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
9529 symbol counts.
9530 (Sized_dynobj::do_get_global_symbol_counts): New function.
9531 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
9532 defined_count_. Update declarations. Define Symbols typedef.
9533 * symtab.cc (Symbol_table::add_from_relobj): Add defined
9534 parameter. Change all callers.
9535 (Symbol_table::add_from_dynobj): Add sympointers and defined
9536 parameters. Change all callers.
9537 * symtab.h (class Symbol_table): Update declarations.
9538 * Makefile.am (CCFILES): Add cref.cc.
9539 (HFILES): Add cref.h.
9540 * Makefile.in: Rebuild.
9541
3f7c5e1d
CD
95422008-07-22 Simon Baldwin <simonb@google.com>
9543
9544 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
9545 to zero when writing undefined symbols.
9546
e0b64032
ILT
95472008-07-22 Ian Lance Taylor <iant@google.com>
9548
9549 * output.cc (Output_section::add_input_section): Don't try to
9550 merge empty merge sections.
9551
096b02cf
CS
95522008-07-21 Craig Silverstein <csilvers@google.com>
9553
9554 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9555 Include symbol version in error message.
cd536b21 9556
1d1f116d
CD
95572008-07-20 Chris Demetriou <cgd@google.com>
9558
cd536b21 9559 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
9560 (RANDOM_SEED_CFLAGS): New substituted variable.
9561 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
9562 * configure: Rebuild.
9563 * Makefile.in: Likewise.
9564 * testsuite/Makefile.in: Likewise.
9565
a18f591e
ILT
95662008-07-18 Ian Lance Taylor <iant@google.com>
9567
9568 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
9569 where we see NAME/NULL and NAME/VERSION as separate symbols.
9570 * testsuite/ver_test_main.cc (main): Call t4.
9571 (t4, t4_2a): Define.
9572 * testsuite/ver_test_2.cc (t4_2): Define.
9573 * testsuite/ver_test_2.script: Put t4_2a in VER2.
9574 * testsuite/ver_test_4.cc (t4_2a): Define.
9575 * testsuite/ver_test_4.script: Put t4_2a in VER2.
9576 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
9577
c6e3f6ed
ILT
95782008-07-17 Ian Lance Taylor <iant@google.com>
9579
9580 * dynobj.cc (Versions::add_def): If we give an error about a
9581 missing version, go ahead and create the version anyhow.
9582
ef9beddf
ILT
95832008-07-10 Ian Lance Taylor <iant@google.com>
9584
9585 Handle output sections with more than 0x7fffffff bytes.
9586 * object.h (class Relobj): Change map_to_output_ to
9587 output_sections_, and just keep a section pointer. Change all
9588 uses. Move comdat group support to Sized_relobj.
9589 (Relobj::is_section_specially_mapped): Remove.
9590 (Relobj::output_section): Remove poff parameter. Change all
9591 callers.
9592 (Relobj::output_section_offset): New function.
9593 (Relobj::set_section_offset): Rewrite.
9594 (Relobj::map_to_output): Remove.
9595 (Relobj::output_sections): New function.
9596 (Relobj::do_output_section_offset): New pure virtual function.
9597 (Relobj::do_set_section_offset): Likewise.
9598 (class Sized_relobj): Add section_offsets_ field. Add comdat
9599 group support from Relobj. Update declarations.
9600 (Sized_relobj::get_output_section_offset): New function.
9601 (Sized_relobj::do_output_section_offset): New function.
9602 (Sized_relobj::do_set_section_offset): New function.
9603 * object.cc (Relobj::output_section_address): Remove.
9604 (Sized_relobj::Sized_relobj): Initialize new fields.
9605 (Sized_relobj::include_section_group): Cast find_kept_object to
9606 Sized_relobj.
9607 (Sized_relobj::include_linkonce_section): Likewise.
9608 (Sized_relobj::do_layout): Use separate arrays for output section
9609 and output offset.
9610 (Sized_relobj::do_count_local_symbols): Change map_to_output to
9611 output_sections.
9612 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
9613 output_sections and section_offsets.
9614 (Sized_relobj::write_local_symbols): Likewise.
9615 (map_to_kept_section): Compute output address directly.
9616 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
9617 output_sections and section_offsets.
9618 (Sized_relobj::write_sections): Likewise.
9619 (Sized_relobj::relocate_sections): Likewise.
9620 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
9621 * output.h (class Output_reloc): Update declarations. Change
9622 u2_.relobj to Sized_relobj*.
9623 (class Output_data_reloc): Change add functions to use
9624 Sized_relobj*.
9625 * output.cc (Output_reloc::Output_reloc): Change relobj to
9626 Sized_relobj*.
9627 (Output_reloc::local_section_offset): Change return type to
9628 Elf_Addr. Use get_output_section_offset.
9629 (Output_reloc::get_address): Likewise.
9630 (Output_section::is_input_address_mapped): Don't call
9631 is_section_specially_mapped.
9632 (Output_section::output_offset): Likewise.
9633 (Output_section::output_address): Likewise.
9634 (Output_section::starting_output_address): Likewise.
9635 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
9636 parameter to Sized_relobj*.
9637 (Copy_relocs::need_copy_reloc): Likewise.
9638 (Copy_relocs::save): Likewise.
9639 * copy-relocs.h (class Copy_relocs): Update declarations.
9640 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
9641 Sized_relobj*. Change relobj_ field to Sized_relobj*.
9642 * target-reloc.h (relocate_for_relocatable): Change
9643 offset_in_output_section type to Elf_Addr. Change code that uses
9644 it as well.
9645 * layout.cc (Layout::layout): Always set *off.
9646 * mapfile.cc (Mapfile::print_input_section): Use
9647 output_section_offset.
9648 * i386.cc (Target_i386::copy_reloc): Change object parameter to
9649 Sized_relobj*.
9650 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
9651 * sparc.cc (Target_sparc::copy_reloc): Likewise.
9652 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
9653
5cb66f97
ILT
96542008-07-03 Ian Lance Taylor <iant@google.com>
9655
9656 * layout.cc (Layout::include_section): Do not discard unrecognized
9657 SHT_STRTAB sections.
9658
afe47622
CS
96592008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
9660
9661 * script.cc (Lex::can_continue_name): Make '?' allowable in
9662 version-script names.
9663 * testsuite/version_script.map: Change glob pattern to use '?'
9664
5adf9721
ILT
96652008-06-30 Manish Singh <yosh@gimp.org>
9666
9667 PR 6585
9668 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
9669 Correct typo.
9670
e6fde208
ILT
96712008-06-30 Ian Lance Taylor <iant@google.com>
9672
9673 PR 6660
9674 PR 6682
9675 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
9676 versions]: Don't try to read the value in the contents, since we
9677 don't use it. Use the template endianness when writing.
9678
3f2e6a2d
CC
96792008-06-25 Cary Coutant <ccoutant@google.com>
9680
9681 * fileread.cc (File_read::make_view): Assert on zero-length view.
9682 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
9683 symbol table when there are no symbols to read.
9684
c43d3a48
CS
96852008-06-23 Craig Silverstein <csilvers@google.com>
9686
9687 * version.cc (version_string): Bump to 1.7
9688
5f494ea0
CS
96892008-06-18 Craig Silverstein <csilvers@google.com>
9690
9691 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
9692 constant 0xFFFF to type Valtype.
9693 (Powerpc_relocate_functions::rel16_ha): Likewise.
9694
c42e122e
ILT
96952008-06-17 Ian Lance Taylor <iant@google.com>
9696
f34787f8
ILT
9697 * output.h (Output_section::Input_section): Initialize p2align_ to
9698 zero for Output_section_data constructors.
9699 (Output_section::Input_section::addralign): If not an input
9700 section, return the alignment of the Output_section_data.
9701 * testsuite/copy_test.cc: New file.
9702 * testsuite/copy_test_1.cc: New file.
9703 * testsuite/copy_test_2.cc: New file.
9704 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
9705 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
9706 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
9707 (copy_test_1_pic.o, copy_test_1.so): New targets.
9708 (copy_test_2_pic.o, copy_test_2.so): New targets.
9709 * testsuite/Makefile.in: Rebuild.
9710
c42e122e
ILT
9711 * script-sections.cc (Script_sections::place_orphan): Initialize
9712 local variable exact.
9713
ce3ac18a
DE
97142008-06-13 David Edelsohn <edelsohn@gnu.org>
9715
9716 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
9717
42cacb20
DE
97182008-06-12 David Edelsohn <edelsohn@gnu.org>
9719 David S. Miller <davem@davemloft.net>
9720
9721 * powerpc.cc: New file.
9722 * Makefile.am (TARGETSOURCES): Add powerpc.cc
9723 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
9724 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
9725 * Makefile.in: Rebuild.
9726
7b308235
ILT
97272008-06-09 Ian Lance Taylor <iant@google.com>
9728
9729 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
9730 <exception>.
9731 (throwing, orig_terminate): New static variables.
9732 (terminate_handler): New static function.
9733 (t2): Set terminate handler.
9734
f0b886e3
ILT
97352008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
9736
9737 PR 6584
cd536b21 9738 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
9739 alignment.
9740
3e90f135
CC
97412008-05-30 Cary Coutant <ccoutant@google.com>
9742
9743 * archive.cc (Archive::include_all_members) Correct to step
9744 over symbol table and extended name table in thin archives.
9745
e09ad04a
ILT
97462008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
9747
9748 PR 6407
9749 * target-reloc.h (relocate_for_relocatable): Fix new_offset
9750 calculation.
9751
62b01cb5
ILT
97522008-05-28 Caleb Howe <cshowe@google.com>
9753
9754 * reduced_debug_output.cc: New file.
9755 * reduced_debug_output.h: New file.
92de84a6 9756 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
9757 * options.cc (General_options::finalize): Add strip_debug_non_line
9758 to the strip heirarchy.
9759 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
9760 fields.
9761 * layout.cc: Include "reduced_debug_output.h".
9762 (Layout::Layout): Initialize new fields.
9763 (line_only_debug_sections): New static array.
9764 (is_lines_only_debug_sections): New static inline function.
9765 (Layout::include_section): Handle --strip-debug-non-line.
9766 (Layout::make_output_section): If --strip-debug-non-line, build
9767 new output sections for .debug_abbrev and .debug_info.
9768 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
9769 gold. Warn about possible overflow.
9770 (read_signed_LEB_128): Likewise.
9771 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
9772 (read_signed_LEB_128): Declare.
9773 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
9774 (HFILES): Add reduced_debug_output.h.
9775 * Makefile.in: Rebuild.
9776
7d9e3d98
ILT
97772008-05-21 Ian Lance Taylor <iant@google.com>
9778
9779 * mapfile.cc: New file.
9780 * mapfile.h: New file.
9781 * options.h (class General_options): Add -M/--print-map and -Map.
9782 * options.cc (General_options::finalize): Make -M equivalent to
9783 -Map -.
9784 * main.cc: Include <cstdio> and "mapfile.h".
9785 (main): Open mapfile if requested.
9786 * gold.cc (class Middle_runner): Add mapfile_ field. Update
9787 constructor. Change caller.
9788 (queue_initial_tasks): Add mapfile parameter. Change caller.
9789 (queue_middle_tasks): Likewise.
9790 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
9791 declarations.
9792 * archive.cc: Include "mapfile.h".
9793 (Archive::add_symbols): Add mapfile parameter. Change all
9794 callers. Pass mapfile, symbol, and reason to include_member.
9795 (Archive::include_all_members): Add mapfile parameter. Change all
9796 callers.
9797 (Archive::include_member): Add mapfile, sym, and why parameters.
9798 Change all callers. Report inclusion to map file.
9799 * archive.h: Include "fileread.h".
9800 (class Archive): Update declarations.
9801 (Archive::file): New const method.
9802 (class Add_archive_symbols): Add mapfile_ field. Update
9803 constructor. Change all callers.
9804 * readsyms.h (class Read_symbols): Likewise.
9805 (class Finish_group): Likewise.
9806 (class Read_script): Likewise.
9807 * common.cc: Include "mapfile.h".
9808 (Symbol_table::allocate_commons): Add mapfile parameter. Change
9809 all callers.
9810 (Symbol_table::do_allocate_commons): Likewise.
9811 (Symbol_table::do_allocate_commons_list): Likewise. Report common
9812 symbol allocation to mapfile.
9813 * common.h (class Allocate_commons_task): Add mapfile_ field.
9814 Update constructor. Change all callers.
9815 * symtab.h (class Symbol_table): Update declarations.
9816 * layout.cc: Include "mapfile.h".
9817 (Layout_task_runner::run): Print information to mapfile.
9818 (Layout::create_gold_note): Change Output_data_fixed_space to
9819 Output_data_zero_fill.
9820 (Layout::create_build_id): Likewise.
9821 (Layout::print_to_mapfile): New function.
9822 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
9823 constructor. Change caller.
9824 (class Layout): Declare print_to_mapfile.
9825 * output.cc (Output_section::Input_section::print_to_mapfile): New
9826 function.
9827 (Output_section::add_input_section): If producing a map, always
9828 add to input_sections_ list.
9829 (Output_section::do_print_to_mapfile): New function.
9830 (Output_segment::print_sections_to_mapfile): New function.
9831 (Output_segment::print_section_list_to_mapfile): New function.
9832 * output.h: Include "mapfile.h".
9833 (Output_data::print_to_mapfile): New function.
9834 (Output_data::do_print_to_mapfile): New virtual function.
9835 (Output_segment_headers::do_print_to_mapfile): New function.
9836 (Output_file_header::do_print_to_mapfile): New function.
9837 (Output_data_const::do_print_to_mapfile): New function.
9838 (class Output_data_const_buffer): Add map_name_ field. Update
9839 constructor. Change all callers. Add do_print_to_mapfile
9840 function.
9841 (class Output_data_fixed_space): Likewise.
9842 (class Output_data_space): Likewise.
9843 (class Output_data_zero_fill): New class.
9844 (Output_data_strtab::do_print_to_mapfile): New function.
9845 (Output_data_reloc_base::do_print_to_mapfile): New function.
9846 (Output_relocatable_relocs::do_print_to_mapfile): New function.
9847 (Output_data_group::do_print_to_mapfile): New function.
9848 (Output_data_got::do_print_to_mapfile): New function.
9849 (Output_data_dynamic::do_print_to_mapfile): New function.
9850 (Output_symtab_xindex::do_print_to_mapfile): New function.
9851 (class Output_section): Declare do_print_to_mapflie. Declare
9852 print_to_mapfile in Input_section.
9853 (class Output_segment): Declare new functions.
9854 * object.h (Sized_relobj::symbol_count): New function.
9855 * script-sections.cc
9856 (Output_section_element_dot_assignment::set_section_addresses):
9857 Change Output_data_fixed_space to Output_data_zero_fill.
9858 (Output_data_expression::do_print_to_mapfile): New function.
9859 * script.cc (read_input_script): Add mapfile parameter. Change
9860 all callers.
9861 * script.h (read_input_script): Update declaration.
9862 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
9863 (Eh_frame::do_print_to_mapfile): New function.
9864 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
9865 (Output_merge_string::do_print_to_mapfile): New function.
9866 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
9867 function.
9868 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
9869 function.
9870 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
9871 function.
9872 * Makefile.am (CCFILES): Add mapfile.cc.
9873 (HFILES): Add mapfile.h.
9874 * Makefile.in: Rebuild.
9875
9f1d377b
ILT
98762008-05-19 Ian Lance Taylor <iant@google.com>
9877
9878 * options.h (class General_options): Add -z relro.
9879 * layout.cc (Layout::Layout): Initialize relro_segment_.
9880 (Layout::add_output_section_data): Return the output section.
9881 (Layout::make_output_section): Rcognize relro sections and mark
9882 them appropriately.
9883 (Layout::attach_allocated_section_to_segment): Put relro sections
9884 in a PT_GNU_RELRO segment.
9885 (Layout::create_initial_dynamic_sections): Mark the .dynamic
9886 section as relro.
9887 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
9888 PT_TLS segments.
9889 (Layout::linkonce_mapping): Map d.rel.ro.local to
9890 .data.rel.ro.local.
9891 (Layout::output_section_name): Us .data.rel.ro.local for any
9892 section which begins with that.
9893 * layout.h (class Layout): Update add_output_section_data
9894 declaration. Add relro_segment_ field.
9895 * output.cc (Output_section::Output_section): Initialize is_relro_
9896 and is_relro_local_ fields.
9897 (Output_segment::add_output_section): Group relro sections.
9898 (Output_segment::is_first_section_relro): New function.
9899 (Output_segment::maximum_alignment): If there is a relro section,
9900 align the segment to the common page size.
9901 (Output_segment::set_section_addresses): Track whether we are
9902 looking at relro sections. If the last section is a relro
9903 section, align to the common page size.
9904 (Output_segment::set_section_list_addresses): Add in_relro
9905 parameter. Change all callers. Align to the page size when
9906 moving from relro to non-relro section.
9907 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
9908 segment.
9909 * output.h (class Output_section): Add is_relro_ and
9910 is_relro_local_ fields.
9911 (Output_section::is_relro): New function.
9912 (Output_section::set_is_relro): New function.
9913 (Output_section::is_relro_local): New function.
9914 (Output_section::set_is_relro_local): New function.
9915 (class Output_segment): Update declarations.
9916 * i386.cc (Target_i386::got_section): Mark .got section as relro.
9917 * sparc.cc (Target_sparc::got_section): Likewise.
9918 * x86_64.cc (Target_x86_64::got_section): Likewise.
9919 * testsuite/relro_test_main.cc: New file.
9920 * testsuite/relro_test.cc: New file.
9921 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
9922 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
9923 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
9924 (relro_test.so, relro_test_pic.o): New targets.
9925 * testsuite/Makefile.in: Rebuild.
9926
a984ee1d
ILT
99272008-05-16 Ian Lance Taylor <iant@google.com>
9928
01676dcd
ILT
9929 * output.cc (Output_segment::add_output_section): Remove front
9930 parameter.
9931 * output.h (class Output_segment): Remove
9932 add_initial_output_section and overloaded add_output_section.
9933 Update declaration of remaining add_output_section.
9934 * layout.cc (Layout::create_interp): Call add_output_section
9935 rather than add_initial_output_section.
9936 (Layout::finish_dynamic_section): Likewise.
9937
497897f9
ILT
9938 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
9939 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
9940 know the dynamic type.
9941 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
9942 field. Initialize it in constructor.
9943 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
9944 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
9945 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
9946 reloc.
9947
a984ee1d
ILT
9948 * output.cc (Output_reloc::get_address): Change return type to
9949 Elf_Addr.
9950 * output.h (class Output_reloc): Update get_address declaration.
9951 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
9952 for section addresses.
9953
55ba0940
ILT
99542008-05-09 Ian Lance Taylor <iant@google.com>
9955
9956 PR 6493
9957 * gold.cc (gold_nomem): Use return value of write.
9958
75517b77
ILT
99592008-05-08 Ian Lance Taylor <iant@google.com>
9960
9961 * symtab.c (Symbol::init_base_output_data): Add version
9962 parameter. Change all callers.
9963 (Symbol::init_base_output_segment): Likewise.
9964 (Symbol::init_base_constant): Likewise.
9965 (Symbol::init_base_undefined): Likewise.
9966 (Sized_symbol::init_output_data): Likewise.
9967 (Sized_symbol::init_output_segment): Likewise.
9968 (Sized_symbol::init_constant): Likewise.
9969 (Sized_symbol::init_undefined): Likewise.
9970 (Symbol_table::do_define_in_output_data): If the new symbol has a
9971 version, mark it as the default.
9972 (Symbol_table::do_define_in_output_segment): Likewise.
9973 (Symbol_table::do_define_as_constant): Likewise.
9974 * symtab.h (class Symbol): Update declarations.
9975 (class Sized_symbol): Likewise.
9976 * resolve.cc (Symbol::override_version): New function.
c42e122e 9977 (Symbol::override_base): Call override_version.
75517b77
ILT
9978 (Symbol::override_base_with_special): Likewise.
9979 * testsuite/ver_script_8.script: New file.
9980 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
9981 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
9982 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
9983 (ver_test_8_1.so, ver_test_8_2.so): New targets.
9984
f1f70eae
ILT
99852008-05-06 Ian Lance Taylor <iant@google.com>
9986
f3e9c5c5
ILT
9987 PR 6049
9988 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
9989 functions.
9990 (class General_options): Remove existing --undefined, and add
9991 --no-undefined instead. Add new --undefined as synonym for -u.
9992 * archive.cc (Archive::add_symbols): Check whether symbol was
9993 named with -u.
9994 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
9995 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
9996 all uses. Add IS_UNDEFINED. Update declarations to split
9997 different versions of init_base. Declare init_base_undefined.
9998 (Symbol::is_defined): Handle IS_UNDEFINED.
9999 (Symbol::is_undefined): Likewise.
10000 (Symbol::is_weak_undefined): Call is_undefined.
10001 (Symbol::is_absolute): Handle IS_CONSTANT.
10002 (class Sized_symbol): Update declarations to split different
10003 versions of init. Declare init_undefined.
10004 (class Symbol_table): Declare new functions.
10005 * symtab.cc (Symbol::init_base_object): Rename from init_base.
10006 Change all callers.
10007 (Symbol::init_base_output_data): Likewise.
10008 (Symbol::init_base_output_segment): Likewise.
10009 (Symbol::init_base_constant): Likewise.
10010 (Symbol::init_base_undefined): New function.
10011 (Sized_symbol::init_object): Rename from init. Change all
10012 callers.
10013 (Sized_symbol::init_output_data): Likewise.
10014 (Sized_symbol::init_output_segment): Likewise.
10015 (Sized_symbol::init_constant): Likewise.
10016 (Sized_symbol::init_undefined): New function.
10017 (Symbol_table::add_undefined_symbols_from_command_line): New
10018 function.
10019 (Symbol_table::do_add_undefined_symbols_from_command_line): New
10020 function.
10021 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
10022 (Symbol::output_section): Likewise.
10023 (Symbol::set_output_section): Likewise.
10024 (Symbol_table::sized_finalize_symbol): Likewise.
10025 (Symbol_table::sized_write_globals): Likewise.
10026 * resolve.cc (Symbol_table::should_override): Likewise.
10027 (Symbol::override_base_with_special): Likewise.
10028
8bdcdf2c
ILT
10029 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
10030 symbol, change it to have default visibility.
10031 * testsuite/protected_1.cc: New file.
10032 * testsuite/protected_2.cc: New file.
10033 * testsuite/protected_3.cc: New file.
10034 * testsuite/protected_main_1.cc: New file.
10035 * testsuite/protected_main_2.cc: New file.
10036 * testsuite/protected_main_3.cc: New file.
10037 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
10038 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
10039 (protected_1_LDFLAGS, protected_1_LDADD): Define.
10040 (protected_1.so): New target.
10041 (protected_1_pic.o, protected_2_pic.o): New targets.
10042 (protected_3_pic.o): New target.
10043 (check_PROGRAMS): Add protected_2.
10044 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
10045 (protected_2_LDFLAGS, protected_2_LDADD): Define.
10046 * testsuite/Makefile.in: Rebuild.
10047
2b706932
ILT
10048 * options.h (DEFINE_var): Add set_user_set_##varname__.
10049 (DEFINE_bool_alias): New macro.
10050 (class General_options): Define -Bstatic using DEFINE_bool_alias
10051 rather than DEFINE_special. Add --undefined as an alias for -z
10052 defs.
10053 * options.cc (General_options::parse_Bstatic): Remove.
10054
d82a5bcc
ILT
10055 * options.h (class General_options): Add --fatal-warnings.
10056 * main.cc (main): Implement --fatal-warnings.
10057 * errors.h (Errors::warning_count): New function.
10058
f1f70eae
ILT
10059 * options.h (class General_options): Add -Bsymbolic-functions.
10060 * symtab.h (Symbol::is_preemptible): Check for
10061 -Bsymbolic-functions.
10062
8825ac63
ILT
100632008-05-05 Ian Lance Taylor <iant@google.com>
10064
d98bc257
ILT
10065 * options.h (DEFINE_bool): For DASH_Z, create the negative option
10066 as noVARNAME rather than no-VARNAME.
10067 (class General_options): Add option -z combreloc.
10068 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
10069 get_address.
10070 (Output_reloc::sort_before) [SHT_REL]: New function.
10071 (Output_reloc::sort_before) [SHT_RELA]: New function.
10072 (class Output_data_reloc_base): Add sort_relocs_ field. Define
10073 Sort_relocs_comparison.
10074 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
10075 parameter. Change all callers.
10076 (Output_data_reloc::Output_data_reloc) [both versions]: Add
10077 sort_relocs parameter. Change all callers.
10078 * output.cc (Output_reloc::get_address): New function, broken out
10079 of write_rel.
10080 (Output_reloc::write_rel): Call it.
10081 (Output_reloc::compare): New function.
10082 (Output_data_reloc_base::do_write): Optionally sort relocs.
10083
60b2b4e7
ILT
10084 * configure.ac: If targ_extra_obj is set, link it in.
10085 * configure.tgt: Initialize all variables.
10086 (x86_64*): Set targ_extra_obj and targ_extra_size.
10087 * configure: Rebuild.
10088
8825ac63
ILT
10089 * object.cc (Sized_relobj::include_section_group): Adjust section
10090 indexes read from group data. Build vector to pass to
10091 layout_group.
10092 * layout.cc (Layout::layout_group): Add flags and shndxes
10093 parameters. Remove contents parameter. Change caller. Update
10094 explicit instantiations.
10095 * layout.h (class Layout): Update layout_group declaration.
10096 * output.cc (Output_data_group::Output_data_group): Add flags and
10097 input_shndxes parameters. Remove contents parameter. Change
10098 caller.
10099 (Output_data_group::do_write): Change input_sections_ to
10100 input_shndxes_.
10101 * output.h (class Output_data_group): Update constructor
10102 declaration. Rename input_sections_ to input_shndxes_.
10103 * testsuite/many_sections_test.cc: Add template.
10104
e94cf127
CC
101052008-04-30 Cary Coutant <ccoutant@google.com>
10106
4418b2d5
CC
10107 * target-reloc.h (relocate_section): Fix dead-pointer bug.
10108
e94cf127
CC
10109 * layout.cc (Layout::include_section): Refactored check for debug
10110 info section.
10111 (Layout::add_comdat): Add new parameters. Change type
10112 of signature parameter. Add object and shndx to signatures table.
10113 (Layout::find_kept_object): New function.
10114 * layout.h: Include <cstring>.
10115 (Layout::is_debug_info_section): New function.
10116 (Layout::add_comdat): Add new parameters.
10117 (Layout::find_kept_object): New function.
10118 (Layout::Kept_section): New struct.
10119 (Layout::Signatures): Change type of map range.
10120 * object.cc (Relobj::output_section_address): New function.
10121 (Sized_relobj::include_section_group): Add new parameters. Change
10122 calls to Layout::add_comdat. Change to build table of kept comdat
10123 groups and table mapping discarded sections to kept sections.
10124 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
10125 (Sized_relobj::do_layout): Change calls to include_section_group and
10126 include_linkonce_section.
10127 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
10128 value to zero when section is discarded.
10129 (Sized_relobj::map_to_kept_section): New function.
10130 * object.h (Relobj::output_section_address): New function.
10131 (Relobj::Comdat_group): New type.
10132 (Relobj::find_comdat_group): New function.
10133 (Relobj::Comdat_group_table): New type.
10134 (Relobj::Kept_comdat_section): New type.
10135 (Relobj::Kept_comdat_section_table): New type.
10136 (Relobj::add_comdat_group): New function.
10137 (Relobj::set_kept_comdat_section): New function.
10138 (Relobj::get_kept_comdat_section): New function.
10139 (Relobj::comdat_groups_): New field.
10140 (Relobj::kept_comdat_sections_): New field.
10141 (Symbol_value::input_value): Update comment.
10142 (Sized_relobj::map_to_kept_section) New function.
10143 (Sized_relobj::include_linkonce_section): Add new parameter.
10144 * target-reloc.h (Comdat_behavior): New type.
10145 (get_comdat_behavior): New function.
10146 (relocate_section): Add code to map a discarded section to the
10147 corresponding kept section when applying a relocation.
10148
e4e5049b
CS
101492008-04-30 Craig Silverstein <csilvers@google.com>
10150
10151 * dwarf_reader.cc (next_generation_count): New static var.
10152 (Addr2line_cache_entry): New struct.
10153 (addr2line_cache): New static var.
10154 (Dwarf_line_info::one_addr2line): Added caching.
10155 (Dwarf_line_info::clear_addr2line_cache): New function.
10156 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
10157 cache-size parameter.
10158 (Dwarf_line_info::one_addr2line_cache): New function.
10159 * symtab.cc (Symbol_table::detect_odr_violations): Pass
10160 new cache-size argument to one_addr2line(), and clear cache.
10161
d09e9154
CC
101622008-04-28 Cary Coutant <ccoutant@google.com>
10163
10164 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
10165 R_386_PC8 relocations.
10166
7ef73768
ILT
101672008-04-23 Ian Lance Taylor <iant@google.com>
10168
55438702
ILT
10169 * object.cc (Sized_relobj::include_section_group): Check for
10170 invalid section group.
10171
c165fb93
ILT
10172 * object.cc (make_elf_object): Correct test for 64-bit ELF file
10173 header size.
10174
7ef73768
ILT
10175 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
10176 than read for file header.
10177 * archive.cc (Archive::include_member): Likewise.
10178
6194aaab
L
101792008-04-23 Paolo Bonzini <bonzini@gnu.org>
10180
10181 * aclocal.m4: Regenerate.
10182 * configure: Regenerate.
10183
d491d34e
ILT
101842008-04-19 Ian Lance Taylor <iant@google.com>
10185
5ea2bac6
ILT
10186 * version.cc (version_string): Bump to 1.6.
10187
7bc3e21a
ILT
10188 * testsuite/Makefile.am (many_sections_r_test): New target.
10189 (many_sections_r_test_SOURCES): Remove.
10190 (many_sections_r_test_DEPENDENCIES): Remove.
10191 (many_sections_r_test_LDFLAGS): Remove.
10192 (many_sections_r_test_LDADD): Remove.
10193
7fcd3aa9
ILT
10194 * object.cc (Sized_relobj::do_add_symbols): Always pass
10195 local_symbol_count_ to add_from_relobj.
10196
4c94d6ae
ILT
10197 * testsuite/Makefile.am (many_sections_check.h): Only check one in
10198 every thousand variables.
10199 * testsuite/Makefile.in: Rebuild.
10200
d491d34e
ILT
10201 * object.cc (Xindex::initialize_symtab_xindex): New function.
10202 (Xindex::read_symtab_xindex): New function.
10203 (Xindex::sym_xindex_to_shndx): New function.
10204 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
10205 available.
10206 (Sized_relobj::do_initialize_xindex): New function.
10207 (Sized_relobj::do_read_symbols): Adjust section links.
10208 (Sized_relobj::symbol_section_and_value): Add is_ordinary
10209 parameter. Change all callers.
10210 (Sized_relobj::include_section_group): Adjust section links and
10211 symbol section indexes.
10212 (Sized_relobj::do_layout): Adjust section links.
10213 (Sized_relobj::do_count_local_symbols): Adjust section links and
10214 symbol section indexes.
10215 (Sized_relobj::do_finalize_local_symbols): Distinguish between
10216 ordinary and special symbols.
10217 (Sized_relobj::write_local_symbols): Add symtab_xindex and
10218 dynsym_xindex parameters. Change all callers. Adjust section
10219 links. Use SHN_XINDEX when needed.
10220 (Sized_relobj::get_symbol_location_info): Adjust section links.
10221 Don't get fooled by special symbols.
10222 * object.h (class Xindex): Define.
10223 (class Object): Add xindex_ parameter. Declare virtual functoin
10224 do_initialize_xindex.
10225 (Object::adjust_sym_shndx): New function.
10226 (Object::set_xindex): New protected function.
10227 (class Symbol_value): Add is_ordinary_shndx_ field.
10228 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
10229 (Symbol_value::value): Assert ordinary section.
10230 (Symbol_value::initialize_input_to_output_map): Likewise.
10231 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
10232 Change all callers.
10233 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
10234 all callers.
10235 (class Sized_relobj): Update declarations.
10236 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
10237 parameter. Change all callers.
10238 (Sized_relobj::adjust_shndx): New function.
10239 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
10240 field.
10241 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
10242 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
10243 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
10244 (Sized_dynobj::read_dynsym_section): Adjust section links.
10245 (Sized_dynobj::read_dynamic): Likewise.
10246 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
10247 section links.
10248 (Sized_dynobj::do_initialize_xindex): New function.
10249 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
10250 do_initialize_xindex.
10251 (Sized_dynobj::adjust_shndx): New function.
10252 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
10253 dynsym_xindex_ fields.
10254 (Layout::finalize): Add a call to set_section_indexes before
10255 creating the symtab sections.
10256 (Layout::set_section_indexes): Don't do anything if the section
10257 already has a section index.
10258 (Layout::create_symtab_sections): Add shnum parameter. Change
10259 caller. Create .symtab_shndx section if needed.
10260 (Layout::create_shdrs): Add shstrtab_section parameter. Change
10261 caller.
10262 (Layout::allocated_output_section_count): New function.
10263 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
10264 needed.
10265 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
10266 fields. Update declarations.
10267 (Layout::symtab_xindex): New function.
10268 (Layout::dynsym_xindex): New function.
10269 (class Write_symbols_task): Add layout_ field.
10270 (Write_symbols_task::Write_symbols_task): Add layout parameter.
10271 Change caller.
10272 * output.cc (Output_section_headers::Output_section_headers): Add
10273 shstrtab_section parameter. Change all callers.
10274 (Output_section_headers::do_sized_write): Store overflow values
10275 for section count and section string table section index in
10276 section header zero.
10277 (Output_file_header::do_sized_write): Check for overflow of
10278 section count and section string table section index.
10279 (Output_symtab_xindex::do_write): New function.
10280 (Output_symtab_xindex::endian_do_write): New function.
10281 * output.h (class Output_section_headers): Add shstrtab_section_.
10282 Update declarations.
10283 (class Output_symtab_xindex): Define.
10284 (Output_section::has_out_shndx): New function.
10285 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
10286 field.
10287 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
10288 Change all callers.
10289 (Sized_symbol::init): Likewise.
10290 (Symbol::output_section): Check for ordinary symbol.
10291 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
10292 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
10293 callers.
10294 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
10295 Change all callers. Simplify handling of symbols from sections
10296 not included in the link.
10297 (Symbol_table::add_from_dynobj): Handle ordinary symbol
10298 distinction.
10299 (Weak_alias_sorter::operator()): Assert that symbols are
10300 ordinary.
10301 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
10302 distinction.
10303 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
10304 parameters. Change all callers.
10305 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
10306 symbol distinction. Use SHN_XINDEX when needed.
10307 (Symbol_table::write_section_symbol): Add symtab_xindex
10308 parameter. Change all callers.
10309 (Symbol_table::sized_write_section_symbol): Likewise. Use
10310 SHN_XINDEX when needed.
10311 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
10312 declarations.
10313 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
10314 (Symbol::is_defined): Check is_ordinary.
10315 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
10316 (Symbol::is_absolute, Symbol::is_common): Likewise.
10317 (class Sized_symbol): Update declarations.
10318 (class Symbol_table): Update declarations.
10319 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
10320 parameters. Change all callers.
10321 (Sized_symbol::override): Likewise.
10322 (Symbol_table::override): Likewise.
10323 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
10324 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
10325 is_ordinary, and orig_st_shndx parameters. Change all callers.
10326 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
10327 to be in an ordinary section.
10328 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
10329 object and is_ordinary parameters. Change all callers.
10330 (Sized_dwarf_line_info::read_relocs): Add object parameter.
10331 Change all callers. Don't add undefined or non-ordinary symbols
10332 to reloc_map_.
10333 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
10334 Change all callers.
10335 * dwarf_reader.h (class Sized_dwarf_line_info): Update
10336 declarations.
10337 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
10338 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
10339 (Sized_relobj::relocate_sections): Likewise.
10340 * target-reloc.h (scan_relocs): Adjust section symbol index.
10341 (scan_relocatable_relocs): Likewise.
10342 * i386.cc (Scan::local): Check for ordinary symbols.
10343 * sparc.cc (Scan::local): Likewise.
10344 * x86_64.cc (Scan::local): Likewise.
10345 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
10346 to symbol_section_and_value.
10347 * testsuite/many_sections_test.cc: New file.
10348 * testsuite/Makefile.am (BUILT_SOURCES): Define.
10349 (check_PROGRAMS): Add many_sections_test.
10350 (many_sections_test_SOURCES): Define.
10351 (many_sections_test_DEPENDENCIES): Define.
10352 (many_sections_test_LDFLAGS): Define.
10353 (BUILT_SOURCES): Add many_sections_define.h.
10354 (many_sections_define.h): New target.
10355 (BUILT_SOURCES): Add many_sections_check.h.
10356 (many_sections_check.h): New target.
10357 (check_PROGRAMS): Add many_sections_r_test.
10358 (many_sections_r_test_SOURCES): Define.
10359 (many_sections_r_test_DEPENDENCIES): Define.
10360 (many_sections_r_test_LDFLAGS): Define.
10361 (many_sections_r_test_LDADD): Define.
10362 (many_sections_r_test.o): New target.
10363 * testsuite/Makefile.in: Rebuild.
10364
c5818ff1
CC
103652008-04-17 Cary Coutant <ccoutant@google.com>
10366
10367 * errors.cc (Errors::info): New function.
10368 (gold_info): New function.
10369 * errors.h (Errors::info): New function.
10370 * gold.h (gold_info): New function.
10371 * object.cc (Input_objects::add_object): Print trace output.
10372 * options.cc (options::parse_set): New function.
10373 (General_options::parse_wrap): Deleted.
10374 (General_options::General_options): Deleted initializer.
10375 * options.h (options::String_set): New typedef.
10376 (options::parse_set): New function.
10377 (DEFINE_set): New macro.
10378 (General_options::wrap): Changed to use DEFINE_set. Changed
10379 callers of any_wrap_symbols and is_wrap_symbol.
10380 (General_options::trace, General_options::trace_symbol):
10381 New options.
10382 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
10383 (General_options::wrap_symbols_): Deleted.
10384 * symtab.cc (Symbol_table::add_from_object): Print trace output.
10385
b5be4a7c
DM
103862008-04-17 David S. Miller <davem@davemloft.net>
10387
10388 * options.cc (General_options::parse_V): New function.
10389 * options.h: Add entries for -V and -Qy.
10390
155a0dd7
ILT
103912008-04-17 Ian Lance Taylor <iant@google.com>
10392
10393 * common.cc (Symbol_table::allocate_commons): Remove options
10394 parameter. Change caller.
10395 (Symbol_table::do_allocate_commons): Remove options parameter.
10396 Change caller. Just call do_allocate_commons_list twice.
10397 (Symbol_table::do_allocate_commons_list): New function, broken out
10398 of do_allocate_commons.
10399 * common.h (class Allocate_commons_task): Remove options_ field.
10400 Update constructor.
10401 * symtab.cc (Symbol_table::Symbol_table): Initialize
10402 tls_commons_.
10403 (Symbol_table::add_from_object): Put TLS common symbols on
10404 tls_commons_ list.
10405 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
10406 which are IN_OUTPUT_DATA.
10407 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
10408 allocate_commons and do_allocate_commons declarations. Declare
10409 do_allocate_commons_list.
10410 * gold.cc (queue_middle_tasks): Update creation of
10411 Allocate_commons_task to not pass options.
10412 * testsuite/Makefile.am (INCLUDES): Add -I.. .
10413 (TLS_TEST_C_FLAGS): New variable.
10414 (tls_test_c_pic.o): New target.
10415 (tls_test_shared.so): Link in tls_test_c_pic.o.
10416 (tls_test_c_pic_ie.o): New target.
10417 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
10418 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
10419 (tls_test_c.o): New target.
10420 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
10421 (tls_pic_test_LDADD): Likewise.
10422 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
10423 (tls_shared_gd_to_ie_test_LDADD): Likewise.
10424 (tls_test_c_gnu2.o): New target.
10425 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
10426 tls_test_c_gnu2.o.
10427 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
10428 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
10429 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
10430 * testsuite/tls_test.cc: Include "config.h".
10431 (t_last): Call t11_last.
10432 * testsuite/tls_test.h (t11, t11_last): Declare.
10433 * testsuite/tls_test_c.c: New file.
10434 * testsuite/tls_test_main.cc (thread_routine): Call t11.
10435 * configure.ac: Check for OpenMP support.
10436 * configure, config.in, Makefile.in: Rebuild.
10437 * testsuite/Makefile.in: Rebuild.
10438
edfbb029
CC
104392008-04-16 Cary Coutant <ccoutant@google.com>
10440
10441 * i386.cc (Target_i386::define_tls_base_symbol): New function.
10442 (Target_i386::tls_base_symbol_defined_): New field.
10443 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10444 (Target_i386::Scan::global): Likewise.
10445 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
10446 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
10447 (Target_x86_64::tls_base_symbol_defined_): New field.
10448 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
10449 (Target_x86_64::Scan::global): Likewise.
10450
f3c69fca
CC
104512008-04-16 Cary Coutant <ccoutant@google.com>
10452
10453 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
10454 (Symbol::needs_plt_entry): Allow weak undefined symbols.
10455 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
10456 building shared libraries.
10457 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
10458 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
10459 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
10460 * testsuite/Makefile.in: Rebuild.
10461 * testsuite/weak_undef.h: New file.
10462 * testsuite/weak_undef_file1.cc: Add extra test cases.
10463 * testsuite/weak_undef_file2.cc: Likewise.
10464 * testsuite/weak_undef_test.cc: Likewise.
10465
7c414435
DM
104662008-04-16 David S. Miller <davem@davemloft.net>
10467
32b769e1
DM
10468 * sparc.cc (Target_sparc::Scan): Change from struct to class.
10469 Add issued_non_pic_error_ field. Declare check_non_pic.
10470 (Target_sparc::Scan::check_non_pic): New function.
10471 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
10472 (Target_sparc::Scan::global): Likewise.
10473
11936fb1
DM
10474 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
10475 * configure: Rebuild.
10476
7c414435
DM
10477 * options.h (DEFINE_enable): New macro.
10478 (new_dtags): New enable option.
10479 (initfirst, interpose, loadfltr, nodefaultlib,
10480 nodelete, nodlopen, nodump): New -z options.
10481 * layout.cc (Layout:finish_dynamic_section): If new
10482 dtags enabled, emit DT_RUNPATH. Also, emit a
10483 DT_FLAGS_1 containing any specified -z flags.
10484
85c7bf8b
ILT
104852008-04-16 Ian Lance Taylor <iant@google.com>
10486
12c0daef
ILT
10487 * copy-relocs.cc: New file.
10488 * copy-relocs.h: New file.
10489 * reloc.cc: Remove Copy_relocs code.
10490 * reloc.h: Likewise.
10491 * reloc-types.h (struct Reloc_types) [both versions]: Add
10492 get_reloc_addend_noerror.
10493 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
10494 variants of add_global which take an addend which must be zero.
10495 * i386.cc: Include "copy-relocs.h".
10496 (class Target_i386): Change type of copy_relocs_ to variable,
10497 update initializer.
10498 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
10499 Change all callers.
10500 (Target_i386::do_finalize_sections): Change handling of
10501 copy_relocs_.
10502 * sparc.cc: Include "copy-relocs.h".
10503 (class Target_sparc): Change type of copy_relocs_ to variable,
10504 update initializer.
10505 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
10506 Change all callers.
10507 (Target_sparc::do_finalize_sections): Change handling of
10508 copy_relocs_.
10509 * x86_64.cc: Include "copy-relocs.h".
10510 (class Target_x86_64): Change type of copy_relocs_ to variable,
10511 update initializer.
10512 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
10513 class. Change all callers.
10514 (Target_x86_64::do_finalize_sections): Change handling of
10515 copy_relocs_.
10516 * Makefile.am (CCFILES): Add copy-relocs.cc.
10517 (HFILES): Add copy-relocs.h.
10518
4f4995b6
ILT
10519 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
10520
85c7bf8b
ILT
10521 * testsuite/script_test_4.sh: Permit leading zeroes.
10522
4f2a9edd
ILT
105232008-04-15 Ian Lance Taylor <iant@google.com>
10524
e6188289
ILT
10525 * script-sections.cc (Script_sections::create_segments): Use
10526 header_size_adjustment even when there is enough room for the
10527 headers.
10528 * testsuite/script_test_4.sh: New file.
10529 * testsuite/script_test_4.t: New file.
10530 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
10531 (check_DATA): Add script_test_4.stdout.
10532 (MOSTLYCLEANFILES): Likewise.
10533 (script_test_4): New target.
10534 (script_test_4.stdout): New target.
10535 * testsuite/Makefile.in: Rebuild.
10536
4f2a9edd
ILT
10537 * sparc.cc: Add definitions for Output_data_plt_sparc class
10538 constants.
10539
f5314dd5
DM
105402008-04-14 David S. Miller <davem@davemloft.net>
10541
10542 * sparc.cc: New file.
10543 * Makefile.am (TARGETSOURCES): Add sparc.cc
10544 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
10545 * configure.tgt: Document targ_extra_size and
10546 targ_extra_big_endian. Add entries for sparc-* and
10547 sparc64-*.
10548 * configure.ac: Handle targ_extra_size and
10549 targ_extra_big_endian.
10550 * Makefile.in: Rebuild.
10551 * configure: Likewise.
10552 * po/POTFILES.in: Likewise.
10553 * po/gold.pot: Likewise.
10554
154e0e9a
ILT
105552008-04-14 Ian Lance Taylor <iant@google.com>
10556
10557 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
10558 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
10559 in the name/type/flags to section mapping. Don't call
10560 allocate_output_section.
10561 (Layout::choose_output_section): Change parameter from adjust_name
10562 to is_input_section. Don't permit input sections after sections
10563 are attached to segments. Don't call allocate_output_section.
10564 (Layout::layout_eh_frame): Call update_flags_for_input_section,
10565 not write_enable_output_section.
10566 (Layout::make_output_section): Don't push to
10567 unattached_section_list_ nor call attach_to_segment. Call
10568 attach_section_to_segment if sections are attached.
10569 (Layout::attach_sections_to_segments): New function.
10570 (Layout::attach_section_to_segment): New function.
10571 (Layout::attach_allocated_section_to_segment): Rename from
10572 attach_to_segment. Remove flags parameter.
10573 (Layout::allocate_output_section): Remove function.
10574 (Layout::write_enable_output_section): Remove function.
10575 * layout.h (class Layout): Update for above changes. Add new
10576 field sections_are_attached_.
10577 * output.h (Output_section::update_flags_for_input_section): New
10578 function.
10579 * output.cc (Output_section::add_input_section): Call
10580 update_flags_for_input_section.
10581 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
10582
009a67a2
CC
105832008-04-11 Cary Coutant <ccoutant@google.com>
10584
10585 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
10586 thought unnecessary.
10587 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
10588
759b1a24
ILT
105892008-04-11 Ian Lance Taylor <iant@google.com>
10590
10591 * output.h (class Output_section_data): Remove inline definition
10592 of set_addralign.
10593 * output.cc (Output_section_data::set_addralign): New function.
10594
c2b45e22
CC
105952008-04-11 Cary Coutant <ccoutant@google.com>
10596
10597 Add support for TLS descriptors for i386 and x86_64.
10598 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
10599 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
10600 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
10601 GOT_TYPE_TLS_DESC.
10602 (Target_i386::got_mod_index_entry): Remove unnecessary code.
10603 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
10604 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
10605 relocations.
10606 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
10607 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
10608 Fix problem with initial-exec relocations.
10609 (Target_i386::Relocate::relocate_tls): Likewise.
10610 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
10611 relaxation.
10612 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
10613 support for section-plus-offset dynamic table entries.
10614 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
10615 (Output_data_dynamic::Dynamic_entry): Add support for
10616 section-plus-offset dynamic table entries.
10617 (Output_data_dynamic::Classification): Likewise.
10618 (Output_data_dynamic::classification_): Renamed offset_.
10619 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
10620 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
10621 (Target_x86_64::make_plt_section): New function.
10622 (Target_x86_64::reserve_tlsdesc_entries): New function.
10623 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
10624 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
10625 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
10626 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
10627 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
10628 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
10629 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
10630 add extra PLT entry for TLS descriptors.
10631 (Output_data_plt_x86_64::got_): New field.
10632 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
10633 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
10634 fields.
10635 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
10636 descriptors.
10637 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
10638 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
10639 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
10640 R_386_TLS_DESC_CALL relocations.
10641 (Target_x86_64::Scan::global): Likewise.
10642 (Target_x86_64::do_finalize_sections): Add dynamic table entries
10643 for TLS descriptors.
10644 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
10645 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
10646 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
10647 GD-to-IE relaxation.
10648 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
10649 and TLS_DESCRIPTORS.
10650 * Makefile.in: Rebuild.
10651 * configure: Rebuild.
10652 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
10653 (tls_test_shared2.so): New target.
10654 (tls_shared_gd_to_ie_test_SOURCES): New variable.
10655 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
10656 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
10657 (tls_shared_gd_to_ie_test_LDADD): New variable.
10658 (tls_shared_gnu2_gd_to_ie_test): New target.
10659 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
10660 New targets.
10661 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
10662 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
10663 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
10664 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
10665 (tls_shared_gnu2_test): New target.
10666 (tls_test_gnu2_shared.so): New target.
10667 (tls_shared_gnu2_test_SOURCES): New variable.
10668 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
10669 (tls_shared_gnu2_test_LDFLAGS): New variable.
10670 (tls_shared_gnu2_test_LDADD): New variable.
10671 * testsuite/Makefile.in: Rebuild.
10672 * testsuite/Makefile.
10673
83bfb6b7
ILT
106742008-04-11 Ian Lance Taylor <iant@google.com>
10675
10676 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
10677 justsyms.t.
10678 * testsuite/Makefile.in: Rebuild.
10679
10680 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
10681 long.
10682 * testsuite/script_test_2.cc (main): Adjust test.
10683
706e1f5e
ILT
106842008-04-11 David S. Miller <davem@davemloft.net>
10685 Ian Lance Taylor <iant@google.com>
10686
10687 * options.h (General_options): Add entries for '-Y' and
10688 '-relax'.
10689 * options.cc (General_options:finalize): If -Y was used, add those
10690 entries to the library path instead of the default "/lib" and
10691 "/usr/lib".
10692
7c98e6bb
DM
106932008-04-11 David S. Miller <davem@davemloft.net>
10694
10695 * testsuite/justsyms.t: Start at 0x100.
10696 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
10697 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
10698 long.
10699 * testsuite/script_test_2.cc: Adjust string and section length
10700 checks.
7c98e6bb 10701
99a37bfd
ILT
107022008-04-09 Ian Lance Taylor <iant@google.com>
10703
2cefc357
ILT
10704 PR gold/5996
10705 * script-sections.cc (Sections_element::allocate_to_segment): Add
10706 orphan parameter.
10707 (Output_section_definition::allocate_to_segment): Likewise.
10708 (Orphan_output_section::allocate_to_segment): Likewise.
10709 (Script_sections::attach_sections_using_phdrs_clause): Don't
10710 propagate non-PT_LOAD segments to orphan sections.
10711 * testsuite/Makefile.am (script_test_3.stdout): Generate using
10712 readelf rather than objdump.
10713 * testsuite/script_test_3.sh: Adjust accordingly. Test that
10714 .interp section and PT_INTERP segment are the same size.
10715 * testsuite/Makefile.in: Rebuild.
10716
99a37bfd
ILT
10717 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
10718 aliases for symbols defined in the same object.
10719 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
10720 (weak_alias_test_SOURCES): New variable.
10721 (weak_alias_test_DEPENDENCIES): New variable.
10722 (weak_alias_test_LDFLAGS): New variable.
10723 (weak_alias_test_LDADD): New variable.
10724 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
10725 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
10726 (weak_alias_test_3.o): New target.
10727 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
10728 * testsuite/weak_alias_test_main.cc: New file.
10729 * testsuite/weak_alias_test_1.cc: New file.
10730 * testsuite/weak_alias_test_2.cc: New file.
10731 * testsuite/weak_alias_test_3.cc: New file.
10732
780e49c5
ILT
107332008-04-08 Ian Lance Taylor <iant@google.com>
10734
cdb0b8f5
ILT
10735 * options.h (class General_options): Add --noinhibit-exec option.
10736 * main.cc (main): Check --noinhibit-exec.
10737
0864d551
ILT
10738 * options.h (class General_options): Define --wrap as a special
10739 option. Add wrap_symbols_ field.
10740 (General_options::any_wrap_symbols): New function.
10741 (General_options::is_wrap_symbol): New function.
10742 * options.cc (General_options::parse_wrap): New function.
10743 (General_options::General_options): Initialize wrap_symbols_.
10744 * symtab.cc (Symbol_table::wrap_symbol): New function.
10745 (Symbol_table::add_from_object): Handle --wrap.
10746 * symtab.h (class Symbol_table): Declare wrap_symbol.
10747 * target.h (Target::wrap_char): New function.
10748 (Target::Target_info): Add wrap_char field.
10749 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
10750 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
10751 * testsuite/testfile.cc (Target_test::test_target_info):
10752 Likewise.
10753
789aa6de
ILT
10754 * errors.cc (Errors::undefined_symbol): Mention symbol version if
10755 there is one.
10756
2c38906f
ILT
10757 * layout.h (class Layout): Add added_eh_frame_data_ field.
10758 * layout.cc (Layout::Layout): Initialize new field.
10759 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
10760 output section until we find a section we merged successfully.
10761 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
10762 that the size be non-zero.
10763
780e49c5
ILT
10764 * merge.cc (Object_merge_map::get_output_offset): Remove inline
10765 qualifier.
10766
7fcd0256
ILT
107672008-04-08 Craig Silverstein <csilvers@google.com>
10768
10769 * configure.ac: Export new conditional variable HAVE_ZLIB.
10770 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
10771 on HAVE_ZLIB.
10772 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
10773 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10774
6835af53
ILT
107752008-04-07 Ian Lance Taylor <iant@google.com>
10776
e24f324c
ILT
10777 * version.cc (version_string): Set to "1.5".
10778
a036edd8
ILT
10779 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
10780 Add issued_non_pic_error_ field. Declare check_non_pic.
10781 (Target_x86_64::Scan::check_non_pic): New function.
10782 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
10783 (Target_x86_64::Scan::global): Likewise.
10784
624f8810
ILT
10785 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
10786 addend parameter. Change caller. Handle merge sections.
10787 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
10788 Address to Addend. Don't add in the result of
10789 local_section_offset, pass down the addend and use the returned
10790 value.
10791 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
10792 Update declarations of local_section_offset and symbol_value.
10793 * testsuite/two_file_test_1.cc (t18): New function.
10794 * testsuite/two_file_test_2.cc (f18): New function.
10795 * testsuite/two_file_test_main.cc (main): Call t18.
10796 * testsuite/two_file_test.h (t18, f18): Declare.
10797
6835af53
ILT
10798 * configure.ac: Don't test for objdump, c++filt, or readelf.
10799 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
10800 conditionals.
10801 (TEST_READELF): New variable.
10802 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
10803 (check_PROGRAMS): Add two_file_strip_test.
10804 (two_file_strip_test): New target.
10805 (check_PROGRAMS): Add two_file_same_shared_strip_test.
10806 (two_file_same_shared_strip_test_SOURCES): New variable.
10807 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
10808 (two_file_same_shared_strip_test_LDFLAGS): New variable.
10809 (two_file_same_shared_strip_test_LDADD): New variable.
10810 (two_file_shared_strip.so): New target.
10811 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
10812 (ver_test_5.syms, ver_test_7.syms): Likewise.
10813 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
10814 (strip_test_3.stdout): Use TEST_OBJDUMP.
10815 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10816
86925eef
CC
108172008-04-04 Cary Coutant <ccoutant@google.com>
10818
10819 * symtab.h (Symbol::is_weak_undefined): New function.
10820 (Symbol::is_strong_undefined): New function.
10821 (Symbol::is_absolute): New function.
10822 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
10823 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
10824 absolute symbols.
10825 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
10826 (weak_undef_test): New target.
10827 * testsuite/Makefile.in: Rebuild.
10828 * testsuite/weak_undef_file1.cc: New file.
10829 * testsuite/weak_undef_file2.cc: New file.
10830 * testsuite/weak_undef_test.cc: New file.
10831
126f3ece
ILT
108322008-04-03 Craig Silverstein <csilvers@google.com>
10833
10834 * compressed_output.h (class Output_compressed_section): Use
10835 unsigned buffer.
10836 * compressed_output.cc (zlib_compress): Use unsigned buffers,
10837 add zlib header.
10838 (zlib_compressed_suffix): Removed.
10839 (Output_compressed_section::set_final_data_size): Use unsigned
10840 buffers.
10841 * testsuite/Makefile.am (flagstest_compress_debug_sections):
10842 Fix linker invocation.
10843 (flagstest_o_specialfile_and_compress_debug_sections):
10844 Likewise.
10845 * testsuite/Makefile.in: Regenerated.
10846
deae2a14
DM
108472008-04-02 David S. Miller <davem@davemloft.net>
10848
10849 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
10850 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
10851
70752818
ILT
108522008-04-02 Craig Silverstein <csilvers@google.com>
10853
10854 * TODO: New file.
10855
39d0cb0e
ILT
108562008-04-02 Ian Lance Taylor <iant@google.com>
10857
10858 * fileread.cc (File_read::find_view): Add byteshift and vshifted
10859 parameters. Update for new key type to views_. Change all
10860 callers.
10861 (File_read::read): Adjust for byteshift in returned view.
10862 (File_read::add_view): New function, broken out of
10863 find_and_make_view.
10864 (File_read::make_view): New function, broken out of
10865 find_and_make_view.
10866 (File_read::find_or_make_view): Add offset and aligned
10867 parameters. Rewrite accordingly. Change all callers.
10868 (File_read::get_view): Add offset and aligned parameters. Adjust
10869 for byteshift in return value.
10870 (File_read::get_lasting_view): Likewise.
10871 * fileread.h (class File_read): Update declarations.
10872 (class File_read::View): Add byteshift_ field. Add byteshift to
10873 constructor. Add byteshift method.
10874 * archive.h (Archive::clear_uncached_views): New function.
10875 (Archive::get_view): Add aligned parameter. Change all callers.
10876 * object.h (Object::get_view): Add aligned parameter. Change all
10877 callers.
10878 (Object::get_lasting_view): Likewise.
10879
10880 * fileread.cc (File_read::release): Don't call clear_views if
10881 there are multiple objects.
10882 * fileread.h (File_read::clear_uncached_views): New function.
10883 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
10884 on the archive.
10885
a1207466
CC
108862008-03-31 Cary Coutant <ccoutant@google.com>
10887
10888 Add thin archive support.
10889 * archive.cc (Archive::armagt): New const.
10890 (Archive::setup): Remove task parameter and calls to unlock.
10891 (Archive::unlock_nested_archives): New function.
10892 (Archive::read_header): Add nested_off parameter. Change
10893 all callers.
10894 (Archive::interpret_header): Likewise.
10895 (Archive::include_all_members): Change to handle thin
10896 archives.
10897 (Archive::include_member): Likewise.
10898 * archive.h (Archive::Archive): Add new parameters and
10899 initializers.
10900 (Archive::armagt): New const.
10901 (Archive::setup): Remove task parameter.
10902 (Archive::unlock_nested_archives): New function.
10903 (Archive::read_header): Add nested_off parameter.
10904 (Archive::interpret_header): Likewise.
10905 (Archive::Nested_archive_table): New typedef.
10906 (Archive::is_thin_archive_): New field.
10907 (Archive::nested_archives_): New field.
10908 (Archive::options_): New field.
10909 (Archive::dirpath_): New field.
10910 (Archive::task_): New field.
10911 * readsyms.cc (Read_symbols::do_read_symbols): Add check
10912 for thin archives. Pass additional parameters to
10913 Archive::Archive. Unlock the archive file after calling
10914 Archive::setup.
cd536b21 10915
479f6503
ILT
109162008-03-29 Ian Lance Taylor <iant@google.com>
10917
686c8caf
ILT
10918 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
10919 version symbol to be local.
10920 * testsuite/ver_test_4.sh: New file.
10921 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
10922 (check_DATA): Add ver_test_4.syms.
10923 (ver_test_4.syms): New target.
10924 * testsuite/Makefile.in: Rebuild.
10925
ab794b6b
ILT
10926 * output.cc
10927 (Output_section::Input_section_sort_entry::has_priority): New
10928 function.
10929 (Output_section::Input_section_sort_entry::match_file_name): New
10930 function.
10931 (Output_section::Input_section_sort_entry::match_section_name):
10932 Remove.
10933 (Output_section::Input_section_sort_entry::match_section_name_prefix):
10934 Remove.
10935 (Output_section::Input_section_sort_entry::match_section_file):
10936 Remove.
10937 (Output_section::Input_section_sort_compare::operator()): Rewrite
10938 using new Input_section_sort_entry functions. Sort crtbegin and
10939 crtend first. Sort sections with no priority before sections with
10940 a priority.
10941 * testsuite/initpri1.c (d3): Check j != 4.
10942 (cd5): New constructor/destructor function.
10943 (main): Check j != 2.
10944
479f6503
ILT
10945 * symtab.cc (Symbol_table::add_from_object): If we don't use the
10946 new symbol when resolving, don't call set_is_default.
10947 * testsuite/ver_test_7.cc: New file.
10948 * testsuite/ver_test_7.sh: New file.
10949 * testsuite/Makefile.am (ver_test_7.so): New target.
10950 (ver_test_7.o): New target.
10951 (check_SCRIPTS): Add ver_test_7.sh.
10952 (check_DATA): Add ver_test_7.syms.
10953 (ver_test_7.syms): New target.
10954
2fd32231
ILT
109552008-03-28 Ian Lance Taylor <iant@google.com>
10956
10957 * layout.cc (Layout::layout): If we see an input section with a
10958 name that needs sorting, set the must_sort flag for the output
10959 section.
10960 (Layout::make_output_section): If the name of the output section
10961 indicates that it might require sorting, set the may_sort flag.
10962 * output.h (Output_section::may_sort_attached_input_sections): New
10963 function.
10964 (Output_section::set_may_sort_attached_input_sections): New
10965 function.
10966 (Output_section::must_sort_attached_input_sections): New
10967 function.
10968 (Output_section::set_must_sort_attached_input_sections): New
10969 function.
10970 (class Output_section): Declare Input_section_sort_entry. Define
10971 Input_section_sort_compare. Declare
10972 sort_attached_input_sections. Add new fields:
10973 may_sort_attached_input_sections_,
10974 must_sort_attached_input_sections_,
10975 attached_input_sections_are_sorted_.
10976 * output.cc (Output_section::Output_section): Initialize new
10977 fields.
10978 (Output_section::add_input_section): Add an entry to
10979 input_sections_ if may_sort or must_sort are true.
10980 (Output_section::set_final_data_size): Call
10981 sort_attached_input_sections if necessary.
10982 (Output_section::Input_section_sort_entry): Define new class.
10983 (Output_section::Input_section_sort_compare::operator()): New
10984 function.
10985 (Output_section::sort_attached_input_sections): New function.
10986 * configure.ac: Check whether the compiler supports constructor
10987 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
10988 * testsuite/initpri1.c: New file.
10989 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
10990 CONSTRUCTOR_PRIORITY.
10991 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
10992 (initpri1_LDFLAGS): New variable.
10993 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
10994
18e6b24e
ILT
109952008-03-27 Ian Lance Taylor <iant@google.com>
10996
49bdd526
ILT
10997 * common.cc (Sort_commons::operator): Correct sorting algorithm.
10998 * testsuite/common_test_1.c: New file.
10999 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
11000 (common_test_1_SOURCES): New variable.
11001 (common_test_1_DEPENDENCIES): New variable.
11002 (common_test_1_LDFLAGS): New variable.
11003
18e6b24e
ILT
11004 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
11005 and commons_ correctly when NAME/VERSION does not override
11006 NAME/NULL.
11007 * testsuite/ver_test_6.c: New file.
11008 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
11009 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
11010 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
11011
04bf7072
ILT
110122008-03-26 Ian Lance Taylor <iant@google.com>
11013
5871526f
ILT
11014 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
11015 of an undefined symbol from a version script.
11016 * testsuite/Makefile.am (ver_test_5.so): New target.
11017 (ver_test_5.o): New target.
11018 (check_SCRIPTS): Add ver_test_5.sh.
11019 (check_DATA): Add ver_test_5.syms.
11020 (ver_test_5.syms): New target.
11021 * testsuite/ver_test_5.cc: New file.
11022 * testsuite/ver_test_5.script: New file.
11023 * testsuite/ver_test_5.sh: New file.
11024 * Makefile.in, testsuite/Makefile.in: Rebuild.
11025
04bf7072
ILT
11026 PR gold/5986
11027 Fix problems building gold with gcc 4.3.0.
11028 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
11029 (gold_error_at_location, gold_warning_at_location): Use it.
11030 * configure.ac: Check whether we can compile and use a template
11031 function with a printf attribute.
11032 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
11033 when jumping over bytes.
11034 * object.cc: Instantiate Object::read_section_data.
11035 * debug.h: Include <cstring>
11036 * dwarf_reader.cc: Include <algorithm>
11037 * main.cc: Include <cstring>.
11038 * options.cc: Include <cstring>.
11039 * output.cc: Include <cstring>.
11040 * script.cc: Include <cstring>.
11041 * script.h: Include <string>.
11042 * symtab.cc: Include <cstring> and <algorithm>.
11043 * target-select.cc: Include <cstring>.
11044 * version.cc: Include <string>.
11045 * testsuite/testmain.cc: Include <cstdlib>.
11046 * configure, config.in: Rebuild.
11047
874c5b28
ILT
110482008-03-25 Ian Lance Taylor <iant@google.com>
11049
819d6c3a
ILT
11050 * options.cc: Include "../bfd/bfdver.h".
11051 (options::help): Print bug reporting address.
11052
f4b2c6f5
ILT
11053 * version.cc (print_version): Adjust output for current value of
11054 BFD_VERSION_STRING.
11055
11056 * NEWS: New file.
11057
e96caa79
ILT
11058 * options.cc (options::help): Print list of supported targets.
11059 * target-select.h: Include <vector>.
11060 (class Target_selector): Make machine_, size_, and is_big_endian_
11061 fields const. Add bfd_name_ and instantiated_target_ fields.
11062 (Target_selector::Target_selector): Add bfd_name parameter.
11063 (Target_selector::recognize): Make non-virtual, call
11064 do_recognize.
11065 (Target_selector::recognize_by_name): Make non-virtual, call
11066 do_recognize_by_name.
11067 (Target_selector::supported_names): New function.
11068 (Target_selector::bfd_name): New function.
11069 (Target_selector::do_instantiate_target): New pure virtual
11070 function.
11071 (Target_selector::do_recognize): New virtual function.
11072 (Target_selector::do_recognize_by_name): New virtual function.
11073 (Target_selector::instantiate_target): New private function.
11074 (supported_target_names): Declare.
11075 * target-select.cc (Target_selector::Target_selector): Update for
11076 new parameter and fields.
11077 (select_target_by_name): Check that the name matches before
11078 calling recognize_by_name.
11079 (supported_target_names): New function.
11080 * i386.cc (class Target_selector_i386): Update Target_selector
11081 constructor call. Remove recognize and recognize_by_name. Add
11082 do_instantiate_target.
11083 * x86_64.cc (class Target_selector_x86_64): Likewise.
11084 * testsuite/testfile.cc (class Target_selector_test): Update for
11085 changes to Target_selector.
11086
874c5b28
ILT
11087 * README: Rewrite, with some notes on unsupported features.
11088
0a65a3a7
CC
110892008-03-24 Cary Coutant <ccoutant@google.com>
11090
11091 * i386.cc (Target_i386::Got_type): New enum declaration.
11092 (Target_i386::Scan::local): Updated callers of Output_data_got
11093 member functions.
11094 (Target_i386::Scan::global): Likewise.
11095 (Target_i386::Relocate::relocate): Likewise.
11096 (Target_i386::Relocate::relocate_tls): Likewise.
11097 * object.h (Got_offset_list): New class.
11098 (Sized_relobj::local_has_got_offset): Added got_type parameter.
11099 (Sized_relobj::local_got_offset): Likewise.
11100 (Sized_relobj::set_local_got_offset): Likewise.
11101 (Sized_relobj::local_has_tls_got_offset): Removed.
11102 (Sized_relobj::local_tls_got_offset): Removed.
11103 (Sized_relobj::set_local_tls_got_offset): Removed.
11104 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
11105 * output.cc (Output_data_got::add_global): Added got_type parameter.
11106 (Output_data_got::add_global_with_rel): Likewise.
11107 (Output_data_got::add_global_with_rela): Likewise.
11108 (Output_data_got::add_global_pair_with_rel): New function.
11109 (Output_data_got::add_global_pair_with_rela): New function.
11110 (Output_data_got::add_local): Added got_type parameter.
11111 (Output_data_got::add_local_with_rel): Likewise.
11112 (Output_data_got::add_local_with_rela): Likewise.
11113 (Output_data_got::add_local_pair_with_rel): New function.
11114 (Output_data_got::add_local_pair_with_rela): New function.
11115 (Output_data_got::add_global_tls): Removed.
11116 (Output_data_got::add_global_tls_with_rel): Removed.
11117 (Output_data_got::add_global_tls_with_rela): Removed.
11118 (Output_data_got::add_local_tls): Removed.
11119 (Output_data_got::add_local_tls_with_rel): Removed.
11120 (Output_data_got::add_local_tls_with_rela): Removed.
11121 * output.h (Output_data_got::add_global): Added got_type parameter.
11122 (Output_data_got::add_global_with_rel): Likewise.
11123 (Output_data_got::add_global_with_rela): Likewise.
11124 (Output_data_got::add_global_pair_with_rel): New function.
11125 (Output_data_got::add_global_pair_with_rela): New function.
11126 (Output_data_got::add_local): Added got_type parameter.
11127 (Output_data_got::add_local_with_rel): Likewise.
11128 (Output_data_got::add_local_with_rela): Likewise.
11129 (Output_data_got::add_local_pair_with_rel): New function.
11130 (Output_data_got::add_local_pair_with_rela): New function.
11131 (Output_data_got::add_global_tls): Removed.
11132 (Output_data_got::add_global_tls_with_rel): Removed.
11133 (Output_data_got::add_global_tls_with_rela): Removed.
11134 (Output_data_got::add_local_tls): Removed.
11135 (Output_data_got::add_local_tls_with_rel): Removed.
11136 (Output_data_got::add_local_tls_with_rela): Removed.
11137 * resolve.cc (Symbol::override_base_with_special): Removed
11138 reference to has_got_offset_ field.
11139 * symtab.cc (Symbol::init_fields): Replaced initialization
11140 of got_offset_ with got_offsets_. Removed initialization
11141 of has_got_offset_
53fcba31 11142 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
11143 (Symbol::got_offset): Likewise.
11144 (Symbol::set_got_offset): Likewise.
11145 (Symbol::has_tls_got_offset): Removed.
11146 (Symbol::tls_got_offset): Removed.
11147 (Symbol::set_tls_got_offset): Removed.
11148 (Symbol::got_offset_): Removed.
11149 (Symbol::tls_mod_got_offset_): Removed.
11150 (Symbol::tls_pair_got_offset_): Removed.
11151 (Symbol::got_offsets_): New field.
11152 (Symbol::has_got_offset): Removed.
11153 (Symbol::has_tls_mod_got_offset): Removed.
11154 (Symbol::has_tls_pair_got_offset): Removed.
11155 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
11156 (Target_x86_64::Scan::local): Updated callers of Output_data_got
11157 member functions.
11158 (Target_x86_64::Scan::global): Likewise.
11159 (Target_x86_64::Relocate::relocate): Likewise.
11160 (Target_x86_64::Relocate::relocate_tls): Likewise.
11161
bd52eafb
BE
111622008-03-25 Ben Elliston <bje@au.ibm.com>
11163
11164 * yyscript.y: Fix spelling error in comment.
11165
8b105e34
ILT
111662008-03-24 Ian Lance Taylor <iant@google.com>
11167
8ed814a9
ILT
11168 * options.h (class General_options): Define build_id option.
11169 * layout.h (class Layout): Declare write_build_id, create_note,
11170 create_build_id. Add build_id_note_ member.
11171 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
11172 "libiberty.h", "md5.h", "sha1.h".
11173 (Layout::Layout): Initialize eh_frame_data_,
11174 eh_frame_hdr_section_, and build_id_note_.
11175 (Layout::finalize): Call create_build_id.
11176 (Layout::create_note): New function, broken out of
11177 Layout::create_gold_note.
11178 (Layout::create_gold_note): Call create_note.
11179 (Layout::create_build_id): New function.
11180 (Layout::write_build_id): New function.
11181 (Close_task_runner::run): Call write_build_id.
11182
8b105e34
ILT
11183 * x86_64.cc: Correct license to GPLv3.
11184
086a1841
ILT
111852008-03-23 Ian Lance Taylor <iant@google.com>
11186
11187 * options.cc: Include "demangle.h".
11188 (parse_optional_string): New function.
11189 (parse_long_option): Handle takes_optional_argument.
11190 (parse_short_option): Update dash_z initializer. Handle
11191 takes_optional_argument.
11192 (General_options::General_options): Initialize do_demangle_.
11193 (General_options::finalize): Set do_demangle_. Handle demangling
11194 style.
11195 * options.h (parse_optional_string): Declare.
11196 (struct One_option): Add optional_arg field. Update constructor.
11197 Update call constructor calls. Add takes_optional_argument
11198 function.
11199 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
11200 (DEFINE_optional_string): Define.
11201 (General_options::demangle): Change from DEFINE_bool to
11202 DEFINE_optional_string.
11203 (General_options::no_demangle): New function.
11204 (General_options::do_demangle): New function.
11205 (General_options::set_do_demangle): New function.
11206 (General_options::execstack_status_): Move definition to end of
11207 class definition.
11208 (General_options::static_): Likewise.
11209 (General_options::do_demangle_): New field.
11210 * object.cc (big_endian>::get_symbol_location_info): Call
11211 Options::do_demangle, not Options::demangle.
11212 * symtab.cc (demangle): Likewise.
11213
cbb93e63
ILT
112142008-03-22 Ian Lance Taylor <iant@google.com>
11215
11216 * gold.h: Include <cstddef> and <sys/types.h>
11217 * options.h: Include <cstring>.
11218
ec531623
ILT
112192008-03-21 Ian Lance Taylor <iant@google.com>
11220
11221 * Added source code to GNU binutils.
This page took 0.710137 seconds and 4 git commands to generate.