* mi/mi-main.c (get_register): Use get_frame_register_value rather
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
f30f86fa
ILT
12011-01-24 Ian Lance Taylor <iant@google.com>
2
3 * options.h (class General_options): Accept
4 --no-detect-odr-violations.
5
8e51a0b9
ILT
62011-01-24 Ian Lance Taylor <iant@google.com>
7
8 * version.cc (version_string): Bump to 1.11.
9
0f3b89d8
ILT
102011-01-24 Ian Lance Taylor <iant@google.com>
11
12 * plugin.cc (class Plugin_rescan): Define new class.
13 (Plugin_manager::claim_file): Set any_claimed_.
14 (Plugin_manager::save_archive): New function.
15 (Plugin_manager::save_input_group): New function.
16 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
17 necessary.
18 (Plugin_manager::new_undefined_symbol): New function.
19 (Plugin_manager::rescan): New function.
20 (Plugin_manager::rescannable_defines): New function.
21 (Plugin_manager::add_input_file): Set any_added_.
22 * plugin.h (class Plugin_manager): define new fields rescannable_,
23 undefined_symbols_, any_claimed_, and any_added_. Declare
24 Plugin_rescan as friend. Declare new functions.
25 (Plugin_manager::Rescannable): Define type.
26 (Plugin_manager::Rescannable_list): Define type.
27 (Plugin_manager::Undefined_symbol_list): Define type.
28 (Plugin_manager::Plugin_manager): Initialize new fields.
29 * archive.cc (Archive::defines_symbol): New function.
30 (Add_archive_symbols::run): Pass archive to plugins if any.
31 * archive.h (class Archive): Declare defines_symbol.
32 * readsyms.cc (Input_group::~Input_group): New function.
33 (Finish_group::run): Pass input_group to plugins if any.
34 * readsyms.h (class Input_group): Declare destructor.
35 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
36 any.
37
3bb951e5
ILT
382011-01-10 Ian Lance Taylor <iant@google.com>
39
40 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
41 section as relro.
42 (Layout::set_segment_offsets): Reset increase_relro before calling
43 set_section_addresses a second time.
44
0aa45fac
CC
452011-01-04 Cary Coutant <ccoutant@google.com>
46
47 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
48 sections before NOBITS sections.
49
0db46eb4
L
502011-01-01 H.J. Lu <hongjiu.lu@intel.com>
51
52 * version.cc (print_version): Update copyright to 2011.
53
829c9745
CC
542010-12-23 Cary Coutant <ccoutant@google.com>
55
56 * output.h (Output_data_reloc::add_output_section): Pass OD instead
57 of OS to this->add. Add OD parameter to second form of the function.
58
7500420b
ILT
592010-12-20 Ian Lance Taylor <iant@google.com>
60
61 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
62 second of two consecutive entries with same offset.
63
f8e9a930
RW
642010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
65
66 * testsuite/Makefile.am (ifuncmain2static_LDADD)
67 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
68 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
69 to avoid unneeded links against $(LDADD).
70 * testsuite/Makefile.in: Regenerate.
71
2fbb4320
ILT
722010-12-15 Ian Lance Taylor <iant@google.com>
73
74 PR gold/12324
75 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
76 for R_X86_64_32 and R_X86_64_PC32.
77 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
78 ver_matching_def_pic.o.
79 (ver_matching_def_pic.o): New target.
80
fedb228d
RW
812010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
82
83 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
84 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
85 Move definition before File_read::View member definitions.
86 (File_read::View::~View): Initialize and hold lock before
87 updating current_mapped_bytes.
88
9b547ce6
RW
892010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
90
91 * dwarf_reader.cc: Remove outdated comment.
92 * gold-threads.cc: Fix typo in error message.
93 * archive.cc: Fix typos in comments.
94 * archive.h: Likewise.
95 * arm-reloc-property.cc: Likewise.
96 * arm-reloc-property.h: Likewise.
97 * arm-reloc.def: Likewise.
98 * arm.cc: Likewise.
99 * attributes.h: Likewise.
100 * cref.cc: Likewise.
101 * ehframe.cc: Likewise.
102 * fileread.h: Likewise.
103 * gold.h: Likewise.
104 * i386.cc: Likewise.
105 * icf.cc: Likewise.
106 * incremental.h: Likewise.
107 * int_encoding.cc: Likewise.
108 * layout.h: Likewise.
109 * main.cc: Likewise.
110 * merge.h: Likewise.
111 * object.cc: Likewise.
112 * object.h: Likewise.
113 * options.cc: Likewise.
114 * readsyms.cc: Likewise.
115 * reduced_debug_output.cc: Likewise.
116 * reloc.cc: Likewise.
117 * script-sections.cc: Likewise.
118 * sparc.cc: Likewise.
119 * symtab.h: Likewise.
120 * target-reloc.h: Likewise.
121 * target.cc: Likewise.
122 * target.h: Likewise.
123 * timer.cc: Likewise.
124 * timer.h: Likewise.
125 * x86_64.cc: Likewise.
126
83e17bd5
CC
1272010-12-09 Cary Coutant <ccoutant@google.com>
128
129 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
130 stack.
131 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
132 parameter; change all callers.
133 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
134 * options.h (warn_execstack): New option.
135
017257f8
DK
1362010-12-07 Doug Kwan <dougkwan@google.com>
137
138 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
139 like function call relocations.
140
c20cbc06
ILT
1412010-12-07 Ian Lance Taylor <iant@google.com>
142
143 * archive.cc (Archive::get_elf_object_for_member): Permit
144 punconfigured to be NULL.
145 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
146 (Archive::include_member): Pass NULL to get_elf_object_for_member
147 if we searched for the archive and this is the first included
148 object.
149
4dbfafcc
ILT
1502010-12-01 Ian Lance Taylor <iant@google.com>
151
152 * dwarf_reader.h (class Sized_dwarf_line_info): Add
153 track_relocs_type_ field.
154 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
155 Set track_relocs_type_.
156 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
157 contents when using RELA relocs.
158 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
159 reloc_map_.
160 * reloc.cc (Track_relocs::next_addend): New function.
161 * reloc.h (class Track_relocs): Declare next_addend.
162
e5e19edd
ILT
1632010-12-01 Ian Lance Taylor <iant@google.com>
164
165 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
166 virtual destructor.
167
9a5ce24c
ILT
1682010-12-01 Ian Lance Taylor <iant@google.com>
169
170 * README: Update compilers known to work and fail.
171
c7791212
NC
1722010-11-23 Matthias Klose <doko@ubuntu.com>
173
174 * configure.in: For --enable-gold, handle value `default' instead of
175 `both*'. Always install ld as ld.bfd, install as ld if gold is
176 not the default.
177 * configure: Regenerate.
178
0ad220c9
DK
1792010-11-18 Doug Kwan <dougkwan@google.com>
180
181 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
182 and right_alignment to be zero. Store result alignment only if it is
183 greater than existing alignment.
184
ab8056e0
CC
1852010-11-16 Cary Coutant <ccoutant@google.com>
186
187 PR gold/12220
188 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
189 Check for ".zdebug_line".
190
fd064a5b
CC
1912010-11-16 Doug Kwan <dougkwan@google.com>
192 Cary Coutant <ccoutant@google.com>
193
194 * output.h (Output_segment::set_section_addresses): Pass increase_relro
195 by reference; adjust all callers.
196 * output.cc (Output_segment::set_section_addresses): Adjust references
197 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
198 list is empty.
199 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
200 end at page boundary.
201
6fc6ea19
CC
2022010-11-16 Cary Coutant <ccoutant@google.com>
203
204 PR gold/12220
205 * layout.cc (Layout::choose_output_section): Transform names of
206 compressed sections even when using a script with a SECTIONS clause.
207 (Layout::output_section_name): Remove code to transform
208 compressed debug section names.
209 * output.cc (Output_section::add_input_section): Use uncompressed
210 section size when tracking input sections.
211
95a2c8d6
RS
2122010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
213
214 * symtab.h (Symbol::NON_PIC_REF): Remove.
215 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
216 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
217 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
218 (Symbol::use_plt_offset): Take a flags argument and pass it
219 directly to needs_dynamic_reloc. Restrict check for undefined
220 weak symbols to function calls.
221 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
222 (Target_arm::Scan::global): Use it.
223 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
224 (Target_arm::Relocate::relocate): Likewise.
225 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
226 parameter with an r_type parameter. Use get_reference_flags
227 to get the flags.
228 (Target_arm::Relocate::relocate): Update accordingly.
229 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
230 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
231 (Target_i386::Scan::global): Likewise.
232 (Target_i386::Relocate::relocate): Likewise.
233 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
234 parameter with an r_type parameter. Use get_reference_flags
235 to get the flags.
236 (Target_i386::Relocate::relocate): Update accordingly.
237 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
238 (Target_powerpc::Scan::global): Use it.
239 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
240 (Target_powerpc::Relocate::relocate): Likewise.
241 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
242 (Target_sparc::Scan::global): Use it.
243 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
244 (Target_sparc::Relocate::relocate): Likewise.
245 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
246 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
247 (Target_x86_64::Scan::global): Likewise.
248 (Target_x86_64::Relocate::relocate): Likewise.
249
f625ae50
DK
2502010-11-08 Doug Kwan <dougkwan@google.com>
251 Cary Coutant <ccoutant@google.com>
252
253 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
254 (Arm_exidx_merge_section::section_contents_): New data member.
255 (Arm_input_section::Arm_input_section): Initialize original_contents_.
256 (Arm_input_section::~Arm_input_section): De-allocate memory.
257 (Arm_input_section::original_contents_): New data member.
258 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
259 in parameters instead of calling Object::section_contents without
260 locking.
261 (Arm_output_section::group_section): New parameter TASK. Pass it
262 to callees that need locking objects.
263 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
264 to lock EXIDX input sections. Fix a formatting issue. Call
265 Arm_exidx_merged_section::build_contents to create merged section
266 contents.
267 (Arm_output_section::create_stub_group): New parameter TASK. Use it
268 to lock object of stub table owner.
269 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
270 TEXT_SIZE to initialize data member TEXT_SIZE_.
271 (Arm_exidx_input_section::addralign): Fix typo in comment.
272 (Arm_exidx_input_section::text_size): New method.
273 (Target_arm::do_relax): New parameter TASK. Pass it to callees
274 that require locking objects. Lock objects before scanning for stubs
275 and updating local symbols.
276 (Arm_input_section<big_endian>::init): Copy contents of original
277 input section.
278 (Arm_input_section<big_endian>::do_write): Use saved contents of
279 original input section instead of calling Object::section_contents
280 without locking.
281 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
282 size without calling Object::section_size().
283 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
284 for size. Allocate a buffer for merged EXIDX entries.
285 (Arm_exidx_merged_section::build_contents): New method.
286 (Arm_exidx_merged_section::do_write): Move merge section contents
287 building code to Arm_exidx_merged_section::build_contetns. Write
288 out contetns in buffer instead of building it on the fly.
289 (Arm_relobj::make_exidx_input_section): Also pass text section size
290 to Arm_exidx_input_section constructor.
291 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
292 (Arm_dynobj::do_read_symbols): Fix memory leak.
293 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
294 * target.h: (class Task): Add forward declaration.
295 (Target::relax): Add new parameter TASK and pass it to
296 Target::do_relax().
297 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
298
5f9bcf58
CC
2992010-11-05 Cary Coutant <ccoutant@google.com>
300
301 PR gold/10708
302 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
303 object when reading from the file.
304 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
305 second layout pass.
306 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
307 when reading section contents.
308 (get_section_contents): Likewise.
309 (icf::find_identical_sections): Likewise.
310 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
311 object when reading from the file.
312 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
313 the object when doing deferred section layout.
314
e597fa08
NC
3152010-11-03 Nick Clifton <nickc@redhat.com>
316
317 PR gold/12001
318 * script.h (class Symbol_assignment: name): New member. Returns
319 the name of the symbol.
320 * scrfipt.cc (Script_options::is_pending_assignment): New member.
321 Returns true if the given symbol name is on the list of
322 assignments wating to be processed.
323 * archive.cc (should_incldue_member): If the symbol is undefined,
324 check to see if it is on the list of symbols pending assignment.
325
3f9a3278
ILT
3262010-11-03 Ryan Mansfield <rmansfield@qnx.com>
327
328 * script-sections.cc (Script_sections::find_memory_region): Check
329 for a NULL output section pointer.
330
d06fb4d1
DK
3312010-10-29 Doug Kwan <dougkwan@google.com>
332
333 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
334 Output_section::add_relaxed_input_section.
335 * output.cc (Output_section::add_relaxed_input_section): Add new
336 arguments LAYOUT and NAME. Set section order index.
337 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
338 Copy section order index.
339 * output.h (Output_section::add_relaxed_input_section): Add new
340 arguments LAYOUT and NAME.
341
90e24de5
ILT
3422010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
343
344 * testsuite/Makefile.am: Move gcctestdir/ld rule to
345 NATIVE_OR_CROSS_LINKER.
346 * testsuite/Makefile.in: Regenerate.
347
c9484ea5
DK
3482010-10-20 Doug Kwan <dougkwan@google.com>
349
350 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
351 without SHF_LINK_ORDER flags.
352 * layout.cc (Layout::choose_output_section): Do not filter
353 SHF_LINK_ORDER flag in a relocatable link.
354
5bc2f5be
CC
3552010-10-17 Cary Coutant <ccoutant@google.com>
356
357 * output.h (Output_segment::set_section_addresses): Change function
358 signature. Update all callers.
359 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
360 sections.
361 (Output_segment::set_section_addresses): Align after last TLS
362 section. Add padding before last relro section instead of after.
363
0c91cf04
DK
3642010-10-17 Doug Kwan <dougkwan@google.com>
365
366 * gold/arm.cc (Target_arm::got_section): Use correct order and set
367 GOT output section to be writable.
368
8c21d9d3
CC
3692010-10-14 Cary Coutant <ccoutant@google.com>
370
371 * debug.h (DEBUG_INCREMENTAL): New flag.
372 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
373 * gold.cc (queue_initial_tasks): Check parameters for incremental link
374 mode.
375 * incremental.cc (report_command_line): Ignore all forms of
376 --incremental.
377 * layout.cc (Layout::Layout): Check parameters for incremental link
378 mode.
379 * options.cc (General_options::parse_incremental): New function.
380 (General_options::parse_no_incremental): New function.
381 (General_options::parse_incremental_full): New function.
382 (General_options::parse_incremental_update): New function.
383 (General_options::incremental_mode_): New data member.
384 (General_options::finalize): Check incremental_mode_.
385 * options.h (General_options): Update help text for --incremental.
386 Add --no-incremental, --incremental-full, --incremental-update.
387 (General_options::Incremental_mode): New enum type.
388 (General_options::incremental_mode): New function.
389 (General_options::incremental_mode_): New data member.
390 * parameters.cc (Parameters::incremental_mode_): New data member.
391 (Parameters::set_options): Set incremental_mode_.
392 (Parameters::set_incremental_full): New function.
393 (Parameters::incremental): New function.
394 (Parameters::incremental_update): New function.
395 (set_parameters_incremental_full): New function.
396 * parameters.h (Parameters::set_incremental_full): New function.
397 (Parameters::incremental): New function.
398 (Parameters::incremental_update): New function.
399 (Parameters::incremental_mode_): New data member.
400 (set_parameters_incremental_full): New function.
401 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
402 incremental link mode.
403 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
404 (Sized_relobj::do_relocate_sections): Likewise.
405 * testsuite/Makefile.am (incremental_test): Use --incremental-full
406 option.
407 * testsuite/Makefile.in: Regenerate.
408 * testsuite/incremental_test.sh: Filter all forms of --incremental.
409
bb32aa18 4102010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
eb373049
ILT
411
412 * script-sections.h (class Script_sections): Make
413 Sections_elements typedef public.
414 * script-sections.cc (class Sort_output_sections): Add elements_
415 field. Add constructor which sets it; change all callers.
416 (Sort_output_sections::is_before): New function.
417 (Sort_output_sections::operator()): Call is_before.
418 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
419 conditional.
420 * testsuite/script_test_10.sh: New test. Test script section
421 order.
422 * testsuite/script_test_10.t: Likewise.
423 * testsuite/script_test_10.s: Likewise.
424 * testsuite/Makefile.am: Wrap the cross linker tests and the
425 common tests into NATIVE_OR_CROSS_LINKER.
426 (check_SCRIPTS): Add script_test_10.sh.
427 (check_DATA): Add script_test_10.stdout.
428 (script_test_10.o, script_test_10): New targets.
429 (script_test_10.stdout): New target.
430 * configure, testsuite/Makefile.in: Regenerate.
431
3cef7179
ILT
4322010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
433
434 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
435 error for the deprecated relocations.
436 (Target_arm::Scan::global): Likewise.
437 (Target_arm::Relocate::relocate): Likewise.
438
7411e9a8
RS
4392010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
440
441 * fileread.cc (Input_file::find_file): Initialize *found_name
442 and *namep when using the fallback search for case 4.
443
6a9da32a
CC
4442010-10-11 Cary Coutant <ccoutant@google.com>
445
446 * options.h (class General_options): Redefine -z lazy as an alias for
447 the negation of -z now.
448
ac897c20
ILT
4492010-10-11 Ian Lance Taylor <iant@google.com>
450
451 * resolve.cc (symbol_to_bits): Report the value of the unsupported
452 binding.
453
ea5cae92
NC
4542010-10-06 Nick Clifton <nickc@redhat.com>
455
456 * script-sections.cc(class Memory_region): Remove
457 current_lma_offset_ field. Rename current_vma_offset_ to
458 current_offset_. Add last_section_ field.
459 (Memory_region::get_current_vma_address): Rename to
460 get_current_address.
461 (Memory_region::get_current_lma_address): Delete.
462 (Memory_region::increment_vma_offset): Rename to
463 increment_offset.
464 (Memory_region::increment_lma_offset): Delete.
465 (Memory_region::attributes_compatible): New method. Returns
466 true if the provided section is compatible with the region.
467 (Memory_region::get_last_section): New method. Returns the last
468 section to use the region.
469 (Memory_region::set_last_section): New method. Stores the last
470 section to use the region.
471 (Script_sections::block_in_region): New method. Returns true if
472 a block of memory is contained within a region.
473 (Script_sections::find_memory_region): New method. Locates a
474 memory region to be used to set a VMA or LMA address.
475 (Output_section_definition::set_section_addresses): Add code to
476 check for addresses set by memory regions.
477 (Output_segment::set_section_addresses): Remove memory region
478 walking code.
479 (Script_sections::create_segment): Add a warning if a header
480 segment is created outside of any region.
481 * script-sections.h (class Script_sections): Add prototypes for
482 find_memory_region and block_in_region methods.
483 * testsuite/memory_test.s: Use .long instead of .word.
484 * testsuite/memory_test.t: Add some more output sections.
485 * testsuite/memory_test.sh: Update expected output.
486
a9bfd952
DK
4872010-10-02 Doug Kwan <dougkwan@google.com>
488
489 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
490 defintion to symtab.h
491 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
492 declaration to defintion.
493
bacff3ab
NC
4942010-10-01 Nick Clifton <nickc@redhat.com>
495
496 * expression.cc (eval): Replace dummy argument with NULL.
497 (eval_maybe_dot): Check for a NULL result section pointer.
498 (Symbol_expression::value): Likewise.
499 (Dot_expression::value): Likewise.
500 (BINARY_EXPRESSION): Likewise.
501 (Max_expression::value): Likewise.
502 (Min_expression::value): Likewise.
503 (Absolute_expression::value): Likewise.
504 (Addr_expression::value_from_output_section): Likewise.
505 (Loaddddr_expression::value_from_output_section): Likewise.
506 (Segment_start_expression::value): Likewise.
507 * script-sections.cc
508 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
509 argument with NULL.
510 (Sections_elememt_dot_assignment::set_section_addresses):
511 Likewise.
512 (Output_data_expression::do_write_to_buffer): Likewise.
513 (Output_section_definition::finalize_symbols): Likewise.
514 (Output_section_definition::set_section_addresses): Likewise.
515
f81bc8b5
DK
5162010-09-30 Doug Kwan <dougkwan@google.com>
517
518 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
519
c95e9f27
ST
5202010-09-28 Sriraman Tallam <tmsriram@google.com>
521
522 * target.h (Target::can_icf_inline_merge_sections): New virtual
bacff3ab 523 function.
c95e9f27
ST
524 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
525 virtual function.
526 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
527 virtual function.
528 * icf.cc (get_section_contents): Inline merge sections only when
529 target allows it.
530
3cac54d2
RW
5312010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
532
533 * configure: Regenerate.
534
2904037a
ILT
5352010-09-17 Ian Lance Taylor <iant@google.com>
536
537 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
d4d91489
ILT
538 * testsuite/Makefile.am (memory_test.o): New target.
539 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
540 memory_test.t.
541 * testsuite/Makefile.in: Rebuild.
2904037a 542
bca7fb63
DK
5432010-09-17 Doug Kwan <dougkwan@google.com>
544
545 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
546 defintion if relocation uses GOT entries of the symbol.
547 * testsuite/icf_safe_test.sh: Fix test.
548 * testsuite/icf_safe_so_test.sh: Fix test.
549
4ef28648
CC
5502010-09-16 Cary Coutant <ccoutant@google.com>
551
552 * script_sections.cc (class Memory_region): Remove "NULL" from
553 vector initializations.
554
793990de
CC
5552010-09-15 Cary Coutant <ccoutant@google.com>
556
557 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
558 Resolve forwarding symbols.
559
81e015e2
DK
5602010-09-15 Doug Kwan <dougkwan@google.com>
561
562 * gold/testsuite/script_test_3.t: Add ARM special sections.
563 * gold/testsuite/script_test_4.t: Same.
564 * gold/testsuite/script_test_5.t: Same.
565 * gold/testsuite/script_test_6.t: Same.
566 * gold/testsuite/script_test_7.t: Same.
567 * gold/testsuite/script_test_7.t: Same.
568 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
569
36171d64
CC
5702010-09-14 Cary Coutant <ccoutant@google.com>
571
572 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
573 (Target_x86_64::Relocate::relocate_tls): Replace check for
574 saw_tls_block_reloc_ with test for executable section.
575
d89051bd
CC
5762010-09-12 Cary Coutant <ccoutant@google.com>
577
578 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
579 position-independent executables to shared libraries need dynamic
580 relocations.
581 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
582 position-independent executables.
583 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
584 * testsuite/Makefile.in: Regenerate.
585
fca41f0f
NC
5862010-09-10 Nick Clifton <nickc@redhat.com>
587
588 PR gold/11997
589 * testsuite/memory_test.t: Discard any sections that are not
590 needed.
591
6695e4b3
L
5922010-09-09 H.J. Lu <hongjiu.lu@intel.com>
593
594 PR gold/11996
595 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
596 "This::" to work around a bug in gcc 4.2.
597
598 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
599
0f72bf6f
RÁE
6002010-09-09 Rafael Espindola <espindola@google.com>
601
602 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
603 sections with different PF_X flags in the same segment.
604 (Layout::find_first_load_seg): Search all segments to find the first
605 one.
606 * options.h (rosegment): New.
607
6082010-09-08 Rafael Espindola <espindola@google.com>
a6577478 609
05a79166 610 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
a6577478 611
aa98ff75
DK
6122010-09-08 Doug Kwan <dougkwan@google.com>
613
614 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
615 (Arm_relobj::do_relocate_sections): Add new parameter for output
616 file to match the parent.
617 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
618 of local symbols instead of input values. Update code to track
619 changes in gold::relocate_section.
620 * object.cc (Sized_relobj::compute_final_local_value): New methods.
621 (Sized_relobj::compute_final_local_value_internal): New methods.
622 (Sized_relobj::do_finalize_local_symbols): Move code from loop
623 body into private version of Sized_relobj::compute_final_local_value.
624 Call the inline method.
625 * object.h (Symbol_value::Symbol_value): Define destructor. Free
626 merged symbol value if there is one.
627 (Symbol_value::has_output_value): New method defintiion.
628 (Sized_relobj::Compute_final_local_value_status): New enum type.
629 (Sized_relobj::compute_final_local_value): New methods.
630 (Sized_relobj::compute_final_local_value_internal): New methods.
631 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
632 and arm_cortex_a8.sh.
633 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
634 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
635 New tests.
636 * Makefile.in: Regenerate.
637 * testsuite/arm_bl_out_of_range.s: Update test.
638 * testsuite/thumb_bl_out_of_range.s: Ditto.
639 * testsuite/thumb_blx_out_of_range.s: Ditto.
640 * testsuite/arm_branch_out_of_range.sh: New file.
641 * testsuite/arm_cortex_a8.sh: Ditto.
642 * testsuite/arm_cortex_a8_b.s: Ditto.
643 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
644 * testsuite/arm_cortex_a8_b_local.s: Ditto.
645 * testsuite/arm_cortex_a8_bl.s: Ditto.
646 * testsuite/arm_cortex_a8_blx.s: Ditto.
647 * testsuite/arm_cortex_a8_local.s: Ditto.
648 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
649 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
650
05a79166
L
6512010-09-08 Rafael Espindola <espindola@google.com>
652
653 * Makefile.am (memory_test.stdout): Run readelf with -W.
654 * Makefile.in: Regenerate.
655 * testsuite/memory_test.sh: Make the regexps accept both 32 and
656 64 bit output.
657
33dbc701
RÁE
6582010-09-08 Rafael Espindola <espindola@google.com>
659
660 * script-sections.cc (Script_sections::add_memory_region): Convert
661 field precision to int.
662 * script.cc (script_set_section_region, script_set_section_region):
663 Convert field precision to int.
664
731ca54a
RÁE
6652010-09-08 Rafael Espindola <espindola@google.com>
666
667 * arm.cc (do_finalize_sections): Create the __exidx_start and
668 __exdix_end symbols even when the section is missing.
669
7f8cd844
NC
6702010-09-08 Nick Clifton <nickc@redhat.com>
671
672 * README: Remove claim that MEMORY is not supported.
673 * expression.cc (script_exp_function_origin)
674 (script_exp_function_length): Move from here to ...
675 * script.cc: ... here.
676 (script_set_section_region, script_add_memory)
677 (script_parse_memory_attr, script_include_directive): New
678 functions.
679 * script-sections.cc
680 (class Memory_region): New class.
681 (class Output_section_definition): Add set_memory_region,
682 set_section_vma, set_section_lma and get_section_name methods.
683 (class Script_Sections): Add add_memory_region,
684 find_memory_region, find_memory_region_origin,
685 find_memory_region_length and set_memory_region methods.
686 Have set_section_addresses method walk the list of set memory
687 regions.
688 Extend the print methos to display memory regions.
689 * script-sections.h: Add prototypes for new methods.
690 Add enum for MEMORY region attributes.
691 * yyscript.y: Add support for parsing MEMORY regions.
692 * script-c.h: Add prototypes for new functions.
693 * testsuite/Makefile.am: Add test of MEMORY region functionality.
694 * testsuite/Makefile.in: Regenerate.
695 * testsuite/memory_test.sh: New script.
696 * testsuite/memory_test.s: New assembler source file.
697 * testsuite/memory_test.t: New linker script.
698
a4649286
DK
6992010-08-27 Doug Kwan <dougkwan@google.com>
700
701 * gold/resolve.cc (Symbol_table::should_override): Let a weak
702 reference override an existing dynamic weak reference.
703 * testsuite/Makefile.am: Add new test dyn_weak_ref.
704 * testsuite/Makefile.in: Regenerate.
705 * testsuite/dyn_weak_ref.sh: New file.
706 * testsuite/dyn_weak_ref_1.c: Ditto.
707 * testsuite/dyn_weak_ref_2.c: Ditto.
708
b56648ad
ILT
7092010-08-27 Ian Lance Taylor <iant@google.com>
710
711 * incremental.h (class Incremental_input_entry): Add virtual
712 destructor.
713
809313cb
ILT
7142010-08-27 Ian Lance Taylor <iant@google.com>
715
716 * testsuite/start_lib_test_3.c: Mark t3 as used.
717
11e32464
NC
7182010-08-27 Nick Clifton <nickc@redhat.com>
719
720 * options.cc (version_script): Fix small typo in previous
721 whitespace tidyup.
722
ca09d69a
NC
7232010-08-25 Nick Clifton <nickc@redhat.com>
724
725 * archive.cc: Formatting fixes: Remove whitespace between
726 typename and following asterisk. Remove whitespace between
727 function name and opening parenthesis.
728 * archive.h: Likewise.
729 * arm.cc: Likewise.
730 * attributes.cc: Likewise.
731 * attributes.h: Likewise.
732 * common.cc: Likewise.
733 * copy-relocs.cc: Likewise.
734 * dirsearch.h: Likewise.
735 * dynobj.cc: Likewise.
736 * ehframe.cc: Likewise.
737 * ehframe.h: Likewise.
738 * expression.cc: Likewise.
739 * fileread.cc: Likewise.
740 * fileread.h: Likewise.
741 * gc.h: Likewise.
742 * gold-threads.cc: Likewise.
743 * gold.cc: Likewise.
744 * i386.cc: Likewise.
745 * icf.h: Likewise.
746 * incremental-dump.cc: Likewise.
747 * incremental.cc: Likewise.
748 * layout.cc: Likewise.
749 * layout.h: Likewise.
750 * main.cc: Likewise.
751 * merge.cc: Likewise.
752 * merge.h: Likewise.
753 * object.cc: Likewise.
754 * object.h: Likewise.
755 * options.cc: Likewise.
756 * options.h: Likewise.
757 * output.cc: Likewise.
758 * output.h: Likewise.
759 * plugin.cc: Likewise.
760 * plugin.h: Likewise.
761 * powerpc.cc: Likewise.
762 * reloc.cc: Likewise.
763 * script-c.h: Likewise.
764 * script-sections.cc: Likewise.
765 * script.cc: Likewise.
766 * stringpool.cc: Likewise.
767 * symtab.cc: Likewise.
768 * symtab.h: Likewise.
769 * target.cc: Likewise.
770 * timer.cc: Likewise.
771 * timer.h: Likewise.
772 * version.cc: Likewise.
773 * x86_64.cc: Likewise.
774
b8fa8750
NC
7752010-08-24 Nick Clifton <nickc@redhat.com>
776
777 PR 11899
778 * layout.cc (segment_precedes): Sort segments by their physical
779 addresses, if they have been set.
780
9919d93b
CC
7812010-08-23 Cary Coutant <ccoutant@google.com>
782
783 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
784 symbols data.
785 (Lib_group::include_member): Unlock object after deleting its
786 symbols data.
787 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
788 the bug fixed here.
789
97b4be1c
CC
7902010-08-19 Neil Vachharajani <nvachhar@google.com>
791 Cary Coutant <ccoutant@google.com>
792
793 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
794 constructor, and set_blocker.
795 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
796 readsyms_blocker_.
797 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
798 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
799 * testsuite/Makefile.am (start_lib_test): New test case.
800 * testsuite/Makefile.in: Regenerate.
801 * testsuite/start_lib_test_main.c: New file.
802 * testsuite/start_lib_test_1.c: New file.
803 * testsuite/start_lib_test_2.c: New file.
804 * testsuite/start_lib_test_3.c: New file.
805
dd0b1884
ILT
8062010-08-19 Ian Lance Taylor <iant@google.com>
807
808 * Makefile.in: Rebuild with automake 1.11.1.
809 * aclocal.m4: Likewise.
810 * testsuite/Makefile.in: Likewise.
811
7223e9ca
ILT
8122010-08-19 Ian Lance Taylor <iant@google.com>
813
814 PR 10893
815 * i386.cc (class Output_data_plt_i386): Update declarations.
816 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
817 local_ifuncs_ fields.
818 (Target_i386::do_plt_section_for_global): New function.
819 (Target_i386::do_plt_section_for_local): New function.
820 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
821 parameter; change all callers. Initialize global_ifuncs_ and
822 local_ifuncs_. If doing a static link define __rel_iplt_start and
823 __rel_iplt_end.
824 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
825 (Output_data_plt_i386::add_local_ifunc_entry): New function.
826 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
827 symbols.
828 (Target_i386::make_plt_section): New function, broken out of
829 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
830 (Target_i386::make_plt_entry): Call make_plt_section.
831 (Target_i386::make_local_ifunc_plt_entry): New function.
832 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
833 (Target_i386::Scan::local): Handle IFUNC symbols. Add
834 R_386_IRELATIVE to switch.
835 (Target_i386::Scan::global): Likewise.
836 (Target_i386::Relocate::relocate): Likewise.
837 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
838 switch.
839 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
840 (Target_x86_64::do_plt_section_for_global): New function.
841 (Target_x86_64::do_plt_section_for_local): New function.
842 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
843 parameter; change all callers. If doing a static link define
844 __rela_iplt_start and __rela_iplt_end.
845 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
846 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
847 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
848 to point to .plt.
849 (Target_x86_64::make_local_ifunc_plt_entry): New function.
850 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
851 switch.
852 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
853 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
854 R_X86_64_IRELATIVE to switch.
855 (Target_x86_64::Scan::global): Likewise.
856 (Target_x86_64::Relocate::relocate): Likewise.
857 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
858 switch.
859 * target.h (class Target): Add plt_section_for_global and
860 plt_section_for_local functions. Add do_plt_section_for_global
861 and do_plt_section_for_local virtual functions.
862 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
863 clarifying comments.
864 (Symbol::use_plt_offset): Handle IFUNC symbol.
865 * object.cc (Sized_relobj::Sized_relobj): Initialize
866 local_plt_offsets_.
867 (Sized_relobj::local_has_plt_offset): New function.
868 (Sized_relobj::local_plt_offset): New function.
869 (Sized_relobj::set_local_plt_offset): New function.
870 (Sized_relobj::do_count): Handle IFUNC symbol.
871 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
872 a bit away from input_shndx_ field. Add set_is_func_symbol and
873 is_ifunc_symbol functions.
874 (class Sized_relobj): Update declarations. Remove Tls_got_entry
875 and Local_tls_got_offsets. Define Local_plt_offsets. Add
876 local_plt_offsets_ field.
877 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
878 * output.h (class Output_section_data): Add non-const
879 output_section function.
880 (class Output_data_got): Update declarations.
881 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
882 Add use_plt_offset parameter to global and local constructors.
883 Change all callers. Change local_sym_index_ field to 31 bits.
884 Change GSYM_CODE and CONSTANT_CODE accordingly.
885 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
886 doing a static link don't set sh_link field.
887 (Output_data_got::Got_entry::write): Use PLT offset if
888 appropriate.
889 (Output_data_got::add_global_plt): New function.
890 (Output_data_got::add_local_plt): New function.
891 * target-reloc.h (relocate_section): Handle IFUNC symbol.
892 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
893 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
894 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
895 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
896 IFUNC conditional.
897 * testsuite/ifunc-sel.h: New file.
898 * testsuite/ifuncmain1.c: New file.
899 * testsuite/ifuncmain1vis.c: New file.
900 * testsuite/ifuncmod1.c: New file.
901 * testsuite/ifuncdep2.c: New file.
902 * testsuite/ifuncmain2.c: New file.
903 * testsuite/ifuncmain3.c: New file.
904 * testsuite/ifuncmod3.c: New file.
905 * testsuite/ifuncmain4.c: New file.
906 * testsuite/ifuncmain5.c: New file.
907 * testsuite/ifuncmod5.c: New file.
908 * testsuite/ifuncmain6pie.c: New file.
909 * testsuite/ifuncmod6.c: New file.
910 * testsuite/ifuncmain7.c: New file.
911 * configure, testsuite/Makefile.in: Rebuild.
912
56f75c03
ILT
9132010-08-18 Ian Lance Taylor <iant@google.com>
914
915 * incremental.cc
916 (Output_section_incremental_inputs::write_input_files): Add cast
917 to avoid signed/unsigned comparison warning.
918 (Output_section_incremental_inputs::write_info_blocks): Likewise.
919
55455f89
CC
9202010-08-12 Cary Coutant <ccoutant@google.com>
921
922 * common.cc (Sort_commons::operator()): Remove unnecessary code.
923
e2054bcb
ILT
9242010-08-13 Ian Lance Taylor <iant@google.com>
925
926 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
927
74f67560
DK
9282010-08-12 Cary Coutant <ccoutant@google.com>
929 Doug Kwan <dougkwan@google.com>
930
931 * resolve.cc (Symbol_table::should_override): When a weak dynamic
932 defintion overrides non-weak undef, remember that the original undef
933 is not weak.
934 * symtab.cc (Symbol_table::sized_write_global): For undef without
935 an original weak binding, set binding to global in output.
936 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
937 * testsuite/Makefile.in: Regenerate.
938 * testsuite/strong_ref_weak_def.sh: New file.
939 * testsuite/strong_ref_weak_def_1.c: Ditto.
940 * testsuite/strong_ref_weak_def_2.c: Ditto.
941
d1238d12
CC
9422010-08-12 Cary Coutant <ccoutant@google.com>
943
944 * testsuite/incremental_test.sh: Rewrite.
945 * testsuite/incremental_test_1.c: Rewrite.
946 * testsuite/incremental_test_2.c: Rewrite.
947
0e70b911
CC
9482010-08-12 Cary Coutant <ccoutant@google.com>
949
950 * arm.cc (Target_arm::got_size): Add const.
951 (Target_arm::got_entry_count): New function.
952 (Target_arm::plt_entry_count): New function.
953 (Target_arm::first_plt_entry_offset): New function.
954 (Target_arm::plt_entry_size): New function.
955 (Output_data_plt_arm::entry_count): New function.
956 (Output_data_plt_arm::first_plt_entry_offset): New function.
957 (Output_data_plt_arm::get_plt_entry_size): New function.
958 * i386.cc (Target_i386::got_size): Add const.
959 (Target_i386::got_entry_count): New function.
960 (Target_i386::plt_entry_count): New function.
961 (Target_i386::first_plt_entry_offset): New function.
962 (Target_i386::plt_entry_size): New function.
963 (Output_data_plt_i386::entry_count): New function.
964 (Output_data_plt_i386::first_plt_entry_offset): New function.
965 (Output_data_plt_i386::get_plt_entry_size): New function.
966 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
967 find_incremental_inputs_sections. Dump incremental_got_plt section.
968 * incremental.cc: Include target.h.
969 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
970 parameter. Adjust all callers. Find incremental_got_plt section.
971 (Incremental_inputs::create_data_sections): Create incremental_got_plt
972 section.
973 (Output_section_incremental_inputs::set_final_data_size): Calculate
974 size of incremental_got_plt section.
975 (Output_section_incremental_inputs::do_write): Write the
976 incremental_got_plt section.
977 (Got_plt_view_info): New struct.
978 (Local_got_offset_visitor): New class.
979 (Global_got_offset_visitor): New class.
980 (Global_symbol_visitor_got_plt): New class.
981 (Output_section_incremental_inputs::write_got_plt): New function.
982 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
983 Add parameter. Adjust all callers.
984 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
985 (Incremental_inputs::got_plt_section): New function.
986 (Incremental_inputs::got_plt_section_): New data member.
987 (Incremental_got_plt_reader): New class.
988 * layout.cc (Layout::create_incremental_info_sections): Add the
989 incremental_got_plt section.
990 * object.h (Got_offset_list::get_list): New function.
991 (Got offset_list::for_all_got_offsets): New function.
992 (Sized_relobj::local_got_offset_list): New function.
993 * powerpc.cc (Target_powerpc::got_size): Add const.
994 (Target_powerpc::got_entry_count): New function.
995 (Target_powerpc::plt_entry_count): New function.
996 (Target_powerpc::first_plt_entry_offset): New function.
997 (Target_powerpc::plt_entry_size): New function.
998 (Output_data_plt_powerpc::entry_count): New function.
999 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
1000 (Output_data_plt_powerpc::get_plt_entry_size): New function.
1001 * sparc.cc (Target_sparc::got_size): Add const.
1002 (Target_sparc::got_entry_count): New function.
1003 (Target_sparc::plt_entry_count): New function.
1004 (Target_sparc::first_plt_entry_offset): New function.
1005 (Target_sparc::plt_entry_size): New function.
1006 (Output_data_plt_sparc::entry_count): New function.
1007 (Output_data_plt_sparc::first_plt_entry_offset): New function.
1008 (Output_data_plt_sparc::get_plt_entry_size): New function.
1009 * symtab.h (Symbol::got_offset_list): New function.
1010 (Symbol_table::for_all_symbols): New function.
1011 * target.h (Sized_target::got_entry_count): New function.
1012 (Sized_target::plt_entry_count): New function.
1013 (Sized_target::plt_entry_size): New function.
1014 * x86_64.cc (Target_x86_64::got_size): Add const.
1015 (Target_x86_64::got_entry_count): New function.
1016 (Target_x86_64::plt_entry_count): New function.
1017 (Target_x86_64::first_plt_entry_offset): New function.
1018 (Target_x86_64::plt_entry_size): New function.
1019 (Output_data_plt_x86_64::entry_count): New function.
1020 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
1021 (Output_data_plt_x86_64::get_plt_entry_size): New function.
1022
09ec0418
CC
10232010-08-12 Cary Coutant <ccoutant@google.com>
1024
1025 * archive.cc: Include incremental.h.
1026 (Archive::Archive): Initialize incremental_info_.
1027 (Archive::include_member): Record archive members in incremental info.
1028 (Add_archive_symbols::run): Record begin and end of an archive in
1029 incremental info.
1030 (Lib_group::include_member): Record objects in incremental info.
1031 * archive.h (Incremental_archive_entry): Forward declaration.
1032 (Archive::set_incremental_info): New member function.
1033 (Archive::incremental_info): New member function.
1034 (Archive::Unused_symbol_iterator): New class.
1035 (Archive::unused_symbols_begin): New member function.
1036 (Archive::unused_symbols_end): New member function.
1037 (Archive::incremental_info_): New data member.
1038 * incremental-dump.cc (find_input_containing_global): New function.
1039 (dump_incremental_inputs): Dump new incremental info sections.
1040 * incremental.cc: Include symtab.h.
1041 (Output_section_incremental_inputs): New class.
1042 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
1043 new incremental info sections.
1044 (Sized_incremental_binary::do_check_inputs): Likewise.
1045 (Incremental_inputs::report_archive): Remove.
1046 (Incremental_inputs::report_archive_begin): New function.
1047 (Incremental_inputs::report_archive_end): New function.
1048 (Incremental_inputs::report_object): New function.
1049 (Incremental_inputs::finalize_inputs): Remove.
1050 (Incremental_inputs::report_input_section): New function.
1051 (Incremental_inputs::report_script): Rewrite.
1052 (Incremental_inputs::finalize): Do nothing but finalize string table.
1053 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1054 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1055 (Incremental_inputs::create_data_sections): New function.
1056 (Incremental_inputs::relocs_entsize): New function.
1057 (Output_section_incremental_inputs::set_final_data_size): New function.
1058 (Output_section_incremental_inputs::do_write): New function.
1059 (Output_section_incremental_inputs::write_header): New function.
1060 (Output_section_incremental_inputs::write_input_files): New function.
1061 (Output_section_incremental_inputs::write_info_blocks): New function.
1062 (Output_section_incremental_inputs::write_symtab): New function.
1063 * incremental.h (Incremental_script_entry): Forward declaration.
1064 (Incremental_object_entry): Forward declaration.
1065 (Incremental_archive_entry): Forward declaration.
1066 (Incremental_inputs): Forward declaration.
1067 (Incremental_inputs_header_data): Remove.
1068 (Incremental_inputs_header): Remove.
1069 (Incremental_inputs_header_write): Remove.
1070 (Incremental_inputs_entry_data): Remove.
1071 (Incremental_inputs_entry): Remove.
1072 (Incremental_inputs_entry_write): Remove.
1073 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
1074 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
1075 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1076 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
1077 Likewise.
1078 (Incremental_input_entry): New class.
1079 (Incremental_script_entry): New class.
1080 (Incremental_object_entry): New class.
1081 (Incremental_archive_entry): New class.
1082 (Incremental_inputs::Incremental_inputs): Initialize new data members.
1083 (Incremental_inputs::report_inputs): Remove.
1084 (Incremental_inputs::report_archive): Remove.
1085 (Incremental_inputs::report_archive_begin): New function.
1086 (Incremental_inputs::report_archive_end): New function.
1087 (Incremental_inputs::report_object): Change prototype.
1088 (Incremental_inputs::report_input_section): New function.
1089 (Incremental_inputs::report_script): Change prototype.
1090 (Incremental_inputs::get_reloc_count): New function.
1091 (Incremental_inputs::set_reloc_count): New function.
1092 (Incremental_inputs::create_data_sections): New function.
1093 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1094 (Incremental_inputs::inputs_section): New function.
1095 (Incremental_inputs::symtab_section): New function.
1096 (Incremental_inputs::relocs_section): New function.
1097 (Incremental_inputs::get_stringpool): Add const.
1098 (Incremental_inputs::command_line): Add const.
1099 (Incremental_inputs::inputs): Remove.
1100 (Incremental_inputs::command_line_key): New function.
1101 (Incremental_inputs::input_file_count): New function.
1102 (Incremental_inputs::input_files): New function.
1103 (Incremental_inputs::relocs_entsize): New function.
1104 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1105 (Incremental_inputs::finalize_inputs): Remove.
1106 (Incremental_inputs::Input_info): Remove.
1107 (Incremental_inputs::lock_): Remove.
1108 (Incremental_inputs::inputs_): Change type.
1109 (Incremental_inputs::inputs_map_): Remove.
1110 (Incremental_inputs::current_object_entry_): New data member.
1111 (Incremental_inputs::inputs_section_): New data member.
1112 (Incremental_inputs::symtab_section_): New data member.
1113 (Incremental_inputs::relocs_section_): New data member.
1114 (Incremental_inputs::reloc_count_): New data member.
1115 (Incremental_inputs_reader): New class.
1116 (Incremental_symtab_reader): New class.
1117 (Incremental_relocs_reader): New class.
1118 * layout.cc (Layout::finalize): Move finalization of incremental info
1119 and creation of incremental info sections to follow finalization of
1120 symbol table. Set offsets for postprocessing sections.
1121 (Layout::create_incremental_info_sections): Call
1122 Incremental_inputs::create_data_sections. Add incremental symtab
1123 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
1124 sections to layout after input sections.
1125 * layout.h (struct Timespec): Forward declaration.
1126 (Layout::incremental_inputs): Add const.
1127 (Layout::create_incremental_info_sections): Add parameter.
1128 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
1129 * object.cc: Include incremental.h.
1130 (Relobj::finalize_incremental_relocs): New function.
1131 (Sized_relobj::do_layout): Record input sections in incremental info.
1132 * object.h (Object::output_section): New function.
1133 (Object::output_section_offset): Moved from Relobj.
1134 (Object::get_incremental_reloc_base): New function.
1135 (Object::get_incremental_reloc_count): New function.
1136 (Object::do_output_section): New function.
1137 (Object::do_output_section_offset): Moved from Relobj.
1138 (Object::do_get_incremental_reloc_base): New function.
1139 (Object::do_get_incremental_reloc_count): New function.
1140 (Object::Object): Initialize new data members.
1141 (Relobj::output_section): Renamed do_output_section and moved to
1142 protected.
1143 (Relobj::output_section_offset): Moved to Object.
1144 (Relobj::do_get_incremental_reloc_base): New function.
1145 (Relobj::do_get_incremental_reloc_count): New function.
1146 (Relobj::allocate_incremental_reloc_counts): New function.
1147 (Relobj::count_incremental_reloc): New function.
1148 (Relobj::finalize_incremental_relocs): New function.
1149 (Relobj::next_incremental_reloc_index): New function.
1150 (Relobj::reloc_counts_): New data member.
1151 (Relobj::reloc_bases_): New data member.
1152 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
1153 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
1154 (Sized_relobj::incremental_relocs_scan): New function.
1155 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1156 (Sized_relobj::incremental_relocs_write): New function.
1157 (Sized_relobj::incremental_relocs_write_reltype): New function.
1158 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
1159 incremental link.
1160 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
1161 archives and object files elsewhere.
1162 (Add_symbols::run): Report object files here.
1163 (Finish_group::run): Report end of archive at end of group.
1164 * reloc.cc: Include layout.h, incremental.h.
1165 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
1166 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
1167 (Sized_relobj::incremental_relocs_scan): New function.
1168 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1169 (Sized_relobj::do_relocate_sections): Write incremental relocations.
1170 (Sized_relobj::incremental_relocs_write): New function.
1171 (Sized_relobj::incremental_relocs_write_reltype): New function.
1172 * script.cc (read_input_script): Rewrite test for incremental link.
1173 Change call to Incremental_inputs::report_script.
1174 * symtab.h (Symbol_table::first_global_index): New function.
1175 (Symbol_table::output_count): New function.
1176
ce0d1972
DK
11772010-08-12 Doug Kwan <dougkwan@google.com>
1178
1179 * arm.cc (Target_arm::merge_object_attributes): Check command line
1180 options --no-wchar-size-warning and --no-enum-size-warning.
1181 * options.h (General_options): Add ld-compatible options
1182 --no-enum-size-warning and --no-wchar-size-warning.
1183
6e5710ce
ILT
11842010-08-04 Ian Lance Taylor <iant@google.com>
1185
1186 * x86_64.cc (Target_x86_64::Scan::local): Use
1187 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
1188 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
1189 (Target_x86_64::Scan::global): Likewise.
1190 (Target_x86_64::Relocate::relocate): Likewise.
1191 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1192 Likewise.
1193
fef830db
CC
11942010-08-03 Cary Coutant <ccoutant@google.com>
1195
1196 * merge.cc (Output_merge_string::do_add_input_section): Count strings
1197 to reserve space in merged_strings vector. Keep total input size
1198 for stats.
1199 (Output_merge_string::do_print_merge_stats): Print total input size.
1200 * merge.h (Output_merge_string): Add input_size_ field.
1201 * stringpool.cc (Stringpool_template::string_length): Move
1202 implementations out of Stringpool_template class and place in
1203 stringpool.h.
1204 * stringpool.h (string_length): Move out of Stringpool_template.
1205
1e3811b0
ILT
12062010-08-03 Ian Lance Taylor <iant@google.com>
1207
1208 PR 11712
1209 * layout.cc (relaxation_loop_body): If address of load segment is
1210 set, adjust address to include headers if possible.
1211
7af0c620
ILT
12122010-08-03 Ian Lance Taylor <iant@google.com>
1213
1214 * version.cc (version_string): Bump to 1.10.
1215
22f0da72
ILT
12162010-08-03 Ian Lance Taylor <iant@google.com>
1217
1218 PR 11805
1219 * layout.h (enum Output_section_order): Define.
1220 (class Layout): Update declarations.
1221 * layout.cc (Layout::get_output_section): Add order parameter.
1222 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
1223 is_first_non_relro parameters. Change all callers.
1224 (Layout::choose_output_section): Likewise.
1225 (Layout::add_output_section_data): Likewise.
1226 (Layout::make_output_section): Likewise. Set order.
1227 (Layout::default_section_order): New function.
1228 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
1229 * output.cc (Output_section::Output_section): Initialize order_.
1230 Don't initialize deleted fields.
1231 (Output_segment::Output_segment): Don't initialize deleted
1232 fields.
1233 (Output_segment::add_output_section_to_load): New function
1234 replacing add_output_section. Change all callers to call this or
1235 add_output_section_to_nonload.
1236 (Output_segment::add_output_section_to_nonload): New function.
1237 (Output_segment::remove_output_section): Rewrite.
1238 (Output_segment::add_initial_output_data): Likewise.
1239 (Output_segment::has_any_data_sections): Likewise.
1240 (Output_segment::is_first_section_relro): Likewise.
1241 (Output_segment::maximum_alignment): Likewise.
1242 (Output_segment::has_dynamic_reloc): New function replacing
1243 dynamic_reloc_count. Change all callers.
1244 (Output_segment::has_dynamic_reloc_list): New function replacing
1245 dynamic_reloc_count_list. Change all callers.
1246 (Output_segment::set_section_addresses): Rewrite.
1247 (Output_segment::set_offset): Rewrite.
1248 (Output_segment::find_first_and_last_list): Remove.
1249 (Output_segment::set_tls_offsets): Rewrite.
1250 (Output_segment::first_section_load_address): Likewise.
1251 (Output_segment::output_section_count): Likewise.
1252 (Output_segment::section_with_lowest_load_address): Likewise.
1253 (Output_segment::write_section_headers): Likewise.
1254 (Output_segment::print_sections_to_map): Likewise.
1255 * output.h (class Output_data): Remove dynamic_reloc_count_
1256 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
1257 (Output_data::add_dynamic_reloc): Rewrite.
1258 (Output_data::has_dynamic_reloc): New function.
1259 (Output_data::dynamic_reloc_count): Remove.
1260 (class Output_section): Add order_ field. Remvoe is_relro_local_,
1261 is_last_relro_, is_first_non_relro_, is_interp_,
1262 is_dynamic_linker_section_ fields. Add order and set_order
1263 functions. Remove is_relro_local, set_is_relro_local,
1264 is_last_relro, set_is_last_relro, is_first_non_relro,
1265 set_is_first_non_relro functions, is_interp, set_is_interp,
1266 is_dynamic_linker_section, and set_is_dynamic_linker_section
1267 functions.
1268 (class Output_segment): Change Output_data_list from std::list to
1269 std:;vector. Add output_lists_ field. Remove output_data_ and
1270 output_bss_ fields. Update declarations.
1271
3ff2ccb0
ILT
12722010-08-02 Ian Lance Taylor <iant@google.com>
1273
1274 * arm.cc (Target_arm::gc_process_relocs): Use typename.
1275 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
1276 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
1277
88a4108b
ILT
12782010-08-02 Ian Lance Taylor <iant@google.com>
1279
1280 PR 11855
1281 * script.cc (Script_options::Script_options): Initialize
1282 symbol_definitions_ and symbol_references_.
1283 (Script_options::add_symbol_assignment): Update
1284 symbol_definitions_ and symbol_references_.
1285 (Script_options::add_symbol_reference): New function.
1286 (script_symbol): New function.
1287 * script.h (class Script_options): Add symbol_definitions_ and
1288 symbol_references_ fields.
1289 (Script_options::referenced_const_iterator): New type.
1290 (Script_options::referenced_begin): New function.
1291 (Script_options::referenced_end): New function.
1292 (Script_options::is_referenced): New function.
1293 (Script_options::any_unreferenced): New function.
1294 * script-c.h (script_symbol): Declare.
1295 * yyscript.y (exp): Call script_symbol.
1296 * symtab.cc: Include "script.h".
1297 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
1298 Change all callers. Check symbols referenced by scripts.
1299 (Symbol_table::add_undefined_symbols_from_command_line): Add
1300 layout parameter. Change all callers.
1301 (Symbol_table::do_add_undefined_symbols_from_command_line):
1302 Likewise. Break out loop body. Check symbols referenced by
1303 scripts.
1304 (Symbol_table::add_undefined_symbol_from_command_line): New
1305 function broken out of
1306 do_add_undefined_symbols_from_command_line.
1307 * symtab.h (class Symbol_table): Update declarations.
1308 * archive.cc: Include "layout.h".
1309 (Archive::should_include_member): Add layout parameter. Change
1310 all callers. Check for symbol mentioned in expression.
1311 * archive.h (class Archive): Update declaration.
1312 * object.cc (Sized_relobj::do_should_include_member): Add layout
1313 parameter.
1314 * object.h (Object::should_include_member): Add layout parameter.
1315 Change all callers.
1316 (Object::do_should_include_member): Add layout parameter.
1317 (class Sized_relobj): Update declaration.
1318 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
1319 parameter.
1320 * dynobj.h (class Sized_dynobj): Update declaration.
1321 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
1322 layout parameter.
1323 * plugin.h (class Sized_pluginobj): Update declaration.
1324
5f1ab67a
ILT
13252010-08-02 Ian Lance Taylor <iant@google.com>
1326
1327 PR 11866
1328 * output.cc (Output_segment::set_offset): Search for the first and
1329 last sections rather than assuming that the list is in order.
1330 (Output_segment::find_first_and_last_list): New function.
1331 * output.h (class Output_segment): Update declarations.
1332 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
1333 (relro_strip_test_SOURCES): New variable.
1334 (relro_strip_test_DEPENDENCIES): New variable.
1335 (relro_strip_test_LDFLAGS): New variable.
1336 (relro_strip_test_LDADD): New variable.
1337 (relro_strip_test.so): New target.
1338
a8df5856
ILT
13392010-08-02 Ian Lance Taylor <iant@google.com>
1340
1341 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
1342 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
1343 (Target_i386::got_tlsdesc_section): New function.
1344 (Target_i386::got_section): Create space for GOT entries for
1345 TLSDESC relocations.
1346 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
1347 R_386_TLS_GOTDESC.
1348 (Target_i386::Scan::global): Likewise.
1349 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
1350 using TLSDESC GOT.
1351 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
1352 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
1353 (Target_x86_64::got_tlsdesc_section): New function.
1354 (Target_x86_64::got_section): Create space for GOT entries for
1355 TLSDESC relocations.
1356 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
1357 R_386_TLS_GOTDESC.
1358 (Target_x86_64::Scan::global): Likewise.
1359 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
1360 using TLSDESC GOT.
1361
0c10a0a6
ILT
13622010-08-02 Ian Lance Taylor <iant@google.com>
1363
1364 * testsuite/final_layout.sh: Use dc to convert from hex to
1365 decimal.
1366
41cbeecc
ST
13672010-07-29 Sriraman Tallam <tmsriram@google.com>
1368
1369 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
1370 paramter to the call to gold::gc_process_relocs.
1371 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
1372 paramter to the call to gold::gc_process_relocs.
1373 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
1374 parameter to the call to gold::gc_process_relocs.
1375 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
1376 template parameter to the call to gold::gc_process_relocs.
1377 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
1378 paramter to the call to gold::gc_process_relocs.
1379 * gc.h (get_embedded_addend_size): New function.
1380 (gc_process_relocs): Save the size of the reloc for use by ICF.
1381 * icf.cc (get_section_contents): Get the addend from the text section
1382 for SHT_REL relocation sections.
1383 * icf.h (Icf::Reloc_addend_size_info): New typedef.
1384 (Icf::Reloc_info): Add new member reloc_addend_size_info.
1385 * int_encoding.h (read_from_pointer): New overloaded function.
1386 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
1387 * testsuite/icf_sht_rel_addend_test.sh: New file.
1388 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
1389 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
1390
6ea55b82
RW
13912010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1392
1393 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
1394 * Makefile.in: Regenerate.
1395 * testsuite/Makefile.in: Regenerate.
1396
9691462b
ILT
13972010-07-27 Jeffrey Yasskin <jyasskin@google.com>
1398
1399 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
1400 * gold/testsuite/debug_msg.cc: Likewise.
1401 * gold/testsuite/odr_violation1.cc
1402 * gold/testsuite/odr_violation2.cc
1403
76897331
CC
14042010-07-21 Cary Coutant <ccoutant@google.com>
1405
1406 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
1407 string, and length fields.
1408 (Output_merge_string::Merged_strings_list): New type.
1409 (Output_merge_string::Merged_strings_lists): New typedef.
1410 (Output_merge_string): Replace merged_strings_ with
1411 merged_strings_lists_.
1412 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
1413 Merged_strings_list per input object and section. Don't store pointer
1414 to the string. Don't store length with each merged string entry.
1415 (Output_merge_string::finalize_merged_data): Loop over list of merged
1416 strings lists. Recompute length of each merged string.
1417
78384e8f
CC
14182010-07-15 Cary Coutant <ccoutant@google.com>
1419
1420 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
1421 here.
1422
783659f9
ILT
14232010-07-14 Ian Lance Taylor <iant@google.com>
1424
1425 * descriptors.cc (Descriptors::open): Report correct name in error
1426 message.
1427
131687b4
DK
14282010-07-13 Doug Kwan <dougkwan@google.com>
1429
1430 * arm.cc (Arm_input_section::Arm_input_section): For a
1431 SHT_ARM_EXIDX section, always keeps the input sections.
1432 (Arm_input_section::set_exidx_section_link): New method.
1433 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
1434 has_errors_ to false.
1435 (Arm_exidx_input_section::has_errors,
1436 Arm_exidx_input_section::set_has_errors): New methods.
1437 (Arm_exidx_input_section::has_errors_): New data member.
1438 (Arm_relobj::get_exidx_shndx_list): New method.
1439 (Arm_output_section::append_text_sections_to_list): Do not skip
1440 section without SHF_EXECINSTR.
1441 (Arm_output_section::fix_exidx_coverage): Skip input sections with
1442 errors.
1443 (Arm_relobj::make_exidx_input_section): Add new parameter for text
1444 section header. Make error messages more verbose. Check for
1445 a non-executable section linked to an EXIDX section.
1446 (Arm_relobj::do_read_symbols): Remove error checking, which has been
1447 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
1448 check that there is no deferred EXIDX section if we exit early.
1449 Instead of not making an EXIDX section in case of an error, make one
1450 and set the has_errors flag of it.
1451 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
1452 in a relocatable link.
1453 (Target_arm::do_relax): Look for the EXIDX output section instead of
1454 assuming that it is called .ARM.exidx.
1455 (Target_arm::fix_exidx_coverage): Add a new parameter for input
1456 section list. Do not check for SHF_EXECINSTR section flags but
1457 skip any input section with errors.
1458 * output.cc (Output_section::Output_section): Initialize
1459 always_keeps_input_sections_ to false.
1460 (Output_section::add_input_section): Check for
1461 always_keeps_input_sections_.
1462 * output.h (Output_section::always_keeps_input_sections,
1463 Output_section::set_always_keeps_input_sections): New methods.
1464 (Output_section::always_keeps_input_sections): New data member.
1465
69517287
RÁE
14662010-07-13 Rafael Espindola <espindola@google.com>
1467
1468 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
1469 * fileread.h (Input_file): Add try_extra_search_path and find_file.
1470
82742395
ILT
14712010-07-13 Philip Herron <herron.philip@googlemail.com>
1472 Ian Lance Taylor <iant@google.com>
1473
1474 * output.h (Output_section_lookup_maps::add_merge_section):
1475 Correct check of whether value was inserted.
1476 (Output_section_lookup_maps::add_merge_input_section): Likewise.
1477 (Output_section_lookup_maps::add_relaxed_input_section):
1478 Likewise.
1479 * arm.cc (Target_arm::got_section): Remove used local os.
1480 * i386.cc (Target_i386::got_section): Likewise.
1481 * x86_64.cc (Target_x86_64::got_section): Likewise.
1482 * sparc.cc (Target_sparc::got_section): Likewise.
1483 (Target_sparc::relocate): Remove unused local have_got_offset.
1484 * powerpc.cc (Target_powerpc::relocate): Likewise.
1485
f2d707b5
ILT
14862010-07-13 Ian Lance Taylor <iant@google.com>
1487
241531d6
ILT
1488 * compressed_output.cc (zlib_decompress): Fix signature in
1489 !HAVE_ZLIB_H case.
1490
f2d707b5
ILT
1491 * archive.cc (Archive::include_member): Unlock an external member
1492 of a thin archive. Don't bother to delete an object we know is
1493 NULL.
1494
a2e47362
CC
14952010-07-12 Cary Coutant <ccoutant@google.com>
1496
1497 * compressed_output.cc (zlib_decompress): New function.
1498 (get_uncompressed_size): New function.
1499 (decompress_input_section): New function.
1500 * compressed_output.h (get_uncompressed_size): New function.
1501 (decompress_input_section): New function.
1502 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
1503 Handle compressed debug sections.
1504 * layout.cc (is_compressed_debug_section): New function.
1505 (Layout::output_section_name): Map compressed section names to
1506 canonical names.
1507 * layout.h (is_compressed_debug_section): New function.
1508 (is_debug_info_section): Recognize compressed debug sections.
1509 * merge.cc: Include compressed_output.h.
1510 (Output_merge_data::do_add_input_section): Handle compressed
1511 debug sections.
1512 (Output_merge_string::do_add_input_section): Handle compressed
1513 debug sections.
1514 * object.cc: Include compressed_output.h.
1515 (Sized_relobj::Sized_relobj): Initialize new data members.
1516 (build_compressed_section_map): New function.
1517 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
1518 * object.h (Object::section_is_compressed): New method.
1519 (Object::do_section_is_compressed): New method.
1520 (Sized_relobj::Compressed_section_map): New type.
1521 (Sized_relobj::do_section_is_compressed): New method.
1522 (Sized_relobj::compressed_sections_): New data member.
1523 * output.cc (Output_section::add_input_section): Handle compressed
1524 debug sections.
1525 * reloc.cc: Include compressed_output.h.
1526 (Sized_relobj::write_sections): Handle compressed debug sections.
1527
ce279a62
CC
15282010-07-08 Cary Coutant <ccoutant@google.com>
1529
1530 * resolve.cc (Symbol_table::resolve): Remember whether undef was
1531 weak when resolving to a dynamic def.
1532 (Symbol_table::should_override): Add adjust_dyndef flag; set it
1533 for weak undef/dynamic def cases. Adjust callers.
1534 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
1535 undef_binding_weak_.
1536 (Symbol_table::sized_write_globals): Adjust symbol binding.
1537 (Symbol_table::sized_write_symbol): Add binding parameter.
1538 * symtab.h (Symbol::set_undef_binding): New method.
1539 (Symbol::is_undef_binding_weak): New method.
1540 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
1541 (Symbol_table::should_override): Add new parameter.
1542 (Symbol_table::sized_write_symbol): Add new parameter.
1543
1544 * testsuite/weak_undef_file1.cc: Add new test case.
1545 * testsuite/weak_undef_file2.cc: Fix header comment.
1546 * testsuite/weak_undef_test.cc: Add new test case.
1547
b2286c10
DK
15482010-06-29 Doug Kwan <dougkwan@google.com>
1549
1550 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
1551 Initialize USE_SYMBOL_.
1552 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
1553 definition.
1554 (Arm_reloc_property::uses_symbol_): New data member declaration.
1555 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
1556 uses symbol value and symbol is undefined but not weakly undefined.
1557
4802450a
RÁE
15582010-06-28 Rafael Espindola <espindola@google.com>
1559
1560 * plugin.cc (Plugin::load): Use dlerror.
1561
e5ca47ba
ILT
15622010-06-26 Jeffrey Yaskin <jyasskin@google.com>
1563
1564 * symtab.cc (detect_odr_violations): When reporting an ODR
1565 violation, report an object where the symbol is defined.
1566
8a75a161
DK
15672010-06-25 Doug Kwan <dougkwan@google.com>
1568
1569 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
1570 (Target_arm::section_may_have_icf_unsafe_pointers): New method
1571 definition.
1572 (Target_arm::Scan::local_reloc_may_be_function_pointer,
1573 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
1574 target hook to detect function points.
1575 (Target_arm::Scan::possible_function_pointer_reloc): New method.
1576 * icf.h (Icf::check_section_for_function_pointers): Change type of
1577 parameter SECTION_NAME to const reference to std::string. Use
1578 target hook to determine if section may have unsafe pointers.
1579 * target.h (Target::section_may_have_icf_unsafe_pointers): New
1580 method definition.
1581
42218b9f
RÁE
15822010-06-21 Rafael Espindola <espindola@google.com>
1583
1584 * fileread.cc (Input_file::find_fie): New
1585 (Input_file::open): Use Input_file::find_fie.
1586 * fileread.h (Input_file::find_fie): New
1587 * plugin.cc (set_extra_library_path): New.
1588 (Plugin::load): Add set_extra_library_path to the transfer vector.
1589 (Plugin_manager::set_extra_library_path): New.
1590 (Plugin_manager::add_input_file): Use the extra search path if set.
1591 (set_extra_library_path(): New.
1592 * plugin.h (Plugin_manager): Add set_extra_library_path and
1593 extra_search_path_.
1594
a0506cca
CC
15952010-06-19 Cary Coutant <ccoutant@google.com>
1596
1597 * layout.cc (gdb_sections): Add .debug_types.
1598 (lines_only_debug_sections): Likewise.
1599
6508b958
RÁE
16002010-06-18 Rafael Espindola <espindola@google.com>
1601
1602 * plugin.cc (add_input_file,add_input_library)
1603 (Plugin_manager::add_input_file): Make filename arguments const.
1604 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
1605 const.
1606
3e235302
DK
16072010-06-16 Doug Kwan <dougkwan@google.com>
1608
1609 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
1610 .ARM.attributes section if we have not merged any input
1611 attributes sections.
1612
106e8a6c
DK
16132010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1614
1615 * arm.cc: Allow combining objects with no EABI version
1616 information.
1617
91ff43fe
RÁE
16182010-06-15 Rafael Espindola <espindola@google.com>
1619
1620 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
1621
68ed838c
ILT
16222010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1623
1624 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
1625 (struct iovec): Correct !HAVE_READV definition.
1626
f3a2388f
CC
16272010-06-10 Cary Coutant <ccoutant@google.com>
1628
1629 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
1630 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
1631 reloc sections.
1632 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
1633
1634 PR 11683
1635 * symtab.h (Symbol::is_placeholder): New member function.
1636 * target-reloc.h (relocate_section): Check for placeholder symbols.
1637
1638 * testsuite/Makefile.am (plugin_test_8): New test.
1639 (plugin_test_9): New test.
1640 * testsuite/Makefile.in: Regenerate.
1641
e1df38aa
NC
16422010-06-09 Nick Clifton <nickc@redhat.com>
1643
1644 * yyscript.y (input_list_element): Allow strings prefixed with
1645 the '-' character. Treat these as libraries.
1646 * script.cc (script_add_library): New function. Adds a library
1647 specified by "-l<name>" found in an input script.
1648 * script-c.h: Add prototype for script_add_library.
1649
25bbe950
DK
16502010-06-07 Doug Kwan <dougkwan@google.com>
1651
1652 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
1653 Restrict stub-group size to be within long conditional branch
1654 range when working around cortex-A8 erratum.
1655
0f32ea4c
ILT
16562010-06-07 Damien Diederen <dd@crosstwine.com>
1657
1658 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
1659 #ifdef typo.
1660
8fe2a369
ST
16612010-06-03 Sriraman Tallam <tmsriram@google.com>
1662
1663 PR gold/11658
1664 * output.cc
1665 (Output_section::Input_section_sort_entry::compare_section_ordering):
1666 Change to return non-zero correctly.
1667 (Output_section::Input_section_sort_section_order_index_compare
1668 ::operator()): Change to fix ambiguity in comparisons.
1669
6e9ba2ca
ST
16702010-06-01 Sriraman Tallam <tmsriram@google.com>
1671
1672 * gold.h (is_wildcard_string): New function.
1673 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
1674 (Layout::layout_eh_frame): Ditto.
1675 (Layout::find_section_order_index): New method.
1676 (Layout::read_layout_from_file): New method.
1677 * layout.h (Layout::find_section_order_index): New method.
1678 (Layout::read_layout_from_file): New method.
1679 (Layout::input_section_position_): New private member.
1680 (Layout::input_section_glob_): New private member.
1681 * main.cc (main): Call read_layout_from_file here.
1682 * options.h (--section-ordering-file): New option.
1683 * output.cc (Output_section::input_section_order_specified_): New
1684 member.
1685 (Output_section::Output_section): Initialize new member.
1686 (Output_section::add_input_section): Add new parameter.
1687 Keep input sections when --section-ordering-file is used.
1688 (Output_section::set_final_data_size): Sort input sections when
1689 section ordering file is specified.
1690 (Output_section::Input_section_sort_entry): Add new parameter.
1691 Check sorting type.
1692 (Output_section::Input_section_sort_entry::compare_section_ordering):
1693 New method.
1694 (Output_section::Input_section_sort_compare::operator()): Change to
1695 consider section_order_index.
1696 (Output_section::Input_section_sort_init_fini_compare::operator()):
1697 Change to consider section_order_index.
1698 (Output_section::Input_section_sort_section_order_index_compare
1699 ::operator()): New method.
1700 (Output_section::sort_attached_input_sections): Change to sort
1701 according to section order when specified.
e1df38aa
NC
1702 (Output_section::add_input_section<32, true>): Add new parameter.
1703 (Output_section::add_input_section<64, true>): Add new parameter.
1704 (Output_section::add_input_section<32, false>): Add new parameter.
1705 (Output_section::add_input_section<64, false>): Add new parameter.
6e9ba2ca
ST
1706 * output.h (Output_section::add_input_section): Add new parameter.
1707 (Output_section::input_section_order_specified): New
1708 method.
1709 (Output_section::set_input_section_order_specified): New method.
1710 (Input_section::Input_section): Initialize section_order_index_.
1711 (Input_section::section_order_index): New method.
1712 (Input_section::set_section_order_index): New method.
1713 (Input_section::section_order_index_): New member.
1714 (Input_section::Input_section_sort_section_order_index_compare): New
1715 struct.
1716 (Output_section::input_section_order_specified_): New member.
1717 * script-sections.cc (is_wildcard_string): Delete and move modified
1718 method to gold.h.
1719 (Output_section_element_input::Output_section_element_input): Modify
1720 call to is_wildcard_string.
1721 (Output_section_element_input::Input_section_pattern
1722 ::Input_section_pattern): Ditto.
1723 (Output_section_element_input::Output_section_element_input): Ditto.
1724 * testsuite/Makefile.am (final_layout): New test case.
1725 * testsuite/Makefile.in: Regenerate.
1726 * testsuite/final_layout.cc: New file.
1727 * testsuite/final_layout.sh: New file.
1728
3537c84b
RÁE
17292010-06-01 Rafael Espindola <espindola@google.com>
1730
1731 * plugin.cc (Plugin::load): Pass the output name to the plugin.
1732
105b6afd
RÁE
17332010-06-01 Rafael Espindola <espindola@google.com>
1734
1735 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
1736 visibility of symbols.
1737
29e11421
DK
17382010-05-27 Doug Kwan <dougkwan@google.com>
1739
1740 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
1741 from start of output section instead of address for a local symbol
1742 in a merged or relaxed section when doing a relocatable link.
1743
5e0f337e
RÁE
17442010-05-26 Rafael Espindola <espindola@google.com>
1745
1746 PR 11604
1747 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
1748 adding sections the garbage collector removed.
1749 * gold/testsuite/Makefile.am: Add test.
1750 * gold/testsuite/Makefile.in: Regenerate.
1751 * gold/testsuite/plugin_test_7.sh: New.
1752 * gold/testsuite/plugin_test_7_1.c: New.
1753 * gold/testsuite/plugin_test_7_2.c: New.
1754
f4187277
RÁE
17552010-05-26 Rafael Espindola <espindola@google.com>
1756
1757 * script-sections.cc (Output_section_definition::set_section_addresses):
1758 Check for --section-start.
1759
5c388529
DK
17602010-05-26 Doug Kwan <dougkwan@google.com>
1761
1762 * arm.cc (Arm_scan_relocatable_relocs): New class.
1763 (Target_arm::relocate_special_relocatable): New method.
1764 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
1765 (Arm_relocate_functions::thumb_branch_common): Same.
1766 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
1767 instead of Default_scan_relocatable_relocs.
1768 * target-reloc.h (relocate_for_relocatable): Let target handle
1769 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
1770 * target.h (Sized_target::relocate_special_relocatable): New method.
1771
bca1c3ae
ILT
17722010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1773
1774 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
1775
0439c796
DK
17762010-05-23 Doug Kwan <dougkwan@google.com>
1777
1778 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
1779 instead of a cast.
1780 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
1781 with a direct branch, not a conditional branch, to a stub.
1782 * merge.cc (Output_merge_base::record_input_section): New method
1783 defintion.
1784 (Output_merge_data::do_add_input_section): Record input section if
1785 keeps-input-sections flag is set.
1786 (Output_merge_string::do_add_input_section): Ditto.
1787 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
1788 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
1789 INPUT_SECTIONS_.
1790 (Output_merge_base::keeps_input_sections,
1791 Output_merge_base::set_keeps_input_sections,
1792 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
1793 method definitions.
1794 (Output_merge_base::Input_sections): New type declaration.
1795 (Output_merge_base::input_sections_begin,
1796 Output_merge_base::input_sections_end,
1797 Output_merge_base::do_set_keeps_input_sections): New method definitions.
1798 (Output_merge_base::bool keeps_input_sections_,
1799 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
1800 Output_merge_base::input_sections_): New data members.
1801 (Output_merge_data::do_set_keeps_input_sections): New method
1802 defintion.
1803 (Output_merge_string::do_set_keeps_input_sections): Ditto.
1804 * output.cc (Output_section::Input_section::relobj): Move method
1805 defintion from class declaration to here and handle merge sections.
1806 (Output_section::Input_section::shndx): Ditto.
1807 (Output_section::Output_section): Remove initializations of removed
1808 data members and initialize new data member LOOKUP_MAPS_.
1809 (Output_section::add_input_section): Set keeps-input-sections flag
1810 for a newly created merge output section as appropriate. Adjust code
1811 to use Output_section_lookup_maps class.
1812 (Output_section::add_relaxed_input_section): Adjst code for lookup
1813 maps code refactoring.
1814 (Output_section::add_merge_input_section): Add a new parameter
1815 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
1816 class. If adding input section to a newly created merge output
1817 section fails, remove the new merge section.
1818 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
e1df38aa 1819 Adjust code for use of the Output_section_lookup_maps class.
0439c796
DK
1820 (Output_section::find_merge_section): Ditto.
1821 (Output_section::build_lookup_maps): New method defintion.
1822 (Output_section::find_relaxed_input_section): Adjust code to use
1823 Output_section_lookup_maps class.
1824 (Output_section::get_input_sections): Export merge sections. Adjust
1825 code to use Output_section_lookup_maps class.
1826 (Output_section:::add_script_input_section): Adjust code to use
1827 Output_section_lookup_maps class. Update lookup maps for merge
1828 sections also.
1829 (Output_section::discard_states): Use Output_section_lookup_maps.
1830 (Output_section::restore_states): Same.
1831 * output.h (Merge_section_properties): Move class defintion out of
1832 Output_section.
1833 (Output_section_lookup_maps): New class.
1834 (Output_section::Input_section::is_merge_section): New method
1835 defintion.
1836 (Output_section::Input_section::relobj): Move defintion out of class
1837 defintion. Declare method only.
1838 (Output_section::Input_section::shndx): Ditto.
1839 (Output_section::Input_section::output_merge_base): New method defintion.
1840 (Output_section::Input_section::u2_.pomb): New union field.
1841 (Output_section::Merge_section_by_properties_map,
1842 Output_section::Output_section_data_by_input_section_map,
1843 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
1844 Remove types.
1845 (Output_section::add_merge_input_section): Add new parameter
1846 KEEPS_INPUT_SECTIONS.
1847 (Output_section::build_lookup_maps): New method declaration.
1848 (Output_section::merge_section_map_,
1849 Output_section::merge_section_by_properties_map_,
1850 Output_section::relaxed_input_section_map_,
1851 Output_section::is_relaxed_input_section_map_valid_): Remove data
1852 members.
1853 (Output_section::lookup_maps_): New data member.
1854
76295588
L
18552010-05-21 Doug Kwan <dougkwan@google.com>
1856
1857 PR gold/11619
1858 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
1859 avoid a compilation error.
1860
d103a984
RÁE
18612010-05-19 Rafael Espindola <espindola@google.com>
1862
1863 * script-sections.cc (Output_section_definition::allocate_to_segment):
1864 Update the phdrs_list even when the output section is NULL.
1865 * testsuite/Makefile.am: Add test.
1866 * testsuite/Makefile.in: Regenerate.
1867 * testsuite/script_test_9.cc: New.
1868 * testsuite/script_test_9.sh: New.
1869 * testsuite/script_test_9.t: New.
1870
6625d24e
DK
18712010-05-19 Doug Kwan <dougkwan@google.com>
1872
1873 * arm.cc (Arm_input_section::original_size): New method.
1874 (Arm_input_section::do_addralign): Add a cast.
1875 (Arm_input_section::do_output_offset): Remove static cast.
1876 (Arm_input_section::original_addralign,
1877 Arm_input_section::original_size_): Change type to uint32_t.
1878 (Arm_input_section::init): Add safe casts for section alignment
1879 and size.
1880 (Arm_input_section::set_final_data_size): Do not set address and
1881 offset of stub table.
1882 (Arm_output_section::fix_exidx_coverage): Change use of of
1883 Output_section::Simple_input_section to that of
1884 Output_section::Input_section.
1885 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
1886 except for the first pass.
1887 * output.cc (Output_section::get_input_sections): Change type of
1888 input_sections to std::list<Input_section>.
1889 (Output_section::add_script_input_section): Rename from
1890 Output_section::add_simple_input_section. Change type of SIS
1891 parameter from Simple_input_section to Input_section.
1892 * output.h (Output_section::Simple_input_section): Remove class.
1893 (Output_section::Input_section): Change class visibility to public.
1894 (Output_section::Input_section::addralign): Use stored alignments
1895 for special input sections if set.
1896 (Output_section::Input_section::set_addralign): New method.
1897 (Output_section::get_input_sections): Change parameter type from
1898 list of Simple_input_section to list of Input_section.
1899 (Output_section::add_script_input_section): Rename from
1900 Output_section::add_simple_input_section. Change first parameter's
1901 type from Simple_input_section to Input_section and remove the
1902 second and third parameters.
1903 * script-sections.cc (Input_section::Input_section_list): Change
1904 type to list of Output_section::Input_section/
1905 (Input_section_info::Input_section_info): Change parameter type of
1906 INPUT_SECTION to Output_section::Input_section.
1907 (Input_section_info::input_section): Change return type.
1908 (Input_section_info::input_section_): Change type to
1909 Output_section::Input_section.
1910 (Output_section_element_input::set_section_addresses): Adjust code
1911 to use Output_section::Input_section instead of
1912 Output_section::Simple_input_section. Adjust code for renaming
1913 of Output_section::add_simple_input_section.
1914 (Orphan_output_section::set_section_addresses): Ditto.
1915
e1e82ea4
RW
19162010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1917
1918 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
1919 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
1920
91e75c8a
RÁE
19212010-05-18 Rafael Espindola <espindola@google.com>
1922
1923 * options.cc (General_options::finalize): Handle -nostdlib.
1924 * options.h (nostdlib): New option.
1925 * script.cc (script_add_search_dir): Handle -nostdlib.
1926
da59ad79
DK
19272010-05-12 Doug Kwan <dougkwan@google.com>
1928
1929 * arm.cc (Target_arm::do_finalize_sections): Create an empty
1930 attributes section only if there no attributes section after merging.
1931 (Target_arm::merge_object_attributes): Move value of
e1df38aa 1932 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
da59ad79
DK
1933 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
1934 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
1935 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
1936 and arm_attr_merge_7.stdout.
1937 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
1938 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
1939 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
1940 arm_attr_merge_7b.o): New rules.
1941 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
1942 arm_attr_merge_7
1943 * testsuite/Makefile.in: Regenerate.
1944 * testsuite/arm_attr_merge.sh: New file.
1945 * testsuite/arm_attr_merge_[67][ab].s: Same.
1946
3e01a7fd
NC
19472010-05-05 Nick Clifton <nickc@redhat.com>
1948
1949 * po/es.po: Updated Spanish translation.
1950
7ad2014a
L
19512010-04-27 H.J. Lu <hongjiu.lu@intel.com>
1952
1953 * Makefile.am (install-exec-local): Properly install gold as
1954 default cross linker.
1955 * Makefile.in: Regenerated.
1956
4fda8867
NC
19572010-04-27 H.J. Lu <hongjiu.lu@intel.com>
1958 Nick Clifton <nickc@redhat.com>
1959
1960 * configure.ac (install_as_default): Define and set to false
1961 unless --enable-gold or --enable-gold=both/gold has been
1962 specified.
1963 * configure: Regenerate.
1964
1965 * Makefile.am (install-exec-local): Install the executable as
1966 'ld.gold'. If install_as_default is true then also install it as
1967 'ld'.
1968 * Makefile.in: Regenerated.
1969
bd288ea2
ILT
19702010-04-24 Ian Lance Taylor <iant@google.com>
1971
1972 * layout.cc (Layout::layout_reloc): In relocatable link don't
1973 combine reloc sections for grouped sections.
1974
ef38fd8a
ST
19752010-04-23 Sriraman Tallam <tmsriram@google.com>
1976
1977 * gc.h (gc_process_relocs): Pass information on relocs pointing to
1978 sections that are not ordinary to icf.
1979 * icf.cc (get_section_contents): Handle relocation pointing to section
1980 with no object or shndx information.
1981 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
1982 * testsuite/Makefile.in: Regenerate.
1983 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
1984 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
1985
f6973bdc
ILT
19862010-04-22 Ian Lance Taylor <iant@google.com>
1987
1988 * expression.cc (Expression::Expression_eval_info): Add
1989 result_alignment_pointer field.
1990 (Expression::eval_with_dot): Add result_alignment_pointer
1991 parameter. Change all callers.
1992 (Expression::eval_maybe_dot): Likewise.
1993 (class Binary_expression): Add alignment_pointer parameter to
1994 left_value and right_value. Change all callers.
1995 (BINARY_EXPRESSION): Set result alignment.
1996 (class Trinary_expression): Add alignment_pointer parameter to
1997 arg2_value and arg3_value. Change all callers.
1998 (Trinary_cond::value): Set result alignment.
1999 (Max_expression::value, Min_expression::value): Likewise.
2000 (Align_expression::value): Likewise.
2001 * script-sections.cc (class Sections_element): Add dot_alignment
2002 parameter to set_section_addresses virtual function. Update
2003 instantiations.
2004 (class Output_section_element): Likewise.
2005 (Script_sections::create_segments): Add dot_alignment parameter.
2006 Change all callers.
2007 (Script_sections::create_segments_from_phdrs_clause): Likewise.
2008 (Script_sections::set_phdrs_clause_addresses): Likewise.
2009 * script-sections.h: Update declarations.
2010 * script.h: Update declarations.
2011 * output.h (Output_segment::set_minimum_p_align): Don't decrease
2012 min_p_align.
2013 * testsuite/script_test_3.t: Set large alignment.
2014 * testsuite/script_test_3.sh: Make sure that at least one LOAD
2015 segment has expected alignment.
2016
9c9c98a5
NC
20172010-04-22 Nick Clifton <nickc@redhat.com>
2018
2019 * po/gold.pot: Updated by the Translation project.
2020 * po/vi.po: Updated Vietnamese translation.
2021
2253bfba
L
20222010-04-22 H.J. Lu <hongjiu.lu@intel.com>
2023
2024 * testsuite/Makefile.am (check_PROGRAMS): Add
2025 icf_virtual_function_folding_test.
2026 * testsuite/Makefile.in: Regenerated.
2027
85fdf906
AH
20282010-04-15 Andrew Haley <aph@redhat.com>
2029
2030 * options.h (merge_exidx_entries): New option.
2031 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
2032 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
2033 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
2034 (Target_arm::merge_exidx_entries): New function.
2035 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
2036 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
2037 to Arm_exidx_fixup constructor.
2038 Add new arg, merge_exidx_entries.
2039 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
2040 Arm_output_section::fix_exidx_coverage.
2041
ce97fa81
ST
20422010-04-18 Sriraman Tallam <tmsriram@google.com>
2043
2044 * icf.cc (get_section_contents): Check for preemptible functions.
2045 Ignore addend when appropriate.
2046 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
2047 section folded.
2048 (add_from_relobj): Check for section folded.
2049 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
2050 * symtab.h (should_add_dynsym_entry): Add new parameter.
2051 * target-reloc.h (scan_relocs): Check for section folded.
2052 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
2053 Check reloc types for function pointers in shared objects.
2054 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
2055 case.
2056 (icf_preemptible_functions_test): New test case.
2057 (icf_string_merge_test): New test case.
2058 * testsuite.Makefile.in: Regenerate.
2059 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
2060 bar_glob. Refactor code.
2061 * testsuite/icf_preemptible_functions_test.cc: New file.
2062 * testsuite/icf_preemptible_functions_test.sh: New file.
2063 * testsuite/icf_string_merge_test.cc: New file.
2064 * testsuite/icf_string_merge_test.sh: New file.
2065 * testsuite/icf_virtual_function_folding_test.cc: New file.
2066 * testsuite/icf_virtual_function_folding_test.sh: New file.
2067
04ceb17c
DK
20682010-04-14 Doug Kwan <dougkwan@google.com>
2069
2070 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
2071 for local symbol recounting if we remove a section due to ICF.
2072 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
2073 there are no regular objects in input.
2074
153e7da4
DK
20752010-04-13 Doug Kwan <dougkwan@google.com>
2076
2077 * arm.cc (Arm_input_section::set_final_data_size): Compute
2078 accurate final data size instead of using current data size.
2079
4dbd9faf
DK
20802010-04-09 Doug Kwan <dougkwan@google.com>
2081
2082 * layout.cc (Layout::choose_output_section): Handle script section
2083 types.
2084 (Layout::make_output_section_for_script): Add section type parameter.
2085 Handle script section types.
2086 * layout.h (Layout::make_output_section_for_script): Add section
2087 type parameter.
2088 * output.cc (Output_section::Output_section): Initialize data member
2089 is_noload_.
2090 (Output_section::do_reset_address_and_file_offset): Do not set address
2091 to 0 if section is a NOLOAD section.
2092 * output.h (Output_section::is_noload): New method.
2093 (Output_section::set_is_noload): Ditto.
2094 (Output_section::is_noload_): New data member.
2095 * script-c.h (Script_section_type): New enum type.
2096 (struct Parser_output_section_header): Add new file section_type.
2097 * script-sections.cc (Sections_element::output_section_name): Add
2098 parameter for returning script section type.
2099 (Output_section_definition::output_section_name): Ditto.
2100 (Output_section_definition::section_type)P; New method.
2101 (Output_section_definiton::script_section_type_name): Ditto.
2102 (Output_section_definition::script_section_type_): New data member.
2103 (Output_section_definition::Output_section_definition): Initialize
2104 data member Output_section_definition::script_section_type_.
2105 (Output_section_definition::create_sections): Pass script section type
2106 to Layout::make_output_section_for_script.
2107 (Output_section_definition::output_section_name): Return script
2108 section type to caller.
2109 (Output_section_definition::set_section_address): Do not advance
2110 dot value and load address if section type is NOLOAD. Set address
2111 of NOLOAD sections regardless of section flags.
2112 (Output_section_definition::print): Print section type if it is
2113 not SCRIPT_SECTION_TYPE_NONE.
2114 (Output_section_definition::section_type): New method.
2115 (Output_section_definition::script_section_type_name): Ditto.
2116 (Script_sections::output_section_name): Add new parameter
2117 PSECTION_TYPE for returning script section type. Pass it to
2118 section elements. Handle discard sections.
2119 (Sort_output_sections::operator()): Handle NOLOAD sections.
2120 * script-sections.h (Script_sections::Section_type): New enum type.
2121 (Script_sections::output_section_name): Add a new parameter for
2122 returning script section type.
2123 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
2124 INFO and NOLOAD.
2125 * yyscript.y (union): Add new field SECTION_TYPE.
2126 (COPY, DSECT, INFO, NOLOAD): New tokens.
2127 (opt_address_and_section_type): Change type to output_section_header.
2128 (section_type): New non-terminal
2129 (section_header): Handle section type.
2253bfba 2130 (opt_address_and_section_type): Return section type value.
4dbd9faf 2131
721ea635
L
21322010-04-09 H.J. Lu <hongjiu.lu@intel.com>
2133
2134 * testsuite/plugin_common_test_1.c (foo): Add prototype.
2135 * testsuite/plugin_common_test_2.c (foo): Likewise.
2136
6bf924b0
DK
21372010-04-08 Doug Kwan <dougkwan@google.com>
2138
2139 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
2140 Output_merge_data.
2141 * output.cc (Output_section::add_merge_input_section): Simplify
2142 code and return status of Output_merge_base::add_input_section.
e1df38aa 2143 Update merge section map only if Output_merge_base::add_input_section
6bf924b0
DK
2144 returns true.
2145
24af6f92
DK
21462010-04-07 Doug Kwan <dougkwan@google.com>
2147
2148 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
2149 if section is marked as containing instructions but has no mapping
2150 symbols.
2151 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
2152 correct section index.
2153 (Arm_relobj::find_linked_text_section): Ditto.
2154
00698fc5
CC
21552010-04-07 Cary Coutant <ccoutant@google.com>
2156
2157 * archive.cc (include_member): Destroy Read_symbols_data object before
2158 releasing file.
2159 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
2160 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
2161 (Read_symbols_data::~Read_symbols_data) New destructor.
2162 (Section_relocs::Section_relocs) New constructor.
2163 (Section_relocs::~Section_relocs) New destructor.
2164 (Read_relocs_data::Read_relocs_data) New constructor.
2165 (Read_relocs_data::~Read_relocs_data) New destructor.
2166 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
2167 pointers to NULL after deleting.
2168
7296d933
DK
21692010-04-07 Doug Kwan <dougkwan@google.com>
2170
2171 * arm.cc: Replace "endianity" with "endianness" in comments.
2172 (Arm_exidx_cantunwind): Ditto.
2173 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
2174 (Arm_relobj::merge_flags_and_attributes): New method.
2175 (Arm_relobj::merge_flags_and_attributes_): New data member.
2176 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
2177 (Arm_relobj::scan_sections_for_stubs): Ditto.
2178 (Arm_relobj::do_read_symbols): Check to see if we really want to
2179 merge processor-specific flags and attributes. Exit early if
2180 an object is empty except for section names and the undefined symbol.
2181 (Target_arm::do_finalize_sections): Move check for ELF format to
2182 Arm_relobj::do_read_symbols. Merge processor specific flags and
2183 attributes from a regular object only when we have determined that
2184 it is aapropriate. Do not create an .ARM.attributes section in
2185 output if there is no regular input object.
2186 (Target_arm::merge_processor_specific_flags): Check
2187 --warn-mismatch before printing any error.
2188 (Target_arm::merge_object_attributes): Ditto.
2189 * gold.cc (queue_middle_tasks): Handle the case in which there is
2190 no regular object in input.
2191 * options.cc (General_options::parse_EB): New method.
2192 (General_options::parse_EL): Same.
2193 (General_options::General_options): Initialize endianness_.
2194 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
2195 New options.
2196 (General_options::Endianness): New enum.
2197 (General_options::endianness): New method.
2198 (General_options::endianness_): New data member.
2199 * parameters.cc (Parameters::set_options): Check target endianness.
2200 (Parameters::set_target_once): Ditto.
2201 (Parameters::check_target_endianness): New method.
2202 (parameters_force_valid_target): If either -EL or -EB is specified,
2203 use it to define endianness of default target.
2204 * parameters.h (Parameters::check_target_endianness): New method
2205 declaration.
2206 * target.h (class Target): Change "endianity" to "endianness"
2207 in comments.
2208
efc8d4f2
RW
22092010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2210
2211 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
2212 * configure: Regenerate.
2213 * Makefile.in: Regenerate.
2214 * testsuite/Makefile.in: Regenerate.
2215
be234d88
CC
22162010-04-06 Cary Coutant <ccoutant@google.com>
2217
2218 gcc PR lto/42757
2219 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
2220 prevailing definitions of common symbols.
2221 * testsuite/plugin_test_6.sh: New test case.
2222 * testsuite/plugin_common_test_1.c: New test case.
2223 * testsuite/plugin_common_test_2.c: New test case.
2224 * testsuite/Makefile.am (plugin_test_6): New test case.
2225 * testsuite/Makefile.in: Regenerate.
2226
bd32c6bd
NC
22272010-04-06 Nick Clifton <nickc@redhat.com>
2228
2229 * po/vi.po: New Vietnamese translation.
2230
323c532f
DK
22312010-03-30 Doug Kwan <dougkwan@google.com>
2232
2233 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
2234
4fcd97eb
DK
22352010-03-25 Doug Kwan <dougkwan@google.com>
2236
2237 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
2238 to avoid a conversion warning on a 32-bit host.
2239
4ebf39db
ILT
22402010-03-24 Ian Lance Taylor <iant@google.com>
2241
2242 * testsuite/script_test_3.t: Add a TLS segment.
2243 * testsuite/Makefile.am (check_PROGRAMS): Add
2244 tls_phdrs_script_test.
2245 (tls_phdrs_script_test_SOURCES): Define.
2246 (tls_phdrs_script_test_DEPENDENCIES): Define.
2247 (tls_phdrs_script_test_LDFLAGS): Define.
2248 (tls_phdrs_script_test_LDADD): Define.
2249 * testsuite/Makefile.in: Rebuild.
2250
4a599bdd
CC
22512010-03-23 Cary Coutant <ccoutant@google.com>
2252
2253 * fileread.cc (find_or_make_view): Fix comment.
2254
6c93b22c
ILT
22552010-03-23 Ian Lance Taylor <iant@google.com>
2256
2257 * script-sections.cc (class Orphan_section_placement): Define
2258 PLACE_TLS and PLACE_TLS_BSS.
2259 (Orphan_section_placement::Orphan_section_placement): Initialize
2260 new places.
2261 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
2262 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
2263 (tls_script_test_SOURCES): Define.
2264 (tls_script_test_DEPENDENCIES): Define.
2265 (tls_script_test_LDFLAGS): Define.
2266 (tls_script_test_LDADD): Define.
2267 * testsuite/Makefile.in: Rebuild.
2268
a2c7281b
DK
22692010-03-22 Doug Kwan <dougkwan@google.com>
2270
2271 * arm.cc (Arm_relocate_functions::abs8,
2272 Arm_relocate_functions::abs16): Use correct check for overflow
2273 specified in the ARM ELF specs.
2274 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
2275 target of a BLX instruction specially.
2276 (Reloc_stub::stub_type_for_reloc): Ditto.
2277 (Relocate::relocate): Use symbolic names instead of numeric relocation
2278 codes to report error.
2279 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
2280 workaround.
2281 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
2282 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
2283 thumb2_blx_out_of_range.stdout
2284 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
2285 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
2286 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
2287 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
2288 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
2289 thumb2_blx_in_range, thumb2_blx_in_range.o,
2290 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
2291 thumb2_blx_out_of_range.o): New rules.
2292 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
2293 thumb2_blx_in_range and thumb2_blx_out_of_range.
2294 * testsuite/Makefile.in: Regenerate.
2295 * arm_branch_in_range.sh: Add tests for THUMB BLX.
2296 * testsuite/thumb_blx_in_range.s: New file.
2297 * testsuite/thumb_blx_out_of_range.s: New file.
2298
b0193076
RÁE
22992010-03-22 Rafael Espindola <espindola@google.com>
2300
2301 * archive.cc (Should_include): Move to archive.h.
2302 (should_include_member): Make it a member of Archive.
2303 (Lib_group): New.
2304 (Add_lib_group_symbols): New.
2305 * archive.h: Include options.h.
2306 (Archive_member): Moved from Archive.
2307 (Should_include): Moved from archive.cc.
2308 (Lib_group): New.
2309 (Add_lib_group_symbols): New.
2310 * dynobj.cc (do_should_include_member): New.
2311 * dynobj.h (do_should_include_member): New.
2312 * gold.cc (queue_initial_tasks): Update call to queue.
2313 * main.cc (main): Print lib group stats.
2314 * object.cc (do_should_include_member): New.
2315 * object.h: Include archive.h.
2316 (Object::should_include_member): New.
2317 (Object::do_should_include_member): New.
2318 (Sized_relobj::do_should_include_member): New.
2319 * options.cc (General_options::parse_start_lib): New.
2320 (General_options::parse_end_lib): New.
2321 (Input_arguments::add_file): Handle lib groups.
2322 (Input_arguments::start_group): Check we are not in a lib.
2323 (Input_arguments::start_lib): New.
2324 (Input_arguments::end_lib): New.
2325 * options.h (General_options): Add start_lib and end_lib.
2326 (Input_argument::lib_): New.
2327 (Input_argument::lib): New.
2328 (Input_argument::is_lib): New.
2329 (Input_file_lib): New.
2330 (Input_arguments::in_lib_): New.
2331 (Input_arguments::in_lib): New.
2332 (Input_arguments::start_lib): New.
2333 (Input_arguments::end_lib_): New.
2334 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
2335 in unused members as preempted.
2336 (Sized_pluginobj::do_should_include_member): New.
2337 * plugin.h (Sized_pluginobj::do_should_include_member): New.
2338 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
2339 return the blocker.
2340 (Read_symbols::do_whole_lib_group): New.
2341 (Read_symbols::do_lib_group): New.
2342 (Read_symbols::do_read_symbols): Handle lib groups.
2343 (Read_symbols::get_name): Handle lib groups.
2344 * readsyms.h (Read_symbols): Add an archive member pointer.
2345 (Read_symbols::do_whole_lib_group): New.
2346 (Read_symbols::do_lib_group): New.
2347 (Read_symbols::member_): New.
2348 * script.cc (read_input_script): Update call to queue_soon.
2349
d099120c
DK
23502010-03-19 Doug Kwan <dougkwan@google.com>
2351
2352 * arm.cc (Stub_table::Stub_table): Initialize new data members
2353 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
2354 (Stub_table::add_reloc_stub): Assign stub offset and update
2355 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
2356 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
2357 New data members.
2358 (Stub_table::update_data_size_and_addralign): Use
2359 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
2360 instead of going over all reloc stubs.
2361 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
2362 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
2363 Stringpool_template::offset_ to size of Stringpool_char.
2364 (Stringpool_template::new_key_offset): Remove code to initialize
2365 Stringpool_template::offset_.
2366 * stringpool.h (Stringpool_template::set_no_zero_null): Set
2367 Stringpool_template::offset_ to zero.
2368
1aa37384
DK
23692010-03-15 Doug Kwan <dougkwan@google.com>
2370
2371 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
2372 offset_.
2373 (Stringpool_template::new_key_offset): New method.
2374 (Stringpool_template::add_string): Assign offsets when adding new
2375 strings.
2376 (Stringpool_template::set_string_offsets): Do not set string offsets
2377 when not optimizing.
2378 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
2379 member size_.
2380 (Chunked_vector::clear): Clear size_.
2381 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
2382 (Chunked_vector::size): Return size_.
2383 (Chunked_vector::push_back): Use size_ to find insert position.
e1df38aa 2384 (Chunked_vector::size_): New data member.
1aa37384
DK
2385 (Stringpool_template::set_no_zero_null): Assert string set is empty.
2386 (Stringpool_template::new_key_offset): New method declaration.
2387 (Stringpool_template::offset_): New data member.
2388
b672b057
RÁE
23892010-03-15 Rafael Espindola <espindola@google.com>
2390
2391 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
2392 Add_symbols' constructor.
2393 * readsyms.h (Add_symbols): Remove the input_group member.
2394
b6848d3c
ILT
23952010-03-10 Ian Lance Taylor <iant@google.com>
2396
2397 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
2398 target to ask whether a reference to a symbol requires a stack
2399 split.
2400 * target.h (Target::is_call_to_non_split): New function.
2401 (Target::do_is_call_to_non_split): Declare virtual function.
2402 * target.cc: Include "symtab.h".
2403 (Target::do_is_call_to_non_split): New function.
2404 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
2405
a2a5469e
CC
24062010-03-10 Cary Coutant <ccoutant@google.com>
2407
2408 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
2409 (File_read::open[1]): Remove initial mapping of whole_file_view_.
2410 (File_read::open[2]): Add whole_file_view_ to list of views.
2411 (File_read::make_view): Remove test of whole_file_view_.
2412 (File_read::find_or_make_view): Create whole_file_view_ if
2413 necessary.
2414 (File_read::clear_views): Replace bool parameter with enum;
2415 adjust all callers. Don't delete views with permanent data;
2416 do delete cached views and views from archives if
2417 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
2418 if clearing the corresponding view.
2419 * fileread.h (File_read::Clear_views_mode): New enum.
2420 (File_read::View::is_permanent_view): New method.
2421 (File_read::clear_views): Replace bool parameter
2422 with enum; adjust all callers.
2423 * options.h (General_options): Change keep_files_mapped option;
2424 add map_whole_files.
2425 * readsyms.cc (Add_symbols::run): Delete sd_ object before
2426 releasing the file.
2427 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
2428 the file.
2429
8861f32b
DM
24302010-03-10 David S. Miller <davem@davemloft.net>
2431
2432 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
2433
d62d0f5f
ST
24342010-03-09 Sriraman Tallam <tmsriram@google.com>
2435
2436 * icf.cc (get_section_contents): Add '@' marker after processing the
2437 merge reloc.
2438
9177756d
DK
24392010-03-08 Doug Kwan <dougkwan@google.com>
2440
2441 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
2442 due to a conversion warning.
2443 (Arm_relobj::update_output_local_symbol_count): Check for local
2444 symbol with unset output index.
2445
9e9e071b
ILT
24462010-03-05 Ian Lance Taylor <iant@google.com>
2447
2448 * options.h (class General_options): Add --spare-dynamic-tags.
2449 * output.cc (Output_data_dynamic::set_final_data_size): Implement
2450 --spare-dynamic-tags.
2451
a81ee015
ILT
24522010-03-05 Ian Lance Taylor <iant@google.com>
2453
2454 * incremental.cc: Include "libiberty.h".
2455
44ec90b9
RO
24562010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2457
2458 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
2459 function, is_info_ member.
2460 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
2461 (Versions::Versions): Update caller.
2462 (Versions::define_base_version): Likewise.
2463 (Versions::add_def): Likewise.
2464
0897ed3b
ST
24652010-03-03 Sriraman Tallam <tmsriram@google.com>
2466
2467 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
2468 (Scan::possible_function_pointer_reloc): New function.
2469 (Scan::local_reloc_may_be_function_pointer): Change to call
2470 possible_function_pointer_reloc.
2471 (Scan::global_reloc_may_be_function_pointer): Ditto.
2472 * icf.h (Icf::check_section_for_function_pointers): Change to reject
2473 relocations in ".data.rel.ro._ZTV" section.
2474 * testsuite/icf_safe_so_test.sh: Change to pass i386.
2475 * testsuite/icf_safe_so_test.cc: Ditto.
2476 * testsuite/icf_safe_test.cc: Ditto.
2477 * testsuite/icf_safe_test.sh: Ditto.
2478
d3bbad62
ILT
24792010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2480 Ian Lance Taylor <iant@google.com>
2481
2482 * target-reloc.h (relocate_section): Check the symbol table index
2483 for -1U before setting the local symbol index.
2484 (scan_relocatable_relocs): If copying the relocation, record that
2485 the local symbol is required.
2486 * object.h (Symbol_value::is_output_symtab_index_set): New
2487 function.
2488 (Symbol_value::may_be_discarded_from_output_symtab): New
2489 function.
2490 (Symbol_value::has_output_symtab_entry): New function.
2491 (Symbol_value::needs_output_symtab_entry): Remove.
2492 (Symbol_value::output_symtab_index): Make sure the symbol index is
2493 set.
2494 (Symbol_value::set_output_symtab_index): Make sure the symbol
2495 index is not set. Make sure the new index is valid.
2496 (Symbol_value::set_must_have_output_symtab_entry): New function.
2497 (Symbol_value::has_output_dynsym_entry): New function.
2498 (Symbol_value::set_output_dynsym_index): Make sure the new index
2499 is valid.
2500 (Sized_relobj::set_must_have_output_symtab_entry): New function.
2501 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
2502 local symbol if permitted.
2503 (Sized_relobj::do_finalize_local_symbols): Call
2504 is_output_symtab_index_set rather than needs_output_symtab_entry.
2505 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
2506 rather than needs_output_symtab_entry. Call
2507 has_output_dynsym_entry rather than needs_output_dynsym_entry.
2508 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
2509 is_output_symtab_index_set rather than needs_output_symtab_entry.
2510 * testsuite/discard_locals_relocatable_test.c: New file.
2511 * testsuite/discard_locals_test.sh: Test -r.
2512 * testsuite/Makefile.am (check_DATA): Add
2513 discard_locals_relocatable_test1.syms,
2514 discard_local_relocatable_test2.syms.
2515 (MOSTLYCLEANFILES): Likewise. Also add
2516 discard_locals_relocatable_test1.lout and
2517 discard_locals_relocatable_test2.out.
2518 (discard_locals_relocatable_test1.syms): New target.
2519 (discard_locals_relocatable_test.o): New target.
2520 (discard_locals_relocatable_test1.out): New target.
2521 (discard_locals_relocatable_test2.syms): New target.
2522 (discard_locals_relocatable_test2.out): New target.
2523 (various): Add missing ../ld-new dependencies.
2524 * testsuite/Makefile.in: Rebuild.
2525
7e8ccf26
NC
25262010-03-03 Nick Clifton <nickc@redhat.com>
2527
2528 * po/fi.po: New Finnish translation.
2529
2a0ff005
DK
25302010-03-01 Doug Kwan <dougkwan@google.com>
2531
2532 * layout.cc (Layout::Layout): Force section types of .init_array*,
2533 .preinit_array* and .fini_array* sections.
2534 * output.cc (Output_section::Input_section_sort_entry::has_priority):
2535 Fix check of return value of std::string::find.().
2536 (Output_section::Input_section_sort_compare::operator()): Remove
2537 comment about .init_array.
2538 (Output_section::Input_section_sort_init_fini_compare::operator()):
2539 New method.
2540 (Output_section::sort_attached_input_sections): Handle .init_array
2541 and .fini_array specially.
2542 * output.h (Output_section::Inut_section_sort_compare): Update
2543 comment.
2544 (Output_section::Input_section_sort_init_fini_compare): New struct.
2545
c3e4ae29
DK
25462010-02-26 Doug Kwan <dougkwan@google.com>
2547
2548 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
2549 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
2550 * testsuite/debug_msg.sh: Avoid matching source line number for
2551 use of global variable undef_int.
2552
2fd9ae7a
DK
25532010-02-26 Doug Kwan <dougkwan@google.com>
2554
2555 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
2556 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
2557 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
2558 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
2559 * options.cc (General_options::General_options): Initialize member
2560 fix_v4bx_.
2561 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
2562 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
2563 and rm_no_fix_v4bx.stdout
2564 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
2565 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
2566 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
2567 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
2568 and arm_no_fix_v4bx.
2569 * Makefile.in: Regenerate.
2570 * testsuite/arm_fix_v4bx.s: New file.
2571 * testsuite/arm_fix_v4bx.sh: Ditto.
2572
67ec7d0b
DK
25732010-02-24 Doug Kwan <dougkwan@google.com>
2574
2575 * arm.cc (Target_arm::got_section): Make the .got section the first
2576 non RELRO section in the data segment.
2577 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
2578 suffixes of section names.
2579
10165461
DK
25802010-02-24 Doug Kwan <dougkwan@google.com>
2581
2582 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
2583 flags and attributes merging if an input file is a binary file.
2584 * fileread.cc (Input_file::open): Record format of original file.
2585 * fileread.h (Input_file::Format): New enum type.
2586 (Input_file::Input_file): Initialize data member format_.
2587 (Input_file::format): New method definition.
2588 (Input_file::format_):: New data member.
2589
4a54abbb
DK
25902010-02-24 Doug Kwan <dougkwan@google.com>
2591
2592 * arm.cc (Arm_output_data_got): New class.
2593 (ARM_TCB_SIZE): New constant
2594 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
2595 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
2596 If user uses a script with a SECTIONS clause, issue only a warning
2597 for a misplaced EXIDX input section. Otherwise, issue an error.
2598 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
2599 garbage collection.
2600 (Target_arm::got_mode_index_entry): Handle static linking.
2601 (Target_arm::Scan::local): Ditto.
2602 (Target_arm::Scan::global): Ditto.
2603 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
2604 all incorrectly implemented relocations.
e1df38aa 2605 (Target_arm::fix_exidx_coverage): Pass layout to
4a54abbb
DK
2606 Arm_output_section::fix_exidx_coverage.
2607 * layout.cc (Layout::section_name_mapping): Remove trailing dots
2608 from ".ARM.exidx." and ".ARM.extab.".
2609
ca419a6f
ILT
26102010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2611
2612 * arm.cc (Target_arm::do_finalize_sections): Create attribute
2613 section if it does not already exist.
2614 * attributes.cc (Attributes_section_data::Attributes_section_data):
2615 Don't crash if size is zero.
2616
135b9c78
ILT
26172010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2618 Ian Lance Taylor <iant@google.com>
2619
2620 * gold.cc (queue_middle_tasks): If no input files were opened,
2621 exit.
2622 * workqueue.h (Task_function::Task_function): Assert that there is
2623 a blocker.
2624
bb0bfe4f
DK
26252010-02-22 Doug Kwan <dougkwan@google.com>
2626
2627 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
2628 * icf.cc (get_section_contents): Cast snprintf arguments to long long
2629 types to avoid warnings due to different uint64_t implementations
2630 on different hosts.
2631
2a2b6d42
DK
26322010-02-21 Doug Kwan <dougkwan@google.com>
2633
2634 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
2635 handling of the maximum backward branch offset.
2636 (Arm_relocate_functions::thumb_branch_common): Ditto.
2637 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
2638 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
e1df38aa 2639 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2a2b6d42
DK
2640 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
2641 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
2642 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
2643 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
2644 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
2645 thumb_bl_out_of_range thumb_bl_out_of_range.o,
2646 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
2647 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
2648 thumb2_bl_out_of_range.o): New rules.
2649 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
2650 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
2651 thumb2_bl_out_of_range
2652 * testsuite/Makefile.in: Regenerate.
2653 * testsuite/arm_bl_in_range.s: New file.
2654 * testsuite/arm_bl_out_of_range.s: Ditto.
2655 * testsuite/arm_branch_in_range.sh: Ditto.
2656 * testsuite/arm_branch_range.t: Ditto.
2657 * testsuite/thumb2_branch_range.t: Ditto.
2658 * testsuite/thumb_bl_in_range.s: Ditto.
2659 * testsuite/thumb_bl_out_of_range.s: Ditto.
2660 * testsuite/thumb_branch_range.t: Ditto.
2661
b487ad64
ST
26622010-02-20 Sriraman Tallam <tmsriram@google.com>
2663
2664 * gc.h (gc_process_relocs): Change vectors to point to the new list.
2665 Add reloc offset information.
2666 * icf.cc (get_section_contents): Change iterators to point to the new
2667 vectors. Add reloc offset information to the contents.
2668 * icf.h (Icf::Sections_reachable_info): New typedef.
2669 (Icf::Sections_reachable_list): New typedef.
2670 (Icf::Offset_info): New typedef.
2671 (Icf::Reloc_info): New struct typedef.
2672 (Icf::Reloc_info_list): New typedef.
2673 (Icf::symbol_reloc_list): Delete method.
2674 (Icf::addend_reloc_list): Delete method.
2675 (Icf::section_reloc_list): Delete method.
2676 (Icf::reloc_info_list): New method.
2677 (Icf::reloc_info_list_): New member.
2678
f96accdf
DK
26792010-02-19 Doug Kwan <dougkwan@google.com>
2680
2681 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
2682 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
2683 * arm.cc (Arm_relocation_functions): New forward declaration.
2684 (Target_arm::Target_arm): Initialize new data members
2685 got_mod_index_offset_ and tls_base_symbol_defined_.
2686 (Target_arm::Relocate::relocate_tls): New method.
2687 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
2688 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
2689 New methods.
2690 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
2691 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
2692 (Target_arm::got_mod_index_offset_,
2693 Target_arm::tls_base_symbol_defined_): New data members.
2694 (Target_arm::Scan::local, Target::Scan::global,
2695 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
2696 relocations.
2697
c8761b9a
DK
26982010-02-18 Doug Kwan <dougkwan@google.com>
2699
2700 * arm.cc (Arm_relobj::find_linked_text_section): New method.
2701 (Arm_relobj::make_exidx_input_section): Pass section index of linked
2702 text section as a parameter becuase some broken tools may not set
2703 the link in section header.
2704 (Target_arm::has_got_section): New method.
2705 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
2706 without any mapping symbol as data only. Remove warning.
2707 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
2708 link in its section header, try to discover the link by inspecting the
2709 REL31 relocation at the beginning of the section.
2710 (Target_arm::Scan::check_non_pic): Report name of offending relocation
2711 in error message.
2712 (Target_arm::Scan::global): Treat any reference to the symbol
2713 _GLOBAL_OFFSET_TABLE_ as a GOT access.
2714
21bb3914
ST
27152010-02-12 Sriraman Tallam <tmsriram@google.com>
2716
2717 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
2718 (Scan::global_reloc_may_be_function_pointer): New function.
2719 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
2720 (Scan::global_reloc_may_be_function_pointer): New function.
2721 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
2722 (Scan::global_reloc_may_be_function_pointer): New function.
2723 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
2724 (Scan::global_reloc_may_be_function_pointer): New function.
2725 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
2726 (Scan::global_reloc_may_be_function_pointer): New function.
2727 (Scan::possible_function_pointer_reloc): New function.
2728 (Target_x86_64::can_check_for_function_pointers): New function.
2729 * gc.h (gc_process_relocs): Scan relocation types to determine if
2730 function pointers were taken for targets that support it.
2731 * icf.cc (Icf::find_identical_sections): Include functions for
2732 folding in safe ICF whose pointer is not taken.
2733 * icf.h (Secn_fptr_taken_set): New typedef.
2734 (fptr_section_id_): New member.
2735 (section_has_function_pointers): New function.
2736 (set_section_has_function_pointers): New function.
2737 (check_section_for_function_pointers): New function.
2738 * options.h: Fix comment for safe ICF option.
2739 * target.h (can_check_for_function_pointers): New function.
2740 * testsuite/Makefile.am: Add icf_safe_so_test test case.
2741 Modify icf_safe_test for X86-64.
2742 * testsuite/Makefile.in: Regenerate.
2743 * testsuite/icf_safe_so_test.cc: New file.
2744 * testsuite/icf_safe_so_test.sh: New file.
2745 * testsuite/icf_safe_test.cc (kept_func_3): New function.
2746 (main): Change to take pointer to function kept_func_3.
2747 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
2748 folding is done correctly for X86-64.
2749
0da6fa6c
DM
27502010-02-12 David S. Miller <davem@davemloft.net>
2751
2752 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
2753 is_symbolless parameter.
2754 (Output_reloc<SHT_REL>::is_symbolless): New.
2755 (Output_reloc<SHT_REL>::is_symbolless_): New.
2756 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
2757 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
2758 (Output_reloc<SHT_RELA>::is_symbolless): New.
2759 (Output_data_reloc::add_global): Handle is_symbolless.
2760 (Output_data_reloc::add_global_relative): Likewise.
2761 (Output_data_reloc::add_local): Likewise.
2762 (Output_data_reloc::add_local_relative): Likewise.
2763 (Output_data_reloc::add_symbolless_global_addend): New.
2764 (Output_data_reloc::add_symbolless_local_addend): New.
2765 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
2766 is_symbolless.
2767 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
2768 instead of ->is_relative_
2769 (Output_reloc::write): Likewise.
2770 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
2771 (Output_reloc::write_rel): Simplify.
2772
2773 * sparc.cc (Target_sparc::Scan::local): Use
2774 ->add_symbolless_local_addend as needed.
2775 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
2776 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
2777 based upon relocation offset.
2778
e4782e83
DK
27792010-02-11 Doug Kwan <dougkwan@google.com>
2780
2781 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
2782 (Target_arm::Scan::global): Ditto. Also remove a comment before the
2783 beginning of function.
2784 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
2785 and MOVT_ABS relocations. Those are non issued in scanning. Fix
2786 parameter is_32bit in calls to should_apply_static_reloc.
2787 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
2788 (check_DATA): Add arm_abs_global.stdout.
2789 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
2790 arm_abs_global.stdout): New rules.
2791 (MOSTLLYCLEANFILES): Add arm_abs_global
2792 * Makefile.in: Regenerate.
2793 * testsuite/arm_abs_global.s: New file.
2794 * testsuite/arm_abs_global.sh: Ditto.
2795 * testsuite/arm_abs_lib.s: Ditto.
2796
93ceb764
ILT
27972010-02-11 Ian Lance Taylor <iant@google.com>
2798
2799 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
2800 Read_relocs task.
2801 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
2802 Allocate_commons_task first.
2803 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
2804 task, rather than symtab_lock_.
2805 (Gc_process_relocs::~Gc_process_relocs): New function.
2806 (Gc_process_relocs::is_runnable): Check this_blocker_.
2807 (Gc_process_relocs::locks): Use next_blocker_ rather than
2808 blocker_.
2809 (Scan_relocs::~Scan_relocs): New function.
2810 (Scan_relocs::is_runnable): Check this_blocker_ rather than
2811 symtab_lock_.
2812 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
2813 next_blocker_.
2814 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
2815 fields. Add this_blocker_ and next_blocker_ fields. Adjust
2816 constructor accordingly.
2817 (class Gc_process_relocs): Likewise.
2818 (class Scan_relocs): Likewise.
2819 * common.h (class Allocate_commons_task): Remove symtab_lock_
2820 field, and corresponding constructor parameter.
2821 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
2822 symtab_lock_.
2823 (Allocate_commons_task::locks): Likewise.
2824
114dfbe1
ILT
28252010-02-11 Ian Lance Taylor <iant@google.com>
2826
2827 * gold-threads.h (class Once): Define.
2828 (class Initialize_lock): Rewrite as child of Once.
2829 * gold-threads.cc (class Once_initialize): Define.
2830 (once_pointer_control): New static variable.
2831 (once_pointer, once_arg): New static variables.
2832 (c_run_once): New static function.
2833 (Once::Once, Once::run_once, Once::internal_run): New functions.
2834 (class Initialize_lock_once): Remove.
2835 (initialize_lock_control): Remove.
2836 (initialize_lock_pointer): Remove.
2837 (initialize_lock_once): Remove.
2838 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
2839 (Initialize_lock::initialize): Rewrite.
2840 (Initialize_lock::do_run_once): New function.
2841 * archive.cc (Archive::interpret_header): Only clear name if it is
2842 not already empty.
2843 * fileread.cc: Include "gold-threads.h"
2844 (file_counts_lock): New static variable.
2845 (file_counts_initialize_lock): Likewise.
2846 (File_read::release): Only increment counts when using --stats.
2847 Use a lock around the increment.
2848 * parameters.cc (class Set_parameters_target_once): Define.
2849 (set_parameters_target_once): New static variable.
2850 (Parameters::Parameters): Move here from parameters.h.
2851 (Parameters::set_target): Rewrite.
2852 (Parameters::set_target_once): New function.
2853 (Parameters::clear_target): Move here and rewrite.
2854 * parameters.h (class Parameters): Update declarations. Add
2855 set_parameters_target_once_ field.
2856 (Parameters::Parameters): Move to parameters.cc.
2857 (Parameters::clear_target): Likewise.
2858 * readsyms.cc (Read_symbols::do_group): Create a Start_group
2859 task.
2860 (Start_group::~Start_group): New function.
2861 (Start_group::is_runnable): New function.
2862 (Start_group::locks, Start_group::run): New functions.
2863 (Finish_group::run): Change saw_undefined to size_t.
2864 * readsyms.h (class Start_group): Define.
2865 (class Finish_group): Change saw_undefined_ field to size_t.
2866 (Finish_group::Finish_group): Remove saw_undefined and
2867 this_blocker parameters. Change all callers.
2868 (Finish_group::set_saw_undefined): New function.
2869 (Finish_group::set_blocker): New function.
2870 * symtab.h (class Symbol_table): Change saw_undefined to return
2871 size_t. Change saw_undefined_ field to size_t.
2872 * target-select.cc (Set_target_once::do_run_once): New function.
2873 (Target_selector::Target_selector): Initialize set_target_once_
2874 field. Don't initialize lock_ and initialize_lock_ fields.
2875 (Target_selector::instantiate_target): Rewrite.
2876 (Target_selector::set_target): New function.
2877 * target-select.h (class Set_target_once): Define.
2878 (class Target_selector): Update declarations. Make
2879 Set_target_once a friend. Remove lock_ and initialize_lock_
2880 fields. Add set_target_once_ field.
2881
fa17a3f4
ILT
28822010-02-10 Ian Lance Taylor <iant@google.com>
2883
2884 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
2885 queueing any tasks.
2886 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
2887 (queue_middle_tasks): Add all blockers before queueing any tasks.
2888 (queue_final_tasks): Likewise.
2889 * token.h (Task_token::add_blockers): New function.
2890 * object.h (Input_objects::number_of_relobjs): New function.
2891
c7177d31
ILT
28922010-02-10 Ian Lance Taylor <iant@google.com>
2893
5de0e392
ILT
2894 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
2895 shared, not if not position independent.
2896 * x86_64.cc (Relocate::relocate_tls): Likewise.
2897 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
2898 (tls_pie_pic_test): New target.
2899 * testsuite/Makefile.in: Rebuild.
2900
c7177d31
ILT
2901 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
2902 (tls_test_main_pie.o, tls_test_pie.o): New targets.
2903 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
2904 * testsuite/Makefile.in: Rebuild.
2905
684b268a
DM
29062010-02-09 David S. Miller <davem@davemloft.net>
2907
2908 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
2909 R_SPARC_RELATIVE using ->add_local_relative().
2910 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
2911
612a8d3d
DM
2912 * output.h (Output_data_dynamic::add_section_size): New method
2913 that takes two Output_data objects.
2914 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
2915 entry param. Handle it in initializers.
2916 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
2917 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
2918 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
2919 arg.
2920 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
2921 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
2922 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
2923 for dynrel_includes_plt.
2924 * i386.cc (Target_i386::do_finalize_sections): Likewise.
2925 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
2926 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
2927 before .rela.plt
2928 (Target_sparc::do_finalize_sections): Update to pass true for
2929 dynrel_includes_plt.
2930 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
2931 output before .rela.plt
2932 (Target_powerpc::do_finalize_sections): Update to pass true for
2933 dynrel_includes_plt when 32-bit.
2934
cb1be87e
DK
29352010-02-08 Doug Kwan <dougkwan@google.com>
2936
2937 * arm.cc (Arm_relobj::simple_input_section_output_address): New
2938 method.
2939 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
2940 Arm_relobj::scan_section_for_cortex_a8_stubs,
2941 Arm_relobj::do_relocation_section): Instead of calling
2942 Output_section::output_address, use faster
2943 Arm_relobj::simple_input_section_output_address.
2944
705b5121
DM
29452010-02-08 David S. Miller <davem@davemloft.net>
2946
2947 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
2948 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
2949 relocation helper function.
2950
024c4466
DM
2951 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
2952 just like R_SPARC_GOT{10,13,22}.
2953 (Target_sparc::Scan::local): Likewise.
2954 (Target_sparc::Relocate:relocate): Likewise.
2955
9109c078
ILT
29562010-02-06 Ian Lance Taylor <iant@google.com>
2957
2958 * configure.ac: Rewrite targetobjs duplicate removal code to use
2959 only shell constructs.
2960 * configure: Rebuild.
2961
cf846138
DK
29622010-02-05 Doug Kwan <dougkwan@google.com>
2963
2964 PR 11247
2965 * arm.cc (Arm_relobj::section_is_scannable): New method.
2966 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
2967 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
2968
6cfaf60b
DK
29692010-02-04 Doug Kwan <dougkwan@google.com>
2970
2971 PR 11247
2972 * arm-reloc-property.cc (cstdio): Include.
2973 * configure.ac (targetobjs): Remove duplicates.
2974 * configure: Regenerate.
2975 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
2976 big and little endian version for a given address size.
2977
5c57f1be
DK
29782010-02-03 Doug Kwan <dougkwan@google.com>
2979
2980 * arm-reloc-property.cc
2981 (Arm_reloc_property_table::reloc_name_in_error_message): New method
2982 definition.
2983 * arm-reloc-property.h
2984 (Arm_reloc_property_table::get_implemented_static_reloc_property):
2985 New method definition.
2986 (Arm_reloc_property_table::reloc_name_in_error_message): New method
2987 declaration.
2988 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
2989 overflow to N.
2990 (GOT_PREL): Change implemented to Y.
2991 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
2992 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
2993 (Arm_relocate_functions::movw_abs_nc): Remove method.
2994 (Arm_relocate_functions::movt_abs): Ditto.
2995 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
2996 (Arm_relocate_functions::thm_movt_abs): Ditto.
2997 (Arm_relocate_functions::movw_rel_nc): Ditto.
2998 (Arm_relocate_functions::movw_rel): Ditto.
2999 (Arm_relocate_functions::movt_rel): Ditto.
3000 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
3001 (Arm_relocate_functions:thm_movw_rel): Ditto.
3002 (Arm_relocate_functions:thm_movt_rel): Ditto.
3003 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
3004 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
3005 New method definitions.
3006 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
3007 (Arm_relocation_functions::arm_grp_ldr): Ditto.
3008 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
3009 (Arm_relocation_functions::arm_grp_ldc): Ditto.
3010 (Target_arm::Relocate::relocate): Check for non-static or
3011 unimplemented relocation code and exit early. Change calls to
3012 Target_arm::reloc_uses_thumb_bit and
3013 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
3014 instead. Refactor code to handle similar relocations to increase
3015 code sharing. Remove check for unsupported relocation code in switch
3016 statement.
3017 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
3018 relocation property table to find out size. Change error message to
3019 print out the name of a relocation code instead of the numeric value.
3020 (Target_arm::scan_reloc_for_stub): Use relocation property table
3021 instead of calling Target_arm::reloc_uses_thumb_bit().
3022
218c5831
DK
30232010-02-02 Doug Kwan <dougkwan@google.com>
3024
3025 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
3026 types of relaxed input section.
3027
0d31c79d
DK
30282010-02-02 Doug Kwan <dougkwan@google.com>
3029
3030 * Makefile.am (HFILES): Add arm-reloc-property.h.
3031 (DEFFILES): New.
3032 (TARGETSOURCES): Add arm-reloc-property.cc
3033 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
3034 (libgold_a_SOURCES): $(DEFFILES)
3035 * Makefile.in: Regenerate.
3036 * arm-reloc-property.cc: New file.
3037 * arm-reloc-property.h: New file.
3038 * arm-reloc.def: New file.
3039 * arm.cc: Update comments.
3040 (arm-reloc-property.h): New included header.
3041 (arm_reloc_property_table): New global variable.
3042 (Target_arm::do_select_as_default_target): New method definition.
3043 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
3044 arm-reloc-property to targ_extra_obj.
3045 * parameters.cc (set_parameters_target): Call
3046 Target::select_as_default_target().
3047 * target.h (Target::select_as_default_target): New method definition.
3048 (Target::do_select_as_default_target): Same.
3049
546c7457
DK
30502010-02-01 Doug Kwan <dougkwan@google.com>
3051
3052 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
3053 first_output_text_section_.
3054 (Arm_exidx_fixup::first_output_text_section): New method definition.
3055 (Arm_exidx_fixup::first_output_text_section_): New data member.
3056 (Arm_exidx_fixup::process_exidx_section): Record the first text
3057 output section seen.
3058 (Arm_output_section::fix_exidx_coverage): Set correct linked section
3059 and entsize in output section header.
3060
11b861d5
DK
30612010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3062
3063 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
3064 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
3065 (Arm_relocate_functions::thm_alu11): New Method.
3066 (Arm_relocate_functions::thm_pc8): New Method.
3067 (Arm_relocate_functions::thm_pc12): New Method.
3068 (Target_arm::Scan::local): Handle the relocations.
3069 (Target_arm::Scan::global): Likewise.
3070 (Target_arm::Relocate::relocate): Likewise.
3071 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
3072
c9a2c125
DK
30732010-01-29 Doug Kwan <dougkwan@google.com>
3074
3075 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
3076 of relocation types as ld.
3077
1521477a
DK
30782010-01-29 Doug Kwan <dougkwan@google.com>
3079
3080 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
3081 to public.
3082 (Arm_relocate_functions::thumb_branch_common): Ditto.
3083 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
3084 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
3085 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
3086 Arm_relocate_functions::jump24): Remove.
3087 (Target_arm::Relocate::relocate): Adjust code to call
3088 Arm_relocation_functions::arm_branch_common and
3089 Arm_relocation_functions::thumb_branch_common instead of their removed
e1df38aa 3090 wrappers. Merge switch-cases together to reduce source code size.
1521477a 3091
e7eca48c
DK
30922010-01-29 Doug Kwan <dougkwan@google.com>
3093
3094 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
3095 output_local_symbol_count_needs_update_.
3096 (Arm_relobj::output_local_symbol_count_needs_update,
3097 Arm_relobj::set_output_local_symbol_count_needs_update,
3098 Arm_relobj::update_output_local_symbol_count): New methods.
3099 (Arm_relobj::output_local_symbol_count_needs_update_): New data
3100 member.
3101 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
3102 of pointed function as in a R_ARM_PREL31 relocation.
3103 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
3104 for output local symbol count updating.
3105 (Target_arm::do_relax): Update output local symbol counts in objects
3106 if necessary.
3107 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
3108
02961d7e
ILT
31092010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3110
3111 * arm.cc: Added support for the ARM relocations:
3112 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
3113 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
3114 (Arm_relocate_functions::movw_rel_nc): Renamed (was
3115 movw_prel_nc).
3116 (Arm_relocate_functions::movw_rel): New method.
3117 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
3118 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
3119 thm_movw_prel_nc).
3120 (Arm_relocate_functions::thm_movw_rel): New method.
3121 (Arm_relocate_functions::thm_movt_rel): Renamed (was
3122 thm_movt_prel).
3123 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
3124 relocations.
3125 (Target_arm::Scan::global): Likewise.
3126 (Target_arm::Relocate::relocate): Likewise.
3127 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3128 Likewise.
3129
b10d2873
ILT
31302010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3131
3132 * arm.cc: Added support for ARM group relocations.
3133 (Target_arm::reloc_needs_sym_origin): New method.
3134 (Arm_relocate_functions::calc_grp_kn): New method.
3135 (Arm_relocate_functions::calc_grp_residual): New method.
3136 (Arm_relocate_functions::calc_grp_gn): New method.
3137 (Arm_relocate_functions::arm_grp_alu): New Method.
3138 (Arm_relocate_functions::arm_grp_ldr): New Method.
3139 (Arm_relocate_functions::arm_grp_ldrs): New Method.
3140 (Arm_relocate_functions::arm_grp_ldc): New Method.
3141 (Target_arm::Scan::local): Handle the ARM group relocations.
3142 (Target_arm::Scan::global): Likewise.
3143 (Target_arm::Relocate::relocate): Likewise.
3144 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3145 Likewise.
3146
2b328d4e
DK
31472010-01-26 Doug Kwan <dougkwan@google.com>
3148
3149 * arm.cc (set): Include.
3150 (class Arm_exidx_fixup): Change type of last_input_section_ to const
3151 pointer type.
3152 (Arm_output_section::Text_section_list): New type.
3153 (Arm_output_section::append_text_sections_to_list): New method.
3154 (Arm_output_section::fix_exidx_coverage): Ditto.
3155 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
3156 (Arm_relobj::convert_input_section_to_relaxed_section): Use
3157 Relobj::set_section_offset() instead of
3158 Sized_relobj::invalidate_section_offset().
3159 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
3160 parameter for section headers. Ignore relocation sections for
3161 unallocated sections and EXIDX sections.
3162 (Target_arm::fix_exidx_coverage): New method.
3163 (Target_arm::output_section_address_less_than): New type.
3164 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
3165 linked text section instead of the EXIDX section.
3166 (Arm_output_section::create_stub_group): Add an assertion to check
3167 that this is not an EXIDX output section.
3168 (Arm_output_section::append_text_sections_to_list): New method.
3169 (Arm_output_section::fix_exidx_coverage): Ditto.
3170 (Arm_relobj::scan_sections_for_stubs): Adjust call to
3171 Arm_relobj::section_needs_reloc_stub_scanning.
3172 (Target_arm::do_relax): Fix EXIDX output section coverage in the
3173 first pass.
3174 (Target_arm::fix_exidx_coverage): New method.
3175 * object.h (Relobj::set_output_section): New method.
3176 (Sized_relobj::invalidate_section_offset): Remove method.
3177 (Sized_relobj::do_invalidate_section_offset): Remove method.
3178 (Sized_relobj::do_set_section_offset): Handle offset value -1.
3179
c7f3c371
DK
31802010-01-25 Doug Kwan <dougkwan@google.com>
3181
3182 * arm.cc (Arm_exidx_merged_section::do_output_offset):
3183 Fix warning due to signed and unsigned comparison on a 32-bit host.
3184
8923b24c
DK
31852010-01-22 Doug Kwan <dougkwan@google.com>
3186
3187 * arm.cc (Target_arm::do_relax): Record an output section for section
3188 offset adjustment it contains any stub table that has changed.
3189 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
3190 offsets in an output section if necessary.
3191 * output.cc (Output_section::Output_section): Initialize
3192 section_offsets_need_adjustments_.
3193 (Output_section::add_input_section_for_script): Renamed to
3194 Output_section::add_simple_input_section.
3195 (Output_section::save_states): Add a comment.
3196 (Output_section::discard_states): New method defintion.
3197 (Output_section::adjust_section_offsets): Same.
3198 * output.h (Output_section::add_input_section_for_script): Renamed to
3199 Output_section::add_simple_input_section.
3200 (Output_section::discard_states): New method declaration.
3201 (Output_section::adjust_section_offsets): Same.
3202 (Output_section::section_offsets_need_adjustment,
3203 Output_section::set_section_offsets_need_adjustment): New method
3204 definitions.
3205 (Output_section::section_offsets_need_adjustment_): New data member.
3206 * script-sections.cc
3207 (Output_section_element_input::set_section_address): Adjust code for
3208 renaming of Output_section::add_input_section_for_script.
3209 (Orphan_output_section::set_section_address): Same.
3210
9b2fd367
DK
32112010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3212
3213 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
3214 Fix_v4bx enum values .
3215 * gold/options.h (General_options): New option definitions.
3216 (General_options::fix_v4bx): New method.
3217 (General_options::Fix_v4bx): New enum.
3218 * gold/options.cc (General_options::parse_fix_v4bx): New method.
3219 (General_options::parse_fix_v4bx_interworking): New method.
3220
80d0d023
DK
32212010-01-22 Doug Kwan <dougkwan@google.com>
3222
3223 * arm.cc (Arm_exidx_fixup): New class.
3224
af2cdeae
DK
32252010-01-21 Doug Kwan <dougkwan@google.com>
3226
3227 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
3228 classes.
3229 (Arm_exidx_section_offset_map): New type.
3230
993d07c1
DK
32312010-01-21 Doug Kwan <dougkwan@google.com>
3232
3233 * arm.cc (Arm_exidx_input_section): New class.
3234 (Arm_relobj::exidx_input_section_by_link,
3235 Arm_relobj::exidx_input_section_by_shndx,
3236 Arm_relobj::make_exidx_input_section): New methods.
3237 (read_arm_attributes_section): Remove.
3238 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
3239 information about them.
3240 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
3241 to here.
3242
5ac169d4
DK
32432010-01-20 Doug Kwan <dougkwan@google.com>
3244
3245 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
3246 Input_section_specifier to Section_id.
3247 (Target_arm::new_arm_input_section: Adjust code for change of key
3248 type.
3249 (Target_arm::find_arm_input_section): Ditto.
3250 * gc.h (object.h): Include for Section_id nand Section_id_hash.
3251 (Section_id): Remove.
3252 (Garbage_collection::Section_id_hash): Remove.
3253 * icf.h (object.h): Include for Section_id nand Section_id_hash.
3254 (Section_id): Remove.
3255 (Icf::Section_id_hash): Remove.
3256 * object.h (Section_id, Const_section_id, Section_id_hash,
3257 Const_section_id_hash): New type definitions.
3258 * output.cc (Output_section::add_relaxed_input_section): Change to
3259 use Const_section_id instead of Input_section_specifier as key type.
3260 (Output_section::add_merge_input_section): Ditto.
3261 (Output_section::build_relaxation_map): Change to use Section_id
3262 instead of Input_section_specifier as key type.
3263 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3264 Ditto.
3265 (Output_section::convert_input_sections_to_relaxed_sections): Change
3266 to use Const_section_id instead of Input_section_specifier as key type.
3267 (Output_section::find_merge_section): Ditto.
3268 (Output_section::find_relaxed_input_section): Ditto.
3269 * output.h (Input_section_specifier): Remove class.
3270 (Output_section::Output_section_data_by_input_section_map): Change
3271 key type to Const_section_id.
3272 (Output_section::Output_relaxed_input_section_by_input_section_map):
3273 Ditto.
3274 (Output_section::Relaxation_map): Change key type to Section_id.
3275
a2162063
ILT
32762010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3277
3278 * gold/arm.cc: Added support for R_ARM_V4BX relocation
3279 (class Arm_v4bx_stub): New class.
3280 (DEF_STUBS): Updated definition to support v4_veneer_bx.
3281 (Stub_factory::make_arm_v4bx_stub): New method.
3282 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
3283 (Stub_table::empty): Handle v4bx stubs.
3284 (Stub_table::add_arm_v4bx_stub): New method.
3285 (Stub_table::find_arm_v4bx_stub): New method.
3286 (Arm_relocate_functions::v4bx): New method.
3287 (Target_arm::fix_v4bx): New method.
3288 (Target_arm::Target_arm): Handle R_ARM_V4BX.
3289 (Stub_table::relocate_stubs): Likewise.
3290 (Stub_table::do_write): Likewise.
3291 (Stub_table::update_data_size_and_addralign): Likewise.
3292 (Stub_table::finalize_stubs): Likewise.
3293 (Target_arm::Scan::local): Likewise.
3294 (Target_arm::Scan::global): Likewise.
3295 (Target_arm::do_finalize_sections): Likewise.
3296 (Target_arm::Relocate::relocate): Likewise.
3297 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3298 Likewise.
3299 (Target_arm::scan_reloc_for_stub): Likewise.
3300 (Target_arm::scan_reloc_section_for_stubs): Likewise.
3301
5696ab0b
ILT
33022010-01-19 Ian Lance Taylor <iant@google.com>
3303
3304 * output.cc (Output_section_headers::do_sized_write): Write large
3305 segment count to sh_info field.
3306 (Output_file_header::do_sized_write): For large segment count,
3307 write PN_XNUM to e_phnum field.
3308
800d0f56
ILT
33092010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3310
3311 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
3312 (Arm_relocate_functions::thm_jump8): New function.
3313 (Arm_relocate_functions::thm_jump11): New function.
3314 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
3315 R_ARM_THM_JUMP11.
3316 (Target_arm::Scan::global): Likewise.
3317 (Target_arm::Relocate::relocate): Likewise.
3318 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3319 Likewise.
3320
41263c05
DK
33212010-01-14 Doug Kwan <dougkwan@google.com>
3322
3323 * arm.cc (map, utility): Include headers.
3324 (Target_arm::apply_cortex_a8_workaround): New method.
3325 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
3326 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
3327 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
3328 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
3329 the --[no-]fix-cortex-a8 command line options.
3330 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
3331 (Target_arm::relocate_stub): Use addend in instruction template.
3332 * options.h (DEFINE_bool): Set the user-set flag.
3333 (General_options): Add --[no-]-fix-cortex options.
3334 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
e1df38aa 3335 : Update fast look-up map after conversion.
41263c05 3336
459e9b03
ST
33372010-01-14 Sriraman Tallam <tmsriram@google.com>
3338
3339 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
3340 in the first pass of do_layout.
3341
b521dfe4
DK
33422010-01-13 Doug Kwan <dougkwan@google.com>
3343
3344 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
3345 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
3346 apparent compiler problem of not folding static constant integral
3347 data members of elfcpp::Elf_sizes<32>.
3348
44272192
DK
33492010-01-13 Doug Kwan <dougkwan@google.com>
3350
3351 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
3352 Arm_relobj::section_needs_cortex_a8_stub_scanning,
3353 Arm_relobj::scan_section_for_cortex_a8_erratum,
3354 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
3355 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
3356 sections to scan for relocation stubs into a new method
3357 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
3358 relocation and Cortex-A8 stub scanning.
3359 (Target_arm::do_relax): Force stubs to be after stubbed sections
3360 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
e1df38aa 3361 the beginning of a new relaxation pass. Update a comment.
44272192
DK
3362 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
3363
44b71ece
ILT
33642010-01-12 Ian Lance Taylor <iant@google.com>
3365
3366 * target-reloc.h (visibility_error): New inline function.
3367 (relocate_section): Call visibility_error.
3368 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
3369 (MOSTLYCLEANFILES): Likewise.
3370 (protected_4_pic.o, protected_3.err): New targets.
3371 * testsuite/protected_4.cc: New file.
3372
a120bc7f
DK
33732010-01-12 Doug Kwan <dougkwan@google.com>
3374
3375 * arm.cc (Cortex_a8_reloc): New class.
3376 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
3377 and cortex_a8_relocs_info_.
3378 (Target_arm::fix_cortex_a8): New method definition.
3379 (Target_arm::Cortex_a8_relocs_info): New type.
3380 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
3381 New data member declarations.
3382 (Target_arm::scan_reloc_for_stub): Record information about
3383 relocations for THUMB branches that might be exempted from the
3384 Cortex-A8 workaround.
3385 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
3386 at the beginning of a relaxation pass.
3387
20138696
DK
33882010-01-12 Doug Kwan <dougkwan@google.com>
3389
3390 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
3391 (Arm_relobj::Mapping_symbol_position,
3392 Arm_reloj::Mapping_symbol_position_less,
3393 Arm_relobj::Mapping_symbols_info): New types.
3394 (Target_arm::is_mapping_symbol_name): New method definition.
3395 (Arm_relobj::do_count_local_symbols): Save information about mapping
3396 symbols.
3397
089d69dc
DK
33982010-01-11 Doug Kwan <dougkwan@google.com>
3399
3400 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
3401 Arm_relocate_functions::thumb32_branch_upper,
3402 Arm_relocate_functions::thumb32_branch_lower,
3403 Arm_relocate_functions::thumb32_cond_branch_offset,
3404 Arm_relocate_functions::thumb32_cond_branch_upper,
3405 Arm_relocate_functions::thumb32_cond_branch_lower,
3406 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
3407 branch offset encoding.
3408 (Arm_relocate_functions::thumb_branch_common): Use new branch
3409 offset encoding methods to avoid code duplication.
3410 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
3411 (Stub_addend_reader::operator()): Use new branch encoding method
3412 to avoid code duplication.
3413
99e5bff2
DK
34142010-01-11 Doug Kwan <dougkwan@google.com>
3415
3416 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
3417 (Target_arm::do_finalize_sections): Define special EXIDX section
3418 symbols only if referenced.
3419 * gc.h (Garbage_collection::add_reference): New method.
3420 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
3421 code duplication.
3422
98e090bd
ILT
34232010-01-11 Ian Lance Taylor <iant@google.com>
3424
d0a91bd8
ILT
3425 * script.cc (Version_script_info::build_expression_list_lookup):
3426 Change complaing about duplicate wildcard match from error to
3427 warning.
3428
98e090bd
ILT
3429 * script.cc (class Lazy_demangler): Recreate--revert part of patch
3430 of 2009-12-30.
3431 (Version_script_info::Version_script_info): Initialize globs_,
3432 default_version_, default_is_global_, and exact_. Don't
3433 initialize globals_ or locals_.
3434 (Version_script_info::build_lookup_tables): Build local symbols
3435 first.
3436 (Version_script_info::unquote): New function.
3437 (Version_script_info::add_exact_match): New function.
3438 (Version_script_info::build_expression_list_lookup): Remove lookup
3439 parameter. Add is_global parameter. Change all callers. Handle
3440 wildcard pattern specially. Unquote pattern. Call
3441 add_exact_match.
3442 (Version_script_info::get_name_to_match): New function.
3443 (Version_script_info::get_symbol_version): New function.
3444 (Version_script_info::get_symbol_version_helper): Remove.
3445 (Version_script_info::check_unmatched_names): Call unquote.
3446 * script.h (class Version_script_info): Change get_symbol_version
3447 to be non-inline and add is_global parameter; change all callers.
3448 Rewrite symbol_is_local. Update declarations. Define struct
3449 Version_tree_match, Exact, Globs. Don't define struct Lookup.
3450 Remove globals_ and locals_ members. Add exact_, globs_,
3451 default_version_, is_global_.
3452 (Version_script_info::Glob): Remove pattern, add expression and
3453 is_global. Update constructor. Change all callers.
3454 * dynobj.cc (Versions::finalize): Mark the version symbol as the
3455 default version.
3456 (Versions::symbol_section_contents): If a symbol is undefined, or
3457 defined in a dynamic object, set the version index to
3458 VER_NDX_LOCAL.
3459 * symtab.cc (Symbol_table::add_from_relobj): Don't call
3460 symbol_is_local.
3461 (Symbol_table::add_from_pluginobj): Likewise.
3462 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
3463
d56962d3
DK
34642010-01-11 Doug Kwan <dougkwan@google.com>
3465
3466 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
3467 (incremental_dump_LDADD): Add linking option for libintl.
3468 * Makefile.in: Regenerate.
3469
94e6ee91
L
34702010-01-11 H.J. Lu <hongjiu.lu@intel.com>
3471
3472 PR gold/11144
3473 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
3474 instead of -Ds.
3475 * testsuite/Makefile.in: Regenerated.
3476
e96c574b
DK
34772010-01-10 Doug Kwan <dougkwan@google.com>
3478
3479 * options.h (DEFINE_var): Use parentheses around argument varname__
3480 in macro body to avoid any unintended subsequent substitutions.
3481
7198066b
ILT
34822010-01-10 Ian Lance Taylor <iant@google.com>
3483
ba4d53bf
ILT
3484 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
3485 candidates before doing symbol resolution.
3486
7198066b
ILT
3487 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
3488 ODR candidates if only one is weak.
3489
a2beed37
ILT
34902010-01-08 Ian Lance Taylor <iant@google.com>
3491
3492 * script.cc (Version_script_info::build_expression_list_lookup):
3493 Don't warn about ambiguous version, just record the ambiguity.
3494 (Version_script_info::get_symbol_version_helper): Give error if
3495 version is ambiguous.
3496
2fb7225c
DK
34972010-01-08 Doug Kwan <dougkwan@google.com>
3498
3499 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
3500 prev_data_size_ and prev_addralign_. Remove initializer for
3501 deleted data member has_been_changed_.
3502 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
3503 to determine if the table is empty.
3504 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
3505 Remove.
3506 (Stub_table::add_reloc_stub): Define method in class definition
3507 instead of just declaring it there.
3508 (Stub_table::add_cortex_a8_stub): New method definition.
3509 (Stub_table::update_data_size_and_addralign): Ditto.
3510 (Stub_table::finalize_stubs): Ditto.
3511 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
3512 (Stub_table::do_addralign_): Return address alignment in the
3513 (Stub_table::do_reset_address_and_file_offset): Define method in
3514 class definition instead of declaring it there. Set current data
3515 size to be the data size of the previous pass.
3516 (Stub_table::set_final_data_size): Use current data size as the
3517 final data size.
3518 (Stub_table::relocate_stub): Change parameter type of stub from
3519 Reloc_stub pointer to Stub pointer.
3520 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
3521 (Stub_table::Cortex_a8_stub_list): New typedef.
3522 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
3523 Stub_table::prev_addralign_): New data member.
3524 (Arm_relobj::Arm_relobj): Initialize data member
3525 section_has_cortex_a8_workaround_.
3526 (Arm_relobj::section_has_cortex_a8_workaround,
3527 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
3528 definitions.
3529 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
3530 declarations.
3531 (Target_arm::relocate_stub): Change parameter type of stub from
3532 Reloc_stub pointer to Stub pointer.
3533 (Insn_template::size, Insn_template::alignment): Handle
3534 THUMB16_SPECIAL_TYPE.
3535 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
3536 Stub_table::update_data_size_and_addralign,
3537 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
3538 definitions.
3539 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
3540 (Stub_table::do_write): Ditto.
3541 (Target_arm::do_relax): Adjust code for changes in Stub_table.
3542
880cd20d
ILT
35432010-01-08 Ian Lance Taylor <iant@google.com>
3544
3545 PR 11108
3546 * symtab.h (class Symbol): Remove fields is_target_special_ and
3547 has_plt_offset_. Add field is_defined_in_discarded_section_.
3548 (Symbol::is_defined_in_discarded_section): New function.
3549 (Symbol::set_is_defined_in_discarded_section): New function.
3550 (Symbol::has_plt_offset): Rewrite.
3551 (Symbol::set_plt_offset): Verify that new offset is not -1U.
3552 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
3553 Don't initialize is_target_special_ or has_plt_offset_.
3554 Initialize is_defined_in_discarded_section_.
3555 (Symbol_table::add_from_relobj): If appropriate, set
3556 is_defined_in_discarded_section.
3557 * resolve.cc (Symbol::override_base_with_special): Don't test
3558 is_target_special_. Change has_plt_offset_ to has_plt_offset().
3559 * target-reloc.h (relocate_section): Do special handling for
3560 symbols defined in discarded sections for global symbols as well
3561 as local symbols.
3562
2703e3eb
ILT
35632010-01-08 Ian Lance Taylor <iant@google.com>
3564
3565 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
3566 the SHT_SYMTAB case.
3567
339d40a3
ILT
35682010-01-08 Ian Lance Taylor <iant@google.com>
3569
3570 * object.cc (Sized_relobj::do_layout): Don't get confused if
3571 layout_eh_frame returns NULL.
3572
abecea76
ILT
35732010-01-08 Ian Lance Taylor <iant@google.com>
3574
3575 PR 11084
3576 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
3577 dynamic symbol table, use the normal symbol table.
3578 (Sized_dynobj::do_read_symbols): Remove assertion about type of
3579 symbol table.
3580
6b7dd3f3
ILT
35812010-01-08 Ian Lance Taylor <iant@google.com>
3582
3583 PR 11072
3584 * layout.cc (Layout::include_section): Remove .gnu_debuglink
3585 sections.
3586
36c50e63
L
35872010-01-08 H.J. Lu <hongjiu.lu@intel.com>
3588
3589 * version.cc (print_version): Change to "Copyright 2010".
3590
e291e7b9
ILT
35912010-01-08 Ian Lance Taylor <iant@google.com>
3592
3593 PR 10287
3594 PR 11063
3595 * i386.cc (class Target_i386): Change return type of plt_section
3596 to be non-const.
3597 (class Output_data_plt_i386): Add tls_desc_rel_ field.
3598 (Output_data_plt_i386::Output_data_plt_i386): Initialize
3599 tls_desc_rel_ field.
3600 (Output_data_plt_i386::rel_tls_desc): New function.
3601 (Target_i386::rel_tls_desc_section): New function.
3602 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
3603 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
3604 R_386_TLS_DESC reloc in rel_tls_desc_section.
3605 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
3606 Define struct Tlsdesc_info.
3607 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
3608 (Target_x86_64::do_reloc_symbol_index): New function.
3609 (Target_x86_64::add_tlsdesc_info): New function.
3610 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
3611 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
3612 tlsdesc_rel_ field.
3613 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
3614 all callers.
3615 (Output_data_plt_x86_64::rela_tlsdesc): New function.
3616 (Target_x86_64::rela_tlsdesc_section): New function.
3617 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
3618 handling.
3619 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
3620 (Target_x86_64::do_reloc_addend): New function.
3621 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
3622 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
3623 declarations. Define TARGET_CODE. Add arg field to u1_ union.
3624 (Output_reloc::type): New function.
3625 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
3626 (Output_reloc::is_target_specific): New function.
3627 (Output_reloc::target_arg): New function.
3628 (class Output_reloc) [SHT_RELA]: Add four new constructors for
3629 absolute relocs and target specific relocs.
3630 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
3631 add_target_specific.
3632 (class Output_data_reloc) [SHT_RELA]: Likewise.
3633 * output.cc (Output_reloc::Output_reloc): Add four new versions
3634 for absolute relocs and target specific relocs.
3635 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
3636 (Output_reloc::get_symbol_index): Likewise.
3637 (Output_reloc::local_section_offset): Check that local_sym_index_
3638 is not TARGET_CODE or 0.
3639 (Output_reloc::symbol_value): Likewise.
3640 (Output_reloc::write) [SHT_RELA]: Call target for target specific
3641 reloc.
3642 * target.h (class Target): Add reloc_symbol_index and reloc_addend
3643 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
3644 functions.
3645 * layout.cc (add_target_dynamic_tags): Use output section for
3646 DT_PLTRELSZ and DT_JMPREL.
3647
3a44184e
ILT
36482010-01-07 Ian Lance Taylor <iant@google.com>
3649
3650 PR 11061
3651 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
3652 function.
3653 (class Output_data_reloc_generic): Define.
3654 (class Output_data_reloc_base): Change base class to
3655 Output_data_reloc_generic. Change add() method to call
3656 bump_relative_reloc_count for a relative reloc. Remove
3657 sort_relocs_ field.
3658 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
3659 to sort_relocs().
3660 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
3661 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
3662 appropriate.
3663 * layout.h (class Layout): Update declaration.
3664
ea715a34
ILT
36652010-01-07 Ian Lance Taylor <iant@google.com>
3666
3667 * output.h (class Output_data): Add const version of
3668 output_section and do_output_section.
3669 (class Output_section_data): Add const version of
3670 do_output_section.
3671 (class Output_section): Likewise.
3672 * layout.cc (Layout::add_target_dynamic_tags): New function.
3673 * layout.h (class Layout): Update declarations.
3674 * arm.cc (Target_arm::do_finalize_sections): Use
3675 add_target_dynamic_tags.
3676 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3677 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
3678 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
3679 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3680
659948a4
ILT
36812010-01-07 Ian Lance Taylor <iant@google.com>
3682
3683 PR 11042
3684 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
3685 object as needed.
3686
9d3b86f6
ILT
36872010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
3688 Ian Lance Taylor <iant@google.com>
3689
3690 PR 11019
3691 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
3692 Xindex::read_symtab_xindex.
3693
bb0d3eb0
DK
36942010-01-07 Doug Kwan <dougkwan@google.com>
3695
3696 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
3697 (Insn_template::thumb16_bcond_insn): New method declaration.
3698 (Insn_template): Fix spelling.
3699 (Stub::thumb16_special): New method declaration.
3700 (Stub::do_write): Define virtual method which was previously pure
3701 virtual.
3702 (Stub::do_thumb16_special): New method declaration.
3703 (Stub::do_fixed_endian_write): New template member.
3704 (Reloc_stub::do_write): Remove.
3705 (Reloc_stub::do_fixed_endian_write): Remove.
3706 (Cortex_a8_stub): New class definition.
3707 (Stub_factory::make_cortex_a8_stub): New method definition.
3708 (Stub_factory::Stub_factory): Add missing static storage class
3709 qualifier for elf32_arm_stub_a8_veneer_blx.
3710
ffeef7df
ILT
37112010-01-07 Ian Lance Taylor <iant@google.com>
3712
dc3f80fe
ILT
3713 PR 10980
3714 * options.h (class General_options): Add --warn-unresolved-symbols
3715 and --error-unresolved-symbols.
3716 * errors.cc (Errors::undefined_symbol): Implement
3717 --warn-unresolved-symbols.
3718
ffeef7df
ILT
3719 * options.h (class General_options): Add -z text and -z textoff.
3720 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
3721
f1ec9ded
ST
37222010-01-06 Sriraman Tallam <tmsriram@google.com>
3723
3724 * gc.h (Garbage_collection::Cident_section_map): New typedef.
3725 (Garbage_collection::cident_sections): New function.
3726 (Garbage_collection::add_cident_section): New function.
3727 (Garbage_collection::cident_sections_): New member.
3728 (gc_process_relocs): Add references to sections whose names are C
3729 identifiers.
3730 * gold.h (cident_section_start_prefix): New constant.
3731 (cident_section_stop_prefix): New constant.
3732 (is_cident): New function.
3733 * layout.cc (Layout::define_section_symbols): Replace string constants
3734 with the newly defined constants.
3735 * object.cc (Sized_relobj::do_layout): Track sections whose names are
3736 C identifiers.
3737 * testsuite/Makefile.am: Add gc_orphan_section_test.
3738 * testsuite/Makefile.in: Regenerate.
3739 * testsuite/gc_orphan_section_test.cc: New file.
3740 * testsuite/gc_orphan_section_test.sh: New file.
3741
6eda8c29
ILT
37422010-01-06 Ian Lance Taylor <iant@google.com>
3743
b9674e17
ILT
3744 PR 10980
3745 * options.h (class General_options): Add --warn-shared-textrel.
3746 * layout.cc (Layout::finish_dynamic_section): Implement
3747 --warn-shared-textrel.
3748
6eda8c29
ILT
3749 PR 10980
3750 * options.h (class General_options): Add --warn-multiple-gp.
3751
32dcd44e
ILT
37522010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3753
3754 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
3755 $(THREADSLIB) and $(LIBDL).
3756 * Makefile.in: Rebuild.
3757
a192ba05
ILT
37582010-01-06 Ian Lance Taylor <iant@google.com>
3759
3760 PR 10980
3761 * options.cc (General_options::parse_section_start): New function.
3762 (General_options::section_start): New function.
3763 (General_options::General_options): Initialize all members.
3764 * options.h: Include <map>
3765 (class General_options): Add --section-start. Add section_starts_
3766 member.
3767 * layout.cc (Layout::attach_allocated_section_to_segment): If
3768 --section-start was used, set the address of the segment. Remove
3769 local sort_sections.
3770 (Layout::relaxation_loop_body): If the address of the load segment
3771 has been set by --section-start, don't use it.
3772 * output.h (Output_segment::update_flags_for_output_section): New
3773 function.
3774 * output.cc (Output_segment::add_output_section): Call
3775 update_flags_for_output_section.
3776
dde3f402
ILT
37772010-01-05 Ian Lance Taylor <iant@google.com>
3778
62dfdd4d
ILT
3779 PR 10980
3780 * options.h (class General_options): Add --undefined-version.
3781 * script.cc (struct Version_expression): Add was_matched_by_symbol
3782 field.
3783 (Version_script_info::matched_symbol): New function.
3784 (Version_script_info::get_symbol_version_helper): Call
3785 matched_symbol.
3786 (Version_script_info::check_unmatched_names): New function.
3787 * script.h (class Version_script_info): Update declarations.
3788 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
3789
9c4ae156
ILT
3790 * options.h (class General_options): Use DEFINE_bool_alias for
3791 allow_multiple_definition.
3792 * resolve.cc (Symbol_table::should_override): Don't test
3793 allow_multiple_definition.
3794
dde3f402
ILT
3795 PR 10980
3796 * options.h (class General_options): Add --cref.
3797 * main.cc (main): Print cref table if --cref. Don't close mapfile
3798 until after printing cref table.
3799 * cref.cc: Include "symtab.h".
3800 (class Cref_inputs): Define Cref_table_compare and Cref_table.
3801 (Cref_table_compare::operator()): New function.
3802 (Cref_inputs::gather_cref): New function.
3803 (filecol): New static const.
3804 (Cref_inputs::print_cref): New function.
3805 (Cref::print_cref): New function.
3806 * cref.h: Include <cstdio>.
3807 (class Cref): Update declarations.
3808 * mapfile.h (Mapfile::file): New function.
3809 * object.h (class Object): Define Symbols. Declare virtual
3810 do_get_global_symbols.
3811 (Object::get_global_symbols): New function.
3812 * object.cc (Input_objects::add_object): Pass object to cref_ if
3813 --cref.
3814 (Input_objects::archive_start): Likewise.
3815 (Input_objects::archive_stop): Likewise.
3816 (Input_objects::print_cref): New function.
3817 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
3818 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
3819 --cref.
3820 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
3821 function.
3822 * plugin.h (class Sized_pluginobj): Update declarations.
3823
8781f709
ILT
38242010-01-05 Ian Lance Taylor <iant@google.com>
3825
3826 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
3827 to is_default_version. Rename insdef to insdefault.
3828 (Symbol_table::add_from_relobj): Rename def to is_default_version
3829 and local to is_forced_local.
3830 (Symbol_table::add_from_pluginobj): Likewise.
3831 (Symbol_table::add_from_dynobj): Likewise.
3832 (Symbol_table::define_special_symbol): Rename insdef to
3833 insdefault.
3834
fe35d28d
ILT
38352010-01-04 Ian Lance Taylor <iant@google.com>
3836
30bc8c46
ILT
3837 PR 10980
3838 * options.h (class General_options): Add
3839 --allow-multiple-definition and -z muldefs.
3840 * resolve.cc (Symbol_table::should_override): Don't warn about a
3841 multiple symbol definition if --allow-multiple-definition or -z
3842 muldefs.
3843
7eaea549
ILT
3844 PR 10980
3845 * options.h (class General_options): Add --add-needed and
3846 --copy-dt-needed-entries. Tweak --as-needed help entry.
3847 * object.cc (Input_objects::check_dynamic_dependencies): Give an
3848 error if --copy-dt-needed-entries aka --add-needed is used and
3849 would cause a change in behaviour.
3850
fe35d28d
ILT
3851 PR 10980
3852 * options.h (class General_options): Add -G as a short version of
3853 --shared. Add no-op options -assert, -g, and -i.
3854
55a2bb35
ST
38552010-01-04 Sriraman Tallam <tmsriram@google.com>
3856
3857 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
3858 check for .text or .gnu.linkonce.t sections.
3859 * icf.cc (Icf::find_identical_sections): Ditto.
3860 Change the detection for mangled function name within the section
3861 name.
3862 * icf.h (is_section_foldable_candidate): New function.
3863
719328e1
ILT
38642009-12-30 Ian Lance Taylor <iant@google.com>
3865
3866 PR 10980
3867 * options.h (class General_options): Permit two dashes with
3868 --retain-symbols-file.
3869
d7bb5745
ILT
38702009-12-30 Ian Lance Taylor <iant@google.com>
3871
403a15dd
ILT
3872 PR 10979
3873 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
3874 don't put the file header and segment headers in the text
3875 segment.
3876
eda294df
ILT
3877 PR 10979
3878 * common.cc (Sort_commons::operator()): Stabilize sort when both
3879 entries are NULL.
3880 (Symbol_table::do_allocate_commons_list): When allocating common
3881 symbols, skip a symbol which is no longer common.
3882 * symtab.h (Symbol::is_common): Test whether the symbol comes from
3883 an object before checking its type.
3884 * testsuite/common_test_2.c: New file.
3885 * testsuite/common_test_3.c: New file.
3886 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
3887 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
3888 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
3889 (common_test_2_pic.o, common_test_2.so): New targets.
3890 (common_test_3_pic.o, common_test_3.so): New targets.
3891 * testsuite/Makefile.in: Rebuild.
3892
d7bb5745
ILT
3893 PR 10979
3894 * script.cc (read_input_script): If we see a new SECTIONS clause,
3895 and we have added an input section, give an error.
3896 * layout.h (class Layout): Add have_added_input_section function.
3897 Add have_added_input_section_ field.
3898 * layout.cc (Layout::Layout): Initialize
3899 have_added_input_section_.
3900 (Layout::layout): Set have_added_input_section_.
3901 (Layout::layout_eh_frame): Likewise.
3902
fc59c572
ILT
39032009-12-30 Ian Lance Taylor <iant@google.com>
3904
3905 PR 10931
3906 * options.h (class General_options): Add --sort-common option.
3907 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
3908 * common.cc (Sort_common): Add sort_order parameter to
3909 constructor. Add sort_order_ field.
3910 (Sort_commons::operator): Check sort_order_.
3911 (Symbol_table::allocate_commons): Determine the sort order.
3912 (Symbol_table::do_allocate_commons): Add sort_order parameter.
3913 Change all callers.
3914 (Symbol_table::do_allocate_commons_list): Likewise.
3915
1c74fab0
ILT
39162009-12-30 Ian Lance Taylor <iant@google.com>
3917
3918 PR 10916
3919 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
3920 symbols from this object, don't change the visibility of an
3921 undefined symbol.
3922 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
3923
6affe781
ILT
39242009-12-30 Ian Lance Taylor <iant@google.com>
3925
3926 PR 10861
3927 * script.h (class Version_script_info): Define Language enum.
3928 Update declarations. Define Glob, Exact, and Lookup types. Add
3929 new fields globals_, locals_, and is_finalized_.
3930 * script.cc: Various formatting fixes.
3931 (class Parser_closure): Change language_stack_ from a vector of
3932 std::string to one of Version_script_info::Language. Adjust all
3933 uses accordingly.
3934 (class Lazy_demangler): Remove.
3935 (struct Version_expression): Change language from std::string to
3936 Version_script_info::Language.
3937 (Version_script_info::Version_script_info): New function.
3938 (Version_script_info::~Version_script_info): Don't call clear.
3939 (Version_script_info::finalize): New function.
3940 (Version_script_info::build_lookup_tables): New function.
3941 (Version_script_info::build_expression_list_lookup): New
3942 function.
3943 (Version_script_info::get_symbol_version_helper): Rewrite to use
3944 lookup tables.
3945 (Version_script_info::print_expression_list): Adjust to use
3946 Version_script_info::Language.
3947 (script_push_lex_into_version_mode): Check that the version script
3948 has not been finalized.
3949 (version_script_push_lang): Change language string to
3950 Version_script_info::Language.
3951 * options.cc (Command_line::version_script): New function.
3952 * options.h (class General_options): Add finalize_dynamic_list
3953 function. Change version_script from declaration to definition.
3954 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
3955 * testsuite/version_script.map: Remove duplicate def of foo.
3956 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
3957 version_script.map.
3958 * testsuite/Makefile.in: Rebuild.
3959
818bf354
ILT
39602009-12-30 Ian Lance Taylor <iant@google.com>
3961
3962 PR 10843
3963 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
3964 if the input symbol index is 0, make the output symbol index 0.
3965
ebcc8304
ILT
39662009-12-30 Ian Lance Taylor <iant@google.com>
3967
3968 PR 10670
3969 * options.h (class General_options): Add -x/--discard-all.
3970 * object.cc (Sized_relobj::do_count_local_symbols): Handle
3971 --discard-all. If the local symbol needs a dynamic entry, check
3972 that before handling --discard-locals.
3973
176fe33f
ILT
39742009-12-30 Ian Lance Taylor <iant@google.com>
3975
bb321bb1
ILT
3976 PR 10450
3977 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
3978 flags to PF_R.
3979 (Output_segment::add_output_section): Don't change the flags if
3980 the type is PT_TLS.
3981
176fe33f
ILT
3982 PR 10450
3983 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
3984 GNU hash table if they need a dynamic value. Otherwise, don't add
3985 them if they are defined in a dynamic object or are forced local.
3986
e8cd95c7
ILT
39872009-12-29 Ian Lance Taylor <iant@google.com>
3988
1b81fb71
ILT
3989 PR 10450
3990 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
3991 .gnu.hash table for a 32-bit target.
3992
8d6d383d
ILT
3993 PR 10450
3994 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
3995 regular and a dynamic object only needs a dynamic symbol table
3996 entry if it is externally visible.
3997
e785ec03
ILT
3998 PR 10450
3999 * i386.cc (class Target_i386): Initialize global_offset_table_ in
4000 constructor. Add global_offset_table_ field.
4001 (Target_i386::got_section): Set global_offset_table_.
4002 (Target_i386::do_finalize_sections): Set global_offset_table_
4003 size.
4004 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
4005 in constructor. Add global_offset_table_ field.
4006 (Target_x86_64::got_section): Set global_offset_table_.
4007 (Target_x86_64::do_finalize_sections): Set global_offset_table_
4008 size.
4009
1a2dff53
ILT
4010 * layout.cc (Layout::Layout): Initialize increase_relro_.
4011 (Layout::get_output_section): Add is_relro, is_last_relro, and
4012 is_first_non_relro parameters. Change all callers.
4013 (Layout::choose_output_section): Likewise.
4014 (Layout::add_output_section_data): Likewise.
4015 (Layout::make_output_section): Likewise.
4016 (Layout::set_segment_offsets): Clear increase_relro when using a
4017 linker script.
4018 * layout.h (class Layout): Add increase_relro method. Add
4019 increase_relro_ field. Update declarations.
4020 * output.cc (Output_section::Output_section): Initialize
4021 is_last_relro_ and is_first_non_relro_.
4022 (Output_segment::add_output_section): Group relro sections is
4023 do_sort is true. Handle is_last_relro and is_first_non_relro.
4024 (Output_segment::maximum_alignment): Remove relro handling.
4025 (Output_segment::set_section_addresses): Add increase_relro
4026 parameter. Change all callers. Add initial alignment to align
4027 relro sections on separate page. Remove old relro handling.
4028 (Output_segment::set_section_list_addresses): Remove in_relro
4029 parameter. Change all callers.
4030 (Output_segment::set_offset): Add increase parameter. Change all
4031 callers. Remove old relro handling.
4032 * output.h (class Output_section): Add new methods: is_last_relro,
4033 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
4034 Add is_last_relro_ and is_first_non_relro_ fields.
4035 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
4036 Create separate .got.plt section. Call increase_relro.
4037 * x86_64.cc (Target_x86_64::got_section): Likewise.
4038 * testsuite/relro_script_test.t: Add .got.plt.
4039
f0ba79e2
ILT
4040 PR 10450
4041 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
4042 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
4043 (Layout::finalize): Call set_dynamic_symbol_size.
4044 (Layout::set_dynamic_symbol_size): New function.
4045 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
4046 set_dynamic_symbol_size.
4047
e8cd95c7
ILT
4048 PR 10450
4049 * output.h (class Output_section): Add is_entsize_zero_ field.
4050 * output.cc (Output_section::Output_section): Initialize
4051 is_entsize_zero_.
4052 (Output_section::set_entsize): If two different entsizes are
4053 requested, force it to zero.
4054 (Output_section::add_input_section): Set flags for .debug_str
4055 before updating section flags. Set entsize.
4056 (Output_section::update_flags_for_input_section): Set SHF_MERGE
4057 and SHF_STRING if all input sections have those flags.
4058
3e1b9a8a
RÁE
40592009-12-29 Rafael Espindola <espindola@google.com>
4060
4061 * main.cc (main): Fix the sys time reporting.
e8cd95c7
ILT
4062 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
4063 reporting.
3e1b9a8a 4064
3dcad376
ST
40652009-12-29 Sriraman Tallam <tmsriram@google.com>
4066
4067 * options.cc (General_options::parse_version): Allow -v to exit
4068 without an error if there is nothing to link.
4069
084e2665
ILT
40702009-12-29 Ian Lance Taylor <iant@google.com>
4071
4072 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
4073 using a version of gcc before 4.1.
4074 * configure: Rebuild.
4075
250acde3
CD
40762009-12-28 Chris Demetriou <cgd@google.com>
4077
4078 * attributes.cc (Output_attributes_section_data::do_write): Use
4079 std::vector::front rather than std::vector::data.
4080
99fff23b
ILT
40812009-12-28 Ian Lance Taylor <iant@google.com>
4082
4083 * symtab.h (class Symbol_table): Add enum Defined.
4084 * resolve.cc (Symbol_table::should_override): Add defined
4085 parameter. Change all callers. Test whether object is NULL
4086 before calling a method on it.
4087 (Symbol_table::report_resolve_problem): Add defined parameter.
4088 Change all callers.
4089 (Symbol_table::should_override_with_special): Likewise.
4090 * symtab.cc (Symbol_table::define_in_output_data): Add defined
4091 parameter. Change all callers.
4092 (Symbol_table::do_define_in_output_data): Likewise.
4093 (Symbol_table::define_in_output_segment): Likewise.
4094 (Symbol_table::do_define_in_output_segment): Likewise.
4095 (Symbol_table::define_as_constant): Likewise.
4096 (Symbol_table::do_define_as_constant): Likewise.
4097 * script.h (class Symbol_assignment): Add is_defsym parameter to
4098 constructor; change all callers.
4099 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
4100 parameter. Change all callers. Add is_defsym_ field.
4101 (class Parser_closure): Add parsing_defsym parameter to
4102 constructor; change all callers. Add parsing_defsym accessor
4103 function. Add parsing_defsym_ field.
4104
556bd683
ILT
41052009-12-28 Ian Lance Taylor <iant@google.com>
4106
4107 * gold.cc (queue_middle_tasks): Fix formatting.
fa618ee4 4108 * object.cc (Relobj::is_section_name_included): Likewise.
556bd683 4109
1782c879
ILT
41102009-12-23 Ian Lance Taylor <iant@google.com>
4111
4112 * i386.cc (Target_i386::do_calls_non_split): Recognize
4113 -fsplit-stack prologue for a function with a static chain.
cbc999b9
ILT
4114 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
4115 -fsplit-stack prologue when using %r11.
1782c879 4116
329ca2b1
ST
41172009-12-21 Sriraman Tallam <tmsriram@google.com>
4118
4119 * options.cc (General_options::parse_version): Make -v continue and do
4120 the link like GNU ld does.
4121
d675ff46
RÁE
41222009-12-17 Rafael Avila de Espindola <espindola@google.com>
4123
4124 * Makefile.am (CCFILES): Add timer.cc.
4125 (HFILES): Add timer.h.
4126 * configure.ac: Check for sysconf and times.
4127 * main.cc: include timer.h.
4128 (main): Use Timer instead of get_run_time.
4129 * timer.cc: New.
4130 * timer.h: New.
4131 * workqueue.cc: include timer.h.
4132 (Workqueue::find_and_run_task):
4133 Report user, sys and wall time.
4134 * Makefile.in: Regenerate.
4135 * config.in: Regenerate.
4136 * configure: Regenerate.
4137
d6344fb5
DK
41382009-12-16 Doug Kwan <dougkwan@google.com>
4139
4140 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
4141 sections.
4142 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
4143 relaxed input sections.
4144 * output.cc (Output_section::find_relaxed_input_section): Change
4145 return type to Output_relaxed_input_section pointer. Adjust code
4146 for new type of relaxed_input_section_map_.
4147 * output.h (Output_section::find_relaxed_input_section): Change
4148 return type to Output_relaxed_input_section pointer.
4149 (Output_section::Output_relaxed_input_section_by_input_section_map):
4150 New type.
4151 (Output_section::relaxed_input_section_map_): Change type to
4152 Output_section::Output_relaxed_input_section_by_input_section_map.
4153 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
4154 input section.
4155
0e0d5469
ILT
41562009-12-15 Ian Lance Taylor <iant@google.com>
4157
4158 * layout.cc (Layout::create_shstrtab): Only write out after input
4159 sections if we are compressing debug sections.
4160
0649a889
ILT
41612009-12-15 Ian Lance Taylor <iant@google.com>
4162
4163 * archive.cc (Archive::add_symbols): Only look up a symbol without
4164 a version if there is, in fact, a version.
4165
2ea97941
ILT
41662009-12-14 Ian Lance Taylor <iant@google.com>
4167
4168 Revert -Wshadow changes, all changes from:
4169 2009-12-11 Doug Kwan <dougkwan@google.com>
4170 2009-12-11 Nick Clifton <nickc@redhat.com>
4171 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
4172
b0eec2cc
DK
41732009-12-11 Doug Kwan <dougkwan@google.com>
4174
4175 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
4176 due to -Wshadow.
4177 * attributes.cc (Object_attribute::size): Ditto.
4178 (Attributes_section_data::size): Ditto.
4179 (Attributes_section_data::Attributes_section_data): Ditto.
4180 (Output_attributes_section_data::do_write): Ditto.
4181 * attributes.h (Object_attribute::set_type): Ditto.
4182 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
4183
91d6fa6a
NC
41842009-12-11 Nick Clifton <nickc@redhat.com>
4185
4186 * archive.cc: Fix shadowed variable warnings.
4187 * arm.cc: Likewise.
4188 * compressed_output.cc: Likewise.
4189 * compressed_output.h: Likewise.
4190 * configure: Likewise.
4191 * dwarf_reader.cc: Likewise.
4192 * dynobj.cc: Likewise.
4193 * dynobj.h: Likewise.
4194 * ehframe.cc: Likewise.
4195 * ehframe.h: Likewise.
4196 * errors.cc: Likewise.
4197 * expression.cc: Likewise.
4198 * fileread.cc: Likewise.
4199 * fileread.h: Likewise.
4200 * freebsd.h: Likewise.
4201 * i386.cc: Likewise.
4202 * icf.cc: Likewise.
4203 * incremental.h: Likewise.
4204 * layout.cc: Likewise.
4205 * layout.h: Likewise.
4206 * mapfile.cc: Likewise.
4207 * merge.cc: Likewise.
4208 * merge.h: Likewise.
4209 * object.cc: Likewise.
4210 * object.h: Likewise.
4211 * options.h: Likewise.
4212 * output.cc: Likewise.
4213 * output.h: Likewise.
4214 * parameters.cc: Likewise.
4215 * plugin.cc: Likewise.
4216 * powerpc.cc: Likewise.
4217 * reduced_debug_output.cc: Likewise.
4218 * reduced_debug_output.h: Likewise.
4219 * reloc.cc: Likewise.
4220 * reloc.h: Likewise.
4221 * resolve.cc: Likewise.
4222 * script-sections.cc: Likewise.
4223 * script.cc: Likewise.
4224 * script.h: Likewise.
4225 * sparc.cc: Likewise.
4226 * symtab.cc: Likewise.
4227 * symtab.h: Likewise.
4228 * target-select.cc: Likewise.
4229 * target-select.h: Likewise.
4230 * token.h: Likewise.
4231 * workqueue.cc: Likewise.
4232 * workqueue.h: Likewise.
4233 * x86_64.cc: Likewise.
4234
a0351a69
DK
42352009-12-10 Doug Kwan <dougkwan@google.com>
4236
4237 * arm.cc (attributes.h): New include.
4238 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
4239 (Arm_relobj::~Arm_relobj): Delete object pointed by
4240 attributes_section_data_.
4241 (Arm_relobj::attributes_section_data): New method definition.
4242 (Arm_relobj::attributes_section_data_): New data member declaration.
4243 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
4244 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
4245 attributes_section_data_.
4246 (Arm_dynobj::attributes_section_data): New method definition.
4247 (Arm_dynobj::attributes_section_data_): New data member declaration.
4248 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
4249 initialization value of may_use_blx_ to false.
4250 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
4251 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
4252 object attributes to compute results instead of hard-coding.
4253 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
4254 Target_arm::get_secondary_compatible_arch,
4255 Target_arm::set_secondary_compatible_arch
4256 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
4257 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
4258 New method declarations.
4259 (Target_arm::get_aeabi_object_attribute): New method definition.
4260 (Target_arm::attributes_section_data_): New data member declaration.
4261 (read_arm_attributes_section): New template definition.
4262 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
4263 (Arm_dynobj::do_read_symbols): Ditto.
4264 (Target_arm::do_finalize_sections): Merge attributes sections from
4265 input. Check for BLX use after attributes section merging.
4266 Fix __exidx_start and __exidx_end visibility. Create an
4267 .ARM.attributes section if necessary.
4268 (Target_arm::get_secondary_compatible_arch,
4269 Target_arm::set_secondary_compatible_arch,
4270 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
4271 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
e1df38aa 4272 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
a0351a69
DK
4273 New method definitions.
4274
b59befec
ILT
42752009-12-09 Ian Lance Taylor <iant@google.com>
4276
4277 * plugin.cc (Plugin::load): Don't cast from void* to a function
4278 pointer.
4279
1276bc89
ILT
42802009-12-09 Ian Lance Taylor <iant@google.com>
4281
4282 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
4283 information fields.
4284
2f2de248
L
42852009-12-09 H.J. Lu <hongjiu.lu@intel.com>
4286
4287 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
4288 Replace two_file_shared_1.so with two_file_shared_2.so.
4289 * testsuite/Makefile.in: Regenerated.
4290
4f787271
DK
42912009-12-08 Doug Kwan <dougkwan@google.com>
4292
4293 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
4294 (HFILES): Add attributes.h and int_encoding.h.
4295 * Makefile.in: Regenerate.
4296 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
4297 function definitions to int_encoding.cc
4298 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
4299 prototypes to int_encoding.h
4300 * reduced_debug_output.cc (int_encoding.h): New include.
4301 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
4302 function definitions to int_encoding.cc
4303 (insert_into_vector, read_from_pointer): Move template definitions to
4304 int_encoding.h
4305 * attributes.cc: New file.
4306 * attributes.h: New file.
4307 * int_encoding.cc: New file.
4308 * int_encoding.h: New file.
4309
20b52f1a
RÁE
43102009-12-07 Rafael Avila de Espindola <espindola@google.com>
4311
4312 PR gold/11055
4313 * incremental-dump.cc (dump_incremental_inputs): New.
4314 (main): Use dump_incremental_inputs.
4315
53d7974c
L
43162009-12-07 H.J. Lu <hongjiu.lu@intel.com>
4317
4318 PR gold/10893
4319 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
4320 checking elfcpp::STT_FUNC.
4321 (Target_i386::Relocate::relocate): Likewise.
4322 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4323
4324 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
4325 symbols from shared libraries into normal FUNC symbols.
4326
4327 * symtab.h (Symbol): Add is_func and use it.
4328
05a352e6
DK
43292009-12-05 Doug Kwan <dougkwan@google.com>
4330
4331 * arm.cc (Target_arm::arm_info): Initialize new fields
4332 attributes_section and attributes_vendor.
4333 * i386.cc (Target_i386::i386_info): Same.
4334 * object.cc (Sized_relobj::do_layout): Skip attribute section.
4335 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
4336 fields attributes_section and attributes_vendor.
53d7974c 4337 * sparc.cc (Target_sparc::sparc_info): Same.
05a352e6
DK
4338 * target.h (Target::attributes_section, Target::attributes_vendor,
4339 Target::is_attributes_section, Target::attribute_arg_type,
4340 Target::attributes_order): New method definitions.
4341 (Target::Target_info::attributes_section,
4342 Target::Target_info::attributes_vendor): New fields.
4343 (Target::do_attribute_arg_type, Target::do_attributes_order): New
4344 virtual method definitions.
4345 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
4346 attributes_section and attributes_vendor.
4347 * testsuite/testfile.cc (Target_test::test_target_info): Same.
4348
f4e5969c
DK
43492009-12-05 Doug Kwan <dougkwan@google.com>
4350
4351 * arm.cc: Update comments about interworking and stub generation.
4352 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
4353 considered as non-PIC.
4354 (Arm_relocate_functions::base_abs): Fix formatting.
4355 (Arm_relocate_functions::got_prel): Fix comment. Change interface
4356 of function to use GOT entry address instead of offset.
4357 (Target_arm::Scan::global): Issue an error if a symbol would need a
4358 PLT does not get one because it is untyped. Remove code to create
4359 dynamic symbols for relative branches.
4360 (Target_arm::Relocate::relocate: Use 0 instead of false since function
4361 takes unsigned integer instead of boolean.
4362
1abce4a6
L
43632009-12-05 H.J. Lu <hongjiu.lu@intel.com>
4364
4365 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
4366 (two_file_test_LDADD): Likewise.
4367 (common_test_1_LDADD): Likewise.
4368 (exception_test_LDADD) Likewise.
4369 (weak_test_LDADD): Likewise.
4370 (many_sections_test_LDADD): Likewise.
4371 (initpri1_LDADD): Likewise.
4372 (script_test_1_LDADD): Likewise.
4373 (script_test_2_LDADD): Likewise.
4374 (justsyms_LDADD): Likewise.
4375 (binary_test_LDADD): Likewise.
4376 (large_LDADD): Likewise.
4377 * testsuite/Makefile.in: Regenerated.
4378
adcf2816 43792009-12-04 H.J. Lu <hongjiu.lu@intel.com>
1abce4a6 4380
adcf2816
L
4381 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
4382 (Symbol_table::override_with_special): Likewise.
4383 (Symbol_table::add_from_object): Likewise.
4384
28e67f5d
RÁE
43852009-12-04 Rafael Avila de Espindola <espindola@google.com>
4386
4387 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
4388 Don't set the data_offset twice.
4389
ae10a101
RÁE
43902009-12-04 Rafael Avila de Espindola <espindola@google.com>
4391
4392 * testsuite/Makefile.in: Regenerate.
4393
f59f41f3
DK
43942009-12-03 Doug Kwan <dougkwan@google.com>
4395
4396 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
4397 (Target_arm::do_finalize_sections): Add parameter for symbol table
4398 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
4399 * i386.cc (Target_i386::do_finalize_sections): Add an additional
4400 parameter for symbol table pointer.
4401 * layout.cc (Layout::finalize): Call Target::finalize_sections with
4402 an additional parameter for a pointer to symbol table.
4403 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
4404 parameter for a symbol table pointer.
4405 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
4406 * target.h (Target::finalize_sections, Target::do_finalize_sections):
4407 Ditto.
4408 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
4409 parameter for a symbol table pointer.
4410
ca55d848
RÁE
44112009-12-03 Rafael Avila de Espindola <espindola@google.com>
4412
4413 * incremental.cc (Incremental_inputs_header)
4414 (Incremental_inputs_header_write, Incremental_inputs_entry)
4415 (Incremental_inputs_entry_write): Move ...
4416 * incremental.h (Incremental_inputs_header)
4417 (Incremental_inputs_header_write, Incremental_inputs_entry)
4418 (Incremental_inputs_entry_write): here.
4419
3aec4f9c
RÁE
44202009-12-02 Rafael Avila de Espindola <espindola@google.com>
4421
4422 * incremental.cc (make_sized_incremental_binary): Set the target.
4423 Error if it is incompatible.
4424 * output.h (Output_file): Add filename method.
4425
9c0ae74d
RÁE
44262009-12-02 Rafael Avila de Espindola <espindola@google.com>
4427
4428 * incremental.cc (Incremental_inputs_entry): Remove unused argument
4429 from the get_* methods.
4430
a45500ae
RÁE
44312009-12-02 Rafael Avila de Espindola <espindola@google.com>
4432
4433 * incremental-dump.cc (main): Check that the offeset of a script is 0.
4434 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
4435 Write 0 for the data_offset of scripts.
4436
325e6408
RÁE
44372009-12-02 Rafael Avila de Espindola <espindola@google.com>
4438
4439 * testsuite/Makefile.am: Add the incremental_test.sh test.
4440 * testsuite/incremental_test.sh: New.
4441 * testsuite/incremental_test_1.c: New.
4442 * testsuite/incremental_test_2.c: New.
4443
954c3e2e
RÁE
44442009-12-01 Rafael Avila de Espindola <espindola@google.com>
4445
4446 * incremental-dump.cc (main): Fix typos.
4447
f8086623
RÁE
44482009-11-27 Rafael Avila de Espindola <espindola@google.com>
4449
4450 PR gold/11025
4451 * incremental-dump.cc (main): Use llu to print 64 bit values.
4452
3b0dd6ac
L
44532009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
4454 H.J. Lu <hongjiu.lu@intel.com>
4455
4456 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
4457 $(LIBDL).
4458 (incremental_dump_LDADD): Likewise.
4459 * Makefile.in: Regenerated.
4460
a6d1ef57 44612009-11-25 Doug Kwan <dougkwan@google.com>
e1df38aa 4462
a6d1ef57
DK
4463 Revert:
4464
4465 2009-11-25 Doug Kwan <dougkwan@google.com>
4466
4467 * arm.cc (Target_arm::Target_arm): Move method definition
4468 outside of class definition. Add code to handle
4469 --target1-rel, --target1-abs and --target2= options.
4470 (Target_arm::get_reloc_reloc_type): Change method to be
4471 non-static and const.
4472 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
4473 New data member declaration.
4474 (Target_arm::Scan::local, Target_arm::Scan::global,
4475 Target_arm::Relocate::relocate,
4476 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4477 Adjust call to Target_arm::get_real_reloc_type.
4478 (Target_arm::get_real_reloc_type): Use command line options
4479 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
4480 * options.h (--target1-rel, --target1-abs, --target2): New
4481 ARM-only options.
4482
50aeb7d4
DK
44832009-11-25 Doug Kwan <dougkwan@google.com>
4484
4485 * arm.cc (Target_arm::Target_arm): Move method definition outside of
4486 class definition. Add code to handle --target1-rel, --target1-abs
4487 and --target2= options.
4488 (Target_arm::get_reloc_reloc_type): Change method to be non-static
4489 and const.
4490 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
4491 member declaration.
4492 (Target_arm::Scan::local, Target_arm::Scan::global,
4493 Target_arm::Relocate::relocate,
4494 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
4495 call to Target_arm::get_real_reloc_type.
4496 (Target_arm::get_real_reloc_type): Use command line options to
4497 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
4498 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
4499 options.
4500
51938283
DK
45012009-11-25 Doug Kwan <dougkwan@google.com>
4502
4503 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
4504 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
4505 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
4506 formatting.
4507 (Arm_relocate_functions::thm_call): Replace body with a call to
4508 Arm_relocate_functions::thumb_branch_common.
4509 (Arm_relocate_functions::thm_jump24,
4510 Arm_relocate_functions::thm_xpc22): New method definitions.
4511 (Arm_relocate_functions::thumb_branch_common): New method definition.
4512 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
4513 operator.
4514 (Target_arm::Relocate::relocate): Adjust call to thm_call.
4515 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
4516
e2b8f3c4
RÁE
45172009-11-24 Rafael Avila de Espindola <espindola@google.com>
4518
4519 * Makefile.am: Build incremental-dump
4520 * Makefile.in: Regenerate.
4521 * incremental-dump.cc: New.
4522 * incremental.cc (Incremental_inputs_header_data,
4523 Incremental_inputs_entry_data): Move to incremental.h
4524 * incremental.h: (Incremental_inputs_header_data,
4525 Incremental_inputs_entry_data): Move from incremental.cc
4526
bcba9aec
RÁE
45272009-11-24 Rafael Avila de Espindola <espindola@google.com>
4528
4529 * incremental.cc (Incremental_inputs_header,
4530 Incremental_inputs_header_write, Incremental_inputs_entry,
4531 Incremental_inputs_entry_write): Add a typedef with the data type.
4532
7c3afe08
RÁE
45332009-11-24 Rafael Avila de Espindola <espindola@google.com>
4534
4535 * incremental.cc (Incremental_inputs_header,
4536 Incremental_inputs_header_write, Incremental_inputs_entry,
4537 Incremental_inputs_entry_write): Update comment about which
4538 type has the filed descriptions.
4539
d204b6e9
DK
45402009-11-15 Doug Kwan <dougkwan@google.com>
4541
4542 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
4543 (Arm_relocate_functions::arm_branch_common): Change method defintion
4544 in class definition to a method declaration and update list of formal
4545 parameters.
4546 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
4547 Arm_relocation_functions::jump24): Adjust call to
4548 Arm_relocate_functions::arm_branch_common. Update list of formal
4549 parameters.
4550 (Arm_relocate_functions::xpc25): New method definition.
4551 (Arm_relocate_functions::arm_branch_common): Move method defintion
4552 out from class definition. Use stubs for mode-switching and extending
4553 branch ranges.
4554 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
4555 specially. Change code to enable use of stubs in ARM branches.
4556
43d12afe
DK
45572009-11-10 Doug Kwan <dougkwan@google.com>
4558
4559 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
4560 in method declaration.
4561 (Target_arm::relocate_stub): New method declaration.
4562 (Target_arm::default_target): Change to return a pointer instead of
4563 a const reference.
4564 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
4565 Target_arm::default_target.
4566 (Arm_Relobj::do_relocate_sections): Remove options paramater in
4567 method definition.
4568 (Target_arm::relocate_section): Adjust view.
4569 (Target_arm::relocate_stub): New method definition.
4570
ac33a407
DK
45712009-11-10 Doug Kwan <dougkwan@google.com>
4572
4573 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
4574 a format warning.
4575 * incremental.cc (open_incremental_binary): Initialized local
4576 variables to avoid warnings.
4577 * object.cc (make_elf_object): Ditto.
4578 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
4579 a format warning.
e1df38aa 4580
88ee28e9
L
4581009-11-09 H.J. Lu <hongjiu.lu@intel.com>
4582
4583 PR gold/10930
4584 * testsuite/plugin_test.c: Include "config.h".
4585
2daedcd6
DK
45862009-11-09 Doug Kwan <dougkwan@google.com>
4587
4588 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
4589 (arm_symbol_value): Remove.
4590 (Arm_relocate_functions::arm_branch_common,
4591 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
4592 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
4593 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
4594 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
4595 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
4596 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
4597 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
4598 Arm_relocate_functions::thm_mobw_abs_nc,
4599 Arm_relocate_functions::thm_mov_abs,
4600 Arm_relocate_functions::movw_prel_nc,
4601 Arm_relocate_functions::thm_movt_abs,
4602 Arm_relocate_functions::movt_prel,
4603 Arm_relocate_functions::thm_movw_prel_nc,
4604 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
4605 (Target_arm::Relocate::relocate): Only decompose address into two
4606 parts if relocation type uses the thumb-bit and pass the actual
4607 bit instead of a flag indicating that the thumb-bit is used. Adjust
4608 calls to methods in Arm_relocate_functions for this change.
4609
1276bc89 46102009-11-08 Ian Lance Taylor <iant@google.com>
3e4afc80
ILT
4611
4612 PR 10925
4613 * reloc.cc: Instantiate
4614 Sized_relobj::initialize_input_to_output_maps and
4615 Sized_relobj:free_input_to_output_maps.
4616
e53ad1b5
ILT
46172009-11-06 Ian Lance Taylor <iant@google.com>
4618
4619 PR 10876
4620 * defstd.cc (in_segment): Set only_if_ref true for "end".
4621
eb44217c
DK
46222009-11-06 Doug Kwan <dougkwan@google.com>
4623
4624 * arm.cc (class Reloc_stub): Correct a comment.
4625 (Target_arm::Target_arm): Initialize arm_input_section_map_.
4626 (Target_arm::scan_section_for_stubs): New method declaration.
4627 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
4628 Change methods from private to protected.
4629 (Target_arm::do_may_relax): New method definition.
4630 (Target_arm::do_relax, Target_arm::group_sections,
4631 Target_arm::scan_reloc_for_stub,
4632 Target_arm::scan_reloc_section_for_stubs): New method declarations.
4633 (Target_arm::arm_input_section_map_): New data member declaration.
4634 (Target_arm::scan_reloc_for_stub,
4635 Target_arm::scan_reloc_section_for_stubs,
4636 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
4637 Target_arm::do_relax): New method definitions.
4638
5d329b7d
ILT
46392009-11-06 Mikolaj Zalewski <mikolaj@google.com>
4640
4641 * configure.ac: Check for (struct stat)::st_mtim
4642 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
4643 * config.in: Regenerate.
4644 * configure: Regenerate.
4645
96a0d71b
ILT
46462009-11-05 Ian Lance Taylor <iant@google.com>
4647
4648 PR 10910
4649 * output.cc (Output_segment::add_output_section): Add missing
4650 return statement.
4651
594c8e5e
ILT
46522009-11-04 Ian Lance Taylor <iant@google.com>
4653
4654 PR 10880
4655 * object.h (class Object): Add is_needed and set_is_needed
4656 methods. Add is_needed_ field. Make bool fields into bitfields.
4657 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
4658 defined in a dynamic object and referenced by a regular object,
4659 set is_needed for the dynamic object.
4660 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
4661 if the file is marked with as_needed and it is not needed.
4662
22b127cc
ILT
46632009-11-04 Ian Lance Taylor <iant@google.com>
4664
4665 PR 10887
4666 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
4667 tags if data is discarded by linker script.
4668 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4669 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4670 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4671 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4672
f5c870d2
ILT
46732009-11-04 Ian Lance Taylor <iant@google.com>
4674
4675 * layout.cc (Layout::get_output_section): Add is_interp and
4676 is_dynamic_linker_section parameters. Change all callers.
4677 (Layout::choose_output_section): Likewise.
4678 (Layout::make_output_section): Likewise.
4679 (Layout::add_output_section_data): Add is_dynamic_linker_section
4680 parameter. Change all callers.
4681 * layout.h (class Layout): Update declarations.
4682 * output.h (class Output_section): Add is_interp, set_is_interp,
4683 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
4684 Add is_interp_, is_dynamic_linker_section_ fields. Change
4685 generate_code_fills_at_write_ to a bitfield.
4686 * output.cc (Output_section::Output_sections): Initialize new
4687 fields.
4688 (Output_segment::add_output_section): Add do_sort parameter.
4689 Change all callers.
4690
1ae4d23b
ILT
46912009-11-03 Ian Lance Taylor <iant@google.com>
4692
4693 PR 10860
4694 * options.h (class General_options): Add --warn-common.
4695 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
4696 merging two common symbols.
4697 (Symbol_table::should_override): Handle --warn-common when merging
4698 a common symbol with a defined symbol. Use report_resolve_problem
4699 for multiple definitions.
4700 (Symbol_table::report_resolve_problem): New function.
4701 * symtab.h (class Symbol_table): Declare report_resolve_problem.
4702
55da9579
DK
47032009-11-03 Doug Kwan <dougkwan@google.com>
4704
4705 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
4706 stub_factory_.
4707 (Target_arm::stub_factory): New method definition.
4708 (Target_arm::new_arm_input_section,
4709 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
4710 Target_arm::reloc_uses_thumb_bit): New method declarations.
e1df38aa 4711 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
55da9579
DK
4712 New type definitions.
4713 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
4714 member declarations.
4715 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
4716 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
4717 New method definitions.
4718
37a9ac43
ILT
47192009-11-03 Ian Lance Taylor <iant@google.com>
4720
4721 * options.h (class General_options): Add --warn_constructors.
4722
b3d6a3d4
ILT
47232009-11-03 Ian Lance Taylor <iant@google.com>
4724
4725 PR 10893
4726 * defstd.cc (in_section): Add entries for __rel_iplt_start,
4727 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
4728
934b01dd
ILT
47292009-11-03 Ian Lance Taylor <iant@google.com>
4730
4731 PR 10895
4732 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
4733 --msgid-bugs-address.
4734 (install-pdf): New target.
4735 (install-data_yes): Look up one directory to find mkinstalldirs.
4736
03c1939b
L
47372009-11-03 H.J. Lu <hongjiu.lu@intel.com>
4738
4739 * po/Make-in (.po.gmo): Don't generate .gmo files in source
4740 tree.
4741
ebd95253
DK
47422009-10-30 Doug Kwan <dougkwan@google.com>
4743
4744 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
4745
e9bbb538
DK
47462009-10-30 Doug Kwan <dougkwan@google.com>
4747
4748 * arm.cc (Stub_addend_reader): New struct template definition
4749 and partial specializations.
4750 (Stub_addend_reader::operator()): New method definition for a
4751 partially specialized template.
4752
d5b40221
DK
47532009-10-30 Doug Kwan <dougkwan@google.com>
4754
4755 * arm.cc (Arm_relobj::processor_specific_flags): New method
4756 definition.
4757 (Arm_relobj::do_read_symbols): New method declaration.
4758 (Arm_relobj::processor_specific_flags_): New data member declaration.
4759 (Arm_dynobj): New class definition.
4760 (Target_arm::do_finalize_sections): Add input_objects parameter.
4761 (Target_arm::do_adjust_elf_header): New method declaration.
4762 (Target_arm::are_eabi_versions_compatible,
4763 (Target_arm::merge_processor_specific_flags): New method declaration.
4764 (Target_arm::do_make_elf_object): New overloaded method definitions
4765 and declaration.
4766 (Arm_relobj::do_read_symbols): New method definition.
4767 (Arm_dynobj::do_read_symbols): Ditto.
4768 (Target_arm::do_finalize_sections): Add input_objects parameters.
4769 Merge processor-specific flags from all input objects.
4770 (Target_arm::are_eabi_versions_compatible,
4771 Target_arm::merge_processor_specific_flags,
4772 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
4773 New method definitions.
4774 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
4775 Input_objects pointer type parameter.
4776 * layout.cc (Layout::finalize): Pass input objects to target's.
4777 finalize_sections function.
4778 * output.cc (Output_file_header::do_sized_write): Set ELF file
4779 header's processor-specific flags.
4780 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
4781 Input_objects pointer type parameter.
4782 * sparc.cc (Target_sparc::do_finalize_sections): Same.
4783 * target.h (Input_objects): New forward class declaration.
4784 (Target::processor_specific_flags,
4785 Target::are_processor_specific_flags_sect): New method definitions.
4786 (Target::finalize_sections): Add input_objects parameter.
4787 (Target::Target): Initialize processor_specific_flags_ and
4788 are_processor_specific_flags_set_.
4789 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
4790 parameter.
4791 (Target::set_processor_specific_flags): New method definition.
4792 (Target::processor_specific_flags_,
4793 Target::are_processor_specific_flags_set_): New data member
4794 declarations.
4795 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
4796 Input_objects pointer type parameter.
4797
ebabffbd
DK
47982009-10-30 Doug Kwan <dougkwan@google.com>
4799
4800 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
4801
ad0f2072
ILT
48022009-10-28 Ian Lance Taylor <iant@google.com>
4803
4804 * object.h (class Relobj): Drop options parameter from
4805 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
4806 do_scan_relocs, do_relocate. Change all callers.
4807 (class Sized_relobj): Drop options parameters from
4808 do_gc_process_relocs, do_scan_relocs, do_relocate,
4809 do_relocate_sections, relocate_sections, emit_relocs_scan,
4810 emit_relocs_scan_reltype. Change all callers.
4811 (struct Relocate_info): Remove options field and all references to
4812 it.
4813 * reloc.h (class Read_relocs): Remove options constructor
4814 parameter and options_ field. Change all callers.
4815 (class Gc_process_relocs, class Scan_relocs): Likewise.
4816 (class Relocate_task): Likewise.
4817 * target-reloc.h (scan_relocs): Remove options parameter. Change
4818 all callers.
4819 (scan_relocatable_relocs): Likewise.
4820 * target.h (class Sized_target): Remove options parameter from
4821 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
4822 all callers.
4823 * gc.h (gc_process_relocs): Remove options parameter. Change all
4824 callers.
4825 * arm.cc: Update functions to remove options parameters.
4826 * i386.cc: Likewise.
4827 * powerpc.cc: Likewise.
4828 * sparc.cc: Likewise.
4829 * x86_64.cc: Likewise.
4830 * testsuite/testfile.cc: Likewise.
4831
8ffa3667
DK
48322009-10-28 Doug Kwan <dougkwan@google.com>
4833
4834 * arm.cc (Arm_relobj): New class definition.
e1df38aa 4835 (Arm_relobj::scan_sections_for_stubs,
8ffa3667
DK
4836 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
4837 New method definitions.
4838
40f36857
CC
48392009-10-28 Cary Coutant <ccoutant@google.com>
4840
4841 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
4842 (Plugin::cleanup_done_): New member.
4843 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
4844 (Plugin_manager::cleanup_done_): Remove.
4845 (Plugin_manager::add_input_file): Edit error message.
4846 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
4847 (Plugin_manager::cleanup): Remove use of cleanup_done_.
4848
2c849493
ILT
48492009-10-27 Mikolaj Zalewski <mikolajz@google.com>
4850
4851 * fileread.cc: (File_read::View::~View): Use the new
4852 data_ownership_ filed.
4853 (File_read::~File_read): Dispose the new whole_file_view_.
4854 (File_read::open): Mmap the whole file if needed.
4855 (File_read::open): Use whole_file_view_ instead of contents_.
4856 (File_read::find_view): Use whole_file_view_ if applicable.
4857 (File_read::do_read): Use whole_file_view_ instead of contents_.
4858 (File_read::make_view): Use whole_file_view_ instead of contents_,
4859 update File_read::View::View call.
4860 (File_read::find_or_make_view): Update File_read::View::View
4861 call.
4862 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
4863 remove contents_
4864 (File_read::View::Data_ownership): New enum.
4865 (File_read::View::View): Replace bool mapped_ with Data_ownership
4866 argument.
4867 (File_read::View::mapped_): Remove (replaced by data_ownership_).
4868 (File_read::View::data_ownership_): New field.
4869 (File_read::contents_): Remove (replaced by whole_file_view_).
4870 (File_read::whole_file_view_): New field.
4871 * options.h (class General_options): Add --keep-files-mapped.
4872
24998053
CC
48732009-10-27 Cary Coutant <ccoutant@google.com>
4874
4875 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
4876 * testsuite/Makefile.am (plugin_test_5): New test case.
4877 * testsuite/Makefile.in: Regenerate.
4878
72adc4fa
DK
48792009-10-25 Doug Kwan <dougkwan@google.com>
4880
4881 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
4882 from private to protected to allow access by child class.
4883 (Sized_relobj::do_relocate_sections): New method declaration.
4884 (Sized_relobj::relocate_sections): Virtualize.
e1df38aa 4885 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
72adc4fa
DK
4886 Sized_relobj::relocate_sections. Instantiate template explicitly
4887 for different target sizes and endianity.
4888
07f508a2
DK
48892009-10-24 Doug Kwan <dougkwan@google.com>
4890
4891 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
4892 (Arm_input_section::as_arm_input_section): New method.
4893 (Arm_output_section): New class definition.
4894 (Arm_output_section::create_stub_group,
4895 Arm_output_section::group_sections): New method definitions.
4896
10ad9fe5
DK
48972009-10-22 Doug Kwan <dougkwan@google.com>
4898
4899 * arm.cc (Arm_input_section): New class definition.
4900 (Arm_input_section::init, Arm_input_section:do_write,
4901 Arm_input_section::set_final_data_size,
4902 Arm_input_section::do_reset_address_and_file_offset): New method
4903 definitions.
4904
56ee5e00
DK
49052009-10-21 Doug Kwan <dougkwan@google.com>
4906
4907 * arm.cc (Stub_table, Arm_input_section): New forward class
4908 declarations.
4909 (Stub_table): New class defintion.
4910 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
4911 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
4912 New method definition.
4913
b569affa
DK
49142009-10-21 Doug Kwan <dougkwan@google.com>
4915
4916 * arm.cc: Update copyright comments.
4917 (Target_arm): New forward class template declaration.
4918 (Arm_address): New type.
4919 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
4920 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
4921 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
4922 constants.
4923 (Insn_template): Same.
4924 (DEF_STUBS): New macro.
4925 (Stub_type): New enum type.
4926 (Stub_template): New class definition.
4927 (Stub): Same.
4928 (Reloc_stub): Same.
4929 (Stub_factory): Same.
4930 (Target_arm::Target_arm): Initialize may_use_blx_ and
4931 should_force_pic_veneer_.
4932 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
4933 Target_arm::should_force_pic_veneer,
4934 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
4935 Target_arm::using_thumb_only, Target_arm:;default_target): New
4936 method defintions.
4937 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
4938 New data member declarations.
4939 (Insn_template::size, Insn_template::alignment): New method defintions.
4940 (Stub_template::Stub_template): New method definition.
4941 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
4942 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
4943 (Stub_factory::Stub_factory): New method definition.
4944 * gold.h (string_hash): New template.
4945 * output.h (Input_section_specifier::hash_value): Use
4946 gold::string_hash.
4947 (Input_section_specifier::string_hash): Remove.
4948 * stringpool.cc (Stringpool_template::string_hash): Use
4949 gold::string_hash.
4950
6c172549
DK
49512009-10-20 Doug Kwan <dougkwan@google.com>
4952
4953 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
4954 symbols of relaxed input sections.
4955 * output.h (Output_section::find_relaxed_input_section): Make
4956 method public.
4957
c5617f2f
DK
49582009-10-16 Doug Kwan <dougkwan@google.com>
4959
4960 * dynobj.cc (Versions::Versions): Initialize version_script_.
4961 Only insert base version symbol definition for a shared object
4962 if version script defines any version versions.
4963 (Versions::define_base_version): New method definition.
4964 (Versions::add_def): Check that base version is not needed.
4965 (Versions::add_need): Define base version lazily.
4966 * dynobj.h (Versions::define_base_version): New method declaration.
4967 (Versions::needs_base_version_): New data member declaration.
4968 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
4969 (check_DATA): Add no_version_test.stdout.
4970 (libno_version_test.so, no_version_test.o no_version_test.stdout):
4971 New make rules.
4972 * testsuite/Makefile.in: Regenerate.
4973 * testsuite/no_version_test.c: New file.
4974 * testsuite/no_version_test.sh: Ditto.
4975
3c12dcdb
DK
49762009-10-16 Doug Kwan <dougkwan@google.com>
4977
4978 * expression.cc (class Segment_start_expression): New class definition.
4979 (Segment_start_expression::value): New method definition.
4980 (script_exp_function_segment_start): Return a new
4981 Segment_start_expression.
4982 * gold/script-c.h (script_saw_segment_start_expression): New function
4983 prototype.
4984 * script-sections.cc (Script_sections::Script_sections): Initialize
4985 SAW_SEGMENT_START_EXPRESSION_ to false.
4986 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
4987 and -Tbbs options to specify section addresses if given in
4988 command line and no SEGMENT_START expression is seen in a script.
4989 * script-sections.h (Script_sections::saw_segment_start_expression,
4990 Script_sections::set_saw_segment_start_expression): New method
4991 definition.
4992 (Script_sections::saw_segment_start_expression_): New data member
4993 declaration.
4994 * script.cc (script_saw_segment_start_expression): New function.
4995 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
4996 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
4997 script_test_7.sh and script_test_8.sh.
4998 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
4999 script_test_8.stdout.
5000 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
5001 (script_test_6, script_test_6.stdout, script_test_7,
5002 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
5003 * Makefile.in: Regenerate.
5004 * testsuite/script_test_6.sh: New file.
5005 * testsuite/script_test_6.t: Same.
5006 * testsuite/script_test_7.sh: Same.
5007 * testsuite/script_test_7.t: Same.
5008 * testsuite/script_test_8.sh: Same.
5009
64b1ae37
DK
50102009-10-16 Doug Kwan <dougkwan@google.com>
5011
5012 * output.cc (Output_segment::set_section_list_address): Cast
5013 expressions to unsigned long long type to avoid format warnings.
5014
661be1e2
ILT
50152009-10-15 Ian Lance Taylor <iant@google.com>
5016
12edd763 5017 * script.cc (Script_options::add_symbol_assignment): Always add a
b3d6a3d4 5018 dot assignment to script_sections_.
12edd763
ILT
5019 * script-sections.cc (Script_sections::add_dot_assignment):
5020 Initialize if necessary.
5021
68b6574b
ILT
5022 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
5023 program headers with no load segment if there is a linker script.
5024
661be1e2
ILT
5025 * layout.cc (Layout::set_segment_offsets): Align the file offset
5026 to the segment aligment for -N or -n with no load segment.
5027 * output.cc (Output_segment::add_output_section): Don't crash if
5028 the first section is a TLS section.
5029 (Output_segment::set_section_list_addresses): Print an error
5030 message if the address moves backward in a linker script.
5031 * script-sections.cc
5032 (Output_section_element_input::set_section_addresses): Don't
5033 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
5034 (Orphan_output_section::set_section_addresses): Likewise.
5035
f15f61a7
DK
50362009-10-15 Doug Kwan <dougkwan@google.com>
5037
5038 * layout.cc (Layout::finish_dynamic_section): Generate tags
5039 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
5040 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
5041 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
5042
82bb573a
ILT
50432009-10-14 Ian Lance Taylor <iant@google.com>
5044
5045 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
5046 fields.
5047 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
5048 data_shdr fields of relinfo.
5049 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
5050 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
5051 R_386_TLS_LDO_32, adjust based on section flags.
5052 (Target_i386::Relocate::fix_up_ldo): Remove.
5053
374ad285
ILT
50542009-10-13 Ian Lance Taylor <iant@google.com>
5055
5056 Add support for -pie.
5057 * options.h (class General_options): Add -pie and
5058 --pic-executable.
5059 (General_options::output_is_position_independent): Test -pie.
5060 (General_options::output_is_executable): Return true if not shared
5061 and not relocatable.
5062 (General_options::output_is_pie): Remove.
5063 * options.cc (General_options::finalize): Reject incompatible uses
5064 of -pie.
5065 * gold.cc (queue_middle_tasks): A -pie link is not static.
5066 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
5067 * symtab.cc (Symbol::final_value_is_known): Return false if
5068 output_is_position_independent.
5069 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
5070 output_is_position_independent.
5071 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
5072 output_is_position_independent.
5073 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
5074 output_is_position_independent.
5075 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
5076 two_file_pie_test.
5077 (basic_pie_test.o, basic_pie_test): New targets.
5078 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
5079 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
5080 (two_file_pie_test): New target.
5081 * testsuite/Makefile.in: Rebuild.
5082 * README: Remove note saying that -pie is not supported.
5083
c6585162
ILT
50842009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
5085
5086 * options.h (class General_options): Add -init and -fini.
5087 * layout.cc (Layout::finish_dynamic_section): Emit
5088 given init and fini functions.
5089
032ce4e9
ST
50902009-10-13 Sriraman Tallam <tmsriram@google.com>
5091
5092 * gc.h (gc_process_relocs): Check if icf is enabled using new
5093 function.
5094 * gold.cc (queue_initial_tasks): Likewise.
5095 (queue_middle_tasks): Likewise.
5096 * object.cc (do_layout): Likewise.
5097 * symtab.cc (is_section_folded): Likewise.
5098 * main.cc (main): Likewise.
5099 * reloc.cc (Read_relocs::run): Likewise.
5100 (Sized_relobj::do_scan_relocs): Likewise.
5101 * icf.cc (is_function_ctor_or_dtor): New function.
5102 (Icf::find_identical_sections): Check if function is ctor or dtor when
5103 safe icf is chosen.
5104 * options.h (General_options::icf): Change option to be an enum.
5105 (Icf_status): New enum.
5106 (icf_enabled): New method.
5107 (icf_safe_folding): New method.
5108 (set_icf_status): New method.
5109 (icf_status_): New variable.
5110 * (options.cc) (General_options::finalize): Set icf_status_.
5111 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
5112 icf_test and icf_keep_unique_test to use the --icf enum flag.
5113 * testsuite/icf_safe_test.sh: New file.
e1df38aa 5114 * testsuite/icf_safe_test.cc: New file.
032ce4e9 5115
f345227a
ST
51162009-10-12 Sriraman Tallam <tmsriram@google.com>
5117
5118 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
5119 includes to gc.h and icf.h.
5120 * arm.cc: Include gc.h.
5121 * gold.cc: Likewise.
5122 * i386.cc: Likewise.
5123 * powerpc.cc: Likewise.
5124 * sparc.cc: Likewise.
5125 * x86_64.cc: Likewise.
5126 * gc.h: Include icf.h.
5127
1c7814ed
ILT
51282009-10-11 Ian Lance Taylor <iant@google.com>
5129
5130 * plugin.cc: Include "gold.h" before other header files.
5131
ae3b5189
CD
51322009-10-10 Chris Demetriou <cgd@google.com>
5133
5134 * options.h (Input_file_argument::Input_file_type): New enum.
5135 (Input_file_argument::is_lib_): Replace with...
5136 (Input_file_argument::type_): New member.
5137 (Input_file_argument::Input_file_argument): Take Input_file_type
5138 'type' rather than boolean 'is_lib' as second argument.
5139 (Input_file_argument::is_lib): Use type_.
5140 (Input_file_argument::is_searched_file): New function.
5141 (Input_file_argument::may_need_search): Handle is_searched_file.
5142 * options.cc (General_options::parse_library): Support -l:filename.
5143 (General_options::parse_just_symbols): Update for Input_file_argument
5144 changes.
5145 (Command_line::process): Likewise.
5146 * archive.cc (Archive::get_file_and_offset): Likewise.
5147 * plugin.cc (Plugin_manager::release_input_file): Likewise.
5148 * script.cc (read_script_file, script_add_file): Likewise.
5149 * fileread.cc (Input_file::Input_file): Likewise.
5150 (Input_file::will_search_for): Handle is_searched_file.
5151 (Input_file::open): Likewise.
5152 * readsyms.cc (Read_symbols::get_name): Likewise.
5153 * testsuite/Makefile.am (searched_file_test): New test.
5154 * testsuite/Makefile.in: Regenerate.
5155 * testsuite/searched_file_test.cc: New file.
5156 * testsuite/searched_file_test_lib.cc: New file.
5157
f3048a1d
ILT
51582009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5159 Ian Lance Taylor <iant@google.com>
5160
5161 * descriptor.cc: Include <cstdio> and "binary-io.h".
5162 (Descriptors::open): Open the files in binary mode always.
5163 * script.cc (Lex::get_token): Treat \r as whitespace.
5164
d4780e57
ILT
51652009-10-09 Ian Lance Taylor <iant@google.com>
5166
5167 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
5168
d9a893b8
ILT
51692009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5170 Ian Lance Taylor <iant@google.com>
5171
5172 * configure.ac: Check for readv function also.
5173 * fileread.cc (readv): Define if not HAVE_READV.
5174 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
5175 does not exist.
5176 * config.in: Regenerate.
5177 * configure: Regenerate.
5178
c0a62865
DK
51792009-10-09 Doug Kwan <dougkwan@google.com>
5180
5181 * layout.cc (Layout::make_output_section): Call target hook to make
5182 ordinary output section.
5183 (Layout::finalize): Adjust parameter list of call the
5184 Target::may_relax().
5185 * layout.h (class Layout::section_list): New method.
5186 * merge.h (Output_merge_base::entsize): Change visibility to public.
5187 (Output_merge_base::is_string, Output_merge_base::do_is_string):
5188 New methods.
5189 (Output_merge_string::do_is_string): New method.
5190 * object.cc (Sized_relobj::do_setup): renamed from
5191 Sized_relobj::set_up.
5192 * object.h (Sized_relobj::adjust_shndx,
5193 Sized_relobj::initializ_input_to_output_maps,
5194 Sized_relobj::free_input_to_output_maps): Change visibilities to
5195 protected.
5196 (Sized_relobj::setup): Virtualize.
5197 (Sized_relobj::do_setup): New method declaration.
5198 (Sized_relobj::invalidate_section_offset,
5199 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
5200 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
5201 * options.cc (parse_int): New function.
5202 * options.h (parse_int): New declaration.
5203 (DEFINE_int): New macro.
5204 (stub_group_size): New option.
5205 * output.cc (Output_section::Output_section): Initialize memebers
5206 merge_section_map_, merge_section_by_properties_map_,
5207 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
5208 (Output_section::add_input_section): Handled deferred code-fill
5209 generation and remove an old comment.
5210 (Output_section::add_relaxed_input_section): New method definition.
5211 (Output_section::add_merge_input_section): Use merge section by
5212 properties map to speed to search. Update merge section maps
5213 as appropriate.
5214 (Output_section::build_relaxation_map): New method definition.
5215 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5216 Same.
5217 (Output_section::relax_input_section): Renamed to
5218 Output_section::convert_input_sections_to_relaxed_sections and change
5219 interface to take a vector of pointers to relaxed sections.
5220 (Output_section::find_merge_section,
5221 Output_section::find_relaxed_input_section): New method definitions.
5222 (Output_section::is_input_address_mapped,
5223 Output_section::output_offset, Output_section::output_address):
5224 Use output section data maps to speed up searching.
5225 (Output_section::find_starting_output_address): Add comments.
5226 (Output_section::do_write,
5227 Output_section::write_to_postprocessing_buffer): Do code-fill
5228 generation as appropriate.
5229 (Output_section::get_input_sections): Invalidate relaxed input section
5230 map.
5231 (Output_section::restore_states): Adjust type of checkpoint .
5232 Invalidate relaxed input section map.
5233 * output.h (Output_merge_base): New class declaration.
5234 (Input_section_specifier): New class defintion.
5235 (class Output_relaxed_input_section) Change base class to
5236 Output_section_data_build.
5237 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
5238 base class initializer.
5239 (Output_section::add_relaxed_input_section): New method declaration.
5240 (Output_section::Input_section): Change visibility to protected.
5241 (Output_section::Input_section::relobj,
5242 Output_section::Input_section::shndx): Handle relaxed input sections.
5243 Output_section::input_sections) Change visibility to protected. Also
5244 define overload to return a non-const pointer.
5245 (Output_section::Merge_section_properties): New class defintion.
5246 (Output_section::Merge_section_by_properties_map,
5247 Output_section::Output_section_data_by_input_section_map,
5248 Output_section::Relaxation_map): New types.
5249 (Output_section::relax_input_section): Rename method to
5250 Output_section::convert_input_sections_to_relaxed_sections and change
5251 interface to take a vector of relaxed section pointers.
5252 (Output_section::find_merge_section,
5253 Output_section::find_relaxed_input_section,
5254 Output_section::build_relaxation_map,
5255 Output_section::convert_input_sections_in_list_to_relaxed_sections):
5256 New method declarations.
5257 (Output_section::merge_section_map_
5258 Output_section::merge_section_by_properties_map_,
5259 Output_section::relaxed_input_section_map_,
5260 Output_section::is_relaxed_input_section_map_valid_,
5261 Output_section::generate_code_fills_at_write_): New data members.
5262 * script-sections.cc
5263 (Output_section_element_input::set_section_addresses): Call
5264 current_data_size and addralign methods of relaxed input sections.
5265 (Orphan_output_section::set_section_addresses): Call current_data_size
5266 and addralign methods of relaxed input sections.
5267 * symtab.cc (Symbol_table::compute_final_value): Extract template
5268 from the body of Symbol_table::sized_finalize_symbol.
5269 (Symbol_table::sized_finalized_symbol): Call
5270 Symbol_table::compute_final_value.
5271 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
5272 (Symbol_table::compute_final_value): New templated method declaration.
5273 * target.cc (Target::do_make_output_section): New method defintion.
5274 * target.h (Target::make_output_section): New method declaration.
5275 (Target::relax): Add more parameters for input objects, symbol table
5276 and layout. Adjust call to do_relax.
5277 (Target::do_make_output_section): New method declaration.
5278 (Target::do_relax): Add parameters for input objects, symbol table
5279 and layout.
5280
d446d6c4
ILT
52812009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5282
5283 * pread.c: Include stdio.h.
5284
bc06c745
ILT
52852009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5286
5287 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
5288 defined.
5289
75aea3d0
ILT
52902009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5291
5292 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5293 Change read_shndx type to unsigned int.
5294 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
5295 int.
5296 (Sized_dwarf_line_info::read_line_mappings): Likewise.
5297 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
5298 Change read_shndx type to unsigned int.
5299 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
5300 int.
5301 (Sized_dwarf_line_info::read_line_mappings): Likewise.
5302 * layout.cc (Layout::create_symtab_sections): Cast the result of
5303 local_symcount * symsize to off_t in the gold_assert.
5304
be8fcb75
ILT
53052009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5306
5307 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
5308 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
5309 R_ARM_BASE_ABS.
5310 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
5311 (Arm_relocate_functions::thm_abs5): New function.
5312 (Arm_relocate_functions::abs12): New function.
5313 (Arm_relocate_functions::abs16): New function.
5314 (Arm_relocate_functions::base_abs): New function.
5315 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
5316 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
5317 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
5318 R_ARM_BASE_ABS.
5319 (Scan::global): Likewise.
5320 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
5321 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
5322 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
5323 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
5324 R_ARM_BASE_ABS.
5325
c2a122b6
ILT
53262009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5327
5328 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
5329 (Arm_relocate_functions::movt_prel): New function.
5330 (Arm_relocate_functions::thm_movw_prel_nc): New function.
5331 (Arm_relocate_functions::thm_movt_prel): New function.
5332 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
5333 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
5334 (Scan::global, Relocate::relocate): Likewise.
5335 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5336
c4aa1e2d
ILT
53372009-10-09 Mikolaj Zalewski <mikolajz@google.com>
5338
5339 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
5340 Incremental_checker.
5341 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
5342 unsigned int.
5343 (class Incremental_inputs_header): New class.
5344 (Incremental_inputs_header_writer): Edit comment.
5345 (Incremental_inputs_entry): New class.
5346 (Incremental_inputs_entry_writer): Edit comment.
5347 (Sized_incremental_binary::do_find_incremental_inputs_section):
5348 Add *strtab_shndx parameter, fill it.
5349 (Sized_incremental_binary::do_check_inputs): New method.
5350 (Incremental_checker::can_incrementally_link_output_file): Use
5351 Sized_incremental_binary::check_inputs.
5352 (Incremental_inputs::report_command_line): Save command line in
5353 command_line_.
5354 * incremental.h:
5355 (Incremental_binary::find_incremental_inputs_section): New
5356 method.
5357 (Incremental_binary::do_find_incremental_inputs_section): Add
5358 strtab_shndx parameter.
5359 (Incremental_binary::do_check_inputs): New pure virtual method.
5360 (Sized_incremental_binary::do_check_inputs): Declare.
5361 (Incremental_checker::Incremental_checker): Add incremental_inputs
5362 parameter, use it to initialize incremental_inputs_.
5363 (Incremental_checker::incremental_inputs_): New field.
5364 (Incremental_checker::command_line): New method.
5365 (Incremental_checker::inputs): New method.
5366 (Incremental_checker::command_line_): New field.
5367
c549a694
ILT
53682009-10-09 Mikolaj Zalewski <mikolajz@google.com>
5369
5370 * incremental.cc: Include <cstdarg> and "target-select.h".
5371 (vexplain_no_incremental): New function.
5372 (explain_no_incremental): New function.
5373 (Incremental_binary::error): New method.
5374 (Sized_incremental_binary::do_find_incremental_inputs_section): New
5375 method.
5376 (make_sized_incremental_binary): New function.
5377 (open_incremental_binary): New function.
5378 (can_incrementally_link_file): Add checks if output is ELF and has
5379 inputs section.
5380 * incremental.h: Include "elfcpp_file.h" and "output.h".
5381 (Incremental_binary): New class.
5382 (Sized_incremental_binary): New class.
5383 (open_incremental_binary): Declare.
5384 * object.cc (is_elf_object): Use
5385 elfcpp::Elf_recognizer::is_elf_file.
5386 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
5387 * output.h (Output_file::filesize): New method.
5388
fd3c5f0b
ILT
53892009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5390
5391 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
5392 New function.
5393 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
5394 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
5395 function.
5396 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
5397 function.
5398 (Arm_relocate_functions::movw_abs_nc): New function.
5399 (Arm_relocate_functions::movt_abs): New function.
5400 (Arm_relocate_functions::thm_movw_abs_nc): New function.
5401 (Arm_relocate_functions::thm_movt_abs): New function.
5402 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
5403 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
5404 (Scan::global): Likewise.
5405 (Relocate::relocate): Likewise.
5406 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5407
7f5309a5
ILT
54082009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5409
5410 * arm.cc (Arm_relocate_functions::got_prel) New function.
5411 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
5412 (Relocate::relocate): Likewise.
5413 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5414
364c7fa5
ILT
54152009-10-06 Ian Lance Taylor <iant@google.com>
5416
5417 * options.h (class General_options): Define
5418 split_stack_adjust_size parameter.
5419 * object.h (class Object): Add uses_split_stack_ and
5420 has_no_split_stack_ fields. Add uses_split_stack and
5421 has_no_split_stack accessor functions. Declare
5422 handle_split_stack_section.
5423 (class Reloc_symbol_changes): Define.
5424 (class Sized_relobj): Define Function_offsets. Declare
5425 split_stack_adjust, split_stack_adjust_reltype, and
5426 find_functions.
5427 * object.cc (Object::handle_split_stack_section): New function.
5428 (Sized_relobj::do_layout): Call handle_split_stack_section.
5429 * dynobj.cc (Sized_dynobj::do_layout): Call
5430 handle_split_stack_section.
5431 * reloc.cc (Sized_relobj::relocate_sections): Call
5432 split_stack_adjust for executable sections in split_stack
5433 objects. Pass reloc_map to relocate_section.
5434 (Sized_relobj::split_stack_adjust): New function.
5435 (Sized_relobj::split_stack_adjust_reltype): New function.
5436 (Sized_relobj::find_functions): New function.
5437 * target-reloc.h: Include "object.h".
5438 (relocate_section): Add reloc_symbol_changes parameter. Change
5439 all callers.
5440 * target.h (class Target): Add calls_non_split method. Declare
5441 do_calls_non_split virtual method. Declare match_view and
5442 set_view_to_nop.
5443 * target.cc: Include "elfcpp.h".
5444 (Target::do_calls_non_split): New function.
5445 (Target::match_view): New function.
5446 (Target::set_view_to_nop): New function.
5447 * gold.cc (queue_middle_tasks): Give an error if mixing
5448 split-stack and non-split-stack objects with -r.
5449 * i386.cc (Target_i386::relocate_section): Add
5450 reloc_symbol_changes parameter.
5451 (Target_i386::do_calls_non_split): New function.
5452 * x86_64.cc (Target_x86_64::relocate_section): Add
5453 reloc_symbol_changes parameter.
5454 (Target_x86_64::do_calls_non_split): New function.
5455 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
5456 parameter.
5457 * powerpc.cc (Target_powerpc::relocate_section): Add
5458 reloc_symbol_changes parameter.
5459 * sparc.cc (Target_sparc::relocate_section): Add
5460 reloc_symbol_changes parameter.
5461 * configure.ac: Call AM_CONDITIONAL for the default target.
5462 * configure: Rebuild.
5463 * testsuite/Makefile.am (TEST_AS): New variable.
5464 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
5465 (check_DATA): Add split_i386 and split_x86_64 files.
5466 (SPLIT_DEFSYMS): Define.
5467 (split_i386_[1234n].o): New targets.
5468 (split_i386_[124]): New targets.
5469 (split_i386_[1234r].stdout): New targets.
5470 (split_x86_64_[1234n].o): New targets.
5471 (split_x86_64_[124]): New targets.
5472 (split_x86_64_[1234r].stdout): New targets.
5473 (MOSTLYCLEANFILES): Add new executables.
5474 * testsuite/split_i386.sh: New file.
5475 * testsuite/split_x86_64.sh: New file.
5476 * testsuite/split_i386_1.s: New file.
5477 * testsuite/split_i386_2.s: New file.
5478 * testsuite/split_i386_3.s: New file.
5479 * testsuite/split_i386_4.s: New file.
5480 * testsuite/split_i386_n.s: New file.
5481 * testsuite/split_x86_64_1.s: New file.
5482 * testsuite/split_x86_64_2.s: New file.
5483 * testsuite/split_x86_64_3.s: New file.
5484 * testsuite/split_x86_64_4.s: New file.
5485 * testsuite/split_x86_64_n.s: New file.
5486 * testsuite/testfile.cc (Target_test): Update relocation_section
5487 function.
5488 * testsuite/Makefile.in: Rebuild.
5489
e8a9fcda
ILT
54902009-10-06 Ian Lance Taylor <iant@google.com>
5491
5492 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
5493 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
5494 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
5495 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
5496 the address on ldo_addrs_.
5497 (Target_i386::Relocate::fix_up_ldo): New function.
5498
e99daf92
ILT
54992009-10-06 Rafael Espindola <espindola@google.com>
5500
5501 * plugin.cc (add_input_library): New.
5502 (Plugin::load): Add add_input_library to tv.
5503 (Plugin_manager::add_input_file): Add the is_lib argument.
5504 (add_input_file): Update call to Plugin_manager::add_input_file.
5505 (add_input_library): New.
5506 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
5507
966d4097
DK
55082009-09-30 Doug Kwan <dougkwan@google.com>
5509
5510 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
5511 symbol and call Symbol::may_need_copy_reloc to determine if
5512 a copy reloc is needed.
5513 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
5514 nocopyreloc is given in command line.
5515 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
5516 given in command line.
5517 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
5518 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
5519 of the removed Target_i386::may_need_copy_reloc.
5520 * options.h (copyreloc): New option with default value false.
5521 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
5522 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
5523 instead of the removed Target_powerpc::may_need_copy_reloc.
5524 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
5525 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
5526 instead of the removed Target_sparc::may_need_copy_reloc.
5527 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
5528 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
5529 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
5530 instead of the removed Target_x86_64::may_need_copy_reloc.
5531
029ba973
ILT
55322009-09-30 Ian Lance Taylor <iant@google.com>
5533
5534 * object.h (class Object): Remove target_ field, and target,
5535 sized_target, and set_target methods.
5536 (Object::sized_target): Remove.
5537 (class Sized_relobj): Update declarations. Remove sized_target.
5538 * object.cc (Sized_relobj::setup): Remove target parameter.
5539 Change all callers.
5540 (Input_objects::add_object): Don't do anything with the target.
5541 (make_elf_sized_object): Add punconfigured parameter. Change all
5542 callers. Set or test parameter target.
5543 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
5544 Change all callers.
5545 * parameters.cc (Parameters::set_target): Change parameter type to
5546 be non-const.
5547 (Parameters::default_target): Remove.
5548 (set_parameters_target): Change parameter type to be non-const.
5549 (parameters_force_valid_target): New function.
5550 (parameters_clear_target): New function.
5551 * parameters.h (class Parameters): Update declarations. Remove
5552 default_target method. Add sized_target and clear_target
5553 methods. Change target_ to be non-const.
5554 (set_parameters_target): Update declaration.
5555 (parameters_force_valid_target): Declare.
5556 (parameters_clear_target): Declare.
5557 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
5558 as NULL if we aren't searching.
5559 (Add_symbols::run): Don't check for compatible target.
5560 * fileread.cc (Input_file::open_binary): Call
5561 parameters_force_valid_target.
5562 * gold.cc (queue_middle_tasks): Likewise.
5563 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
5564 set_target on object.
5565 * dynobj.h (class Sized_dynobj): Update declarations.
5566 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
5567 make_elf_object returns NULL.
5568 (Archive::include_member): Don't check whether object target is
5569 compatible.
5570 * output.cc (Output_section::add_input_section): Get target from
5571 parameters.
5572 (Output_section::relax_input_section): Likewise.
5573 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
5574 parameters.
5575 (Sized_relobj::do_scan_relocs): Likewise.
5576 (Sized_relobj::relocate_sections): Likewise.
5577 * resolve.cc (Symbol_table::resolve): Likewise.
5578 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
5579 parameter. Change all callers.
5580 (Symbol_table::add_from_object): Get target from parameters.
5581 (Symbol_table::add_from_relobj): Don't check object target.
5582 (Symbol_table::add_from_dynobj): Likewise.
5583 (Symbol_table::define_special_symbol): Get target from
5584 parameters.
5585 * symtab.h (class Symbol_table): Update declaration.
5586 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
5587 parameter. Change all callers. Clear parameter target.
5588 (Binary_test): Test target here.
5589 * testsuite/object_unittest.cc (gold_testsuite): Remove
5590 target_test_pointer parameter. Change all callers.
5591 (Object_test): Test target here.
5592
a6a22b83
ILT
55932009-09-26 Ian Lance Taylor <iant@google.com>
5594
5595 * testsuite/initpri1.c: Don't try to use constructor priorities if
5596 compiling with gcc before 4.3.
5597
6a8f49fe
ILT
55982009-09-22 Mikolaj Zalewski <mikolajz@google.com>
5599
5600 * testsuite/retain_symbols_file_test.sh (check_present): Change
5601 output file name to retain_symbols_file_test.stdout.
5602 (check_absent): Likewise.
5603
8c604651
CS
56042009-09-18 Craig Silverstein <csilvers@google.com>
5605
5606 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
5607 * options.cc: Include <cerrno> and <fstream>.
5608 (General_options::finalize): Parse -retain-symbols-file tag.
5609 * options.h: New flag.
5610 (General_options): New method should_retain_symbol, new
5611 variable symbols_to_retain.
5612 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
5613 should_retain_symbol map.
5614 * testsuite/Makefile.am (retain_symbols_file_test): New test.
5615 * testsuite/Makefile.in: Regenerate.
5616 * testsuite/retain_symbols_file_test.sh: New file.
5617
ca58b19f
NC
56182009-09-18 Nick Clifton <nickc@redhat.com>
5619
5620 * po/es.po: Updated Spanish translation.
5621
20e6d0d6
DK
56222009-09-17 Doug Kwan <dougkwan@google.com>
5623
5624 * debug.h (DEBUG_RELAXATION): New constant.
5625 (DEBUG_ALL): Add DEBUG_RELAXATION.
5626 (debug_string_to_enum): Add relaxation debug option.
5627 * layout.cc
5628 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
5629 Layout::Relaxation_debug_check::read_sections,
5630 Layout::Relaxation_debug_check::read_sections): New method definitions.
5631 (Layout::Layout): Initialize data members
5632 record_output_section_data_from_scrips_,
5633 script_output_section_data_list_ and relaxation_debug_check_.
5634 (Layout::save_segments, Layout::restore_segments,
5635 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
5636 Layout::relaxation_loop_body): New method definitions.
5637 (Layout::finalize): Support relaxation. Move section layout code to
5638 Layout::relaxation_loop_body.
5639 (Layout::set_asection_address_from_script): Move code for orphan
5640 section placement out.
5641 (Layout::place_orphan_sections_in_script): New method definition.
5642 * layout.h (Output_segment_headers, Output_file_header):
5643 New forward class declarations.
5644 (Layout::~Layout): Define.
5645 (Layout::new_output_section_data_from_script): New method definition.
5646 (Layout::place_orphan_sections_in_script): New method declaration.
5647 (Layout::Segment_states): New type declaration.
5648 (Layout::save_segments, Layout::restore_segments,
5649 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
5650 Layout::relaxation_loop_body): New method declarations.
5651 (Layout::Output_section_data_list): New type declaration.
5652 (Layout::Relaxation_debug_check): New class definition.
5653 (Layout::record_output_section_data_from_script_,
5654 Layout::script_output_section_data_list_, Layout::segment_states_,
5655 Layout::relaxation_debug_check_): New data members.
5656 * output.cc: (Output_section_headers::do_size): New method definition.
5657 (Output_section_headers::Output_section_headers): Move size
5658 computation to Output_section_headers::do_size.
5659 (Output_segment_headers::do_size): New method definition.
e1df38aa 5660 (Output_file_header::Output_file_header): Move size computation to
20e6d0d6
DK
5661 Output_file_header::do_size and call it.
5662 (Output_file_header::do_size): New method definition.
5663 (Output_data_group::Output_data_group): Adjust call to
5664 Output_section_data.
5665 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
5666 (Output_symtab_xindex::do_write): Add array bound check.
5667 (Output_section::Input_section::print_to_mapfile): Handle
5668 RELAXED_INPUT_SECTION_CODE.
5669 (Output_section::Output_section): Initialize data member checkpoint_.
5670 (Output_section::~Output_section): Delete checkpoint object pointed
5671 by checkpoint_.
5672 (Output_section::add_input_section): Always add an Input_section if
5673 relaxing.
5674 (Output_section::add_merge_input_section): Add assert.
5675 (Output_section::relax_input_section): New method definition.
5676 (Output_section::set_final_data_size): Set load address to zero for
5677 an unallocated section.
5678 (Output_section::do_address_and_file_offset_have_reset_values):
5679 New method definition.
5680 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
5681 Handle relaxed input section.
5682 (Output_section::sort_attached_input_sections): Checkpoint input
5683 section list lazily.
5684 (Output_section::get_input_sections): Change type of input_sections to
5685 list of Simple_input_section pointers. Checkpoint input section list
5686 lazily. Also handle relaxed input sections.
5687 (Output_section::add_input_section_for_script): Take a reference to
5688 a Simple_input_section object instead of Relobj pointer and section
5689 index as parameter. Handle relaxed input sections.
5690 (Output_section::save_states, Output_section::restore_states): New
5691 method definitions.
5692 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
5693 (Output_data::is_data_size_fixed): New method definition.
5694 (Output_data::reset_addresss_and_file_offset): Do not reset data size
5695 if it is fixed.
5696 (Output_data::address_and_file_offset_have_reset_values): New method
5697 definition.
5698 (Output_data::do_address_and_file_offset_have_reset_values): New method
5699 definition.
5700 (Output_data::set_data_size): Check that data size is not fixed.
5701 (Output_data::fix_data_size): New method definition.
5702 (Output_data::is_data_size_fixed_): New data member.
5703 (Output_section_headers::set_final_data_size): New method definition.
5704 (Output_section_headers::do_size): New method declaration.
5705 (Output_segment_headers::set_final_data_size): New method definition.
5706 (Output_segment_headers::do_size): New method declaration.
5707 (Output_file_header::set_final_data_size)::New method definition.
5708 (Output_file_header::do_size)::New method declaration.
5709 (Output_section_data::Output_section_data): Add new parameter
5710 is_data_size_fixed and use it to fix data size.
5711 (Output_data_const::Output_data_const): Adjust call to base class
5712 constructor and fix data size.
5713 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
5714 base class constructor and fix data size.
5715 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
5716 base class constructor and fix data size.
5717 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
5718 class constructor and fix data size.
5719 (Output_data_group::set_final_data_size): New method definition.
5720 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
5721 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
5722 class constructor and fix data size.
5723 (Output_relaxed_input_section): New class definition.
5724 (Output_section::Simple_input_section): New class definition.
5725 (Output_section::get_input_sections): Adjust parameter list.
5726 (Output_section::add_input_section_for_script): Same.
5727 (Output_section::save_states, Output_section::restore_states,
5728 Output_section::do_address_and_file_offset_have_reset_values,
5729 (Output_section::Input_section::Input_section): Handle
5730 RELAXED_INPUT_SECTION_CODE. Add new overload for
5731 Output_relaxed_input_section.
5732 (Output_section::Input_section::is_input_section,
5733 Output_section::Input_section::set_output_section): Handle relaxed
5734 input section.
5735 (Output_section::Input_section::is_relaxed_input_section,
5736 Output_section::Input_section::output_section_data,
5737 Output_section::Input_section::relaxed_input_section): New method
5738 definitions.
5739 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
5740 value.
5741 (Output_section::Input_section::u1_): Update comments.
5742 (Output_section::Input_section::u2_): Add new union member poris.
5743 (Output_section::Checkpoint_output_section): New classs definition.
5744 (Output_section::relax_input_section): New method declaration.
5745 (Output_section::checkpoint_): New data member.
5746 (Output_segment): Update comments.
5747 (Output_segment::Output_segment): Un-privatize copy constructor.
5748 (Output_segment::operator=): Un-privatize.
5749 * script-sections.cc (Output_section_element::Input_section_list):
5750 Change element type to Output_section::Simple_input_section.
5751 (Output_section_element_dot_assignment::set_section_addresses):
5752 Register output section data for relaxation clean up.
5753 (Output_data_exression::Output_data_expression): Adjust call to base
5754 constructor to fix data size.
5755 (Output_section_element_data::set_section_addresses): Register
5756 Output_data_expression object for relaxation clean up.
5757 (struct Input_section_info): Replace Relobj pointer and section index
5758 pair with Output_section::Simple_input_section and Convert struct to a
5759 class.
5760 (Input_section_sorter::operator()): Adjust access to
e1df38aa 5761 Input_section_info data member to use accessors.
20e6d0d6
DK
5762 (Output_section_element_input::set_section_addresses): Use layout
5763 parameter. Adjust code to use Output_section::Simple_input_section
5764 and Input_secction_info classes. Register filler for relaxation
5765 clean up.
5766 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
5767 and section index pair with Output_section::Simple_input_section
5768 class. Adjust code accordingly.
5769 (Phdrs_element::release_segment): New method definition.
5770 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
5771 segment list.
5772 (Script_sections::release_segments): New method definition.
5773 * gold/script-sections.h (Script_sections::release_segments): New
5774 method declaration.
5775 * gold/target.h (Target::may_relax, Target::relax,
5776 Target::do_may_relax, Target::do_relax): New method definitions.
5777
5e445df6
ILT
57782009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5779
5780 * arm.cc (has_signed_unsigned_overflow): New function.
5781 (Arm_relocate_functions::abs8): New function.
5782 (Target_arm::Scan::local): Handle R_ARM_ABS8.
5783 (Target_arm::Scan::global): Likewise.
5784 (Target_arm::relocate::relocate): Likewise.
5785 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5786 Likewise.
5787
8c604651 57882009-09-16 Cary Coutant <ccoutant@google.com>
72fef11a
CC
5789
5790 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
5791 * testsuite/Makefile.in: Regenerate.
5792
1e9cc1c2
NC
57932009-09-11 Nick Clifton <nickc@redhat.com>
5794
5795 * po/gold.pot: Updated by the Translation project.
5796
6a89f575
CC
57972009-09-08 Cary Coutant <ccoutant@google.com>
5798
5799 * output.cc (Output_file::open): Add execute permission to empty file.
5800 * testsuite/Makefile.am (permission_test): New test.
5801 * testsuite/Makefile.in: Regenerate.
5802
fdcac5af
ILT
58032009-09-02 Ian Lance Taylor <iant@google.com>
5804
5805 * output.cc (Output_file::resize): Call map_no_anonymous rather
5806 than map.
5807
44453f85
ILT
58082009-09-01 Mikolaj Zalewski <mikolajz@google.com>
5809
5810 * gold.cc: Include "incremental.h".
5811 (queue_initial_tasks): Call Incremental_checker methods.
5812 * incremental.cc: Include "output.h".
5813 (Incremental_checker::can_incrementally_link_output_file): New
5814 method.
5815 * incremental.h (Incremental_checker): New class.
5816
5817 * output.cc (Output_file::open_for_modification): New method.
5818 (Output_file::map_anonymous): Changed return type to bool. Record
5819 map in base_ field.
5820 (Output_file::map_no_anonymous): New method, broken out of map.
5821 (Output_file::map): Use map_no_anonymous and map_anonymous.
5822 * output.h (class Output_file): Update declarations.
5823
293c1386
CC
58242009-08-24 Cary Coutant <ccoutant@google.com>
5825
5826 * options.h (Command_line::Pre_options): New class.
5827 (Command_line::pre_options): New member.
5828 * options.cc (gold::options::ready_to_register): New variable.
5829 (One_option::register_option): Do nothing if not registering options.
5830 Assert if same short option registered twice.
5831 (General_options::General_options): Turn off option registration when
5832 done constructing.
5833 (Command_line::Pre_options::Pre_options): New constructor.
5834
f773f3d2
CC
58352009-08-24 Cary Coutant <ccoutant@google.com>
5836
06a73cfe
CC
5837 * options.h (General_options::no_keep_memory): Remove incorrect
5838 short option.
f773f3d2 5839
a15af8e2
RW
58402009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5841
5842 * Makefile.am (am__skiplex, am__skipyacc): New.
5843 * Makefile.in: Regenerate.
5844
c462b41b
RW
58452009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5846
14ec8efd
RW
5847 * Makefile.am (AM_CPPFLAGS): Renamed from ...
5848 (INCLUDES): ... this.
5849 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
5850 (AM_CPPFLAGS): Renamed from ...
5851 (INCLUDE): ... this.
5852 * Makefile.in, testsuite/Makefile.in: Regenerate.
5853
81ecdfbb
RW
5854 * Makefile.in: Regenerate.
5855 * aclocal.m4: Likewise.
5856 * config.in: Likewise.
5857 * configure: Likewise.
5858 * testsuite/Makefile.in: Likewise.
5859
c462b41b
RW
5860 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
5861 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
5862 * Makefile.in: Regenerate.
5863 * testsuite/Makefile.in: Regenerate.
5864
2da73f13
CC
58652009-08-19 Cary Coutant <ccoutant@google.com>
5866
5867 * resolve.cc (Symbol_table::resolve): Don't complain about defined
5868 symbols in shared libraries overridden by hidden or internal symbols
5869 in the main program.
5870
2db70501
CD
58712009-08-19 Chris Demetriou <cgd@google.com>
5872
5873 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
5874 checking source file names in error messages.
5875
f733487b
DK
58762009-08-18 Doug Kwan <dougkwan@google.com>
5877
5878 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
5879 an elcpp::Ehdr as parameter. Adjust call to set_target.
5880 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
5881 an elfcpp::Ehdr as parameter.
5882 * object.cc (Object::set_target): Remove the version that looks up
5883 a target and sets it.
5884 (Sized_relobj::setup): Take a Target object instead of
5885 an elfcpp::Ehdr as parameter. Adjust call to set_target.
5886 (make_elf_sized_object): Find target and ask target to
5887 make an ELF object.
5888 * object.h: (Object::set_target): Remove the version that looks up
5889 a target and sets it.
5890 (Sized_relobj::setup): Take a Target object instead of
5891 an elfcpp:Ehdr as parameter.
5892 * target.cc: Include dynobj.h.
5893 (Target::do_make_elf_object_implementation): New.
5894 (Target::do_make_elf_object): New.
5895 * target.h (Target::make_elf_object): New template declaration.
5896 (Target::do_make_elf_object): New method declarations.
5897 (Target::do_make_elf_object_implementation): New template declaration.
5898
cc70f101
ILT
58992009-08-14 Ian Lance Taylor <iant@google.com>
5900
5901 * gold.h (FUNCTION_NAME): Define.
5902 (gold_unreachable): Use FUNCTION_NAME.
5903
ef5e0cb1
ST
59042009-08-12 Sriraman Tallam <tmsriram@google.com>
5905
5906 * icf.cc (Icf::find_identical_sections): Issue a warning when a
5907 symbol in the --keep-unique list is not found.
5908
48c187ce
ST
59092009-08-12 Sriraman Tallam <tmsriram@google.com>
5910
5911 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
5912 been maked as --keep-unique.
5913 (Icf::unfold_section): New function.
5914 * icf.h (Icf::unfold_section): New function.
5915 * options.h (General_options::keep_unique): New option.
5916 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
5917 * testsuite/Makefile.in: Regenerate.
5918 * testsuite/icf_keep_unique_test.sh: New file.
5919 * testsuite/icf_keep_unique_test.cc: New file.
5920
645afe0c
CC
59212009-08-12 Cary Coutant <ccoutant@google.com>
5922
5923 PR 10471
5924 * resolve.cc (Symbol_table::resolve): Check for references from
5925 dynamic objects to hidden and internal symbols.
5926 * testsuite/Makefile.am (hidden_test.sh): New test.
5927 * testsuite/Makefile.in: Regenerate.
5928 * testsuite/hidden_test.sh: New script.
5929 * testsuite/hidden_test_1.c: New test source.
5930 * testsuite/hidden_test_main.c: New test source.
5931
11af873f
DK
59322009-08-11 Doug Kwan <dougkwan@google.com>
5933
5934 * arm.cc: Update comments.
5935 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
5936 segment to locate the .ARM.exidx section if present.
5937
b9f7d72d
DK
59382009-08-09 Doug Kwan <dougkwan@google.com>
5939
5940 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
5941 patch.
5942
ddd3c53c
ST
59432009-08-07 Sriraman Tallam <tmsriram@google.com>
5944 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
5945 compiler warnings.
5946
27721062
ST
59472009-08-06 Sriraman Tallam <tmsriram@google.com>
5948
5949 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
5950 valid tls_segment only for non-debug-section relocations.
5951 * testsuite/Makefile.am: Add gc_tls_test.
5952 * testsuite/Makefile.in: Regenerate.
5953 * testsuite/gc_tls_test.cc: New file.
5954 * testsuite/gc_tls_test.sh: New file.
5955
ef15dade 59562009-08-05 Sriraman Tallam <tmsriram@google.com>
e1df38aa 5957
ef15dade
ST
5958 * icf.cc: New file.
5959 * icf.h: New file.
5960 * Makefile.am (CCFILES): Add icf.cc.
5961 (HFILES): Add icf.h
5962 * Makefile.in: Regenerate.
5963 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
5964 * gc.h (gc_process_relocs): Populate lists used by icf to contain
5965 section, symbol and addend information for the relocs.
5966 * gold.cc (queue_middle_tasks): Call identical code folding.
5967 * gold.h: Add defines for multimap.
5968 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
5969 to the call of finalize_local_symbols.
5970 * main.cc (main): Create object of class Icf.
5971 * object.cc (Sized_relobj::do_layout): Allow this function to be
5972 called twice during icf.
5973 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
5974 to sections marked as identical by icf.
5975 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
5976 when available.
5977 (Sized_relobj::do_section_entsize): New function.
5978 * object.h (Object::section_entsize): New function.
5979 (Object::do_section_entsize): New pure virtual function.
5980 (Relobj::finalize_local_symbols): Add new parameter.
5981 (Relobj::do_section_entsize): New function.
5982 * options.h (General_options::icf): New option.
5983 (General_options::icf_iterations): New option.
5984 (General_options::print_icf_sections): New option.
5985 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
5986 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
5987 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
5988 icf.
5989 * symtab.cc (Symbol_table::is_section_folded): New function.
5990 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
5991 to sections marked as identical by icf.
5992 * symtab.h (Symbol_table::set_icf): New function.
5993 (Symbol_table::icf): New function.
5994 (Symbol_table::is_section_folded): New function.
5995 (Symbol_table::icf_): New data member.
5996 * target-reloc.h (relocate_section): Ignore sections folded by icf.
5997 * testsuite/Makefile.am: Add commands to build icf_test.
5998 * testsuite/Makefile.in: Regenerate.
5999 * testsuite/icf_test.sh: New file.
6000 * testsuite/icf_test.cc: New file.
6001
c3b65ac4
CD
60022009-07-24 Chris Demetriou <cgd@google.com>
6003
6004 * layout.cc (is_compressible_debug_section): Fix incorrect
6005 comment about compressed section names.
6006
1caf2c51
ILT
60072009-07-20 Ian Lance Taylor <ian@airs.com>
6008
6009 PR 10419
6010 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
6011
1ef4d87f
ILT
60122009-07-16 Ian Lance Taylor <iant@google.com>
6013
6014 PR 10400
6015 * layout.h: #include <map>.
6016 (class Kept_section): Change from struct to class. Add accessors
6017 and setters. Add section size to Comdat_group mapping. Change
6018 Comdat_group to std::map. Add is_comdat_ field. Add
6019 linkonce_size field in union.
6020 (class Layout): Update declaration of find_or_add_kept_section.
6021 Don't declare find_kept_object.
6022 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
6023 parameter. Add object, shndx, is_comdat, and is_group_name
6024 parameters. Change all callers. Adjust for new Kept_section.
6025 (Layout::find_kept_object): Remove.
6026 * object.cc (Sized_relobj::include_section_group): Update use of
6027 Kept_section. Rename secnum to shndx. Only record
6028 Kept_comdat_section if sections are the same size.
6029 (Sized_relobj::include_linkonce_section): Update use of
6030 Kept_section. Only record Kept_comdat_section if sections are the
6031 same size. Set size of linkonce section.
6032 (Sized_relobj::map_to_kept_section): Update call to
6033 get_kept_comdat_section.
6034 * object.h (class Sized_relobj): Rename fields in
6035 Kept_comdat_section to drop trailing underscores; change object
6036 field to Relobj*. Change Kept_comdat_section_table to store
6037 struct rather than pointer.
6038 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
6039 Add kept_object and kept_shndx parameters. Change all callers.
6040 (Sized_relobj::get_kept_comdat_section): Change return type to
6041 bool. Add kept_object and kept_shndx parameters. Change all
6042 callers.
6043 * plugin.cc (Pluginobj::include_comdat_group): Update call to
6044 Layout::find_or_add_kept_section.
6045
37c3b7b0
ILT
60462009-07-09 Ian Lance Taylor <iant@google.com>
6047
6048 * merge.cc (Object_merge_map::initialize_input_to_output_map):
6049 Reserve space in the hash table.
6050
98fa85cb
ILT
60512009-07-06 Mikolaj Zalewski <mikolajz@google.com>
6052
6053 * fileread.cc (File_read::get_mtime): New method.
6054 * fileread.h (Timespec): New structure.
6055 (File_read::get_mtime): New method.
6056 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
6057 Renamed from timestamp_nsec.
6058 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
6059 Elf_Xword.
e1df38aa 6060 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
98fa85cb 6061 timestamp_nsec.
e1df38aa 6062 (Incremental_inputs::report_archive): Save mtime; style fix.
98fa85cb
ILT
6063 (Incremental_inputs::report_obejct): Save mtime; style fix.
6064 (Incremental_inputs::report_script): Save mtime; style fix.
6065 (Incremental_inputs::finalize_inputs): Style fix.
6066 (Incremental_inputs::finalize): Style fix.
6067 (Incremental_inputs::create_input_section_data): Store inputs
6068 mtime.
6069 * incremental.h (Incremental_inputs::report_script): Add mtime
6070 argument.
6071 (Incremental_inputs::Input_info::Input_info): Intialize only one
6072 union member.
6073 (Incremental_inputs::Input_info::archive): Move to nameless
6074 union.
6075 (Incremental_inputs::Input_info::obejct): Move to nameless union.
6076 (Incremental_inputs::Input_info::script): Move to nameless union.
6077 (Incremental_inputs::mtime): New field.
6078 * script.cc (read_input_script): Pass file mtime to
6079 Incremental_input.
6080 * script.h (Script_info::inputs): Style fix.
6081
c9d70757
ILT
60822009-07-01 Ian Lance Taylor <ian@airs.com>
6083
6084 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
6085 instead of 32.
6086
9c547ec3
ILT
60872009-06-24 Ian Lance Taylor <iant@google.com>
6088
6089 PR 10156
6090 * layout.cc (Layout::choose_output_section): If we find an
6091 existing section, update the flags.
6092 (Layout::create_notes): New function, broken out of
6093 Layout::finalize.
6094 (Layout::finalize): Don't create note sections.
6095 (Layout::create_note): Don't crash if linker script discards
6096 section.
6097 (Layout::create_gold_note): Likewise.
6098 (Layout::create_build_id): Likewise. Don't set
6099 after_input_sections on the section.
6100 (Layout::create_executable_stack_info): Remove target parameter.
6101 Change caller.
6102 * layout.h (class Layout): Declare create_notes. Update
6103 declaration of create_executable_stack_info.
6104 * gold.cc (queue_middle_tasks): Call create_notes.
6105 * output.cc (Output_section::update_flags_for_input_section): Move
6106 here from output.h. If SHF_ALLOC flag is newly set, mark address
6107 invalid.
6108 * output.h (Output_data::mark_address_invalid): New function.
6109 (class Output_section): Only declare, not define,
6110 update_flags_for_input_section. Remove set_flags.
6111
55458500
ILT
61122009-06-24 Ian Lance Taylor <iant@google.com>
6113
6114 * script-sections.cc (Output_section_definition::
6115 set_section_addresses): Rename shadowing local load_address to
6116 laddr.
6117
1307d6cd
ILT
61182009-06-24 Ian Lance Taylor <iant@google.com>
6119
6120 PR 10244
6121 * reloc.cc (relocate_sections): Skip empty relocation sections.
6122
ec3f783e
ILT
61232009-06-23 Ian Lance Taylor <iant@google.com>
6124
6125 PR 10156
6126 * layout.cc (Layout::create_note): Use choose_output_section
6127 rather than make_output_section.
6128
459c9f1c
ILT
61292009-06-23 Ian Lance Taylor <iant@google.com>
6130
6131 PR 10237
6132 * options.cc (General_options::parse_V): Set printed_version_.
6133 (General_options::General_options): Initialize printed_version_.
6134 * options.h (class General_options): Add printed_version_ field.
6135 * gold.cc (queue_initial_tasks): If there are no input files,
6136 don't give a fatal error if we printed the version information.
6137 (queue_middle_tasks): If using -r with a shared object, give a
6138 fatal error rather than an ordinary error.
6139
1518dc8f
ILT
61402009-06-23 Ian Lance Taylor <iant@google.com>
6141
6142 PR 10219
6143 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
6144 (Layout::make_output_section): Set have_stabstr_section_ if we see
6145 a .stab*str section.
6146 (Layout::finalize): Call link_stabs_sections.
6147 (Layout::link_stabs_sections): New file.
6148 * layout.h (class Layout): Add have_stabstr_section_ field.
6149 Declare link_stabs_sections.
6150
3d857b98
DK
61512009-06-23 Doug Kwan <dougkwan@google.com>
6152
6153 * Makefile.am (libgold_a_LIBADD): New.
6154 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
6155 * Makefile.in: Regenerate.
6156 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
6157 * configure: Regenerate.
6158 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
6159 * fileread.cc: Include sys/state.h
6160 * gold.h: Declare memmem and strndup if found missing.
6161 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
6162
0639a6f6
ILT
61632009-06-23 Ian Lance Taylor <iant@google.com>
6164
6165 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
6166 * configure: Rebuild.
6167
8d63875c
ILT
61682009-06-23 Ian Lance Taylor <iant@google.com>
6169
6170 PR 10147
6171 * object.cc (Object::section_contents): Don't try to get a view if
6172 the section has length zero.
6173 (Object::handle_gnu_warning_section): If the section is empty, use
6174 the name of the section as the warning.
6175
f7c8a183
ILT
61762009-06-23 Ian Lance Taylor <iant@google.com>
6177
6178 PR 10133
6179 * stringpool.h (class Stringpool_template): Add optimize_ field.
6180 (Stringpool_template::set_optimize): New function.
6181 * stringpool.cc (Stringpool_template::Stringpool_template):
6182 Initialize optimize_ field.
6183 (Stringpool_template::set_string_offsets): Test local optimize
6184 fild rather than parameter.
6185 * layout.cc (Layout::Layout): Call set_optimize on the section
6186 name stringpool.
6187
e6a307ba
ILT
61882009-06-22 Ian Lance Taylor <iant@google.com>
6189
6190 PR 10030
6191 * yyscript.y: Parse TARGET.
6192 * script.cc (script_set_target): New function.
6193 * script-c.h (script_set_target): Declare.
6194 * options.cc (General_options::string_to_object_format): Rename
6195 from string_to_object_format in anonymous namespace. Change
6196 callers.
6197 * options.h (class General_options): Declare
6198 string_to_object_format.
6199
3ee173de
ILT
62002009-06-22 Ian Lance Taylor <iant@google.com>
6201
6202 * script-sections.cc (Script_sections::create_segments): Don't put
6203 program headers in a PT_LOAD segment if -n or -N.
6204
62052009-06-22 Ian Lance Taylor <iant@google.com>
e1c74d60
ILT
6206
6207 PR 10141
6208 * options.h (class General_options): Add -z lazy and -z now. Sort
6209 -z options into alphabetical order.
6210 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
6211
cd6739a1 62122009-06-21 Ian Lance Taylor <iant@google.com>
8a5e3e08
ILT
6213
6214 * layout.cc (Layout::make_output_section): Call
6215 Target::new_output_section.
6216 (Layout::attach_allocated_section_to_segment): Put large section
6217 sections in a separate load segment with the large segment flag
6218 set.
6219 (Layout::segment_precedes): Sort large data segments after other
6220 load segments.
6221 (align_file_offset): New static function.
6222 (Layout::set_segment_offsets): Use align_file_offset.
6223 * output.h (class Output_section): Add is_small_section_ and
6224 is_large_section_ fields.
6225 (Output_section::is_small_section): New function.
6226 (Output_section::set_is_small_section): New function.
6227 (Output_section::is_large_section): New function.
6228 (Output_section::set_is_large_section): New function.
6229 (Output_section::is_large_data_section): New function.
6230 (class Output_segment): Add is_large_data_segment_ field.
6231 (Output_segment::is_large_data_segment): New function.
6232 (Output_segment::set_is_large_data_segment): New function.
6233 * output.cc (Output_section::Output_section): Initialize new
6234 fields.
6235 (Output_segment::Output_segment): Likewise.
6236 (Output_segment::add_output_section): Add assertion that large
6237 data sections always go in large data segments. Force small data
6238 sections to the end of the list of data sections. Force small BSS
6239 sections to the start of the list of BSS sections. For large BSS
6240 sections to the end of the list of BSS sections.
6241 * symtab.h (class Symbol): Declare is_common_shndx.
6242 (Symbol::is_defined): Check Symbol::is_common_shndx.
6243 (Symbol::is_common): Likewise.
6244 (class Symbol_table): Define enum Commons_section_type. Update
6245 declarations. Add small_commons_ and large_commons_ fields.
6246 * symtab.cc (Symbol::is_common_shndx): New function.
6247 (Symbol_table::Symbol_table): Initialize new fields.
6248 (Symbol_table::add_from_object): Put small and large common
6249 symbols in the right list.
6250 (Symbol_table::sized_finalized_symbol): Check
6251 Symbol::is_common_shndx.
6252 (Symbol_table::sized_write_globals): Likewise.
6253 * common.cc (Symbol_table::do_allocate_commons): Allocate new
6254 common symbol lists. Don't call do_allocate_commons_list if the
6255 list is empty.
6256 (Symbol_table::do_allocate_commons_list): Remove is_tls
6257 parameter. Add comons_section_type parameter. Change all
6258 callers. Handle small and large common symbols.
6259 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
6260 Symbol::is_common_shndx.
6261 * resolve.cc (symbol_to_bits): Likewise.
6262 * target.h (Target::small_common_shndx): New function.
6263 (Target::small_common_section_flags): New function.
6264 (Target::large_common_shndx): New function.
6265 (Target::large_common_section_flags): New function.
6266 (Target::new_output_section): New function.
6267 (Target::Target_info): Add small_common_shndx, large_common_shndx,
6268 small_common_section_flags, and large_common_section_flags
6269 fields.
6270 (Target::do_new_output_section): New virtual function.
6271 * arm.cc (Target_arm::arm_info): Initialize new fields.
6272 * i386.cc (Target_i386::i386_info): Likewise.
6273 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6274 Likewise.
6275 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
6276 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
6277 (Target_x86_64::do_new_output_section): New function.
6278 * configure.ac: Define conditional MCMODEL_MEDIUM.
6279 * testsuite/Makefile.am (check_PROGRAMS): Add large.
6280 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
6281 (large_LDFLAGS): Define.
6282 * testsuite/large.c: New file.
6283 * testsuite/testfile.cc (Target_test::test_target_info):
6284 Initialize new fields.
6285 * configure, testsuite/Makefile.in: Rebuild.
6286
bb04269c
DK
62872009-06-05 Doug Kwan <dougkwan@google.com>
6288
6289 * Makefile.am (CCFILES): Add target.cc.
e1df38aa 6290 * Makefile.in: Regenerate.
bb04269c
DK
6291 * i386.cc (class Target_i386): Define new virtual method to
6292 override do_is_local_label_name in parent.
6293 * object.cc (Sized_relobj::do_count_local_symbols): Discard
6294 local symbols if --discard-locals or -X is given.
6295 * options.h (class General_options): Declare new options
6296 '--discard-locals' and '-X' for discarding locals.
6297 * target.h (class Target): Define new methods is_local_label_name.
6298 Declare new virtual method do_is_local_label_name.
6299 * target.cc: New file.
6300 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
6301 (check_SCRIPTS): Add discard_locals_test.sh.
6302 (check_DATA): Add discard_local_tests.syms.
6303 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
6304 (discard_local_tests.syms, discard_locals_test.o): New make rules.
6305 * testsuite/Makefile.in: Regenerate.
6306 * testsuite/discard_locals_test.c: New file.
6307 * testsuite/discard_locals_test.sh: Same.
6308
805bb01c
DK
63092009-06-05 Doug Kwan <dougkwan@google.com>
6310
6311 * object.cc (Sized_relobj::Sized_relobj): Initialize
6312 discarded_eh_frame_shndx_ to -1U.
6313 (Sized_relobj::do_layout): Record index of a discard .eh_frame
6314 section.
6315 (Sized_relobj::do_count_local_symbols): Skip local symbols in
6316 a discarded .eh_frame section.
6317 (Sized_relobj::do_finalize_local_symbols): Ditto.
6318 * object.h (class Sized_relobj): Declare new member
6319 discarded_eh_frame_shndx_.
6320 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
6321 (local_labels_test.o, local_labels_test): New rules.
6322 * testsuite/Makefile.in: Regenerate.
6323
1dcd334d
DK
63242009-06-04 Doug Kwan <dougkwan@google.com>
6325
6326 * layout.cc (Layout::section_name_mapping): Add mapping for
6327 special ARM sections.
6328
96d49306
DK
63292009-06-03 Doug Kwan <dougkwan@google.com>
6330
6331 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
6332 (utils::has_overflow): Same.
6333
dff16297
ILT
63342009-06-03 Ian Lance Taylor <iant@google.com>
6335
6336 * layout.cc (Layout::section_name_mapping): New array, replacing
6337 Layout::linkonce_mapping.
6338 (Layout::section_name_mapping_count): New variable, replacing
6339 Layout::linkonce_mapping_count.
6340 (Layout::linkonce_output_name): Remove.
6341 (Layout::output_section_name): Rewrite.
6342 * layout.h (class Layout): Rename Linkonce_mapping to
6343 Section_name_mapping, linkonce_mapping to section_name_mapping,
6344 linkonce_mapping_count to section_name_mapping_count. Don't
6345 declare linkonce_output_name.
6346
c121c671
DK
63472009-06-03 Doug Kwan <dougkwan@google.com>
6348
6349 * gold/arm.cc (namespace utils): New.
6350 (Target_arm::reloc_is_non_pic): Define new method.
6351 (class Arm_relocate_functions): New.
6352 (Target_arm::Relocate::relocate): Handle relocation types used by
6353 Android.
6354
07800fab
ILT
63552009-06-03 Ian Lance Taylor <iant@google.com>
6356
6357 * arm.cc (Target_arm::scan::global): Use || instead of |.
6358
c121c671
DK
63592009-06-02 Doug Kwan <dougkwan@google.com>
6360
6361 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
6362 issued_non_pic_error_.
6363 (class Target_arm::Scan): Declare new method check_non_pic.
6364 Define new method symbol_needs_plt_entry.
6365 Declare new data member issued_non_pic_error_.
6366 (class Target_arm::Relocate): Declare new method
6367 should_apply_static_reloc.
6368 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
6369 (Target_arm::Scan::check_non_pic): Define new method.
6370 (Target_arm::Scan::local): Handle a small subset of reloc types used
6371 by Android.
6372 (Target_arm::Scan::local): Same.
6373 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
6374
b19b0c6d
ILT
63752009-05-31 Mikolaj Zalewski <mikolajz@google.com>
6376
6377 * incremental.cc (Incremental_inputs::report_command_line): Filter
6378 out --incremental-* options.
6379
94cdfcff
DK
63802009-05-29 Doug Kwan <dougkwan@google.com>
6381
6382 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
6383 template class.
6384 (class Target_arm): Update comment.
6385 (Target_arm::Target_arm): Initialize new data members GOT_,
6386 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
6387 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
6388 and Target_arm::rel_dyn_section.
6389 Declare new_enum Target_arm::Got_type.
6390 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
6391 and DYNBSS_.
6392 Update commments for member do_dynsym_value.
6393 (Target_arm::got_size, Target_arm::plt_section,
6394 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
6395 new methods inside class defintion.
6396 (Target_arm::got_section): Define new method.
6397 (Target_arm::rel_dyn_section): Same.
6398 (Output_data_plt_arm): New template class.
6399 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
6400 (Output_data_plt_arm:do_adjust_output_section): Define new method.
6401 (Output_data_plt_arm::add_entry): Same.
6402 (Output_data_plt_arm::first_plt_entry): Define new
6403 static data member for PLT instruction template.
6404 (Output_data_plt_arm::plt_entry): Same.
6405 (Output_data_plt_arm::do_write): Define new method.
6406 (Target_arm::make_plt_entry): Same.
6407 (Target_arm::do_finalize_sections): Same.
6408 (Target_arm::do_dynsym_value): Same.
6409
4a657b0d
DK
64102009-05-28 Doug Kwan <dougkwan@google.com>
6411
6412 * Makefile.am (TARGETSOURCES): Add arm.cc.
6413 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
6414 * Makefile.in: Regenerate.
6415 * arm.cc: New file.
6416 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
6417
e7ae8c36
DK
64182009-05-26 Doug Kwan <dougkwan@google.com>
6419
6420 * options.cc (General_options::parse_exclude_libs). Fix a comment.
6421 (General_options::check_excluded_libs): Strip off directories in
6422 archive name before matching like GNU ld does.
6423 * testsuite/Makefile.am (MOSTLYCLEANFILES,
6424 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
6425 (exclude_libs_test_LDFLAGS): Add linker option
6426 -Wl,--exclude-libs,libexclude_libs_test_3
6427 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
6428 an explicit archive without using -l.
6429 (alt/libexclude_libs_test_3.a): New make rule.
6430 * testsuite/Makefile.in: Regenerate.
6431 * testsuite/exclude_libs_test.c : Declare lib3_default().
6432 (main): Call it.
6433 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
6434 * exclude_libs_test_3.c: New file.
6435
f12e7348
NC
64362009-05-26 Nick Clifton <nickc@redhat.com>
6437
6438 * po/id.po: New Indonesian translation.
6439 * po/gold.pot: Updated template file.
6440
4daadc0d
ST
64412009-05-22 Sriraman Tallam <tmsriram@google.com>
6442
e1df38aa 6443 * testsuite/Makefile.am: Add -ffunction-sections to compile
4daadc0d
ST
6444 gc_comdat_test files. Add -Wl,--gc-sections to build
6445 gc_comdat_test.
6446 * testsuite/Makefile.in: Regenerate.
6447 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
6448
531813ad
ST
64492009-05-21 Sriraman Tallam <tmsriram@google.com>
6450
6451 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
6452 kept comdat section was garbage collected.
6453 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
6454 * testsuite/Makefile.in: Regenerate.
6455 * testsuite/gc_comdat_test.sh: New file.
6456 * testsuite/gc_comdat_test_1.cc: New file.
6457 * testsuite/gc_comdat_test_2.cc: New file.
6458
65514900
CC
64592009-05-19 Doug Kwan <dougkwan@google.com>
6460
6461 * archive.cc (Archive::Archive): Move constructor from archive.h
6462 to here. Initialize no_export_.
6463 (Archive::get_elf_object_for_member): Set no_export flag of object.
6464 * archive.h (Archive::Archive): Move constructor body to
6465 archive.cc.
6466 (Archive::no_export): New method.
6467 (Archive::no_export_): New field.
6468 * object.h (Object::Object): Initialize no_export_ to false.
6469 (Object::no_export, Object::set_no_export): New methods.
6470 (Object::no_export_): New field.
6471 * options.cc (General_options::parse_exclude_libs): New method.
6472 (General_options::check_excluded_libs) Same.
6473 * options.h (exclude_libs): New option.
6474 (General_options::check_excluded_libs): New method declaration.
6475 (General_options::excluded_libs_): New field.
6476 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
6477 default or protected visibility if an object has no-export flag set.
6478 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
6479 (check_SCRIPTS): Add exclude_libs_test.sh.
6480 (check_DATA): Add exclude_libs_test.syms.
6481 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
6482 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
6483 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
6484 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
6485 (exclude_libs_test.syms, libexclude_libs_test_1.a,
6486 libexclude_libs_test_2.a): New rules.
6487 * testsuite/Makefile.in: Regenerate.
6488 * testsuite/exclude_libs_test.c: New file.
6489 * testsuite/exclude_libs_test.sh: Ditto.
6490 * testsuite/exclude_libs_test_1.c: Ditto.
6491 * testsuite/exclude_libs_test_2.c: Ditto.
6492
1b77ea50
ILT
64932009-05-15 Ian Lance Taylor <iant@google.com>
6494
6495 * configure.ac: Check for declarations for cases where libiberty.h
6496 checks HAVE_DECL_xxx.
6497 * configure, config.in: Rebuild.
6498
072fe7ce
ILT
64992009-05-15 Mikolaj Zalewski <mikolajz@google.com>
6500
6501 * gold.h (Incremental_argument_list): Remove (invalid) forward
6502 declaration.
6503 * incremental.cc (Incremental_inputs::report_achive): New method.
6504 (Incremental_inputs::report_object): New method.
6505 (Incremental_inputs::report_script): New method.
6506 (Incremental_inputs::finalize_inputs): New method.
6507 (Incremental_inputs::finalize): Call finalize_inputs().
6508 (Incremental_inputs::sized_create_incremental_inputs_section_data):
6509 Create inputs entries.
6510 * incremental.h (Incremental_input_type): New enum.
6511 (Incremental_inputs::Incremental_input): Initialize new fields.
6512 (Incremental_inputs::report_inputs): New method.
6513 (Incremental_inputs::report_achive): New method.
6514 (Incremental_inputs::report_object): New method.
6515 (Incremental_inputs::report_script): New method.
6516 (Incremental_inputs::finalize_inputs): New method.
6517 (Incremental_inputs::Input_info): New struct.
6518 (Incremental_inputs::Input_info_map): New typedef.
6519 (Incremental_inputs::lock_): New field.
6520 (Incremental_inputs::Inputs_): New field.
6521 (Incremental_inputs::Inputs_map): New field.
6522 * main.cc (main): Call Incremental_input::report_inputs.
6523 * options.h (Input_argument_list): Typedef moved from
6524 Input_arguments.
6525 (Input_file_group::Files): Remove, use ::Input_argument_list.
6526 (Input_file_group::Input_argument_list): Remove, use
6527 ::Input_argument_list.
6528 * plugin.cc (Plugin_manager::add_input_file): Add error in
6529 incremental build.
6530 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
6531 functions.
6532 * script.cc (read_input_script): Call
6533 Incremental_input::report_script.
6534 * script.h (Script_info): New class.
6535
b0481b0b
ILT
65362009-04-27 Ian Lance Taylor <iant@google.com>
6537
6538 * x86_64.cc (do_adjust_output_section): Set entsize to
6539 plt_entry_size.
6540
b22a5a41 65412009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
6542
6543 * output.cc (Output_file::close): After short writes, continue
6544 writing from the correct offset in the buffer being written.
6545
40fde488
CD
65462009-04-23 Chris Demetriou <cgd@google.com>
6547
6548 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
6549 * configure: Regenerate.
6550 * config.in: Regenerate.
6551 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
6552 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
6553
3ce2c28e
ILT
65542009-04-21 Mikolaj Zalewski <mikolajz@google.com>
6555
6556 * incremental.cc (Incremental_inputs_header_data): Renamed from
6557 Incremental_input_header_data.
6558 (Incremental_inputs_header_data::data_size): New field.
6559 (Incremental_inputs_header_data::put_input_file_count): Renamed
6560 from input_file_count.
6561 (Incremental_inputs_header_data::put_command_line_offset): Renamed
6562 from command_line_offset.
6563 (Incremental_inputs_header_data::put_reserved): Renamed from
6564 put_reserved.
6565 (Incremental_inputs_entry_data): Renamed from
6566 Incremental_input_entry_data.
6567 (Incremental_inputs_entry_data::data_size): New field.
6568 (Incremental_inputs::report_command_line): New method.
6569 (Incremental_inputs::finalize): New method.
6570 (Incremental_inputs::create_incremental_inputs_data): New method.
6571 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
6572 * incremental.h: New file.
6573 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
6574 (Layout::finalize): Create incremental inputs section in
6575 incremental builds.
6576 (Layout::create_incremental_info_sections): New method.
6577 * layout.h (Layout::incremental_inputs): New method.
6578 (Layout::create_incremental_info_sections): New method.
6579 (Layout::incremental_inputs_): New field.
6580 * main.cc (main): Notify Incremental_input of the command line.
6581
e55bde5e
ILT
65822009-04-01 Ian Lance Taylor <iant@google.com>
6583 Mikolaj Zalewski <mikolajz@google.com>
6584
6585 * gold.h (reserve_unordered_map): Define, three versions, one for
6586 each version of Unordered_map.
6587 * layout.cc (Layout::Layout): Remove options parameter. Add
6588 number_of_input_files parameter. Don't initialize options_.
6589 Initialize number_of_input_files_ and resized_signatures_. Move
6590 sections_are_attached_.
6591 (Layout::layout_group): Reserve space for group_signatures_.
6592 (Layout::find_or_add_kept_section): Change name parameter to be a
6593 reference. Resize signatures_ map when it gets large enough.
6594 (Layout::layout_eh_frame): Use parameters->options() instead of
6595 this->options_.
6596 (Layout::make_output_section): Likewise.
6597 (Layout::attach_allocated_section_to_segment): Likewise.
6598 (Layout::finalize, Layout::create_executable_stack): Likewise.
6599 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
6600 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
6601 * layout.h (class Layout): Update declarations. Remove options_
6602 field. Add number_of_input_files_ and resized_signatures_
6603 fields. Move sections_are_attached_ field.
6604 * main.cc (main): Pass number of input files to Layout
6605 constructor. Don't pass options.
6606
154b857c
ILT
66072009-03-30 Ian Lance Taylor <iant@google.com>
6608
6609 * ffsll.c (ffsll): Correct implementation.
6610
2f35ab9b
ILT
66112009-03-27 Ian Lance Taylor <iant@google.com>
6612
fd03461a
ILT
6613 * ffsll.c: New file.
6614 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
6615 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
6616 * ftruncate.c (ftruncate): Declare before definition.
6617 * mremap.c (mremap): Likewise.
6618 * pread.c (pread): Likewise.
6619 * configure, Makefile.in, config.in: Rebuild.
6620
2f35ab9b
ILT
6621 * mremap.c: New file.
6622 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
6623 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
6624 (mremap): Declare if HAVE_MREMAP is not defined.
6625 * configure, Makefile.in, config.in: Rebuild.
6626
33aea2fd
CC
66272009-03-27 Cary Coutant <ccoutant@google.com>
6628
6629 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
6630 position independent.
6631 * sparc.cc (Target_sparc::check_non_pic): Likewise.
6632 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
6633
6d479619
CC
66342009-03-24 Cary Coutant <ccoutant@google.com>
6635
6636 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
6637 an executable.
6638 (needs_dynamic_reloc): Likewise.
6639
afc06bb8
ILT
66402009-03-24 Ian Lance Taylor <iant@google.com>
6641
6642 * yyscript.y (file_cmd): Recognize EXTERN.
6643 (extern_name_list, extern_name_list_body): New nonterminals.
6644 * script.cc (script_add_extern): Define.
6645 * script-c.h (script_add_extern): Declare.
6646
f6060a4d
ILT
66472009-03-24 Rafael Avila de Espindola <espindola@google.com>
6648
6649 * object.cc (is_elf_object): Define.
6650 * object.h (is_elf_object): Declare.
6651 * archive.cc (Archive::get_elf_object_for_member): Call
6652 is_elf_object.
33aea2fd 6653 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 6654
26736d8e
ILT
66552009-03-24 Elliott Hughes <enh@google.com>
6656
6657 * output.cc (Output_file::map_anonymous): Define.
6658 (Output_file::map): Use map_anonymous. If the regular mmap fails,
6659 try an anonymous one. Report the size if the mmap fails.
6660 * output.h (class Output_file): Declare map_anonymous.
6661
22fd9730
ILT
66622009-03-24 Ian Lance Taylor <iant@google.com>
6663
6664 * target-select.cc (instantiate_target): Don't acquire the lock if
6665 the instantiated_target_ field has already been set.
6666
cb010894
ILT
66672009-03-23 Ian Lance Taylor <iant@google.com>
6668
7f055c20
ILT
6669 * gold-threads.h (class Initialize_lock): Define.
6670 * gold-threads.cc (class Initialize_lock_once): Define.
6671 (initialize_lock_control): New static variable.
6672 (initialize_lock_pointer): New static variable.
6673 (initialize_lock_once): New static function.
6674 (Initialize_lock::Initialize_lock): Define.
6675 (Initialize_lock::initialize): Define.
6676 * target-select.h: Include "gold-threads.h".
6677 (class Target_selector): Add lock_ and initialize_lock_ fields.
6678 Don't define instantiate_target, just declare it.
6679 * target-select.cc (Target_selector::Target_selector): Initialize
6680 new fields.
6681 (Target_selector::instantiate_target): Define.
6682 * descriptors.h: Include "gold-threads.h".
6683 (class Descriptors): Add initialize_lock_ field.
6684 * descriptors.cc (Descriptors::Descriptors): Initialize new
6685 field.
6686 (Descriptors::open): Use initialize_lock_ field
6687 * errors.h (class Errors): Add initialize_lock_ field.
6688 * errors.cc (Errors::Errors): Initialize new field.
6689 (Errors::initialize_lock): Use initialize_lock_ field.
6690 * powerpc.cc (class Target_selector_powerpc): Remove
6691 instantiated_target_ field. In do_recognize call
6692 instantiate_target rather than do_instantiate_target. In
6693 do_instantiate_target just allocate a new target.
6694 * sparc.cc (class Target_selector_sparc): Likewise.
6695
36959681
ILT
6696 * freebsd.h: New file.
6697 * i386.cc: Include "freebsd.h".
6698 (Target_i386): Derive from Target_freebsd rather than
6699 Sized_target.
6700 (Target_selector_i386): Derive from Target_selector_freebsd rather
6701 than Target_selector.
6702 * x86_64.cc: Include "freebsd.h".
6703 (Target_x86_64): Derive from Target_freebsd rather than
6704 Sized_target.
6705 (Target_selector_x86_64): Derive from Target_selector_freebsd
6706 rather than Target_selector.
6707 * target.h (class Target): Add adjust_elf_header and
6708 do_adjust_elf_header.
6709 * output.cc (Output_file_header:: do_sized_write): Call target
6710 adjust_elf_header routine.
6711 * configure.tgt: Set targ_osabi.
6712 * configure.ac: Define GOLD_DEFAULT_OSABI.
6713 * parameters.cc (Parameters::default_target): Pass
6714 GOLD_DEFAULT_OSABI to select_target.
6715 * target-select.h (class Target_selector): Make instantiate_target
6716 protected rather than private.
6717 * Makefile.am (HFILES): Add freebsd.h.
6718 * configure, Makefile.in, config.in: Rebuild.
6719
cb010894
ILT
6720 * merge.cc (do_add_input_section): Correct pend value. Change
6721 message about last entry not being null terminated from error to
6722 warning.
6723
0e879927
ILT
67242009-03-20 Mikolaj Zalewski <mikolajz@google.com>
6725
6726 * incremental.cc: New file.
6727 * Makefile.am (CCFILES): Add incremental.cc.
6728 * Makefile.in: Rebuild.
6729
41105937
PP
67302009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
6731
6732 * layout.cc (Layout::output_section_name): Preserve names
6733 of '.note.' sections.
e1df38aa 6734
60439920
ILT
67352009-03-19 Ian Lance Taylor <iant@google.com>
6736
6737 * descriptors.cc (Descriptors::open): Check that the options are
6738 valid before using them.
6739
0d371ad3
ILT
67402009-03-18 Ian Lance Taylor <iant@google.com>
6741
6742 * script-sections.h: Include <list>.
6743 (class Script_sections): Change Sections_elements from std::vector
6744 to std::list. Typedef public Elements_iterator. Add
6745 orphan_section_placement_, data_segment_align_start_, and
6746 saw_data_segment_align_ fields. Remove data_segment_align_index_
6747 field.
6748 * script-sections.cc (class Orphan_section_placement): New class.
6749 (class Sections_element): Add virtual functions is_relro and
6750 orphan_section_init. Remove virtual function place_orphan_here.
6751 (class Output_section_definition): Add is_relro and
6752 orphan_section_init. Remove place_orphan_here.
6753 (class Orphan_output_section): Likewise.
6754 (Script_sections::Script_sections): Update for field changes.
6755 (Script_sections::data_segment_align): Set saw_data_segment_align_
6756 and data_segment_align_start_, not data_segment_align_index.
6757 (Script_sections::data_segment_relro_end): Check
6758 saw_data_segment_align_. Use data_segment_align_start_ rather
6759 than data_segment_align_index_.
6760 (Script_sections::place_orphan): Rewrite to use
6761 Orphan_section_placement.
6762
9201d894
ILT
67632009-03-17 Ian Lance Taylor <iant@google.com>
6764
9c5b8369
ILT
6765 * archive.cc (Archive::add_symbols): Check for a version attached
6766 to the symbol name in the archive map.
6767 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
6768 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
6769 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
6770 (ver_test_11.a): New target.
6771 * testsuite/Makefile.in: Rebuild.
6772
9201d894
ILT
6773 * configure.ac: Check for chsize and posix_fallocate. Replace
6774 ftruncate.
6775 * ftruncate.c: New file, from gnulib.
6776 * output.cc (posix_fallocate): Define dummy version if not
6777 HAVE_POSIX_FALLOCATE.
6778 (Output_file::map): Call posix_fallocate rather than lseek and
6779 write.
6780 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
6781 * configure, Makefile.in, config.in: Rebuild.
6782
ef4ab7a8 67832009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
e1df38aa 6784
ef4ab7a8
PP
6785 * layout.h (Layout::create_note): Add section_name parameter.
6786 * layout.cc (Layout::create_note): Likewise.
6787 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
e1df38aa 6788
8c500701
ILT
67892009-03-17 Ian Lance Taylor <iant@google.com>
6790
e85b18e1
ILT
6791 * descriptors.cc: Include "options.h".
6792 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
6793 (Descriptors::open): Always use O_CLOEXEC when opening a new
6794 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
6795 then set FD_CLOEXEC.
6796
9efe6174
ILT
6797 * sparc.cc (class Target_sparc): Add has_got_section.
6798 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
6799 make sure we have a GOT section.
6800
6801 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
6802 (Target_sparc::Scan::local): Likewise.
6803 (Target_sparc::Scan::global): Likewise.
6804 (Target_sparc::Relocate::relocate): Likewise.
6805 (Target_sparc::Relocate::relocate_tls): Likewise.
6806
8c500701
ILT
6807 * symtab.cc (Symbol_table::define_default_version): New function,
6808 broken out of add_from_object.
6809 (Symbol_table::add_from_object): Call define_default_version.
6810 (Symbol_table::define_special_symbol): Add resolve_oldsym
6811 parameter. Change all callers. If the version for a symbol comes
6812 from a version script, resolve it with the symbol with the same
6813 name with no version. Also add the symbol without a version if
6814 appropriate.
6815 (do_define_in_output_data): If resolving with oldsym, don't delete
6816 sym.
6817 (do_define_in_output_segment): Likewise.
6818 (do_define_as_constant): Likewise.
6819 * symtab.h (class Symbol_table): Update declarations.
6820
f1ed28fb
ILT
68212009-03-13 Ian Lance Taylor <iant@google.com>
6822
15f8229b
ILT
6823 * readsyms.cc (Read_symbols::incompatible_warning): New function.
6824 (Read_symbols::requeue): New function.
6825 (Read_symbols::do_read_symbols): If make_elf_object fails because
6826 the target type is not configured, and the file was searched for,
6827 issue a warning and retry with the next directory.
6828 (Add_symbols::run): If the file has an incompatible format, and
6829 it was searched for, requeue the Read_symbols task. On error,
6830 release the object.
6831 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
6832 dirindex parameter to constructor. Change all callers. Declare
6833 incompatible_warning and requeue.
6834 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
6835 input_argument_ and input_group_ fields. Add them to
6836 constructor. Change all callers.
6837 (class Read_script): Add dirindex_ field. Add it to constructor.
6838 Change all callers.
6839 * archive.cc (Archive::setup): Remove input_objects parameter.
6840 Change all callers.
6841 (Archive::get_file_and_offset): Likewise.
6842 (Archive::read_all_symbols): Likewise.
6843 (Archive::read_symbols): Likewise.
6844 (Archive::get_elf_object_for_member): Remove input_objects
6845 parameter. Add punconfigured parameter. Change all callers.
6846 (Archive::add_symbols): Change return type to bool. Check return
6847 value of include_member.
6848 (Archive::include_all_members): Likewise.
6849 (Archive::include_member): Change return type to bool. Return
6850 false if first included object has incompatible target. Set
6851 included_member_ field.
6852 (Add_archive_symbols::run): If add_symbols returns false, requeue
6853 Read_symbols task.
6854 * archive.h (class Archive): Add included_member_ field.
6855 Initialize it in constructor. Add input_file and searched_for
6856 methods. Update declarations.
6857 (class Add_archive_symbols): Add dirpath_, dirindex_, and
6858 input_argument_ fields. Add them to constructor. Change all
6859 callers.
6860 * script.cc: Include "target-select.h".
6861 (class Parser_closure): Add skip_on_incompatible_target_ and
6862 found_incompatible_target_ fields. Add
6863 skip_on_incompatible_target parameter to constructor. Change all
6864 callers. Add methods skip_on_incompatible_target,
6865 clear_skip_on_incompatible_target, found_incompatible_target, and
6866 set_found_incompatible_target.
6867 (read_input_script): Add dirindex parameter. Change all callers.
6868 If parser finds an incompatible target, requeue Read_symbols
6869 task.
6870 (script_set_symbol): Clear skip_on_incompatible_target in
6871 closure.
6872 (script_add_assertion, script_parse_option): Likewise.
6873 (script_start_sections, script_add_phdr): Likewise.
6874 (script_check_output_format): New function.
6875 * script.h (read_input_script): Update declaration.
6876 * script-c.h (script_check_output_format): Declare.
6877 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
6878 (ignore_cmd): Remove OUTPUT_FORMAT.
6879 * fileread.cc (Input_file::Input_file): Add explicit this.
6880 (Input_file::will_search_for): New function.
6881 (Input_file::open): Add pindex parameter. Change all callers.
6882 * fileread.h (class Input_file): Add input_file_argument method.
6883 Declare will_search_for. Update declarations.
6884 * object.cc (make_elf_object): Add punconfigured parameter.
6885 Change all callers.
6886 * object.h (class Object): Make input_file public. Add
6887 searched_for method.
6888 (make_elf_object): Update declaration.
6889 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
6890 restart search.
6891 * dirsearch.h (class Dirsearch): Update declaration.
6892 * options.h (class General_options): Add --warn-search-mismatch.
6893 * parameters.cc (Parameters::is_compatible_target): New function.
6894 * parameters.h (class Parameters): Declare is_compatible_target.
6895 * workqueue.cc (Workqueue::add_blocker): New function.
6896 * workqueue.h (class Workqueue): Declare add_blocker.
6897
f1ed28fb
ILT
6898 * fileread.cc (Input_file::open): Remove options parameter.
6899 Change all callers.
6900 (Input_file::open_binary): Likewise.
6901 * script.cc (read_input_script): Likewise.
6902 * readsyms.h (class Read_symbols): Remove options_ field. Remove
6903 options parameter from constructor. Change all callers.
6904 (class Read_script): Likewise.
6905 * fileread.h (class Input_file): Update declarations.
6906 * script.h (read_input_script): Update declaration.
6907
34dd024a
NC
69082009-03-10 Nick Clifton <nickc@redhat.com>
6909
6910 * po/es.po: New Spanish translation.
6911
6d71b17c
CC
69122009-03-06 Cary Coutant <ccoutant@google.com>
6913
6914 * options.cc (parse_short_option): Keep dash_z from registering itself.
6915
031cdbed
ILT
69162009-03-03 Ian Lance Taylor <iant@google.com>
6917
6918 PR 9918
6919 * target-reloc.h (relocate_section): Pass output_section to
6920 relocate.
6921 * i386.cc (Target_i386::should_apply_static_reloc): Add
6922 output_section parameter. Change all callers.
6923 (Target_i386::Relocate::relocate): Add output_section parameter.
6924 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
6925 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
6926 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
6927 * testsuite/two_file_shared.sh: New script.
6928 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
6929 (check_DATA): Add two_file_shared.dbg.
6930 (two_file_shared.dbg): New target.
6931 * testsuite/Makefile.in: Rebuild.
6932
15d5fa16
ILT
69332009-03-01 Ian Lance Taylor <iant@google.com>
6934
6935 * configure.ac: Check for byteswap.h.
6936 * configure: Rebuild.
6937 * config.in: Rebuild.
6938
8a4c0b0d
ILT
69392009-03-01 Mikolaj Zalewski <mikolajz@google.com>
6940
6941 * layout.cc (Layout::find_or_add_kept_section): New function.
6942 (Layout::add_comdat): Removed.
6943 * layout.h (struct Kept_section): Move out of class Layout.
6944 Remove trailing underscores from field names. Add group_sections
6945 field. Rename group_ field to is_group. Change all uses.
6946 (class Layout): Declare find_or_add_kept_section, not add_comdat.
6947 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
6948 comdat_groups_ field.
6949 (Sized_relobj::include_section_group): Use
6950 find_or_add_kept_section and Kept_section::group_sections.
6951 (Sized_relobj::include_linkonce_section): Likewise.
6952 * object.cc (class Sized_relobj): Don't define Comdat_group or
6953 Comdat_group_table. Remove find_comdat_group and
6954 add_comdat_group. Remove comdat_groups_ field.
6955 * plugin.cc (include_comdat_group): Use
6956 Layout::find_or_add_kept_section.
6957
b4ecf66b
ILT
69582009-02-28 Ian Lance Taylor <iant@google.com>
6959
14359ca0
ILT
6960 * README: --gc-sections and map files are now supported. Document
6961 some build requirements.
6962
b4ecf66b
ILT
6963 PR 6992
6964 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
6965 relocatable link set the value of the section symbol to zero.
6966 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
6967 relocatable link don't include the section address in the local
6968 symbol value.
6969
0602e05a
ILT
69702009-02-27 Ian Lance Taylor <iant@google.com>
6971
fd9d194f
ILT
6972 PR 6811
6973 * options.h (class Search_directory): Add is_system_directory.
6974 (class General_options): Declare is_in_system_directory.
6975 * options.cc (get_relative_sysroot): Make static.
6976 (get_default_sysroot): Make static.
6977 (General_optoins::is_in_system_directory): New function.
6978 * fileread.cc (Input_file::is_in_system_directory): New function.
6979 * fileread.h (class Input_file): Declare is_in_system_directory.
6980 * object.h (class Object): Add is_in_system_directory.
6981 (class Input_objects): Remove system_library_directory_ field.
6982 * object.cc (Input_objects::add_object): Don't set
6983 system_library_directory_.
6984 (input_objects::found_in_system_library_directory): Remove.
6985 * symtab.cc (Symbol_table::write_globals): Remove input_objects
6986 parameter. Change all callers.
6987 (Symbol_table::sized_write_globals): Likewise.
6988 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
6989 Call Object::is_in_system_directory.
6990 * symtab.h (class Symbol_table): Update declarations.
6991
61edd21f
ILT
6992 PR 5990
6993 * descriptors.h (Open_descriptor): Add is_on_stack field.
6994 * descriptors.cc (Descriptors::open): If the descriptor is on the
6995 top of the stack, remove it. Initialize is_on_stack field.
6996 (Descriptors::release): Only add pod to stack if it is not on the
6997 stack already.
6998 (Descriptors::close_some_descriptor): Clear stack_next and
6999 is_on_stack fields.
7000
e29e076a
ILT
7001 PR 7091
7002 * output.cc (Output_section::find_starting_output_address): Rename
7003 from starting_output_address; add PADDR parameter; change return
7004 type.
7005 * output.h (class Output_section): Declare
7006 find_starting_output_address instead of starting_output_address.
7007 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
7008 section symbol for which we can't find a merge section.
7009
0602e05a
ILT
7010 PR 9836
7011 * symtab.cc (Symbol_table::add_from_object): If the visibility is
7012 hidden or internal, force the symbol to be local.
7013 * resolve.cc (Symbol::override_visibility): Define.
7014 (Symbol::override_base): Use override_visibility.
7015 (Symbol_table::resolve): Likewise.
7016 (Symbol::override_base_with_special): Likewise.
7017 (Symbol_table::override_with_special): If the visibility is hidden
7018 or internal, force the symbol to be local.
7019 * symtab.h (class Symbol): Add set_visibility and
7020 override_visibility.
7021 * testsuite/ver_test_1.sh: New file.
7022 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
7023 (check_DATA): Add ver_test_1.syms.
7024 (ver_test_1.syms): New target.
7025 * testsuite/Makefile.in: Rebuild.
7026
401a9a73
CC
70272009-02-25 Cary Coutant <ccoutant@google.com>
7028
7029 * layout.cc (Layout::choose_output_section): Don't rename sections
7030 when using a linker script that has a SECTIONS clause.
7031 * Makefile.in: Regenerate.
7032
7033 * testsuite/Makefile.am (script_test_5.sh): New test case.
7034 * testsuite/Makefile.in: Regenerate.
7035 * testsuite/script_test_5.cc: New file.
7036 * testsuite/script_test_5.sh: New file.
7037 * testsuite/script_test_5.t: New file.
7038
f488e4b0
CC
70392009-02-13 Rafael Avila de Espindola <espindola@google.com>
7040
7041 * archive.cc (Archive::include_member): Update calls to add_symbols.
7042 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
7043 the Layout argument.
7044 * dynobj.h (do_add_symbols): Add the Layout argument.
7045 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
7046 Layout argument.
7047 * object.h (Object::add_symbols): Add the Layout argument.
7048 (Object::do_add_symbols): Add the Layout argument.
7049 (Sized_relobj::do_add_symbols): Add the Layout argument.
7050 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
7051 Unify the two versions.
7052 (Add_plugin_symbols): Remove.
7053 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
7054 (Sized_pluginobj::do_add_symbols): Unify the two versions.
7055 (Add_plugin_symbols): Remove.
7056 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
7057 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
7058 (Add_symbols::run): Make it work with Pulginobj.
7059
89dd1680
ILT
70602009-02-06 Ian Lance Taylor <iant@google.com>
7061
7062 * object.cc (Sized_relobj::do_layout): Make info message start
7063 with lower case letter.
7064
266d0a74
ILT
70652009-02-06 Mikolaj Zalewski <mikolajz@google.com>
7066
602b464e
ILT
7067 * binary.cc: Fix file comment.
7068
266d0a74
ILT
7069 * options.h (enum Incremental_disposition): Define.
7070 (class General_options): Add new options: --incremental,
7071 --incremental_changed, --incremental_unchanged,
7072 --incremental_unknown. Add incremental_disposition_ and
7073 implicit_incremental_ fields.
7074 (General_options::incremental_disposition): New function.
7075 (class Position_dependent_options): Add incremental_disposition
7076 option.
7077 (Position_dependent_options::copy_from_options): Set incremental
7078 dispositions.
7079 * options.cc (General_options::parse_incremental_changed): New
7080 function.
7081 (General_options::parse_incremental_unchanged): New function.
7082 (General_options::parse_incremental_unknown): New function.
7083 (General_options::General_options): Initialize new fields
7084 incremental_disposition_ and implicit_incremental_.
7085 (General_options::finalize): Check for uasge of --incremental-*
7086 without --incremental.
7087
f073bbf7
CD
70882009-02-06 Chris Demetriou <cgd@google.com>
7089
7090 * gold.h (gold_undefined_symbol): Change to take only a Symbol
7091 pointer and to report location as the file name associated with
7092 the symbol.
7093 (gold_undefined_symbol_at_location): New function to replace the
7094 old gold_undefined_symbol functionality.
7095 * target-reloc.h (relocate_section): Update to use
7096 gold_undefined_symbol_at_location.
7097 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
7098 Call gold_undefined_symbol function rather than gold_error.
7099 * errors.h (Errors::undefined_symbol): Take location as a
7100 string, rather than calculating it from a relocation.
7101 * errors.cc (Errors::fatal): Print "fatal error:" before the
7102 formatted message.
7103 (Errors::error, Errors::error_at_location): Print "error: "
7104 before the formatted message.
7105 (Errors::undefined_symbol): Take location as a string, rather
7106 than calculating it from a relocation.
7107 (gold_undefined_symbol_at_location): New function akin to
7108 old gold_undefined_symbol, calculates location from relocation.
7109 (gold_undefined_symbol): Change to take only a Symbol pointer
7110 and to report location as the file name associated with the symbol.
7111 * testsuite/debug_msg.sh: Update for changed error messages.
7112 * testsuite/undef_symbol.sh: Likewise.
7113
8e94a90c
ILT
71142009-02-04 Duncan Sands <baldrick@free.fr>
7115
7116 PR 9812
7117 * reduced_debug_output.h
7118 (Output_reduced_debug_abbrev_section::failed): Use format for
7119 gold_warning.
7120 (Output_reduced_debug_info_section::faild): Likewise.
7121
88a0e15b
ILT
71222009-01-31 Mikolaj Zalewski <mikolajz@google.com>
7123
7124 * script.cc (Lazy_demangler): New class.
7125 (Version_script_info::get_symbol_version_helper): Demangle a
7126 symbol only once.
7127
5efc7cd2
CC
71282009-01-29 Cary Coutant <ccoutant@google.com>
7129
7130 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
7131 to __tls_get_addr.
7132 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7133
e0ebcf42
ILT
71342009-01-28 Ian Lance Taylor <iant@google.com>
7135
5efc7cd2 7136 * version.cc (version_string): Bump to 1.9.
75fe7426 7137
e0ebcf42
ILT
7138 * gold.h: Include <cstring> and <stdint.h>.
7139 * version.cc: Include <cstdio>.
7140 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
7141 warning.
7142 * reduced_debug_output.cc (insert_into_vector): Rename from
7143 Insert_into_vector; change all callers. Use Swap_unaligned to
7144 avoid aliasing issue; remove union since it is unnecessary.
7145
8e2813be 71462009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
7147
7148 * Makefile.am (CCFILES): Add gc.cc.
7149 (HFILES): Add gc.h.
7150 * Makefile.in: Regenerate.
7151 * gold.cc (Gc_runner): New class.
7152 (queue_initial_tasks): Call garbage collection related tasks
7153 when corresponding options are invoked.
7154 (queue_middle_gc_tasks): New function.
7155 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
7156 processed early before laying out sections during garbage collection.
7157 * gold.h (queue_middle_gc_tasks): New function.
7158 (is_prefix_of): Move from "layout.cc".
7159 * i386.cc (Target_i386::gc_process_relocs): New function.
7160 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
7161 * main.cc (main): Create object of class "Garbage_collection".
7162 * object.cc (Relobj::copy_symbols_data): New function.
7163 (Relobj::is_section_name_included): New function.
e1df38aa
NC
7164 (Sized_relobj::do_layout): Allow this function to be called twice
7165 during garbage collection and defer layout of section during the
6d03d481
ST
7166 first call.
7167 * object.h (Relobj::get_symbols_data): New function.
7168 (Relobj::is_section_name_included): New function.
7169 (Relobj::copy_symbols_data): New function.
7170 (Relobj::set_symbols_data): New function.
7171 (Relobj::get_relocs_data): New function.
7172 (Relobj::set_relocs_data): New function.
7173 (Relobj::is_output_section_offset_invalid): New pure virtual function.
7174 (Relobj::gc_process_relocs): New function.
7175 (Relobj::do_gc_process_relocs): New pure virtual function.
7176 (Relobj::sd_): New data member.
7177 (Sized_relobj::is_output_section_offset_invalid): New function.
7178 (Sized_relobj::do_gc_process_relocs): New function.
7179 * options.h (General_options::gc_sections): Modify to not be a no-op.
7180 (General_options::print_gc_sections): New option.
7181 * plugin.cc (Plugin_finish::run): Remove function call to
7182 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
7183 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
7184 * reloc.cc (Read_relocs::run): Add task to process relocs and
7185 determine unreferenced sections when doing garbage collection.
7186 (Gc_process_relocs): New class.
7187 (Sized_relobj::do_gc_process_relocs): New function.
7188 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
7189 sections that are garbage collected.
7190 * reloc.h (Gc_process_relocs): New class.
7191 * sparc.cc (Target_sparc::gc_process_relocs): New function.
7192 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
7193 symbols whose corresponding sections are garbage collected.
7194 (Symbol_table::Symbol_table): Add new parameter for the garbage
7195 collection object.
7196 (Symbol_table::gc_mark_undef_symbols): New function.
7197 (Symbol_table::gc_mark_symbol_for_shlib): New function.
7198 (Symbol_table::gc_mark_dyn_syms): New function.
7199 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
7200 as garbage.
7201 (Symbol_table::add_from_object): Likewise.
7202 (Symbol_table::add_from_relobj): When building shared objects, do not
7203 treat externally visible symbols as garbage.
7204 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
7205 table information for static and relocatable links.
7206 * symtab.h (Symbol_table::set_gc): New function.
7207 (Symbol_table::gc): New function.
7208 (Symbol_table::gc_mark_undef_symbols): New function.
7209 (Symbol_table::gc_mark_symbol_for_shlib): New function.
7210 (Symbol_table::gc_mark_dyn_syms): New function.
7211 (Symbol_table::gc_): New data member.
e1df38aa 7212 * target.h (Sized_target::gc_process_relocs): New pure virtual
6d03d481
ST
7213 function.
7214 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
7215 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
7216
3b293544
CF
72172009-01-20 Chris Faylor <me.sourceware@sourceware.org>
7218
7219 * options.h (General_options::gc_sections): Define as a no-op for now.
7220 (General_options::no_keep_memory): Ditto.
7221 (General_options::Bshareable): Define.
7222 * options.cc (General_options::finalize): Honor -Bshareable.
7223
83d22aa8
AS
72242009-01-20 Andreas Schwab <schwab@suse.de>
7225
7226 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
7227 read the value in the contents, since we don't use it. Use the
7228 template endianness when writing.
7229 (Relocate::relocate): Use it for R_PPC_REL16_HA.
7230
cd536b21
AS
72312009-01-19 Andreas Schwab <schwab@suse.de>
7232
7233 * configure.tgt (powerpc64-*): Fix targ_obj.
7234
99e9a495
ILT
72352009-01-15 Ian Lance Taylor <iant@google.com>
7236
7237 * object.cc (Sized_relobj::write_local_symbols): Don't write out
7238 local symbols when stripping all symbols.
7239
bbbfea06
CC
72402009-01-14 Cary Coutant <ccoutant@google.com>
7241
99e9a495 7242 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 7243
0f7c0701
CC
72442009-01-14 Cary Coutant <ccoutant@google.com>
7245
7246 * archive.cc (Archive::get_elf_object_for_member): Remove call
7247 to File_read::claim_for_plugin.
7248 * descriptors.cc (Descriptors::open): Remove reference to
7249 is_claimed.
7250 (Descriptors::claim_for_plugin): Remove.
7251 * descriptors.h (Descriptors::claim_for_plugin): Remove.
7252 (Descriptors::is_claimed): Remove.
7253 (claim_descriptor_for_plugin): Remove.
7254 * fileread.cc (File_read::claim_for_plugin): Remove.
7255 * fileread.h (File_read::claim_for_plugin): Remove.
7256 (File_read::descriptor): Reopen descriptor if necessary.
7257 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
7258 (Plugin_manager::all_symbols_read): Add task parameter. Change
7259 all callers.
7260 (Plugin_manager::get_input_file): New function.
7261 (Plugin_manager::release_input_file): New function.
7262 (Pluginobj::Pluginobj): Add filesize parameter and initialize
7263 corresponding data member.
7264 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
7265 and pass to base constructor. Change all callers.
7266 (get_input_file, release_input_file): New functions.
7267 (make_sized_plugin_object): Add filesize parameter. Change all callers.
7268 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
7269 (Plugin_manager::all_symbols_read): Add task parameter.
7270 (Plugin_manager::get_input_file): New function.
7271 (Plugin_manager::release_input_file): New function.
7272 (Plugin_manager::task_): New data member.
7273 (Pluginobj::Pluginobj): Add filesize parameter.
7274 (Pluginobj::filename): New function.
7275 (Pluginobj::descriptor): New function.
7276 (Pluginobj::filesize): New function.
7277 (Pluginobj::filesize_): New data member.
7278 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
7279 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
7280 File_read::claim_for_plugin; use Object::unlock to unlock the file.
7281
7282 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
7283 with archive libraries.
7284 * testsuite/Makefile.in: Regenerate.
7285 * testsuite/plugin_test.c (struct sym_info): New type.
7286 (get_input_file, release_input_file): New static variables.
7287 (onload): Capture new transfer vector entries.
7288 (claim_file_hook): Stop reading at end of file according to filesize.
7289 Factor out parsing of readelf output into separate function.
7290 (all_symbols_read_hook): Exercise get_input_file and release_input_file
7291 APIs and get the source file name from the symbol table. Convert
7292 source file name to corresponding object file name. Print info
7293 message when adding new input files.
7294 (parse_readelf_line): New function.
7295 * testsuite/plugin_test_1.sh: Add checks for new info messages.
7296 * testsuite/plugin_test_2.sh: Likewise.
7297 * testsuite/plugin_test_3.sh: Likewise.
7298 * testsuite/plugin_test_4.sh: New test case.
7299
62a6d109
ILT
73002009-01-07 Ian Lance Taylor <iant@google.com>
7301
7302 * version.cc (version_string): Bump to 1.8.
7303
483620e8
CC
73042008-12-23 Cary Coutant <ccoutant@google.com>
7305
7306 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
7307 * plugin.cc (Plugin_manager::finish): Rename as
7308 layout_deferred_objects. Move cleanup to separate function.
7309 (Plugin_manager::cleanup): New function.
7310 (Plugin_finish::run): Call layout_deferred_objects and cleanup
7311 separately.
7312 * plugin.h (Plugin_manager::finish): Rename as
7313 layout_deferred_objects.
7314 (Plugin_manager::cleanup): New function.
7315 (Plugin_manager::cleanup_done): New field.
7316
d66a9eb3
CC
73172008-12-23 Cary Coutant <ccoutant@google.com>
7318
7319 * plugin.cc (is_visible_from_outside): New function.
7320 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
7321 so we don't return "IR only" status for exported symbols or -r links.
7322
7323 * testsuite/Makefile.am (plugin_test_3): New test case.
7324 * testsuite/Makefile.in: Regenerate.
7325 * testsuite/plugin_test_3.sh: New file.
7326
5995b570
CC
73272008-12-22 Cary Coutant <ccoutant@google.com>
7328
7329 * object.cc (Sized_relobj::layout_section): New function.
7330 (Sized_relobj::do_layout): Defer layout of input sections until after
7331 plugin has provided replacement files.
7332 (Sized_relobj::do_layout_deferred_sections): New function.
7333 * object.h (Relobj::set_section_offset): Remove virtual keyword.
7334 (Relobj::layout_deferred_sections): New function.
7335 (Relobj::do_layout_deferred_sections): New function.
7336 (Sized_relobj::do_layout_deferred_sections): New function.
7337 (Sized_relobj::layout_section): New function.
7338 (Sized_relobj::Deferred_layout): New structure.
7339 (Sized_relobj::deferred_layout_): New field.
7340 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
7341 Change all callers. Layout deferred sections.
7342 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
7343 references.
7344 (Plugin_hook::run): Move code from do_plugin_hook inline.
7345 (Plugin_hook::do_plugin_hook): Remove.
7346 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
7347 (Plugin_manager::finish): Renamed, was cleanup.
7348 (Plugin_manager::should_defer_layout): New function.
7349 (Plugin_manager::add_deferred_layout_object): New function.
7350 (Plugin_manager::Deferred_layout_list): New type.
7351 (Plugin_manager::deferred_layout_objects_): New field.
7352 (Plugin_hook::do_plugin_hook): Remove.
7353
ee769c88
ILT
73542008-12-17 Ian Lance Taylor <iant@google.com>
7355
7356 * options.h (class General_options): Add --no case for
7357 --export-dynamic.
7358
abc8dcba
CC
73592008-12-16 Cary Coutant <ccoutant@google.com>
7360
7361 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
7362 vector.
7363 (Plugin_manager::claim_file): Create plugin object even if
7364 plugin did not call the add_symbols callback.
7365 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
7366 asking for more symbols than were added.
7367 * testsuite/Makefile.am (plugin_test_1): Add test case with
7368 no global symbols.
7369 (empty.syms): New target.
7370 * testsuite/Makefile.in: Regenerate.
7371 * testsuite/plugin_test.c (claim_file_hook): Add new debug
7372 message. Don't call add_symbols if no globals.
7373 (all_symbols_read_hook): Don't provide replacement for empty
7374 claimed file.
7375
b0074644
ILT
73762008-12-12 Ian Lance Taylor <iant@google.com>
7377
68943102
ILT
7378 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
7379 r_type == 0 for a local symbol with r_sym == 0.
7380 (scan_relocatable_relocs): Pass r_sym to
7381 local_non_section_strategy.
7382 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
7383 r_sym parameter.
7384
b0074644
ILT
7385 * configure.ac: Update test for TLS descriptors: they are
7386 supported as of glibc 2.9.
7387 * configure: Rebuild.
7388
c2508178
ILT
73892008-12-11 Ian Lance Taylor <iant@google.com>
7390
7391 PR 7091
7392 * target-reloc.h (Default_scan_relocatable_relocs): For each
7393 function, map r_type == 0 to RELOC_DISCARD.
7394
2756a258
CC
73952008-12-10 Cary Coutant <ccoutant@google.com>
7396
7397 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
7398 object to override a kept COMDAT group from a plugin object.
7399
bb6f53d3
ILT
74002008-12-09 Ian Lance Taylor <iant@google.com>
7401
fbc558e1
ILT
7402 PR 7088
7403 * yyscript.y (file_cmd): Handle INPUT.
7404
bb6f53d3
ILT
7405 * testsuite/initpri1.c: Change all declarations to be full
7406 prototypes by adding void, to avoid compiler warnings.
7407
4674ecfc
CC
74082008-12-05 Rafael Avila de Espindola <espindola@google.com>
7409
7410 * options.cc (General_options::parse_plugin_opt): New.
7411 (General_options::add_plugin): The argument now is just the filename.
7412 (General_options::add_plugin_option): New.
7413 * options.h (plugin_opt): New.
7414 (add_plugin): Change argument name.
7415 (add_plugin_option): New.
7416 * plugin.cc (Plugin::load): Don't parse the plugin option.
7417 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
7418 (Plugin::add_option): New.
7419 (Plugin::args_): Change type.
7420 (Plugin::filename_): New.
7421 (Plugin_manager::add_plugin_option): New.
7422 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
7423 * testsuite/Makefile.in: Regenerate.
7424
fd06b4aa
CC
74252008-12-05 Cary Coutant <ccoutant@google.com>
7426
7427 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
7428 Handle --strip-lto-sections option.
7429 * options.h (strip_lto_sections): New option.
7430
6c52134c
CC
74312008-12-01 Cary Coutant <ccoutant@google.com>
7432
7433 * plugin.cc (ld_plugin_message): Change format parameter to const.
7434 Fix mismatch between new[] and delete.
7435
a45248e0
CC
74362008-11-14 Cary Coutant <ccoutant@google.com>
7437
7438 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
7439 instead of -1U.
7440
c82fbeee
CS
74412008-11-05 Craig Silverstein <csilvers@google.com>
7442
7443 * options.cc (General_options::parse_dynamic_list): New function.
7444 * options.h (General_options): New flags dynamic_list,
7445 dynamic_list_data, dynamic_list_cpp_new, and
7446 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
7447 (General_options::in_dynamic_list): New function.
7448 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
7449 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
7450 (Lex::can_continue_name): Likewise.
7451 (yylex): Likewise.
7452 (read_script_file): New parameter script_options.
7453 (read_dynamic_list): New function.
7454 (Script_options::define_dynamic_list): New function.
7455 (dynamic_list_keyword_parsecodes): New variable.
7456 (dynamic_list_keywords): New variable.
7457 * script.h (Script_options::define_dynamic_list): New function
7458 prototype.
7459 (read_dynamic_list): New function prototype.
7460 * symtab.cc (strprefix): New macro.
7461 (Symbol::should_add_dynsym_entry): Support dynamic_list,
7462 dynamic_list_data, dynamic_list_cpp_new, and
7463 dynamic_list_cpp_typeinfo.
7464 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
7465 (dynamic_list_expr): New rule.
7466 (dynamic_list_nodes): Likewise.
7467 (dynamic_list_node): Likewise.
7468 * testsuite/Makefile.am (dynamic_list): New test.
7469 * testsuite/Makefile.in: Regenerated.
7470 * testsuite/dynamic_list.t: New file.
7471 * testsuite/dynamic_list.sh: New file.
7472
e0bb29a5
CS
74732008-11-05 Craig Silverstein <csilvers@google.com>
7474
7475 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
7476 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
7477 (t11_last): Likewise.
7478 * testsuite/ver_test_6.c (main): Likewise.
7479
4e1e25e0
CC
74802008-10-07 Cary Coutant <ccoutant@google.com>
7481
7482 * options.c (General_options::finalize): Add check for -static and
7483 -shared.
7484 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
7485 is not empty.
7486
92f03fcb
CC
74872008-10-02 Cary Coutant <ccoutant@google.com>
7488
7489 * plugin.cc (make_sized_plugin_object): Fix conditional
7490 compilation to work when not all targets are enabled.
7491
fbd8a257
CC
74922008-09-29 Cary Coutant <ccoutant@google.com>
7493
7494 * archive.cc (Archive::get_file_and_offset): Use filename instead
7495 of name to get library path.
7496 (Archive::include_member): Unlock external member of a thin archive.
7497
7498 * testsuite/Makefile.am (TEST_AR): New variable.
7499 (thin_archive_test_1): New test.
7500 (thin_archive_test_2): New test.
81636b3f
CC
7501 * testsuite/Makefile.in: Regenerate.
7502 * testsuite/thin_archive_main.cc: New file.
7503 * testsuite/thin_archive_test_1.cc: New file.
7504 * testsuite/thin_archive_test_2.cc: New file.
7505 * testsuite/thin_archive_test_3.cc: New file.
7506 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 7507
eff45813
CC
75082008-09-29 Cary Coutant <ccoutant@google.com>
7509
7510 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
7511 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
7512 instead of -1U.
7513 (Sized_relobj::do_finalize_local_symbols): Likewise.
7514 (Sized_relobj::map_to_kept_section): Likewise.
7515 * object.h (Sized_relobj::invalid_address): New constant.
7516 (Sized_relobj::do_output_section_offset): Check for invalid_address
7517 and return -1ULL.
7518 * output.cc (Output_reloc::local_section_offset): Use constant
7519 invalid_address instead of -1U.
7520 (Output_reloc::get_address): Likewise.
7521 (Output_section::output_address): Change -1U to -1ULL.
7522 * output.h (Output_reloc::invalid_address): New constant.
7523 * reloc.cc (Sized_relobj::write_sections): Use constant
7524 invalid_address instead of -1U.
7525 (Sized_relobj::relocate_sections): Likewise.
7526 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
7527 values for merge sections.
7528 * target-reloc.h (relocate_for_relocatable): Use constant
7529 invalid_address instead of -1U.
7530
89fc3421
CC
75312008-09-19 Cary Coutant <ccoutant@google.com>
7532
7533 Add plugin functionality for link-time optimization (LTO).
7534 * configure.ac (plugins): Add --enable-plugins option.
7535 * configure: Regenerate.
7536 * config.in: Regenerate.
7537 * Makefile.am (LIBDL): New variable.
7538 (CCFILES): Add plugin.cc.
7539 (HFILES): Add plugin.h.
7540 (ldadd_var): Add LIBDL.
7541 * Makefile.in: Regenerate.
7542
7543 * archive.cc: Include "plugin.h".
7544 (Archive::setup): Don't preread archive symbols when using a plugin.
7545 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
7546 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
7547 files.
7548 (Archive::include_member): Add symbols from plugin objects.
7549 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
7550 * descriptors.cc (Descriptors::open): Check for file descriptors
7551 abandoned by plugins.
7552 (Descriptors::claim_for_plugin): New function.
7553 * descriptors.h (Descriptors::claim_for_plugin): New function.
7554 (Open_descriptor::is_claimed): New field.
7555 (claim_descriptor_for_plugin): New function.
7556 * fileread.cc (File_read::claim_for_plugin): New function.
7557 * fileread.h (File_read::claim_for_plugin): New function.
7558 (File_read::descriptor): New function.
7559 * gold.cc: Include "plugin.h".
7560 (queue_initial_tasks): Add task to call plugin hooks for generating
7561 new object files.
7562 * main.cc: Include "plugin.h".
7563 (main): Load plugin libraries.
7564 * object.h (Pluginobj): Declare.
7565 (Object::pluginobj): New function.
7566 (Object::do_pluginobj): New function.
7567 (Object::set_target): New function.
7568 * options.cc: Include "plugin.h".
7569 (General_options::parse_plugin): New function.
7570 (General_options::General_options): Initialize plugins_ field.
7571 (General_options::add_plugin): New function.
7572 * options.h (Plugin_manager): Declare.
7573 (General_options): Add --plugin option.
7574 (General_options::has_plugins): New function.
7575 (General_options::plugins): New function.
7576 (General_options::add_plugin): New function.
7577 (General_options::plugins_): New field.
7578 * plugin.cc: New file.
7579 * plugin.h: New file.
7580 * readsyms.cc: Include "plugin.h".
7581 (Read_symbols::do_read_symbols): Check for archive before checking
7582 for ELF file. Call plugin hooks to claim files.
7583 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
7584 from a real object file; force override when processing replacement
7585 files.
7586 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
7587 (Symbol::init_base_object): Likewise.
7588 (Symbol::init_base_output_data): Likewise.
7589 (Symbol::init_base_output_segment): Likewise.
7590 (Symbol::init_base_constant): Likewise.
7591 (Symbol::init_base_undefined): Likewise.
7592 (Symbol::output_section): Assert that object is not a plugin.
7593 (Symbol_table::add_from_pluginobj): New function.
7594 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
7595 undefined.
7596 (Symbol_table::sized_write_globals): Likewise.
7597 (Symbol_table::add_from_pluginobj): Instantiate template.
7598 * symtab.h (Sized_pluginobj): Declare.
7599 (Symbol::in_real_elf): New function.
7600 (Symbol::set_in_real_elf): New function.
7601 (Symbol::in_real_elf_): New field.
7602 (Symbol_table::add_from_pluginobj): New function.
7603
7604 * testsuite/Makefile.am (AM_CFLAGS): New variable.
7605 (LIBDL): New variable.
7606 (LDADD): Add LIBDL.
7607 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
7608 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
7609 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
7610 (MOSTLYCLEANFILES): Likewise.
7611 * testsuite/Makefile.in: Regenerate.
7612 * testsuite/plugin_test.c: New file.
7613 * testsuite/plugin_test_1.sh: New file.
7614 * testsuite/plugin_test_2.sh: New file.
7615
de31bda5
ILT
76162008-09-16 Ian Lance Taylor <iant@google.com>
7617
9c2d0ef9
ILT
7618 * target-reloc.h (relocate_section): Check whether a symbol is
7619 defined by the ABI before reporting an undefined symbol error.
7620 * target.h (Target::is_defined_by_abi): Make parameter const.
7621 (Target::do_is_defined_by_abi): Likewise.
7622 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
7623 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
7624 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
7625 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
7626 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
7627 * testsuite/Makefile.in: Rebuild.
7628
de31bda5
ILT
7629 * fileread.cc (make_view): Add casts to avoid warning.
7630
9fa33bee
AO
76312008-09-16 Alexandre Oliva <aoliva@redhat.com>
7632
7633 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
7634 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
7635
183fd0e3
AO
76362008-09-16 Alexandre Oliva <aoliva@redhat.com>
7637
7638 * options.h (General_options::output_is_executable): New.
7639 (General_options::output_is_pie): New.
7640 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
7641 for shared libraries.
7642 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
7643
7be8330a
CD
76442008-09-11 Chris Demetriou <cgd@google.com>
7645
7646 * options.h (origin): New -z option.
7647 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
7648 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
7649 in DT_FLAGS_1.
7650
a9caad02
CC
76512008-09-05 Cary Coutant <ccoutant@google.com>
7652
7653 * fileread.cc (File_read::make_view): Add check for attempt to map
7654 beyond end of file.
7655
ae6dce4d
CC
76562008-09-05 Cary Coutant <ccoutant@google.com>
7657
7658 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
7659 explicit instantiations.
7660
d7ab2a47
KVH
76612008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
7662
7663 PR gold/6858
7664 * options.cc (General_options::finalize): Allow undefined symbols
7665 in shlibs if linking -shared.
7666
7667 PR gold/6859
7668 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
7669 symbols as not needing a dynsym entry.
7670
1e52a9c1
CS
76712008-08-20 Craig Silverstein <csilvers@google.com>
7672
7673 * fileread.cc (File_read::open): Do not lock the file unless it
7674 was successfully opened.
7675
d85c80a3
CC
76762008-08-14 Cary Coutant <ccoutant@google.com>
7677
7678 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
7679 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
7680 * testsuite/tls_test.cc (struct int128): 128-bit struct
7681 for testing TLS relocs with non-zero addend.
7682 (v12): New TLS variable.
7683 (t12): New test.
7684 (t_last): Add check for v12.
7685 * testsuite/tls_test.h (t12): New function.
7686 * testsuite/tls_test_main.cc (thread_routine): Call new test.
7687
2d924fd9
ILT
76882008-08-13 Ian Lance Taylor <iant@google.com>
7689
7690 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
7691 set tls_segment_ or relro_segment_.
7692 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
7693 when appropriate.
7694 * output.h (Output_section::clear_is_relro): New function.
7695 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
7696 sections specially even when output_data_ is empty.
7697 (Output_segment::maximum_alignment): When first section is relro,
7698 only force alignment for PT_LOAD segments.
7699 * script.cc (script_data_segment_align): New function.
7700 (script_data_segment_relro_end): New function.
7701 * script-c.h (script_data_segment_align): Declare.
7702 (script_data_segment_relro_end): Declare.
7703 * script-sections.h (class Script_sections): Declare
7704 data_segment_align and data_segment_relro_end. Add fields
7705 segment_align_index_ and saw_relro_end_.
7706 * script-sections.cc (class Sections_element): Add set_is_relro
7707 virtual function. Add new bool* parameter to place_orphan_here.
7708 Add get_output_section virtual function.
7709 (class Output_section_definition): Add set_is_relro. Add new
7710 bool* parameter to place_orphan_here. Add get_output_section.
7711 Add is_relro_ field.
7712 (Output_section_definition::Output_section_definition): Initialize
7713 evaluated_address_, evaluated_load_address, evaluated_addralign_,
7714 and is_relro_ fields.
7715 (Output_section_definition::place_orphan_here): Add is_relro
7716 parameter.
7717 (Output_section_definition::set_section_addresses): Set relro for
7718 output section.
7719 (Output_section_definition::alternate_constraint): Likewise.
7720 (class Orphan_output_section): Add new bool* parameter to
7721 place_orphan_here. Add get_output_section.
7722 (Orphan_output_section::place_orphan_here): Add is_relro
7723 parameter.
7724 (Script_sections::Script_sections): Initialize
7725 data_segment_align_index_ and saw_relro_end_.
7726 (Script_sections::data_segment_align): New function.
7727 (Script_sections::data_segment_relro_end): New function.
7728 (Script_sections::place_orphan): Set or clear is_relro.
7729 (Script_sections::set_section_addresses): Force alignment of first
7730 TLS section.
7731 * yyscript.y (exp): Call script_data_segment_align and
7732 script_data_segment_relro_end.
7733 * testsuite/relro_script_test.t: New file.
7734 * testsuite/relro_test.cc (using_script): Declare.
7735 (t1, t2): Test using_script.
7736 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
7737 (relro_script_test_SOURCES): Define.
7738 (relro_script_test_DEPENDENCIES): Define.
7739 (relro_script_test_LDFLAGS): Define.
7740 (relro_script_test_LDADD): Define.
7741 (relro_script_test.so): New target.
7742 * testsuite/Makefile.in: Rebuild.
7743
f827c9a9
CC
77442008-08-06 Cary Coutant <ccoutant@google.com>
7745
7746 * archive.cc (Archive::total_archives, Archive::total_members)
7747 (Archive::total_members_loaded): New variables.
7748 (Archive::setup): Add parameter. Add option to preread
7749 archive symbols.
7750 (Archive::read_armap): Add counter.
7751 (Archive::get_file_and_offset): New function.
7752 (Archive::get_elf_object_for_member): New function.
7753 (Archive::read_all_symbols): New function.
7754 (Archive::read_symbols): New function.
7755 (Archive::add_symbols): Add counters.
7756 (Archive::include_all_members): Use armap to find members if it's
7757 already built.
7758 (Archive::include_member): Skip reading symbols if already read.
7759 Factored code into Archive::get_file_and_offset and
7760 Archive::get_elf_object_for_member. Changed call to
7761 Mapfile::report_include_archive_member.
7762 (Archive::print_stats): New function.
7763 * archive.h: Declare Object and Read_symbols_data classes.
7764 (Archive::Archive): Add initializers for new members.
7765 (Archive::setup): Add parameter.
7766 (Archive::print_stats): New function.
7767 (Archive::total_archives, Archive::total_members)
7768 (Archive::total_members_loaded): New variables.
7769 (Archive::get_file_and_offset): New function.
7770 (Archive::get_elf_object_for_member): New function.
7771 (Archive::read_all_symbols): New function.
7772 (Archive::read_symbols): New function.
7773 (Archive::Archive_member): New class.
7774 (Archive::members_): New member.
7775 (Archive::num_members_): New member.
7776 * main.cc: Include archive.h.
7777 (main): Call Archive::print_stats.
7778 * mapfile.cc (Mapfile::report_include_archive_member): Delete
7779 archive parameter; member_name is now the fully-decorated name.
7780 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
7781 * options.h: (General_options): Add --preread-archive-symbols option.
7782 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
7783 Archive::setup.
7784
de4c45bd
ILT
77852008-08-04 Ian Lance Taylor <iant@google.com>
7786
7787 * symtab.h (Symbol::use_plt_offset): New function.
7788 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
7789 * powerpc.cc (Relocate::relocate): Likewise.
7790 * sparc.cc (Relocate::relocate): Likewise.
7791 * x86_64.cc (Relocate::relocate): Likewise.
7792 * testsuite/weak_plt.sh: New test.
7793 * testsuite/weak_plt_main.cc: New test.
7794 * testsuite/weak_plt_shared.cc: New test.
7795 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
7796 (check_PROGRAMS): Add weak_plt.
7797 (check_DATA): Add weak_plt_shared.so.
7798 (weak_plt_main_pic.o, weak_plt): New targets.
7799 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
7800 * testsuite/Makefile.in: Rebuild.
7801
7802 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
7803 gcctestdir/ld.
7804 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
7805 * testsuite/Makefile.in: Rebuild.
7806
323ee3f4
AM
78072008-08-04 Alan Modra <amodra@bigpond.net.au>
7808
7809 * Makefile.am (POTFILES.in): Set LC_ALL=C.
7810 * Makefile.in: Regenerate.
7811 * po/POTFILES.in: Regenerate.
7812
7c07ecec
ILT
78132008-07-29 Ian Lance Taylor <iant@google.com>
7814
7815 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
7816 symbols before other symbols.
7817 * testsuite/script_test_2.cc (test_addr): Declare.
7818 (test_addr_alias): Declare.
7819 (main): Check that test_addr and test_addr_alias have the right
cd536b21 7820 values.
7c07ecec
ILT
7821 * testsuite/script_test_2.t: Define test_addr_alias and
7822 test_addr.
7823
5778530e
ILT
78242008-07-24 Ian Lance Taylor <iant@google.com>
7825
2a00e4fb
ILT
7826 PR 5990
7827 * descriptors.cc: New file.
7828 * descriptors.h: New file.
7829 * gold-threads.h (class Hold_optional_lock): New class.
7830 * fileread.cc: Include "descriptors.h".
7831 (File_read::~File_read): Release descriptor rather than closing
7832 it.
7833 (File_read::open) [file]: Call open_descriptor rather than open.
7834 Set is_descriptor_opened_.
7835 (File_read::open) [memory]: Assert that descriptor is not open.
7836 (File_read::reopen_descriptor): New function.
7837 (File_read::release): Release descriptor.
7838 (File_read::do_read): Make non-const. Reopen descriptor.
7839 (File_read::read): Make non-const.
7840 (File_read::make_view): Reopen descriptor.
7841 (File_read::do_readv): Likewise.
7842 * fileread.h (class File_read): Add is_descriptor_opened_ field.
7843 Update declarations.
7844 * layout.cc: Include "descriptors.h".
7845 (Layout::create_build_id): Use open_descriptor rather than open.
7846 * output.cc: Include "descriptors.h".
7847 (Output_file::open): Use open_descriptor rather than open.
7848 * archive.cc (Archive::const_iterator): Change Archive to be
7849 non-const.
7850 (Archive::begin, Archive::end): Make non-const.
7851 (Archive::count_members): Likewise.
7852 * archive.h (class Archive): Update declarations.
7853 * object.h (Object::read): Make non-const.
7854 * Makefile.am (CCFILES): Add descriptors.cc.
7855 (HFILES): Add descriptors.h.
7856 * Makefile.in: Rebuild.
7857
801647d1
ILT
7858 PR 6716
7859 * gold.h: Always include <clocale>. Add Solaris workarounds
7860 following code in binutils/sysdep.h.
7861
5edd166e
ILT
7862 PR 6048
7863 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
7864 this->eh_frame_hdr_ is NULL before using it.
7865
c89ad728
ILT
7866 * dynobj.cc (Versions::Versions): Update comment.
7867
aa86f06b
ILT
7868 * dynobj.cc (Versions::Versions): If there is an soname, use it as
7869 the base version name.
7870
5778530e
ILT
7871 * stringpool.cc (Stringpool_template::add_with_length): Set key to
7872 array size plus one.
7873 (Stringpool_template::set_string_offsets): Subtract one from key
7874 before using it as an array index.
7875 (Stringpool_template::get_offset_with_length): Likewise.
7876 (Stringpool_template::write_to_buffer): Likewise.
7877 * stringpool.h (Stringpool_template::get_offset_from_key):
7878 Likewise.
7879
057ead22
ILT
78802008-07-23 Ian Lance Taylor <iant@google.com>
7881
7f649c59
ILT
7882 PR 6658
7883 * object.h (Merged_symbol_value::value): Do our best to handle a
7884 negative addend.
7885
057ead22
ILT
7886 PR 6647
7887 * script.cc (Version_script_info::get_versions): Don't add empty
7888 version tag to return value.
7889 (Version_script_info::get_symbol_version_helper): Change return
7890 type to bool. Add pversion parameter. Change all callers.
7891 (script_register_vers_node): Don't require a non-NULL tag.
7892 * script.h (class Version_script_info): Update declarations.
7893 (Version_script_info::get_symbol_version): Change return type to
7894 bool. Add version parameter. Change all callers.
7895 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
7896 handling. Handle an empty version from a version script.
7897 (Symbol_table::define_special_symbol): Likewise.
7898 * testsuite/ver_test_10.script: New file.
7899 * testsuite/ver_test_10.sh: New file.
7900 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
7901 (check_DATA): Add ver_test_10.syms.
7902 (ver_test_10.syms, ver_test_10.so): New target.
7903 * testsuite/Makefile.in: Rebuild.
7904
58e54ac2
CD
79052008-07-23 Simon Baldwin <simonb@google.com>
7906
7907 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
7908 to zero for undefined symbols from dynamic libraries.
7909
95d14cd3
ILT
79102008-07-23 Ian Lance Taylor <iant@google.com>
7911
7912 * symtab.cc (Symbol_table::resolve): Remove version parameter.
7913 Change all callers.
7914 * symtab.h (class Symbol_table): Update declaration.
7915 * testsuite/ver_test_9.cc: New file.
7916 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
7917 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
7918 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
7919 (ver_test_9.so, ver_test_9.o): New targets.
7920 * testsuite/Makefile.in: Rebuild.
7921
92de84a6
ILT
79222008-07-22 Ian Lance Taylor <iant@google.com>
7923
34810851
ILT
7924 * options.h (class General_options): Define --check-sections.
7925 * layout.cc (Layout::set_segment_offsets): Handle
7926 --check-sections.
7927
af6156ef
ILT
7928 * options.h (class General_options): Define -n/--nmagic and
7929 -N/--omagic.
7930 * options.cc (General_options::finalize): For -n/--nmagic or
7931 -N/--omagic, set -static.
7932 * layout.cc (Layout::attach_allocated_section_to_segment): If
7933 -N/--omagic, don't put read-only and read-write sections in
7934 different segments.
7935 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
7936 finding a read-only segment.
7937 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
7938 don't set the minimum segment alignment to the common page size,
7939 and don't set the file offset to the address modulo the page size.
7940 * script-sections.cc (Script_sections::create_segments): If
7941 -n/--omagic, don't put read-only and read-write sections in
7942 different segments.
7943
92de84a6
ILT
7944 * cref.cc: New file.
7945 * cref.h: New file.
7946 * options.h (class General_options): Add --print-symbol-counts.
7947 * main.cc (main): Issue defined symbol report if requested.
7948 * archive.cc (Archive::interpret_header): Make into a const member
7949 function.
7950 (Archive::add_symbols): Call Input_objects::archive_start and
7951 archive_stop.
7952 (Archive::const_iterator): Define new class.
7953 (Archive::begin, Archive::end): New functions.
7954 (Archive::include_all_members): Rewrite to use iterator.
7955 (Archive::count_members): New function.
7956 * archive.h (class Archive): Update declarations.
7957 (Archive::filename): New function.
7958 * object.cc: Include "cref.h".
7959 (Sized_relobj::Sized_relobj): Initialize defined_count_.
7960 (Sized_relobj::do_get_global_symbol_counts): New function.
7961 (Input_objects::add_object): Add object to cross-referencer.
7962 (Input_objects::archive_start): New function.
7963 (Input_objects::archive_stop): New function.
7964 (Input_objects::print_symbol_counts): New function.
7965 * object.h: Declare Cref and Archive.
7966 (Object::get_global_symbol_counts): New function.
7967 (Object::do_get_global_symbol_counts): New pure virtual function.
7968 (class Sized_relobj): Add defined_count_ field. Update
7969 declarations.
7970 (class Input_objects): Add cref_ field. Update constructor.
7971 Update declarations.
7972 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
7973 defined_count_.
7974 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
7975 symbol counts.
7976 (Sized_dynobj::do_get_global_symbol_counts): New function.
7977 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
7978 defined_count_. Update declarations. Define Symbols typedef.
7979 * symtab.cc (Symbol_table::add_from_relobj): Add defined
7980 parameter. Change all callers.
7981 (Symbol_table::add_from_dynobj): Add sympointers and defined
7982 parameters. Change all callers.
7983 * symtab.h (class Symbol_table): Update declarations.
7984 * Makefile.am (CCFILES): Add cref.cc.
7985 (HFILES): Add cref.h.
7986 * Makefile.in: Rebuild.
7987
3f7c5e1d
CD
79882008-07-22 Simon Baldwin <simonb@google.com>
7989
7990 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
7991 to zero when writing undefined symbols.
7992
e0b64032
ILT
79932008-07-22 Ian Lance Taylor <iant@google.com>
7994
7995 * output.cc (Output_section::add_input_section): Don't try to
7996 merge empty merge sections.
7997
096b02cf
CS
79982008-07-21 Craig Silverstein <csilvers@google.com>
7999
8000 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8001 Include symbol version in error message.
cd536b21 8002
1d1f116d
CD
80032008-07-20 Chris Demetriou <cgd@google.com>
8004
cd536b21 8005 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
8006 (RANDOM_SEED_CFLAGS): New substituted variable.
8007 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
8008 * configure: Rebuild.
8009 * Makefile.in: Likewise.
8010 * testsuite/Makefile.in: Likewise.
8011
a18f591e
ILT
80122008-07-18 Ian Lance Taylor <iant@google.com>
8013
8014 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
8015 where we see NAME/NULL and NAME/VERSION as separate symbols.
8016 * testsuite/ver_test_main.cc (main): Call t4.
8017 (t4, t4_2a): Define.
8018 * testsuite/ver_test_2.cc (t4_2): Define.
8019 * testsuite/ver_test_2.script: Put t4_2a in VER2.
8020 * testsuite/ver_test_4.cc (t4_2a): Define.
8021 * testsuite/ver_test_4.script: Put t4_2a in VER2.
8022 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
8023
c6e3f6ed
ILT
80242008-07-17 Ian Lance Taylor <iant@google.com>
8025
8026 * dynobj.cc (Versions::add_def): If we give an error about a
8027 missing version, go ahead and create the version anyhow.
8028
ef9beddf
ILT
80292008-07-10 Ian Lance Taylor <iant@google.com>
8030
8031 Handle output sections with more than 0x7fffffff bytes.
8032 * object.h (class Relobj): Change map_to_output_ to
8033 output_sections_, and just keep a section pointer. Change all
8034 uses. Move comdat group support to Sized_relobj.
8035 (Relobj::is_section_specially_mapped): Remove.
8036 (Relobj::output_section): Remove poff parameter. Change all
8037 callers.
8038 (Relobj::output_section_offset): New function.
8039 (Relobj::set_section_offset): Rewrite.
8040 (Relobj::map_to_output): Remove.
8041 (Relobj::output_sections): New function.
8042 (Relobj::do_output_section_offset): New pure virtual function.
8043 (Relobj::do_set_section_offset): Likewise.
8044 (class Sized_relobj): Add section_offsets_ field. Add comdat
8045 group support from Relobj. Update declarations.
8046 (Sized_relobj::get_output_section_offset): New function.
8047 (Sized_relobj::do_output_section_offset): New function.
8048 (Sized_relobj::do_set_section_offset): New function.
8049 * object.cc (Relobj::output_section_address): Remove.
8050 (Sized_relobj::Sized_relobj): Initialize new fields.
8051 (Sized_relobj::include_section_group): Cast find_kept_object to
8052 Sized_relobj.
8053 (Sized_relobj::include_linkonce_section): Likewise.
8054 (Sized_relobj::do_layout): Use separate arrays for output section
8055 and output offset.
8056 (Sized_relobj::do_count_local_symbols): Change map_to_output to
8057 output_sections.
8058 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
8059 output_sections and section_offsets.
8060 (Sized_relobj::write_local_symbols): Likewise.
8061 (map_to_kept_section): Compute output address directly.
8062 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
8063 output_sections and section_offsets.
8064 (Sized_relobj::write_sections): Likewise.
8065 (Sized_relobj::relocate_sections): Likewise.
8066 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
8067 * output.h (class Output_reloc): Update declarations. Change
8068 u2_.relobj to Sized_relobj*.
8069 (class Output_data_reloc): Change add functions to use
8070 Sized_relobj*.
8071 * output.cc (Output_reloc::Output_reloc): Change relobj to
8072 Sized_relobj*.
8073 (Output_reloc::local_section_offset): Change return type to
8074 Elf_Addr. Use get_output_section_offset.
8075 (Output_reloc::get_address): Likewise.
8076 (Output_section::is_input_address_mapped): Don't call
8077 is_section_specially_mapped.
8078 (Output_section::output_offset): Likewise.
8079 (Output_section::output_address): Likewise.
8080 (Output_section::starting_output_address): Likewise.
8081 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
8082 parameter to Sized_relobj*.
8083 (Copy_relocs::need_copy_reloc): Likewise.
8084 (Copy_relocs::save): Likewise.
8085 * copy-relocs.h (class Copy_relocs): Update declarations.
8086 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
8087 Sized_relobj*. Change relobj_ field to Sized_relobj*.
8088 * target-reloc.h (relocate_for_relocatable): Change
8089 offset_in_output_section type to Elf_Addr. Change code that uses
8090 it as well.
8091 * layout.cc (Layout::layout): Always set *off.
8092 * mapfile.cc (Mapfile::print_input_section): Use
8093 output_section_offset.
8094 * i386.cc (Target_i386::copy_reloc): Change object parameter to
8095 Sized_relobj*.
8096 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
8097 * sparc.cc (Target_sparc::copy_reloc): Likewise.
8098 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
8099
5cb66f97
ILT
81002008-07-03 Ian Lance Taylor <iant@google.com>
8101
8102 * layout.cc (Layout::include_section): Do not discard unrecognized
8103 SHT_STRTAB sections.
8104
afe47622
CS
81052008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
8106
8107 * script.cc (Lex::can_continue_name): Make '?' allowable in
8108 version-script names.
8109 * testsuite/version_script.map: Change glob pattern to use '?'
8110
5adf9721
ILT
81112008-06-30 Manish Singh <yosh@gimp.org>
8112
8113 PR 6585
8114 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
8115 Correct typo.
8116
e6fde208
ILT
81172008-06-30 Ian Lance Taylor <iant@google.com>
8118
8119 PR 6660
8120 PR 6682
8121 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
8122 versions]: Don't try to read the value in the contents, since we
8123 don't use it. Use the template endianness when writing.
8124
3f2e6a2d
CC
81252008-06-25 Cary Coutant <ccoutant@google.com>
8126
8127 * fileread.cc (File_read::make_view): Assert on zero-length view.
8128 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
8129 symbol table when there are no symbols to read.
8130
c43d3a48
CS
81312008-06-23 Craig Silverstein <csilvers@google.com>
8132
8133 * version.cc (version_string): Bump to 1.7
8134
5f494ea0
CS
81352008-06-18 Craig Silverstein <csilvers@google.com>
8136
8137 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
8138 constant 0xFFFF to type Valtype.
8139 (Powerpc_relocate_functions::rel16_ha): Likewise.
8140
c42e122e
ILT
81412008-06-17 Ian Lance Taylor <iant@google.com>
8142
f34787f8
ILT
8143 * output.h (Output_section::Input_section): Initialize p2align_ to
8144 zero for Output_section_data constructors.
8145 (Output_section::Input_section::addralign): If not an input
8146 section, return the alignment of the Output_section_data.
8147 * testsuite/copy_test.cc: New file.
8148 * testsuite/copy_test_1.cc: New file.
8149 * testsuite/copy_test_2.cc: New file.
8150 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
8151 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
8152 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
8153 (copy_test_1_pic.o, copy_test_1.so): New targets.
8154 (copy_test_2_pic.o, copy_test_2.so): New targets.
8155 * testsuite/Makefile.in: Rebuild.
8156
c42e122e
ILT
8157 * script-sections.cc (Script_sections::place_orphan): Initialize
8158 local variable exact.
8159
ce3ac18a
DE
81602008-06-13 David Edelsohn <edelsohn@gnu.org>
8161
8162 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
8163
42cacb20
DE
81642008-06-12 David Edelsohn <edelsohn@gnu.org>
8165 David S. Miller <davem@davemloft.net>
8166
8167 * powerpc.cc: New file.
8168 * Makefile.am (TARGETSOURCES): Add powerpc.cc
8169 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
8170 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
8171 * Makefile.in: Rebuild.
8172
7b308235
ILT
81732008-06-09 Ian Lance Taylor <iant@google.com>
8174
8175 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
8176 <exception>.
8177 (throwing, orig_terminate): New static variables.
8178 (terminate_handler): New static function.
8179 (t2): Set terminate handler.
8180
f0b886e3
ILT
81812008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
8182
8183 PR 6584
cd536b21 8184 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
8185 alignment.
8186
3e90f135
CC
81872008-05-30 Cary Coutant <ccoutant@google.com>
8188
8189 * archive.cc (Archive::include_all_members) Correct to step
8190 over symbol table and extended name table in thin archives.
8191
e09ad04a
ILT
81922008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
8193
8194 PR 6407
8195 * target-reloc.h (relocate_for_relocatable): Fix new_offset
8196 calculation.
8197
62b01cb5
ILT
81982008-05-28 Caleb Howe <cshowe@google.com>
8199
8200 * reduced_debug_output.cc: New file.
8201 * reduced_debug_output.h: New file.
92de84a6 8202 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
8203 * options.cc (General_options::finalize): Add strip_debug_non_line
8204 to the strip heirarchy.
8205 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
8206 fields.
8207 * layout.cc: Include "reduced_debug_output.h".
8208 (Layout::Layout): Initialize new fields.
8209 (line_only_debug_sections): New static array.
8210 (is_lines_only_debug_sections): New static inline function.
8211 (Layout::include_section): Handle --strip-debug-non-line.
8212 (Layout::make_output_section): If --strip-debug-non-line, build
8213 new output sections for .debug_abbrev and .debug_info.
8214 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
8215 gold. Warn about possible overflow.
8216 (read_signed_LEB_128): Likewise.
8217 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
8218 (read_signed_LEB_128): Declare.
8219 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
8220 (HFILES): Add reduced_debug_output.h.
8221 * Makefile.in: Rebuild.
8222
7d9e3d98
ILT
82232008-05-21 Ian Lance Taylor <iant@google.com>
8224
8225 * mapfile.cc: New file.
8226 * mapfile.h: New file.
8227 * options.h (class General_options): Add -M/--print-map and -Map.
8228 * options.cc (General_options::finalize): Make -M equivalent to
8229 -Map -.
8230 * main.cc: Include <cstdio> and "mapfile.h".
8231 (main): Open mapfile if requested.
8232 * gold.cc (class Middle_runner): Add mapfile_ field. Update
8233 constructor. Change caller.
8234 (queue_initial_tasks): Add mapfile parameter. Change caller.
8235 (queue_middle_tasks): Likewise.
8236 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
8237 declarations.
8238 * archive.cc: Include "mapfile.h".
8239 (Archive::add_symbols): Add mapfile parameter. Change all
8240 callers. Pass mapfile, symbol, and reason to include_member.
8241 (Archive::include_all_members): Add mapfile parameter. Change all
8242 callers.
8243 (Archive::include_member): Add mapfile, sym, and why parameters.
8244 Change all callers. Report inclusion to map file.
8245 * archive.h: Include "fileread.h".
8246 (class Archive): Update declarations.
8247 (Archive::file): New const method.
8248 (class Add_archive_symbols): Add mapfile_ field. Update
8249 constructor. Change all callers.
8250 * readsyms.h (class Read_symbols): Likewise.
8251 (class Finish_group): Likewise.
8252 (class Read_script): Likewise.
8253 * common.cc: Include "mapfile.h".
8254 (Symbol_table::allocate_commons): Add mapfile parameter. Change
8255 all callers.
8256 (Symbol_table::do_allocate_commons): Likewise.
8257 (Symbol_table::do_allocate_commons_list): Likewise. Report common
8258 symbol allocation to mapfile.
8259 * common.h (class Allocate_commons_task): Add mapfile_ field.
8260 Update constructor. Change all callers.
8261 * symtab.h (class Symbol_table): Update declarations.
8262 * layout.cc: Include "mapfile.h".
8263 (Layout_task_runner::run): Print information to mapfile.
8264 (Layout::create_gold_note): Change Output_data_fixed_space to
8265 Output_data_zero_fill.
8266 (Layout::create_build_id): Likewise.
8267 (Layout::print_to_mapfile): New function.
8268 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
8269 constructor. Change caller.
8270 (class Layout): Declare print_to_mapfile.
8271 * output.cc (Output_section::Input_section::print_to_mapfile): New
8272 function.
8273 (Output_section::add_input_section): If producing a map, always
8274 add to input_sections_ list.
8275 (Output_section::do_print_to_mapfile): New function.
8276 (Output_segment::print_sections_to_mapfile): New function.
8277 (Output_segment::print_section_list_to_mapfile): New function.
8278 * output.h: Include "mapfile.h".
8279 (Output_data::print_to_mapfile): New function.
8280 (Output_data::do_print_to_mapfile): New virtual function.
8281 (Output_segment_headers::do_print_to_mapfile): New function.
8282 (Output_file_header::do_print_to_mapfile): New function.
8283 (Output_data_const::do_print_to_mapfile): New function.
8284 (class Output_data_const_buffer): Add map_name_ field. Update
8285 constructor. Change all callers. Add do_print_to_mapfile
8286 function.
8287 (class Output_data_fixed_space): Likewise.
8288 (class Output_data_space): Likewise.
8289 (class Output_data_zero_fill): New class.
8290 (Output_data_strtab::do_print_to_mapfile): New function.
8291 (Output_data_reloc_base::do_print_to_mapfile): New function.
8292 (Output_relocatable_relocs::do_print_to_mapfile): New function.
8293 (Output_data_group::do_print_to_mapfile): New function.
8294 (Output_data_got::do_print_to_mapfile): New function.
8295 (Output_data_dynamic::do_print_to_mapfile): New function.
8296 (Output_symtab_xindex::do_print_to_mapfile): New function.
8297 (class Output_section): Declare do_print_to_mapflie. Declare
8298 print_to_mapfile in Input_section.
8299 (class Output_segment): Declare new functions.
8300 * object.h (Sized_relobj::symbol_count): New function.
8301 * script-sections.cc
8302 (Output_section_element_dot_assignment::set_section_addresses):
8303 Change Output_data_fixed_space to Output_data_zero_fill.
8304 (Output_data_expression::do_print_to_mapfile): New function.
8305 * script.cc (read_input_script): Add mapfile parameter. Change
8306 all callers.
8307 * script.h (read_input_script): Update declaration.
8308 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
8309 (Eh_frame::do_print_to_mapfile): New function.
8310 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
8311 (Output_merge_string::do_print_to_mapfile): New function.
8312 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
8313 function.
8314 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
8315 function.
8316 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
8317 function.
8318 * Makefile.am (CCFILES): Add mapfile.cc.
8319 (HFILES): Add mapfile.h.
8320 * Makefile.in: Rebuild.
8321
9f1d377b
ILT
83222008-05-19 Ian Lance Taylor <iant@google.com>
8323
8324 * options.h (class General_options): Add -z relro.
8325 * layout.cc (Layout::Layout): Initialize relro_segment_.
8326 (Layout::add_output_section_data): Return the output section.
8327 (Layout::make_output_section): Rcognize relro sections and mark
8328 them appropriately.
8329 (Layout::attach_allocated_section_to_segment): Put relro sections
8330 in a PT_GNU_RELRO segment.
8331 (Layout::create_initial_dynamic_sections): Mark the .dynamic
8332 section as relro.
8333 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
8334 PT_TLS segments.
8335 (Layout::linkonce_mapping): Map d.rel.ro.local to
8336 .data.rel.ro.local.
8337 (Layout::output_section_name): Us .data.rel.ro.local for any
8338 section which begins with that.
8339 * layout.h (class Layout): Update add_output_section_data
8340 declaration. Add relro_segment_ field.
8341 * output.cc (Output_section::Output_section): Initialize is_relro_
8342 and is_relro_local_ fields.
8343 (Output_segment::add_output_section): Group relro sections.
8344 (Output_segment::is_first_section_relro): New function.
8345 (Output_segment::maximum_alignment): If there is a relro section,
8346 align the segment to the common page size.
8347 (Output_segment::set_section_addresses): Track whether we are
8348 looking at relro sections. If the last section is a relro
8349 section, align to the common page size.
8350 (Output_segment::set_section_list_addresses): Add in_relro
8351 parameter. Change all callers. Align to the page size when
8352 moving from relro to non-relro section.
8353 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
8354 segment.
8355 * output.h (class Output_section): Add is_relro_ and
8356 is_relro_local_ fields.
8357 (Output_section::is_relro): New function.
8358 (Output_section::set_is_relro): New function.
8359 (Output_section::is_relro_local): New function.
8360 (Output_section::set_is_relro_local): New function.
8361 (class Output_segment): Update declarations.
8362 * i386.cc (Target_i386::got_section): Mark .got section as relro.
8363 * sparc.cc (Target_sparc::got_section): Likewise.
8364 * x86_64.cc (Target_x86_64::got_section): Likewise.
8365 * testsuite/relro_test_main.cc: New file.
8366 * testsuite/relro_test.cc: New file.
8367 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
8368 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
8369 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
8370 (relro_test.so, relro_test_pic.o): New targets.
8371 * testsuite/Makefile.in: Rebuild.
8372
a984ee1d
ILT
83732008-05-16 Ian Lance Taylor <iant@google.com>
8374
01676dcd
ILT
8375 * output.cc (Output_segment::add_output_section): Remove front
8376 parameter.
8377 * output.h (class Output_segment): Remove
8378 add_initial_output_section and overloaded add_output_section.
8379 Update declaration of remaining add_output_section.
8380 * layout.cc (Layout::create_interp): Call add_output_section
8381 rather than add_initial_output_section.
8382 (Layout::finish_dynamic_section): Likewise.
8383
497897f9
ILT
8384 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
8385 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
8386 know the dynamic type.
8387 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
8388 field. Initialize it in constructor.
8389 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
8390 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
8391 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
8392 reloc.
8393
a984ee1d
ILT
8394 * output.cc (Output_reloc::get_address): Change return type to
8395 Elf_Addr.
8396 * output.h (class Output_reloc): Update get_address declaration.
8397 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
8398 for section addresses.
8399
55ba0940
ILT
84002008-05-09 Ian Lance Taylor <iant@google.com>
8401
8402 PR 6493
8403 * gold.cc (gold_nomem): Use return value of write.
8404
75517b77
ILT
84052008-05-08 Ian Lance Taylor <iant@google.com>
8406
8407 * symtab.c (Symbol::init_base_output_data): Add version
8408 parameter. Change all callers.
8409 (Symbol::init_base_output_segment): Likewise.
8410 (Symbol::init_base_constant): Likewise.
8411 (Symbol::init_base_undefined): Likewise.
8412 (Sized_symbol::init_output_data): Likewise.
8413 (Sized_symbol::init_output_segment): Likewise.
8414 (Sized_symbol::init_constant): Likewise.
8415 (Sized_symbol::init_undefined): Likewise.
8416 (Symbol_table::do_define_in_output_data): If the new symbol has a
8417 version, mark it as the default.
8418 (Symbol_table::do_define_in_output_segment): Likewise.
8419 (Symbol_table::do_define_as_constant): Likewise.
8420 * symtab.h (class Symbol): Update declarations.
8421 (class Sized_symbol): Likewise.
8422 * resolve.cc (Symbol::override_version): New function.
c42e122e 8423 (Symbol::override_base): Call override_version.
75517b77
ILT
8424 (Symbol::override_base_with_special): Likewise.
8425 * testsuite/ver_script_8.script: New file.
8426 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
8427 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
8428 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
8429 (ver_test_8_1.so, ver_test_8_2.so): New targets.
8430
f1f70eae
ILT
84312008-05-06 Ian Lance Taylor <iant@google.com>
8432
f3e9c5c5
ILT
8433 PR 6049
8434 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
8435 functions.
8436 (class General_options): Remove existing --undefined, and add
8437 --no-undefined instead. Add new --undefined as synonym for -u.
8438 * archive.cc (Archive::add_symbols): Check whether symbol was
8439 named with -u.
8440 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
8441 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
8442 all uses. Add IS_UNDEFINED. Update declarations to split
8443 different versions of init_base. Declare init_base_undefined.
8444 (Symbol::is_defined): Handle IS_UNDEFINED.
8445 (Symbol::is_undefined): Likewise.
8446 (Symbol::is_weak_undefined): Call is_undefined.
8447 (Symbol::is_absolute): Handle IS_CONSTANT.
8448 (class Sized_symbol): Update declarations to split different
8449 versions of init. Declare init_undefined.
8450 (class Symbol_table): Declare new functions.
8451 * symtab.cc (Symbol::init_base_object): Rename from init_base.
8452 Change all callers.
8453 (Symbol::init_base_output_data): Likewise.
8454 (Symbol::init_base_output_segment): Likewise.
8455 (Symbol::init_base_constant): Likewise.
8456 (Symbol::init_base_undefined): New function.
8457 (Sized_symbol::init_object): Rename from init. Change all
8458 callers.
8459 (Sized_symbol::init_output_data): Likewise.
8460 (Sized_symbol::init_output_segment): Likewise.
8461 (Sized_symbol::init_constant): Likewise.
8462 (Sized_symbol::init_undefined): New function.
8463 (Symbol_table::add_undefined_symbols_from_command_line): New
8464 function.
8465 (Symbol_table::do_add_undefined_symbols_from_command_line): New
8466 function.
8467 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
8468 (Symbol::output_section): Likewise.
8469 (Symbol::set_output_section): Likewise.
8470 (Symbol_table::sized_finalize_symbol): Likewise.
8471 (Symbol_table::sized_write_globals): Likewise.
8472 * resolve.cc (Symbol_table::should_override): Likewise.
8473 (Symbol::override_base_with_special): Likewise.
8474
8bdcdf2c
ILT
8475 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
8476 symbol, change it to have default visibility.
8477 * testsuite/protected_1.cc: New file.
8478 * testsuite/protected_2.cc: New file.
8479 * testsuite/protected_3.cc: New file.
8480 * testsuite/protected_main_1.cc: New file.
8481 * testsuite/protected_main_2.cc: New file.
8482 * testsuite/protected_main_3.cc: New file.
8483 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
8484 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
8485 (protected_1_LDFLAGS, protected_1_LDADD): Define.
8486 (protected_1.so): New target.
8487 (protected_1_pic.o, protected_2_pic.o): New targets.
8488 (protected_3_pic.o): New target.
8489 (check_PROGRAMS): Add protected_2.
8490 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
8491 (protected_2_LDFLAGS, protected_2_LDADD): Define.
8492 * testsuite/Makefile.in: Rebuild.
8493
2b706932
ILT
8494 * options.h (DEFINE_var): Add set_user_set_##varname__.
8495 (DEFINE_bool_alias): New macro.
8496 (class General_options): Define -Bstatic using DEFINE_bool_alias
8497 rather than DEFINE_special. Add --undefined as an alias for -z
8498 defs.
8499 * options.cc (General_options::parse_Bstatic): Remove.
8500
d82a5bcc
ILT
8501 * options.h (class General_options): Add --fatal-warnings.
8502 * main.cc (main): Implement --fatal-warnings.
8503 * errors.h (Errors::warning_count): New function.
8504
f1f70eae
ILT
8505 * options.h (class General_options): Add -Bsymbolic-functions.
8506 * symtab.h (Symbol::is_preemptible): Check for
8507 -Bsymbolic-functions.
8508
8825ac63
ILT
85092008-05-05 Ian Lance Taylor <iant@google.com>
8510
d98bc257
ILT
8511 * options.h (DEFINE_bool): For DASH_Z, create the negative option
8512 as noVARNAME rather than no-VARNAME.
8513 (class General_options): Add option -z combreloc.
8514 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
8515 get_address.
8516 (Output_reloc::sort_before) [SHT_REL]: New function.
8517 (Output_reloc::sort_before) [SHT_RELA]: New function.
8518 (class Output_data_reloc_base): Add sort_relocs_ field. Define
8519 Sort_relocs_comparison.
8520 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
8521 parameter. Change all callers.
8522 (Output_data_reloc::Output_data_reloc) [both versions]: Add
8523 sort_relocs parameter. Change all callers.
8524 * output.cc (Output_reloc::get_address): New function, broken out
8525 of write_rel.
8526 (Output_reloc::write_rel): Call it.
8527 (Output_reloc::compare): New function.
8528 (Output_data_reloc_base::do_write): Optionally sort relocs.
8529
60b2b4e7
ILT
8530 * configure.ac: If targ_extra_obj is set, link it in.
8531 * configure.tgt: Initialize all variables.
8532 (x86_64*): Set targ_extra_obj and targ_extra_size.
8533 * configure: Rebuild.
8534
8825ac63
ILT
8535 * object.cc (Sized_relobj::include_section_group): Adjust section
8536 indexes read from group data. Build vector to pass to
8537 layout_group.
8538 * layout.cc (Layout::layout_group): Add flags and shndxes
8539 parameters. Remove contents parameter. Change caller. Update
8540 explicit instantiations.
8541 * layout.h (class Layout): Update layout_group declaration.
8542 * output.cc (Output_data_group::Output_data_group): Add flags and
8543 input_shndxes parameters. Remove contents parameter. Change
8544 caller.
8545 (Output_data_group::do_write): Change input_sections_ to
8546 input_shndxes_.
8547 * output.h (class Output_data_group): Update constructor
8548 declaration. Rename input_sections_ to input_shndxes_.
8549 * testsuite/many_sections_test.cc: Add template.
8550
e94cf127
CC
85512008-04-30 Cary Coutant <ccoutant@google.com>
8552
4418b2d5
CC
8553 * target-reloc.h (relocate_section): Fix dead-pointer bug.
8554
e94cf127
CC
8555 * layout.cc (Layout::include_section): Refactored check for debug
8556 info section.
8557 (Layout::add_comdat): Add new parameters. Change type
8558 of signature parameter. Add object and shndx to signatures table.
8559 (Layout::find_kept_object): New function.
8560 * layout.h: Include <cstring>.
8561 (Layout::is_debug_info_section): New function.
8562 (Layout::add_comdat): Add new parameters.
8563 (Layout::find_kept_object): New function.
8564 (Layout::Kept_section): New struct.
8565 (Layout::Signatures): Change type of map range.
8566 * object.cc (Relobj::output_section_address): New function.
8567 (Sized_relobj::include_section_group): Add new parameters. Change
8568 calls to Layout::add_comdat. Change to build table of kept comdat
8569 groups and table mapping discarded sections to kept sections.
8570 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
8571 (Sized_relobj::do_layout): Change calls to include_section_group and
8572 include_linkonce_section.
8573 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
8574 value to zero when section is discarded.
8575 (Sized_relobj::map_to_kept_section): New function.
8576 * object.h (Relobj::output_section_address): New function.
8577 (Relobj::Comdat_group): New type.
8578 (Relobj::find_comdat_group): New function.
8579 (Relobj::Comdat_group_table): New type.
8580 (Relobj::Kept_comdat_section): New type.
8581 (Relobj::Kept_comdat_section_table): New type.
8582 (Relobj::add_comdat_group): New function.
8583 (Relobj::set_kept_comdat_section): New function.
8584 (Relobj::get_kept_comdat_section): New function.
8585 (Relobj::comdat_groups_): New field.
8586 (Relobj::kept_comdat_sections_): New field.
8587 (Symbol_value::input_value): Update comment.
8588 (Sized_relobj::map_to_kept_section) New function.
8589 (Sized_relobj::include_linkonce_section): Add new parameter.
8590 * target-reloc.h (Comdat_behavior): New type.
8591 (get_comdat_behavior): New function.
8592 (relocate_section): Add code to map a discarded section to the
8593 corresponding kept section when applying a relocation.
8594
e4e5049b
CS
85952008-04-30 Craig Silverstein <csilvers@google.com>
8596
8597 * dwarf_reader.cc (next_generation_count): New static var.
8598 (Addr2line_cache_entry): New struct.
8599 (addr2line_cache): New static var.
8600 (Dwarf_line_info::one_addr2line): Added caching.
8601 (Dwarf_line_info::clear_addr2line_cache): New function.
8602 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
8603 cache-size parameter.
8604 (Dwarf_line_info::one_addr2line_cache): New function.
8605 * symtab.cc (Symbol_table::detect_odr_violations): Pass
8606 new cache-size argument to one_addr2line(), and clear cache.
8607
d09e9154
CC
86082008-04-28 Cary Coutant <ccoutant@google.com>
8609
8610 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
8611 R_386_PC8 relocations.
8612
7ef73768
ILT
86132008-04-23 Ian Lance Taylor <iant@google.com>
8614
55438702
ILT
8615 * object.cc (Sized_relobj::include_section_group): Check for
8616 invalid section group.
8617
c165fb93
ILT
8618 * object.cc (make_elf_object): Correct test for 64-bit ELF file
8619 header size.
8620
7ef73768
ILT
8621 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
8622 than read for file header.
8623 * archive.cc (Archive::include_member): Likewise.
8624
6194aaab
L
86252008-04-23 Paolo Bonzini <bonzini@gnu.org>
8626
8627 * aclocal.m4: Regenerate.
8628 * configure: Regenerate.
8629
d491d34e
ILT
86302008-04-19 Ian Lance Taylor <iant@google.com>
8631
5ea2bac6
ILT
8632 * version.cc (version_string): Bump to 1.6.
8633
7bc3e21a
ILT
8634 * testsuite/Makefile.am (many_sections_r_test): New target.
8635 (many_sections_r_test_SOURCES): Remove.
8636 (many_sections_r_test_DEPENDENCIES): Remove.
8637 (many_sections_r_test_LDFLAGS): Remove.
8638 (many_sections_r_test_LDADD): Remove.
8639
7fcd3aa9
ILT
8640 * object.cc (Sized_relobj::do_add_symbols): Always pass
8641 local_symbol_count_ to add_from_relobj.
8642
4c94d6ae
ILT
8643 * testsuite/Makefile.am (many_sections_check.h): Only check one in
8644 every thousand variables.
8645 * testsuite/Makefile.in: Rebuild.
8646
d491d34e
ILT
8647 * object.cc (Xindex::initialize_symtab_xindex): New function.
8648 (Xindex::read_symtab_xindex): New function.
8649 (Xindex::sym_xindex_to_shndx): New function.
8650 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
8651 available.
8652 (Sized_relobj::do_initialize_xindex): New function.
8653 (Sized_relobj::do_read_symbols): Adjust section links.
8654 (Sized_relobj::symbol_section_and_value): Add is_ordinary
8655 parameter. Change all callers.
8656 (Sized_relobj::include_section_group): Adjust section links and
8657 symbol section indexes.
8658 (Sized_relobj::do_layout): Adjust section links.
8659 (Sized_relobj::do_count_local_symbols): Adjust section links and
8660 symbol section indexes.
8661 (Sized_relobj::do_finalize_local_symbols): Distinguish between
8662 ordinary and special symbols.
8663 (Sized_relobj::write_local_symbols): Add symtab_xindex and
8664 dynsym_xindex parameters. Change all callers. Adjust section
8665 links. Use SHN_XINDEX when needed.
8666 (Sized_relobj::get_symbol_location_info): Adjust section links.
8667 Don't get fooled by special symbols.
8668 * object.h (class Xindex): Define.
8669 (class Object): Add xindex_ parameter. Declare virtual functoin
8670 do_initialize_xindex.
8671 (Object::adjust_sym_shndx): New function.
8672 (Object::set_xindex): New protected function.
8673 (class Symbol_value): Add is_ordinary_shndx_ field.
8674 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
8675 (Symbol_value::value): Assert ordinary section.
8676 (Symbol_value::initialize_input_to_output_map): Likewise.
8677 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
8678 Change all callers.
8679 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
8680 all callers.
8681 (class Sized_relobj): Update declarations.
8682 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
8683 parameter. Change all callers.
8684 (Sized_relobj::adjust_shndx): New function.
8685 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
8686 field.
8687 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
8688 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
8689 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
8690 (Sized_dynobj::read_dynsym_section): Adjust section links.
8691 (Sized_dynobj::read_dynamic): Likewise.
8692 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
8693 section links.
8694 (Sized_dynobj::do_initialize_xindex): New function.
8695 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
8696 do_initialize_xindex.
8697 (Sized_dynobj::adjust_shndx): New function.
8698 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
8699 dynsym_xindex_ fields.
8700 (Layout::finalize): Add a call to set_section_indexes before
8701 creating the symtab sections.
8702 (Layout::set_section_indexes): Don't do anything if the section
8703 already has a section index.
8704 (Layout::create_symtab_sections): Add shnum parameter. Change
8705 caller. Create .symtab_shndx section if needed.
8706 (Layout::create_shdrs): Add shstrtab_section parameter. Change
8707 caller.
8708 (Layout::allocated_output_section_count): New function.
8709 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
8710 needed.
8711 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
8712 fields. Update declarations.
8713 (Layout::symtab_xindex): New function.
8714 (Layout::dynsym_xindex): New function.
8715 (class Write_symbols_task): Add layout_ field.
8716 (Write_symbols_task::Write_symbols_task): Add layout parameter.
8717 Change caller.
8718 * output.cc (Output_section_headers::Output_section_headers): Add
8719 shstrtab_section parameter. Change all callers.
8720 (Output_section_headers::do_sized_write): Store overflow values
8721 for section count and section string table section index in
8722 section header zero.
8723 (Output_file_header::do_sized_write): Check for overflow of
8724 section count and section string table section index.
8725 (Output_symtab_xindex::do_write): New function.
8726 (Output_symtab_xindex::endian_do_write): New function.
8727 * output.h (class Output_section_headers): Add shstrtab_section_.
8728 Update declarations.
8729 (class Output_symtab_xindex): Define.
8730 (Output_section::has_out_shndx): New function.
8731 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
8732 field.
8733 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
8734 Change all callers.
8735 (Sized_symbol::init): Likewise.
8736 (Symbol::output_section): Check for ordinary symbol.
8737 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
8738 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
8739 callers.
8740 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
8741 Change all callers. Simplify handling of symbols from sections
8742 not included in the link.
8743 (Symbol_table::add_from_dynobj): Handle ordinary symbol
8744 distinction.
8745 (Weak_alias_sorter::operator()): Assert that symbols are
8746 ordinary.
8747 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
8748 distinction.
8749 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
8750 parameters. Change all callers.
8751 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
8752 symbol distinction. Use SHN_XINDEX when needed.
8753 (Symbol_table::write_section_symbol): Add symtab_xindex
8754 parameter. Change all callers.
8755 (Symbol_table::sized_write_section_symbol): Likewise. Use
8756 SHN_XINDEX when needed.
8757 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
8758 declarations.
8759 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
8760 (Symbol::is_defined): Check is_ordinary.
8761 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
8762 (Symbol::is_absolute, Symbol::is_common): Likewise.
8763 (class Sized_symbol): Update declarations.
8764 (class Symbol_table): Update declarations.
8765 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
8766 parameters. Change all callers.
8767 (Sized_symbol::override): Likewise.
8768 (Symbol_table::override): Likewise.
8769 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
8770 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
8771 is_ordinary, and orig_st_shndx parameters. Change all callers.
8772 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
8773 to be in an ordinary section.
8774 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
8775 object and is_ordinary parameters. Change all callers.
8776 (Sized_dwarf_line_info::read_relocs): Add object parameter.
8777 Change all callers. Don't add undefined or non-ordinary symbols
8778 to reloc_map_.
8779 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
8780 Change all callers.
8781 * dwarf_reader.h (class Sized_dwarf_line_info): Update
8782 declarations.
8783 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
8784 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
8785 (Sized_relobj::relocate_sections): Likewise.
8786 * target-reloc.h (scan_relocs): Adjust section symbol index.
8787 (scan_relocatable_relocs): Likewise.
8788 * i386.cc (Scan::local): Check for ordinary symbols.
8789 * sparc.cc (Scan::local): Likewise.
8790 * x86_64.cc (Scan::local): Likewise.
8791 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
8792 to symbol_section_and_value.
8793 * testsuite/many_sections_test.cc: New file.
8794 * testsuite/Makefile.am (BUILT_SOURCES): Define.
8795 (check_PROGRAMS): Add many_sections_test.
8796 (many_sections_test_SOURCES): Define.
8797 (many_sections_test_DEPENDENCIES): Define.
8798 (many_sections_test_LDFLAGS): Define.
8799 (BUILT_SOURCES): Add many_sections_define.h.
8800 (many_sections_define.h): New target.
8801 (BUILT_SOURCES): Add many_sections_check.h.
8802 (many_sections_check.h): New target.
8803 (check_PROGRAMS): Add many_sections_r_test.
8804 (many_sections_r_test_SOURCES): Define.
8805 (many_sections_r_test_DEPENDENCIES): Define.
8806 (many_sections_r_test_LDFLAGS): Define.
8807 (many_sections_r_test_LDADD): Define.
8808 (many_sections_r_test.o): New target.
8809 * testsuite/Makefile.in: Rebuild.
8810
c5818ff1
CC
88112008-04-17 Cary Coutant <ccoutant@google.com>
8812
8813 * errors.cc (Errors::info): New function.
8814 (gold_info): New function.
8815 * errors.h (Errors::info): New function.
8816 * gold.h (gold_info): New function.
8817 * object.cc (Input_objects::add_object): Print trace output.
8818 * options.cc (options::parse_set): New function.
8819 (General_options::parse_wrap): Deleted.
8820 (General_options::General_options): Deleted initializer.
8821 * options.h (options::String_set): New typedef.
8822 (options::parse_set): New function.
8823 (DEFINE_set): New macro.
8824 (General_options::wrap): Changed to use DEFINE_set. Changed
8825 callers of any_wrap_symbols and is_wrap_symbol.
8826 (General_options::trace, General_options::trace_symbol):
8827 New options.
8828 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
8829 (General_options::wrap_symbols_): Deleted.
8830 * symtab.cc (Symbol_table::add_from_object): Print trace output.
8831
b5be4a7c
DM
88322008-04-17 David S. Miller <davem@davemloft.net>
8833
8834 * options.cc (General_options::parse_V): New function.
8835 * options.h: Add entries for -V and -Qy.
8836
155a0dd7
ILT
88372008-04-17 Ian Lance Taylor <iant@google.com>
8838
8839 * common.cc (Symbol_table::allocate_commons): Remove options
8840 parameter. Change caller.
8841 (Symbol_table::do_allocate_commons): Remove options parameter.
8842 Change caller. Just call do_allocate_commons_list twice.
8843 (Symbol_table::do_allocate_commons_list): New function, broken out
8844 of do_allocate_commons.
8845 * common.h (class Allocate_commons_task): Remove options_ field.
8846 Update constructor.
8847 * symtab.cc (Symbol_table::Symbol_table): Initialize
8848 tls_commons_.
8849 (Symbol_table::add_from_object): Put TLS common symbols on
8850 tls_commons_ list.
8851 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
8852 which are IN_OUTPUT_DATA.
8853 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
8854 allocate_commons and do_allocate_commons declarations. Declare
8855 do_allocate_commons_list.
8856 * gold.cc (queue_middle_tasks): Update creation of
8857 Allocate_commons_task to not pass options.
8858 * testsuite/Makefile.am (INCLUDES): Add -I.. .
8859 (TLS_TEST_C_FLAGS): New variable.
8860 (tls_test_c_pic.o): New target.
8861 (tls_test_shared.so): Link in tls_test_c_pic.o.
8862 (tls_test_c_pic_ie.o): New target.
8863 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
8864 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
8865 (tls_test_c.o): New target.
8866 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
8867 (tls_pic_test_LDADD): Likewise.
8868 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
8869 (tls_shared_gd_to_ie_test_LDADD): Likewise.
8870 (tls_test_c_gnu2.o): New target.
8871 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
8872 tls_test_c_gnu2.o.
8873 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
8874 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
8875 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
8876 * testsuite/tls_test.cc: Include "config.h".
8877 (t_last): Call t11_last.
8878 * testsuite/tls_test.h (t11, t11_last): Declare.
8879 * testsuite/tls_test_c.c: New file.
8880 * testsuite/tls_test_main.cc (thread_routine): Call t11.
8881 * configure.ac: Check for OpenMP support.
8882 * configure, config.in, Makefile.in: Rebuild.
8883 * testsuite/Makefile.in: Rebuild.
8884
edfbb029
CC
88852008-04-16 Cary Coutant <ccoutant@google.com>
8886
8887 * i386.cc (Target_i386::define_tls_base_symbol): New function.
8888 (Target_i386::tls_base_symbol_defined_): New field.
8889 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
8890 (Target_i386::Scan::global): Likewise.
8891 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
8892 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
8893 (Target_x86_64::tls_base_symbol_defined_): New field.
8894 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
8895 (Target_x86_64::Scan::global): Likewise.
8896
f3c69fca
CC
88972008-04-16 Cary Coutant <ccoutant@google.com>
8898
8899 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
8900 (Symbol::needs_plt_entry): Allow weak undefined symbols.
8901 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
8902 building shared libraries.
8903 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
8904 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
8905 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
8906 * testsuite/Makefile.in: Rebuild.
8907 * testsuite/weak_undef.h: New file.
8908 * testsuite/weak_undef_file1.cc: Add extra test cases.
8909 * testsuite/weak_undef_file2.cc: Likewise.
8910 * testsuite/weak_undef_test.cc: Likewise.
8911
7c414435
DM
89122008-04-16 David S. Miller <davem@davemloft.net>
8913
32b769e1
DM
8914 * sparc.cc (Target_sparc::Scan): Change from struct to class.
8915 Add issued_non_pic_error_ field. Declare check_non_pic.
8916 (Target_sparc::Scan::check_non_pic): New function.
8917 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
8918 (Target_sparc::Scan::global): Likewise.
8919
11936fb1
DM
8920 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
8921 * configure: Rebuild.
8922
7c414435
DM
8923 * options.h (DEFINE_enable): New macro.
8924 (new_dtags): New enable option.
8925 (initfirst, interpose, loadfltr, nodefaultlib,
8926 nodelete, nodlopen, nodump): New -z options.
8927 * layout.cc (Layout:finish_dynamic_section): If new
8928 dtags enabled, emit DT_RUNPATH. Also, emit a
8929 DT_FLAGS_1 containing any specified -z flags.
8930
85c7bf8b
ILT
89312008-04-16 Ian Lance Taylor <iant@google.com>
8932
12c0daef
ILT
8933 * copy-relocs.cc: New file.
8934 * copy-relocs.h: New file.
8935 * reloc.cc: Remove Copy_relocs code.
8936 * reloc.h: Likewise.
8937 * reloc-types.h (struct Reloc_types) [both versions]: Add
8938 get_reloc_addend_noerror.
8939 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
8940 variants of add_global which take an addend which must be zero.
8941 * i386.cc: Include "copy-relocs.h".
8942 (class Target_i386): Change type of copy_relocs_ to variable,
8943 update initializer.
8944 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
8945 Change all callers.
8946 (Target_i386::do_finalize_sections): Change handling of
8947 copy_relocs_.
8948 * sparc.cc: Include "copy-relocs.h".
8949 (class Target_sparc): Change type of copy_relocs_ to variable,
8950 update initializer.
8951 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
8952 Change all callers.
8953 (Target_sparc::do_finalize_sections): Change handling of
8954 copy_relocs_.
8955 * x86_64.cc: Include "copy-relocs.h".
8956 (class Target_x86_64): Change type of copy_relocs_ to variable,
8957 update initializer.
8958 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
8959 class. Change all callers.
8960 (Target_x86_64::do_finalize_sections): Change handling of
8961 copy_relocs_.
8962 * Makefile.am (CCFILES): Add copy-relocs.cc.
8963 (HFILES): Add copy-relocs.h.
8964
4f4995b6
ILT
8965 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
8966
85c7bf8b
ILT
8967 * testsuite/script_test_4.sh: Permit leading zeroes.
8968
4f2a9edd
ILT
89692008-04-15 Ian Lance Taylor <iant@google.com>
8970
e6188289
ILT
8971 * script-sections.cc (Script_sections::create_segments): Use
8972 header_size_adjustment even when there is enough room for the
8973 headers.
8974 * testsuite/script_test_4.sh: New file.
8975 * testsuite/script_test_4.t: New file.
8976 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
8977 (check_DATA): Add script_test_4.stdout.
8978 (MOSTLYCLEANFILES): Likewise.
8979 (script_test_4): New target.
8980 (script_test_4.stdout): New target.
8981 * testsuite/Makefile.in: Rebuild.
8982
4f2a9edd
ILT
8983 * sparc.cc: Add definitions for Output_data_plt_sparc class
8984 constants.
8985
f5314dd5
DM
89862008-04-14 David S. Miller <davem@davemloft.net>
8987
8988 * sparc.cc: New file.
8989 * Makefile.am (TARGETSOURCES): Add sparc.cc
8990 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
8991 * configure.tgt: Document targ_extra_size and
8992 targ_extra_big_endian. Add entries for sparc-* and
8993 sparc64-*.
8994 * configure.ac: Handle targ_extra_size and
8995 targ_extra_big_endian.
8996 * Makefile.in: Rebuild.
8997 * configure: Likewise.
8998 * po/POTFILES.in: Likewise.
8999 * po/gold.pot: Likewise.
9000
154e0e9a
ILT
90012008-04-14 Ian Lance Taylor <iant@google.com>
9002
9003 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
9004 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
9005 in the name/type/flags to section mapping. Don't call
9006 allocate_output_section.
9007 (Layout::choose_output_section): Change parameter from adjust_name
9008 to is_input_section. Don't permit input sections after sections
9009 are attached to segments. Don't call allocate_output_section.
9010 (Layout::layout_eh_frame): Call update_flags_for_input_section,
9011 not write_enable_output_section.
9012 (Layout::make_output_section): Don't push to
9013 unattached_section_list_ nor call attach_to_segment. Call
9014 attach_section_to_segment if sections are attached.
9015 (Layout::attach_sections_to_segments): New function.
9016 (Layout::attach_section_to_segment): New function.
9017 (Layout::attach_allocated_section_to_segment): Rename from
9018 attach_to_segment. Remove flags parameter.
9019 (Layout::allocate_output_section): Remove function.
9020 (Layout::write_enable_output_section): Remove function.
9021 * layout.h (class Layout): Update for above changes. Add new
9022 field sections_are_attached_.
9023 * output.h (Output_section::update_flags_for_input_section): New
9024 function.
9025 * output.cc (Output_section::add_input_section): Call
9026 update_flags_for_input_section.
9027 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
9028
009a67a2
CC
90292008-04-11 Cary Coutant <ccoutant@google.com>
9030
9031 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
9032 thought unnecessary.
9033 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
9034
759b1a24
ILT
90352008-04-11 Ian Lance Taylor <iant@google.com>
9036
9037 * output.h (class Output_section_data): Remove inline definition
9038 of set_addralign.
9039 * output.cc (Output_section_data::set_addralign): New function.
9040
c2b45e22
CC
90412008-04-11 Cary Coutant <ccoutant@google.com>
9042
9043 Add support for TLS descriptors for i386 and x86_64.
9044 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
9045 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
9046 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
9047 GOT_TYPE_TLS_DESC.
9048 (Target_i386::got_mod_index_entry): Remove unnecessary code.
9049 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
9050 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
9051 relocations.
9052 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
9053 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
9054 Fix problem with initial-exec relocations.
9055 (Target_i386::Relocate::relocate_tls): Likewise.
9056 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
9057 relaxation.
9058 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
9059 support for section-plus-offset dynamic table entries.
9060 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
9061 (Output_data_dynamic::Dynamic_entry): Add support for
9062 section-plus-offset dynamic table entries.
9063 (Output_data_dynamic::Classification): Likewise.
9064 (Output_data_dynamic::classification_): Renamed offset_.
9065 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
9066 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
9067 (Target_x86_64::make_plt_section): New function.
9068 (Target_x86_64::reserve_tlsdesc_entries): New function.
9069 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
9070 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
9071 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
9072 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
9073 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
9074 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
9075 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
9076 add extra PLT entry for TLS descriptors.
9077 (Output_data_plt_x86_64::got_): New field.
9078 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
9079 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
9080 fields.
9081 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
9082 descriptors.
9083 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
9084 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
9085 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
9086 R_386_TLS_DESC_CALL relocations.
9087 (Target_x86_64::Scan::global): Likewise.
9088 (Target_x86_64::do_finalize_sections): Add dynamic table entries
9089 for TLS descriptors.
9090 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
9091 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
9092 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
9093 GD-to-IE relaxation.
9094 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
9095 and TLS_DESCRIPTORS.
9096 * Makefile.in: Rebuild.
9097 * configure: Rebuild.
9098 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
9099 (tls_test_shared2.so): New target.
9100 (tls_shared_gd_to_ie_test_SOURCES): New variable.
9101 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
9102 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
9103 (tls_shared_gd_to_ie_test_LDADD): New variable.
9104 (tls_shared_gnu2_gd_to_ie_test): New target.
9105 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
9106 New targets.
9107 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
9108 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
9109 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
9110 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
9111 (tls_shared_gnu2_test): New target.
9112 (tls_test_gnu2_shared.so): New target.
9113 (tls_shared_gnu2_test_SOURCES): New variable.
9114 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
9115 (tls_shared_gnu2_test_LDFLAGS): New variable.
9116 (tls_shared_gnu2_test_LDADD): New variable.
9117 * testsuite/Makefile.in: Rebuild.
9118 * testsuite/Makefile.
9119
83bfb6b7
ILT
91202008-04-11 Ian Lance Taylor <iant@google.com>
9121
9122 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
9123 justsyms.t.
9124 * testsuite/Makefile.in: Rebuild.
9125
9126 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
9127 long.
9128 * testsuite/script_test_2.cc (main): Adjust test.
9129
706e1f5e
ILT
91302008-04-11 David S. Miller <davem@davemloft.net>
9131 Ian Lance Taylor <iant@google.com>
9132
9133 * options.h (General_options): Add entries for '-Y' and
9134 '-relax'.
9135 * options.cc (General_options:finalize): If -Y was used, add those
9136 entries to the library path instead of the default "/lib" and
9137 "/usr/lib".
9138
7c98e6bb
DM
91392008-04-11 David S. Miller <davem@davemloft.net>
9140
9141 * testsuite/justsyms.t: Start at 0x100.
9142 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
9143 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
9144 long.
9145 * testsuite/script_test_2.cc: Adjust string and section length
9146 checks.
7c98e6bb 9147
99a37bfd
ILT
91482008-04-09 Ian Lance Taylor <iant@google.com>
9149
2cefc357
ILT
9150 PR gold/5996
9151 * script-sections.cc (Sections_element::allocate_to_segment): Add
9152 orphan parameter.
9153 (Output_section_definition::allocate_to_segment): Likewise.
9154 (Orphan_output_section::allocate_to_segment): Likewise.
9155 (Script_sections::attach_sections_using_phdrs_clause): Don't
9156 propagate non-PT_LOAD segments to orphan sections.
9157 * testsuite/Makefile.am (script_test_3.stdout): Generate using
9158 readelf rather than objdump.
9159 * testsuite/script_test_3.sh: Adjust accordingly. Test that
9160 .interp section and PT_INTERP segment are the same size.
9161 * testsuite/Makefile.in: Rebuild.
9162
99a37bfd
ILT
9163 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
9164 aliases for symbols defined in the same object.
9165 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
9166 (weak_alias_test_SOURCES): New variable.
9167 (weak_alias_test_DEPENDENCIES): New variable.
9168 (weak_alias_test_LDFLAGS): New variable.
9169 (weak_alias_test_LDADD): New variable.
9170 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
9171 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
9172 (weak_alias_test_3.o): New target.
9173 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
9174 * testsuite/weak_alias_test_main.cc: New file.
9175 * testsuite/weak_alias_test_1.cc: New file.
9176 * testsuite/weak_alias_test_2.cc: New file.
9177 * testsuite/weak_alias_test_3.cc: New file.
9178
780e49c5
ILT
91792008-04-08 Ian Lance Taylor <iant@google.com>
9180
cdb0b8f5
ILT
9181 * options.h (class General_options): Add --noinhibit-exec option.
9182 * main.cc (main): Check --noinhibit-exec.
9183
0864d551
ILT
9184 * options.h (class General_options): Define --wrap as a special
9185 option. Add wrap_symbols_ field.
9186 (General_options::any_wrap_symbols): New function.
9187 (General_options::is_wrap_symbol): New function.
9188 * options.cc (General_options::parse_wrap): New function.
9189 (General_options::General_options): Initialize wrap_symbols_.
9190 * symtab.cc (Symbol_table::wrap_symbol): New function.
9191 (Symbol_table::add_from_object): Handle --wrap.
9192 * symtab.h (class Symbol_table): Declare wrap_symbol.
9193 * target.h (Target::wrap_char): New function.
9194 (Target::Target_info): Add wrap_char field.
9195 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
9196 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9197 * testsuite/testfile.cc (Target_test::test_target_info):
9198 Likewise.
9199
789aa6de
ILT
9200 * errors.cc (Errors::undefined_symbol): Mention symbol version if
9201 there is one.
9202
2c38906f
ILT
9203 * layout.h (class Layout): Add added_eh_frame_data_ field.
9204 * layout.cc (Layout::Layout): Initialize new field.
9205 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
9206 output section until we find a section we merged successfully.
9207 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
9208 that the size be non-zero.
9209
780e49c5
ILT
9210 * merge.cc (Object_merge_map::get_output_offset): Remove inline
9211 qualifier.
9212
7fcd0256
ILT
92132008-04-08 Craig Silverstein <csilvers@google.com>
9214
9215 * configure.ac: Export new conditional variable HAVE_ZLIB.
9216 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
9217 on HAVE_ZLIB.
9218 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
9219 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9220
6835af53
ILT
92212008-04-07 Ian Lance Taylor <iant@google.com>
9222
e24f324c
ILT
9223 * version.cc (version_string): Set to "1.5".
9224
a036edd8
ILT
9225 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
9226 Add issued_non_pic_error_ field. Declare check_non_pic.
9227 (Target_x86_64::Scan::check_non_pic): New function.
9228 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
9229 (Target_x86_64::Scan::global): Likewise.
9230
624f8810
ILT
9231 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
9232 addend parameter. Change caller. Handle merge sections.
9233 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
9234 Address to Addend. Don't add in the result of
9235 local_section_offset, pass down the addend and use the returned
9236 value.
9237 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
9238 Update declarations of local_section_offset and symbol_value.
9239 * testsuite/two_file_test_1.cc (t18): New function.
9240 * testsuite/two_file_test_2.cc (f18): New function.
9241 * testsuite/two_file_test_main.cc (main): Call t18.
9242 * testsuite/two_file_test.h (t18, f18): Declare.
9243
6835af53
ILT
9244 * configure.ac: Don't test for objdump, c++filt, or readelf.
9245 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
9246 conditionals.
9247 (TEST_READELF): New variable.
9248 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
9249 (check_PROGRAMS): Add two_file_strip_test.
9250 (two_file_strip_test): New target.
9251 (check_PROGRAMS): Add two_file_same_shared_strip_test.
9252 (two_file_same_shared_strip_test_SOURCES): New variable.
9253 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
9254 (two_file_same_shared_strip_test_LDFLAGS): New variable.
9255 (two_file_same_shared_strip_test_LDADD): New variable.
9256 (two_file_shared_strip.so): New target.
9257 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
9258 (ver_test_5.syms, ver_test_7.syms): Likewise.
9259 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
9260 (strip_test_3.stdout): Use TEST_OBJDUMP.
9261 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9262
86925eef
CC
92632008-04-04 Cary Coutant <ccoutant@google.com>
9264
9265 * symtab.h (Symbol::is_weak_undefined): New function.
9266 (Symbol::is_strong_undefined): New function.
9267 (Symbol::is_absolute): New function.
9268 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
9269 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
9270 absolute symbols.
9271 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
9272 (weak_undef_test): New target.
9273 * testsuite/Makefile.in: Rebuild.
9274 * testsuite/weak_undef_file1.cc: New file.
9275 * testsuite/weak_undef_file2.cc: New file.
9276 * testsuite/weak_undef_test.cc: New file.
9277
126f3ece
ILT
92782008-04-03 Craig Silverstein <csilvers@google.com>
9279
9280 * compressed_output.h (class Output_compressed_section): Use
9281 unsigned buffer.
9282 * compressed_output.cc (zlib_compress): Use unsigned buffers,
9283 add zlib header.
9284 (zlib_compressed_suffix): Removed.
9285 (Output_compressed_section::set_final_data_size): Use unsigned
9286 buffers.
9287 * testsuite/Makefile.am (flagstest_compress_debug_sections):
9288 Fix linker invocation.
9289 (flagstest_o_specialfile_and_compress_debug_sections):
9290 Likewise.
9291 * testsuite/Makefile.in: Regenerated.
9292
deae2a14
DM
92932008-04-02 David S. Miller <davem@davemloft.net>
9294
9295 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
9296 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
9297
70752818
ILT
92982008-04-02 Craig Silverstein <csilvers@google.com>
9299
9300 * TODO: New file.
9301
39d0cb0e
ILT
93022008-04-02 Ian Lance Taylor <iant@google.com>
9303
9304 * fileread.cc (File_read::find_view): Add byteshift and vshifted
9305 parameters. Update for new key type to views_. Change all
9306 callers.
9307 (File_read::read): Adjust for byteshift in returned view.
9308 (File_read::add_view): New function, broken out of
9309 find_and_make_view.
9310 (File_read::make_view): New function, broken out of
9311 find_and_make_view.
9312 (File_read::find_or_make_view): Add offset and aligned
9313 parameters. Rewrite accordingly. Change all callers.
9314 (File_read::get_view): Add offset and aligned parameters. Adjust
9315 for byteshift in return value.
9316 (File_read::get_lasting_view): Likewise.
9317 * fileread.h (class File_read): Update declarations.
9318 (class File_read::View): Add byteshift_ field. Add byteshift to
9319 constructor. Add byteshift method.
9320 * archive.h (Archive::clear_uncached_views): New function.
9321 (Archive::get_view): Add aligned parameter. Change all callers.
9322 * object.h (Object::get_view): Add aligned parameter. Change all
9323 callers.
9324 (Object::get_lasting_view): Likewise.
9325
9326 * fileread.cc (File_read::release): Don't call clear_views if
9327 there are multiple objects.
9328 * fileread.h (File_read::clear_uncached_views): New function.
9329 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
9330 on the archive.
9331
a1207466
CC
93322008-03-31 Cary Coutant <ccoutant@google.com>
9333
9334 Add thin archive support.
9335 * archive.cc (Archive::armagt): New const.
9336 (Archive::setup): Remove task parameter and calls to unlock.
9337 (Archive::unlock_nested_archives): New function.
9338 (Archive::read_header): Add nested_off parameter. Change
9339 all callers.
9340 (Archive::interpret_header): Likewise.
9341 (Archive::include_all_members): Change to handle thin
9342 archives.
9343 (Archive::include_member): Likewise.
9344 * archive.h (Archive::Archive): Add new parameters and
9345 initializers.
9346 (Archive::armagt): New const.
9347 (Archive::setup): Remove task parameter.
9348 (Archive::unlock_nested_archives): New function.
9349 (Archive::read_header): Add nested_off parameter.
9350 (Archive::interpret_header): Likewise.
9351 (Archive::Nested_archive_table): New typedef.
9352 (Archive::is_thin_archive_): New field.
9353 (Archive::nested_archives_): New field.
9354 (Archive::options_): New field.
9355 (Archive::dirpath_): New field.
9356 (Archive::task_): New field.
9357 * readsyms.cc (Read_symbols::do_read_symbols): Add check
9358 for thin archives. Pass additional parameters to
9359 Archive::Archive. Unlock the archive file after calling
9360 Archive::setup.
cd536b21 9361
479f6503
ILT
93622008-03-29 Ian Lance Taylor <iant@google.com>
9363
686c8caf
ILT
9364 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
9365 version symbol to be local.
9366 * testsuite/ver_test_4.sh: New file.
9367 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
9368 (check_DATA): Add ver_test_4.syms.
9369 (ver_test_4.syms): New target.
9370 * testsuite/Makefile.in: Rebuild.
9371
ab794b6b
ILT
9372 * output.cc
9373 (Output_section::Input_section_sort_entry::has_priority): New
9374 function.
9375 (Output_section::Input_section_sort_entry::match_file_name): New
9376 function.
9377 (Output_section::Input_section_sort_entry::match_section_name):
9378 Remove.
9379 (Output_section::Input_section_sort_entry::match_section_name_prefix):
9380 Remove.
9381 (Output_section::Input_section_sort_entry::match_section_file):
9382 Remove.
9383 (Output_section::Input_section_sort_compare::operator()): Rewrite
9384 using new Input_section_sort_entry functions. Sort crtbegin and
9385 crtend first. Sort sections with no priority before sections with
9386 a priority.
9387 * testsuite/initpri1.c (d3): Check j != 4.
9388 (cd5): New constructor/destructor function.
9389 (main): Check j != 2.
9390
479f6503
ILT
9391 * symtab.cc (Symbol_table::add_from_object): If we don't use the
9392 new symbol when resolving, don't call set_is_default.
9393 * testsuite/ver_test_7.cc: New file.
9394 * testsuite/ver_test_7.sh: New file.
9395 * testsuite/Makefile.am (ver_test_7.so): New target.
9396 (ver_test_7.o): New target.
9397 (check_SCRIPTS): Add ver_test_7.sh.
9398 (check_DATA): Add ver_test_7.syms.
9399 (ver_test_7.syms): New target.
9400
2fd32231
ILT
94012008-03-28 Ian Lance Taylor <iant@google.com>
9402
9403 * layout.cc (Layout::layout): If we see an input section with a
9404 name that needs sorting, set the must_sort flag for the output
9405 section.
9406 (Layout::make_output_section): If the name of the output section
9407 indicates that it might require sorting, set the may_sort flag.
9408 * output.h (Output_section::may_sort_attached_input_sections): New
9409 function.
9410 (Output_section::set_may_sort_attached_input_sections): New
9411 function.
9412 (Output_section::must_sort_attached_input_sections): New
9413 function.
9414 (Output_section::set_must_sort_attached_input_sections): New
9415 function.
9416 (class Output_section): Declare Input_section_sort_entry. Define
9417 Input_section_sort_compare. Declare
9418 sort_attached_input_sections. Add new fields:
9419 may_sort_attached_input_sections_,
9420 must_sort_attached_input_sections_,
9421 attached_input_sections_are_sorted_.
9422 * output.cc (Output_section::Output_section): Initialize new
9423 fields.
9424 (Output_section::add_input_section): Add an entry to
9425 input_sections_ if may_sort or must_sort are true.
9426 (Output_section::set_final_data_size): Call
9427 sort_attached_input_sections if necessary.
9428 (Output_section::Input_section_sort_entry): Define new class.
9429 (Output_section::Input_section_sort_compare::operator()): New
9430 function.
9431 (Output_section::sort_attached_input_sections): New function.
9432 * configure.ac: Check whether the compiler supports constructor
9433 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
9434 * testsuite/initpri1.c: New file.
9435 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
9436 CONSTRUCTOR_PRIORITY.
9437 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
9438 (initpri1_LDFLAGS): New variable.
9439 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9440
18e6b24e
ILT
94412008-03-27 Ian Lance Taylor <iant@google.com>
9442
49bdd526
ILT
9443 * common.cc (Sort_commons::operator): Correct sorting algorithm.
9444 * testsuite/common_test_1.c: New file.
9445 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
9446 (common_test_1_SOURCES): New variable.
9447 (common_test_1_DEPENDENCIES): New variable.
9448 (common_test_1_LDFLAGS): New variable.
9449
18e6b24e
ILT
9450 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
9451 and commons_ correctly when NAME/VERSION does not override
9452 NAME/NULL.
9453 * testsuite/ver_test_6.c: New file.
9454 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
9455 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
9456 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
9457
04bf7072
ILT
94582008-03-26 Ian Lance Taylor <iant@google.com>
9459
5871526f
ILT
9460 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
9461 of an undefined symbol from a version script.
9462 * testsuite/Makefile.am (ver_test_5.so): New target.
9463 (ver_test_5.o): New target.
9464 (check_SCRIPTS): Add ver_test_5.sh.
9465 (check_DATA): Add ver_test_5.syms.
9466 (ver_test_5.syms): New target.
9467 * testsuite/ver_test_5.cc: New file.
9468 * testsuite/ver_test_5.script: New file.
9469 * testsuite/ver_test_5.sh: New file.
9470 * Makefile.in, testsuite/Makefile.in: Rebuild.
9471
04bf7072
ILT
9472 PR gold/5986
9473 Fix problems building gold with gcc 4.3.0.
9474 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
9475 (gold_error_at_location, gold_warning_at_location): Use it.
9476 * configure.ac: Check whether we can compile and use a template
9477 function with a printf attribute.
9478 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
9479 when jumping over bytes.
9480 * object.cc: Instantiate Object::read_section_data.
9481 * debug.h: Include <cstring>
9482 * dwarf_reader.cc: Include <algorithm>
9483 * main.cc: Include <cstring>.
9484 * options.cc: Include <cstring>.
9485 * output.cc: Include <cstring>.
9486 * script.cc: Include <cstring>.
9487 * script.h: Include <string>.
9488 * symtab.cc: Include <cstring> and <algorithm>.
9489 * target-select.cc: Include <cstring>.
9490 * version.cc: Include <string>.
9491 * testsuite/testmain.cc: Include <cstdlib>.
9492 * configure, config.in: Rebuild.
9493
874c5b28
ILT
94942008-03-25 Ian Lance Taylor <iant@google.com>
9495
819d6c3a
ILT
9496 * options.cc: Include "../bfd/bfdver.h".
9497 (options::help): Print bug reporting address.
9498
f4b2c6f5
ILT
9499 * version.cc (print_version): Adjust output for current value of
9500 BFD_VERSION_STRING.
9501
9502 * NEWS: New file.
9503
e96caa79
ILT
9504 * options.cc (options::help): Print list of supported targets.
9505 * target-select.h: Include <vector>.
9506 (class Target_selector): Make machine_, size_, and is_big_endian_
9507 fields const. Add bfd_name_ and instantiated_target_ fields.
9508 (Target_selector::Target_selector): Add bfd_name parameter.
9509 (Target_selector::recognize): Make non-virtual, call
9510 do_recognize.
9511 (Target_selector::recognize_by_name): Make non-virtual, call
9512 do_recognize_by_name.
9513 (Target_selector::supported_names): New function.
9514 (Target_selector::bfd_name): New function.
9515 (Target_selector::do_instantiate_target): New pure virtual
9516 function.
9517 (Target_selector::do_recognize): New virtual function.
9518 (Target_selector::do_recognize_by_name): New virtual function.
9519 (Target_selector::instantiate_target): New private function.
9520 (supported_target_names): Declare.
9521 * target-select.cc (Target_selector::Target_selector): Update for
9522 new parameter and fields.
9523 (select_target_by_name): Check that the name matches before
9524 calling recognize_by_name.
9525 (supported_target_names): New function.
9526 * i386.cc (class Target_selector_i386): Update Target_selector
9527 constructor call. Remove recognize and recognize_by_name. Add
9528 do_instantiate_target.
9529 * x86_64.cc (class Target_selector_x86_64): Likewise.
9530 * testsuite/testfile.cc (class Target_selector_test): Update for
9531 changes to Target_selector.
9532
874c5b28
ILT
9533 * README: Rewrite, with some notes on unsupported features.
9534
0a65a3a7
CC
95352008-03-24 Cary Coutant <ccoutant@google.com>
9536
9537 * i386.cc (Target_i386::Got_type): New enum declaration.
9538 (Target_i386::Scan::local): Updated callers of Output_data_got
9539 member functions.
9540 (Target_i386::Scan::global): Likewise.
9541 (Target_i386::Relocate::relocate): Likewise.
9542 (Target_i386::Relocate::relocate_tls): Likewise.
9543 * object.h (Got_offset_list): New class.
9544 (Sized_relobj::local_has_got_offset): Added got_type parameter.
9545 (Sized_relobj::local_got_offset): Likewise.
9546 (Sized_relobj::set_local_got_offset): Likewise.
9547 (Sized_relobj::local_has_tls_got_offset): Removed.
9548 (Sized_relobj::local_tls_got_offset): Removed.
9549 (Sized_relobj::set_local_tls_got_offset): Removed.
9550 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
9551 * output.cc (Output_data_got::add_global): Added got_type parameter.
9552 (Output_data_got::add_global_with_rel): Likewise.
9553 (Output_data_got::add_global_with_rela): Likewise.
9554 (Output_data_got::add_global_pair_with_rel): New function.
9555 (Output_data_got::add_global_pair_with_rela): New function.
9556 (Output_data_got::add_local): Added got_type parameter.
9557 (Output_data_got::add_local_with_rel): Likewise.
9558 (Output_data_got::add_local_with_rela): Likewise.
9559 (Output_data_got::add_local_pair_with_rel): New function.
9560 (Output_data_got::add_local_pair_with_rela): New function.
9561 (Output_data_got::add_global_tls): Removed.
9562 (Output_data_got::add_global_tls_with_rel): Removed.
9563 (Output_data_got::add_global_tls_with_rela): Removed.
9564 (Output_data_got::add_local_tls): Removed.
9565 (Output_data_got::add_local_tls_with_rel): Removed.
9566 (Output_data_got::add_local_tls_with_rela): Removed.
9567 * output.h (Output_data_got::add_global): Added got_type parameter.
9568 (Output_data_got::add_global_with_rel): Likewise.
9569 (Output_data_got::add_global_with_rela): Likewise.
9570 (Output_data_got::add_global_pair_with_rel): New function.
9571 (Output_data_got::add_global_pair_with_rela): New function.
9572 (Output_data_got::add_local): Added got_type parameter.
9573 (Output_data_got::add_local_with_rel): Likewise.
9574 (Output_data_got::add_local_with_rela): Likewise.
9575 (Output_data_got::add_local_pair_with_rel): New function.
9576 (Output_data_got::add_local_pair_with_rela): New function.
9577 (Output_data_got::add_global_tls): Removed.
9578 (Output_data_got::add_global_tls_with_rel): Removed.
9579 (Output_data_got::add_global_tls_with_rela): Removed.
9580 (Output_data_got::add_local_tls): Removed.
9581 (Output_data_got::add_local_tls_with_rel): Removed.
9582 (Output_data_got::add_local_tls_with_rela): Removed.
9583 * resolve.cc (Symbol::override_base_with_special): Removed
9584 reference to has_got_offset_ field.
9585 * symtab.cc (Symbol::init_fields): Replaced initialization
9586 of got_offset_ with got_offsets_. Removed initialization
9587 of has_got_offset_
53fcba31 9588 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
9589 (Symbol::got_offset): Likewise.
9590 (Symbol::set_got_offset): Likewise.
9591 (Symbol::has_tls_got_offset): Removed.
9592 (Symbol::tls_got_offset): Removed.
9593 (Symbol::set_tls_got_offset): Removed.
9594 (Symbol::got_offset_): Removed.
9595 (Symbol::tls_mod_got_offset_): Removed.
9596 (Symbol::tls_pair_got_offset_): Removed.
9597 (Symbol::got_offsets_): New field.
9598 (Symbol::has_got_offset): Removed.
9599 (Symbol::has_tls_mod_got_offset): Removed.
9600 (Symbol::has_tls_pair_got_offset): Removed.
9601 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
9602 (Target_x86_64::Scan::local): Updated callers of Output_data_got
9603 member functions.
9604 (Target_x86_64::Scan::global): Likewise.
9605 (Target_x86_64::Relocate::relocate): Likewise.
9606 (Target_x86_64::Relocate::relocate_tls): Likewise.
9607
bd52eafb
BE
96082008-03-25 Ben Elliston <bje@au.ibm.com>
9609
9610 * yyscript.y: Fix spelling error in comment.
9611
8b105e34
ILT
96122008-03-24 Ian Lance Taylor <iant@google.com>
9613
8ed814a9
ILT
9614 * options.h (class General_options): Define build_id option.
9615 * layout.h (class Layout): Declare write_build_id, create_note,
9616 create_build_id. Add build_id_note_ member.
9617 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
9618 "libiberty.h", "md5.h", "sha1.h".
9619 (Layout::Layout): Initialize eh_frame_data_,
9620 eh_frame_hdr_section_, and build_id_note_.
9621 (Layout::finalize): Call create_build_id.
9622 (Layout::create_note): New function, broken out of
9623 Layout::create_gold_note.
9624 (Layout::create_gold_note): Call create_note.
9625 (Layout::create_build_id): New function.
9626 (Layout::write_build_id): New function.
9627 (Close_task_runner::run): Call write_build_id.
9628
8b105e34
ILT
9629 * x86_64.cc: Correct license to GPLv3.
9630
086a1841
ILT
96312008-03-23 Ian Lance Taylor <iant@google.com>
9632
9633 * options.cc: Include "demangle.h".
9634 (parse_optional_string): New function.
9635 (parse_long_option): Handle takes_optional_argument.
9636 (parse_short_option): Update dash_z initializer. Handle
9637 takes_optional_argument.
9638 (General_options::General_options): Initialize do_demangle_.
9639 (General_options::finalize): Set do_demangle_. Handle demangling
9640 style.
9641 * options.h (parse_optional_string): Declare.
9642 (struct One_option): Add optional_arg field. Update constructor.
9643 Update call constructor calls. Add takes_optional_argument
9644 function.
9645 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
9646 (DEFINE_optional_string): Define.
9647 (General_options::demangle): Change from DEFINE_bool to
9648 DEFINE_optional_string.
9649 (General_options::no_demangle): New function.
9650 (General_options::do_demangle): New function.
9651 (General_options::set_do_demangle): New function.
9652 (General_options::execstack_status_): Move definition to end of
9653 class definition.
9654 (General_options::static_): Likewise.
9655 (General_options::do_demangle_): New field.
9656 * object.cc (big_endian>::get_symbol_location_info): Call
9657 Options::do_demangle, not Options::demangle.
9658 * symtab.cc (demangle): Likewise.
9659
cbb93e63
ILT
96602008-03-22 Ian Lance Taylor <iant@google.com>
9661
9662 * gold.h: Include <cstddef> and <sys/types.h>
9663 * options.h: Include <cstring>.
9664
ec531623
ILT
96652008-03-21 Ian Lance Taylor <iant@google.com>
9666
9667 * Added source code to GNU binutils.
This page took 0.572476 seconds and 4 git commands to generate.