1 2011-03-09 Jeffrey Yasskin <jyasskin@google.com>
3 * dwarf_reader.cc (Sized_dwarf_line_info): Include all lines,
4 but mark earlier ones as non-canonical
5 (offset_to_iterator): Update search target and example
6 (do_addr2line): Return extra lines in a vector*
7 (format_file_lineno): Extract from do_addr2line
8 (one_addr2line): Add vector* out-param
9 * dwarf_reader.h (Offset_to_lineno_entry): New field recording
10 when a lineno entry appeared last for its instruction
11 (Dwarf_line_info): Add vector* out-param
12 * object.cc (Relocate_info): Pass NULL for the vector* out-param
13 * symtab.cc (Odr_violation_compare): Include the lineno in the
15 (linenos_from_loc): New. Combine the canonical line for an
16 address with its other lines.
17 (True_if_intersect): New. Helper functor to make
18 std::set_intersection a query.
19 (detect_odr_violations): Compare sets of lines instead of just
20 one line for each function. This became less deterministic, but
21 has fewer false positives.
22 * symtab.h: Declarations.
23 * testsuite/Makefile.am (odr_violation2.o): Compile with -O2 to
24 mix an optimized and non-optimized object in the same binary
25 (odr_violation2.so): Same.
26 * testsuite/Makefile.in: Regenerate from Makefile.am.
27 * testsuite/debug_msg.cc (main): Make OdrDerived classes.
28 * testsuite/debug_msg.sh: Update line numbers and add
30 * testsuite/odr_violation1.cc: Use OdrDerived, in a
31 non-optimized context.
32 * testsuite/odr_violation2.cc: Make sure Ordering::operator()
33 isn't inlined, and use OdrDerived in an optimized context.
34 * testsuite/odr_header1.h: Defines OdrDerived, where
35 optimization will change the
36 first-instruction-in-the-destructor's file and line number.
37 * testsuite/odr_header2.h: Defines OdrBase.
39 2011-03-09 Ian Lance Taylor <iant@google.com>
41 * fileread.cc (File_read::clear_views): Don't delete the whole
44 2011-03-08 Ian Lance Taylor <iant@google.com>
47 * fileread.cc: #include <climits>.
48 (GOLD_IOV_MAX): Define.
49 (File_read::read_multiple): Limit number of entries by iov_max.
50 * fileread.h (class File_read): Always set max_readv_entries to
53 2011-03-07 Ian Lance Taylor <iant@google.com>
56 * options.h (class General_options): Add -dy and -dn.
58 2011-03-02 Cary Coutant <ccoutant@google.com>
60 * testsuite/script_test_9.t: Add TLS segment.
62 2011-03-02 Simon Baldwin <simonb@google.com>
64 * configure.ac: Add check for gnu_indirect_function support in
65 the toolchain building binutils.
68 2010-02-18 Rafael Ávila de Espíndola <respindola@mozilla.com>
70 * symtab.cc (Symbol::should_add_dynsym_entry) Return false for
72 (Symbol_table::sized_finalize_symbol) Mark symbol only present
73 in plugin files as not needed in the symbol table.
75 2011-02-11 Sriraman Tallam <tmsriram@google.com>
77 * output.cc (Output_section::add_input_section): Delay fill
78 generation for section ordering.
80 2011-02-09 Ian Lance Taylor <iant@google.com>
83 * object.h (class Sized_relobj): Remove clear_local_symbols.
84 * reloc.cc (Sized_relobj::do_relocate): Don't call
87 2010-02-08 Rafael Ávila de Espíndola <respindola@mozilla.com>
89 * plugin.cc (is_visible_from_outside): Return true for symbols
92 2011-02-04 Jeffrey Yasskin <jyasskin@google.com>
94 * symtab.cc (Odr_violation_compare::operator()): Sort by just the
97 2011-02-02 Sriraman Tallam <tmsriram@google.com>
99 * icf.h (is_section_foldable_candidate): Change type of parameter
101 * icf.cc (Icf::find_identical_sections): Change type of local variable
102 section_name to be std::string.
103 (is_function_ctor_or_dtor): Change type of parameter to std::string.
105 2011-01-25 Ian Lance Taylor <iant@google.com>
107 * script.cc (script_add_extern): Rewrite to use
108 add_symbol_reference.
110 2011-01-25 Doug Kwan <dougkwan@google.com>
112 * icf.cc (get_section_contents): Always lock section's object.
114 2011-01-24 Ian Lance Taylor <iant@google.com>
116 * options.h (class General_options): Accept
117 --no-detect-odr-violations.
119 2011-01-24 Ian Lance Taylor <iant@google.com>
121 * version.cc (version_string): Bump to 1.11.
123 2011-01-24 Ian Lance Taylor <iant@google.com>
125 * plugin.cc (class Plugin_rescan): Define new class.
126 (Plugin_manager::claim_file): Set any_claimed_.
127 (Plugin_manager::save_archive): New function.
128 (Plugin_manager::save_input_group): New function.
129 (Plugin_manager::all_symbols_read): Create Plugin_rescan task if
131 (Plugin_manager::new_undefined_symbol): New function.
132 (Plugin_manager::rescan): New function.
133 (Plugin_manager::rescannable_defines): New function.
134 (Plugin_manager::add_input_file): Set any_added_.
135 * plugin.h (class Plugin_manager): define new fields rescannable_,
136 undefined_symbols_, any_claimed_, and any_added_. Declare
137 Plugin_rescan as friend. Declare new functions.
138 (Plugin_manager::Rescannable): Define type.
139 (Plugin_manager::Rescannable_list): Define type.
140 (Plugin_manager::Undefined_symbol_list): Define type.
141 (Plugin_manager::Plugin_manager): Initialize new fields.
142 * archive.cc (Archive::defines_symbol): New function.
143 (Add_archive_symbols::run): Pass archive to plugins if any.
144 * archive.h (class Archive): Declare defines_symbol.
145 * readsyms.cc (Input_group::~Input_group): New function.
146 (Finish_group::run): Pass input_group to plugins if any.
147 * readsyms.h (class Input_group): Declare destructor.
148 * symtab.cc (add_from_object): Pass undefined symbol to plugins if
151 2011-01-10 Ian Lance Taylor <iant@google.com>
153 * layout.cc (Layout::layout_eh_frame): Mark a writable .eh_frame
155 (Layout::set_segment_offsets): Reset increase_relro before calling
156 set_section_addresses a second time.
158 2011-01-04 Cary Coutant <ccoutant@google.com>
160 * script-sections.cc (Sort_output_sections::operator()): Sort TLS
161 sections before NOBITS sections.
163 2011-01-01 H.J. Lu <hongjiu.lu@intel.com>
165 * version.cc (print_version): Update copyright to 2011.
167 2010-12-23 Cary Coutant <ccoutant@google.com>
169 * output.h (Output_data_reloc::add_output_section): Pass OD instead
170 of OS to this->add. Add OD parameter to second form of the function.
172 2010-12-20 Ian Lance Taylor <iant@google.com>
174 * dwarf_reader.cc (Sized_dwarf_line_info::read_lines): Only keep
175 second of two consecutive entries with same offset.
177 2010-12-16 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
179 * testsuite/Makefile.am (ifuncmain2static_LDADD)
180 (ifuncmain2_LDADD, ifuncmain4static_LDADD, ifuncmain4_LDADD)
181 (ifuncmain7static_LDADD, ifuncmain7_LDADD): New empty variables,
182 to avoid unneeded links against $(LDADD).
183 * testsuite/Makefile.in: Regenerate.
185 2010-12-15 Ian Lance Taylor <iant@google.com>
188 * x86_64.cc (Target_x86_64::Scan::check_non_pic): Give an error
189 for R_X86_64_32 and R_X86_64_PC32.
190 * testsuite/Makefile.am (ver_matching_def.so): Depend on and use
191 ver_matching_def_pic.o.
192 (ver_matching_def_pic.o): New target.
194 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
196 * fileread.cc (file_counts_lock, file_counts_initialize_lock)
197 (total_mapped_bytes, current_mapped_bytes, maximum_mapped_bytes):
198 Move definition before File_read::View member definitions.
199 (File_read::View::~View): Initialize and hold lock before
200 updating current_mapped_bytes.
202 2010-12-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
204 * dwarf_reader.cc: Remove outdated comment.
205 * gold-threads.cc: Fix typo in error message.
206 * archive.cc: Fix typos in comments.
207 * archive.h: Likewise.
208 * arm-reloc-property.cc: Likewise.
209 * arm-reloc-property.h: Likewise.
210 * arm-reloc.def: Likewise.
212 * attributes.h: Likewise.
214 * ehframe.cc: Likewise.
215 * fileread.h: Likewise.
219 * incremental.h: Likewise.
220 * int_encoding.cc: Likewise.
221 * layout.h: Likewise.
224 * object.cc: Likewise.
225 * object.h: Likewise.
226 * options.cc: Likewise.
227 * readsyms.cc: Likewise.
228 * reduced_debug_output.cc: Likewise.
229 * reloc.cc: Likewise.
230 * script-sections.cc: Likewise.
231 * sparc.cc: Likewise.
232 * symtab.h: Likewise.
233 * target-reloc.h: Likewise.
234 * target.cc: Likewise.
235 * target.h: Likewise.
236 * timer.cc: Likewise.
238 * x86_64.cc: Likewise.
240 2010-12-09 Cary Coutant <ccoutant@google.com>
242 * layout.cc (Layout::layout_gnu_stack): Add warnings for executable
244 * layout.h (Layout::layout_gnu_stack): Add pointer to Object
245 parameter; change all callers.
246 * object.cc (Sized_relobj::do_layout): Adjust call to layout_gnu_stack.
247 * options.h (warn_execstack): New option.
249 2010-12-07 Doug Kwan <dougkwan@google.com>
251 * arm.cc (Target_arm::Scan::get_reference_flags): Treat R_ARM_PREL31
252 like function call relocations.
254 2010-12-07 Ian Lance Taylor <iant@google.com>
256 * archive.cc (Archive::get_elf_object_for_member): Permit
257 punconfigured to be NULL.
258 (Archive::read_symbols): Pass NULL to get_elf_object_for_member.
259 (Archive::include_member): Pass NULL to get_elf_object_for_member
260 if we searched for the archive and this is the first included
263 2010-12-01 Ian Lance Taylor <iant@google.com>
265 * dwarf_reader.h (class Sized_dwarf_line_info): Add
266 track_relocs_type_ field.
267 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
268 Set track_relocs_type_.
269 (Sized_dwarf_line_info::process_one_opcode): Ignore the section
270 contents when using RELA relocs.
271 (Sized_dwarf_line_info::read_relocs): Add the reloc addend to
273 * reloc.cc (Track_relocs::next_addend): New function.
274 * reloc.h (class Track_relocs): Declare next_addend.
276 2010-12-01 Ian Lance Taylor <iant@google.com>
278 * testsuite/icf_virtual_function_folding_test.cc (class Bar): Add
281 2010-12-01 Ian Lance Taylor <iant@google.com>
283 * README: Update compilers known to work and fail.
285 2010-11-23 Matthias Klose <doko@ubuntu.com>
287 * configure.in: For --enable-gold, handle value `default' instead of
288 `both*'. Always install ld as ld.bfd, install as ld if gold is
290 * configure: Regenerate.
292 2010-11-18 Doug Kwan <dougkwan@google.com>
294 * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
295 and right_alignment to be zero. Store result alignment only if it is
296 greater than existing alignment.
298 2010-11-16 Cary Coutant <ccoutant@google.com>
301 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
302 Check for ".zdebug_line".
304 2010-11-16 Doug Kwan <dougkwan@google.com>
305 Cary Coutant <ccoutant@google.com>
307 * output.h (Output_segment::set_section_addresses): Pass increase_relro
308 by reference; adjust all callers.
309 * output.cc (Output_segment::set_section_addresses): Adjust references
310 to increase_relro. Add padding to *increase_relro when ORDER_RELRO_LAST
312 (Output_segment::set_offset): Assert if PT_GNU_RELRO segment does not
313 end at page boundary.
315 2010-11-16 Cary Coutant <ccoutant@google.com>
318 * layout.cc (Layout::choose_output_section): Transform names of
319 compressed sections even when using a script with a SECTIONS clause.
320 (Layout::output_section_name): Remove code to transform
321 compressed debug section names.
322 * output.cc (Output_section::add_input_section): Use uncompressed
323 section size when tracking input sections.
325 2010-11-11 Richard Sandiford <richard.sandiford@linaro.org>
327 * symtab.h (Symbol::NON_PIC_REF): Remove.
328 (Symbol::RELATIVE_REF, Symbol::TLS_REF): New Reference_flags.
329 (Symbol::FUNCTION_CALL): Renumber. Reword comment.
330 (Symbol::needs_dynamic_reloc): Don't check NON_PIC_REF.
331 (Symbol::use_plt_offset): Take a flags argument and pass it
332 directly to needs_dynamic_reloc. Restrict check for undefined
333 weak symbols to function calls.
334 * arm.cc (Target_arm::Scan::get_reference_flags): New function.
335 (Target_arm::Scan::global): Use it.
336 (Target_arm::Scan::scan_reloc_for_stub): Likewise.
337 (Target_arm::Relocate::relocate): Likewise.
338 (Target_arm::Relocate::should_apply_static_reloc): Replace flags
339 parameter with an r_type parameter. Use get_reference_flags
341 (Target_arm::Relocate::relocate): Update accordingly.
342 * i386.cc (Target_i386::Scan::get_reference_flags): New function.
343 (Target_i386::Scan::reloc_needs_plt_for_ifunc): Use it.
344 (Target_i386::Scan::global): Likewise.
345 (Target_i386::Relocate::relocate): Likewise.
346 (Target_i386::Relocate::should_apply_static_reloc): Replace flags
347 parameter with an r_type parameter. Use get_reference_flags
349 (Target_i386::Relocate::relocate): Update accordingly.
350 * powerpc.cc (Target_powerpc::Scan::get_reference_flags): New function.
351 (Target_powerpc::Scan::global): Use it.
352 (Target_powerpc::Scan::scan_reloc_for_stub): Likewise.
353 (Target_powerpc::Relocate::relocate): Likewise.
354 * sparc.cc (Target_sparc::Scan::get_reference_flags): New function.
355 (Target_sparc::Scan::global): Use it.
356 (Target_sparc::Scan::scan_reloc_for_stub): Likewise.
357 (Target_sparc::Relocate::relocate): Likewise.
358 * x86_64.cc (Target_x86_64::Scan::get_reference_flags): New function.
359 (Target_x86_64::Scan::reloc_needs_plt_for_ifunc): Use it.
360 (Target_x86_64::Scan::global): Likewise.
361 (Target_x86_64::Relocate::relocate): Likewise.
363 2010-11-08 Doug Kwan <dougkwan@google.com>
364 Cary Coutant <ccoutant@google.com>
366 * arm.cc (Arm_exidx_merge_section::build_contents): New method.
367 (Arm_exidx_merge_section::section_contents_): New data member.
368 (Arm_input_section::Arm_input_section): Initialize original_contents_.
369 (Arm_input_section::~Arm_input_section): De-allocate memory.
370 (Arm_input_section::original_contents_): New data member.
371 (Arm_exidx_fixup::process_exidx_section): Pass EXIDX section contents
372 in parameters instead of calling Object::section_contents without
374 (Arm_output_section::group_section): New parameter TASK. Pass it
375 to callees that need locking objects.
376 (Arm_output_section::fix_exidx_coverage): New parameter TASK. Use it
377 to lock EXIDX input sections. Fix a formatting issue. Call
378 Arm_exidx_merged_section::build_contents to create merged section
380 (Arm_output_section::create_stub_group): New parameter TASK. Use it
381 to lock object of stub table owner.
382 (Arm_exidx_input_section::Arm_exidx_input_section): Add new parameter
383 TEXT_SIZE to initialize data member TEXT_SIZE_.
384 (Arm_exidx_input_section::addralign): Fix typo in comment.
385 (Arm_exidx_input_section::text_size): New method.
386 (Target_arm::do_relax): New parameter TASK. Pass it to callees
387 that require locking objects. Lock objects before scanning for stubs
388 and updating local symbols.
389 (Arm_input_section<big_endian>::init): Copy contents of original
391 (Arm_input_section<big_endian>::do_write): Use saved contents of
392 original input section instead of calling Object::section_contents
394 (Arm_exidx_cantunwind::do_fixed_endian_write): Find out text section
395 size without calling Object::section_size().
396 (Arm_exidx_merged_section::Arm_exidx_merged_section): Add sanity check
397 for size. Allocate a buffer for merged EXIDX entries.
398 (Arm_exidx_merged_section::build_contents): New method.
399 (Arm_exidx_merged_section::do_write): Move merge section contents
400 building code to Arm_exidx_merged_section::build_contetns. Write
401 out contetns in buffer instead of building it on the fly.
402 (Arm_relobj::make_exidx_input_section): Also pass text section size
403 to Arm_exidx_input_section constructor.
404 (Arm_relobj::do_read_symbols): Fix memory leak. Fix a formatting issue.
405 (Arm_dynobj::do_read_symbols): Fix memory leak.
406 * layout.cc (Layout::finalize): Pass TASK to Target::relax().
407 * target.h: (class Task): Add forward declaration.
408 (Target::relax): Add new parameter TASK and pass it to
410 (Target::do_relax):: New parameter TASK. Fix a formatting issue.
412 2010-11-05 Cary Coutant <ccoutant@google.com>
415 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Hold a lock on the
416 object when reading from the file.
417 * gold.cc (queue_middle_tasks): Hold a lock on the object when doing
419 * icf.cc (preprocess_for_unique_sections): Hold a lock on the object
420 when reading section contents.
421 (get_section_contents): Likewise.
422 (icf::find_identical_sections): Likewise.
423 * mapfile.cc (Mapfile::print_discarded_sections): Hold a lock on the
424 object when reading from the file.
425 * plugin.cc (Plugin_manager::layout_deferred_objects): Hold a lock on
426 the object when doing deferred section layout.
428 2010-11-03 Nick Clifton <nickc@redhat.com>
431 * script.h (class Symbol_assignment: name): New member. Returns
432 the name of the symbol.
433 * scrfipt.cc (Script_options::is_pending_assignment): New member.
434 Returns true if the given symbol name is on the list of
435 assignments wating to be processed.
436 * archive.cc (should_incldue_member): If the symbol is undefined,
437 check to see if it is on the list of symbols pending assignment.
439 2010-11-03 Ryan Mansfield <rmansfield@qnx.com>
441 * script-sections.cc (Script_sections::find_memory_region): Check
442 for a NULL output section pointer.
444 2010-10-29 Doug Kwan <dougkwan@google.com>
446 * arm.cc (Arm_outout_section::fix_exidx_coverage): Adjust call to
447 Output_section::add_relaxed_input_section.
448 * output.cc (Output_section::add_relaxed_input_section): Add new
449 arguments LAYOUT and NAME. Set section order index.
450 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
451 Copy section order index.
452 * output.h (Output_section::add_relaxed_input_section): Add new
453 arguments LAYOUT and NAME.
455 2010-10-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
457 * testsuite/Makefile.am: Move gcctestdir/ld rule to
458 NATIVE_OR_CROSS_LINKER.
459 * testsuite/Makefile.in: Regenerate.
461 2010-10-20 Doug Kwan <dougkwan@google.com>
463 * arm.cc (Arm_relobj::do_read_symbols): Warn about ARM EXIDX sections
464 without SHF_LINK_ORDER flags.
465 * layout.cc (Layout::choose_output_section): Do not filter
466 SHF_LINK_ORDER flag in a relocatable link.
468 2010-10-17 Cary Coutant <ccoutant@google.com>
470 * output.h (Output_segment::set_section_addresses): Change function
471 signature. Update all callers.
472 * output.cc (Output_segment::is_first_section_relro): Ignore TLS
474 (Output_segment::set_section_addresses): Align after last TLS
475 section. Add padding before last relro section instead of after.
477 2010-10-17 Doug Kwan <dougkwan@google.com>
479 * gold/arm.cc (Target_arm::got_section): Use correct order and set
480 GOT output section to be writable.
482 2010-10-14 Cary Coutant <ccoutant@google.com>
484 * debug.h (DEBUG_INCREMENTAL): New flag.
485 (debug_string_to_enum): Add DEBUG_INCREMENTAL).
486 * gold.cc (queue_initial_tasks): Check parameters for incremental link
488 * incremental.cc (report_command_line): Ignore all forms of
490 * layout.cc (Layout::Layout): Check parameters for incremental link
492 * options.cc (General_options::parse_incremental): New function.
493 (General_options::parse_no_incremental): New function.
494 (General_options::parse_incremental_full): New function.
495 (General_options::parse_incremental_update): New function.
496 (General_options::incremental_mode_): New data member.
497 (General_options::finalize): Check incremental_mode_.
498 * options.h (General_options): Update help text for --incremental.
499 Add --no-incremental, --incremental-full, --incremental-update.
500 (General_options::Incremental_mode): New enum type.
501 (General_options::incremental_mode): New function.
502 (General_options::incremental_mode_): New data member.
503 * parameters.cc (Parameters::incremental_mode_): New data member.
504 (Parameters::set_options): Set incremental_mode_.
505 (Parameters::set_incremental_full): New function.
506 (Parameters::incremental): New function.
507 (Parameters::incremental_update): New function.
508 (set_parameters_incremental_full): New function.
509 * parameters.h (Parameters::set_incremental_full): New function.
510 (Parameters::incremental): New function.
511 (Parameters::incremental_update): New function.
512 (Parameters::incremental_mode_): New data member.
513 (set_parameters_incremental_full): New function.
514 * plugin.cc (Plugin_manager::add_input_file): Check parameters for
515 incremental link mode.
516 * reloc.cc (Sized_relobj::do_read_relocs): Likewise.
517 (Sized_relobj::do_relocate_sections): Likewise.
518 * testsuite/Makefile.am (incremental_test): Use --incremental-full
520 * testsuite/Makefile.in: Regenerate.
521 * testsuite/incremental_test.sh: Filter all forms of --incremental.
523 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
525 * script-sections.h (class Script_sections): Make
526 Sections_elements typedef public.
527 * script-sections.cc (class Sort_output_sections): Add elements_
528 field. Add constructor which sets it; change all callers.
529 (Sort_output_sections::is_before): New function.
530 (Sort_output_sections::operator()): Call is_before.
531 * configure.ac (NATIVE_OR_CROSS_LINKER): New automake
533 * testsuite/script_test_10.sh: New test. Test script section
535 * testsuite/script_test_10.t: Likewise.
536 * testsuite/script_test_10.s: Likewise.
537 * testsuite/Makefile.am: Wrap the cross linker tests and the
538 common tests into NATIVE_OR_CROSS_LINKER.
539 (check_SCRIPTS): Add script_test_10.sh.
540 (check_DATA): Add script_test_10.stdout.
541 (script_test_10.o, script_test_10): New targets.
542 (script_test_10.stdout): New target.
543 * configure, testsuite/Makefile.in: Regenerate.
545 2010-10-12 Viktor Kutuzov <vkutuzov@accesssoftek.com>
547 * arm.cc (Target_arm::Scan::local): Report the unsupported reloc
548 error for the deprecated relocations.
549 (Target_arm::Scan::global): Likewise.
550 (Target_arm::Relocate::relocate): Likewise.
552 2010-10-12 Richard Sandiford <richard.sandiford@linaro.org>
554 * fileread.cc (Input_file::find_file): Initialize *found_name
555 and *namep when using the fallback search for case 4.
557 2010-10-11 Cary Coutant <ccoutant@google.com>
559 * options.h (class General_options): Redefine -z lazy as an alias for
560 the negation of -z now.
562 2010-10-11 Ian Lance Taylor <iant@google.com>
564 * resolve.cc (symbol_to_bits): Report the value of the unsupported
567 2010-10-06 Nick Clifton <nickc@redhat.com>
569 * script-sections.cc(class Memory_region): Remove
570 current_lma_offset_ field. Rename current_vma_offset_ to
571 current_offset_. Add last_section_ field.
572 (Memory_region::get_current_vma_address): Rename to
574 (Memory_region::get_current_lma_address): Delete.
575 (Memory_region::increment_vma_offset): Rename to
577 (Memory_region::increment_lma_offset): Delete.
578 (Memory_region::attributes_compatible): New method. Returns
579 true if the provided section is compatible with the region.
580 (Memory_region::get_last_section): New method. Returns the last
581 section to use the region.
582 (Memory_region::set_last_section): New method. Stores the last
583 section to use the region.
584 (Script_sections::block_in_region): New method. Returns true if
585 a block of memory is contained within a region.
586 (Script_sections::find_memory_region): New method. Locates a
587 memory region to be used to set a VMA or LMA address.
588 (Output_section_definition::set_section_addresses): Add code to
589 check for addresses set by memory regions.
590 (Output_segment::set_section_addresses): Remove memory region
592 (Script_sections::create_segment): Add a warning if a header
593 segment is created outside of any region.
594 * script-sections.h (class Script_sections): Add prototypes for
595 find_memory_region and block_in_region methods.
596 * testsuite/memory_test.s: Use .long instead of .word.
597 * testsuite/memory_test.t: Add some more output sections.
598 * testsuite/memory_test.sh: Update expected output.
600 2010-10-02 Doug Kwan <dougkwan@google.com>
602 * symtab.cc (Symbol_table::Symbol_table_hash::operator()): Move
603 defintion to symtab.h
604 * symtab.h (Symbol_table::Symbol_table_hash::operator()): Change
605 declaration to defintion.
607 2010-10-01 Nick Clifton <nickc@redhat.com>
609 * expression.cc (eval): Replace dummy argument with NULL.
610 (eval_maybe_dot): Check for a NULL result section pointer.
611 (Symbol_expression::value): Likewise.
612 (Dot_expression::value): Likewise.
613 (BINARY_EXPRESSION): Likewise.
614 (Max_expression::value): Likewise.
615 (Min_expression::value): Likewise.
616 (Absolute_expression::value): Likewise.
617 (Addr_expression::value_from_output_section): Likewise.
618 (Loaddddr_expression::value_from_output_section): Likewise.
619 (Segment_start_expression::value): Likewise.
621 (Sections_elememt_dot_assignment::finalize_symbols): Replace dummy
623 (Sections_elememt_dot_assignment::set_section_addresses):
625 (Output_data_expression::do_write_to_buffer): Likewise.
626 (Output_section_definition::finalize_symbols): Likewise.
627 (Output_section_definition::set_section_addresses): Likewise.
629 2010-09-30 Doug Kwan <dougkwan@google.com>
631 * gold/testsuite/arm_branch_out_of_range.sh: Fix broken tests.
633 2010-09-28 Sriraman Tallam <tmsriram@google.com>
635 * target.h (Target::can_icf_inline_merge_sections): New virtual
637 * x86_64.cc (Target__x86_64::can_icf_inline_merge_sections): New
639 * i386.cc (Target_i386::can_icf_inline_merge_sections): New
641 * icf.cc (get_section_contents): Inline merge sections only when
644 2010-09-27 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
646 * configure: Regenerate.
648 2010-09-17 Ian Lance Taylor <iant@google.com>
650 * testsuite/memory_test.sh: Adjust for change of 2010-09-10.
651 * testsuite/Makefile.am (memory_test.o): New target.
652 (memory_test): Depend on memory_test.o, gcctestdir/ld, and
654 * testsuite/Makefile.in: Rebuild.
656 2010-09-17 Doug Kwan <dougkwan@google.com>
658 * arm.cc (Target_arm::Relocate::relocate): Ignore symbol type and
659 defintion if relocation uses GOT entries of the symbol.
660 * testsuite/icf_safe_test.sh: Fix test.
661 * testsuite/icf_safe_so_test.sh: Fix test.
663 2010-09-16 Cary Coutant <ccoutant@google.com>
665 * script_sections.cc (class Memory_region): Remove "NULL" from
666 vector initializations.
668 2010-09-15 Cary Coutant <ccoutant@google.com>
670 * incremental.cc (Output_section_incremental_inputs::write_info_blocks):
671 Resolve forwarding symbols.
673 2010-09-15 Doug Kwan <dougkwan@google.com>
675 * gold/testsuite/script_test_3.t: Add ARM special sections.
676 * gold/testsuite/script_test_4.t: Same.
677 * gold/testsuite/script_test_5.t: Same.
678 * gold/testsuite/script_test_6.t: Same.
679 * gold/testsuite/script_test_7.t: Same.
680 * gold/testsuite/script_test_7.t: Same.
681 * gold/testsuite/thumb_blx_out_of_range.s: Fix instruction alignment.
683 2010-09-14 Cary Coutant <ccoutant@google.com>
685 * x86_64.cc (Target_x86_64::saw_tls_block_reloc_): Remove member.
686 (Target_x86_64::Relocate::relocate_tls): Replace check for
687 saw_tls_block_reloc_ with test for executable section.
689 2010-09-12 Cary Coutant <ccoutant@google.com>
691 * symtab.h (Symbol::needs_dynamic_reloc): Non-PIC calls from
692 position-independent executables to shared libraries need dynamic
694 (Symbol::may_need_copy_reloc): Do not generate COPY relocs in
695 position-independent executables.
696 * testsuite/Makefile.am (two_file_mixed_pie_test): New test.
697 * testsuite/Makefile.in: Regenerate.
699 2010-09-10 Nick Clifton <nickc@redhat.com>
702 * testsuite/memory_test.t: Discard any sections that are not
705 2010-09-09 H.J. Lu <hongjiu.lu@intel.com>
708 * object.cc (Sized_relobj::do_finalize_local_symbols): Remove
709 "This::" to work around a bug in gcc 4.2.
711 * testsuite/ifuncmain7.c (foo_ifunc): Add __attribute__ ((used)).
713 2010-09-09 Rafael Espindola <espindola@google.com>
715 * layout.cc (Layout::attach_allocated_section_to_segment): Don't put
716 sections with different PF_X flags in the same segment.
717 (Layout::find_first_load_seg): Search all segments to find the first
719 * options.h (rosegment): New.
721 2010-09-08 Rafael Espindola <espindola@google.com>
723 * layout.cc (Layout::set_segment_offsets): Always advance to a new page.
725 2010-09-08 Doug Kwan <dougkwan@google.com>
727 * arm.cc (Arm_exidx_cantunwind::do_print_to_mapfile): New method.
728 (Arm_relobj::do_relocate_sections): Add new parameter for output
729 file to match the parent.
730 (Target_arm::scan_reloc_section_for_stubs): Use would-be final values
731 of local symbols instead of input values. Update code to track
732 changes in gold::relocate_section.
733 * object.cc (Sized_relobj::compute_final_local_value): New methods.
734 (Sized_relobj::compute_final_local_value_internal): New methods.
735 (Sized_relobj::do_finalize_local_symbols): Move code from loop
736 body into private version of Sized_relobj::compute_final_local_value.
737 Call the inline method.
738 * object.h (Symbol_value::Symbol_value): Define destructor. Free
739 merged symbol value if there is one.
740 (Symbol_value::has_output_value): New method defintiion.
741 (Sized_relobj::Compute_final_local_value_status): New enum type.
742 (Sized_relobj::compute_final_local_value): New methods.
743 (Sized_relobj::compute_final_local_value_internal): New methods.
744 * Makefile.am (check_SCRIPTS): Add arm_branch_out_of_range.sh
745 and arm_cortex_a8.sh.
746 (thumb_bl_out_of_range_local, arm_cortex_a8_b_cond, arm_cortex_a8_bl,
747 arm_cortex_a8_blx, arm_cortex_a8_local, arm_corte_a8_local_reloc):
749 * Makefile.in: Regenerate.
750 * testsuite/arm_bl_out_of_range.s: Update test.
751 * testsuite/thumb_bl_out_of_range.s: Ditto.
752 * testsuite/thumb_blx_out_of_range.s: Ditto.
753 * testsuite/arm_branch_out_of_range.sh: New file.
754 * testsuite/arm_cortex_a8.sh: Ditto.
755 * testsuite/arm_cortex_a8_b.s: Ditto.
756 * testsuite/arm_cortex_a8_b_cond.s: Ditto.
757 * testsuite/arm_cortex_a8_b_local.s: Ditto.
758 * testsuite/arm_cortex_a8_bl.s: Ditto.
759 * testsuite/arm_cortex_a8_blx.s: Ditto.
760 * testsuite/arm_cortex_a8_local.s: Ditto.
761 * testsuite/arm_cortex_a8_local_reloc.s: Ditto.
762 * testsuite/thumb_bl_out_of_range_local.s: Ditto.
764 2010-09-08 Rafael Espindola <espindola@google.com>
766 * Makefile.am (memory_test.stdout): Run readelf with -W.
767 * Makefile.in: Regenerate.
768 * testsuite/memory_test.sh: Make the regexps accept both 32 and
771 2010-09-08 Rafael Espindola <espindola@google.com>
773 * script-sections.cc (Script_sections::add_memory_region): Convert
774 field precision to int.
775 * script.cc (script_set_section_region, script_set_section_region):
776 Convert field precision to int.
778 2010-09-08 Rafael Espindola <espindola@google.com>
780 * arm.cc (do_finalize_sections): Create the __exidx_start and
781 __exdix_end symbols even when the section is missing.
783 2010-09-08 Nick Clifton <nickc@redhat.com>
785 * README: Remove claim that MEMORY is not supported.
786 * expression.cc (script_exp_function_origin)
787 (script_exp_function_length): Move from here to ...
788 * script.cc: ... here.
789 (script_set_section_region, script_add_memory)
790 (script_parse_memory_attr, script_include_directive): New
793 (class Memory_region): New class.
794 (class Output_section_definition): Add set_memory_region,
795 set_section_vma, set_section_lma and get_section_name methods.
796 (class Script_Sections): Add add_memory_region,
797 find_memory_region, find_memory_region_origin,
798 find_memory_region_length and set_memory_region methods.
799 Have set_section_addresses method walk the list of set memory
801 Extend the print methos to display memory regions.
802 * script-sections.h: Add prototypes for new methods.
803 Add enum for MEMORY region attributes.
804 * yyscript.y: Add support for parsing MEMORY regions.
805 * script-c.h: Add prototypes for new functions.
806 * testsuite/Makefile.am: Add test of MEMORY region functionality.
807 * testsuite/Makefile.in: Regenerate.
808 * testsuite/memory_test.sh: New script.
809 * testsuite/memory_test.s: New assembler source file.
810 * testsuite/memory_test.t: New linker script.
812 2010-08-27 Doug Kwan <dougkwan@google.com>
814 * gold/resolve.cc (Symbol_table::should_override): Let a weak
815 reference override an existing dynamic weak reference.
816 * testsuite/Makefile.am: Add new test dyn_weak_ref.
817 * testsuite/Makefile.in: Regenerate.
818 * testsuite/dyn_weak_ref.sh: New file.
819 * testsuite/dyn_weak_ref_1.c: Ditto.
820 * testsuite/dyn_weak_ref_2.c: Ditto.
822 2010-08-27 Ian Lance Taylor <iant@google.com>
824 * incremental.h (class Incremental_input_entry): Add virtual
827 2010-08-27 Ian Lance Taylor <iant@google.com>
829 * testsuite/start_lib_test_3.c: Mark t3 as used.
831 2010-08-27 Nick Clifton <nickc@redhat.com>
833 * options.cc (version_script): Fix small typo in previous
836 2010-08-25 Nick Clifton <nickc@redhat.com>
838 * archive.cc: Formatting fixes: Remove whitespace between
839 typename and following asterisk. Remove whitespace between
840 function name and opening parenthesis.
841 * archive.h: Likewise.
843 * attributes.cc: Likewise.
844 * attributes.h: Likewise.
845 * common.cc: Likewise.
846 * copy-relocs.cc: Likewise.
847 * dirsearch.h: Likewise.
848 * dynobj.cc: Likewise.
849 * ehframe.cc: Likewise.
850 * ehframe.h: Likewise.
851 * expression.cc: Likewise.
852 * fileread.cc: Likewise.
853 * fileread.h: Likewise.
855 * gold-threads.cc: Likewise.
859 * incremental-dump.cc: Likewise.
860 * incremental.cc: Likewise.
861 * layout.cc: Likewise.
862 * layout.h: Likewise.
864 * merge.cc: Likewise.
866 * object.cc: Likewise.
867 * object.h: Likewise.
868 * options.cc: Likewise.
869 * options.h: Likewise.
870 * output.cc: Likewise.
871 * output.h: Likewise.
872 * plugin.cc: Likewise.
873 * plugin.h: Likewise.
874 * powerpc.cc: Likewise.
875 * reloc.cc: Likewise.
876 * script-c.h: Likewise.
877 * script-sections.cc: Likewise.
878 * script.cc: Likewise.
879 * stringpool.cc: Likewise.
880 * symtab.cc: Likewise.
881 * symtab.h: Likewise.
882 * target.cc: Likewise.
883 * timer.cc: Likewise.
885 * version.cc: Likewise.
886 * x86_64.cc: Likewise.
888 2010-08-24 Nick Clifton <nickc@redhat.com>
891 * layout.cc (segment_precedes): Sort segments by their physical
892 addresses, if they have been set.
894 2010-08-23 Cary Coutant <ccoutant@google.com>
896 * archive.cc (Lib_group::add_symbols): Lock object before deleting its
898 (Lib_group::include_member): Unlock object after deleting its
900 * testsuite/start_lib_test_3.c: Remove all global symbols to trigger
903 2010-08-19 Neil Vachharajani <nvachhar@google.com>
904 Cary Coutant <ccoutant@google.com>
906 * gold/archive.h (Add_lib_group_symbols): Add readsyms_blocker_, adjust
907 constructor, and set_blocker.
908 * gold/archive.cc (Add_lib_group_symbols::is_runnable): Also check
910 * gold/readsyms.cc (Read_symbols::do_lib_group): Also pass
911 this->this_blocker_ to Add_lib_group_symbols::set_blocker.
912 * testsuite/Makefile.am (start_lib_test): New test case.
913 * testsuite/Makefile.in: Regenerate.
914 * testsuite/start_lib_test_main.c: New file.
915 * testsuite/start_lib_test_1.c: New file.
916 * testsuite/start_lib_test_2.c: New file.
917 * testsuite/start_lib_test_3.c: New file.
919 2010-08-19 Ian Lance Taylor <iant@google.com>
921 * Makefile.in: Rebuild with automake 1.11.1.
922 * aclocal.m4: Likewise.
923 * testsuite/Makefile.in: Likewise.
925 2010-08-19 Ian Lance Taylor <iant@google.com>
928 * i386.cc (class Output_data_plt_i386): Update declarations.
929 Define Global_ifunc and Local_ifunc types. Add global_ifuncs_ and
930 local_ifuncs_ fields.
931 (Target_i386::do_plt_section_for_global): New function.
932 (Target_i386::do_plt_section_for_local): New function.
933 (Output_data_plt_i386::Output_data_plt_i386): Add symtab
934 parameter; change all callers. Initialize global_ifuncs_ and
935 local_ifuncs_. If doing a static link define __rel_iplt_start and
937 (Output_data_plt_i386::add_entry): Handle IFUNC symbols.
938 (Output_data_plt_i386::add_local_ifunc_entry): New function.
939 (Output_data_plt_i386::do_write): Fix GOT entries for IFUNC
941 (Target_i386::make_plt_section): New function, broken out of
942 make_plt_entry. Set sh_info field of .rel.plt to point to .plt.
943 (Target_i386::make_plt_entry): Call make_plt_section.
944 (Target_i386::make_local_ifunc_plt_entry): New function.
945 (Target_i386::Scan::reloc_needs_iplt_for_ifunc): New function.
946 (Target_i386::Scan::local): Handle IFUNC symbols. Add
947 R_386_IRELATIVE to switch.
948 (Target_i386::Scan::global): Likewise.
949 (Target_i386::Relocate::relocate): Likewise.
950 (Target_i386::Relocatable_size_for_reloc): Add R_386_IRELATIVE to
952 * x86_64.cc (class Output_data_plt_x86_64): Update declarations.
953 (Target_x86_64::do_plt_section_for_global): New function.
954 (Target_x86_64::do_plt_section_for_local): New function.
955 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add symtab
956 parameter; change all callers. If doing a static link define
957 __rela_iplt_start and __rela_iplt_end.
958 (Output_data_plt_x86_64::add_entry): Handle IFUNC symbols.
959 (Output_data_plt_x86_64::add_local_ifunc_entry): New function.
960 (Target_x86_64::make_plt_section): Set sh_info field of .rel.plt
962 (Target_x86_64::make_local_ifunc_plt_entry): New function.
963 (Target_x86_64::Scan::check_non_pic): Add R_X86_64_IRELATIVE to
965 (Target_x86_64::Scan::reloc_needs_iplt_for_ifunc): New function.
966 (Target_x86_64::Scan::local): Handle IFUNC symbols. Add
967 R_X86_64_IRELATIVE to switch.
968 (Target_x86_64::Scan::global): Likewise.
969 (Target_x86_64::Relocate::relocate): Likewise.
970 (Target_x86_64::Relocatable_size_for_reloc): Add R_X86_64_IRELATIVE to
972 * target.h (class Target): Add plt_section_for_global and
973 plt_section_for_local functions. Add do_plt_section_for_global
974 and do_plt_section_for_local virtual functions.
975 * symtab.h (Symbol::needs_plt_entry): Handle IFUNC symbol. Add
977 (Symbol::use_plt_offset): Handle IFUNC symbol.
978 * object.cc (Sized_relobj::Sized_relobj): Initialize
980 (Sized_relobj::local_has_plt_offset): New function.
981 (Sized_relobj::local_plt_offset): New function.
982 (Sized_relobj::set_local_plt_offset): New function.
983 (Sized_relobj::do_count): Handle IFUNC symbol.
984 * object.h (class Symbol_value): Add is_ifunc_symbol_ field. Take
985 a bit away from input_shndx_ field. Add set_is_func_symbol and
986 is_ifunc_symbol functions.
987 (class Sized_relobj): Update declarations. Remove Tls_got_entry
988 and Local_tls_got_offsets. Define Local_plt_offsets. Add
989 local_plt_offsets_ field.
990 (Sized_relobj::clear_local_symbols): Clear local_plt_offsets_.
991 * output.h (class Output_section_data): Add non-const
992 output_section function.
993 (class Output_data_got): Update declarations.
994 (class Output_data_got::Got_entry): Add use_plt_offset_ field.
995 Add use_plt_offset parameter to global and local constructors.
996 Change all callers. Change local_sym_index_ field to 31 bits.
997 Change GSYM_CODE and CONSTANT_CODE accordingly.
998 * output.cc (Output_data_reloc_base::do_adjust_output_section): If
999 doing a static link don't set sh_link field.
1000 (Output_data_got::Got_entry::write): Use PLT offset if
1002 (Output_data_got::add_global_plt): New function.
1003 (Output_data_got::add_local_plt): New function.
1004 * target-reloc.h (relocate_section): Handle IFUNC symbol.
1005 * defstd.cc (in_section): Remove entries for __rel_iplt_start,
1006 __rel_iplt_end, __rela_iplt_start, and __rela_iplt_end.
1007 * configure.ac: Set IFUNC automake conditional for glibc >= 2.11.
1008 * testsuite/Makefile.am: Add a bunch of IFUNC tests, all within
1010 * testsuite/ifunc-sel.h: New file.
1011 * testsuite/ifuncmain1.c: New file.
1012 * testsuite/ifuncmain1vis.c: New file.
1013 * testsuite/ifuncmod1.c: New file.
1014 * testsuite/ifuncdep2.c: New file.
1015 * testsuite/ifuncmain2.c: New file.
1016 * testsuite/ifuncmain3.c: New file.
1017 * testsuite/ifuncmod3.c: New file.
1018 * testsuite/ifuncmain4.c: New file.
1019 * testsuite/ifuncmain5.c: New file.
1020 * testsuite/ifuncmod5.c: New file.
1021 * testsuite/ifuncmain6pie.c: New file.
1022 * testsuite/ifuncmod6.c: New file.
1023 * testsuite/ifuncmain7.c: New file.
1024 * configure, testsuite/Makefile.in: Rebuild.
1026 2010-08-18 Ian Lance Taylor <iant@google.com>
1029 (Output_section_incremental_inputs::write_input_files): Add cast
1030 to avoid signed/unsigned comparison warning.
1031 (Output_section_incremental_inputs::write_info_blocks): Likewise.
1033 2010-08-12 Cary Coutant <ccoutant@google.com>
1035 * common.cc (Sort_commons::operator()): Remove unnecessary code.
1037 2010-08-13 Ian Lance Taylor <iant@google.com>
1039 * testsuite/incremental_test_1.c: Add prototype to avoid warning.
1041 2010-08-12 Cary Coutant <ccoutant@google.com>
1042 Doug Kwan <dougkwan@google.com>
1044 * resolve.cc (Symbol_table::should_override): When a weak dynamic
1045 defintion overrides non-weak undef, remember that the original undef
1047 * symtab.cc (Symbol_table::sized_write_global): For undef without
1048 an original weak binding, set binding to global in output.
1049 * testsuite/Makefile.am: Add new test strong_ref_weak_def.
1050 * testsuite/Makefile.in: Regenerate.
1051 * testsuite/strong_ref_weak_def.sh: New file.
1052 * testsuite/strong_ref_weak_def_1.c: Ditto.
1053 * testsuite/strong_ref_weak_def_2.c: Ditto.
1055 2010-08-12 Cary Coutant <ccoutant@google.com>
1057 * testsuite/incremental_test.sh: Rewrite.
1058 * testsuite/incremental_test_1.c: Rewrite.
1059 * testsuite/incremental_test_2.c: Rewrite.
1061 2010-08-12 Cary Coutant <ccoutant@google.com>
1063 * arm.cc (Target_arm::got_size): Add const.
1064 (Target_arm::got_entry_count): New function.
1065 (Target_arm::plt_entry_count): New function.
1066 (Target_arm::first_plt_entry_offset): New function.
1067 (Target_arm::plt_entry_size): New function.
1068 (Output_data_plt_arm::entry_count): New function.
1069 (Output_data_plt_arm::first_plt_entry_offset): New function.
1070 (Output_data_plt_arm::get_plt_entry_size): New function.
1071 * i386.cc (Target_i386::got_size): Add const.
1072 (Target_i386::got_entry_count): New function.
1073 (Target_i386::plt_entry_count): New function.
1074 (Target_i386::first_plt_entry_offset): New function.
1075 (Target_i386::plt_entry_size): New function.
1076 (Output_data_plt_i386::entry_count): New function.
1077 (Output_data_plt_i386::first_plt_entry_offset): New function.
1078 (Output_data_plt_i386::get_plt_entry_size): New function.
1079 * incremental-dump.cc (dump_incremental_inputs): Adjust call to
1080 find_incremental_inputs_sections. Dump incremental_got_plt section.
1081 * incremental.cc: Include target.h.
1082 (Sized_incremental_binary::do_find_incremental_inputs_sections): Add
1083 parameter. Adjust all callers. Find incremental_got_plt section.
1084 (Incremental_inputs::create_data_sections): Create incremental_got_plt
1086 (Output_section_incremental_inputs::set_final_data_size): Calculate
1087 size of incremental_got_plt section.
1088 (Output_section_incremental_inputs::do_write): Write the
1089 incremental_got_plt section.
1090 (Got_plt_view_info): New struct.
1091 (Local_got_offset_visitor): New class.
1092 (Global_got_offset_visitor): New class.
1093 (Global_symbol_visitor_got_plt): New class.
1094 (Output_section_incremental_inputs::write_got_plt): New function.
1095 * incremental.h (Incremental_binary::find_incremental_inputs_sections):
1096 Add parameter. Adjust all callers.
1097 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1098 (Incremental_inputs::got_plt_section): New function.
1099 (Incremental_inputs::got_plt_section_): New data member.
1100 (Incremental_got_plt_reader): New class.
1101 * layout.cc (Layout::create_incremental_info_sections): Add the
1102 incremental_got_plt section.
1103 * object.h (Got_offset_list::get_list): New function.
1104 (Got offset_list::for_all_got_offsets): New function.
1105 (Sized_relobj::local_got_offset_list): New function.
1106 * powerpc.cc (Target_powerpc::got_size): Add const.
1107 (Target_powerpc::got_entry_count): New function.
1108 (Target_powerpc::plt_entry_count): New function.
1109 (Target_powerpc::first_plt_entry_offset): New function.
1110 (Target_powerpc::plt_entry_size): New function.
1111 (Output_data_plt_powerpc::entry_count): New function.
1112 (Output_data_plt_powerpc::first_plt_entry_offset): New function.
1113 (Output_data_plt_powerpc::get_plt_entry_size): New function.
1114 * sparc.cc (Target_sparc::got_size): Add const.
1115 (Target_sparc::got_entry_count): New function.
1116 (Target_sparc::plt_entry_count): New function.
1117 (Target_sparc::first_plt_entry_offset): New function.
1118 (Target_sparc::plt_entry_size): New function.
1119 (Output_data_plt_sparc::entry_count): New function.
1120 (Output_data_plt_sparc::first_plt_entry_offset): New function.
1121 (Output_data_plt_sparc::get_plt_entry_size): New function.
1122 * symtab.h (Symbol::got_offset_list): New function.
1123 (Symbol_table::for_all_symbols): New function.
1124 * target.h (Sized_target::got_entry_count): New function.
1125 (Sized_target::plt_entry_count): New function.
1126 (Sized_target::plt_entry_size): New function.
1127 * x86_64.cc (Target_x86_64::got_size): Add const.
1128 (Target_x86_64::got_entry_count): New function.
1129 (Target_x86_64::plt_entry_count): New function.
1130 (Target_x86_64::first_plt_entry_offset): New function.
1131 (Target_x86_64::plt_entry_size): New function.
1132 (Output_data_plt_x86_64::entry_count): New function.
1133 (Output_data_plt_x86_64::first_plt_entry_offset): New function.
1134 (Output_data_plt_x86_64::get_plt_entry_size): New function.
1136 2010-08-12 Cary Coutant <ccoutant@google.com>
1138 * archive.cc: Include incremental.h.
1139 (Archive::Archive): Initialize incremental_info_.
1140 (Archive::include_member): Record archive members in incremental info.
1141 (Add_archive_symbols::run): Record begin and end of an archive in
1143 (Lib_group::include_member): Record objects in incremental info.
1144 * archive.h (Incremental_archive_entry): Forward declaration.
1145 (Archive::set_incremental_info): New member function.
1146 (Archive::incremental_info): New member function.
1147 (Archive::Unused_symbol_iterator): New class.
1148 (Archive::unused_symbols_begin): New member function.
1149 (Archive::unused_symbols_end): New member function.
1150 (Archive::incremental_info_): New data member.
1151 * incremental-dump.cc (find_input_containing_global): New function.
1152 (dump_incremental_inputs): Dump new incremental info sections.
1153 * incremental.cc: Include symtab.h.
1154 (Output_section_incremental_inputs): New class.
1155 (Sized_incremental_binary::do_find_incremental_inputs_sections): Support
1156 new incremental info sections.
1157 (Sized_incremental_binary::do_check_inputs): Likewise.
1158 (Incremental_inputs::report_archive): Remove.
1159 (Incremental_inputs::report_archive_begin): New function.
1160 (Incremental_inputs::report_archive_end): New function.
1161 (Incremental_inputs::report_object): New function.
1162 (Incremental_inputs::finalize_inputs): Remove.
1163 (Incremental_inputs::report_input_section): New function.
1164 (Incremental_inputs::report_script): Rewrite.
1165 (Incremental_inputs::finalize): Do nothing but finalize string table.
1166 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1167 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1168 (Incremental_inputs::create_data_sections): New function.
1169 (Incremental_inputs::relocs_entsize): New function.
1170 (Output_section_incremental_inputs::set_final_data_size): New function.
1171 (Output_section_incremental_inputs::do_write): New function.
1172 (Output_section_incremental_inputs::write_header): New function.
1173 (Output_section_incremental_inputs::write_input_files): New function.
1174 (Output_section_incremental_inputs::write_info_blocks): New function.
1175 (Output_section_incremental_inputs::write_symtab): New function.
1176 * incremental.h (Incremental_script_entry): Forward declaration.
1177 (Incremental_object_entry): Forward declaration.
1178 (Incremental_archive_entry): Forward declaration.
1179 (Incremental_inputs): Forward declaration.
1180 (Incremental_inputs_header_data): Remove.
1181 (Incremental_inputs_header): Remove.
1182 (Incremental_inputs_header_write): Remove.
1183 (Incremental_inputs_entry_data): Remove.
1184 (Incremental_inputs_entry): Remove.
1185 (Incremental_inputs_entry_write): Remove.
1186 (enum Incremental_input_type): Add INCREMENTAL_INPUT_ARCHIVE_MEMBER.
1187 (Incremental_binary::find_incremental_inputs_sections): Add parameters.
1188 (Incremental_binary::do_find_incremental_inputs_sections): Likewise.
1189 (Sized_ncremental_binary::do_find_incremental_inputs_sections):
1191 (Incremental_input_entry): New class.
1192 (Incremental_script_entry): New class.
1193 (Incremental_object_entry): New class.
1194 (Incremental_archive_entry): New class.
1195 (Incremental_inputs::Incremental_inputs): Initialize new data members.
1196 (Incremental_inputs::report_inputs): Remove.
1197 (Incremental_inputs::report_archive): Remove.
1198 (Incremental_inputs::report_archive_begin): New function.
1199 (Incremental_inputs::report_archive_end): New function.
1200 (Incremental_inputs::report_object): Change prototype.
1201 (Incremental_inputs::report_input_section): New function.
1202 (Incremental_inputs::report_script): Change prototype.
1203 (Incremental_inputs::get_reloc_count): New function.
1204 (Incremental_inputs::set_reloc_count): New function.
1205 (Incremental_inputs::create_data_sections): New function.
1206 (Incremental_inputs::create_incremental_inputs_section_data): Remove.
1207 (Incremental_inputs::inputs_section): New function.
1208 (Incremental_inputs::symtab_section): New function.
1209 (Incremental_inputs::relocs_section): New function.
1210 (Incremental_inputs::get_stringpool): Add const.
1211 (Incremental_inputs::command_line): Add const.
1212 (Incremental_inputs::inputs): Remove.
1213 (Incremental_inputs::command_line_key): New function.
1214 (Incremental_inputs::input_file_count): New function.
1215 (Incremental_inputs::input_files): New function.
1216 (Incremental_inputs::relocs_entsize): New function.
1217 (Incremental_inputs::sized_create_inputs_section_data): Remove.
1218 (Incremental_inputs::finalize_inputs): Remove.
1219 (Incremental_inputs::Input_info): Remove.
1220 (Incremental_inputs::lock_): Remove.
1221 (Incremental_inputs::inputs_): Change type.
1222 (Incremental_inputs::inputs_map_): Remove.
1223 (Incremental_inputs::current_object_entry_): New data member.
1224 (Incremental_inputs::inputs_section_): New data member.
1225 (Incremental_inputs::symtab_section_): New data member.
1226 (Incremental_inputs::relocs_section_): New data member.
1227 (Incremental_inputs::reloc_count_): New data member.
1228 (Incremental_inputs_reader): New class.
1229 (Incremental_symtab_reader): New class.
1230 (Incremental_relocs_reader): New class.
1231 * layout.cc (Layout::finalize): Move finalization of incremental info
1232 and creation of incremental info sections to follow finalization of
1233 symbol table. Set offsets for postprocessing sections.
1234 (Layout::create_incremental_info_sections): Call
1235 Incremental_inputs::create_data_sections. Add incremental symtab
1236 and relocs sections. Set sh_entsize and sh_link fields. Arrange for
1237 sections to layout after input sections.
1238 * layout.h (struct Timespec): Forward declaration.
1239 (Layout::incremental_inputs): Add const.
1240 (Layout::create_incremental_info_sections): Add parameter.
1241 * main.cc (main): Remove call to Incremental_inputs::report_inputs.
1242 * object.cc: Include incremental.h.
1243 (Relobj::finalize_incremental_relocs): New function.
1244 (Sized_relobj::do_layout): Record input sections in incremental info.
1245 * object.h (Object::output_section): New function.
1246 (Object::output_section_offset): Moved from Relobj.
1247 (Object::get_incremental_reloc_base): New function.
1248 (Object::get_incremental_reloc_count): New function.
1249 (Object::do_output_section): New function.
1250 (Object::do_output_section_offset): Moved from Relobj.
1251 (Object::do_get_incremental_reloc_base): New function.
1252 (Object::do_get_incremental_reloc_count): New function.
1253 (Object::Object): Initialize new data members.
1254 (Relobj::output_section): Renamed do_output_section and moved to
1256 (Relobj::output_section_offset): Moved to Object.
1257 (Relobj::do_get_incremental_reloc_base): New function.
1258 (Relobj::do_get_incremental_reloc_count): New function.
1259 (Relobj::allocate_incremental_reloc_counts): New function.
1260 (Relobj::count_incremental_reloc): New function.
1261 (Relobj::finalize_incremental_relocs): New function.
1262 (Relobj::next_incremental_reloc_index): New function.
1263 (Relobj::reloc_counts_): New data member.
1264 (Relobj::reloc_bases_): New data member.
1265 (Sized_relobj::do_relocate_sections): Add parameter. Change caller.
1266 (Sized_relobj::relocate_sections): Add parameter. Change all callers.
1267 (Sized_relobj::incremental_relocs_scan): New function.
1268 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1269 (Sized_relobj::incremental_relocs_write): New function.
1270 (Sized_relobj::incremental_relocs_write_reltype): New function.
1271 * plugin.cc (Plugin_manager::add_input_file): Rewrite test for
1273 * readsyms.cc (Read_symbols::do_read_symbols): Move reporting of
1274 archives and object files elsewhere.
1275 (Add_symbols::run): Report object files here.
1276 (Finish_group::run): Report end of archive at end of group.
1277 * reloc.cc: Include layout.h, incremental.h.
1278 (Sized_relobj::do_read_relocs): Need relocations for incremental link.
1279 (Sized_relobj::do_scan_relocs): Record relocations for incremental link.
1280 (Sized_relobj::incremental_relocs_scan): New function.
1281 (Sized_relobj::incremental_relocs_scan_reltype): New function.
1282 (Sized_relobj::do_relocate_sections): Write incremental relocations.
1283 (Sized_relobj::incremental_relocs_write): New function.
1284 (Sized_relobj::incremental_relocs_write_reltype): New function.
1285 * script.cc (read_input_script): Rewrite test for incremental link.
1286 Change call to Incremental_inputs::report_script.
1287 * symtab.h (Symbol_table::first_global_index): New function.
1288 (Symbol_table::output_count): New function.
1290 2010-08-12 Doug Kwan <dougkwan@google.com>
1292 * arm.cc (Target_arm::merge_object_attributes): Check command line
1293 options --no-wchar-size-warning and --no-enum-size-warning.
1294 * options.h (General_options): Add ld-compatible options
1295 --no-enum-size-warning and --no-wchar-size-warning.
1297 2010-08-04 Ian Lance Taylor <iant@google.com>
1299 * x86_64.cc (Target_x86_64::Scan::local): Use
1300 R_X86_64_GNU_VTINHERIT instead of R_386_GNU_VTINHERIT and
1301 R_X86_64_GNU_VTENTRY instead of R_386_GNU_VTENTRY.
1302 (Target_x86_64::Scan::global): Likewise.
1303 (Target_x86_64::Relocate::relocate): Likewise.
1304 (Target_x86_64::Relocatable_size_for_reloc::get_size_for_reloc):
1307 2010-08-03 Cary Coutant <ccoutant@google.com>
1309 * merge.cc (Output_merge_string::do_add_input_section): Count strings
1310 to reserve space in merged_strings vector. Keep total input size
1312 (Output_merge_string::do_print_merge_stats): Print total input size.
1313 * merge.h (Output_merge_string): Add input_size_ field.
1314 * stringpool.cc (Stringpool_template::string_length): Move
1315 implementations out of Stringpool_template class and place in
1317 * stringpool.h (string_length): Move out of Stringpool_template.
1319 2010-08-03 Ian Lance Taylor <iant@google.com>
1322 * layout.cc (relaxation_loop_body): If address of load segment is
1323 set, adjust address to include headers if possible.
1325 2010-08-03 Ian Lance Taylor <iant@google.com>
1327 * version.cc (version_string): Bump to 1.10.
1329 2010-08-03 Ian Lance Taylor <iant@google.com>
1332 * layout.h (enum Output_section_order): Define.
1333 (class Layout): Update declarations.
1334 * layout.cc (Layout::get_output_section): Add order parameter.
1335 Remove is_interp, is_dynamic_linker_section, is_last_relro, and
1336 is_first_non_relro parameters. Change all callers.
1337 (Layout::choose_output_section): Likewise.
1338 (Layout::add_output_section_data): Likewise.
1339 (Layout::make_output_section): Likewise. Set order.
1340 (Layout::default_section_order): New function.
1341 (Layout::layout_eh_frame): Call add_output_section_to_nonload.
1342 * output.cc (Output_section::Output_section): Initialize order_.
1343 Don't initialize deleted fields.
1344 (Output_segment::Output_segment): Don't initialize deleted
1346 (Output_segment::add_output_section_to_load): New function
1347 replacing add_output_section. Change all callers to call this or
1348 add_output_section_to_nonload.
1349 (Output_segment::add_output_section_to_nonload): New function.
1350 (Output_segment::remove_output_section): Rewrite.
1351 (Output_segment::add_initial_output_data): Likewise.
1352 (Output_segment::has_any_data_sections): Likewise.
1353 (Output_segment::is_first_section_relro): Likewise.
1354 (Output_segment::maximum_alignment): Likewise.
1355 (Output_segment::has_dynamic_reloc): New function replacing
1356 dynamic_reloc_count. Change all callers.
1357 (Output_segment::has_dynamic_reloc_list): New function replacing
1358 dynamic_reloc_count_list. Change all callers.
1359 (Output_segment::set_section_addresses): Rewrite.
1360 (Output_segment::set_offset): Rewrite.
1361 (Output_segment::find_first_and_last_list): Remove.
1362 (Output_segment::set_tls_offsets): Rewrite.
1363 (Output_segment::first_section_load_address): Likewise.
1364 (Output_segment::output_section_count): Likewise.
1365 (Output_segment::section_with_lowest_load_address): Likewise.
1366 (Output_segment::write_section_headers): Likewise.
1367 (Output_segment::print_sections_to_map): Likewise.
1368 * output.h (class Output_data): Remove dynamic_reloc_count_
1369 field. Add has_dynamic_reloc_ field. Make bools into bitfields.
1370 (Output_data::add_dynamic_reloc): Rewrite.
1371 (Output_data::has_dynamic_reloc): New function.
1372 (Output_data::dynamic_reloc_count): Remove.
1373 (class Output_section): Add order_ field. Remvoe is_relro_local_,
1374 is_last_relro_, is_first_non_relro_, is_interp_,
1375 is_dynamic_linker_section_ fields. Add order and set_order
1376 functions. Remove is_relro_local, set_is_relro_local,
1377 is_last_relro, set_is_last_relro, is_first_non_relro,
1378 set_is_first_non_relro functions, is_interp, set_is_interp,
1379 is_dynamic_linker_section, and set_is_dynamic_linker_section
1381 (class Output_segment): Change Output_data_list from std::list to
1382 std:;vector. Add output_lists_ field. Remove output_data_ and
1383 output_bss_ fields. Update declarations.
1385 2010-08-02 Ian Lance Taylor <iant@google.com>
1387 * arm.cc (Target_arm::gc_process_relocs): Use typename.
1388 * powerpc.cc (Target_powerpc::gc_process_relocs): Likewise.
1389 * sparc.cc (Target_sparc::gc_process_relocs): Likewise.
1391 2010-08-02 Ian Lance Taylor <iant@google.com>
1394 * script.cc (Script_options::Script_options): Initialize
1395 symbol_definitions_ and symbol_references_.
1396 (Script_options::add_symbol_assignment): Update
1397 symbol_definitions_ and symbol_references_.
1398 (Script_options::add_symbol_reference): New function.
1399 (script_symbol): New function.
1400 * script.h (class Script_options): Add symbol_definitions_ and
1401 symbol_references_ fields.
1402 (Script_options::referenced_const_iterator): New type.
1403 (Script_options::referenced_begin): New function.
1404 (Script_options::referenced_end): New function.
1405 (Script_options::is_referenced): New function.
1406 (Script_options::any_unreferenced): New function.
1407 * script-c.h (script_symbol): Declare.
1408 * yyscript.y (exp): Call script_symbol.
1409 * symtab.cc: Include "script.h".
1410 (Symbol_table::gc_mark_undef_symbols): Add layout parameter.
1411 Change all callers. Check symbols referenced by scripts.
1412 (Symbol_table::add_undefined_symbols_from_command_line): Add
1413 layout parameter. Change all callers.
1414 (Symbol_table::do_add_undefined_symbols_from_command_line):
1415 Likewise. Break out loop body. Check symbols referenced by
1417 (Symbol_table::add_undefined_symbol_from_command_line): New
1418 function broken out of
1419 do_add_undefined_symbols_from_command_line.
1420 * symtab.h (class Symbol_table): Update declarations.
1421 * archive.cc: Include "layout.h".
1422 (Archive::should_include_member): Add layout parameter. Change
1423 all callers. Check for symbol mentioned in expression.
1424 * archive.h (class Archive): Update declaration.
1425 * object.cc (Sized_relobj::do_should_include_member): Add layout
1427 * object.h (Object::should_include_member): Add layout parameter.
1429 (Object::do_should_include_member): Add layout parameter.
1430 (class Sized_relobj): Update declaration.
1431 * dynobj.cc (Sized_dynobj::do_should_include_member): Add layout
1433 * dynobj.h (class Sized_dynobj): Update declaration.
1434 * plugin.cc (Sized_pluginobj::do_should_include_member): Add
1436 * plugin.h (class Sized_pluginobj): Update declaration.
1438 2010-08-02 Ian Lance Taylor <iant@google.com>
1441 * output.cc (Output_segment::set_offset): Search for the first and
1442 last sections rather than assuming that the list is in order.
1443 (Output_segment::find_first_and_last_list): New function.
1444 * output.h (class Output_segment): Update declarations.
1445 * testsuite/Makefile.am (check_PROGRAMS): Add relro_strip_test.
1446 (relro_strip_test_SOURCES): New variable.
1447 (relro_strip_test_DEPENDENCIES): New variable.
1448 (relro_strip_test_LDFLAGS): New variable.
1449 (relro_strip_test_LDADD): New variable.
1450 (relro_strip_test.so): New target.
1452 2010-08-02 Ian Lance Taylor <iant@google.com>
1454 * i386.cc (class Target_i386): Add got_tlsdesc_ field.
1455 (Target_i386::Target_i386):: Initialize got_tlsdesc_.
1456 (Target_i386::got_tlsdesc_section): New function.
1457 (Target_i386::got_section): Create space for GOT entries for
1458 TLSDESC relocations.
1459 (Target_i386::Scan::local): Use TLSDESC GOT for unoptimized
1461 (Target_i386::Scan::global): Likewise.
1462 (Target_i386::Relocate::relocate_tls): Adjust GOT offset when
1464 * x86_64.cc (class Target_x86_64): Add got_tlsdesc_ field.
1465 (Target_x86_64::Target_x86_64):: Initialize got_tlsdesc_.
1466 (Target_x86_64::got_tlsdesc_section): New function.
1467 (Target_x86_64::got_section): Create space for GOT entries for
1468 TLSDESC relocations.
1469 (Target_x86_64::Scan::local): Use TLSDESC GOT for unoptimized
1471 (Target_x86_64::Scan::global): Likewise.
1472 (Target_x86_64::Relocate::relocate_tls): Adjust GOT offset when
1475 2010-08-02 Ian Lance Taylor <iant@google.com>
1477 * testsuite/final_layout.sh: Use dc to convert from hex to
1480 2010-07-29 Sriraman Tallam <tmsriram@google.com>
1482 * arm.cc (Target_arm<big_endian>::gc_process_relocs): Add template
1483 paramter to the call to gold::gc_process_relocs.
1484 * i386.cc (Target_i386<big_endian>::gc_process_relocs): Add template
1485 paramter to the call to gold::gc_process_relocs.
1486 * x86_64.cc (Target_x86_64<big_endian>::gc_process_relocs): Add template
1487 parameter to the call to gold::gc_process_relocs.
1488 * powerpc.cc (Target_powerpc<big_endian>::gc_process_relocs): Add
1489 template parameter to the call to gold::gc_process_relocs.
1490 * sparc.cc (Target_sparc<big_endian>::gc_process_relocs): Add template
1491 paramter to the call to gold::gc_process_relocs.
1492 * gc.h (get_embedded_addend_size): New function.
1493 (gc_process_relocs): Save the size of the reloc for use by ICF.
1494 * icf.cc (get_section_contents): Get the addend from the text section
1495 for SHT_REL relocation sections.
1496 * icf.h (Icf::Reloc_addend_size_info): New typedef.
1497 (Icf::Reloc_info): Add new member reloc_addend_size_info.
1498 * int_encoding.h (read_from_pointer): New overloaded function.
1499 * testsuite/Makefile.am (icf_sht_rel_addend_test): New test.
1500 * testsuite/icf_sht_rel_addend_test.sh: New file.
1501 * testsuite/icf_sht_rel_addend_test_1.cc: New file.
1502 * testsuite/icf_sht_rel_addend_test_2.cc: New file.
1504 2010-07-28 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1506 * configure.ac (AM_INIT_AUTOMAKE): Use parallel-tests option.
1507 * Makefile.in: Regenerate.
1508 * testsuite/Makefile.in: Regenerate.
1510 2010-07-27 Jeffrey Yasskin <jyasskin@google.com>
1512 * testsuite/debug_msg.sh: Test mixed weak/strong symbol behavior.
1513 * gold/testsuite/debug_msg.cc: Likewise.
1514 * gold/testsuite/odr_violation1.cc
1515 * gold/testsuite/odr_violation2.cc
1517 2010-07-21 Cary Coutant <ccoutant@google.com>
1519 * merge.h (Output_merge_string::Merged_string): Remove object, shndx,
1520 string, and length fields.
1521 (Output_merge_string::Merged_strings_list): New type.
1522 (Output_merge_string::Merged_strings_lists): New typedef.
1523 (Output_merge_string): Replace merged_strings_ with
1524 merged_strings_lists_.
1525 * merge.cc (Output_merge_string::do_add_input_section): Allocate new
1526 Merged_strings_list per input object and section. Don't store pointer
1527 to the string. Don't store length with each merged string entry.
1528 (Output_merge_string::finalize_merged_data): Loop over list of merged
1529 strings lists. Recompute length of each merged string.
1531 2010-07-15 Cary Coutant <ccoutant@google.com>
1533 * plugin.cc (Plugin_finish::run): Don't call cleanup handlers from
1536 2010-07-14 Ian Lance Taylor <iant@google.com>
1538 * descriptors.cc (Descriptors::open): Report correct name in error
1541 2010-07-13 Doug Kwan <dougkwan@google.com>
1543 * arm.cc (Arm_input_section::Arm_input_section): For a
1544 SHT_ARM_EXIDX section, always keeps the input sections.
1545 (Arm_input_section::set_exidx_section_link): New method.
1546 (Arm_exidx_input_section::Arm_exidx_input_section): Initialize
1547 has_errors_ to false.
1548 (Arm_exidx_input_section::has_errors,
1549 Arm_exidx_input_section::set_has_errors): New methods.
1550 (Arm_exidx_input_section::has_errors_): New data member.
1551 (Arm_relobj::get_exidx_shndx_list): New method.
1552 (Arm_output_section::append_text_sections_to_list): Do not skip
1553 section without SHF_EXECINSTR.
1554 (Arm_output_section::fix_exidx_coverage): Skip input sections with
1556 (Arm_relobj::make_exidx_input_section): Add new parameter for text
1557 section header. Make error messages more verbose. Check for
1558 a non-executable section linked to an EXIDX section.
1559 (Arm_relobj::do_read_symbols): Remove error checking, which has been
1560 moved to Arm_relobj::make_exidx_input_section. Add an assertion to
1561 check that there is no deferred EXIDX section if we exit early.
1562 Instead of not making an EXIDX section in case of an error, make one
1563 and set the has_errors flag of it.
1564 (Target_arm::do_finalize_sections): Fix up links of EXIDX sections
1565 in a relocatable link.
1566 (Target_arm::do_relax): Look for the EXIDX output section instead of
1567 assuming that it is called .ARM.exidx.
1568 (Target_arm::fix_exidx_coverage): Add a new parameter for input
1569 section list. Do not check for SHF_EXECINSTR section flags but
1570 skip any input section with errors.
1571 * output.cc (Output_section::Output_section): Initialize
1572 always_keeps_input_sections_ to false.
1573 (Output_section::add_input_section): Check for
1574 always_keeps_input_sections_.
1575 * output.h (Output_section::always_keeps_input_sections,
1576 Output_section::set_always_keeps_input_sections): New methods.
1577 (Output_section::always_keeps_input_sections): New data member.
1579 2010-07-13 Rafael Espindola <espindola@google.com>
1581 * fileread.cc (try_extra_search_path, find_file): Move to Input_file.
1582 * fileread.h (Input_file): Add try_extra_search_path and find_file.
1584 2010-07-13 Philip Herron <herron.philip@googlemail.com>
1585 Ian Lance Taylor <iant@google.com>
1587 * output.h (Output_section_lookup_maps::add_merge_section):
1588 Correct check of whether value was inserted.
1589 (Output_section_lookup_maps::add_merge_input_section): Likewise.
1590 (Output_section_lookup_maps::add_relaxed_input_section):
1592 * arm.cc (Target_arm::got_section): Remove used local os.
1593 * i386.cc (Target_i386::got_section): Likewise.
1594 * x86_64.cc (Target_x86_64::got_section): Likewise.
1595 * sparc.cc (Target_sparc::got_section): Likewise.
1596 (Target_sparc::relocate): Remove unused local have_got_offset.
1597 * powerpc.cc (Target_powerpc::relocate): Likewise.
1599 2010-07-13 Ian Lance Taylor <iant@google.com>
1601 * compressed_output.cc (zlib_decompress): Fix signature in
1604 * archive.cc (Archive::include_member): Unlock an external member
1605 of a thin archive. Don't bother to delete an object we know is
1608 2010-07-12 Cary Coutant <ccoutant@google.com>
1610 * compressed_output.cc (zlib_decompress): New function.
1611 (get_uncompressed_size): New function.
1612 (decompress_input_section): New function.
1613 * compressed_output.h (get_uncompressed_size): New function.
1614 (decompress_input_section): New function.
1615 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info)
1616 Handle compressed debug sections.
1617 * layout.cc (is_compressed_debug_section): New function.
1618 (Layout::output_section_name): Map compressed section names to
1620 * layout.h (is_compressed_debug_section): New function.
1621 (is_debug_info_section): Recognize compressed debug sections.
1622 * merge.cc: Include compressed_output.h.
1623 (Output_merge_data::do_add_input_section): Handle compressed
1625 (Output_merge_string::do_add_input_section): Handle compressed
1627 * object.cc: Include compressed_output.h.
1628 (Sized_relobj::Sized_relobj): Initialize new data members.
1629 (build_compressed_section_map): New function.
1630 (Sized_relobj::do_read_symbols): Handle compressed debug sections.
1631 * object.h (Object::section_is_compressed): New method.
1632 (Object::do_section_is_compressed): New method.
1633 (Sized_relobj::Compressed_section_map): New type.
1634 (Sized_relobj::do_section_is_compressed): New method.
1635 (Sized_relobj::compressed_sections_): New data member.
1636 * output.cc (Output_section::add_input_section): Handle compressed
1638 * reloc.cc: Include compressed_output.h.
1639 (Sized_relobj::write_sections): Handle compressed debug sections.
1641 2010-07-08 Cary Coutant <ccoutant@google.com>
1643 * resolve.cc (Symbol_table::resolve): Remember whether undef was
1644 weak when resolving to a dynamic def.
1645 (Symbol_table::should_override): Add adjust_dyndef flag; set it
1646 for weak undef/dynamic def cases. Adjust callers.
1647 * symtab.cc (Symbol::init_fields): Initialize undef_binding_set_ and
1648 undef_binding_weak_.
1649 (Symbol_table::sized_write_globals): Adjust symbol binding.
1650 (Symbol_table::sized_write_symbol): Add binding parameter.
1651 * symtab.h (Symbol::set_undef_binding): New method.
1652 (Symbol::is_undef_binding_weak): New method.
1653 (Symbol::undef_binding_set_, Symbol::undef_binding_weak_): New members.
1654 (Symbol_table::should_override): Add new parameter.
1655 (Symbol_table::sized_write_symbol): Add new parameter.
1657 * testsuite/weak_undef_file1.cc: Add new test case.
1658 * testsuite/weak_undef_file2.cc: Fix header comment.
1659 * testsuite/weak_undef_test.cc: Add new test case.
1661 2010-06-29 Doug Kwan <dougkwan@google.com>
1663 * arm-reloc-property.cc (Arm_reloc_property::Arm_reloc_property):
1664 Initialize USE_SYMBOL_.
1665 * arm-reloc-property.h (Arm_reloc_property::uses_symbol): New method
1667 (Arm_reloc_property::uses_symbol_): New data member declaration.
1668 * arm.cc (Target_arm::Relocate::relocate): Exit early if relocation
1669 uses symbol value and symbol is undefined but not weakly undefined.
1671 2010-06-28 Rafael Espindola <espindola@google.com>
1673 * plugin.cc (Plugin::load): Use dlerror.
1675 2010-06-26 Jeffrey Yaskin <jyasskin@google.com>
1677 * symtab.cc (detect_odr_violations): When reporting an ODR
1678 violation, report an object where the symbol is defined.
1680 2010-06-25 Doug Kwan <dougkwan@google.com>
1682 * arm.cc (Target_arm::can_check_for_functions_pointers): Return true.
1683 (Target_arm::section_may_have_icf_unsafe_pointers): New method
1685 (Target_arm::Scan::local_reloc_may_be_function_pointer,
1686 Target_arm::Scan::global_reloc_may_be_function_pointer): Implement
1687 target hook to detect function points.
1688 (Target_arm::Scan::possible_function_pointer_reloc): New method.
1689 * icf.h (Icf::check_section_for_function_pointers): Change type of
1690 parameter SECTION_NAME to const reference to std::string. Use
1691 target hook to determine if section may have unsafe pointers.
1692 * target.h (Target::section_may_have_icf_unsafe_pointers): New
1695 2010-06-21 Rafael Espindola <espindola@google.com>
1697 * fileread.cc (Input_file::find_fie): New
1698 (Input_file::open): Use Input_file::find_fie.
1699 * fileread.h (Input_file::find_fie): New
1700 * plugin.cc (set_extra_library_path): New.
1701 (Plugin::load): Add set_extra_library_path to the transfer vector.
1702 (Plugin_manager::set_extra_library_path): New.
1703 (Plugin_manager::add_input_file): Use the extra search path if set.
1704 (set_extra_library_path(): New.
1705 * plugin.h (Plugin_manager): Add set_extra_library_path and
1708 2010-06-19 Cary Coutant <ccoutant@google.com>
1710 * layout.cc (gdb_sections): Add .debug_types.
1711 (lines_only_debug_sections): Likewise.
1713 2010-06-18 Rafael Espindola <espindola@google.com>
1715 * plugin.cc (add_input_file,add_input_library)
1716 (Plugin_manager::add_input_file): Make filename arguments const.
1717 * plugin.h (Plugin_manager::add_input_file): Make filename arguments
1720 2010-06-16 Doug Kwan <dougkwan@google.com>
1722 * arm.cc (Target_arm::do_finalize_sections): Do not emit an
1723 .ARM.attributes section if we have not merged any input
1724 attributes sections.
1726 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1728 * arm.cc: Allow combining objects with no EABI version
1731 2010-06-15 Rafael Espindola <espindola@google.com>
1733 * plugin.cc (Plugin_hook::run): Set in_real_elf for the start symbol.
1735 2010-06-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1737 * fileread.cc: Only #include <sys/uio.h> if HAVE_READV.
1738 (struct iovec): Correct !HAVE_READV definition.
1740 2010-06-10 Cary Coutant <ccoutant@google.com>
1742 * object.cc (Sized_relobj::do_layout): Defer layout for reloc sections.
1743 (Sized_relobj::do_layout_deferred_sections): Do layout for deferred
1745 * object.h (Sized_relobj::deferred_layout_relocs_): New data member.
1748 * symtab.h (Symbol::is_placeholder): New member function.
1749 * target-reloc.h (relocate_section): Check for placeholder symbols.
1751 * testsuite/Makefile.am (plugin_test_8): New test.
1752 (plugin_test_9): New test.
1753 * testsuite/Makefile.in: Regenerate.
1755 2010-06-09 Nick Clifton <nickc@redhat.com>
1757 * yyscript.y (input_list_element): Allow strings prefixed with
1758 the '-' character. Treat these as libraries.
1759 * script.cc (script_add_library): New function. Adds a library
1760 specified by "-l<name>" found in an input script.
1761 * script-c.h: Add prototype for script_add_library.
1763 2010-06-07 Doug Kwan <dougkwan@google.com>
1765 * arm.cc (Target_arm::do_relax): Reserve more space for stubs.
1766 Restrict stub-group size to be within long conditional branch
1767 range when working around cortex-A8 erratum.
1769 2010-06-07 Damien Diederen <dd@crosstwine.com>
1771 * gold-threads.cc (Lock_impl_threads::Lock_impl_threads): Correct
1774 2010-06-03 Sriraman Tallam <tmsriram@google.com>
1778 (Output_section::Input_section_sort_entry::compare_section_ordering):
1779 Change to return non-zero correctly.
1780 (Output_section::Input_section_sort_section_order_index_compare
1781 ::operator()): Change to fix ambiguity in comparisons.
1783 2010-06-01 Sriraman Tallam <tmsriram@google.com>
1785 * gold.h (is_wildcard_string): New function.
1786 * layout.cc (Layout::layout): Pass this pointer to add_input_section.
1787 (Layout::layout_eh_frame): Ditto.
1788 (Layout::find_section_order_index): New method.
1789 (Layout::read_layout_from_file): New method.
1790 * layout.h (Layout::find_section_order_index): New method.
1791 (Layout::read_layout_from_file): New method.
1792 (Layout::input_section_position_): New private member.
1793 (Layout::input_section_glob_): New private member.
1794 * main.cc (main): Call read_layout_from_file here.
1795 * options.h (--section-ordering-file): New option.
1796 * output.cc (Output_section::input_section_order_specified_): New
1798 (Output_section::Output_section): Initialize new member.
1799 (Output_section::add_input_section): Add new parameter.
1800 Keep input sections when --section-ordering-file is used.
1801 (Output_section::set_final_data_size): Sort input sections when
1802 section ordering file is specified.
1803 (Output_section::Input_section_sort_entry): Add new parameter.
1805 (Output_section::Input_section_sort_entry::compare_section_ordering):
1807 (Output_section::Input_section_sort_compare::operator()): Change to
1808 consider section_order_index.
1809 (Output_section::Input_section_sort_init_fini_compare::operator()):
1810 Change to consider section_order_index.
1811 (Output_section::Input_section_sort_section_order_index_compare
1812 ::operator()): New method.
1813 (Output_section::sort_attached_input_sections): Change to sort
1814 according to section order when specified.
1815 (Output_section::add_input_section<32, true>): Add new parameter.
1816 (Output_section::add_input_section<64, true>): Add new parameter.
1817 (Output_section::add_input_section<32, false>): Add new parameter.
1818 (Output_section::add_input_section<64, false>): Add new parameter.
1819 * output.h (Output_section::add_input_section): Add new parameter.
1820 (Output_section::input_section_order_specified): New
1822 (Output_section::set_input_section_order_specified): New method.
1823 (Input_section::Input_section): Initialize section_order_index_.
1824 (Input_section::section_order_index): New method.
1825 (Input_section::set_section_order_index): New method.
1826 (Input_section::section_order_index_): New member.
1827 (Input_section::Input_section_sort_section_order_index_compare): New
1829 (Output_section::input_section_order_specified_): New member.
1830 * script-sections.cc (is_wildcard_string): Delete and move modified
1832 (Output_section_element_input::Output_section_element_input): Modify
1833 call to is_wildcard_string.
1834 (Output_section_element_input::Input_section_pattern
1835 ::Input_section_pattern): Ditto.
1836 (Output_section_element_input::Output_section_element_input): Ditto.
1837 * testsuite/Makefile.am (final_layout): New test case.
1838 * testsuite/Makefile.in: Regenerate.
1839 * testsuite/final_layout.cc: New file.
1840 * testsuite/final_layout.sh: New file.
1842 2010-06-01 Rafael Espindola <espindola@google.com>
1844 * plugin.cc (Plugin::load): Pass the output name to the plugin.
1846 2010-06-01 Rafael Espindola <espindola@google.com>
1848 * plugin.cc (Sized_pluginobj::::do_add_symbols): Correctly set the
1849 visibility of symbols.
1851 2010-05-27 Doug Kwan <dougkwan@google.com>
1853 * object.cc (Sized_relobj::do_finalize_local_symbols): Use offset
1854 from start of output section instead of address for a local symbol
1855 in a merged or relaxed section when doing a relocatable link.
1857 2010-05-26 Rafael Espindola <espindola@google.com>
1860 * gold/object.cc(Sized_relobj::do_layout_deferred_sections): Avoid
1861 adding sections the garbage collector removed.
1862 * gold/testsuite/Makefile.am: Add test.
1863 * gold/testsuite/Makefile.in: Regenerate.
1864 * gold/testsuite/plugin_test_7.sh: New.
1865 * gold/testsuite/plugin_test_7_1.c: New.
1866 * gold/testsuite/plugin_test_7_2.c: New.
1868 2010-05-26 Rafael Espindola <espindola@google.com>
1870 * script-sections.cc (Output_section_definition::set_section_addresses):
1871 Check for --section-start.
1873 2010-05-26 Doug Kwan <dougkwan@google.com>
1875 * arm.cc (Arm_scan_relocatable_relocs): New class.
1876 (Target_arm::relocate_special_relocatable): New method.
1877 (Arm_relocate_functions::arm_branch_common): Handle relocatable link.
1878 (Arm_relocate_functions::thumb_branch_common): Same.
1879 (Target_arm::scan_relocatable_relocs): Use Arm_scan_relocatable_relocs
1880 instead of Default_scan_relocatable_relocs.
1881 * target-reloc.h (relocate_for_relocatable): Let target handle
1882 relocation strategy Relocatable_relocs::RELOC_SPECIAL.
1883 * target.h (Sized_target::relocate_special_relocatable): New method.
1885 2010-05-25 Viktor Kutuzov <vkutuzov@accesssoftek.com>
1887 * timer.cc: Only #include <sys/times.h> if HAVE_TIMES is defined.
1889 2010-05-23 Doug Kwan <dougkwan@google.com>
1891 * arm.cc (Arm_input_section::do_output_offset): Use convert_types
1893 (Target_arm::apply_cortex_a8_workaround): Rewrite a conditional branch
1894 with a direct branch, not a conditional branch, to a stub.
1895 * merge.cc (Output_merge_base::record_input_section): New method
1897 (Output_merge_data::do_add_input_section): Record input section if
1898 keeps-input-sections flag is set.
1899 (Output_merge_string::do_add_input_section): Ditto.
1900 * merge.h (Output_merge_base::Output_merge_base): Initialize new data
1901 members KEEPS_INPUT_SECTIONS_, FIRST_RELOBJ_, FIRST_SHNDX_ and
1903 (Output_merge_base::keeps_input_sections,
1904 Output_merge_base::set_keeps_input_sections,
1905 Output_merge_base::first_relobj, Output_merge_base::first_shndx): New
1907 (Output_merge_base::Input_sections): New type declaration.
1908 (Output_merge_base::input_sections_begin,
1909 Output_merge_base::input_sections_end,
1910 Output_merge_base::do_set_keeps_input_sections): New method definitions.
1911 (Output_merge_base::bool keeps_input_sections_,
1912 Output_merge_base::first_relobj_, Output_merge_base::first_shndx_,
1913 Output_merge_base::input_sections_): New data members.
1914 (Output_merge_data::do_set_keeps_input_sections): New method
1916 (Output_merge_string::do_set_keeps_input_sections): Ditto.
1917 * output.cc (Output_section::Input_section::relobj): Move method
1918 defintion from class declaration to here and handle merge sections.
1919 (Output_section::Input_section::shndx): Ditto.
1920 (Output_section::Output_section): Remove initializations of removed
1921 data members and initialize new data member LOOKUP_MAPS_.
1922 (Output_section::add_input_section): Set keeps-input-sections flag
1923 for a newly created merge output section as appropriate. Adjust code
1924 to use Output_section_lookup_maps class.
1925 (Output_section::add_relaxed_input_section): Adjst code for lookup
1926 maps code refactoring.
1927 (Output_section::add_merge_input_section): Add a new parameter
1928 KEEPS_INPUT_SECTION. Adjust code to use Output_section_lookup_maps
1929 class. If adding input section to a newly created merge output
1930 section fails, remove the new merge section.
1931 (Output_section::convert_input_sections_in_list_to_relaxed_input_sections):
1932 Adjust code for use of the Output_section_lookup_maps class.
1933 (Output_section::find_merge_section): Ditto.
1934 (Output_section::build_lookup_maps): New method defintion.
1935 (Output_section::find_relaxed_input_section): Adjust code to use
1936 Output_section_lookup_maps class.
1937 (Output_section::get_input_sections): Export merge sections. Adjust
1938 code to use Output_section_lookup_maps class.
1939 (Output_section:::add_script_input_section): Adjust code to use
1940 Output_section_lookup_maps class. Update lookup maps for merge
1942 (Output_section::discard_states): Use Output_section_lookup_maps.
1943 (Output_section::restore_states): Same.
1944 * output.h (Merge_section_properties): Move class defintion out of
1946 (Output_section_lookup_maps): New class.
1947 (Output_section::Input_section::is_merge_section): New method
1949 (Output_section::Input_section::relobj): Move defintion out of class
1950 defintion. Declare method only.
1951 (Output_section::Input_section::shndx): Ditto.
1952 (Output_section::Input_section::output_merge_base): New method defintion.
1953 (Output_section::Input_section::u2_.pomb): New union field.
1954 (Output_section::Merge_section_by_properties_map,
1955 Output_section::Output_section_data_by_input_section_map,
1956 Output_section::Ouptut_relaxed_input_section_by_input_section_map):
1958 (Output_section::add_merge_input_section): Add new parameter
1959 KEEPS_INPUT_SECTIONS.
1960 (Output_section::build_lookup_maps): New method declaration.
1961 (Output_section::merge_section_map_,
1962 Output_section::merge_section_by_properties_map_,
1963 Output_section::relaxed_input_section_map_,
1964 Output_section::is_relaxed_input_section_map_valid_): Remove data
1966 (Output_section::lookup_maps_): New data member.
1968 2010-05-21 Doug Kwan <dougkwan@google.com>
1971 * arm.cc (Arm_input_section::do_output_offset): Add a cast to
1972 avoid a compilation error.
1974 2010-05-19 Rafael Espindola <espindola@google.com>
1976 * script-sections.cc (Output_section_definition::allocate_to_segment):
1977 Update the phdrs_list even when the output section is NULL.
1978 * testsuite/Makefile.am: Add test.
1979 * testsuite/Makefile.in: Regenerate.
1980 * testsuite/script_test_9.cc: New.
1981 * testsuite/script_test_9.sh: New.
1982 * testsuite/script_test_9.t: New.
1984 2010-05-19 Doug Kwan <dougkwan@google.com>
1986 * arm.cc (Arm_input_section::original_size): New method.
1987 (Arm_input_section::do_addralign): Add a cast.
1988 (Arm_input_section::do_output_offset): Remove static cast.
1989 (Arm_input_section::original_addralign,
1990 Arm_input_section::original_size_): Change type to uint32_t.
1991 (Arm_input_section::init): Add safe casts for section alignment
1993 (Arm_input_section::set_final_data_size): Do not set address and
1994 offset of stub table.
1995 (Arm_output_section::fix_exidx_coverage): Change use of of
1996 Output_section::Simple_input_section to that of
1997 Output_section::Input_section.
1998 (Target_arm::do_relax): Set addresses and file offsets of Stub_tables
1999 except for the first pass.
2000 * output.cc (Output_section::get_input_sections): Change type of
2001 input_sections to std::list<Input_section>.
2002 (Output_section::add_script_input_section): Rename from
2003 Output_section::add_simple_input_section. Change type of SIS
2004 parameter from Simple_input_section to Input_section.
2005 * output.h (Output_section::Simple_input_section): Remove class.
2006 (Output_section::Input_section): Change class visibility to public.
2007 (Output_section::Input_section::addralign): Use stored alignments
2008 for special input sections if set.
2009 (Output_section::Input_section::set_addralign): New method.
2010 (Output_section::get_input_sections): Change parameter type from
2011 list of Simple_input_section to list of Input_section.
2012 (Output_section::add_script_input_section): Rename from
2013 Output_section::add_simple_input_section. Change first parameter's
2014 type from Simple_input_section to Input_section and remove the
2015 second and third parameters.
2016 * script-sections.cc (Input_section::Input_section_list): Change
2017 type to list of Output_section::Input_section/
2018 (Input_section_info::Input_section_info): Change parameter type of
2019 INPUT_SECTION to Output_section::Input_section.
2020 (Input_section_info::input_section): Change return type.
2021 (Input_section_info::input_section_): Change type to
2022 Output_section::Input_section.
2023 (Output_section_element_input::set_section_addresses): Adjust code
2024 to use Output_section::Input_section instead of
2025 Output_section::Simple_input_section. Adjust code for renaming
2026 of Output_section::add_simple_input_section.
2027 (Orphan_output_section::set_section_addresses): Ditto.
2029 2010-05-18 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2031 * gold.h (Unordered_multimap, Unordered_map): Fix defines for
2032 when neither HAVE_TR1_UNORDERED_MAP nor HAVE_EXT_HASH_MAP are set.
2034 2010-05-18 Rafael Espindola <espindola@google.com>
2036 * options.cc (General_options::finalize): Handle -nostdlib.
2037 * options.h (nostdlib): New option.
2038 * script.cc (script_add_search_dir): Handle -nostdlib.
2040 2010-05-12 Doug Kwan <dougkwan@google.com>
2042 * arm.cc (Target_arm::do_finalize_sections): Create an empty
2043 attributes section only if there no attributes section after merging.
2044 (Target_arm::merge_object_attributes): Move value of
2045 Tag_MPextension_use_legacy to that of Tag_MPextension_use.
2046 Handle Tag_DIV_use and Tag_MPextension_use_legacy.
2047 * testsuite/Makefile.am (check_SCRIPTS): Add arm_attr_merge.sh
2048 (check_DATA): Add arm_attr_merge_6.stdout, arm_attr_merge_6r_stdout
2049 and arm_attr_merge_7.stdout.
2050 (arm_attr_merge_6.stdout, arm_attr_merge_6 arm_attr_merge_6a.o
2051 arm_attr_merge_6b.o, arm_attr_merge_6r.stdout, arm_attr_merge_6r,
2052 arm_attr_merge_7.stdout, arm_attr_merge_7, arm_attr_merge_7a.o,
2053 arm_attr_merge_7b.o): New rules.
2054 (MOSTLYCLEANFILES): Add arm_attr_merge_6, arm_attr_merge_6r and
2056 * testsuite/Makefile.in: Regenerate.
2057 * testsuite/arm_attr_merge.sh: New file.
2058 * testsuite/arm_attr_merge_[67][ab].s: Same.
2060 2010-05-05 Nick Clifton <nickc@redhat.com>
2062 * po/es.po: Updated Spanish translation.
2064 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2066 * Makefile.am (install-exec-local): Properly install gold as
2067 default cross linker.
2068 * Makefile.in: Regenerated.
2070 2010-04-27 H.J. Lu <hongjiu.lu@intel.com>
2071 Nick Clifton <nickc@redhat.com>
2073 * configure.ac (install_as_default): Define and set to false
2074 unless --enable-gold or --enable-gold=both/gold has been
2076 * configure: Regenerate.
2078 * Makefile.am (install-exec-local): Install the executable as
2079 'ld.gold'. If install_as_default is true then also install it as
2081 * Makefile.in: Regenerated.
2083 2010-04-24 Ian Lance Taylor <iant@google.com>
2085 * layout.cc (Layout::layout_reloc): In relocatable link don't
2086 combine reloc sections for grouped sections.
2088 2010-04-23 Sriraman Tallam <tmsriram@google.com>
2090 * gc.h (gc_process_relocs): Pass information on relocs pointing to
2091 sections that are not ordinary to icf.
2092 * icf.cc (get_section_contents): Handle relocation pointing to section
2093 with no object or shndx information.
2094 * testsuite/Makefile.am: Remove icf_virtual_function_folding_test.sh
2095 * testsuite/Makefile.in: Regenerate.
2096 * testsuite/icf_virtual_function_folding_test.cc: Remove printf.
2097 * testsuite/icf_virtual_function_folding_test.sh: Delete file.
2099 2010-04-22 Ian Lance Taylor <iant@google.com>
2101 * expression.cc (Expression::Expression_eval_info): Add
2102 result_alignment_pointer field.
2103 (Expression::eval_with_dot): Add result_alignment_pointer
2104 parameter. Change all callers.
2105 (Expression::eval_maybe_dot): Likewise.
2106 (class Binary_expression): Add alignment_pointer parameter to
2107 left_value and right_value. Change all callers.
2108 (BINARY_EXPRESSION): Set result alignment.
2109 (class Trinary_expression): Add alignment_pointer parameter to
2110 arg2_value and arg3_value. Change all callers.
2111 (Trinary_cond::value): Set result alignment.
2112 (Max_expression::value, Min_expression::value): Likewise.
2113 (Align_expression::value): Likewise.
2114 * script-sections.cc (class Sections_element): Add dot_alignment
2115 parameter to set_section_addresses virtual function. Update
2117 (class Output_section_element): Likewise.
2118 (Script_sections::create_segments): Add dot_alignment parameter.
2120 (Script_sections::create_segments_from_phdrs_clause): Likewise.
2121 (Script_sections::set_phdrs_clause_addresses): Likewise.
2122 * script-sections.h: Update declarations.
2123 * script.h: Update declarations.
2124 * output.h (Output_segment::set_minimum_p_align): Don't decrease
2126 * testsuite/script_test_3.t: Set large alignment.
2127 * testsuite/script_test_3.sh: Make sure that at least one LOAD
2128 segment has expected alignment.
2130 2010-04-22 Nick Clifton <nickc@redhat.com>
2132 * po/gold.pot: Updated by the Translation project.
2133 * po/vi.po: Updated Vietnamese translation.
2135 2010-04-22 H.J. Lu <hongjiu.lu@intel.com>
2137 * testsuite/Makefile.am (check_PROGRAMS): Add
2138 icf_virtual_function_folding_test.
2139 * testsuite/Makefile.in: Regenerated.
2141 2010-04-15 Andrew Haley <aph@redhat.com>
2143 * options.h (merge_exidx_entries): New option.
2144 * arm.cc (class Arm_exidx_fixup): Add new arg, merge_exidx_entries.
2145 (class Arm_exidx_fixup::merge_exidx_entries_): New member.
2146 (Output_section::fix_exidx_coverage): Add new arg, merge_exidx_entries.
2147 (Target_arm::merge_exidx_entries): New function.
2148 (process_exidx_entry): Don't merge if merge_exidx_entries_ is false.
2149 (Arm_output_section::fix_exidx_coverage): Pass merge_exidx_entries
2150 to Arm_exidx_fixup constructor.
2151 Add new arg, merge_exidx_entries.
2152 (Target_arm::fix_exidx_coverage): pass merge_exidx_entries to
2153 Arm_output_section::fix_exidx_coverage.
2155 2010-04-18 Sriraman Tallam <tmsriram@google.com>
2157 * icf.cc (get_section_contents): Check for preemptible functions.
2158 Ignore addend when appropriate.
2159 * symtab.cc (should_add_dynsym_entry): Add new parameter. Check for
2161 (add_from_relobj): Check for section folded.
2162 (set_dynsym_indexes): Fix call to should_add_dynsym_entry.
2163 * symtab.h (should_add_dynsym_entry): Add new parameter.
2164 * target-reloc.h (scan_relocs): Check for section folded.
2165 * x86_64.cc (Target_x86_64::Scan::possible_function_pointer_reloc):
2166 Check reloc types for function pointers in shared objects.
2167 * testsuite/Makefile.am (icf_virtual_function_folding_test): New test
2169 (icf_preemptible_functions_test): New test case.
2170 (icf_string_merge_test): New test case.
2171 * testsuite.Makefile.in: Regenerate.
2172 * testsuite/icf_safe_so_test.sh: Change to not fold foo_glob and
2173 bar_glob. Refactor code.
2174 * testsuite/icf_preemptible_functions_test.cc: New file.
2175 * testsuite/icf_preemptible_functions_test.sh: New file.
2176 * testsuite/icf_string_merge_test.cc: New file.
2177 * testsuite/icf_string_merge_test.sh: New file.
2178 * testsuite/icf_virtual_function_folding_test.cc: New file.
2179 * testsuite/icf_virtual_function_folding_test.sh: New file.
2181 2010-04-14 Doug Kwan <dougkwan@google.com>
2183 * arm.cc (Arm_output_section::fix_exidx_coverage): Mark object
2184 for local symbol recounting if we remove a section due to ICF.
2185 * gold.cc (queue_middle_gc_tasks): Create a dummy blocker if
2186 there are no regular objects in input.
2188 2010-04-13 Doug Kwan <dougkwan@google.com>
2190 * arm.cc (Arm_input_section::set_final_data_size): Compute
2191 accurate final data size instead of using current data size.
2193 2010-04-09 Doug Kwan <dougkwan@google.com>
2195 * layout.cc (Layout::choose_output_section): Handle script section
2197 (Layout::make_output_section_for_script): Add section type parameter.
2198 Handle script section types.
2199 * layout.h (Layout::make_output_section_for_script): Add section
2201 * output.cc (Output_section::Output_section): Initialize data member
2203 (Output_section::do_reset_address_and_file_offset): Do not set address
2204 to 0 if section is a NOLOAD section.
2205 * output.h (Output_section::is_noload): New method.
2206 (Output_section::set_is_noload): Ditto.
2207 (Output_section::is_noload_): New data member.
2208 * script-c.h (Script_section_type): New enum type.
2209 (struct Parser_output_section_header): Add new file section_type.
2210 * script-sections.cc (Sections_element::output_section_name): Add
2211 parameter for returning script section type.
2212 (Output_section_definition::output_section_name): Ditto.
2213 (Output_section_definition::section_type)P; New method.
2214 (Output_section_definiton::script_section_type_name): Ditto.
2215 (Output_section_definition::script_section_type_): New data member.
2216 (Output_section_definition::Output_section_definition): Initialize
2217 data member Output_section_definition::script_section_type_.
2218 (Output_section_definition::create_sections): Pass script section type
2219 to Layout::make_output_section_for_script.
2220 (Output_section_definition::output_section_name): Return script
2221 section type to caller.
2222 (Output_section_definition::set_section_address): Do not advance
2223 dot value and load address if section type is NOLOAD. Set address
2224 of NOLOAD sections regardless of section flags.
2225 (Output_section_definition::print): Print section type if it is
2226 not SCRIPT_SECTION_TYPE_NONE.
2227 (Output_section_definition::section_type): New method.
2228 (Output_section_definition::script_section_type_name): Ditto.
2229 (Script_sections::output_section_name): Add new parameter
2230 PSECTION_TYPE for returning script section type. Pass it to
2231 section elements. Handle discard sections.
2232 (Sort_output_sections::operator()): Handle NOLOAD sections.
2233 * script-sections.h (Script_sections::Section_type): New enum type.
2234 (Script_sections::output_section_name): Add a new parameter for
2235 returning script section type.
2236 * script.cc (script_keyword_parsecodes): Add keywords COPY, DSECT,
2238 * yyscript.y (union): Add new field SECTION_TYPE.
2239 (COPY, DSECT, INFO, NOLOAD): New tokens.
2240 (opt_address_and_section_type): Change type to output_section_header.
2241 (section_type): New non-terminal
2242 (section_header): Handle section type.
2243 (opt_address_and_section_type): Return section type value.
2245 2010-04-09 H.J. Lu <hongjiu.lu@intel.com>
2247 * testsuite/plugin_common_test_1.c (foo): Add prototype.
2248 * testsuite/plugin_common_test_2.c (foo): Likewise.
2250 2010-04-08 Doug Kwan <dougkwan@google.com>
2252 * merge.cc (Output_merge_data::set_final_data_size): Handle empty
2254 * output.cc (Output_section::add_merge_input_section): Simplify
2255 code and return status of Output_merge_base::add_input_section.
2256 Update merge section map only if Output_merge_base::add_input_section
2259 2010-04-07 Doug Kwan <dougkwan@google.com>
2261 * arm.cc (Arm_relobj::scan_section_for_cortex_a8_erratum): Warn
2262 if section is marked as containing instructions but has no mapping
2264 (Arm_relobj::do_count_local_symbols): Call adjust_sym_shndx to get
2265 correct section index.
2266 (Arm_relobj::find_linked_text_section): Ditto.
2268 2010-04-07 Cary Coutant <ccoutant@google.com>
2270 * archive.cc (include_member): Destroy Read_symbols_data object before
2272 * object.cc (Read_symbols_data::~Read_symbols_data) New destructor.
2273 * object.h (Read_symbols_data::Read_symbols_data) New constructor.
2274 (Read_symbols_data::~Read_symbols_data) New destructor.
2275 (Section_relocs::Section_relocs) New constructor.
2276 (Section_relocs::~Section_relocs) New destructor.
2277 (Read_relocs_data::Read_relocs_data) New constructor.
2278 (Read_relocs_data::~Read_relocs_data) New destructor.
2279 * testsuite/binary_unittest.cc (Sized_binary_test): Set sd member
2280 pointers to NULL after deleting.
2282 2010-04-07 Doug Kwan <dougkwan@google.com>
2284 * arm.cc: Replace "endianity" with "endianness" in comments.
2285 (Arm_exidx_cantunwind): Ditto.
2286 (Arm_relobj::Arm_relobj): Initialize merge_flags_and_attribures.
2287 (Arm_relobj::merge_flags_and_attributes): New method.
2288 (Arm_relobj::merge_flags_and_attributes_): New data member.
2289 (Arm_exidx_cantunwind::do_fixed_endian_write): Fix formatting.
2290 (Arm_relobj::scan_sections_for_stubs): Ditto.
2291 (Arm_relobj::do_read_symbols): Check to see if we really want to
2292 merge processor-specific flags and attributes. Exit early if
2293 an object is empty except for section names and the undefined symbol.
2294 (Target_arm::do_finalize_sections): Move check for ELF format to
2295 Arm_relobj::do_read_symbols. Merge processor specific flags and
2296 attributes from a regular object only when we have determined that
2297 it is aapropriate. Do not create an .ARM.attributes section in
2298 output if there is no regular input object.
2299 (Target_arm::merge_processor_specific_flags): Check
2300 --warn-mismatch before printing any error.
2301 (Target_arm::merge_object_attributes): Ditto.
2302 * gold.cc (queue_middle_tasks): Handle the case in which there is
2303 no regular object in input.
2304 * options.cc (General_options::parse_EB): New method.
2305 (General_options::parse_EL): Same.
2306 (General_options::General_options): Initialize endianness_.
2307 * options.h (-EB, -EL, -no-pipeline-knowledge, -p, --warn-mismatch):
2309 (General_options::Endianness): New enum.
2310 (General_options::endianness): New method.
2311 (General_options::endianness_): New data member.
2312 * parameters.cc (Parameters::set_options): Check target endianness.
2313 (Parameters::set_target_once): Ditto.
2314 (Parameters::check_target_endianness): New method.
2315 (parameters_force_valid_target): If either -EL or -EB is specified,
2316 use it to define endianness of default target.
2317 * parameters.h (Parameters::check_target_endianness): New method
2319 * target.h (class Target): Change "endianity" to "endianness"
2322 2010-04-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2324 * configure.ac (AM_INIT_AUTOMAKE): Add option no-dist.
2325 * configure: Regenerate.
2326 * Makefile.in: Regenerate.
2327 * testsuite/Makefile.in: Regenerate.
2329 2010-04-06 Cary Coutant <ccoutant@google.com>
2332 * plugin.cc (Pluginobj::get_symbol_resolution_info): Check for
2333 prevailing definitions of common symbols.
2334 * testsuite/plugin_test_6.sh: New test case.
2335 * testsuite/plugin_common_test_1.c: New test case.
2336 * testsuite/plugin_common_test_2.c: New test case.
2337 * testsuite/Makefile.am (plugin_test_6): New test case.
2338 * testsuite/Makefile.in: Regenerate.
2340 2010-04-06 Nick Clifton <nickc@redhat.com>
2342 * po/vi.po: New Vietnamese translation.
2344 2010-03-30 Doug Kwan <dougkwan@google.com>
2346 * arm.cc (Target_arm::using_thumb_only): Handle v6-M
2348 2010-03-25 Doug Kwan <dougkwan@google.com>
2350 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Rearrange code
2351 to avoid a conversion warning on a 32-bit host.
2353 2010-03-24 Ian Lance Taylor <iant@google.com>
2355 * testsuite/script_test_3.t: Add a TLS segment.
2356 * testsuite/Makefile.am (check_PROGRAMS): Add
2357 tls_phdrs_script_test.
2358 (tls_phdrs_script_test_SOURCES): Define.
2359 (tls_phdrs_script_test_DEPENDENCIES): Define.
2360 (tls_phdrs_script_test_LDFLAGS): Define.
2361 (tls_phdrs_script_test_LDADD): Define.
2362 * testsuite/Makefile.in: Rebuild.
2364 2010-03-23 Cary Coutant <ccoutant@google.com>
2366 * fileread.cc (find_or_make_view): Fix comment.
2368 2010-03-23 Ian Lance Taylor <iant@google.com>
2370 * script-sections.cc (class Orphan_section_placement): Define
2371 PLACE_TLS and PLACE_TLS_BSS.
2372 (Orphan_section_placement::Orphan_section_placement): Initialize
2374 (Orphan_section_placement::find_place): Handle SHF_TLS sections.
2375 * testsuite/Makefile.am (check_PROGRAMS): Add tls_script_test.
2376 (tls_script_test_SOURCES): Define.
2377 (tls_script_test_DEPENDENCIES): Define.
2378 (tls_script_test_LDFLAGS): Define.
2379 (tls_script_test_LDADD): Define.
2380 * testsuite/Makefile.in: Rebuild.
2382 2010-03-22 Doug Kwan <dougkwan@google.com>
2384 * arm.cc (Arm_relocate_functions::abs8,
2385 Arm_relocate_functions::abs16): Use correct check for overflow
2386 specified in the ARM ELF specs.
2387 (Arm_relocate_functions): thumb_branch_common. Handle bit 1 of branch
2388 target of a BLX instruction specially.
2389 (Reloc_stub::stub_type_for_reloc): Ditto.
2390 (Relocate::relocate): Use symbolic names instead of numeric relocation
2391 codes to report error.
2392 (Target_arm::do_relox): Reduce default stub-group size for Cortex-A8
2394 * testsuite/Makefile.am (check_DATA): add thumb_blx_in_range.stdout,
2395 thumb_blx_out_of_range.stdout, thumb2_blx_in_range.stdout and
2396 thumb2_blx_out_of_range.stdout
2397 (thumb_bl_out_of_range, thumb_bl_out_of_range.o,
2398 thumb2_bl_out_of_range, thumb2_bl_out_of_range.o): Fix dependenices.
2399 (thumb_blx_in_range.stdout, thumb_blx_in_range, thumb_blx_in_range.o,
2400 thumb_blx_out_of_range.stdout, thumb_blx_out_of_range,
2401 thumb_blx_out_of_range.o, thumb2_blx_in_range.stdout,
2402 thumb2_blx_in_range, thumb2_blx_in_range.o,
2403 thumb2_blx_out_of_range.stdout, thumb2_blx_out_of_range,
2404 thumb2_blx_out_of_range.o): New rules.
2405 (MOSTLYCLEANFILES): Add thumb_blx_in_range, thumb_blx_out_of_range,
2406 thumb2_blx_in_range and thumb2_blx_out_of_range.
2407 * testsuite/Makefile.in: Regenerate.
2408 * arm_branch_in_range.sh: Add tests for THUMB BLX.
2409 * testsuite/thumb_blx_in_range.s: New file.
2410 * testsuite/thumb_blx_out_of_range.s: New file.
2412 2010-03-22 Rafael Espindola <espindola@google.com>
2414 * archive.cc (Should_include): Move to archive.h.
2415 (should_include_member): Make it a member of Archive.
2417 (Add_lib_group_symbols): New.
2418 * archive.h: Include options.h.
2419 (Archive_member): Moved from Archive.
2420 (Should_include): Moved from archive.cc.
2422 (Add_lib_group_symbols): New.
2423 * dynobj.cc (do_should_include_member): New.
2424 * dynobj.h (do_should_include_member): New.
2425 * gold.cc (queue_initial_tasks): Update call to queue.
2426 * main.cc (main): Print lib group stats.
2427 * object.cc (do_should_include_member): New.
2428 * object.h: Include archive.h.
2429 (Object::should_include_member): New.
2430 (Object::do_should_include_member): New.
2431 (Sized_relobj::do_should_include_member): New.
2432 * options.cc (General_options::parse_start_lib): New.
2433 (General_options::parse_end_lib): New.
2434 (Input_arguments::add_file): Handle lib groups.
2435 (Input_arguments::start_group): Check we are not in a lib.
2436 (Input_arguments::start_lib): New.
2437 (Input_arguments::end_lib): New.
2438 * options.h (General_options): Add start_lib and end_lib.
2439 (Input_argument::lib_): New.
2440 (Input_argument::lib): New.
2441 (Input_argument::is_lib): New.
2442 (Input_file_lib): New.
2443 (Input_arguments::in_lib_): New.
2444 (Input_arguments::in_lib): New.
2445 (Input_arguments::start_lib): New.
2446 (Input_arguments::end_lib_): New.
2447 * plugin.cc (Pluginobj::get_symbol_resolution_info): Mark symbols
2448 in unused members as preempted.
2449 (Sized_pluginobj::do_should_include_member): New.
2450 * plugin.h (Sized_pluginobj::do_should_include_member): New.
2451 * readsyms.cc (Read_symbols::locks): If we are just reading a member,
2453 (Read_symbols::do_whole_lib_group): New.
2454 (Read_symbols::do_lib_group): New.
2455 (Read_symbols::do_read_symbols): Handle lib groups.
2456 (Read_symbols::get_name): Handle lib groups.
2457 * readsyms.h (Read_symbols): Add an archive member pointer.
2458 (Read_symbols::do_whole_lib_group): New.
2459 (Read_symbols::do_lib_group): New.
2460 (Read_symbols::member_): New.
2461 * script.cc (read_input_script): Update call to queue_soon.
2463 2010-03-19 Doug Kwan <dougkwan@google.com>
2465 * arm.cc (Stub_table::Stub_table): Initialize new data members
2466 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
2467 (Stub_table::add_reloc_stub): Assign stub offset and update
2468 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_.
2469 (Stub_table::reloc_stubs_size_, Stub_table::reloc_stubs_addralign_):
2471 (Stub_table::update_data_size_and_addralign): Use
2472 Stub_table::reloc_stubs_size_ and Stub_table::reloc_stubs_addralign_
2473 instead of going over all reloc stubs.
2474 (Stub_table::finalize_stubs): Do not assign reloc stub offsets.
2475 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
2476 Stringpool_template::offset_ to size of Stringpool_char.
2477 (Stringpool_template::new_key_offset): Remove code to initialize
2478 Stringpool_template::offset_.
2479 * stringpool.h (Stringpool_template::set_no_zero_null): Set
2480 Stringpool_template::offset_ to zero.
2482 2010-03-15 Doug Kwan <dougkwan@google.com>
2484 * stringpool.cc (Stringpool_template::Stringpool_template): Initialize
2486 (Stringpool_template::new_key_offset): New method.
2487 (Stringpool_template::add_string): Assign offsets when adding new
2489 (Stringpool_template::set_string_offsets): Do not set string offsets
2490 when not optimizing.
2491 * stringpool.h (Chunked_vector::Chunked_vector): Initialize data
2493 (Chunked_vector::clear): Clear size_.
2494 (Chunked_vector::reserve): Call reserve method of all Element_vectors.
2495 (Chunked_vector::size): Return size_.
2496 (Chunked_vector::push_back): Use size_ to find insert position.
2497 (Chunked_vector::size_): New data member.
2498 (Stringpool_template::set_no_zero_null): Assert string set is empty.
2499 (Stringpool_template::new_key_offset): New method declaration.
2500 (Stringpool_template::offset_): New data member.
2502 2010-03-15 Rafael Espindola <espindola@google.com>
2504 * readsyms.cc (Read_symbols::do_read_symbols): Update calls to
2505 Add_symbols' constructor.
2506 * readsyms.h (Add_symbols): Remove the input_group member.
2508 2010-03-10 Ian Lance Taylor <iant@google.com>
2510 * reloc.cc (Sized_relobj::split_stack_adjust_reltype): Call the
2511 target to ask whether a reference to a symbol requires a stack
2513 * target.h (Target::is_call_to_non_split): New function.
2514 (Target::do_is_call_to_non_split): Declare virtual function.
2515 * target.cc: Include "symtab.h".
2516 (Target::do_is_call_to_non_split): New function.
2517 * i386.cc (Target_i386::do_is_call_to_non_split): New function.
2519 2010-03-10 Cary Coutant <ccoutant@google.com>
2521 * fileread.cc (File_read::~File_read): Don't delete whole_file_view_.
2522 (File_read::open[1]): Remove initial mapping of whole_file_view_.
2523 (File_read::open[2]): Add whole_file_view_ to list of views.
2524 (File_read::make_view): Remove test of whole_file_view_.
2525 (File_read::find_or_make_view): Create whole_file_view_ if
2527 (File_read::clear_views): Replace bool parameter with enum;
2528 adjust all callers. Don't delete views with permanent data;
2529 do delete cached views and views from archives if
2530 --no-keep-files-mapped is set. Set whole_file_view_ to NULL
2531 if clearing the corresponding view.
2532 * fileread.h (File_read::Clear_views_mode): New enum.
2533 (File_read::View::is_permanent_view): New method.
2534 (File_read::clear_views): Replace bool parameter
2535 with enum; adjust all callers.
2536 * options.h (General_options): Change keep_files_mapped option;
2537 add map_whole_files.
2538 * readsyms.cc (Add_symbols::run): Delete sd_ object before
2540 * reloc.cc (Scan_relocs::run): Delete rd_ object before releasing
2543 2010-03-10 David S. Miller <davem@davemloft.net>
2545 * sparc.cc (Target_sparc::Scan::local): Accept R_SPARC_WPLT30.
2547 2010-03-09 Sriraman Tallam <tmsriram@google.com>
2549 * icf.cc (get_section_contents): Add '@' marker after processing the
2552 2010-03-08 Doug Kwan <dougkwan@google.com>
2554 * gold/arm.cc (Arm_exidx_fixup::update_offset_map): Fix build breakage
2555 due to a conversion warning.
2556 (Arm_relobj::update_output_local_symbol_count): Check for local
2557 symbol with unset output index.
2559 2010-03-05 Ian Lance Taylor <iant@google.com>
2561 * options.h (class General_options): Add --spare-dynamic-tags.
2562 * output.cc (Output_data_dynamic::set_final_data_size): Implement
2563 --spare-dynamic-tags.
2565 2010-03-05 Ian Lance Taylor <iant@google.com>
2567 * incremental.cc: Include "libiberty.h".
2569 2010-03-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
2571 * dynobj.h (Verdef::Verdef): Add is_info arg, is_info member
2572 function, is_info_ member.
2573 * dynobj.cc (Verdef::write): Set VER_FLG_INFO if this->is_info_.
2574 (Versions::Versions): Update caller.
2575 (Versions::define_base_version): Likewise.
2576 (Versions::add_def): Likewise.
2578 2010-03-03 Sriraman Tallam <tmsriram@google.com>
2580 * i386.cc (Target_i386::can_check_for_function_pointers): New function.
2581 (Scan::possible_function_pointer_reloc): New function.
2582 (Scan::local_reloc_may_be_function_pointer): Change to call
2583 possible_function_pointer_reloc.
2584 (Scan::global_reloc_may_be_function_pointer): Ditto.
2585 * icf.h (Icf::check_section_for_function_pointers): Change to reject
2586 relocations in ".data.rel.ro._ZTV" section.
2587 * testsuite/icf_safe_so_test.sh: Change to pass i386.
2588 * testsuite/icf_safe_so_test.cc: Ditto.
2589 * testsuite/icf_safe_test.cc: Ditto.
2590 * testsuite/icf_safe_test.sh: Ditto.
2592 2010-03-03 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2593 Ian Lance Taylor <iant@google.com>
2595 * target-reloc.h (relocate_section): Check the symbol table index
2596 for -1U before setting the local symbol index.
2597 (scan_relocatable_relocs): If copying the relocation, record that
2598 the local symbol is required.
2599 * object.h (Symbol_value::is_output_symtab_index_set): New
2601 (Symbol_value::may_be_discarded_from_output_symtab): New
2603 (Symbol_value::has_output_symtab_entry): New function.
2604 (Symbol_value::needs_output_symtab_entry): Remove.
2605 (Symbol_value::output_symtab_index): Make sure the symbol index is
2607 (Symbol_value::set_output_symtab_index): Make sure the symbol
2608 index is not set. Make sure the new index is valid.
2609 (Symbol_value::set_must_have_output_symtab_entry): New function.
2610 (Symbol_value::has_output_dynsym_entry): New function.
2611 (Symbol_value::set_output_dynsym_index): Make sure the new index
2613 (Sized_relobj::set_must_have_output_symtab_entry): New function.
2614 * object.cc (Sized_relobj::do_count_local_symbols): Only discard a
2615 local symbol if permitted.
2616 (Sized_relobj::do_finalize_local_symbols): Call
2617 is_output_symtab_index_set rather than needs_output_symtab_entry.
2618 (Sized_relobj::write_local_symbols): Call has_output_symtab_entry
2619 rather than needs_output_symtab_entry. Call
2620 has_output_dynsym_entry rather than needs_output_dynsym_entry.
2621 * arm.cc (Arm_relobj::update_output_local_symbol_count): Call
2622 is_output_symtab_index_set rather than needs_output_symtab_entry.
2623 * testsuite/discard_locals_relocatable_test.c: New file.
2624 * testsuite/discard_locals_test.sh: Test -r.
2625 * testsuite/Makefile.am (check_DATA): Add
2626 discard_locals_relocatable_test1.syms,
2627 discard_local_relocatable_test2.syms.
2628 (MOSTLYCLEANFILES): Likewise. Also add
2629 discard_locals_relocatable_test1.lout and
2630 discard_locals_relocatable_test2.out.
2631 (discard_locals_relocatable_test1.syms): New target.
2632 (discard_locals_relocatable_test.o): New target.
2633 (discard_locals_relocatable_test1.out): New target.
2634 (discard_locals_relocatable_test2.syms): New target.
2635 (discard_locals_relocatable_test2.out): New target.
2636 (various): Add missing ../ld-new dependencies.
2637 * testsuite/Makefile.in: Rebuild.
2639 2010-03-03 Nick Clifton <nickc@redhat.com>
2641 * po/fi.po: New Finnish translation.
2643 2010-03-01 Doug Kwan <dougkwan@google.com>
2645 * layout.cc (Layout::Layout): Force section types of .init_array*,
2646 .preinit_array* and .fini_array* sections.
2647 * output.cc (Output_section::Input_section_sort_entry::has_priority):
2648 Fix check of return value of std::string::find.().
2649 (Output_section::Input_section_sort_compare::operator()): Remove
2650 comment about .init_array.
2651 (Output_section::Input_section_sort_init_fini_compare::operator()):
2653 (Output_section::sort_attached_input_sections): Handle .init_array
2654 and .fini_array specially.
2655 * output.h (Output_section::Inut_section_sort_compare): Update
2657 (Output_section::Input_section_sort_init_fini_compare): New struct.
2659 2010-02-26 Doug Kwan <dougkwan@google.com>
2661 * arm.cc (Target_arm::Relocate::reloc_is_non_pic): Treat
2662 R_ARM_PREL31 and R_ARM_SBREL31 as position independent.
2663 * testsuite/debug_msg.sh: Avoid matching source line number for
2664 use of global variable undef_int.
2666 2010-02-26 Doug Kwan <dougkwan@google.com>
2668 * arm.cc (Target_arm::scan_reloc_for_stub): Move code handling
2669 R_ARM_V4BX to Target_arm::scan_reloc_section_for_stubs.
2670 (Target_arm::scan_reloc_section_for_stubs): Instead of calling
2671 scan_reloc_for_stub, do all processing of R_ARM_V4BX here.
2672 * options.cc (General_options::General_options): Initialize member
2674 * testsuite/Makefile.am (check_SCRIPTS): Add arm_fix_v4bx.sh
2675 (check_DATA): Add arm_fix_v4bx.stdout, arm_fix_v4bx_interworking.stdout
2676 and rm_no_fix_v4bx.stdout
2677 (arm_fix_v4bx.stdout, arm_fix_v4bx, arm_fix_v4bx.o,
2678 arm_fix_v4bx_interworking.stdout, arm_fix_v4bx_interworking,
2679 arm_no_fix_v4bx.stdout, arm_no_fix_v4bx): New make rules.
2680 (MOSTLYCLEANFILES): Add arm_fix_v4bx, arm_fix_v4bx_interworking
2681 and arm_no_fix_v4bx.
2682 * Makefile.in: Regenerate.
2683 * testsuite/arm_fix_v4bx.s: New file.
2684 * testsuite/arm_fix_v4bx.sh: Ditto.
2686 2010-02-24 Doug Kwan <dougkwan@google.com>
2688 * arm.cc (Target_arm::got_section): Make the .got section the first
2689 non RELRO section in the data segment.
2690 * testsuite/script_test_5.sh: Fix match patterns to avoid matching
2691 suffixes of section names.
2693 2010-02-24 Doug Kwan <dougkwan@google.com>
2695 * arm.cc (Target_arm::do_finalize_sections): Skip processor specific
2696 flags and attributes merging if an input file is a binary file.
2697 * fileread.cc (Input_file::open): Record format of original file.
2698 * fileread.h (Input_file::Format): New enum type.
2699 (Input_file::Input_file): Initialize data member format_.
2700 (Input_file::format): New method definition.
2701 (Input_file::format_):: New data member.
2703 2010-02-24 Doug Kwan <dougkwan@google.com>
2705 * arm.cc (Arm_output_data_got): New class.
2706 (ARM_TCB_SIZE): New constant
2707 (Target_arm): Use Arm_output_data_got instead of Output_data_got.
2708 (Arm_output_section::fix_exidx_coverage): Add a parameter for layout.
2709 If user uses a script with a SECTIONS clause, issue only a warning
2710 for a misplaced EXIDX input section. Otherwise, issue an error.
2711 (Arm_relobj::do_gc_process_relocs): Exit early if we are not doing
2713 (Target_arm::got_mode_index_entry): Handle static linking.
2714 (Target_arm::Scan::local): Ditto.
2715 (Target_arm::Scan::global): Ditto.
2716 (Target_arm::Relocate::relocate_tls): Handle static linking. Fix
2717 all incorrectly implemented relocations.
2718 (Target_arm::fix_exidx_coverage): Pass layout to
2719 Arm_output_section::fix_exidx_coverage.
2720 * layout.cc (Layout::section_name_mapping): Remove trailing dots
2721 from ".ARM.exidx." and ".ARM.extab.".
2723 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2725 * arm.cc (Target_arm::do_finalize_sections): Create attribute
2726 section if it does not already exist.
2727 * attributes.cc (Attributes_section_data::Attributes_section_data):
2728 Don't crash if size is zero.
2730 2010-02-23 Viktor Kutuzov <vkutuzov@accesssoftek.com>
2731 Ian Lance Taylor <iant@google.com>
2733 * gold.cc (queue_middle_tasks): If no input files were opened,
2735 * workqueue.h (Task_function::Task_function): Assert that there is
2738 2010-02-22 Doug Kwan <dougkwan@google.com>
2740 * gold-threads.h (Once::~Once): Explicitly define virtual destructor.
2741 * icf.cc (get_section_contents): Cast snprintf arguments to long long
2742 types to avoid warnings due to different uint64_t implementations
2745 2010-02-21 Doug Kwan <dougkwan@google.com>
2747 * arm.cc (Arm_relocate_functions::arm_branch_common): Fix bug in
2748 handling of the maximum backward branch offset.
2749 (Arm_relocate_functions::thumb_branch_common): Ditto.
2750 * testsuite/Makefile.am (check_SCRIPTS): Add arm_branch_in_range.sh.
2751 (check_DATA): Add arm_bl_in_range.stdout, arm_bl_out_of_range.stdout
2752 thumb_bl_in_range.stdout, thumb_bl_out_of_range.stdout,
2753 thumb2_bl_in_range.stdout and thumb2_bl_out_of_range.stdout.
2754 (arm_bl_in_range.stdout, arm_bl_in_range, arm_bl_in_range.o,
2755 arm_bl_out_of_range.stdout, arm_bl_out_of_range,
2756 arm_bl_out_of_range.o, thumb_bl_in_range.stdout, thumb_bl_in_range,
2757 thumb_bl_in_range.o, thumb_bl_out_of_range.stdout,
2758 thumb_bl_out_of_range thumb_bl_out_of_range.o,
2759 thumb2_bl_in_range.stdout, thumb2_bl_in_range, thumb2_bl_in_range.o
2760 thumb2_bl_out_of_range.stdout, thumb2_bl_out_of_range,
2761 thumb2_bl_out_of_range.o): New rules.
2762 (MOSTLYCLEANFILES): Add arm_bl_in_range, arm_bl_out_of_range,
2763 thumb_bl_in_range, thumb_bl_out_of_range, thumb2_bl_in_range and
2764 thumb2_bl_out_of_range
2765 * testsuite/Makefile.in: Regenerate.
2766 * testsuite/arm_bl_in_range.s: New file.
2767 * testsuite/arm_bl_out_of_range.s: Ditto.
2768 * testsuite/arm_branch_in_range.sh: Ditto.
2769 * testsuite/arm_branch_range.t: Ditto.
2770 * testsuite/thumb2_branch_range.t: Ditto.
2771 * testsuite/thumb_bl_in_range.s: Ditto.
2772 * testsuite/thumb_bl_out_of_range.s: Ditto.
2773 * testsuite/thumb_branch_range.t: Ditto.
2775 2010-02-20 Sriraman Tallam <tmsriram@google.com>
2777 * gc.h (gc_process_relocs): Change vectors to point to the new list.
2778 Add reloc offset information.
2779 * icf.cc (get_section_contents): Change iterators to point to the new
2780 vectors. Add reloc offset information to the contents.
2781 * icf.h (Icf::Sections_reachable_info): New typedef.
2782 (Icf::Sections_reachable_list): New typedef.
2783 (Icf::Offset_info): New typedef.
2784 (Icf::Reloc_info): New struct typedef.
2785 (Icf::Reloc_info_list): New typedef.
2786 (Icf::symbol_reloc_list): Delete method.
2787 (Icf::addend_reloc_list): Delete method.
2788 (Icf::section_reloc_list): Delete method.
2789 (Icf::reloc_info_list): New method.
2790 (Icf::reloc_info_list_): New member.
2792 2010-02-19 Doug Kwan <dougkwan@google.com>
2794 * arm-reloc.def: Mark R_ARM_TLS_GD32, R_ARM_TLS_LDM32,
2795 R_ARM_TLS_LDO32, R_ARM_TLS_IE32 and R_ARM_TLS_LE32 are implemented.
2796 * arm.cc (Arm_relocation_functions): New forward declaration.
2797 (Target_arm::Target_arm): Initialize new data members
2798 got_mod_index_offset_ and tls_base_symbol_defined_.
2799 (Target_arm::Relocate::relocate_tls): New method.
2800 (Target_arm::optimize_tls_reloc, Target_arm::define_tls_base_symbol,
2801 Target_arm::got_mod_index_entry, Target_arm::rel_tls_desc_section):
2803 (Target_arm::Got_type): Add GOT_TYPE_TLS_NOFFSET, GOT_TYPE_OFFSET,
2804 GOT_TYPE_TLS_PAIR and GOT_TYPE_TLS_DESC.
2805 (Target_arm::got_mod_index_offset_,
2806 Target_arm::tls_base_symbol_defined_): New data members.
2807 (Target_arm::Scan::local, Target::Scan::global,
2808 Target_arm::Relocate::relocate): Handle 32-bit initial TLS
2811 2010-02-18 Doug Kwan <dougkwan@google.com>
2813 * arm.cc (Arm_relobj::find_linked_text_section): New method.
2814 (Arm_relobj::make_exidx_input_section): Pass section index of linked
2815 text section as a parameter becuase some broken tools may not set
2816 the link in section header.
2817 (Target_arm::has_got_section): New method.
2818 (Target_arm::scan_section_for_cortex_a8_stubs): Treat an input section
2819 without any mapping symbol as data only. Remove warning.
2820 (Arm_relobj::do_read_synbols): If an EXIDX input section has no
2821 link in its section header, try to discover the link by inspecting the
2822 REL31 relocation at the beginning of the section.
2823 (Target_arm::Scan::check_non_pic): Report name of offending relocation
2825 (Target_arm::Scan::global): Treat any reference to the symbol
2826 _GLOBAL_OFFSET_TABLE_ as a GOT access.
2828 2010-02-12 Sriraman Tallam <tmsriram@google.com>
2830 * arm.cc (Scan::local_reloc_may_be_function_pointer): New function.
2831 (Scan::global_reloc_may_be_function_pointer): New function.
2832 * sparc.cc (Scan::local_reloc_may_be_function_pointer): New function.
2833 (Scan::global_reloc_may_be_function_pointer): New function.
2834 * powerpc.cc (Scan::local_reloc_may_be_function_pointer): New function.
2835 (Scan::global_reloc_may_be_function_pointer): New function.
2836 * i386.cc (Scan::local_reloc_may_be_function_pointer): New function.
2837 (Scan::global_reloc_may_be_function_pointer): New function.
2838 * x86_64.cc (Scan::local_reloc_may_be_function_pointer): New function.
2839 (Scan::global_reloc_may_be_function_pointer): New function.
2840 (Scan::possible_function_pointer_reloc): New function.
2841 (Target_x86_64::can_check_for_function_pointers): New function.
2842 * gc.h (gc_process_relocs): Scan relocation types to determine if
2843 function pointers were taken for targets that support it.
2844 * icf.cc (Icf::find_identical_sections): Include functions for
2845 folding in safe ICF whose pointer is not taken.
2846 * icf.h (Secn_fptr_taken_set): New typedef.
2847 (fptr_section_id_): New member.
2848 (section_has_function_pointers): New function.
2849 (set_section_has_function_pointers): New function.
2850 (check_section_for_function_pointers): New function.
2851 * options.h: Fix comment for safe ICF option.
2852 * target.h (can_check_for_function_pointers): New function.
2853 * testsuite/Makefile.am: Add icf_safe_so_test test case.
2854 Modify icf_safe_test for X86-64.
2855 * testsuite/Makefile.in: Regenerate.
2856 * testsuite/icf_safe_so_test.cc: New file.
2857 * testsuite/icf_safe_so_test.sh: New file.
2858 * testsuite/icf_safe_test.cc (kept_func_3): New function.
2859 (main): Change to take pointer to function kept_func_3.
2860 * testsuite/icf_safe_test.sh (arch_specific_safe_fold): Check if safe
2861 folding is done correctly for X86-64.
2863 2010-02-12 David S. Miller <davem@davemloft.net>
2865 * output.h (Output_reloc<SHT_REL>::Output_reloc): Add
2866 is_symbolless parameter.
2867 (Output_reloc<SHT_REL>::is_symbolless): New.
2868 (Output_reloc<SHT_REL>::is_symbolless_): New.
2869 (Output_reloc<SHT_REL>::type_): Decrease to 29 bits.
2870 (Output_reloc<SHT_RELA>::Output_reloc): Add is_symbolless parameter.
2871 (Output_reloc<SHT_RELA>::is_symbolless): New.
2872 (Output_data_reloc::add_global): Handle is_symbolless.
2873 (Output_data_reloc::add_global_relative): Likewise.
2874 (Output_data_reloc::add_local): Likewise.
2875 (Output_data_reloc::add_local_relative): Likewise.
2876 (Output_data_reloc::add_symbolless_global_addend): New.
2877 (Output_data_reloc::add_symbolless_local_addend): New.
2878 * output.cc (Output_reloc<SHT_REL>::Output_reloc): Handle
2880 (Output_reloc::set_needs_dynsym_index): Test ->is_symbolless_
2881 instead of ->is_relative_
2882 (Output_reloc::write): Likewise.
2883 (Output_reloc::get_symbol_index): Return 0 when ->is_symbolless_
2884 (Output_reloc::write_rel): Simplify.
2886 * sparc.cc (Target_sparc::Scan::local): Use
2887 ->add_symbolless_local_addend as needed.
2888 (Target_sparc::Scan::global): Use ->add_symbolless_global_addend as
2889 needed. Also, emit appropriate unaligned vs. aligned dynamic reloc
2890 based upon relocation offset.
2892 2010-02-11 Doug Kwan <dougkwan@google.com>
2894 * arm.cc (Target_arm::Scan::local): Fix bugs in relocation handling.
2895 (Target_arm::Scan::global): Ditto. Also remove a comment before the
2896 beginning of function.
2897 (Target_arm::Relocate::relocate): Remove error messages for MOVW_ABS
2898 and MOVT_ABS relocations. Those are non issued in scanning. Fix
2899 parameter is_32bit in calls to should_apply_static_reloc.
2900 * testsuite/Makefile.am (check_SCRIPTS): Add arm_abs_global.sh.
2901 (check_DATA): Add arm_abs_global.stdout.
2902 (arm_abs_lib.o, libarm_abs.so, arm_abs_global.o, arm_abs_global,
2903 arm_abs_global.stdout): New rules.
2904 (MOSTLLYCLEANFILES): Add arm_abs_global
2905 * Makefile.in: Regenerate.
2906 * testsuite/arm_abs_global.s: New file.
2907 * testsuite/arm_abs_global.sh: Ditto.
2908 * testsuite/arm_abs_lib.s: Ditto.
2910 2010-02-11 Ian Lance Taylor <iant@google.com>
2912 * gold.cc (queue_middle_gc_tasks): Use a separate blocker for each
2914 (queue_middle_tasks): Likewise, and also for Scan_relocs. Run
2915 Allocate_commons_task first.
2916 * reloc.cc (Read_relocs::run): Pass next_blocker_ down to next
2917 task, rather than symtab_lock_.
2918 (Gc_process_relocs::~Gc_process_relocs): New function.
2919 (Gc_process_relocs::is_runnable): Check this_blocker_.
2920 (Gc_process_relocs::locks): Use next_blocker_ rather than
2922 (Scan_relocs::~Scan_relocs): New function.
2923 (Scan_relocs::is_runnable): Check this_blocker_ rather than
2925 (Scan_relocs::locks): Drop symtab_lock_ and blocker_. Add
2927 * reloc.h (class Read_relocs): Drop symtab_lock_ and blocker_
2928 fields. Add this_blocker_ and next_blocker_ fields. Adjust
2929 constructor accordingly.
2930 (class Gc_process_relocs): Likewise.
2931 (class Scan_relocs): Likewise.
2932 * common.h (class Allocate_commons_task): Remove symtab_lock_
2933 field, and corresponding constructor parameter.
2934 * common.cc (Allocate_commons_tasK::is_runnable): Remove use of
2936 (Allocate_commons_task::locks): Likewise.
2938 2010-02-11 Ian Lance Taylor <iant@google.com>
2940 * gold-threads.h (class Once): Define.
2941 (class Initialize_lock): Rewrite as child of Once.
2942 * gold-threads.cc (class Once_initialize): Define.
2943 (once_pointer_control): New static variable.
2944 (once_pointer, once_arg): New static variables.
2945 (c_run_once): New static function.
2946 (Once::Once, Once::run_once, Once::internal_run): New functions.
2947 (class Initialize_lock_once): Remove.
2948 (initialize_lock_control): Remove.
2949 (initialize_lock_pointer): Remove.
2950 (initialize_lock_once): Remove.
2951 (Initialize_lock::Initialize_lock): Move to gold-threads.h.
2952 (Initialize_lock::initialize): Rewrite.
2953 (Initialize_lock::do_run_once): New function.
2954 * archive.cc (Archive::interpret_header): Only clear name if it is
2956 * fileread.cc: Include "gold-threads.h"
2957 (file_counts_lock): New static variable.
2958 (file_counts_initialize_lock): Likewise.
2959 (File_read::release): Only increment counts when using --stats.
2960 Use a lock around the increment.
2961 * parameters.cc (class Set_parameters_target_once): Define.
2962 (set_parameters_target_once): New static variable.
2963 (Parameters::Parameters): Move here from parameters.h.
2964 (Parameters::set_target): Rewrite.
2965 (Parameters::set_target_once): New function.
2966 (Parameters::clear_target): Move here and rewrite.
2967 * parameters.h (class Parameters): Update declarations. Add
2968 set_parameters_target_once_ field.
2969 (Parameters::Parameters): Move to parameters.cc.
2970 (Parameters::clear_target): Likewise.
2971 * readsyms.cc (Read_symbols::do_group): Create a Start_group
2973 (Start_group::~Start_group): New function.
2974 (Start_group::is_runnable): New function.
2975 (Start_group::locks, Start_group::run): New functions.
2976 (Finish_group::run): Change saw_undefined to size_t.
2977 * readsyms.h (class Start_group): Define.
2978 (class Finish_group): Change saw_undefined_ field to size_t.
2979 (Finish_group::Finish_group): Remove saw_undefined and
2980 this_blocker parameters. Change all callers.
2981 (Finish_group::set_saw_undefined): New function.
2982 (Finish_group::set_blocker): New function.
2983 * symtab.h (class Symbol_table): Change saw_undefined to return
2984 size_t. Change saw_undefined_ field to size_t.
2985 * target-select.cc (Set_target_once::do_run_once): New function.
2986 (Target_selector::Target_selector): Initialize set_target_once_
2987 field. Don't initialize lock_ and initialize_lock_ fields.
2988 (Target_selector::instantiate_target): Rewrite.
2989 (Target_selector::set_target): New function.
2990 * target-select.h (class Set_target_once): Define.
2991 (class Target_selector): Update declarations. Make
2992 Set_target_once a friend. Remove lock_ and initialize_lock_
2993 fields. Add set_target_once_ field.
2995 2010-02-10 Ian Lance Taylor <iant@google.com>
2997 * dirsearch.cc (Dirsearch::initialize): Add all blockers before
2999 * gold.cc (queue_middle_gc_tasks): Likewise. Fix final blocker.
3000 (queue_middle_tasks): Add all blockers before queueing any tasks.
3001 (queue_final_tasks): Likewise.
3002 * token.h (Task_token::add_blockers): New function.
3003 * object.h (Input_objects::number_of_relobjs): New function.
3005 2010-02-10 Ian Lance Taylor <iant@google.com>
3007 * i386.cc (Relocate::relocate_tls): A local symbol is final if not
3008 shared, not if not position independent.
3009 * x86_64.cc (Relocate::relocate_tls): Likewise.
3010 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_pic_test.
3011 (tls_pie_pic_test): New target.
3012 * testsuite/Makefile.in: Rebuild.
3014 * testsuite/Makefile.am (check_PROGRAMS): Add tls_pie_test.
3015 (tls_test_main_pie.o, tls_test_pie.o): New targets.
3016 (tls_test_file2_pie.o, tls_test_c_pie.o, tls_pie_test): Likewise.
3017 * testsuite/Makefile.in: Rebuild.
3019 2010-02-09 David S. Miller <davem@davemloft.net>
3021 * sparc.cc (Target_sparc::Scan::local): Do not emit relocs other than
3022 R_SPARC_RELATIVE using ->add_local_relative().
3023 (Target_sparc::Scan::global): Likewise for ->add_global_relative().
3025 * output.h (Output_data_dynamic::add_section_size): New method
3026 that takes two Output_data objects.
3027 (Output_data_dynamic::Dynamic_entry): Create storage for secondary
3028 entry param. Handle it in initializers.
3029 * output.cc (Output_data_dynamic::Dynamic_entry::write): For
3030 DYNAMIC_SECTION_SIZE, add in second object size if non-NULL.
3031 * layout.h (Layout::add_target_dynamic_tags): Add dynrel_includes_plt
3033 * layout.cc (Layout::add_target_dynamic_tags): If dynrel_includes_plt,
3034 and .rela.plt exists, set DT_REL{,A}SZ to sum of .rela.dyn and .rela.plt
3035 * arm.cc (Target_arm::do_finalize_sections): Update to pass false
3036 for dynrel_includes_plt.
3037 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3038 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3039 * sparc.cc (Target_sparc::make_plt_entry): Force .rela.dyn to be output
3041 (Target_sparc::do_finalize_sections): Update to pass true for
3042 dynrel_includes_plt.
3043 * powerpc.cc (Target_powerpc::make_plt_entry): Force .rela.dyn to be
3044 output before .rela.plt
3045 (Target_powerpc::do_finalize_sections): Update to pass true for
3046 dynrel_includes_plt when 32-bit.
3048 2010-02-08 Doug Kwan <dougkwan@google.com>
3050 * arm.cc (Arm_relobj::simple_input_section_output_address): New
3052 (Arm_relobj::section_needs_cortex_a8_stub_scanning,
3053 Arm_relobj::scan_section_for_cortex_a8_stubs,
3054 Arm_relobj::do_relocation_section): Instead of calling
3055 Output_section::output_address, use faster
3056 Arm_relobj::simple_input_section_output_address.
3058 2010-02-08 David S. Miller <davem@davemloft.net>
3060 * sparc.cc (Target_sparc::Relocate::relocate): If relocation offset is
3061 unaligned for R_SPARC_16, R_SPARC_32, or R_SPARC_64, use the unaligned
3062 relocation helper function.
3064 * sparc.cc (Target_sparc::Scan::local): Handle R_SPARC_GOTDATA_OP*
3065 just like R_SPARC_GOT{10,13,22}.
3066 (Target_sparc::Scan::local): Likewise.
3067 (Target_sparc::Relocate:relocate): Likewise.
3069 2010-02-06 Ian Lance Taylor <iant@google.com>
3071 * configure.ac: Rewrite targetobjs duplicate removal code to use
3072 only shell constructs.
3073 * configure: Rebuild.
3075 2010-02-05 Doug Kwan <dougkwan@google.com>
3078 * arm.cc (Arm_relobj::section_is_scannable): New method.
3079 (Arm_relobj::section_needs_reloc_stub_scanning): Use it.
3080 (Arm_relobj::section_needs_cortex_a8_stub_scanning): Same.
3082 2010-02-04 Doug Kwan <dougkwan@google.com>
3085 * arm-reloc-property.cc (cstdio): Include.
3086 * configure.ac (targetobjs): Remove duplicates.
3087 * configure: Regenerate.
3088 * resolve.cc (Symbol_table::resolve): Explicit instantiate both
3089 big and little endian version for a given address size.
3091 2010-02-03 Doug Kwan <dougkwan@google.com>
3093 * arm-reloc-property.cc
3094 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3096 * arm-reloc-property.h
3097 (Arm_reloc_property_table::get_implemented_static_reloc_property):
3098 New method definition.
3099 (Arm_reloc_property_table::reloc_name_in_error_message): New method
3101 * arm-reloc.def (THM_MOVT_ABS, THM_MOVT_PREL, THM_MOVT_BREL): Change
3103 (GOT_PREL): Change implemented to Y.
3104 * arm.cc (Target_arm::reloc_uses_thumb_bit): Remove method.
3105 (Target_arm::Relocate::reloc_needs_sym_origin): Remove method.
3106 (Arm_relocate_functions::movw_abs_nc): Remove method.
3107 (Arm_relocate_functions::movt_abs): Ditto.
3108 (Arm_relocate_functions::thm_movw_abs_nc): Ditto.
3109 (Arm_relocate_functions::thm_movt_abs): Ditto.
3110 (Arm_relocate_functions::movw_rel_nc): Ditto.
3111 (Arm_relocate_functions::movw_rel): Ditto.
3112 (Arm_relocate_functions::movt_rel): Ditto.
3113 (Arm_relocate_functions:thm_movw_rel_nc): Ditto.
3114 (Arm_relocate_functions:thm_movw_rel): Ditto.
3115 (Arm_relocate_functions:thm_movt_rel): Ditto.
3116 (Arm_relocate_functions::movw, Arm_relocate_functions::movt,
3117 (Arm_relocate_functions::thm_movw, Arm_relocate_functions::thm_movt):
3118 New method definitions.
3119 (Arm_relocation_functions::arm_grp_alu): Add assertion for group index.
3120 (Arm_relocation_functions::arm_grp_ldr): Ditto.
3121 (Arm_relocation_functions::arm_grp_ldrs): Ditto.
3122 (Arm_relocation_functions::arm_grp_ldc): Ditto.
3123 (Target_arm::Relocate::relocate): Check for non-static or
3124 unimplemented relocation code and exit early. Change calls to
3125 Target_arm::reloc_uses_thumb_bit and
3126 Target_arm::Reloc::reloc_needs_sym_origin to use relocation property
3127 instead. Refactor code to handle similar relocations to increase
3128 code sharing. Remove check for unsupported relocation code in switch
3130 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Use
3131 relocation property table to find out size. Change error message to
3132 print out the name of a relocation code instead of the numeric value.
3133 (Target_arm::scan_reloc_for_stub): Use relocation property table
3134 instead of calling Target_arm::reloc_uses_thumb_bit().
3136 2010-02-02 Doug Kwan <dougkwan@google.com>
3138 * arm.cc (Target_arm::relocate_section): Do view adjustment for all
3139 types of relaxed input section.
3141 2010-02-02 Doug Kwan <dougkwan@google.com>
3143 * Makefile.am (HFILES): Add arm-reloc-property.h.
3145 (TARGETSOURCES): Add arm-reloc-property.cc
3146 (ALL_TARGETOBJS): Add arm-reloc-property.$(OBJEXT)
3147 (libgold_a_SOURCES): $(DEFFILES)
3148 * Makefile.in: Regenerate.
3149 * arm-reloc-property.cc: New file.
3150 * arm-reloc-property.h: New file.
3151 * arm-reloc.def: New file.
3152 * arm.cc: Update comments.
3153 (arm-reloc-property.h): New included header.
3154 (arm_reloc_property_table): New global variable.
3155 (Target_arm::do_select_as_default_target): New method definition.
3156 * configure.tgt (armeb*-*-*,armbe*-*-*,arm*-*-*): Add
3157 arm-reloc-property to targ_extra_obj.
3158 * parameters.cc (set_parameters_target): Call
3159 Target::select_as_default_target().
3160 * target.h (Target::select_as_default_target): New method definition.
3161 (Target::do_select_as_default_target): Same.
3163 2010-02-01 Doug Kwan <dougkwan@google.com>
3165 * arm.cc (Arm_exidx_fixup::Arm_exidx_fixup): Initialize
3166 first_output_text_section_.
3167 (Arm_exidx_fixup::first_output_text_section): New method definition.
3168 (Arm_exidx_fixup::first_output_text_section_): New data member.
3169 (Arm_exidx_fixup::process_exidx_section): Record the first text
3170 output section seen.
3171 (Arm_output_section::fix_exidx_coverage): Set correct linked section
3172 and entsize in output section header.
3174 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3176 * gold/arm.cc: Added support for the ARM relocations: R_ARM_THM_PC8,
3177 R_ARM_THM_PC12, R_ARM_THM_ALU_PREL_11_0.
3178 (Arm_relocate_functions::thm_alu11): New Method.
3179 (Arm_relocate_functions::thm_pc8): New Method.
3180 (Arm_relocate_functions::thm_pc12): New Method.
3181 (Target_arm::Scan::local): Handle the relocations.
3182 (Target_arm::Scan::global): Likewise.
3183 (Target_arm::Relocate::relocate): Likewise.
3184 (Target_arm:Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
3186 2010-01-29 Doug Kwan <dougkwan@google.com>
3188 * arm.cc (Target_arm::Scan::global): General PLTs for the same set
3189 of relocation types as ld.
3191 2010-01-29 Doug Kwan <dougkwan@google.com>
3193 * arm.cc (Arm_relocate_functions::arm_branch_common) Change visibility
3195 (Arm_relocate_functions::thumb_branch_common): Ditto.
3196 (Arm_relocate_functions::thm_call, Arm_relocate_functions::thm_jump24,
3197 Arm_relocate_functions::thm_xpc22, Arm_relocate_functions::plt32,
3198 Arm_relocate_functions::xpc25, Arm_relocate_functions::call,
3199 Arm_relocate_functions::jump24): Remove.
3200 (Target_arm::Relocate::relocate): Adjust code to call
3201 Arm_relocation_functions::arm_branch_common and
3202 Arm_relocation_functions::thumb_branch_common instead of their removed
3203 wrappers. Merge switch-cases together to reduce source code size.
3205 2010-01-29 Doug Kwan <dougkwan@google.com>
3207 * arm.cc (Arm_relobj::Arm_relobj): Initialize new data member
3208 output_local_symbol_count_needs_update_.
3209 (Arm_relobj::output_local_symbol_count_needs_update,
3210 Arm_relobj::set_output_local_symbol_count_needs_update,
3211 Arm_relobj::update_output_local_symbol_count): New methods.
3212 (Arm_relobj::output_local_symbol_count_needs_update_): New data
3214 (Arm_exidx_cantunwind::do_fixed_endian_write): Write address
3215 of pointed function as in a R_ARM_PREL31 relocation.
3216 (Arm_output_section<big_endian>::fix_exidx_coverage): Mark objects
3217 for output local symbol count updating.
3218 (Target_arm::do_relax): Update output local symbol counts in objects
3220 * object.h (Sized_relobj::set_output_local_symbol_count): New method.
3222 2010-01-29 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3224 * arm.cc: Added support for the ARM relocations:
3225 R_ARM_MOVW_BREL_NC, R_ARM_MOVT_BREL, R_ARM_MOVW_BREL,
3226 R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVT_BREL, R_ARM_THM_MOVW_BREL.
3227 (Arm_relocate_functions::movw_rel_nc): Renamed (was
3229 (Arm_relocate_functions::movw_rel): New method.
3230 (Arm_relocate_functions::movt_rel): Renamed (was movt_prel).
3231 (Arm_relocate_functions::thm_movw_rel_nc): Renamed (was
3233 (Arm_relocate_functions::thm_movw_rel): New method.
3234 (Arm_relocate_functions::thm_movt_rel): Renamed (was
3236 (Target_arm::Scan::local): Handle MOVW_BREL/MOVT_BREL
3238 (Target_arm::Scan::global): Likewise.
3239 (Target_arm::Relocate::relocate): Likewise.
3240 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3243 2010-01-27 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3245 * arm.cc: Added support for ARM group relocations.
3246 (Target_arm::reloc_needs_sym_origin): New method.
3247 (Arm_relocate_functions::calc_grp_kn): New method.
3248 (Arm_relocate_functions::calc_grp_residual): New method.
3249 (Arm_relocate_functions::calc_grp_gn): New method.
3250 (Arm_relocate_functions::arm_grp_alu): New Method.
3251 (Arm_relocate_functions::arm_grp_ldr): New Method.
3252 (Arm_relocate_functions::arm_grp_ldrs): New Method.
3253 (Arm_relocate_functions::arm_grp_ldc): New Method.
3254 (Target_arm::Scan::local): Handle the ARM group relocations.
3255 (Target_arm::Scan::global): Likewise.
3256 (Target_arm::Relocate::relocate): Likewise.
3257 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3260 2010-01-26 Doug Kwan <dougkwan@google.com>
3262 * arm.cc (set): Include.
3263 (class Arm_exidx_fixup): Change type of last_input_section_ to const
3265 (Arm_output_section::Text_section_list): New type.
3266 (Arm_output_section::append_text_sections_to_list): New method.
3267 (Arm_output_section::fix_exidx_coverage): Ditto.
3268 (Arm_relobj::Arm_relobj): Initialize exidx_section_map_.
3269 (Arm_relobj::convert_input_section_to_relaxed_section): Use
3270 Relobj::set_section_offset() instead of
3271 Sized_relobj::invalidate_section_offset().
3272 (Arm_relobj::section_needs_reloc_stub_scanning): Add an extra
3273 parameter for section headers. Ignore relocation sections for
3274 unallocated sections and EXIDX sections.
3275 (Target_arm::fix_exidx_coverage): New method.
3276 (Target_arm::output_section_address_less_than): New type.
3277 (Arm_exidx_fixup::add_exidx_cantunwind_as_needed): Use index of the
3278 linked text section instead of the EXIDX section.
3279 (Arm_output_section::create_stub_group): Add an assertion to check
3280 that this is not an EXIDX output section.
3281 (Arm_output_section::append_text_sections_to_list): New method.
3282 (Arm_output_section::fix_exidx_coverage): Ditto.
3283 (Arm_relobj::scan_sections_for_stubs): Adjust call to
3284 Arm_relobj::section_needs_reloc_stub_scanning.
3285 (Target_arm::do_relax): Fix EXIDX output section coverage in the
3287 (Target_arm::fix_exidx_coverage): New method.
3288 * object.h (Relobj::set_output_section): New method.
3289 (Sized_relobj::invalidate_section_offset): Remove method.
3290 (Sized_relobj::do_invalidate_section_offset): Remove method.
3291 (Sized_relobj::do_set_section_offset): Handle offset value -1.
3293 2010-01-25 Doug Kwan <dougkwan@google.com>
3295 * arm.cc (Arm_exidx_merged_section::do_output_offset):
3296 Fix warning due to signed and unsigned comparison on a 32-bit host.
3298 2010-01-22 Doug Kwan <dougkwan@google.com>
3300 * arm.cc (Target_arm::do_relax): Record an output section for section
3301 offset adjustment it contains any stub table that has changed.
3302 * layout.cc (Layout::clean_up_after_relaxation): Adjust section
3303 offsets in an output section if necessary.
3304 * output.cc (Output_section::Output_section): Initialize
3305 section_offsets_need_adjustments_.
3306 (Output_section::add_input_section_for_script): Renamed to
3307 Output_section::add_simple_input_section.
3308 (Output_section::save_states): Add a comment.
3309 (Output_section::discard_states): New method defintion.
3310 (Output_section::adjust_section_offsets): Same.
3311 * output.h (Output_section::add_input_section_for_script): Renamed to
3312 Output_section::add_simple_input_section.
3313 (Output_section::discard_states): New method declaration.
3314 (Output_section::adjust_section_offsets): Same.
3315 (Output_section::section_offsets_need_adjustment,
3316 Output_section::set_section_offsets_need_adjustment): New method
3318 (Output_section::section_offsets_need_adjustment_): New data member.
3319 * script-sections.cc
3320 (Output_section_element_input::set_section_address): Adjust code for
3321 renaming of Output_section::add_input_section_for_script.
3322 (Orphan_output_section::set_section_address): Same.
3324 2010-01-22 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3326 * gold/arm.cc (Target_arm): Updated fix_v4bx method and usage of
3327 Fix_v4bx enum values .
3328 * gold/options.h (General_options): New option definitions.
3329 (General_options::fix_v4bx): New method.
3330 (General_options::Fix_v4bx): New enum.
3331 * gold/options.cc (General_options::parse_fix_v4bx): New method.
3332 (General_options::parse_fix_v4bx_interworking): New method.
3334 2010-01-22 Doug Kwan <dougkwan@google.com>
3336 * arm.cc (Arm_exidx_fixup): New class.
3338 2010-01-21 Doug Kwan <dougkwan@google.com>
3340 * arm.cc (Arm_exidx_cantunwind, Arm_exidx_merged_section): New
3342 (Arm_exidx_section_offset_map): New type.
3344 2010-01-21 Doug Kwan <dougkwan@google.com>
3346 * arm.cc (Arm_exidx_input_section): New class.
3347 (Arm_relobj::exidx_input_section_by_link,
3348 Arm_relobj::exidx_input_section_by_shndx,
3349 Arm_relobj::make_exidx_input_section): New methods.
3350 (read_arm_attributes_section): Remove.
3351 (Arm_relobj::do_read_symbols): Look for ARM.exidx sections and record
3352 information about them.
3353 (Arm_dynobj::do_read_symbols): Move code in read_arm_attributes_section
3356 2010-01-20 Doug Kwan <dougkwan@google.com>
3358 * arm.cc (Target_arm::Arm_input_section_map): Change key type from
3359 Input_section_specifier to Section_id.
3360 (Target_arm::new_arm_input_section: Adjust code for change of key
3362 (Target_arm::find_arm_input_section): Ditto.
3363 * gc.h (object.h): Include for Section_id nand Section_id_hash.
3364 (Section_id): Remove.
3365 (Garbage_collection::Section_id_hash): Remove.
3366 * icf.h (object.h): Include for Section_id nand Section_id_hash.
3367 (Section_id): Remove.
3368 (Icf::Section_id_hash): Remove.
3369 * object.h (Section_id, Const_section_id, Section_id_hash,
3370 Const_section_id_hash): New type definitions.
3371 * output.cc (Output_section::add_relaxed_input_section): Change to
3372 use Const_section_id instead of Input_section_specifier as key type.
3373 (Output_section::add_merge_input_section): Ditto.
3374 (Output_section::build_relaxation_map): Change to use Section_id
3375 instead of Input_section_specifier as key type.
3376 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
3378 (Output_section::convert_input_sections_to_relaxed_sections): Change
3379 to use Const_section_id instead of Input_section_specifier as key type.
3380 (Output_section::find_merge_section): Ditto.
3381 (Output_section::find_relaxed_input_section): Ditto.
3382 * output.h (Input_section_specifier): Remove class.
3383 (Output_section::Output_section_data_by_input_section_map): Change
3384 key type to Const_section_id.
3385 (Output_section::Output_relaxed_input_section_by_input_section_map):
3387 (Output_section::Relaxation_map): Change key type to Section_id.
3389 2010-01-20 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3391 * gold/arm.cc: Added support for R_ARM_V4BX relocation
3392 (class Arm_v4bx_stub): New class.
3393 (DEF_STUBS): Updated definition to support v4_veneer_bx.
3394 (Stub_factory::make_arm_v4bx_stub): New method.
3395 (Stub_factory::elf32_arm_stub_v4_veneer_bx): New veneer template.
3396 (Stub_table::empty): Handle v4bx stubs.
3397 (Stub_table::add_arm_v4bx_stub): New method.
3398 (Stub_table::find_arm_v4bx_stub): New method.
3399 (Arm_relocate_functions::v4bx): New method.
3400 (Target_arm::fix_v4bx): New method.
3401 (Target_arm::Target_arm): Handle R_ARM_V4BX.
3402 (Stub_table::relocate_stubs): Likewise.
3403 (Stub_table::do_write): Likewise.
3404 (Stub_table::update_data_size_and_addralign): Likewise.
3405 (Stub_table::finalize_stubs): Likewise.
3406 (Target_arm::Scan::local): Likewise.
3407 (Target_arm::Scan::global): Likewise.
3408 (Target_arm::do_finalize_sections): Likewise.
3409 (Target_arm::Relocate::relocate): Likewise.
3410 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3412 (Target_arm::scan_reloc_for_stub): Likewise.
3413 (Target_arm::scan_reloc_section_for_stubs): Likewise.
3415 2010-01-19 Ian Lance Taylor <iant@google.com>
3417 * output.cc (Output_section_headers::do_sized_write): Write large
3418 segment count to sh_info field.
3419 (Output_file_header::do_sized_write): For large segment count,
3420 write PN_XNUM to e_phnum field.
3422 2010-01-15 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3424 * arm.cc (Arm_relocate_functions::thm_jump6): New function.
3425 (Arm_relocate_functions::thm_jump8): New function.
3426 (Arm_relocate_functions::thm_jump11): New function.
3427 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP6, R_ARM_THM_JUMP8,
3429 (Target_arm::Scan::global): Likewise.
3430 (Target_arm::Relocate::relocate): Likewise.
3431 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
3434 2010-01-14 Doug Kwan <dougkwan@google.com>
3436 * arm.cc (map, utility): Include headers.
3437 (Target_arm::apply_cortex_a8_workaround): New method.
3438 (Arm_relobj::do_relocate_sections): Apply any Cortex-A8 workaround.
3439 (Target_arm::Scan::local): Handle R_ARM_THM_JUMP24, R_ARM_THM_JUMP19.
3440 (Target_arm::Scan::global): R_ARM_THM_JUMP19.
3441 (Target_arm::do_finalize_sections): Set fix_cortex_a8_ according to
3442 the --[no-]fix-cortex-a8 command line options.
3443 (Target_arm::Relocate::relocate): Handle R_ARM_JUMP19.
3444 (Target_arm::relocate_stub): Use addend in instruction template.
3445 * options.h (DEFINE_bool): Set the user-set flag.
3446 (General_options): Add --[no-]-fix-cortex options.
3447 * output.cc (Output_section::convert_input_sections_to_relaxed_sections)
3448 : Update fast look-up map after conversion.
3450 2010-01-14 Sriraman Tallam <tmsriram@google.com>
3452 * object.cc (Sized_relobj::do_layout): Change to call layout_gnu_stack
3453 in the first pass of do_layout.
3455 2010-01-13 Doug Kwan <dougkwan@google.com>
3457 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
3458 Arm_relobj::scan_sections_for_stubs): Rearrange code to avoid an
3459 apparent compiler problem of not folding static constant integral
3460 data members of elfcpp::Elf_sizes<32>.
3462 2010-01-13 Doug Kwan <dougkwan@google.com>
3464 * arm.cc (Arm_relobj::section_needs_reloc_stub_scanning,
3465 Arm_relobj::section_needs_cortex_a8_stub_scanning,
3466 Arm_relobj::scan_section_for_cortex_a8_erratum,
3467 Arm_relobj::scan_span_for_cortex_a8_erratum): New methods.
3468 (Arm_relobj::scan_sections_for_stubs): Move code deciding what
3469 sections to scan for relocation stubs into a new method
3470 Arm_relobj::section_needs_reloc_stub_scanning. Handle both
3471 relocation and Cortex-A8 stub scanning.
3472 (Target_arm::do_relax): Force stubs to be after stubbed sections
3473 if fixing the Cortex-A8 erratum. Remove all Cortex-A8 stubs at
3474 the beginning of a new relaxation pass. Update a comment.
3475 (Target_arm::scan_span_for_cortex_a8_erratum): New method definition.
3477 2010-01-12 Ian Lance Taylor <iant@google.com>
3479 * target-reloc.h (visibility_error): New inline function.
3480 (relocate_section): Call visibility_error.
3481 * testsuite/Makefile.am (check_DATA): Add protected_3.err.
3482 (MOSTLYCLEANFILES): Likewise.
3483 (protected_4_pic.o, protected_3.err): New targets.
3484 * testsuite/protected_4.cc: New file.
3486 2010-01-12 Doug Kwan <dougkwan@google.com>
3488 * arm.cc (Cortex_a8_reloc): New class.
3489 (Target_arm::Target_arm): Initialize new data members fix_cortex_a8_
3490 and cortex_a8_relocs_info_.
3491 (Target_arm::fix_cortex_a8): New method definition.
3492 (Target_arm::Cortex_a8_relocs_info): New type.
3493 (Target_arm::fix_cortex_a8_, Target_arm::cortex_a8_relocs_info_):
3494 New data member declarations.
3495 (Target_arm::scan_reloc_for_stub): Record information about
3496 relocations for THUMB branches that might be exempted from the
3497 Cortex-A8 workaround.
3498 (Target_arm::do_relax): Clear all Cortex-A8 relocation information
3499 at the beginning of a relaxation pass.
3501 2010-01-12 Doug Kwan <dougkwan@google.com>
3503 * arm.cc (Arm_relobj::mapping_symbols_info_): New data member.
3504 (Arm_relobj::Mapping_symbol_position,
3505 Arm_reloj::Mapping_symbol_position_less,
3506 Arm_relobj::Mapping_symbols_info): New types.
3507 (Target_arm::is_mapping_symbol_name): New method definition.
3508 (Arm_relobj::do_count_local_symbols): Save information about mapping
3511 2010-01-11 Doug Kwan <dougkwan@google.com>
3513 * arm.cc (Arm_relocate_functions::thumb32_branch_offset,
3514 Arm_relocate_functions::thumb32_branch_upper,
3515 Arm_relocate_functions::thumb32_branch_lower,
3516 Arm_relocate_functions::thumb32_cond_branch_offset,
3517 Arm_relocate_functions::thumb32_cond_branch_upper,
3518 Arm_relocate_functions::thumb32_cond_branch_lower,
3519 Arm_relocate_functions::thm_jump19): New methods to handle THUMB
3520 branch offset encoding.
3521 (Arm_relocate_functions::thumb_branch_common): Use new branch
3522 offset encoding methods to avoid code duplication.
3523 (Stub_template::Stub_template) Handle THUMB16_SPECIAL_TYPE.
3524 (Stub_addend_reader::operator()): Use new branch encoding method
3525 to avoid code duplication.
3527 2010-01-11 Doug Kwan <dougkwan@google.com>
3529 * arm.cc (Arm_relobj::do_gc_process_relocs): New method.
3530 (Target_arm::do_finalize_sections): Define special EXIDX section
3531 symbols only if referenced.
3532 * gc.h (Garbage_collection::add_reference): New method.
3533 (gc_process_relocs): Use Garbage_collection::add_reference to avoid
3536 2010-01-11 Ian Lance Taylor <iant@google.com>
3538 * script.cc (Version_script_info::build_expression_list_lookup):
3539 Change complaing about duplicate wildcard match from error to
3542 * script.cc (class Lazy_demangler): Recreate--revert part of patch
3544 (Version_script_info::Version_script_info): Initialize globs_,
3545 default_version_, default_is_global_, and exact_. Don't
3546 initialize globals_ or locals_.
3547 (Version_script_info::build_lookup_tables): Build local symbols
3549 (Version_script_info::unquote): New function.
3550 (Version_script_info::add_exact_match): New function.
3551 (Version_script_info::build_expression_list_lookup): Remove lookup
3552 parameter. Add is_global parameter. Change all callers. Handle
3553 wildcard pattern specially. Unquote pattern. Call
3555 (Version_script_info::get_name_to_match): New function.
3556 (Version_script_info::get_symbol_version): New function.
3557 (Version_script_info::get_symbol_version_helper): Remove.
3558 (Version_script_info::check_unmatched_names): Call unquote.
3559 * script.h (class Version_script_info): Change get_symbol_version
3560 to be non-inline and add is_global parameter; change all callers.
3561 Rewrite symbol_is_local. Update declarations. Define struct
3562 Version_tree_match, Exact, Globs. Don't define struct Lookup.
3563 Remove globals_ and locals_ members. Add exact_, globs_,
3564 default_version_, is_global_.
3565 (Version_script_info::Glob): Remove pattern, add expression and
3566 is_global. Update constructor. Change all callers.
3567 * dynobj.cc (Versions::finalize): Mark the version symbol as the
3569 (Versions::symbol_section_contents): If a symbol is undefined, or
3570 defined in a dynamic object, set the version index to
3572 * symtab.cc (Symbol_table::add_from_relobj): Don't call
3574 (Symbol_table::add_from_pluginobj): Likewise.
3575 * testsuite/ver_matching_test.sh: blaza1 and blaza go into V2.
3577 2010-01-11 Doug Kwan <dougkwan@google.com>
3579 * Makefile.am (incremental_dump_DEPENDENCIES): Add libintl dependency.
3580 (incremental_dump_LDADD): Add linking option for libintl.
3581 * Makefile.in: Regenerate.
3583 2010-01-11 H.J. Lu <hongjiu.lu@intel.com>
3586 * testsuite/Makefile.am (dynamic_list.stdout): Use --dyn-syms
3588 * testsuite/Makefile.in: Regenerated.
3590 2010-01-10 Doug Kwan <dougkwan@google.com>
3592 * options.h (DEFINE_var): Use parentheses around argument varname__
3593 in macro body to avoid any unintended subsequent substitutions.
3595 2010-01-10 Ian Lance Taylor <iant@google.com>
3597 * resolve.cc (Symbol_table::resolve): Add symbols to list of ODR
3598 candidates before doing symbol resolution.
3600 * resolve.cc (Symbol_table::resolve): Add symbols to the list of
3601 ODR candidates if only one is weak.
3603 2010-01-08 Ian Lance Taylor <iant@google.com>
3605 * script.cc (Version_script_info::build_expression_list_lookup):
3606 Don't warn about ambiguous version, just record the ambiguity.
3607 (Version_script_info::get_symbol_version_helper): Give error if
3608 version is ambiguous.
3610 2010-01-08 Doug Kwan <dougkwan@google.com>
3612 * arm.cc (Stub_table::Stub_table): Initalize cortex_a8_stubs_,
3613 prev_data_size_ and prev_addralign_. Remove initializer for
3614 deleted data member has_been_changed_.
3615 (Stub_table::empty): Look at both reloc_stubs_ and cortex_a8_stubs_
3616 to determine if the table is empty.
3617 (Stub_table::has_been_changed, Stub_table_set_has_been_changed):
3619 (Stub_table::add_reloc_stub): Define method in class definition
3620 instead of just declaring it there.
3621 (Stub_table::add_cortex_a8_stub): New method definition.
3622 (Stub_table::update_data_size_and_addralign): Ditto.
3623 (Stub_table::finalize_stubs): Ditto.
3624 (Stub_table::apply_cortex_a8_workaround_to_address_range): Ditto.
3625 (Stub_table::do_addralign_): Return address alignment in the
3626 (Stub_table::do_reset_address_and_file_offset): Define method in
3627 class definition instead of declaring it there. Set current data
3628 size to be the data size of the previous pass.
3629 (Stub_table::set_final_data_size): Use current data size as the
3631 (Stub_table::relocate_stub): Change parameter type of stub from
3632 Reloc_stub pointer to Stub pointer.
3633 (Stub_table::addralign_, Stub_table::has_been_changed_): Remove.
3634 (Stub_table::Cortex_a8_stub_list): New typedef.
3635 (Stub_table::cortex_a8_stubs_, Stub_table::prev_data_size_,
3636 Stub_table::prev_addralign_): New data member.
3637 (Arm_relobj::Arm_relobj): Initialize data member
3638 section_has_cortex_a8_workaround_.
3639 (Arm_relobj::section_has_cortex_a8_workaround,
3640 Arm_relobj::mark_section_for_cortex_a8_workaround): New method
3642 (Arm_relobj::section_has_cortex_a8_workaround_): New data member
3644 (Target_arm::relocate_stub): Change parameter type of stub from
3645 Reloc_stub pointer to Stub pointer.
3646 (Insn_template::size, Insn_template::alignment): Handle
3647 THUMB16_SPECIAL_TYPE.
3648 (Stub_table::remove_all_cortex_a8_stubs, Stub_table::finalize_stubs,
3649 Stub_table::update_data_size_and_addralign,
3650 Stub_table::apply_cortex_a8_workaround_to_address_range): New method
3652 (Stub_table::relocate_stubs): Handle Cortex-A8 stubs.
3653 (Stub_table::do_write): Ditto.
3654 (Target_arm::do_relax): Adjust code for changes in Stub_table.
3656 2010-01-08 Ian Lance Taylor <iant@google.com>
3659 * symtab.h (class Symbol): Remove fields is_target_special_ and
3660 has_plt_offset_. Add field is_defined_in_discarded_section_.
3661 (Symbol::is_defined_in_discarded_section): New function.
3662 (Symbol::set_is_defined_in_discarded_section): New function.
3663 (Symbol::has_plt_offset): Rewrite.
3664 (Symbol::set_plt_offset): Verify that new offset is not -1U.
3665 * symtab.cc (Symbol::init_fields): Initialize plt_offset_ to -1U.
3666 Don't initialize is_target_special_ or has_plt_offset_.
3667 Initialize is_defined_in_discarded_section_.
3668 (Symbol_table::add_from_relobj): If appropriate, set
3669 is_defined_in_discarded_section.
3670 * resolve.cc (Symbol::override_base_with_special): Don't test
3671 is_target_special_. Change has_plt_offset_ to has_plt_offset().
3672 * target-reloc.h (relocate_section): Do special handling for
3673 symbols defined in discarded sections for global symbols as well
3676 2010-01-08 Ian Lance Taylor <iant@google.com>
3678 * dynobj.cc (big_endian>::find_dynsym_sections): Set pi to NULL in
3679 the SHT_SYMTAB case.
3681 2010-01-08 Ian Lance Taylor <iant@google.com>
3683 * object.cc (Sized_relobj::do_layout): Don't get confused if
3684 layout_eh_frame returns NULL.
3686 2010-01-08 Ian Lance Taylor <iant@google.com>
3689 * dynobj.cc (Sized_dynobj::find_dynsym_sections): If there is no
3690 dynamic symbol table, use the normal symbol table.
3691 (Sized_dynobj::do_read_symbols): Remove assertion about type of
3694 2010-01-08 Ian Lance Taylor <iant@google.com>
3697 * layout.cc (Layout::include_section): Remove .gnu_debuglink
3700 2010-01-08 H.J. Lu <hongjiu.lu@intel.com>
3702 * version.cc (print_version): Change to "Copyright 2010".
3704 2010-01-08 Ian Lance Taylor <iant@google.com>
3708 * i386.cc (class Target_i386): Change return type of plt_section
3710 (class Output_data_plt_i386): Add tls_desc_rel_ field.
3711 (Output_data_plt_i386::Output_data_plt_i386): Initialize
3712 tls_desc_rel_ field.
3713 (Output_data_plt_i386::rel_tls_desc): New function.
3714 (Target_i386::rel_tls_desc_section): New function.
3715 (Target_i386::Scan::local): Rewrite R_386_TLS_GOTDESC handling.
3716 (Target_i386::Scan::global): For R_386_TLS_GOTDESC put
3717 R_386_TLS_DESC reloc in rel_tls_desc_section.
3718 * x86_64.cc (class Target_x86_64): Add tlsdesc_reloc_info_ field.
3719 Define struct Tlsdesc_info.
3720 (Target_x86_64::Target_x86_64): Initialize tlsdesc_reloc_info_.
3721 (Target_x86_64::do_reloc_symbol_index): New function.
3722 (Target_x86_64::add_tlsdesc_info): New function.
3723 (class Output_data_plt_x86_64): Add tlsdesc_rel_ field.
3724 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize
3726 (Output_data_plt_x86_64::rela_plt): Rename from rel_plt. Change
3728 (Output_data_plt_x86_64::rela_tlsdesc): New function.
3729 (Target_x86_64::rela_tlsdesc_section): New function.
3730 (Target_x86_64::Scan::local): Rewrite R_X86_64_GOTPC32_TLSDESC
3732 (Target_x86_64::Scan::global): For R_X86_64_GOTPC32_TLSDESC put
3733 (Target_x86_64::do_reloc_addend): New function.
3734 R_X86_64_TLSDESC reloc in rela_tlsdesc_section.
3735 * output.h (class Output_reloc) [SHT_REL]: Add new constructor
3736 declarations. Define TARGET_CODE. Add arg field to u1_ union.
3737 (Output_reloc::type): New function.
3738 (Output_reloc::is_local_section_symbol): Check for TARGET_CODE.
3739 (Output_reloc::is_target_specific): New function.
3740 (Output_reloc::target_arg): New function.
3741 (class Output_reloc) [SHT_RELA]: Add four new constructors for
3742 absolute relocs and target specific relocs.
3743 (class Output_data_reloc) [SHT_REL]: Add add_absolute and
3744 add_target_specific.
3745 (class Output_data_reloc) [SHT_RELA]: Likewise.
3746 * output.cc (Output_reloc::Output_reloc): Add four new versions
3747 for absolute relocs and target specific relocs.
3748 (Output_reloc::set_needs_dynsym_index): Add TARGET_CODE case.
3749 (Output_reloc::get_symbol_index): Likewise.
3750 (Output_reloc::local_section_offset): Check that local_sym_index_
3751 is not TARGET_CODE or 0.
3752 (Output_reloc::symbol_value): Likewise.
3753 (Output_reloc::write) [SHT_RELA]: Call target for target specific
3755 * target.h (class Target): Add reloc_symbol_index and reloc_addend
3756 functions. Add do_reloc_symbol_index and do_reloc_addend virtual
3758 * layout.cc (add_target_dynamic_tags): Use output section for
3759 DT_PLTRELSZ and DT_JMPREL.
3761 2010-01-07 Ian Lance Taylor <iant@google.com>
3764 * output.h (class Output_reloc) [SHT_RELA]: Add is_relative
3766 (class Output_data_reloc_generic): Define.
3767 (class Output_data_reloc_base): Change base class to
3768 Output_data_reloc_generic. Change add() method to call
3769 bump_relative_reloc_count for a relative reloc. Remove
3771 * output.cc (Output_data_reloc_base::do_write): Change sort_reloc_
3773 * layout.cc (Layout::add_target_dynamic_tags): Change dyn_rel to
3774 Output_data_reloc_generic*. Add DT_RELCOUNT/DT_RELACOUNT tag if
3776 * layout.h (class Layout): Update declaration.
3778 2010-01-07 Ian Lance Taylor <iant@google.com>
3780 * output.h (class Output_data): Add const version of
3781 output_section and do_output_section.
3782 (class Output_section_data): Add const version of
3784 (class Output_section): Likewise.
3785 * layout.cc (Layout::add_target_dynamic_tags): New function.
3786 * layout.h (class Layout): Update declarations.
3787 * arm.cc (Target_arm::do_finalize_sections): Use
3788 add_target_dynamic_tags.
3789 * i386.cc (Target_i386::do_finalize_sections): Likewise.
3790 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
3791 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
3792 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
3794 2010-01-07 Ian Lance Taylor <iant@google.com>
3797 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Mark the dynamic
3800 2010-01-07 Dmitry Gorbachev <d.g.gorbachev@gmail.com>
3801 Ian Lance Taylor <iant@google.com>
3804 * object.cc: Instantiate Xindex::initialize_symtab_xindex and
3805 Xindex::read_symtab_xindex.
3807 2010-01-07 Doug Kwan <dougkwan@google.com>
3809 * arm.cc (Insn_template::Type): New enum value THUMB16_SPECIAL_TYPE.
3810 (Insn_template::thumb16_bcond_insn): New method declaration.
3811 (Insn_template): Fix spelling.
3812 (Stub::thumb16_special): New method declaration.
3813 (Stub::do_write): Define virtual method which was previously pure
3815 (Stub::do_thumb16_special): New method declaration.
3816 (Stub::do_fixed_endian_write): New template member.
3817 (Reloc_stub::do_write): Remove.
3818 (Reloc_stub::do_fixed_endian_write): Remove.
3819 (Cortex_a8_stub): New class definition.
3820 (Stub_factory::make_cortex_a8_stub): New method definition.
3821 (Stub_factory::Stub_factory): Add missing static storage class
3822 qualifier for elf32_arm_stub_a8_veneer_blx.
3824 2010-01-07 Ian Lance Taylor <iant@google.com>
3827 * options.h (class General_options): Add --warn-unresolved-symbols
3828 and --error-unresolved-symbols.
3829 * errors.cc (Errors::undefined_symbol): Implement
3830 --warn-unresolved-symbols.
3832 * options.h (class General_options): Add -z text and -z textoff.
3833 * layout.cc (Layout::finish_dynamic_section): Implement -z text.
3835 2010-01-06 Sriraman Tallam <tmsriram@google.com>
3837 * gc.h (Garbage_collection::Cident_section_map): New typedef.
3838 (Garbage_collection::cident_sections): New function.
3839 (Garbage_collection::add_cident_section): New function.
3840 (Garbage_collection::cident_sections_): New member.
3841 (gc_process_relocs): Add references to sections whose names are C
3843 * gold.h (cident_section_start_prefix): New constant.
3844 (cident_section_stop_prefix): New constant.
3845 (is_cident): New function.
3846 * layout.cc (Layout::define_section_symbols): Replace string constants
3847 with the newly defined constants.
3848 * object.cc (Sized_relobj::do_layout): Track sections whose names are
3850 * testsuite/Makefile.am: Add gc_orphan_section_test.
3851 * testsuite/Makefile.in: Regenerate.
3852 * testsuite/gc_orphan_section_test.cc: New file.
3853 * testsuite/gc_orphan_section_test.sh: New file.
3855 2010-01-06 Ian Lance Taylor <iant@google.com>
3858 * options.h (class General_options): Add --warn-shared-textrel.
3859 * layout.cc (Layout::finish_dynamic_section): Implement
3860 --warn-shared-textrel.
3863 * options.h (class General_options): Add --warn-multiple-gp.
3865 2010-01-06 Viktor Kutuzov <vkutuzov@accesssoftek.com>
3867 * Makefile.am (incremental_dump_DEPENDENCIES): Remove
3868 $(THREADSLIB) and $(LIBDL).
3869 * Makefile.in: Rebuild.
3871 2010-01-06 Ian Lance Taylor <iant@google.com>
3874 * options.cc (General_options::parse_section_start): New function.
3875 (General_options::section_start): New function.
3876 (General_options::General_options): Initialize all members.
3877 * options.h: Include <map>
3878 (class General_options): Add --section-start. Add section_starts_
3880 * layout.cc (Layout::attach_allocated_section_to_segment): If
3881 --section-start was used, set the address of the segment. Remove
3882 local sort_sections.
3883 (Layout::relaxation_loop_body): If the address of the load segment
3884 has been set by --section-start, don't use it.
3885 * output.h (Output_segment::update_flags_for_output_section): New
3887 * output.cc (Output_segment::add_output_section): Call
3888 update_flags_for_output_section.
3890 2010-01-05 Ian Lance Taylor <iant@google.com>
3893 * options.h (class General_options): Add --undefined-version.
3894 * script.cc (struct Version_expression): Add was_matched_by_symbol
3896 (Version_script_info::matched_symbol): New function.
3897 (Version_script_info::get_symbol_version_helper): Call
3899 (Version_script_info::check_unmatched_names): New function.
3900 * script.h (class Version_script_info): Update declarations.
3901 * gold.cc (queue_middle_tasks): Handle --no-undefined-version.
3903 * options.h (class General_options): Use DEFINE_bool_alias for
3904 allow_multiple_definition.
3905 * resolve.cc (Symbol_table::should_override): Don't test
3906 allow_multiple_definition.
3909 * options.h (class General_options): Add --cref.
3910 * main.cc (main): Print cref table if --cref. Don't close mapfile
3911 until after printing cref table.
3912 * cref.cc: Include "symtab.h".
3913 (class Cref_inputs): Define Cref_table_compare and Cref_table.
3914 (Cref_table_compare::operator()): New function.
3915 (Cref_inputs::gather_cref): New function.
3916 (filecol): New static const.
3917 (Cref_inputs::print_cref): New function.
3918 (Cref::print_cref): New function.
3919 * cref.h: Include <cstdio>.
3920 (class Cref): Update declarations.
3921 * mapfile.h (Mapfile::file): New function.
3922 * object.h (class Object): Define Symbols. Declare virtual
3923 do_get_global_symbols.
3924 (Object::get_global_symbols): New function.
3925 * object.cc (Input_objects::add_object): Pass object to cref_ if
3927 (Input_objects::archive_start): Likewise.
3928 (Input_objects::archive_stop): Likewise.
3929 (Input_objects::print_cref): New function.
3930 * dynobj.h (Sized_dynobj::do_get_global_symbols): New function.
3931 * dynobj.cc (big_endian>::do_add_symbols): Create symbols_ if
3933 * plugin.cc (Sized_pluginobj::do_get_global_symbols): New
3935 * plugin.h (class Sized_pluginobj): Update declarations.
3937 2010-01-05 Ian Lance Taylor <iant@google.com>
3939 * symtab.cc (Symbol_table::add_from_object): Rename def parameter
3940 to is_default_version. Rename insdef to insdefault.
3941 (Symbol_table::add_from_relobj): Rename def to is_default_version
3942 and local to is_forced_local.
3943 (Symbol_table::add_from_pluginobj): Likewise.
3944 (Symbol_table::add_from_dynobj): Likewise.
3945 (Symbol_table::define_special_symbol): Rename insdef to
3948 2010-01-04 Ian Lance Taylor <iant@google.com>
3951 * options.h (class General_options): Add
3952 --allow-multiple-definition and -z muldefs.
3953 * resolve.cc (Symbol_table::should_override): Don't warn about a
3954 multiple symbol definition if --allow-multiple-definition or -z
3958 * options.h (class General_options): Add --add-needed and
3959 --copy-dt-needed-entries. Tweak --as-needed help entry.
3960 * object.cc (Input_objects::check_dynamic_dependencies): Give an
3961 error if --copy-dt-needed-entries aka --add-needed is used and
3962 would cause a change in behaviour.
3965 * options.h (class General_options): Add -G as a short version of
3966 --shared. Add no-op options -assert, -g, and -i.
3968 2010-01-04 Sriraman Tallam <tmsriram@google.com>
3970 * gc.h (gc_process_relocs): Call is_section_foldable_candidate to
3971 check for .text or .gnu.linkonce.t sections.
3972 * icf.cc (Icf::find_identical_sections): Ditto.
3973 Change the detection for mangled function name within the section
3975 * icf.h (is_section_foldable_candidate): New function.
3977 2009-12-30 Ian Lance Taylor <iant@google.com>
3980 * options.h (class General_options): Permit two dashes with
3981 --retain-symbols-file.
3983 2009-12-30 Ian Lance Taylor <iant@google.com>
3986 * layout.cc (Layout::relaxation_loop_body): If -Ttext was used,
3987 don't put the file header and segment headers in the text
3991 * common.cc (Sort_commons::operator()): Stabilize sort when both
3993 (Symbol_table::do_allocate_commons_list): When allocating common
3994 symbols, skip a symbol which is no longer common.
3995 * symtab.h (Symbol::is_common): Test whether the symbol comes from
3996 an object before checking its type.
3997 * testsuite/common_test_2.c: New file.
3998 * testsuite/common_test_3.c: New file.
3999 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_2.
4000 (common_test_2_SOURCES, common_test_2_DEPENDENCIES): Define.
4001 (common_test_2_LDFLAGS, common_test_2_LDADD): Define.
4002 (common_test_2_pic.o, common_test_2.so): New targets.
4003 (common_test_3_pic.o, common_test_3.so): New targets.
4004 * testsuite/Makefile.in: Rebuild.
4007 * script.cc (read_input_script): If we see a new SECTIONS clause,
4008 and we have added an input section, give an error.
4009 * layout.h (class Layout): Add have_added_input_section function.
4010 Add have_added_input_section_ field.
4011 * layout.cc (Layout::Layout): Initialize
4012 have_added_input_section_.
4013 (Layout::layout): Set have_added_input_section_.
4014 (Layout::layout_eh_frame): Likewise.
4016 2009-12-30 Ian Lance Taylor <iant@google.com>
4019 * options.h (class General_options): Add --sort-common option.
4020 * symtab.h (class Symbol_table): Define Sort_commons_order enum.
4021 * common.cc (Sort_common): Add sort_order parameter to
4022 constructor. Add sort_order_ field.
4023 (Sort_commons::operator): Check sort_order_.
4024 (Symbol_table::allocate_commons): Determine the sort order.
4025 (Symbol_table::do_allocate_commons): Add sort_order parameter.
4027 (Symbol_table::do_allocate_commons_list): Likewise.
4029 2009-12-30 Ian Lance Taylor <iant@google.com>
4032 * symtab.cc (Symbol_table::add_from_relobj): When not exporting
4033 symbols from this object, don't change the visibility of an
4035 * testsuite/exclude_libs_test_1.c (lib1_ref): New function.
4037 2009-12-30 Ian Lance Taylor <iant@google.com>
4040 * script.h (class Version_script_info): Define Language enum.
4041 Update declarations. Define Glob, Exact, and Lookup types. Add
4042 new fields globals_, locals_, and is_finalized_.
4043 * script.cc: Various formatting fixes.
4044 (class Parser_closure): Change language_stack_ from a vector of
4045 std::string to one of Version_script_info::Language. Adjust all
4047 (class Lazy_demangler): Remove.
4048 (struct Version_expression): Change language from std::string to
4049 Version_script_info::Language.
4050 (Version_script_info::Version_script_info): New function.
4051 (Version_script_info::~Version_script_info): Don't call clear.
4052 (Version_script_info::finalize): New function.
4053 (Version_script_info::build_lookup_tables): New function.
4054 (Version_script_info::build_expression_list_lookup): New
4056 (Version_script_info::get_symbol_version_helper): Rewrite to use
4058 (Version_script_info::print_expression_list): Adjust to use
4059 Version_script_info::Language.
4060 (script_push_lex_into_version_mode): Check that the version script
4061 has not been finalized.
4062 (version_script_push_lang): Change language string to
4063 Version_script_info::Language.
4064 * options.cc (Command_line::version_script): New function.
4065 * options.h (class General_options): Add finalize_dynamic_list
4066 function. Change version_script from declaration to definition.
4067 * testsuite/ver_test_4.script: Remove duplicate def of t2_2.
4068 * testsuite/version_script.map: Remove duplicate def of foo.
4069 * testsuite/Makefile.am (ver_matching_def.so): Depend upon
4071 * testsuite/Makefile.in: Rebuild.
4073 2009-12-30 Ian Lance Taylor <iant@google.com>
4076 * target-reloc.h (relocate_for_relocatable): When copying a reloc,
4077 if the input symbol index is 0, make the output symbol index 0.
4079 2009-12-30 Ian Lance Taylor <iant@google.com>
4082 * options.h (class General_options): Add -x/--discard-all.
4083 * object.cc (Sized_relobj::do_count_local_symbols): Handle
4084 --discard-all. If the local symbol needs a dynamic entry, check
4085 that before handling --discard-locals.
4087 2009-12-30 Ian Lance Taylor <iant@google.com>
4090 * output.cc (Output_segment::Output_segment): If PT_TLS, set the
4092 (Output_segment::add_output_section): Don't change the flags if
4096 * dynobj.cc (Dynobj::create_gnu_hash_table): Add symbols to the
4097 GNU hash table if they need a dynamic value. Otherwise, don't add
4098 them if they are defined in a dynamic object or are forced local.
4100 2009-12-29 Ian Lance Taylor <iant@google.com>
4103 * layout.cc (Layout::create_dynamic_symtab): Only set entsize of
4104 .gnu.hash table for a 32-bit target.
4107 * symtab.h (Symbol::needs_dynsym_entry): A symbol in both a
4108 regular and a dynamic object only needs a dynamic symbol table
4109 entry if it is externally visible.
4112 * i386.cc (class Target_i386): Initialize global_offset_table_ in
4113 constructor. Add global_offset_table_ field.
4114 (Target_i386::got_section): Set global_offset_table_.
4115 (Target_i386::do_finalize_sections): Set global_offset_table_
4117 * x86_64.cc (class Target_x86_64): Initialize global_offset_table_
4118 in constructor. Add global_offset_table_ field.
4119 (Target_x86_64::got_section): Set global_offset_table_.
4120 (Target_x86_64::do_finalize_sections): Set global_offset_table_
4123 * layout.cc (Layout::Layout): Initialize increase_relro_.
4124 (Layout::get_output_section): Add is_relro, is_last_relro, and
4125 is_first_non_relro parameters. Change all callers.
4126 (Layout::choose_output_section): Likewise.
4127 (Layout::add_output_section_data): Likewise.
4128 (Layout::make_output_section): Likewise.
4129 (Layout::set_segment_offsets): Clear increase_relro when using a
4131 * layout.h (class Layout): Add increase_relro method. Add
4132 increase_relro_ field. Update declarations.
4133 * output.cc (Output_section::Output_section): Initialize
4134 is_last_relro_ and is_first_non_relro_.
4135 (Output_segment::add_output_section): Group relro sections is
4136 do_sort is true. Handle is_last_relro and is_first_non_relro.
4137 (Output_segment::maximum_alignment): Remove relro handling.
4138 (Output_segment::set_section_addresses): Add increase_relro
4139 parameter. Change all callers. Add initial alignment to align
4140 relro sections on separate page. Remove old relro handling.
4141 (Output_segment::set_section_list_addresses): Remove in_relro
4142 parameter. Change all callers.
4143 (Output_segment::set_offset): Add increase parameter. Change all
4144 callers. Remove old relro handling.
4145 * output.h (class Output_section): Add new methods: is_last_relro,
4146 set_is_last_relro, is_first_non_relro, set_is_first_non_relro.
4147 Add is_last_relro_ and is_first_non_relro_ fields.
4148 * i386.cc (Target_i386::got_section): Don't call set_is_relro.
4149 Create separate .got.plt section. Call increase_relro.
4150 * x86_64.cc (Target_x86_64::got_section): Likewise.
4151 * testsuite/relro_script_test.t: Add .got.plt.
4154 * layout.cc (Layout::Layout): Initialize dynamic_symbol_ field.
4155 (Layout::create_initial_dynamic_sections): Set dynamic_symbol_.
4156 (Layout::finalize): Call set_dynamic_symbol_size.
4157 (Layout::set_dynamic_symbol_size): New function.
4158 * layout.h (class Layout): Add dynamic_symbol_ field. Declare
4159 set_dynamic_symbol_size.
4162 * output.h (class Output_section): Add is_entsize_zero_ field.
4163 * output.cc (Output_section::Output_section): Initialize
4165 (Output_section::set_entsize): If two different entsizes are
4166 requested, force it to zero.
4167 (Output_section::add_input_section): Set flags for .debug_str
4168 before updating section flags. Set entsize.
4169 (Output_section::update_flags_for_input_section): Set SHF_MERGE
4170 and SHF_STRING if all input sections have those flags.
4172 2009-12-29 Rafael Espindola <espindola@google.com>
4174 * main.cc (main): Fix the sys time reporting.
4175 * workqueue.cc (Workqueue::find_and_run_task): Fix the sys time
4178 2009-12-29 Sriraman Tallam <tmsriram@google.com>
4180 * options.cc (General_options::parse_version): Allow -v to exit
4181 without an error if there is nothing to link.
4183 2009-12-29 Ian Lance Taylor <iant@google.com>
4185 * configure.ac: Set the MCMODEL_MEDIUM conditional to false if
4186 using a version of gcc before 4.1.
4187 * configure: Rebuild.
4189 2009-12-28 Chris Demetriou <cgd@google.com>
4191 * attributes.cc (Output_attributes_section_data::do_write): Use
4192 std::vector::front rather than std::vector::data.
4194 2009-12-28 Ian Lance Taylor <iant@google.com>
4196 * symtab.h (class Symbol_table): Add enum Defined.
4197 * resolve.cc (Symbol_table::should_override): Add defined
4198 parameter. Change all callers. Test whether object is NULL
4199 before calling a method on it.
4200 (Symbol_table::report_resolve_problem): Add defined parameter.
4202 (Symbol_table::should_override_with_special): Likewise.
4203 * symtab.cc (Symbol_table::define_in_output_data): Add defined
4204 parameter. Change all callers.
4205 (Symbol_table::do_define_in_output_data): Likewise.
4206 (Symbol_table::define_in_output_segment): Likewise.
4207 (Symbol_table::do_define_in_output_segment): Likewise.
4208 (Symbol_table::define_as_constant): Likewise.
4209 (Symbol_table::do_define_as_constant): Likewise.
4210 * script.h (class Symbol_assignment): Add is_defsym parameter to
4211 constructor; change all callers.
4212 * script.cc (Script_options::add_symbol_assignment): Add is_defsym
4213 parameter. Change all callers. Add is_defsym_ field.
4214 (class Parser_closure): Add parsing_defsym parameter to
4215 constructor; change all callers. Add parsing_defsym accessor
4216 function. Add parsing_defsym_ field.
4218 2009-12-28 Ian Lance Taylor <iant@google.com>
4220 * gold.cc (queue_middle_tasks): Fix formatting.
4221 * object.cc (Relobj::is_section_name_included): Likewise.
4223 2009-12-23 Ian Lance Taylor <iant@google.com>
4225 * i386.cc (Target_i386::do_calls_non_split): Recognize
4226 -fsplit-stack prologue for a function with a static chain.
4227 * x86_64.cc (Target_x86_64::do_calls_non_split): Recognize
4228 -fsplit-stack prologue when using %r11.
4230 2009-12-21 Sriraman Tallam <tmsriram@google.com>
4232 * options.cc (General_options::parse_version): Make -v continue and do
4233 the link like GNU ld does.
4235 2009-12-17 Rafael Avila de Espindola <espindola@google.com>
4237 * Makefile.am (CCFILES): Add timer.cc.
4238 (HFILES): Add timer.h.
4239 * configure.ac: Check for sysconf and times.
4240 * main.cc: include timer.h.
4241 (main): Use Timer instead of get_run_time.
4244 * workqueue.cc: include timer.h.
4245 (Workqueue::find_and_run_task):
4246 Report user, sys and wall time.
4247 * Makefile.in: Regenerate.
4248 * config.in: Regenerate.
4249 * configure: Regenerate.
4251 2009-12-16 Doug Kwan <dougkwan@google.com>
4253 * arm.cc (Arm_relobj::scan_sections_for_stubs): Exclude ICF-eliminated
4255 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle
4256 relaxed input sections.
4257 * output.cc (Output_section::find_relaxed_input_section): Change
4258 return type to Output_relaxed_input_section pointer. Adjust code
4259 for new type of relaxed_input_section_map_.
4260 * output.h (Output_section::find_relaxed_input_section): Change
4261 return type to Output_relaxed_input_section pointer.
4262 (Output_section::Output_relaxed_input_section_by_input_section_map):
4264 (Output_section::relaxed_input_section_map_): Change type to
4265 Output_section::Output_relaxed_input_section_by_input_section_map.
4266 * symtab.cc (Symbol_table::compute_final_value): Handle relaxed
4269 2009-12-15 Ian Lance Taylor <iant@google.com>
4271 * layout.cc (Layout::create_shstrtab): Only write out after input
4272 sections if we are compressing debug sections.
4274 2009-12-15 Ian Lance Taylor <iant@google.com>
4276 * archive.cc (Archive::add_symbols): Only look up a symbol without
4277 a version if there is, in fact, a version.
4279 2009-12-14 Ian Lance Taylor <iant@google.com>
4281 Revert -Wshadow changes, all changes from:
4282 2009-12-11 Doug Kwan <dougkwan@google.com>
4283 2009-12-11 Nick Clifton <nickc@redhat.com>
4284 * configure.ac: Remove -Wshadow when setting WARN_CXXFLAGS.
4286 2009-12-11 Doug Kwan <dougkwan@google.com>
4288 * arm.cc (Target_arm::do_finalize_sections): Fix build breakage
4290 * attributes.cc (Object_attribute::size): Ditto.
4291 (Attributes_section_data::size): Ditto.
4292 (Attributes_section_data::Attributes_section_data): Ditto.
4293 (Output_attributes_section_data::do_write): Ditto.
4294 * attributes.h (Object_attribute::set_type): Ditto.
4295 * testsuite/tls_test_main.cc (safe_lock, safe_unlock): Ditto.
4297 2009-12-11 Nick Clifton <nickc@redhat.com>
4299 * archive.cc: Fix shadowed variable warnings.
4301 * compressed_output.cc: Likewise.
4302 * compressed_output.h: Likewise.
4303 * configure: Likewise.
4304 * dwarf_reader.cc: Likewise.
4305 * dynobj.cc: Likewise.
4306 * dynobj.h: Likewise.
4307 * ehframe.cc: Likewise.
4308 * ehframe.h: Likewise.
4309 * errors.cc: Likewise.
4310 * expression.cc: Likewise.
4311 * fileread.cc: Likewise.
4312 * fileread.h: Likewise.
4313 * freebsd.h: Likewise.
4314 * i386.cc: Likewise.
4316 * incremental.h: Likewise.
4317 * layout.cc: Likewise.
4318 * layout.h: Likewise.
4319 * mapfile.cc: Likewise.
4320 * merge.cc: Likewise.
4321 * merge.h: Likewise.
4322 * object.cc: Likewise.
4323 * object.h: Likewise.
4324 * options.h: Likewise.
4325 * output.cc: Likewise.
4326 * output.h: Likewise.
4327 * parameters.cc: Likewise.
4328 * plugin.cc: Likewise.
4329 * powerpc.cc: Likewise.
4330 * reduced_debug_output.cc: Likewise.
4331 * reduced_debug_output.h: Likewise.
4332 * reloc.cc: Likewise.
4333 * reloc.h: Likewise.
4334 * resolve.cc: Likewise.
4335 * script-sections.cc: Likewise.
4336 * script.cc: Likewise.
4337 * script.h: Likewise.
4338 * sparc.cc: Likewise.
4339 * symtab.cc: Likewise.
4340 * symtab.h: Likewise.
4341 * target-select.cc: Likewise.
4342 * target-select.h: Likewise.
4343 * token.h: Likewise.
4344 * workqueue.cc: Likewise.
4345 * workqueue.h: Likewise.
4346 * x86_64.cc: Likewise.
4348 2009-12-10 Doug Kwan <dougkwan@google.com>
4350 * arm.cc (attributes.h): New include.
4351 (Arm_relobj::Arm_relobj): Initialize attributes_section_data_.
4352 (Arm_relobj::~Arm_relobj): Delete object pointed by
4353 attributes_section_data_.
4354 (Arm_relobj::attributes_section_data): New method definition.
4355 (Arm_relobj::attributes_section_data_): New data member declaration.
4356 (Arm_dynobj::Arm_dynobj): Initialize attributes_section_data_.
4357 (Arm_dynobj::~Arm_dynobj): Delete object pointed by
4358 attributes_section_data_.
4359 (Arm_dynobj::attributes_section_data): New method definition.
4360 (Arm_dynobj::attributes_section_data_): New data member declaration.
4361 (Target_arm::Target_arm): Initialize attributes_section_data_. Change
4362 initialization value of may_use_blx_ to false.
4363 (Target_arm::using_thumb2, Target_arm::using_thumb_only,
4364 Target_arm::may_use_arm_nop, Target_arm::may_use_thumb2_nop): Use
4365 object attributes to compute results instead of hard-coding.
4366 (Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order,
4367 Target_arm::get_secondary_compatible_arch,
4368 Target_arm::set_secondary_compatible_arch
4369 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
4370 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes):
4371 New method declarations.
4372 (Target_arm::get_aeabi_object_attribute): New method definition.
4373 (Target_arm::attributes_section_data_): New data member declaration.
4374 (read_arm_attributes_section): New template definition.
4375 (Arm_relobj::do_read_symbols): Read attributes section if it exists.
4376 (Arm_dynobj::do_read_symbols): Ditto.
4377 (Target_arm::do_finalize_sections): Merge attributes sections from
4378 input. Check for BLX use after attributes section merging.
4379 Fix __exidx_start and __exidx_end visibility. Create an
4380 .ARM.attributes section if necessary.
4381 (Target_arm::get_secondary_compatible_arch,
4382 Target_arm::set_secondary_compatible_arch,
4383 Target_arm::tag_cpu_arch_combine, Target_arm::aeabi_enum_name,
4384 Target_arm::tag_cpu_name_value, Target_arm::merge_object_attributes,
4385 Target_arm::do_attribute_arg_type, Target_arm::do_attributes_order):
4386 New method definitions.
4388 2009-12-09 Ian Lance Taylor <iant@google.com>
4390 * plugin.cc (Plugin::load): Don't cast from void* to a function
4393 2009-12-09 Ian Lance Taylor <iant@google.com>
4395 * dynobj.cc (Sized_dynobj::do_read_symbols): Clear version
4398 2009-12-09 H.J. Lu <hongjiu.lu@intel.com>
4400 * testsuite/Makefile.am (two_file_shared_1_pic_2_test_DEPENDENCIES):
4401 Replace two_file_shared_1.so with two_file_shared_2.so.
4402 * testsuite/Makefile.in: Regenerated.
4404 2009-12-08 Doug Kwan <dougkwan@google.com>
4406 * Makefile.am (CCFILES): Add attributes.cc and int_encoding.cc.
4407 (HFILES): Add attributes.h and int_encoding.h.
4408 * Makefile.in: Regenerate.
4409 * dwarf_reader.cc (read_unsigned_LEB_128, read_signed_LEB_128): Move
4410 function definitions to int_encoding.cc
4411 * dwarf_reader.h (read_unsigned_LEB_128, read_signed_LEB_128): Move
4412 prototypes to int_encoding.h
4413 * reduced_debug_output.cc (int_encoding.h): New include.
4414 (write_unsigned_LEB_128, get_length_as_unsigned_LEB_128): Move
4415 function definitions to int_encoding.cc
4416 (insert_into_vector, read_from_pointer): Move template definitions to
4418 * attributes.cc: New file.
4419 * attributes.h: New file.
4420 * int_encoding.cc: New file.
4421 * int_encoding.h: New file.
4423 2009-12-07 Rafael Avila de Espindola <espindola@google.com>
4426 * incremental-dump.cc (dump_incremental_inputs): New.
4427 (main): Use dump_incremental_inputs.
4429 2009-12-07 H.J. Lu <hongjiu.lu@intel.com>
4432 * i386.cc (Target_i386::Scan::globa): Use is_func instead of
4433 checking elfcpp::STT_FUNC.
4434 (Target_i386::Relocate::relocate): Likewise.
4435 * x86_64.cc (Target_x86_64::Scan::global): Likewise.
4437 * symtab.cc (Symbol_table::sized_write_symbol): Turn IFUNC
4438 symbols from shared libraries into normal FUNC symbols.
4440 * symtab.h (Symbol): Add is_func and use it.
4442 2009-12-05 Doug Kwan <dougkwan@google.com>
4444 * arm.cc (Target_arm::arm_info): Initialize new fields
4445 attributes_section and attributes_vendor.
4446 * i386.cc (Target_i386::i386_info): Same.
4447 * object.cc (Sized_relobj::do_layout): Skip attribute section.
4448 * gold/powerpc.cc (Target_powerpc::powerpc_info): Initialize new
4449 fields attributes_section and attributes_vendor.
4450 * sparc.cc (Target_sparc::sparc_info): Same.
4451 * target.h (Target::attributes_section, Target::attributes_vendor,
4452 Target::is_attributes_section, Target::attribute_arg_type,
4453 Target::attributes_order): New method definitions.
4454 (Target::Target_info::attributes_section,
4455 Target::Target_info::attributes_vendor): New fields.
4456 (Target::do_attribute_arg_type, Target::do_attributes_order): New
4457 virtual method definitions.
4458 * x86_64.cc (Target_x86_64::x86_64_info): Initialize new fields
4459 attributes_section and attributes_vendor.
4460 * testsuite/testfile.cc (Target_test::test_target_info): Same.
4462 2009-12-05 Doug Kwan <dougkwan@google.com>
4464 * arm.cc: Update comments about interworking and stub generation.
4465 (Target_arm::Relocate::reloc_is_non_pic): Update list of relocations
4466 considered as non-PIC.
4467 (Arm_relocate_functions::base_abs): Fix formatting.
4468 (Arm_relocate_functions::got_prel): Fix comment. Change interface
4469 of function to use GOT entry address instead of offset.
4470 (Target_arm::Scan::global): Issue an error if a symbol would need a
4471 PLT does not get one because it is untyped. Remove code to create
4472 dynamic symbols for relative branches.
4473 (Target_arm::Relocate::relocate: Use 0 instead of false since function
4474 takes unsigned integer instead of boolean.
4476 2009-12-05 H.J. Lu <hongjiu.lu@intel.com>
4478 * testsuite/Makefile.am (constructor_test_LDADD): New. Empty.
4479 (two_file_test_LDADD): Likewise.
4480 (common_test_1_LDADD): Likewise.
4481 (exception_test_LDADD) Likewise.
4482 (weak_test_LDADD): Likewise.
4483 (many_sections_test_LDADD): Likewise.
4484 (initpri1_LDADD): Likewise.
4485 (script_test_1_LDADD): Likewise.
4486 (script_test_2_LDADD): Likewise.
4487 (justsyms_LDADD): Likewise.
4488 (binary_test_LDADD): Likewise.
4489 (large_LDADD): Likewise.
4490 * testsuite/Makefile.in: Regenerated.
4492 2009-12-04 H.J. Lu <hongjiu.lu@intel.com>
4494 * resolve.cc (symbol_to_bits): Treat STB_GNU_UNIQUE as STB_GLOBAL.
4495 (Symbol_table::override_with_special): Likewise.
4496 (Symbol_table::add_from_object): Likewise.
4498 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
4500 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
4501 Don't set the data_offset twice.
4503 2009-12-04 Rafael Avila de Espindola <espindola@google.com>
4505 * testsuite/Makefile.in: Regenerate.
4507 2009-12-03 Doug Kwan <dougkwan@google.com>
4509 * arm.cc: Remove comment about missing .ARM.exidx section symbols.
4510 (Target_arm::do_finalize_sections): Add parameter for symbol table
4511 pointer. Add __exidx_start and __exidx_end symbols as appropriate.
4512 * i386.cc (Target_i386::do_finalize_sections): Add an additional
4513 parameter for symbol table pointer.
4514 * layout.cc (Layout::finalize): Call Target::finalize_sections with
4515 an additional parameter for a pointer to symbol table.
4516 * powerpc.cc (Target_powerpc::do_finalize_sections): Add an additional
4517 parameter for a symbol table pointer.
4518 * sparc.cc (Target_sparc::do_finalize_sections): Ditto.
4519 * target.h (Target::finalize_sections, Target::do_finalize_sections):
4521 * x86_64.cc (Target_x86_64::do_finalize_sections): Add an additional
4522 parameter for a symbol table pointer.
4524 2009-12-03 Rafael Avila de Espindola <espindola@google.com>
4526 * incremental.cc (Incremental_inputs_header)
4527 (Incremental_inputs_header_write, Incremental_inputs_entry)
4528 (Incremental_inputs_entry_write): Move ...
4529 * incremental.h (Incremental_inputs_header)
4530 (Incremental_inputs_header_write, Incremental_inputs_entry)
4531 (Incremental_inputs_entry_write): here.
4533 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
4535 * incremental.cc (make_sized_incremental_binary): Set the target.
4536 Error if it is incompatible.
4537 * output.h (Output_file): Add filename method.
4539 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
4541 * incremental.cc (Incremental_inputs_entry): Remove unused argument
4542 from the get_* methods.
4544 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
4546 * incremental-dump.cc (main): Check that the offeset of a script is 0.
4547 * incremental.cc (Incremental_inputs::sized_create_inputs_section_data):
4548 Write 0 for the data_offset of scripts.
4550 2009-12-02 Rafael Avila de Espindola <espindola@google.com>
4552 * testsuite/Makefile.am: Add the incremental_test.sh test.
4553 * testsuite/incremental_test.sh: New.
4554 * testsuite/incremental_test_1.c: New.
4555 * testsuite/incremental_test_2.c: New.
4557 2009-12-01 Rafael Avila de Espindola <espindola@google.com>
4559 * incremental-dump.cc (main): Fix typos.
4561 2009-11-27 Rafael Avila de Espindola <espindola@google.com>
4564 * incremental-dump.cc (main): Use llu to print 64 bit values.
4566 2009-11-26 Per Øyvind Karlsen <peroyvind@mandriva.org>
4567 H.J. Lu <hongjiu.lu@intel.com>
4569 * Makefile.am (incremental_dump_DEPENDENCIES): Add $(THREADSLIB)
4571 (incremental_dump_LDADD): Likewise.
4572 * Makefile.in: Regenerated.
4574 2009-11-25 Doug Kwan <dougkwan@google.com>
4578 2009-11-25 Doug Kwan <dougkwan@google.com>
4580 * arm.cc (Target_arm::Target_arm): Move method definition
4581 outside of class definition. Add code to handle
4582 --target1-rel, --target1-abs and --target2= options.
4583 (Target_arm::get_reloc_reloc_type): Change method to be
4584 non-static and const.
4585 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_):
4586 New data member declaration.
4587 (Target_arm::Scan::local, Target_arm::Scan::global,
4588 Target_arm::Relocate::relocate,
4589 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
4590 Adjust call to Target_arm::get_real_reloc_type.
4591 (Target_arm::get_real_reloc_type): Use command line options
4592 to determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
4593 * options.h (--target1-rel, --target1-abs, --target2): New
4596 2009-11-25 Doug Kwan <dougkwan@google.com>
4598 * arm.cc (Target_arm::Target_arm): Move method definition outside of
4599 class definition. Add code to handle --target1-rel, --target1-abs
4600 and --target2= options.
4601 (Target_arm::get_reloc_reloc_type): Change method to be non-static
4603 (Target_arm::target1_is_rel_, Target_arm::target2_reloc_): New data
4605 (Target_arm::Scan::local, Target_arm::Scan::global,
4606 Target_arm::Relocate::relocate,
4607 Target_arm::Relocatable_size_for_reloc::get_size_for_reloc): Adjust
4608 call to Target_arm::get_real_reloc_type.
4609 (Target_arm::get_real_reloc_type): Use command line options to
4610 determine real types of R_ARM_TARGET1 and R_ARM_TARGET2.
4611 * options.h (--target1-rel, --target1-abs, --target2): New ARM-only
4614 2009-11-25 Doug Kwan <dougkwan@google.com>
4616 * arm.cc (Target_arm::may_use_thumb2_nop): New method definition.
4617 (Arm_relocate_functions::thumb_branch_common): New metod declaration.
4618 (Arm_relocate_functions::abs12, Arm_relocate_functions::abs16): Fix
4620 (Arm_relocate_functions::thm_call): Replace body with a call to
4621 Arm_relocate_functions::thumb_branch_common.
4622 (Arm_relocate_functions::thm_jump24,
4623 Arm_relocate_functions::thm_xpc22): New method definitions.
4624 (Arm_relocate_functions::thumb_branch_common): New method definition.
4625 (Reloc_stub::stbu_type_for_reloc): Fix incorrect uses of bit-wise-or
4627 (Target_arm::Relocate::relocate): Adjust call to thm_call.
4628 Add code to handle R_ARM_THM_XPC22 and R_ARM_THM_JUMP24.
4630 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
4632 * Makefile.am: Build incremental-dump
4633 * Makefile.in: Regenerate.
4634 * incremental-dump.cc: New.
4635 * incremental.cc (Incremental_inputs_header_data,
4636 Incremental_inputs_entry_data): Move to incremental.h
4637 * incremental.h: (Incremental_inputs_header_data,
4638 Incremental_inputs_entry_data): Move from incremental.cc
4640 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
4642 * incremental.cc (Incremental_inputs_header,
4643 Incremental_inputs_header_write, Incremental_inputs_entry,
4644 Incremental_inputs_entry_write): Add a typedef with the data type.
4646 2009-11-24 Rafael Avila de Espindola <espindola@google.com>
4648 * incremental.cc (Incremental_inputs_header,
4649 Incremental_inputs_header_write, Incremental_inputs_entry,
4650 Incremental_inputs_entry_write): Update comment about which
4651 type has the filed descriptions.
4653 2009-11-15 Doug Kwan <dougkwan@google.com>
4655 * arm.cc (Target_arm::may_use_arm_nop): New method definition.
4656 (Arm_relocate_functions::arm_branch_common): Change method defintion
4657 in class definition to a method declaration and update list of formal
4659 (Arm_relocate_functions::plt32, Arm_relocate_functions::call,
4660 Arm_relocation_functions::jump24): Adjust call to
4661 Arm_relocate_functions::arm_branch_common. Update list of formal
4663 (Arm_relocate_functions::xpc25): New method definition.
4664 (Arm_relocate_functions::arm_branch_common): Move method defintion
4665 out from class definition. Use stubs for mode-switching and extending
4667 (Target_arm::Relocate::relocate): Handle weakly-undefined symbols
4668 specially. Change code to enable use of stubs in ARM branches.
4670 2009-11-10 Doug Kwan <dougkwan@google.com>
4672 * arm.cc (Arm_relobj::do_relocate_sections): Remove options parameter
4673 in method declaration.
4674 (Target_arm::relocate_stub): New method declaration.
4675 (Target_arm::default_target): Change to return a pointer instead of
4677 (Reloc_stub::stub_type_for_reloc): Adjust for the change in
4678 Target_arm::default_target.
4679 (Arm_Relobj::do_relocate_sections): Remove options paramater in
4681 (Target_arm::relocate_section): Adjust view.
4682 (Target_arm::relocate_stub): New method definition.
4684 2009-11-10 Doug Kwan <dougkwan@google.com>
4686 * i386.cc (Target_i386::do_calls_non_split): Add a cast to avoid
4688 * incremental.cc (open_incremental_binary): Initialized local
4689 variables to avoid warnings.
4690 * object.cc (make_elf_object): Ditto.
4691 * x86_64.cc (Target_x86_64::do_calls_non_split): Add a cast to avoid
4694 009-11-09 H.J. Lu <hongjiu.lu@intel.com>
4697 * testsuite/plugin_test.c: Include "config.h".
4699 2009-11-09 Doug Kwan <dougkwan@google.com>
4701 * arm.cc (Target_arm::fake_relnum_for_stubs): New constant.
4702 (arm_symbol_value): Remove.
4703 (Arm_relocate_functions::arm_branch_common,
4704 Arm_relocate_functions::abs8, Arm_relocate_functions::thm_abs5,
4705 Arm_relocate_functions::abs12, Arm_relocate_functions::abs16,
4706 Arm_relocate_functions::abs32, Arm_relocate_functions::rel32,
4707 Arm_relocate_functions::thm_call, Arm_relocate_functions::plt32,
4708 Arm_relocate_functions::call, Arm_relocate_functions::jump24,
4709 Arm_relocate_functions::prel31, Arm_relocate_functions::mov_abs_nc,
4710 Arm_relocate_functions::movt_abs, Arm_relocate_functions::movw_abs_nc,
4711 Arm_relocate_functions::thm_mobw_abs_nc,
4712 Arm_relocate_functions::thm_mov_abs,
4713 Arm_relocate_functions::movw_prel_nc,
4714 Arm_relocate_functions::thm_movt_abs,
4715 Arm_relocate_functions::movt_prel,
4716 Arm_relocate_functions::thm_movw_prel_nc,
4717 Arm_relocate_functions::thm_movt_prel): Adjust callers of the above.
4718 (Target_arm::Relocate::relocate): Only decompose address into two
4719 parts if relocation type uses the thumb-bit and pass the actual
4720 bit instead of a flag indicating that the thumb-bit is used. Adjust
4721 calls to methods in Arm_relocate_functions for this change.
4723 2009-11-08 Ian Lance Taylor <iant@google.com>
4726 * reloc.cc: Instantiate
4727 Sized_relobj::initialize_input_to_output_maps and
4728 Sized_relobj:free_input_to_output_maps.
4730 2009-11-06 Ian Lance Taylor <iant@google.com>
4733 * defstd.cc (in_segment): Set only_if_ref true for "end".
4735 2009-11-06 Doug Kwan <dougkwan@google.com>
4737 * arm.cc (class Reloc_stub): Correct a comment.
4738 (Target_arm::Target_arm): Initialize arm_input_section_map_.
4739 (Target_arm::scan_section_for_stubs): New method declaration.
4740 (Target_arm::do_make_elf_object, Target_arm::do_make_output_section):
4741 Change methods from private to protected.
4742 (Target_arm::do_may_relax): New method definition.
4743 (Target_arm::do_relax, Target_arm::group_sections,
4744 Target_arm::scan_reloc_for_stub,
4745 Target_arm::scan_reloc_section_for_stubs): New method declarations.
4746 (Target_arm::arm_input_section_map_): New data member declaration.
4747 (Target_arm::scan_reloc_for_stub,
4748 Target_arm::scan_reloc_section_for_stubs,
4749 Target_arm::scan_section_for_stubs, Target_arm::group_sections,
4750 Target_arm::do_relax): New method definitions.
4752 2009-11-06 Mikolaj Zalewski <mikolaj@google.com>
4754 * configure.ac: Check for (struct stat)::st_mtim
4755 * fileread.cc (File_read::get_mtime): Use st_mtim if available.
4756 * config.in: Regenerate.
4757 * configure: Regenerate.
4759 2009-11-05 Ian Lance Taylor <iant@google.com>
4762 * output.cc (Output_segment::add_output_section): Add missing
4765 2009-11-04 Ian Lance Taylor <iant@google.com>
4768 * object.h (class Object): Add is_needed and set_is_needed
4769 methods. Add is_needed_ field. Make bool fields into bitfields.
4770 * symtab.cc (Symbol_table::set_dynsym_indexes): If a symbol is
4771 defined in a dynamic object and referenced by a regular object,
4772 set is_needed for the dynamic object.
4773 * layout.cc (Layout::finish_dynamic_section): Don't add DT_NEEDED
4774 if the file is marked with as_needed and it is not needed.
4776 2009-11-04 Ian Lance Taylor <iant@google.com>
4779 * arm.cc (Target_arm::do_finalize_sections): Don't add dynamic
4780 tags if data is discarded by linker script.
4781 * i386.cc (Target_i386::do_finalize_sections): Likewise.
4782 * powerpc.cc (Target_powerpc::do_finalize_sections): Likewise.
4783 * sparc.cc (Target_sparc::do_finalize_sections): Likewise.
4784 * x86_64.cc (Target_x86_64::do_finalize_sections): Likewise.
4786 2009-11-04 Ian Lance Taylor <iant@google.com>
4788 * layout.cc (Layout::get_output_section): Add is_interp and
4789 is_dynamic_linker_section parameters. Change all callers.
4790 (Layout::choose_output_section): Likewise.
4791 (Layout::make_output_section): Likewise.
4792 (Layout::add_output_section_data): Add is_dynamic_linker_section
4793 parameter. Change all callers.
4794 * layout.h (class Layout): Update declarations.
4795 * output.h (class Output_section): Add is_interp, set_is_interp,
4796 is_dynamic_linker_section, set_is_dynamic_linker_section methods.
4797 Add is_interp_, is_dynamic_linker_section_ fields. Change
4798 generate_code_fills_at_write_ to a bitfield.
4799 * output.cc (Output_section::Output_sections): Initialize new
4801 (Output_segment::add_output_section): Add do_sort parameter.
4804 2009-11-03 Ian Lance Taylor <iant@google.com>
4807 * options.h (class General_options): Add --warn-common.
4808 * resolve.cc (Symbol_table::resolve): Handle --warn-common when
4809 merging two common symbols.
4810 (Symbol_table::should_override): Handle --warn-common when merging
4811 a common symbol with a defined symbol. Use report_resolve_problem
4812 for multiple definitions.
4813 (Symbol_table::report_resolve_problem): New function.
4814 * symtab.h (class Symbol_table): Declare report_resolve_problem.
4816 2009-11-03 Doug Kwan <dougkwan@google.com>
4818 * arm.cc (Target_arm::Target_arm): Initialize stub_tables_ and
4820 (Target_arm::stub_factory): New method definition.
4821 (Target_arm::new_arm_input_section,
4822 Target_arm::find_arm_input_section, Target_arm::new_stub_table,
4823 Target_arm::reloc_uses_thumb_bit): New method declarations.
4824 (Target_arm::Stub_table_list, Target_arm::Arm_input_section_map):
4825 New type definitions.
4826 (Target_arm::stub_tables_, Target_arm::stub_factory_): New data
4827 member declarations.
4828 (Target_arm::reloc_uses_thumb_bit, Target_arm::new_arm_input_section,
4829 Target_arm::find_arm_input_section, Target_arm::new_stub_table):
4830 New method definitions.
4832 2009-11-03 Ian Lance Taylor <iant@google.com>
4834 * options.h (class General_options): Add --warn_constructors.
4836 2009-11-03 Ian Lance Taylor <iant@google.com>
4839 * defstd.cc (in_section): Add entries for __rel_iplt_start,
4840 __rel_iplt_end, __rela_iplt_start, __rela_iplt_end, and __stack.
4842 2009-11-03 Ian Lance Taylor <iant@google.com>
4845 * po/Make-in ($(srcdir)/$(PACKAGE).pot): Pass -C and
4846 --msgid-bugs-address.
4847 (install-pdf): New target.
4848 (install-data_yes): Look up one directory to find mkinstalldirs.
4850 2009-11-03 H.J. Lu <hongjiu.lu@intel.com>
4852 * po/Make-in (.po.gmo): Don't generate .gmo files in source
4855 2009-10-30 Doug Kwan <dougkwan@google.com>
4857 * arm.cc (Stub_addend_reader): Fix bug in previouls check-in.
4859 2009-10-30 Doug Kwan <dougkwan@google.com>
4861 * arm.cc (Stub_addend_reader): New struct template definition
4862 and partial specializations.
4863 (Stub_addend_reader::operator()): New method definition for a
4864 partially specialized template.
4866 2009-10-30 Doug Kwan <dougkwan@google.com>
4868 * arm.cc (Arm_relobj::processor_specific_flags): New method
4870 (Arm_relobj::do_read_symbols): New method declaration.
4871 (Arm_relobj::processor_specific_flags_): New data member declaration.
4872 (Arm_dynobj): New class definition.
4873 (Target_arm::do_finalize_sections): Add input_objects parameter.
4874 (Target_arm::do_adjust_elf_header): New method declaration.
4875 (Target_arm::are_eabi_versions_compatible,
4876 (Target_arm::merge_processor_specific_flags): New method declaration.
4877 (Target_arm::do_make_elf_object): New overloaded method definitions
4879 (Arm_relobj::do_read_symbols): New method definition.
4880 (Arm_dynobj::do_read_symbols): Ditto.
4881 (Target_arm::do_finalize_sections): Add input_objects parameters.
4882 Merge processor-specific flags from all input objects.
4883 (Target_arm::are_eabi_versions_compatible,
4884 Target_arm::merge_processor_specific_flags,
4885 Target_arm::do_adjust_elf_header, Target_arm::do_make_elf_object):
4886 New method definitions.
4887 * i386.cc (Target_i386::do_finalize_sections): Add unnamed
4888 Input_objects pointer type parameter.
4889 * layout.cc (Layout::finalize): Pass input objects to target's.
4890 finalize_sections function.
4891 * output.cc (Output_file_header::do_sized_write): Set ELF file
4892 header's processor-specific flags.
4893 * powerpc.cc (Target_powerpc::do_finalize_sections): Add unnamed
4894 Input_objects pointer type parameter.
4895 * sparc.cc (Target_sparc::do_finalize_sections): Same.
4896 * target.h (Input_objects): New forward class declaration.
4897 (Target::processor_specific_flags,
4898 Target::are_processor_specific_flags_sect): New method definitions.
4899 (Target::finalize_sections): Add input_objects parameter.
4900 (Target::Target): Initialize processor_specific_flags_ and
4901 are_processor_specific_flags_set_.
4902 (Target::do_finalize_sections): Add unnamed Input_objects pointer type
4904 (Target::set_processor_specific_flags): New method definition.
4905 (Target::processor_specific_flags_,
4906 Target::are_processor_specific_flags_set_): New data member
4908 * x86_64.cc (Target_x86_64::do_finalize_sections): Add unnamed
4909 Input_objects pointer type parameter.
4911 2009-10-30 Doug Kwan <dougkwan@google.com>
4913 * arm.cc: Use Arm_address instead of elfcpp::Elf_types<32>::Elf_Addr.
4915 2009-10-28 Ian Lance Taylor <iant@google.com>
4917 * object.h (class Relobj): Drop options parameter from
4918 gc_process_relocs, scan_relocs, relocate, do_gc_process_relocs,
4919 do_scan_relocs, do_relocate. Change all callers.
4920 (class Sized_relobj): Drop options parameters from
4921 do_gc_process_relocs, do_scan_relocs, do_relocate,
4922 do_relocate_sections, relocate_sections, emit_relocs_scan,
4923 emit_relocs_scan_reltype. Change all callers.
4924 (struct Relocate_info): Remove options field and all references to
4926 * reloc.h (class Read_relocs): Remove options constructor
4927 parameter and options_ field. Change all callers.
4928 (class Gc_process_relocs, class Scan_relocs): Likewise.
4929 (class Relocate_task): Likewise.
4930 * target-reloc.h (scan_relocs): Remove options parameter. Change
4932 (scan_relocatable_relocs): Likewise.
4933 * target.h (class Sized_target): Remove options parameter from
4934 gc_process_relocs, scan_relocs, scan_relocatable_relocs. Change
4936 * gc.h (gc_process_relocs): Remove options parameter. Change all
4938 * arm.cc: Update functions to remove options parameters.
4939 * i386.cc: Likewise.
4940 * powerpc.cc: Likewise.
4941 * sparc.cc: Likewise.
4942 * x86_64.cc: Likewise.
4943 * testsuite/testfile.cc: Likewise.
4945 2009-10-28 Doug Kwan <dougkwan@google.com>
4947 * arm.cc (Arm_relobj): New class definition.
4948 (Arm_relobj::scan_sections_for_stubs,
4949 Arm_relobj::do_count_local_symbols, Arm_relobj::do_relocate_sections):
4950 New method definitions.
4952 2009-10-28 Cary Coutant <ccoutant@google.com>
4954 * plugin.h (Plugin::Plugin): Initialize cleanup_done_.
4955 (Plugin::cleanup_done_): New member.
4956 (Plugin_manager::Plugin_manager): Remove cleanup_done_.
4957 (Plugin_manager::cleanup_done_): Remove.
4958 (Plugin_manager::add_input_file): Edit error message.
4959 * plugin.cc (Plugin::cleanup): Test and set cleanup_done_.
4960 (Plugin_manager::cleanup): Remove use of cleanup_done_.
4962 2009-10-27 Mikolaj Zalewski <mikolajz@google.com>
4964 * fileread.cc: (File_read::View::~View): Use the new
4965 data_ownership_ filed.
4966 (File_read::~File_read): Dispose the new whole_file_view_.
4967 (File_read::open): Mmap the whole file if needed.
4968 (File_read::open): Use whole_file_view_ instead of contents_.
4969 (File_read::find_view): Use whole_file_view_ if applicable.
4970 (File_read::do_read): Use whole_file_view_ instead of contents_.
4971 (File_read::make_view): Use whole_file_view_ instead of contents_,
4972 update File_read::View::View call.
4973 (File_read::find_or_make_view): Update File_read::View::View
4975 * fileread.h: (File_read::File_read): Initialize whole_file_view_,
4977 (File_read::View::Data_ownership): New enum.
4978 (File_read::View::View): Replace bool mapped_ with Data_ownership
4980 (File_read::View::mapped_): Remove (replaced by data_ownership_).
4981 (File_read::View::data_ownership_): New field.
4982 (File_read::contents_): Remove (replaced by whole_file_view_).
4983 (File_read::whole_file_view_): New field.
4984 * options.h (class General_options): Add --keep-files-mapped.
4986 2009-10-27 Cary Coutant <ccoutant@google.com>
4988 * symtab.cc (add_from_pluginobj): Pass correct value for is_ordinary.
4989 * testsuite/Makefile.am (plugin_test_5): New test case.
4990 * testsuite/Makefile.in: Regenerate.
4992 2009-10-25 Doug Kwan <dougkwan@google.com>
4994 * object.h (Sized_relobj::View_size, Sized_relobj::Views): Change
4995 from private to protected to allow access by child class.
4996 (Sized_relobj::do_relocate_sections): New method declaration.
4997 (Sized_relobj::relocate_sections): Virtualize.
4998 * reloc.cc (Sized_relobj::do_relocate_sections): Rename from
4999 Sized_relobj::relocate_sections. Instantiate template explicitly
5000 for different target sizes and endianity.
5002 2009-10-24 Doug Kwan <dougkwan@google.com>
5004 * arm.cc (Arm_output_section, Arm_relobj): Forward class declarations.
5005 (Arm_input_section::as_arm_input_section): New method.
5006 (Arm_output_section): New class definition.
5007 (Arm_output_section::create_stub_group,
5008 Arm_output_section::group_sections): New method definitions.
5010 2009-10-22 Doug Kwan <dougkwan@google.com>
5012 * arm.cc (Arm_input_section): New class definition.
5013 (Arm_input_section::init, Arm_input_section:do_write,
5014 Arm_input_section::set_final_data_size,
5015 Arm_input_section::do_reset_address_and_file_offset): New method
5018 2009-10-21 Doug Kwan <dougkwan@google.com>
5020 * arm.cc (Stub_table, Arm_input_section): New forward class
5022 (Stub_table): New class defintion.
5023 (Stub_table::add_reloc_stub, Stub_table::relocate_stubs
5024 Stub_table::do_reset_address_and_file_offset, Stub_table::do_write):
5025 New method definition.
5027 2009-10-21 Doug Kwan <dougkwan@google.com>
5029 * arm.cc: Update copyright comments.
5030 (Target_arm): New forward class template declaration.
5031 (Arm_address): New type.
5032 (ARM_MAX_FWD_BRANCH_OFFSET, ARM_MAX_BWD_BRANCH_OFFSET,
5033 THM_MAX_FWD_BRANCH_OFFSET, THM_MAX_BWD_BRANCH_OFFSET,
5034 THM2_MAX_FWD_BRANCH_OFFSET, THM2_MAX_BWD_BRANCH_OFFSET): New
5036 (Insn_template): Same.
5037 (DEF_STUBS): New macro.
5038 (Stub_type): New enum type.
5039 (Stub_template): New class definition.
5042 (Stub_factory): Same.
5043 (Target_arm::Target_arm): Initialize may_use_blx_ and
5044 should_force_pic_veneer_.
5045 (Target_arm::may_use_blx, Target_arm::set_may_use_blx,
5046 Target_arm::should_force_pic_veneer,
5047 Target_arm::set_should_force_pic_veneer, Target_arm::using_thumb2,
5048 Target_arm::using_thumb_only, Target_arm:;default_target): New
5050 (Target_arm::may_use_blx_, Target_arm::should_force_pic_veneer_):
5051 New data member declarations.
5052 (Insn_template::size, Insn_template::alignment): New method defintions.
5053 (Stub_template::Stub_template): New method definition.
5054 (Reloc_stub::Key::name, Reloc_stub::stub_type_for_reloc,
5055 Reloc_stub::do_fixed_endian_write, Reloc_stub::do_write): Same.
5056 (Stub_factory::Stub_factory): New method definition.
5057 * gold.h (string_hash): New template.
5058 * output.h (Input_section_specifier::hash_value): Use
5060 (Input_section_specifier::string_hash): Remove.
5061 * stringpool.cc (Stringpool_template::string_hash): Use
5064 2009-10-20 Doug Kwan <dougkwan@google.com>
5066 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle section
5067 symbols of relaxed input sections.
5068 * output.h (Output_section::find_relaxed_input_section): Make
5071 2009-10-16 Doug Kwan <dougkwan@google.com>
5073 * dynobj.cc (Versions::Versions): Initialize version_script_.
5074 Only insert base version symbol definition for a shared object
5075 if version script defines any version versions.
5076 (Versions::define_base_version): New method definition.
5077 (Versions::add_def): Check that base version is not needed.
5078 (Versions::add_need): Define base version lazily.
5079 * dynobj.h (Versions::define_base_version): New method declaration.
5080 (Versions::needs_base_version_): New data member declaration.
5081 * testsuite/Makefile.am (check_SCRIPTS): Add no_version_test.sh
5082 (check_DATA): Add no_version_test.stdout.
5083 (libno_version_test.so, no_version_test.o no_version_test.stdout):
5085 * testsuite/Makefile.in: Regenerate.
5086 * testsuite/no_version_test.c: New file.
5087 * testsuite/no_version_test.sh: Ditto.
5089 2009-10-16 Doug Kwan <dougkwan@google.com>
5091 * expression.cc (class Segment_start_expression): New class definition.
5092 (Segment_start_expression::value): New method definition.
5093 (script_exp_function_segment_start): Return a new
5094 Segment_start_expression.
5095 * gold/script-c.h (script_saw_segment_start_expression): New function
5097 * script-sections.cc (Script_sections::Script_sections): Initialize
5098 SAW_SEGMENT_START_EXPRESSION_ to false.
5099 (Script_sections::set_section_addresses): Use -Ttext, -Tdata
5100 and -Tbbs options to specify section addresses if given in
5101 command line and no SEGMENT_START expression is seen in a script.
5102 * script-sections.h (Script_sections::saw_segment_start_expression,
5103 Script_sections::set_saw_segment_start_expression): New method
5105 (Script_sections::saw_segment_start_expression_): New data member
5107 * script.cc (script_saw_segment_start_expression): New function.
5108 * yyscript.y (SEGMENT_START): Call script_saw_segment_start_expression.
5109 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_6.sh,
5110 script_test_7.sh and script_test_8.sh.
5111 (check_DATA): Add script_test_6.stdout, script_test_7.stdout and
5112 script_test_8.stdout.
5113 (MOSTLYCLEANFILES): Add script_test_6, script_test_7 and script_test_8.
5114 (script_test_6, script_test_6.stdout, script_test_7,
5115 script_test_7.stdout, script_test_8, script_test_8.stdout): New rules.
5116 * Makefile.in: Regenerate.
5117 * testsuite/script_test_6.sh: New file.
5118 * testsuite/script_test_6.t: Same.
5119 * testsuite/script_test_7.sh: Same.
5120 * testsuite/script_test_7.t: Same.
5121 * testsuite/script_test_8.sh: Same.
5123 2009-10-16 Doug Kwan <dougkwan@google.com>
5125 * output.cc (Output_segment::set_section_list_address): Cast
5126 expressions to unsigned long long type to avoid format warnings.
5128 2009-10-15 Ian Lance Taylor <iant@google.com>
5130 * script.cc (Script_options::add_symbol_assignment): Always add a
5131 dot assignment to script_sections_.
5132 * script-sections.cc (Script_sections::add_dot_assignment):
5133 Initialize if necessary.
5135 * layout.cc (Layout::relaxation_loop_body): Don't crash if we see
5136 program headers with no load segment if there is a linker script.
5138 * layout.cc (Layout::set_segment_offsets): Align the file offset
5139 to the segment aligment for -N or -n with no load segment.
5140 * output.cc (Output_segment::add_output_section): Don't crash if
5141 the first section is a TLS section.
5142 (Output_segment::set_section_list_addresses): Print an error
5143 message if the address moves backward in a linker script.
5144 * script-sections.cc
5145 (Output_section_element_input::set_section_addresses): Don't
5146 increase *dot_value for a SHF_TLS/SHT_NOBITS section.
5147 (Orphan_output_section::set_section_addresses): Likewise.
5149 2009-10-15 Doug Kwan <dougkwan@google.com>
5151 * layout.cc (Layout::finish_dynamic_section): Generate tags
5152 DT_FINI_ARRAY, DT_FINI_ARRAYSZ, DT_INIT_ARRAY, DT_INIT_ARRAYSZ,
5153 DT_PREINIT_ARRAY, DT_PREINIT_ARRAYSZ as needed. If -Bsymbolic is
5154 used, add DT_SYMBOLIC and set DF_SYMBOLIC in DT_FLAGS.
5156 2009-10-14 Ian Lance Taylor <iant@google.com>
5158 * object.h (class Relocate_info): Add reloc_shdr and data_shdr
5160 * object.cc (Sized_relobj::relocate_sections): Set reloc_shdr and
5161 data_shdr fields of relinfo.
5162 * i386.cc (class Target_i386::Relocate): Remove ldo_addrs_ field.
5163 (Target_i386::Relocate::relocate_tls): Don't call fix_up_ldo. For
5164 R_386_TLS_LDO_32, adjust based on section flags.
5165 (Target_i386::Relocate::fix_up_ldo): Remove.
5167 2009-10-13 Ian Lance Taylor <iant@google.com>
5169 Add support for -pie.
5170 * options.h (class General_options): Add -pie and
5172 (General_options::output_is_position_independent): Test -pie.
5173 (General_options::output_is_executable): Return true if not shared
5174 and not relocatable.
5175 (General_options::output_is_pie): Remove.
5176 * options.cc (General_options::finalize): Reject incompatible uses
5178 * gold.cc (queue_middle_tasks): A -pie link is not static.
5179 * symtab.h (Symbol::needs_plt_entry): Return false if -pie.
5180 * symtab.cc (Symbol::final_value_is_known): Return false if
5181 output_is_position_independent.
5182 * layout.cc (Layout::set_segment_offsets): Start at address 0 if
5183 output_is_position_independent.
5184 * output.cc (Output_file_header::do_sized_write): Use ET_DYN if
5185 output_is_position_independent.
5186 * i386.cc (Output_data_plt_i386::do_write): Use the PIC PLT if
5187 output_is_position_independent.
5188 * testsuite/Makefile.am (check_PROGRAMS): Add basic_pie_test and
5190 (basic_pie_test.o, basic_pie_test): New targets.
5191 (two_file_test_1_pie.o, two_file_test_1b_pie.o): New targets.
5192 (two_file_test_2_pie.o, two_file_test_main_pie.o): New targets.
5193 (two_file_pie_test): New target.
5194 * testsuite/Makefile.in: Rebuild.
5195 * README: Remove note saying that -pie is not supported.
5197 2009-10-13 Bernhard Reutner-Fischer <aldot@gcc.gnu.org>
5199 * options.h (class General_options): Add -init and -fini.
5200 * layout.cc (Layout::finish_dynamic_section): Emit
5201 given init and fini functions.
5203 2009-10-13 Sriraman Tallam <tmsriram@google.com>
5205 * gc.h (gc_process_relocs): Check if icf is enabled using new
5207 * gold.cc (queue_initial_tasks): Likewise.
5208 (queue_middle_tasks): Likewise.
5209 * object.cc (do_layout): Likewise.
5210 * symtab.cc (is_section_folded): Likewise.
5211 * main.cc (main): Likewise.
5212 * reloc.cc (Read_relocs::run): Likewise.
5213 (Sized_relobj::do_scan_relocs): Likewise.
5214 * icf.cc (is_function_ctor_or_dtor): New function.
5215 (Icf::find_identical_sections): Check if function is ctor or dtor when
5217 * options.h (General_options::icf): Change option to be an enum.
5218 (Icf_status): New enum.
5219 (icf_enabled): New method.
5220 (icf_safe_folding): New method.
5221 (set_icf_status): New method.
5222 (icf_status_): New variable.
5223 * (options.cc) (General_options::finalize): Set icf_status_.
5224 * testsuite/Makefile.am: Add commands to build icf_safe_test. Modify
5225 icf_test and icf_keep_unique_test to use the --icf enum flag.
5226 * testsuite/icf_safe_test.sh: New file.
5227 * testsuite/icf_safe_test.cc: New file.
5229 2009-10-12 Sriraman Tallam <tmsriram@google.com>
5231 * symtab.h: Check for GOLD_SYMTAB_H before header includes. Remove
5232 includes to gc.h and icf.h.
5233 * arm.cc: Include gc.h.
5234 * gold.cc: Likewise.
5235 * i386.cc: Likewise.
5236 * powerpc.cc: Likewise.
5237 * sparc.cc: Likewise.
5238 * x86_64.cc: Likewise.
5239 * gc.h: Include icf.h.
5241 2009-10-11 Ian Lance Taylor <iant@google.com>
5243 * plugin.cc: Include "gold.h" before other header files.
5245 2009-10-10 Chris Demetriou <cgd@google.com>
5247 * options.h (Input_file_argument::Input_file_type): New enum.
5248 (Input_file_argument::is_lib_): Replace with...
5249 (Input_file_argument::type_): New member.
5250 (Input_file_argument::Input_file_argument): Take Input_file_type
5251 'type' rather than boolean 'is_lib' as second argument.
5252 (Input_file_argument::is_lib): Use type_.
5253 (Input_file_argument::is_searched_file): New function.
5254 (Input_file_argument::may_need_search): Handle is_searched_file.
5255 * options.cc (General_options::parse_library): Support -l:filename.
5256 (General_options::parse_just_symbols): Update for Input_file_argument
5258 (Command_line::process): Likewise.
5259 * archive.cc (Archive::get_file_and_offset): Likewise.
5260 * plugin.cc (Plugin_manager::release_input_file): Likewise.
5261 * script.cc (read_script_file, script_add_file): Likewise.
5262 * fileread.cc (Input_file::Input_file): Likewise.
5263 (Input_file::will_search_for): Handle is_searched_file.
5264 (Input_file::open): Likewise.
5265 * readsyms.cc (Read_symbols::get_name): Likewise.
5266 * testsuite/Makefile.am (searched_file_test): New test.
5267 * testsuite/Makefile.in: Regenerate.
5268 * testsuite/searched_file_test.cc: New file.
5269 * testsuite/searched_file_test_lib.cc: New file.
5271 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5272 Ian Lance Taylor <iant@google.com>
5274 * descriptor.cc: Include <cstdio> and "binary-io.h".
5275 (Descriptors::open): Open the files in binary mode always.
5276 * script.cc (Lex::get_token): Treat \r as whitespace.
5278 2009-10-09 Ian Lance Taylor <iant@google.com>
5280 * testsuite/retain_symbols_file_test.sh: Don't test for __tcf_0.
5282 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5283 Ian Lance Taylor <iant@google.com>
5285 * configure.ac: Check for readv function also.
5286 * fileread.cc (readv): Define if not HAVE_READV.
5287 * fileread.h (File_read:: max_readv_entries): Set to 1 if readv
5289 * config.in: Regenerate.
5290 * configure: Regenerate.
5292 2009-10-09 Doug Kwan <dougkwan@google.com>
5294 * layout.cc (Layout::make_output_section): Call target hook to make
5295 ordinary output section.
5296 (Layout::finalize): Adjust parameter list of call the
5297 Target::may_relax().
5298 * layout.h (class Layout::section_list): New method.
5299 * merge.h (Output_merge_base::entsize): Change visibility to public.
5300 (Output_merge_base::is_string, Output_merge_base::do_is_string):
5302 (Output_merge_string::do_is_string): New method.
5303 * object.cc (Sized_relobj::do_setup): renamed from
5304 Sized_relobj::set_up.
5305 * object.h (Sized_relobj::adjust_shndx,
5306 Sized_relobj::initializ_input_to_output_maps,
5307 Sized_relobj::free_input_to_output_maps): Change visibilities to
5309 (Sized_relobj::setup): Virtualize.
5310 (Sized_relobj::do_setup): New method declaration.
5311 (Sized_relobj::invalidate_section_offset,
5312 Sized_relobj::do_invalidate_section_offset): New method decfinitions.
5313 (Sized_relobj::elf_file, Sized_relobj::local_values): New methods.
5314 * options.cc (parse_int): New function.
5315 * options.h (parse_int): New declaration.
5316 (DEFINE_int): New macro.
5317 (stub_group_size): New option.
5318 * output.cc (Output_section::Output_section): Initialize memebers
5319 merge_section_map_, merge_section_by_properties_map_,
5320 relaxed_input_section_map_, is_relaxed_input_section_map_valid_.
5321 (Output_section::add_input_section): Handled deferred code-fill
5322 generation and remove an old comment.
5323 (Output_section::add_relaxed_input_section): New method definition.
5324 (Output_section::add_merge_input_section): Use merge section by
5325 properties map to speed to search. Update merge section maps
5327 (Output_section::build_relaxation_map): New method definition.
5328 (Output_section::convert_input_sections_in_list_to_relaxed_sections):
5330 (Output_section::relax_input_section): Renamed to
5331 Output_section::convert_input_sections_to_relaxed_sections and change
5332 interface to take a vector of pointers to relaxed sections.
5333 (Output_section::find_merge_section,
5334 Output_section::find_relaxed_input_section): New method definitions.
5335 (Output_section::is_input_address_mapped,
5336 Output_section::output_offset, Output_section::output_address):
5337 Use output section data maps to speed up searching.
5338 (Output_section::find_starting_output_address): Add comments.
5339 (Output_section::do_write,
5340 Output_section::write_to_postprocessing_buffer): Do code-fill
5341 generation as appropriate.
5342 (Output_section::get_input_sections): Invalidate relaxed input section
5344 (Output_section::restore_states): Adjust type of checkpoint .
5345 Invalidate relaxed input section map.
5346 * output.h (Output_merge_base): New class declaration.
5347 (Input_section_specifier): New class defintion.
5348 (class Output_relaxed_input_section) Change base class to
5349 Output_section_data_build.
5350 (Output_relaxed_input_section::Output_relaxed_input_section): Adjust
5351 base class initializer.
5352 (Output_section::add_relaxed_input_section): New method declaration.
5353 (Output_section::Input_section): Change visibility to protected.
5354 (Output_section::Input_section::relobj,
5355 Output_section::Input_section::shndx): Handle relaxed input sections.
5356 Output_section::input_sections) Change visibility to protected. Also
5357 define overload to return a non-const pointer.
5358 (Output_section::Merge_section_properties): New class defintion.
5359 (Output_section::Merge_section_by_properties_map,
5360 Output_section::Output_section_data_by_input_section_map,
5361 Output_section::Relaxation_map): New types.
5362 (Output_section::relax_input_section): Rename method to
5363 Output_section::convert_input_sections_to_relaxed_sections and change
5364 interface to take a vector of relaxed section pointers.
5365 (Output_section::find_merge_section,
5366 Output_section::find_relaxed_input_section,
5367 Output_section::build_relaxation_map,
5368 Output_section::convert_input_sections_in_list_to_relaxed_sections):
5369 New method declarations.
5370 (Output_section::merge_section_map_
5371 Output_section::merge_section_by_properties_map_,
5372 Output_section::relaxed_input_section_map_,
5373 Output_section::is_relaxed_input_section_map_valid_,
5374 Output_section::generate_code_fills_at_write_): New data members.
5375 * script-sections.cc
5376 (Output_section_element_input::set_section_addresses): Call
5377 current_data_size and addralign methods of relaxed input sections.
5378 (Orphan_output_section::set_section_addresses): Call current_data_size
5379 and addralign methods of relaxed input sections.
5380 * symtab.cc (Symbol_table::compute_final_value): Extract template
5381 from the body of Symbol_table::sized_finalize_symbol.
5382 (Symbol_table::sized_finalized_symbol): Call
5383 Symbol_table::compute_final_value.
5384 * symtab.h (Symbol_table::Compute_final_value_status): New enum type.
5385 (Symbol_table::compute_final_value): New templated method declaration.
5386 * target.cc (Target::do_make_output_section): New method defintion.
5387 * target.h (Target::make_output_section): New method declaration.
5388 (Target::relax): Add more parameters for input objects, symbol table
5389 and layout. Adjust call to do_relax.
5390 (Target::do_make_output_section): New method declaration.
5391 (Target::do_relax): Add parameters for input objects, symbol table
5394 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5396 * pread.c: Include stdio.h.
5398 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5400 * plugin.cc: Don't include dlfcn.h when ENABLE_PLUGINS is not
5403 2009-10-09 Andrew Pinski <andrew_pinski@playstation.sony.com>
5405 * dwarf_reader.cc (Sized_dwarf_line_info::Sized_dwarf_line_info):
5406 Change read_shndx type to unsigned int.
5407 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
5409 (Sized_dwarf_line_info::read_line_mappings): Likewise.
5410 * dwarf_reader.h (Sized_dwarf_line_info::Sized_dwarf_line_info):
5411 Change read_shndx type to unsigned int.
5412 (Sized_dwarf_line_info::read_lines): Change shndx type to unsigned
5414 (Sized_dwarf_line_info::read_line_mappings): Likewise.
5415 * layout.cc (Layout::create_symtab_sections): Cast the result of
5416 local_symcount * symsize to off_t in the gold_assert.
5418 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5420 * arm.cc (Target_arm::relocate::reloc_is_non_pic): Return true for
5421 R_ARM_THM_ABS5, R_ARM_ABS8, R_ARM_ABS12, R_ARM_ABS16,
5423 (Arm_relocate_functions::abs8): Remove has_thumb_bit parameter.
5424 (Arm_relocate_functions::thm_abs5): New function.
5425 (Arm_relocate_functions::abs12): New function.
5426 (Arm_relocate_functions::abs16): New function.
5427 (Arm_relocate_functions::base_abs): New function.
5428 (Scan::check_non_pic): Handle R_ARM_ABS32_NOI.
5429 (Scan::local): Remove special handling of R_ARM_ABS8. Handle
5430 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, R_ARM_ABS12, R_ARM_ABS16, and
5432 (Scan::global): Likewise.
5433 (Relocate::relocate): Handle R_ARM_ABS12, R_ARM_ABS16,
5434 R_ARM_ABS32_NOI, R_ARM_THM_ABS5, and R_ARM_BASE_ABS.
5435 (Relocatable_size_for_reloc::get_size_for_reloc): Handle
5436 R_ARM_ABS16, R_ARM_THM_ABS5, R_ARM_ABS32_NOI, R_ARM_ABS12, and
5439 2009-10-09 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5441 * arm.cc (Arm_relocate_functions::movw_prel_nc): New function.
5442 (Arm_relocate_functions::movt_prel): New function.
5443 (Arm_relocate_functions::thm_movw_prel_nc): New function.
5444 (Arm_relocate_functions::thm_movt_prel): New function.
5445 (Scan::local): Handle R_ARM_MOVW_PREL_NC, R_ARM_MOVT_PREL,
5446 R_ARM_THM_MOVW_PREL_NC, and R_ARM_THM_MOVT_PREL.
5447 (Scan::global, Relocate::relocate): Likewise.
5448 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5450 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
5452 * gold.cc: (queue_initial_tasks): Pass incremental_inputs to
5453 Incremental_checker.
5454 * incremental.cc: (INCREMENTAL_LINK_VERSION): Change type to
5456 (class Incremental_inputs_header): New class.
5457 (Incremental_inputs_header_writer): Edit comment.
5458 (Incremental_inputs_entry): New class.
5459 (Incremental_inputs_entry_writer): Edit comment.
5460 (Sized_incremental_binary::do_find_incremental_inputs_section):
5461 Add *strtab_shndx parameter, fill it.
5462 (Sized_incremental_binary::do_check_inputs): New method.
5463 (Incremental_checker::can_incrementally_link_output_file): Use
5464 Sized_incremental_binary::check_inputs.
5465 (Incremental_inputs::report_command_line): Save command line in
5468 (Incremental_binary::find_incremental_inputs_section): New
5470 (Incremental_binary::do_find_incremental_inputs_section): Add
5471 strtab_shndx parameter.
5472 (Incremental_binary::do_check_inputs): New pure virtual method.
5473 (Sized_incremental_binary::do_check_inputs): Declare.
5474 (Incremental_checker::Incremental_checker): Add incremental_inputs
5475 parameter, use it to initialize incremental_inputs_.
5476 (Incremental_checker::incremental_inputs_): New field.
5477 (Incremental_checker::command_line): New method.
5478 (Incremental_checker::inputs): New method.
5479 (Incremental_checker::command_line_): New field.
5481 2009-10-09 Mikolaj Zalewski <mikolajz@google.com>
5483 * incremental.cc: Include <cstdarg> and "target-select.h".
5484 (vexplain_no_incremental): New function.
5485 (explain_no_incremental): New function.
5486 (Incremental_binary::error): New method.
5487 (Sized_incremental_binary::do_find_incremental_inputs_section): New
5489 (make_sized_incremental_binary): New function.
5490 (open_incremental_binary): New function.
5491 (can_incrementally_link_file): Add checks if output is ELF and has
5493 * incremental.h: Include "elfcpp_file.h" and "output.h".
5494 (Incremental_binary): New class.
5495 (Sized_incremental_binary): New class.
5496 (open_incremental_binary): Declare.
5497 * object.cc (is_elf_object): Use
5498 elfcpp::Elf_recognizer::is_elf_file.
5499 (make_elf_object): Use elfcpp::Elf_recognizer::is_valid_header.
5500 * output.h (Output_file::filesize): New method.
5502 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5504 * arm.cc (Arm_relocate_functions::extract_arm_movw_movt_addend):
5506 (Arm_relocate_functions::insert_val_arm_movw_movt): New function.
5507 (Arm_relocate_functions::extract_thumb_movw_movt_addend): New
5509 (Arm_relocate_functions::insert_val_thumb_movw_movt): New
5511 (Arm_relocate_functions::movw_abs_nc): New function.
5512 (Arm_relocate_functions::movt_abs): New function.
5513 (Arm_relocate_functions::thm_movw_abs_nc): New function.
5514 (Arm_relocate_functions::thm_movt_abs): New function.
5515 (Scan::local): Handle R_ARM_MOVW_ABS_NC, R_ARM_MOVT_ABS,
5516 R_ARM_THM_MOVW_ABS_NC, R_ARM_THM_MOVT_ABS.
5517 (Scan::global): Likewise.
5518 (Relocate::relocate): Likewise.
5519 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5521 2009-10-07 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5523 * arm.cc (Arm_relocate_functions::got_prel) New function.
5524 (Scan::local, Scan::global): Handle R_ARM_GOT_PREL.
5525 (Relocate::relocate): Likewise.
5526 (Relocatable_size_for_reloc::get_size_for_reloc): Likewise.
5528 2009-10-06 Ian Lance Taylor <iant@google.com>
5530 * options.h (class General_options): Define
5531 split_stack_adjust_size parameter.
5532 * object.h (class Object): Add uses_split_stack_ and
5533 has_no_split_stack_ fields. Add uses_split_stack and
5534 has_no_split_stack accessor functions. Declare
5535 handle_split_stack_section.
5536 (class Reloc_symbol_changes): Define.
5537 (class Sized_relobj): Define Function_offsets. Declare
5538 split_stack_adjust, split_stack_adjust_reltype, and
5540 * object.cc (Object::handle_split_stack_section): New function.
5541 (Sized_relobj::do_layout): Call handle_split_stack_section.
5542 * dynobj.cc (Sized_dynobj::do_layout): Call
5543 handle_split_stack_section.
5544 * reloc.cc (Sized_relobj::relocate_sections): Call
5545 split_stack_adjust for executable sections in split_stack
5546 objects. Pass reloc_map to relocate_section.
5547 (Sized_relobj::split_stack_adjust): New function.
5548 (Sized_relobj::split_stack_adjust_reltype): New function.
5549 (Sized_relobj::find_functions): New function.
5550 * target-reloc.h: Include "object.h".
5551 (relocate_section): Add reloc_symbol_changes parameter. Change
5553 * target.h (class Target): Add calls_non_split method. Declare
5554 do_calls_non_split virtual method. Declare match_view and
5556 * target.cc: Include "elfcpp.h".
5557 (Target::do_calls_non_split): New function.
5558 (Target::match_view): New function.
5559 (Target::set_view_to_nop): New function.
5560 * gold.cc (queue_middle_tasks): Give an error if mixing
5561 split-stack and non-split-stack objects with -r.
5562 * i386.cc (Target_i386::relocate_section): Add
5563 reloc_symbol_changes parameter.
5564 (Target_i386::do_calls_non_split): New function.
5565 * x86_64.cc (Target_x86_64::relocate_section): Add
5566 reloc_symbol_changes parameter.
5567 (Target_x86_64::do_calls_non_split): New function.
5568 * arm.cc (Target_arm::relocate_section): Add reloc_symbol_changes
5570 * powerpc.cc (Target_powerpc::relocate_section): Add
5571 reloc_symbol_changes parameter.
5572 * sparc.cc (Target_sparc::relocate_section): Add
5573 reloc_symbol_changes parameter.
5574 * configure.ac: Call AM_CONDITIONAL for the default target.
5575 * configure: Rebuild.
5576 * testsuite/Makefile.am (TEST_AS): New variable.
5577 (check_SCRIPTS): Add split_i386.sh and split_x86_64.sh.
5578 (check_DATA): Add split_i386 and split_x86_64 files.
5579 (SPLIT_DEFSYMS): Define.
5580 (split_i386_[1234n].o): New targets.
5581 (split_i386_[124]): New targets.
5582 (split_i386_[1234r].stdout): New targets.
5583 (split_x86_64_[1234n].o): New targets.
5584 (split_x86_64_[124]): New targets.
5585 (split_x86_64_[1234r].stdout): New targets.
5586 (MOSTLYCLEANFILES): Add new executables.
5587 * testsuite/split_i386.sh: New file.
5588 * testsuite/split_x86_64.sh: New file.
5589 * testsuite/split_i386_1.s: New file.
5590 * testsuite/split_i386_2.s: New file.
5591 * testsuite/split_i386_3.s: New file.
5592 * testsuite/split_i386_4.s: New file.
5593 * testsuite/split_i386_n.s: New file.
5594 * testsuite/split_x86_64_1.s: New file.
5595 * testsuite/split_x86_64_2.s: New file.
5596 * testsuite/split_x86_64_3.s: New file.
5597 * testsuite/split_x86_64_4.s: New file.
5598 * testsuite/split_x86_64_n.s: New file.
5599 * testsuite/testfile.cc (Target_test): Update relocation_section
5601 * testsuite/Makefile.in: Rebuild.
5603 2009-10-06 Ian Lance Taylor <iant@google.com>
5605 * i386.cc (class Target_i386::Relocate): Add ldo_addrs_ field.
5606 (Target_i386::Relocate::relocate_tls): Call fix_up_ldo before
5607 changing local_dynamic_type_ from LOCAL_DYNAMIC_NONE. When
5608 handling R_386_TLS_LDO_32, if local_dynamic_type_ is NONE, push
5609 the address on ldo_addrs_.
5610 (Target_i386::Relocate::fix_up_ldo): New function.
5612 2009-10-06 Rafael Espindola <espindola@google.com>
5614 * plugin.cc (add_input_library): New.
5615 (Plugin::load): Add add_input_library to tv.
5616 (Plugin_manager::add_input_file): Add the is_lib argument.
5617 (add_input_file): Update call to Plugin_manager::add_input_file.
5618 (add_input_library): New.
5619 * plugin.h (Plugin_manager::add_input_file): Add the is_lib argument.
5621 2009-09-30 Doug Kwan <dougkwan@google.com>
5623 * arm.cc (Target_arm::may_need_copy_reloc): Check for THUMB function
5624 symbol and call Symbol::may_need_copy_reloc to determine if
5625 a copy reloc is needed.
5626 * copy-relocs.cc (Copy_relocs::need_copy_reloc): Return false if -z
5627 nocopyreloc is given in command line.
5628 (Copy_relocs::emit_copy_reloc): Assert that -z nocopyreloc is not
5629 given in command line.
5630 * i386.cc (Target_i386::may_need_copy_reloc): Remove.
5631 (Target_i386::Scan::global): Use Symbol::may_need_copy_reloc instead
5632 of the removed Target_i386::may_need_copy_reloc.
5633 * options.h (copyreloc): New option with default value false.
5634 * powerpc.cc (Target_powerpc::may_need_copy_reloc): Remove.
5635 (Target_powerpc::Scan::global): Use Symbol::may_need_copy_reloc
5636 instead of the removed Target_powerpc::may_need_copy_reloc.
5637 * sparc.cc (Target_powerpc::may_need_copy_reloc): Remove.
5638 (Target_sparc::Scan::global): Use Symbol::may_need_copy_reloc
5639 instead of the removed Target_sparc::may_need_copy_reloc.
5640 * symtab.h (Symbol::may_need_copy_reloc): New method definition.
5641 * x86_64.cc (Target_powerpc::may_need_copy_reloc): Remove.
5642 (Target_x86_64::Scan::global): Use Symbol::may_need_copy_reloc
5643 instead of the removed Target_x86_64::may_need_copy_reloc.
5645 2009-09-30 Ian Lance Taylor <iant@google.com>
5647 * object.h (class Object): Remove target_ field, and target,
5648 sized_target, and set_target methods.
5649 (Object::sized_target): Remove.
5650 (class Sized_relobj): Update declarations. Remove sized_target.
5651 * object.cc (Sized_relobj::setup): Remove target parameter.
5653 (Input_objects::add_object): Don't do anything with the target.
5654 (make_elf_sized_object): Add punconfigured parameter. Change all
5655 callers. Set or test parameter target.
5656 * dynobj.cc (Sized_dynobj::target): Remove target parameter.
5658 * parameters.cc (Parameters::set_target): Change parameter type to
5660 (Parameters::default_target): Remove.
5661 (set_parameters_target): Change parameter type to be non-const.
5662 (parameters_force_valid_target): New function.
5663 (parameters_clear_target): New function.
5664 * parameters.h (class Parameters): Update declarations. Remove
5665 default_target method. Add sized_target and clear_target
5666 methods. Change target_ to be non-const.
5667 (set_parameters_target): Update declaration.
5668 (parameters_force_valid_target): Declare.
5669 (parameters_clear_target): Declare.
5670 * readsyms.cc (Read_symbols::do_read_symbols): Pass punconfigured
5671 as NULL if we aren't searching.
5672 (Add_symbols::run): Don't check for compatible target.
5673 * fileread.cc (Input_file::open_binary): Call
5674 parameters_force_valid_target.
5675 * gold.cc (queue_middle_tasks): Likewise.
5676 * plugin.cc (make_sized_plugin_object): Likewise. Don't call
5677 set_target on object.
5678 * dynobj.h (class Sized_dynobj): Update declarations.
5679 * archive.cc (Archive::get_elf_object_for_member): Return NULL if
5680 make_elf_object returns NULL.
5681 (Archive::include_member): Don't check whether object target is
5683 * output.cc (Output_section::add_input_section): Get target from
5685 (Output_section::relax_input_section): Likewise.
5686 * reloc.cc (Sized_relobj::do_gc_process_relocs): Get target from
5688 (Sized_relobj::do_scan_relocs): Likewise.
5689 (Sized_relobj::relocate_sections): Likewise.
5690 * resolve.cc (Symbol_table::resolve): Likewise.
5691 * symtab.cc (Symbol_table::wrap_symbol): Likewise. Remove object
5692 parameter. Change all callers.
5693 (Symbol_table::add_from_object): Get target from parameters.
5694 (Symbol_table::add_from_relobj): Don't check object target.
5695 (Symbol_table::add_from_dynobj): Likewise.
5696 (Symbol_table::define_special_symbol): Get target from
5698 * symtab.h (class Symbol_table): Update declaration.
5699 * testsuite/binary_unittest.cc (gold_testsuite): Remove target
5700 parameter. Change all callers. Clear parameter target.
5701 (Binary_test): Test target here.
5702 * testsuite/object_unittest.cc (gold_testsuite): Remove
5703 target_test_pointer parameter. Change all callers.
5704 (Object_test): Test target here.
5706 2009-09-26 Ian Lance Taylor <iant@google.com>
5708 * testsuite/initpri1.c: Don't try to use constructor priorities if
5709 compiling with gcc before 4.3.
5711 2009-09-22 Mikolaj Zalewski <mikolajz@google.com>
5713 * testsuite/retain_symbols_file_test.sh (check_present): Change
5714 output file name to retain_symbols_file_test.stdout.
5715 (check_absent): Likewise.
5717 2009-09-18 Craig Silverstein <csilvers@google.com>
5719 * object.cc (Sized_relobj::do_count): Test should_retain_symbol map.
5720 * options.cc: Include <cerrno> and <fstream>.
5721 (General_options::finalize): Parse -retain-symbols-file tag.
5722 * options.h: New flag.
5723 (General_options): New method should_retain_symbol, new
5724 variable symbols_to_retain.
5725 * symtab.cc (Symbol_table::sized_finalize_symbol): Test
5726 should_retain_symbol map.
5727 * testsuite/Makefile.am (retain_symbols_file_test): New test.
5728 * testsuite/Makefile.in: Regenerate.
5729 * testsuite/retain_symbols_file_test.sh: New file.
5731 2009-09-18 Nick Clifton <nickc@redhat.com>
5733 * po/es.po: Updated Spanish translation.
5735 2009-09-17 Doug Kwan <dougkwan@google.com>
5737 * debug.h (DEBUG_RELAXATION): New constant.
5738 (DEBUG_ALL): Add DEBUG_RELAXATION.
5739 (debug_string_to_enum): Add relaxation debug option.
5741 (Layout::Relaxation_debug_check::check_output_data_for_reset_values,
5742 Layout::Relaxation_debug_check::read_sections,
5743 Layout::Relaxation_debug_check::read_sections): New method definitions.
5744 (Layout::Layout): Initialize data members
5745 record_output_section_data_from_scrips_,
5746 script_output_section_data_list_ and relaxation_debug_check_.
5747 (Layout::save_segments, Layout::restore_segments,
5748 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
5749 Layout::relaxation_loop_body): New method definitions.
5750 (Layout::finalize): Support relaxation. Move section layout code to
5751 Layout::relaxation_loop_body.
5752 (Layout::set_asection_address_from_script): Move code for orphan
5753 section placement out.
5754 (Layout::place_orphan_sections_in_script): New method definition.
5755 * layout.h (Output_segment_headers, Output_file_header):
5756 New forward class declarations.
5757 (Layout::~Layout): Define.
5758 (Layout::new_output_section_data_from_script): New method definition.
5759 (Layout::place_orphan_sections_in_script): New method declaration.
5760 (Layout::Segment_states): New type declaration.
5761 (Layout::save_segments, Layout::restore_segments,
5762 Layout::clean_up_after_relaxation, Layout::prepare_for_relaxation,
5763 Layout::relaxation_loop_body): New method declarations.
5764 (Layout::Output_section_data_list): New type declaration.
5765 (Layout::Relaxation_debug_check): New class definition.
5766 (Layout::record_output_section_data_from_script_,
5767 Layout::script_output_section_data_list_, Layout::segment_states_,
5768 Layout::relaxation_debug_check_): New data members.
5769 * output.cc: (Output_section_headers::do_size): New method definition.
5770 (Output_section_headers::Output_section_headers): Move size
5771 computation to Output_section_headers::do_size.
5772 (Output_segment_headers::do_size): New method definition.
5773 (Output_file_header::Output_file_header): Move size computation to
5774 Output_file_header::do_size and call it.
5775 (Output_file_header::do_size): New method definition.
5776 (Output_data_group::Output_data_group): Adjust call to
5777 Output_section_data.
5778 (Output_data_dynamic::set_final_data_size): Add DT_NULL tag only once.
5779 (Output_symtab_xindex::do_write): Add array bound check.
5780 (Output_section::Input_section::print_to_mapfile): Handle
5781 RELAXED_INPUT_SECTION_CODE.
5782 (Output_section::Output_section): Initialize data member checkpoint_.
5783 (Output_section::~Output_section): Delete checkpoint object pointed
5785 (Output_section::add_input_section): Always add an Input_section if
5787 (Output_section::add_merge_input_section): Add assert.
5788 (Output_section::relax_input_section): New method definition.
5789 (Output_section::set_final_data_size): Set load address to zero for
5790 an unallocated section.
5791 (Output_section::do_address_and_file_offset_have_reset_values):
5792 New method definition.
5793 (Output_section::Input_section_sort_enty::Input_section_sort_enty):
5794 Handle relaxed input section.
5795 (Output_section::sort_attached_input_sections): Checkpoint input
5796 section list lazily.
5797 (Output_section::get_input_sections): Change type of input_sections to
5798 list of Simple_input_section pointers. Checkpoint input section list
5799 lazily. Also handle relaxed input sections.
5800 (Output_section::add_input_section_for_script): Take a reference to
5801 a Simple_input_section object instead of Relobj pointer and section
5802 index as parameter. Handle relaxed input sections.
5803 (Output_section::save_states, Output_section::restore_states): New
5805 * output.h (Output_data::Output_data): Initialize is_data_size_fixed_.
5806 (Output_data::is_data_size_fixed): New method definition.
5807 (Output_data::reset_addresss_and_file_offset): Do not reset data size
5809 (Output_data::address_and_file_offset_have_reset_values): New method
5811 (Output_data::do_address_and_file_offset_have_reset_values): New method
5813 (Output_data::set_data_size): Check that data size is not fixed.
5814 (Output_data::fix_data_size): New method definition.
5815 (Output_data::is_data_size_fixed_): New data member.
5816 (Output_section_headers::set_final_data_size): New method definition.
5817 (Output_section_headers::do_size): New method declaration.
5818 (Output_segment_headers::set_final_data_size): New method definition.
5819 (Output_segment_headers::do_size): New method declaration.
5820 (Output_file_header::set_final_data_size)::New method definition.
5821 (Output_file_header::do_size)::New method declaration.
5822 (Output_section_data::Output_section_data): Add new parameter
5823 is_data_size_fixed and use it to fix data size.
5824 (Output_data_const::Output_data_const): Adjust call to base class
5825 constructor and fix data size.
5826 (Output_data_const_buffer::Output_data_const_buffer): Adjust call to
5827 base class constructor and fix data size.
5828 (Output_data_fixed_space::Output_data_fixed_space): Adjust call to
5829 base class constructor and fix data size.
5830 (Output_data_zero_fill::Output_data_zero_fill): Adjust call to base
5831 class constructor and fix data size.
5832 (Output_data_group::set_final_data_size): New method definition.
5833 (Output_data_dynamic::Dynamic_entry::tag): New method definition.
5834 (Output_symtab_xindex::Output_symtab_xindex): Adjust call to base
5835 class constructor and fix data size.
5836 (Output_relaxed_input_section): New class definition.
5837 (Output_section::Simple_input_section): New class definition.
5838 (Output_section::get_input_sections): Adjust parameter list.
5839 (Output_section::add_input_section_for_script): Same.
5840 (Output_section::save_states, Output_section::restore_states,
5841 Output_section::do_address_and_file_offset_have_reset_values,
5842 (Output_section::Input_section::Input_section): Handle
5843 RELAXED_INPUT_SECTION_CODE. Add new overload for
5844 Output_relaxed_input_section.
5845 (Output_section::Input_section::is_input_section,
5846 Output_section::Input_section::set_output_section): Handle relaxed
5848 (Output_section::Input_section::is_relaxed_input_section,
5849 Output_section::Input_section::output_section_data,
5850 Output_section::Input_section::relaxed_input_section): New method
5852 (Output_section::Input_section::RELAXED_INPUT_SECTION_CODE): New enum
5854 (Output_section::Input_section::u1_): Update comments.
5855 (Output_section::Input_section::u2_): Add new union member poris.
5856 (Output_section::Checkpoint_output_section): New classs definition.
5857 (Output_section::relax_input_section): New method declaration.
5858 (Output_section::checkpoint_): New data member.
5859 (Output_segment): Update comments.
5860 (Output_segment::Output_segment): Un-privatize copy constructor.
5861 (Output_segment::operator=): Un-privatize.
5862 * script-sections.cc (Output_section_element::Input_section_list):
5863 Change element type to Output_section::Simple_input_section.
5864 (Output_section_element_dot_assignment::set_section_addresses):
5865 Register output section data for relaxation clean up.
5866 (Output_data_exression::Output_data_expression): Adjust call to base
5867 constructor to fix data size.
5868 (Output_section_element_data::set_section_addresses): Register
5869 Output_data_expression object for relaxation clean up.
5870 (struct Input_section_info): Replace Relobj pointer and section index
5871 pair with Output_section::Simple_input_section and Convert struct to a
5873 (Input_section_sorter::operator()): Adjust access to
5874 Input_section_info data member to use accessors.
5875 (Output_section_element_input::set_section_addresses): Use layout
5876 parameter. Adjust code to use Output_section::Simple_input_section
5877 and Input_secction_info classes. Register filler for relaxation
5879 (Orphan_output_section::set_section_addresses): Replace Relobj pointer
5880 and section index pair with Output_section::Simple_input_section
5881 class. Adjust code accordingly.
5882 (Phdrs_element::release_segment): New method definition.
5883 (Script_sections::attach_sections_using_phdrs_clause): Do not modify
5885 (Script_sections::release_segments): New method definition.
5886 * gold/script-sections.h (Script_sections::release_segments): New
5888 * gold/target.h (Target::may_relax, Target::relax,
5889 Target::do_may_relax, Target::do_relax): New method definitions.
5891 2009-09-17 Viktor Kutuzov <vkutuzov@accesssoftek.com>
5893 * arm.cc (has_signed_unsigned_overflow): New function.
5894 (Arm_relocate_functions::abs8): New function.
5895 (Target_arm::Scan::local): Handle R_ARM_ABS8.
5896 (Target_arm::Scan::global): Likewise.
5897 (Target_arm::relocate::relocate): Likewise.
5898 (Target_arm::Relocatable_size_for_reloc::get_size_for_reloc):
5901 2009-09-16 Cary Coutant <ccoutant@google.com>
5903 * testsuite/Makefile.am (MOSTLYCLEANFILES): Add more generated files.
5904 * testsuite/Makefile.in: Regenerate.
5906 2009-09-11 Nick Clifton <nickc@redhat.com>
5908 * po/gold.pot: Updated by the Translation project.
5910 2009-09-08 Cary Coutant <ccoutant@google.com>
5912 * output.cc (Output_file::open): Add execute permission to empty file.
5913 * testsuite/Makefile.am (permission_test): New test.
5914 * testsuite/Makefile.in: Regenerate.
5916 2009-09-02 Ian Lance Taylor <iant@google.com>
5918 * output.cc (Output_file::resize): Call map_no_anonymous rather
5921 2009-09-01 Mikolaj Zalewski <mikolajz@google.com>
5923 * gold.cc: Include "incremental.h".
5924 (queue_initial_tasks): Call Incremental_checker methods.
5925 * incremental.cc: Include "output.h".
5926 (Incremental_checker::can_incrementally_link_output_file): New
5928 * incremental.h (Incremental_checker): New class.
5930 * output.cc (Output_file::open_for_modification): New method.
5931 (Output_file::map_anonymous): Changed return type to bool. Record
5933 (Output_file::map_no_anonymous): New method, broken out of map.
5934 (Output_file::map): Use map_no_anonymous and map_anonymous.
5935 * output.h (class Output_file): Update declarations.
5937 2009-08-24 Cary Coutant <ccoutant@google.com>
5939 * options.h (Command_line::Pre_options): New class.
5940 (Command_line::pre_options): New member.
5941 * options.cc (gold::options::ready_to_register): New variable.
5942 (One_option::register_option): Do nothing if not registering options.
5943 Assert if same short option registered twice.
5944 (General_options::General_options): Turn off option registration when
5946 (Command_line::Pre_options::Pre_options): New constructor.
5948 2009-08-24 Cary Coutant <ccoutant@google.com>
5950 * options.h (General_options::no_keep_memory): Remove incorrect
5953 2009-08-24 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5955 * Makefile.am (am__skiplex, am__skipyacc): New.
5956 * Makefile.in: Regenerate.
5958 2009-08-22 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
5960 * Makefile.am (AM_CPPFLAGS): Renamed from ...
5961 (INCLUDES): ... this.
5962 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add -Wno-portability.
5963 (AM_CPPFLAGS): Renamed from ...
5964 (INCLUDE): ... this.
5965 * Makefile.in, testsuite/Makefile.in: Regenerate.
5967 * Makefile.in: Regenerate.
5968 * aclocal.m4: Likewise.
5969 * config.in: Likewise.
5970 * configure: Likewise.
5971 * testsuite/Makefile.in: Likewise.
5973 * Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
5974 * testsuite/Makefile.am (AUTOMAKE_OPTIONS): Add foreign.
5975 * Makefile.in: Regenerate.
5976 * testsuite/Makefile.in: Regenerate.
5978 2009-08-19 Cary Coutant <ccoutant@google.com>
5980 * resolve.cc (Symbol_table::resolve): Don't complain about defined
5981 symbols in shared libraries overridden by hidden or internal symbols
5982 in the main program.
5984 2009-08-19 Chris Demetriou <cgd@google.com>
5986 * testsuite/debug_msg.sh: Match .* rather than ${srcdir} when
5987 checking source file names in error messages.
5989 2009-08-18 Doug Kwan <dougkwan@google.com>
5991 * dynobj.cc (Sized_dynobj::setup): Take a Target object instead of
5992 an elcpp::Ehdr as parameter. Adjust call to set_target.
5993 * dynobj.h (Sized_dynobj::setup): Take a Target object instead of
5994 an elfcpp::Ehdr as parameter.
5995 * object.cc (Object::set_target): Remove the version that looks up
5996 a target and sets it.
5997 (Sized_relobj::setup): Take a Target object instead of
5998 an elfcpp::Ehdr as parameter. Adjust call to set_target.
5999 (make_elf_sized_object): Find target and ask target to
6001 * object.h: (Object::set_target): Remove the version that looks up
6002 a target and sets it.
6003 (Sized_relobj::setup): Take a Target object instead of
6004 an elfcpp:Ehdr as parameter.
6005 * target.cc: Include dynobj.h.
6006 (Target::do_make_elf_object_implementation): New.
6007 (Target::do_make_elf_object): New.
6008 * target.h (Target::make_elf_object): New template declaration.
6009 (Target::do_make_elf_object): New method declarations.
6010 (Target::do_make_elf_object_implementation): New template declaration.
6012 2009-08-14 Ian Lance Taylor <iant@google.com>
6014 * gold.h (FUNCTION_NAME): Define.
6015 (gold_unreachable): Use FUNCTION_NAME.
6017 2009-08-12 Sriraman Tallam <tmsriram@google.com>
6019 * icf.cc (Icf::find_identical_sections): Issue a warning when a
6020 symbol in the --keep-unique list is not found.
6022 2009-08-12 Sriraman Tallam <tmsriram@google.com>
6024 * icf.cc (Icf::find_identical_sections): Unfold symbols that have
6025 been maked as --keep-unique.
6026 (Icf::unfold_section): New function.
6027 * icf.h (Icf::unfold_section): New function.
6028 * options.h (General_options::keep_unique): New option.
6029 * testsuite/Makefile.am: Add commands to build icf_keep_unique_test.
6030 * testsuite/Makefile.in: Regenerate.
6031 * testsuite/icf_keep_unique_test.sh: New file.
6032 * testsuite/icf_keep_unique_test.cc: New file.
6034 2009-08-12 Cary Coutant <ccoutant@google.com>
6037 * resolve.cc (Symbol_table::resolve): Check for references from
6038 dynamic objects to hidden and internal symbols.
6039 * testsuite/Makefile.am (hidden_test.sh): New test.
6040 * testsuite/Makefile.in: Regenerate.
6041 * testsuite/hidden_test.sh: New script.
6042 * testsuite/hidden_test_1.c: New test source.
6043 * testsuite/hidden_test_main.c: New test source.
6045 2009-08-11 Doug Kwan <dougkwan@google.com>
6047 * arm.cc: Update comments.
6048 (Target_arm::do_finalize_sections): Add a special PT_ARM_EXIDX
6049 segment to locate the .ARM.exidx section if present.
6051 2009-08-09 Doug Kwan <dougkwan@google.com>
6053 * dynobj.h (Sized_dynobj::do_section_entsize): Revert the previous
6056 2009-08-07 Sriraman Tallam <tmsriram@google.com>
6057 * dynobj.h (Sized_dynobj::do_section_entsize): Add return to avoid
6060 2009-08-06 Sriraman Tallam <tmsriram@google.com>
6062 * x86_64.cc (Target_x86_64::Relocate::relocate_tls): Check for a
6063 valid tls_segment only for non-debug-section relocations.
6064 * testsuite/Makefile.am: Add gc_tls_test.
6065 * testsuite/Makefile.in: Regenerate.
6066 * testsuite/gc_tls_test.cc: New file.
6067 * testsuite/gc_tls_test.sh: New file.
6069 2009-08-05 Sriraman Tallam <tmsriram@google.com>
6073 * Makefile.am (CCFILES): Add icf.cc.
6075 * Makefile.in: Regenerate.
6076 * dynobj.h (Sized_dynobj::do_section_entsize): New function.
6077 * gc.h (gc_process_relocs): Populate lists used by icf to contain
6078 section, symbol and addend information for the relocs.
6079 * gold.cc (queue_middle_tasks): Call identical code folding.
6080 * gold.h: Add defines for multimap.
6081 * layout.cc (Layout::create_symtab_sections): Add symtab as parameter
6082 to the call of finalize_local_symbols.
6083 * main.cc (main): Create object of class Icf.
6084 * object.cc (Sized_relobj::do_layout): Allow this function to be
6085 called twice during icf.
6086 (Sized_relobj::do_finalize_local_symbols): Fold symbols corresponding
6087 to sections marked as identical by icf.
6088 (Sized_relobj::do_section_flags): Get section_flags from Symbols_data
6090 (Sized_relobj::do_section_entsize): New function.
6091 * object.h (Object::section_entsize): New function.
6092 (Object::do_section_entsize): New pure virtual function.
6093 (Relobj::finalize_local_symbols): Add new parameter.
6094 (Relobj::do_section_entsize): New function.
6095 * options.h (General_options::icf): New option.
6096 (General_options::icf_iterations): New option.
6097 (General_options::print_icf_sections): New option.
6098 * plugin.cc (Sized_pluginobj::do_section_entsize): New function.
6099 * plugin.h (Sized_pluginobj::do_section_entsize): New function.
6100 * reloc.cc (Read_relocs::run): Delay scanning relocs when doing
6102 * symtab.cc (Symbol_table::is_section_folded): New function.
6103 (Symbol_table::sized_finalize_symbol): Fold symbols corresponding
6104 to sections marked as identical by icf.
6105 * symtab.h (Symbol_table::set_icf): New function.
6106 (Symbol_table::icf): New function.
6107 (Symbol_table::is_section_folded): New function.
6108 (Symbol_table::icf_): New data member.
6109 * target-reloc.h (relocate_section): Ignore sections folded by icf.
6110 * testsuite/Makefile.am: Add commands to build icf_test.
6111 * testsuite/Makefile.in: Regenerate.
6112 * testsuite/icf_test.sh: New file.
6113 * testsuite/icf_test.cc: New file.
6115 2009-07-24 Chris Demetriou <cgd@google.com>
6117 * layout.cc (is_compressible_debug_section): Fix incorrect
6118 comment about compressed section names.
6120 2009-07-20 Ian Lance Taylor <ian@airs.com>
6123 * x86_64.cc (Target_x86_64::do_code_fill): Correct nop sequences.
6125 2009-07-16 Ian Lance Taylor <iant@google.com>
6128 * layout.h: #include <map>.
6129 (class Kept_section): Change from struct to class. Add accessors
6130 and setters. Add section size to Comdat_group mapping. Change
6131 Comdat_group to std::map. Add is_comdat_ field. Add
6132 linkonce_size field in union.
6133 (class Layout): Update declaration of find_or_add_kept_section.
6134 Don't declare find_kept_object.
6135 * layout.cc (Layout::find_or_add_kept_section): Remove candidate
6136 parameter. Add object, shndx, is_comdat, and is_group_name
6137 parameters. Change all callers. Adjust for new Kept_section.
6138 (Layout::find_kept_object): Remove.
6139 * object.cc (Sized_relobj::include_section_group): Update use of
6140 Kept_section. Rename secnum to shndx. Only record
6141 Kept_comdat_section if sections are the same size.
6142 (Sized_relobj::include_linkonce_section): Update use of
6143 Kept_section. Only record Kept_comdat_section if sections are the
6144 same size. Set size of linkonce section.
6145 (Sized_relobj::map_to_kept_section): Update call to
6146 get_kept_comdat_section.
6147 * object.h (class Sized_relobj): Rename fields in
6148 Kept_comdat_section to drop trailing underscores; change object
6149 field to Relobj*. Change Kept_comdat_section_table to store
6150 struct rather than pointer.
6151 (Sized_relobj::set_kept_comdat_section): Remove kept parameter.
6152 Add kept_object and kept_shndx parameters. Change all callers.
6153 (Sized_relobj::get_kept_comdat_section): Change return type to
6154 bool. Add kept_object and kept_shndx parameters. Change all
6156 * plugin.cc (Pluginobj::include_comdat_group): Update call to
6157 Layout::find_or_add_kept_section.
6159 2009-07-09 Ian Lance Taylor <iant@google.com>
6161 * merge.cc (Object_merge_map::initialize_input_to_output_map):
6162 Reserve space in the hash table.
6164 2009-07-06 Mikolaj Zalewski <mikolajz@google.com>
6166 * fileread.cc (File_read::get_mtime): New method.
6167 * fileread.h (Timespec): New structure.
6168 (File_read::get_mtime): New method.
6169 * incremental.cc (Incremental_inputs_entry_data::timestamp_usec):
6170 Renamed from timestamp_nsec.
6171 (Incremental_inputs_entry_write::timestamp_sec): Fix argument to
6173 (Incremental_inputs_entry_write::timestamp_usec): Renamed from
6175 (Incremental_inputs::report_archive): Save mtime; style fix.
6176 (Incremental_inputs::report_obejct): Save mtime; style fix.
6177 (Incremental_inputs::report_script): Save mtime; style fix.
6178 (Incremental_inputs::finalize_inputs): Style fix.
6179 (Incremental_inputs::finalize): Style fix.
6180 (Incremental_inputs::create_input_section_data): Store inputs
6182 * incremental.h (Incremental_inputs::report_script): Add mtime
6184 (Incremental_inputs::Input_info::Input_info): Intialize only one
6186 (Incremental_inputs::Input_info::archive): Move to nameless
6188 (Incremental_inputs::Input_info::obejct): Move to nameless union.
6189 (Incremental_inputs::Input_info::script): Move to nameless union.
6190 (Incremental_inputs::mtime): New field.
6191 * script.cc (read_input_script): Pass file mtime to
6193 * script.h (Script_info::inputs): Style fix.
6195 2009-07-01 Ian Lance Taylor <ian@airs.com>
6197 * freebsd.h (Target_freebsd::do_adjust_elf_header): Use size
6200 2009-06-24 Ian Lance Taylor <iant@google.com>
6203 * layout.cc (Layout::choose_output_section): If we find an
6204 existing section, update the flags.
6205 (Layout::create_notes): New function, broken out of
6207 (Layout::finalize): Don't create note sections.
6208 (Layout::create_note): Don't crash if linker script discards
6210 (Layout::create_gold_note): Likewise.
6211 (Layout::create_build_id): Likewise. Don't set
6212 after_input_sections on the section.
6213 (Layout::create_executable_stack_info): Remove target parameter.
6215 * layout.h (class Layout): Declare create_notes. Update
6216 declaration of create_executable_stack_info.
6217 * gold.cc (queue_middle_tasks): Call create_notes.
6218 * output.cc (Output_section::update_flags_for_input_section): Move
6219 here from output.h. If SHF_ALLOC flag is newly set, mark address
6221 * output.h (Output_data::mark_address_invalid): New function.
6222 (class Output_section): Only declare, not define,
6223 update_flags_for_input_section. Remove set_flags.
6225 2009-06-24 Ian Lance Taylor <iant@google.com>
6227 * script-sections.cc (Output_section_definition::
6228 set_section_addresses): Rename shadowing local load_address to
6231 2009-06-24 Ian Lance Taylor <iant@google.com>
6234 * reloc.cc (relocate_sections): Skip empty relocation sections.
6236 2009-06-23 Ian Lance Taylor <iant@google.com>
6239 * layout.cc (Layout::create_note): Use choose_output_section
6240 rather than make_output_section.
6242 2009-06-23 Ian Lance Taylor <iant@google.com>
6245 * options.cc (General_options::parse_V): Set printed_version_.
6246 (General_options::General_options): Initialize printed_version_.
6247 * options.h (class General_options): Add printed_version_ field.
6248 * gold.cc (queue_initial_tasks): If there are no input files,
6249 don't give a fatal error if we printed the version information.
6250 (queue_middle_tasks): If using -r with a shared object, give a
6251 fatal error rather than an ordinary error.
6253 2009-06-23 Ian Lance Taylor <iant@google.com>
6256 * layout.cc (Layout::Layout): Initialize have_stabstr_section_.
6257 (Layout::make_output_section): Set have_stabstr_section_ if we see
6258 a .stab*str section.
6259 (Layout::finalize): Call link_stabs_sections.
6260 (Layout::link_stabs_sections): New file.
6261 * layout.h (class Layout): Add have_stabstr_section_ field.
6262 Declare link_stabs_sections.
6264 2009-06-23 Doug Kwan <dougkwan@google.com>
6266 * Makefile.am (libgold_a_LIBADD): New.
6267 (ld_new_DEPENDENCIES, ld_new_LDADD): Remove LIBOBJS
6268 * Makefile.in: Regenerate.
6269 * config.in (HAVE_DECL_MEMMEM, HAVE_DECL_STRNDUP): New.
6270 * configure: Regenerate.
6271 * configure.ac (AC_CHECK_DECLS): Add strndup and memmem.
6272 * fileread.cc: Include sys/state.h
6273 * gold.h: Declare memmem and strndup if found missing.
6274 * gold_reloc.h: Include byteswap.h if HAVE_BYTESWAP_H is defined.
6276 2009-06-23 Ian Lance Taylor <iant@google.com>
6278 * configure.ac: Call AC_CHECK_DECLS using C, not C++.
6279 * configure: Rebuild.
6281 2009-06-23 Ian Lance Taylor <iant@google.com>
6284 * object.cc (Object::section_contents): Don't try to get a view if
6285 the section has length zero.
6286 (Object::handle_gnu_warning_section): If the section is empty, use
6287 the name of the section as the warning.
6289 2009-06-23 Ian Lance Taylor <iant@google.com>
6292 * stringpool.h (class Stringpool_template): Add optimize_ field.
6293 (Stringpool_template::set_optimize): New function.
6294 * stringpool.cc (Stringpool_template::Stringpool_template):
6295 Initialize optimize_ field.
6296 (Stringpool_template::set_string_offsets): Test local optimize
6297 fild rather than parameter.
6298 * layout.cc (Layout::Layout): Call set_optimize on the section
6301 2009-06-22 Ian Lance Taylor <iant@google.com>
6304 * yyscript.y: Parse TARGET.
6305 * script.cc (script_set_target): New function.
6306 * script-c.h (script_set_target): Declare.
6307 * options.cc (General_options::string_to_object_format): Rename
6308 from string_to_object_format in anonymous namespace. Change
6310 * options.h (class General_options): Declare
6311 string_to_object_format.
6313 2009-06-22 Ian Lance Taylor <iant@google.com>
6315 * script-sections.cc (Script_sections::create_segments): Don't put
6316 program headers in a PT_LOAD segment if -n or -N.
6318 2009-06-22 Ian Lance Taylor <iant@google.com>
6321 * options.h (class General_options): Add -z lazy and -z now. Sort
6322 -z options into alphabetical order.
6323 * layout.cc (Layout::finish_dynamic_section): Handle -z now.
6325 2009-06-21 Ian Lance Taylor <iant@google.com>
6327 * layout.cc (Layout::make_output_section): Call
6328 Target::new_output_section.
6329 (Layout::attach_allocated_section_to_segment): Put large section
6330 sections in a separate load segment with the large segment flag
6332 (Layout::segment_precedes): Sort large data segments after other
6334 (align_file_offset): New static function.
6335 (Layout::set_segment_offsets): Use align_file_offset.
6336 * output.h (class Output_section): Add is_small_section_ and
6337 is_large_section_ fields.
6338 (Output_section::is_small_section): New function.
6339 (Output_section::set_is_small_section): New function.
6340 (Output_section::is_large_section): New function.
6341 (Output_section::set_is_large_section): New function.
6342 (Output_section::is_large_data_section): New function.
6343 (class Output_segment): Add is_large_data_segment_ field.
6344 (Output_segment::is_large_data_segment): New function.
6345 (Output_segment::set_is_large_data_segment): New function.
6346 * output.cc (Output_section::Output_section): Initialize new
6348 (Output_segment::Output_segment): Likewise.
6349 (Output_segment::add_output_section): Add assertion that large
6350 data sections always go in large data segments. Force small data
6351 sections to the end of the list of data sections. Force small BSS
6352 sections to the start of the list of BSS sections. For large BSS
6353 sections to the end of the list of BSS sections.
6354 * symtab.h (class Symbol): Declare is_common_shndx.
6355 (Symbol::is_defined): Check Symbol::is_common_shndx.
6356 (Symbol::is_common): Likewise.
6357 (class Symbol_table): Define enum Commons_section_type. Update
6358 declarations. Add small_commons_ and large_commons_ fields.
6359 * symtab.cc (Symbol::is_common_shndx): New function.
6360 (Symbol_table::Symbol_table): Initialize new fields.
6361 (Symbol_table::add_from_object): Put small and large common
6362 symbols in the right list.
6363 (Symbol_table::sized_finalized_symbol): Check
6364 Symbol::is_common_shndx.
6365 (Symbol_table::sized_write_globals): Likewise.
6366 * common.cc (Symbol_table::do_allocate_commons): Allocate new
6367 common symbol lists. Don't call do_allocate_commons_list if the
6369 (Symbol_table::do_allocate_commons_list): Remove is_tls
6370 parameter. Add comons_section_type parameter. Change all
6371 callers. Handle small and large common symbols.
6372 * object.cc (Sized_relobj::do_finalize_local_symbols): Check
6373 Symbol::is_common_shndx.
6374 * resolve.cc (symbol_to_bits): Likewise.
6375 * target.h (Target::small_common_shndx): New function.
6376 (Target::small_common_section_flags): New function.
6377 (Target::large_common_shndx): New function.
6378 (Target::large_common_section_flags): New function.
6379 (Target::new_output_section): New function.
6380 (Target::Target_info): Add small_common_shndx, large_common_shndx,
6381 small_common_section_flags, and large_common_section_flags
6383 (Target::do_new_output_section): New virtual function.
6384 * arm.cc (Target_arm::arm_info): Initialize new fields.
6385 * i386.cc (Target_i386::i386_info): Likewise.
6386 * powerpc.cc (Target_powerpc::powerpc_info) [all versions]:
6388 * sparc.c (Target_sparc::sparc_info) [all versions]: Likewise.
6389 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
6390 (Target_x86_64::do_new_output_section): New function.
6391 * configure.ac: Define conditional MCMODEL_MEDIUM.
6392 * testsuite/Makefile.am (check_PROGRAMS): Add large.
6393 (large_SOURCES, large_CFLAGS, large_DEPENDENCIES): Define.
6394 (large_LDFLAGS): Define.
6395 * testsuite/large.c: New file.
6396 * testsuite/testfile.cc (Target_test::test_target_info):
6397 Initialize new fields.
6398 * configure, testsuite/Makefile.in: Rebuild.
6400 2009-06-05 Doug Kwan <dougkwan@google.com>
6402 * Makefile.am (CCFILES): Add target.cc.
6403 * Makefile.in: Regenerate.
6404 * i386.cc (class Target_i386): Define new virtual method to
6405 override do_is_local_label_name in parent.
6406 * object.cc (Sized_relobj::do_count_local_symbols): Discard
6407 local symbols if --discard-locals or -X is given.
6408 * options.h (class General_options): Declare new options
6409 '--discard-locals' and '-X' for discarding locals.
6410 * target.h (class Target): Define new methods is_local_label_name.
6411 Declare new virtual method do_is_local_label_name.
6412 * target.cc: New file.
6413 * testsuite/Makefile.am (check_PROGRAMS): Add discard_locals_test.
6414 (check_SCRIPTS): Add discard_locals_test.sh.
6415 (check_DATA): Add discard_local_tests.syms.
6416 (discard_locals_test_SOURCES, discard_locals_test_LDFLAGS): Define.
6417 (discard_local_tests.syms, discard_locals_test.o): New make rules.
6418 * testsuite/Makefile.in: Regenerate.
6419 * testsuite/discard_locals_test.c: New file.
6420 * testsuite/discard_locals_test.sh: Same.
6422 2009-06-05 Doug Kwan <dougkwan@google.com>
6424 * object.cc (Sized_relobj::Sized_relobj): Initialize
6425 discarded_eh_frame_shndx_ to -1U.
6426 (Sized_relobj::do_layout): Record index of a discard .eh_frame
6428 (Sized_relobj::do_count_local_symbols): Skip local symbols in
6429 a discarded .eh_frame section.
6430 (Sized_relobj::do_finalize_local_symbols): Ditto.
6431 * object.h (class Sized_relobj): Declare new member
6432 discarded_eh_frame_shndx_.
6433 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
6434 (local_labels_test.o, local_labels_test): New rules.
6435 * testsuite/Makefile.in: Regenerate.
6437 2009-06-04 Doug Kwan <dougkwan@google.com>
6439 * layout.cc (Layout::section_name_mapping): Add mapping for
6440 special ARM sections.
6442 2009-06-03 Doug Kwan <dougkwan@google.com>
6444 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
6445 (utils::has_overflow): Same.
6447 2009-06-03 Ian Lance Taylor <iant@google.com>
6449 * layout.cc (Layout::section_name_mapping): New array, replacing
6450 Layout::linkonce_mapping.
6451 (Layout::section_name_mapping_count): New variable, replacing
6452 Layout::linkonce_mapping_count.
6453 (Layout::linkonce_output_name): Remove.
6454 (Layout::output_section_name): Rewrite.
6455 * layout.h (class Layout): Rename Linkonce_mapping to
6456 Section_name_mapping, linkonce_mapping to section_name_mapping,
6457 linkonce_mapping_count to section_name_mapping_count. Don't
6458 declare linkonce_output_name.
6460 2009-06-03 Doug Kwan <dougkwan@google.com>
6462 * gold/arm.cc (namespace utils): New.
6463 (Target_arm::reloc_is_non_pic): Define new method.
6464 (class Arm_relocate_functions): New.
6465 (Target_arm::Relocate::relocate): Handle relocation types used by
6468 2009-06-03 Ian Lance Taylor <iant@google.com>
6470 * arm.cc (Target_arm::scan::global): Use || instead of |.
6472 2009-06-02 Doug Kwan <dougkwan@google.com>
6474 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
6475 issued_non_pic_error_.
6476 (class Target_arm::Scan): Declare new method check_non_pic.
6477 Define new method symbol_needs_plt_entry.
6478 Declare new data member issued_non_pic_error_.
6479 (class Target_arm::Relocate): Declare new method
6480 should_apply_static_reloc.
6481 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
6482 (Target_arm::Scan::check_non_pic): Define new method.
6483 (Target_arm::Scan::local): Handle a small subset of reloc types used
6485 (Target_arm::Scan::local): Same.
6486 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
6488 2009-05-31 Mikolaj Zalewski <mikolajz@google.com>
6490 * incremental.cc (Incremental_inputs::report_command_line): Filter
6491 out --incremental-* options.
6493 2009-05-29 Doug Kwan <dougkwan@google.com>
6495 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
6497 (class Target_arm): Update comment.
6498 (Target_arm::Target_arm): Initialize new data members GOT_,
6499 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
6500 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
6501 and Target_arm::rel_dyn_section.
6502 Declare new_enum Target_arm::Got_type.
6503 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
6505 Update commments for member do_dynsym_value.
6506 (Target_arm::got_size, Target_arm::plt_section,
6507 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
6508 new methods inside class defintion.
6509 (Target_arm::got_section): Define new method.
6510 (Target_arm::rel_dyn_section): Same.
6511 (Output_data_plt_arm): New template class.
6512 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
6513 (Output_data_plt_arm:do_adjust_output_section): Define new method.
6514 (Output_data_plt_arm::add_entry): Same.
6515 (Output_data_plt_arm::first_plt_entry): Define new
6516 static data member for PLT instruction template.
6517 (Output_data_plt_arm::plt_entry): Same.
6518 (Output_data_plt_arm::do_write): Define new method.
6519 (Target_arm::make_plt_entry): Same.
6520 (Target_arm::do_finalize_sections): Same.
6521 (Target_arm::do_dynsym_value): Same.
6523 2009-05-28 Doug Kwan <dougkwan@google.com>
6525 * Makefile.am (TARGETSOURCES): Add arm.cc.
6526 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
6527 * Makefile.in: Regenerate.
6529 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
6531 2009-05-26 Doug Kwan <dougkwan@google.com>
6533 * options.cc (General_options::parse_exclude_libs). Fix a comment.
6534 (General_options::check_excluded_libs): Strip off directories in
6535 archive name before matching like GNU ld does.
6536 * testsuite/Makefile.am (MOSTLYCLEANFILES,
6537 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
6538 (exclude_libs_test_LDFLAGS): Add linker option
6539 -Wl,--exclude-libs,libexclude_libs_test_3
6540 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
6541 an explicit archive without using -l.
6542 (alt/libexclude_libs_test_3.a): New make rule.
6543 * testsuite/Makefile.in: Regenerate.
6544 * testsuite/exclude_libs_test.c : Declare lib3_default().
6546 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
6547 * exclude_libs_test_3.c: New file.
6549 2009-05-26 Nick Clifton <nickc@redhat.com>
6551 * po/id.po: New Indonesian translation.
6552 * po/gold.pot: Updated template file.
6554 2009-05-22 Sriraman Tallam <tmsriram@google.com>
6556 * testsuite/Makefile.am: Add -ffunction-sections to compile
6557 gc_comdat_test files. Add -Wl,--gc-sections to build
6559 * testsuite/Makefile.in: Regenerate.
6560 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
6562 2009-05-21 Sriraman Tallam <tmsriram@google.com>
6564 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
6565 kept comdat section was garbage collected.
6566 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
6567 * testsuite/Makefile.in: Regenerate.
6568 * testsuite/gc_comdat_test.sh: New file.
6569 * testsuite/gc_comdat_test_1.cc: New file.
6570 * testsuite/gc_comdat_test_2.cc: New file.
6572 2009-05-19 Doug Kwan <dougkwan@google.com>
6574 * archive.cc (Archive::Archive): Move constructor from archive.h
6575 to here. Initialize no_export_.
6576 (Archive::get_elf_object_for_member): Set no_export flag of object.
6577 * archive.h (Archive::Archive): Move constructor body to
6579 (Archive::no_export): New method.
6580 (Archive::no_export_): New field.
6581 * object.h (Object::Object): Initialize no_export_ to false.
6582 (Object::no_export, Object::set_no_export): New methods.
6583 (Object::no_export_): New field.
6584 * options.cc (General_options::parse_exclude_libs): New method.
6585 (General_options::check_excluded_libs) Same.
6586 * options.h (exclude_libs): New option.
6587 (General_options::check_excluded_libs): New method declaration.
6588 (General_options::excluded_libs_): New field.
6589 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
6590 default or protected visibility if an object has no-export flag set.
6591 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
6592 (check_SCRIPTS): Add exclude_libs_test.sh.
6593 (check_DATA): Add exclude_libs_test.syms.
6594 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
6595 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
6596 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
6597 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
6598 (exclude_libs_test.syms, libexclude_libs_test_1.a,
6599 libexclude_libs_test_2.a): New rules.
6600 * testsuite/Makefile.in: Regenerate.
6601 * testsuite/exclude_libs_test.c: New file.
6602 * testsuite/exclude_libs_test.sh: Ditto.
6603 * testsuite/exclude_libs_test_1.c: Ditto.
6604 * testsuite/exclude_libs_test_2.c: Ditto.
6606 2009-05-15 Ian Lance Taylor <iant@google.com>
6608 * configure.ac: Check for declarations for cases where libiberty.h
6609 checks HAVE_DECL_xxx.
6610 * configure, config.in: Rebuild.
6612 2009-05-15 Mikolaj Zalewski <mikolajz@google.com>
6614 * gold.h (Incremental_argument_list): Remove (invalid) forward
6616 * incremental.cc (Incremental_inputs::report_achive): New method.
6617 (Incremental_inputs::report_object): New method.
6618 (Incremental_inputs::report_script): New method.
6619 (Incremental_inputs::finalize_inputs): New method.
6620 (Incremental_inputs::finalize): Call finalize_inputs().
6621 (Incremental_inputs::sized_create_incremental_inputs_section_data):
6622 Create inputs entries.
6623 * incremental.h (Incremental_input_type): New enum.
6624 (Incremental_inputs::Incremental_input): Initialize new fields.
6625 (Incremental_inputs::report_inputs): New method.
6626 (Incremental_inputs::report_achive): New method.
6627 (Incremental_inputs::report_object): New method.
6628 (Incremental_inputs::report_script): New method.
6629 (Incremental_inputs::finalize_inputs): New method.
6630 (Incremental_inputs::Input_info): New struct.
6631 (Incremental_inputs::Input_info_map): New typedef.
6632 (Incremental_inputs::lock_): New field.
6633 (Incremental_inputs::Inputs_): New field.
6634 (Incremental_inputs::Inputs_map): New field.
6635 * main.cc (main): Call Incremental_input::report_inputs.
6636 * options.h (Input_argument_list): Typedef moved from
6638 (Input_file_group::Files): Remove, use ::Input_argument_list.
6639 (Input_file_group::Input_argument_list): Remove, use
6640 ::Input_argument_list.
6641 * plugin.cc (Plugin_manager::add_input_file): Add error in
6643 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
6645 * script.cc (read_input_script): Call
6646 Incremental_input::report_script.
6647 * script.h (Script_info): New class.
6649 2009-04-27 Ian Lance Taylor <iant@google.com>
6651 * x86_64.cc (do_adjust_output_section): Set entsize to
6654 2009-04-23 Elliott Hughes <enh@google.com>
6656 * output.cc (Output_file::close): After short writes, continue
6657 writing from the correct offset in the buffer being written.
6659 2009-04-23 Chris Demetriou <cgd@google.com>
6661 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
6662 * configure: Regenerate.
6663 * config.in: Regenerate.
6664 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
6665 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
6667 2009-04-21 Mikolaj Zalewski <mikolajz@google.com>
6669 * incremental.cc (Incremental_inputs_header_data): Renamed from
6670 Incremental_input_header_data.
6671 (Incremental_inputs_header_data::data_size): New field.
6672 (Incremental_inputs_header_data::put_input_file_count): Renamed
6673 from input_file_count.
6674 (Incremental_inputs_header_data::put_command_line_offset): Renamed
6675 from command_line_offset.
6676 (Incremental_inputs_header_data::put_reserved): Renamed from
6678 (Incremental_inputs_entry_data): Renamed from
6679 Incremental_input_entry_data.
6680 (Incremental_inputs_entry_data::data_size): New field.
6681 (Incremental_inputs::report_command_line): New method.
6682 (Incremental_inputs::finalize): New method.
6683 (Incremental_inputs::create_incremental_inputs_data): New method.
6684 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
6685 * incremental.h: New file.
6686 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
6687 (Layout::finalize): Create incremental inputs section in
6689 (Layout::create_incremental_info_sections): New method.
6690 * layout.h (Layout::incremental_inputs): New method.
6691 (Layout::create_incremental_info_sections): New method.
6692 (Layout::incremental_inputs_): New field.
6693 * main.cc (main): Notify Incremental_input of the command line.
6695 2009-04-01 Ian Lance Taylor <iant@google.com>
6696 Mikolaj Zalewski <mikolajz@google.com>
6698 * gold.h (reserve_unordered_map): Define, three versions, one for
6699 each version of Unordered_map.
6700 * layout.cc (Layout::Layout): Remove options parameter. Add
6701 number_of_input_files parameter. Don't initialize options_.
6702 Initialize number_of_input_files_ and resized_signatures_. Move
6703 sections_are_attached_.
6704 (Layout::layout_group): Reserve space for group_signatures_.
6705 (Layout::find_or_add_kept_section): Change name parameter to be a
6706 reference. Resize signatures_ map when it gets large enough.
6707 (Layout::layout_eh_frame): Use parameters->options() instead of
6709 (Layout::make_output_section): Likewise.
6710 (Layout::attach_allocated_section_to_segment): Likewise.
6711 (Layout::finalize, Layout::create_executable_stack): Likewise.
6712 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
6713 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
6714 * layout.h (class Layout): Update declarations. Remove options_
6715 field. Add number_of_input_files_ and resized_signatures_
6716 fields. Move sections_are_attached_ field.
6717 * main.cc (main): Pass number of input files to Layout
6718 constructor. Don't pass options.
6720 2009-03-30 Ian Lance Taylor <iant@google.com>
6722 * ffsll.c (ffsll): Correct implementation.
6724 2009-03-27 Ian Lance Taylor <iant@google.com>
6726 * ffsll.c: New file.
6727 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
6728 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
6729 * ftruncate.c (ftruncate): Declare before definition.
6730 * mremap.c (mremap): Likewise.
6731 * pread.c (pread): Likewise.
6732 * configure, Makefile.in, config.in: Rebuild.
6734 * mremap.c: New file.
6735 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
6736 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
6737 (mremap): Declare if HAVE_MREMAP is not defined.
6738 * configure, Makefile.in, config.in: Rebuild.
6740 2009-03-27 Cary Coutant <ccoutant@google.com>
6742 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
6743 position independent.
6744 * sparc.cc (Target_sparc::check_non_pic): Likewise.
6745 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
6747 2009-03-24 Cary Coutant <ccoutant@google.com>
6749 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
6751 (needs_dynamic_reloc): Likewise.
6753 2009-03-24 Ian Lance Taylor <iant@google.com>
6755 * yyscript.y (file_cmd): Recognize EXTERN.
6756 (extern_name_list, extern_name_list_body): New nonterminals.
6757 * script.cc (script_add_extern): Define.
6758 * script-c.h (script_add_extern): Declare.
6760 2009-03-24 Rafael Avila de Espindola <espindola@google.com>
6762 * object.cc (is_elf_object): Define.
6763 * object.h (is_elf_object): Declare.
6764 * archive.cc (Archive::get_elf_object_for_member): Call
6766 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
6768 2009-03-24 Elliott Hughes <enh@google.com>
6770 * output.cc (Output_file::map_anonymous): Define.
6771 (Output_file::map): Use map_anonymous. If the regular mmap fails,
6772 try an anonymous one. Report the size if the mmap fails.
6773 * output.h (class Output_file): Declare map_anonymous.
6775 2009-03-24 Ian Lance Taylor <iant@google.com>
6777 * target-select.cc (instantiate_target): Don't acquire the lock if
6778 the instantiated_target_ field has already been set.
6780 2009-03-23 Ian Lance Taylor <iant@google.com>
6782 * gold-threads.h (class Initialize_lock): Define.
6783 * gold-threads.cc (class Initialize_lock_once): Define.
6784 (initialize_lock_control): New static variable.
6785 (initialize_lock_pointer): New static variable.
6786 (initialize_lock_once): New static function.
6787 (Initialize_lock::Initialize_lock): Define.
6788 (Initialize_lock::initialize): Define.
6789 * target-select.h: Include "gold-threads.h".
6790 (class Target_selector): Add lock_ and initialize_lock_ fields.
6791 Don't define instantiate_target, just declare it.
6792 * target-select.cc (Target_selector::Target_selector): Initialize
6794 (Target_selector::instantiate_target): Define.
6795 * descriptors.h: Include "gold-threads.h".
6796 (class Descriptors): Add initialize_lock_ field.
6797 * descriptors.cc (Descriptors::Descriptors): Initialize new
6799 (Descriptors::open): Use initialize_lock_ field
6800 * errors.h (class Errors): Add initialize_lock_ field.
6801 * errors.cc (Errors::Errors): Initialize new field.
6802 (Errors::initialize_lock): Use initialize_lock_ field.
6803 * powerpc.cc (class Target_selector_powerpc): Remove
6804 instantiated_target_ field. In do_recognize call
6805 instantiate_target rather than do_instantiate_target. In
6806 do_instantiate_target just allocate a new target.
6807 * sparc.cc (class Target_selector_sparc): Likewise.
6809 * freebsd.h: New file.
6810 * i386.cc: Include "freebsd.h".
6811 (Target_i386): Derive from Target_freebsd rather than
6813 (Target_selector_i386): Derive from Target_selector_freebsd rather
6814 than Target_selector.
6815 * x86_64.cc: Include "freebsd.h".
6816 (Target_x86_64): Derive from Target_freebsd rather than
6818 (Target_selector_x86_64): Derive from Target_selector_freebsd
6819 rather than Target_selector.
6820 * target.h (class Target): Add adjust_elf_header and
6821 do_adjust_elf_header.
6822 * output.cc (Output_file_header:: do_sized_write): Call target
6823 adjust_elf_header routine.
6824 * configure.tgt: Set targ_osabi.
6825 * configure.ac: Define GOLD_DEFAULT_OSABI.
6826 * parameters.cc (Parameters::default_target): Pass
6827 GOLD_DEFAULT_OSABI to select_target.
6828 * target-select.h (class Target_selector): Make instantiate_target
6829 protected rather than private.
6830 * Makefile.am (HFILES): Add freebsd.h.
6831 * configure, Makefile.in, config.in: Rebuild.
6833 * merge.cc (do_add_input_section): Correct pend value. Change
6834 message about last entry not being null terminated from error to
6837 2009-03-20 Mikolaj Zalewski <mikolajz@google.com>
6839 * incremental.cc: New file.
6840 * Makefile.am (CCFILES): Add incremental.cc.
6841 * Makefile.in: Rebuild.
6843 2009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
6845 * layout.cc (Layout::output_section_name): Preserve names
6846 of '.note.' sections.
6848 2009-03-19 Ian Lance Taylor <iant@google.com>
6850 * descriptors.cc (Descriptors::open): Check that the options are
6851 valid before using them.
6853 2009-03-18 Ian Lance Taylor <iant@google.com>
6855 * script-sections.h: Include <list>.
6856 (class Script_sections): Change Sections_elements from std::vector
6857 to std::list. Typedef public Elements_iterator. Add
6858 orphan_section_placement_, data_segment_align_start_, and
6859 saw_data_segment_align_ fields. Remove data_segment_align_index_
6861 * script-sections.cc (class Orphan_section_placement): New class.
6862 (class Sections_element): Add virtual functions is_relro and
6863 orphan_section_init. Remove virtual function place_orphan_here.
6864 (class Output_section_definition): Add is_relro and
6865 orphan_section_init. Remove place_orphan_here.
6866 (class Orphan_output_section): Likewise.
6867 (Script_sections::Script_sections): Update for field changes.
6868 (Script_sections::data_segment_align): Set saw_data_segment_align_
6869 and data_segment_align_start_, not data_segment_align_index.
6870 (Script_sections::data_segment_relro_end): Check
6871 saw_data_segment_align_. Use data_segment_align_start_ rather
6872 than data_segment_align_index_.
6873 (Script_sections::place_orphan): Rewrite to use
6874 Orphan_section_placement.
6876 2009-03-17 Ian Lance Taylor <iant@google.com>
6878 * archive.cc (Archive::add_symbols): Check for a version attached
6879 to the symbol name in the archive map.
6880 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
6881 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
6882 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
6883 (ver_test_11.a): New target.
6884 * testsuite/Makefile.in: Rebuild.
6886 * configure.ac: Check for chsize and posix_fallocate. Replace
6888 * ftruncate.c: New file, from gnulib.
6889 * output.cc (posix_fallocate): Define dummy version if not
6890 HAVE_POSIX_FALLOCATE.
6891 (Output_file::map): Call posix_fallocate rather than lseek and
6893 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
6894 * configure, Makefile.in, config.in: Rebuild.
6896 2009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
6898 * layout.h (Layout::create_note): Add section_name parameter.
6899 * layout.cc (Layout::create_note): Likewise.
6900 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
6902 2009-03-17 Ian Lance Taylor <iant@google.com>
6904 * descriptors.cc: Include "options.h".
6905 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
6906 (Descriptors::open): Always use O_CLOEXEC when opening a new
6907 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
6908 then set FD_CLOEXEC.
6910 * sparc.cc (class Target_sparc): Add has_got_section.
6911 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
6912 make sure we have a GOT section.
6914 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
6915 (Target_sparc::Scan::local): Likewise.
6916 (Target_sparc::Scan::global): Likewise.
6917 (Target_sparc::Relocate::relocate): Likewise.
6918 (Target_sparc::Relocate::relocate_tls): Likewise.
6920 * symtab.cc (Symbol_table::define_default_version): New function,
6921 broken out of add_from_object.
6922 (Symbol_table::add_from_object): Call define_default_version.
6923 (Symbol_table::define_special_symbol): Add resolve_oldsym
6924 parameter. Change all callers. If the version for a symbol comes
6925 from a version script, resolve it with the symbol with the same
6926 name with no version. Also add the symbol without a version if
6928 (do_define_in_output_data): If resolving with oldsym, don't delete
6930 (do_define_in_output_segment): Likewise.
6931 (do_define_as_constant): Likewise.
6932 * symtab.h (class Symbol_table): Update declarations.
6934 2009-03-13 Ian Lance Taylor <iant@google.com>
6936 * readsyms.cc (Read_symbols::incompatible_warning): New function.
6937 (Read_symbols::requeue): New function.
6938 (Read_symbols::do_read_symbols): If make_elf_object fails because
6939 the target type is not configured, and the file was searched for,
6940 issue a warning and retry with the next directory.
6941 (Add_symbols::run): If the file has an incompatible format, and
6942 it was searched for, requeue the Read_symbols task. On error,
6944 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
6945 dirindex parameter to constructor. Change all callers. Declare
6946 incompatible_warning and requeue.
6947 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
6948 input_argument_ and input_group_ fields. Add them to
6949 constructor. Change all callers.
6950 (class Read_script): Add dirindex_ field. Add it to constructor.
6952 * archive.cc (Archive::setup): Remove input_objects parameter.
6954 (Archive::get_file_and_offset): Likewise.
6955 (Archive::read_all_symbols): Likewise.
6956 (Archive::read_symbols): Likewise.
6957 (Archive::get_elf_object_for_member): Remove input_objects
6958 parameter. Add punconfigured parameter. Change all callers.
6959 (Archive::add_symbols): Change return type to bool. Check return
6960 value of include_member.
6961 (Archive::include_all_members): Likewise.
6962 (Archive::include_member): Change return type to bool. Return
6963 false if first included object has incompatible target. Set
6964 included_member_ field.
6965 (Add_archive_symbols::run): If add_symbols returns false, requeue
6967 * archive.h (class Archive): Add included_member_ field.
6968 Initialize it in constructor. Add input_file and searched_for
6969 methods. Update declarations.
6970 (class Add_archive_symbols): Add dirpath_, dirindex_, and
6971 input_argument_ fields. Add them to constructor. Change all
6973 * script.cc: Include "target-select.h".
6974 (class Parser_closure): Add skip_on_incompatible_target_ and
6975 found_incompatible_target_ fields. Add
6976 skip_on_incompatible_target parameter to constructor. Change all
6977 callers. Add methods skip_on_incompatible_target,
6978 clear_skip_on_incompatible_target, found_incompatible_target, and
6979 set_found_incompatible_target.
6980 (read_input_script): Add dirindex parameter. Change all callers.
6981 If parser finds an incompatible target, requeue Read_symbols
6983 (script_set_symbol): Clear skip_on_incompatible_target in
6985 (script_add_assertion, script_parse_option): Likewise.
6986 (script_start_sections, script_add_phdr): Likewise.
6987 (script_check_output_format): New function.
6988 * script.h (read_input_script): Update declaration.
6989 * script-c.h (script_check_output_format): Declare.
6990 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
6991 (ignore_cmd): Remove OUTPUT_FORMAT.
6992 * fileread.cc (Input_file::Input_file): Add explicit this.
6993 (Input_file::will_search_for): New function.
6994 (Input_file::open): Add pindex parameter. Change all callers.
6995 * fileread.h (class Input_file): Add input_file_argument method.
6996 Declare will_search_for. Update declarations.
6997 * object.cc (make_elf_object): Add punconfigured parameter.
6999 * object.h (class Object): Make input_file public. Add
7000 searched_for method.
7001 (make_elf_object): Update declaration.
7002 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
7004 * dirsearch.h (class Dirsearch): Update declaration.
7005 * options.h (class General_options): Add --warn-search-mismatch.
7006 * parameters.cc (Parameters::is_compatible_target): New function.
7007 * parameters.h (class Parameters): Declare is_compatible_target.
7008 * workqueue.cc (Workqueue::add_blocker): New function.
7009 * workqueue.h (class Workqueue): Declare add_blocker.
7011 * fileread.cc (Input_file::open): Remove options parameter.
7013 (Input_file::open_binary): Likewise.
7014 * script.cc (read_input_script): Likewise.
7015 * readsyms.h (class Read_symbols): Remove options_ field. Remove
7016 options parameter from constructor. Change all callers.
7017 (class Read_script): Likewise.
7018 * fileread.h (class Input_file): Update declarations.
7019 * script.h (read_input_script): Update declaration.
7021 2009-03-10 Nick Clifton <nickc@redhat.com>
7023 * po/es.po: New Spanish translation.
7025 2009-03-06 Cary Coutant <ccoutant@google.com>
7027 * options.cc (parse_short_option): Keep dash_z from registering itself.
7029 2009-03-03 Ian Lance Taylor <iant@google.com>
7032 * target-reloc.h (relocate_section): Pass output_section to
7034 * i386.cc (Target_i386::should_apply_static_reloc): Add
7035 output_section parameter. Change all callers.
7036 (Target_i386::Relocate::relocate): Add output_section parameter.
7037 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7038 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
7039 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
7040 * testsuite/two_file_shared.sh: New script.
7041 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
7042 (check_DATA): Add two_file_shared.dbg.
7043 (two_file_shared.dbg): New target.
7044 * testsuite/Makefile.in: Rebuild.
7046 2009-03-01 Ian Lance Taylor <iant@google.com>
7048 * configure.ac: Check for byteswap.h.
7049 * configure: Rebuild.
7050 * config.in: Rebuild.
7052 2009-03-01 Mikolaj Zalewski <mikolajz@google.com>
7054 * layout.cc (Layout::find_or_add_kept_section): New function.
7055 (Layout::add_comdat): Removed.
7056 * layout.h (struct Kept_section): Move out of class Layout.
7057 Remove trailing underscores from field names. Add group_sections
7058 field. Rename group_ field to is_group. Change all uses.
7059 (class Layout): Declare find_or_add_kept_section, not add_comdat.
7060 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
7061 comdat_groups_ field.
7062 (Sized_relobj::include_section_group): Use
7063 find_or_add_kept_section and Kept_section::group_sections.
7064 (Sized_relobj::include_linkonce_section): Likewise.
7065 * object.cc (class Sized_relobj): Don't define Comdat_group or
7066 Comdat_group_table. Remove find_comdat_group and
7067 add_comdat_group. Remove comdat_groups_ field.
7068 * plugin.cc (include_comdat_group): Use
7069 Layout::find_or_add_kept_section.
7071 2009-02-28 Ian Lance Taylor <iant@google.com>
7073 * README: --gc-sections and map files are now supported. Document
7074 some build requirements.
7077 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
7078 relocatable link set the value of the section symbol to zero.
7079 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
7080 relocatable link don't include the section address in the local
7083 2009-02-27 Ian Lance Taylor <iant@google.com>
7086 * options.h (class Search_directory): Add is_system_directory.
7087 (class General_options): Declare is_in_system_directory.
7088 * options.cc (get_relative_sysroot): Make static.
7089 (get_default_sysroot): Make static.
7090 (General_optoins::is_in_system_directory): New function.
7091 * fileread.cc (Input_file::is_in_system_directory): New function.
7092 * fileread.h (class Input_file): Declare is_in_system_directory.
7093 * object.h (class Object): Add is_in_system_directory.
7094 (class Input_objects): Remove system_library_directory_ field.
7095 * object.cc (Input_objects::add_object): Don't set
7096 system_library_directory_.
7097 (input_objects::found_in_system_library_directory): Remove.
7098 * symtab.cc (Symbol_table::write_globals): Remove input_objects
7099 parameter. Change all callers.
7100 (Symbol_table::sized_write_globals): Likewise.
7101 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
7102 Call Object::is_in_system_directory.
7103 * symtab.h (class Symbol_table): Update declarations.
7106 * descriptors.h (Open_descriptor): Add is_on_stack field.
7107 * descriptors.cc (Descriptors::open): If the descriptor is on the
7108 top of the stack, remove it. Initialize is_on_stack field.
7109 (Descriptors::release): Only add pod to stack if it is not on the
7111 (Descriptors::close_some_descriptor): Clear stack_next and
7115 * output.cc (Output_section::find_starting_output_address): Rename
7116 from starting_output_address; add PADDR parameter; change return
7118 * output.h (class Output_section): Declare
7119 find_starting_output_address instead of starting_output_address.
7120 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
7121 section symbol for which we can't find a merge section.
7124 * symtab.cc (Symbol_table::add_from_object): If the visibility is
7125 hidden or internal, force the symbol to be local.
7126 * resolve.cc (Symbol::override_visibility): Define.
7127 (Symbol::override_base): Use override_visibility.
7128 (Symbol_table::resolve): Likewise.
7129 (Symbol::override_base_with_special): Likewise.
7130 (Symbol_table::override_with_special): If the visibility is hidden
7131 or internal, force the symbol to be local.
7132 * symtab.h (class Symbol): Add set_visibility and
7133 override_visibility.
7134 * testsuite/ver_test_1.sh: New file.
7135 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
7136 (check_DATA): Add ver_test_1.syms.
7137 (ver_test_1.syms): New target.
7138 * testsuite/Makefile.in: Rebuild.
7140 2009-02-25 Cary Coutant <ccoutant@google.com>
7142 * layout.cc (Layout::choose_output_section): Don't rename sections
7143 when using a linker script that has a SECTIONS clause.
7144 * Makefile.in: Regenerate.
7146 * testsuite/Makefile.am (script_test_5.sh): New test case.
7147 * testsuite/Makefile.in: Regenerate.
7148 * testsuite/script_test_5.cc: New file.
7149 * testsuite/script_test_5.sh: New file.
7150 * testsuite/script_test_5.t: New file.
7152 2009-02-13 Rafael Avila de Espindola <espindola@google.com>
7154 * archive.cc (Archive::include_member): Update calls to add_symbols.
7155 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
7156 the Layout argument.
7157 * dynobj.h (do_add_symbols): Add the Layout argument.
7158 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
7160 * object.h (Object::add_symbols): Add the Layout argument.
7161 (Object::do_add_symbols): Add the Layout argument.
7162 (Sized_relobj::do_add_symbols): Add the Layout argument.
7163 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
7164 Unify the two versions.
7165 (Add_plugin_symbols): Remove.
7166 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
7167 (Sized_pluginobj::do_add_symbols): Unify the two versions.
7168 (Add_plugin_symbols): Remove.
7169 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
7170 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
7171 (Add_symbols::run): Make it work with Pulginobj.
7173 2009-02-06 Ian Lance Taylor <iant@google.com>
7175 * object.cc (Sized_relobj::do_layout): Make info message start
7176 with lower case letter.
7178 2009-02-06 Mikolaj Zalewski <mikolajz@google.com>
7180 * binary.cc: Fix file comment.
7182 * options.h (enum Incremental_disposition): Define.
7183 (class General_options): Add new options: --incremental,
7184 --incremental_changed, --incremental_unchanged,
7185 --incremental_unknown. Add incremental_disposition_ and
7186 implicit_incremental_ fields.
7187 (General_options::incremental_disposition): New function.
7188 (class Position_dependent_options): Add incremental_disposition
7190 (Position_dependent_options::copy_from_options): Set incremental
7192 * options.cc (General_options::parse_incremental_changed): New
7194 (General_options::parse_incremental_unchanged): New function.
7195 (General_options::parse_incremental_unknown): New function.
7196 (General_options::General_options): Initialize new fields
7197 incremental_disposition_ and implicit_incremental_.
7198 (General_options::finalize): Check for uasge of --incremental-*
7199 without --incremental.
7201 2009-02-06 Chris Demetriou <cgd@google.com>
7203 * gold.h (gold_undefined_symbol): Change to take only a Symbol
7204 pointer and to report location as the file name associated with
7206 (gold_undefined_symbol_at_location): New function to replace the
7207 old gold_undefined_symbol functionality.
7208 * target-reloc.h (relocate_section): Update to use
7209 gold_undefined_symbol_at_location.
7210 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
7211 Call gold_undefined_symbol function rather than gold_error.
7212 * errors.h (Errors::undefined_symbol): Take location as a
7213 string, rather than calculating it from a relocation.
7214 * errors.cc (Errors::fatal): Print "fatal error:" before the
7216 (Errors::error, Errors::error_at_location): Print "error: "
7217 before the formatted message.
7218 (Errors::undefined_symbol): Take location as a string, rather
7219 than calculating it from a relocation.
7220 (gold_undefined_symbol_at_location): New function akin to
7221 old gold_undefined_symbol, calculates location from relocation.
7222 (gold_undefined_symbol): Change to take only a Symbol pointer
7223 and to report location as the file name associated with the symbol.
7224 * testsuite/debug_msg.sh: Update for changed error messages.
7225 * testsuite/undef_symbol.sh: Likewise.
7227 2009-02-04 Duncan Sands <baldrick@free.fr>
7230 * reduced_debug_output.h
7231 (Output_reduced_debug_abbrev_section::failed): Use format for
7233 (Output_reduced_debug_info_section::faild): Likewise.
7235 2009-01-31 Mikolaj Zalewski <mikolajz@google.com>
7237 * script.cc (Lazy_demangler): New class.
7238 (Version_script_info::get_symbol_version_helper): Demangle a
7241 2009-01-29 Cary Coutant <ccoutant@google.com>
7243 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
7245 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
7247 2009-01-28 Ian Lance Taylor <iant@google.com>
7249 * version.cc (version_string): Bump to 1.9.
7251 * gold.h: Include <cstring> and <stdint.h>.
7252 * version.cc: Include <cstdio>.
7253 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
7255 * reduced_debug_output.cc (insert_into_vector): Rename from
7256 Insert_into_vector; change all callers. Use Swap_unaligned to
7257 avoid aliasing issue; remove union since it is unnecessary.
7259 2009-01-27 Sriraman Tallam <tmsriram@google.com>
7261 * Makefile.am (CCFILES): Add gc.cc.
7263 * Makefile.in: Regenerate.
7264 * gold.cc (Gc_runner): New class.
7265 (queue_initial_tasks): Call garbage collection related tasks
7266 when corresponding options are invoked.
7267 (queue_middle_gc_tasks): New function.
7268 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
7269 processed early before laying out sections during garbage collection.
7270 * gold.h (queue_middle_gc_tasks): New function.
7271 (is_prefix_of): Move from "layout.cc".
7272 * i386.cc (Target_i386::gc_process_relocs): New function.
7273 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
7274 * main.cc (main): Create object of class "Garbage_collection".
7275 * object.cc (Relobj::copy_symbols_data): New function.
7276 (Relobj::is_section_name_included): New function.
7277 (Sized_relobj::do_layout): Allow this function to be called twice
7278 during garbage collection and defer layout of section during the
7280 * object.h (Relobj::get_symbols_data): New function.
7281 (Relobj::is_section_name_included): New function.
7282 (Relobj::copy_symbols_data): New function.
7283 (Relobj::set_symbols_data): New function.
7284 (Relobj::get_relocs_data): New function.
7285 (Relobj::set_relocs_data): New function.
7286 (Relobj::is_output_section_offset_invalid): New pure virtual function.
7287 (Relobj::gc_process_relocs): New function.
7288 (Relobj::do_gc_process_relocs): New pure virtual function.
7289 (Relobj::sd_): New data member.
7290 (Sized_relobj::is_output_section_offset_invalid): New function.
7291 (Sized_relobj::do_gc_process_relocs): New function.
7292 * options.h (General_options::gc_sections): Modify to not be a no-op.
7293 (General_options::print_gc_sections): New option.
7294 * plugin.cc (Plugin_finish::run): Remove function call to
7295 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
7296 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
7297 * reloc.cc (Read_relocs::run): Add task to process relocs and
7298 determine unreferenced sections when doing garbage collection.
7299 (Gc_process_relocs): New class.
7300 (Sized_relobj::do_gc_process_relocs): New function.
7301 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
7302 sections that are garbage collected.
7303 * reloc.h (Gc_process_relocs): New class.
7304 * sparc.cc (Target_sparc::gc_process_relocs): New function.
7305 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
7306 symbols whose corresponding sections are garbage collected.
7307 (Symbol_table::Symbol_table): Add new parameter for the garbage
7309 (Symbol_table::gc_mark_undef_symbols): New function.
7310 (Symbol_table::gc_mark_symbol_for_shlib): New function.
7311 (Symbol_table::gc_mark_dyn_syms): New function.
7312 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
7314 (Symbol_table::add_from_object): Likewise.
7315 (Symbol_table::add_from_relobj): When building shared objects, do not
7316 treat externally visible symbols as garbage.
7317 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
7318 table information for static and relocatable links.
7319 * symtab.h (Symbol_table::set_gc): New function.
7320 (Symbol_table::gc): New function.
7321 (Symbol_table::gc_mark_undef_symbols): New function.
7322 (Symbol_table::gc_mark_symbol_for_shlib): New function.
7323 (Symbol_table::gc_mark_dyn_syms): New function.
7324 (Symbol_table::gc_): New data member.
7325 * target.h (Sized_target::gc_process_relocs): New pure virtual
7327 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
7328 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
7330 2009-01-20 Chris Faylor <me.sourceware@sourceware.org>
7332 * options.h (General_options::gc_sections): Define as a no-op for now.
7333 (General_options::no_keep_memory): Ditto.
7334 (General_options::Bshareable): Define.
7335 * options.cc (General_options::finalize): Honor -Bshareable.
7337 2009-01-20 Andreas Schwab <schwab@suse.de>
7339 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
7340 read the value in the contents, since we don't use it. Use the
7341 template endianness when writing.
7342 (Relocate::relocate): Use it for R_PPC_REL16_HA.
7344 2009-01-19 Andreas Schwab <schwab@suse.de>
7346 * configure.tgt (powerpc64-*): Fix targ_obj.
7348 2009-01-15 Ian Lance Taylor <iant@google.com>
7350 * object.cc (Sized_relobj::write_local_symbols): Don't write out
7351 local symbols when stripping all symbols.
7353 2009-01-14 Cary Coutant <ccoutant@google.com>
7355 * output.cc (Output_reloc): Add explicit instantiations.
7357 2009-01-14 Cary Coutant <ccoutant@google.com>
7359 * archive.cc (Archive::get_elf_object_for_member): Remove call
7360 to File_read::claim_for_plugin.
7361 * descriptors.cc (Descriptors::open): Remove reference to
7363 (Descriptors::claim_for_plugin): Remove.
7364 * descriptors.h (Descriptors::claim_for_plugin): Remove.
7365 (Descriptors::is_claimed): Remove.
7366 (claim_descriptor_for_plugin): Remove.
7367 * fileread.cc (File_read::claim_for_plugin): Remove.
7368 * fileread.h (File_read::claim_for_plugin): Remove.
7369 (File_read::descriptor): Reopen descriptor if necessary.
7370 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
7371 (Plugin_manager::all_symbols_read): Add task parameter. Change
7373 (Plugin_manager::get_input_file): New function.
7374 (Plugin_manager::release_input_file): New function.
7375 (Pluginobj::Pluginobj): Add filesize parameter and initialize
7376 corresponding data member.
7377 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
7378 and pass to base constructor. Change all callers.
7379 (get_input_file, release_input_file): New functions.
7380 (make_sized_plugin_object): Add filesize parameter. Change all callers.
7381 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
7382 (Plugin_manager::all_symbols_read): Add task parameter.
7383 (Plugin_manager::get_input_file): New function.
7384 (Plugin_manager::release_input_file): New function.
7385 (Plugin_manager::task_): New data member.
7386 (Pluginobj::Pluginobj): Add filesize parameter.
7387 (Pluginobj::filename): New function.
7388 (Pluginobj::descriptor): New function.
7389 (Pluginobj::filesize): New function.
7390 (Pluginobj::filesize_): New data member.
7391 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
7392 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
7393 File_read::claim_for_plugin; use Object::unlock to unlock the file.
7395 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
7396 with archive libraries.
7397 * testsuite/Makefile.in: Regenerate.
7398 * testsuite/plugin_test.c (struct sym_info): New type.
7399 (get_input_file, release_input_file): New static variables.
7400 (onload): Capture new transfer vector entries.
7401 (claim_file_hook): Stop reading at end of file according to filesize.
7402 Factor out parsing of readelf output into separate function.
7403 (all_symbols_read_hook): Exercise get_input_file and release_input_file
7404 APIs and get the source file name from the symbol table. Convert
7405 source file name to corresponding object file name. Print info
7406 message when adding new input files.
7407 (parse_readelf_line): New function.
7408 * testsuite/plugin_test_1.sh: Add checks for new info messages.
7409 * testsuite/plugin_test_2.sh: Likewise.
7410 * testsuite/plugin_test_3.sh: Likewise.
7411 * testsuite/plugin_test_4.sh: New test case.
7413 2009-01-07 Ian Lance Taylor <iant@google.com>
7415 * version.cc (version_string): Bump to 1.8.
7417 2008-12-23 Cary Coutant <ccoutant@google.com>
7419 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
7420 * plugin.cc (Plugin_manager::finish): Rename as
7421 layout_deferred_objects. Move cleanup to separate function.
7422 (Plugin_manager::cleanup): New function.
7423 (Plugin_finish::run): Call layout_deferred_objects and cleanup
7425 * plugin.h (Plugin_manager::finish): Rename as
7426 layout_deferred_objects.
7427 (Plugin_manager::cleanup): New function.
7428 (Plugin_manager::cleanup_done): New field.
7430 2008-12-23 Cary Coutant <ccoutant@google.com>
7432 * plugin.cc (is_visible_from_outside): New function.
7433 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
7434 so we don't return "IR only" status for exported symbols or -r links.
7436 * testsuite/Makefile.am (plugin_test_3): New test case.
7437 * testsuite/Makefile.in: Regenerate.
7438 * testsuite/plugin_test_3.sh: New file.
7440 2008-12-22 Cary Coutant <ccoutant@google.com>
7442 * object.cc (Sized_relobj::layout_section): New function.
7443 (Sized_relobj::do_layout): Defer layout of input sections until after
7444 plugin has provided replacement files.
7445 (Sized_relobj::do_layout_deferred_sections): New function.
7446 * object.h (Relobj::set_section_offset): Remove virtual keyword.
7447 (Relobj::layout_deferred_sections): New function.
7448 (Relobj::do_layout_deferred_sections): New function.
7449 (Sized_relobj::do_layout_deferred_sections): New function.
7450 (Sized_relobj::layout_section): New function.
7451 (Sized_relobj::Deferred_layout): New structure.
7452 (Sized_relobj::deferred_layout_): New field.
7453 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
7454 Change all callers. Layout deferred sections.
7455 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
7457 (Plugin_hook::run): Move code from do_plugin_hook inline.
7458 (Plugin_hook::do_plugin_hook): Remove.
7459 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
7460 (Plugin_manager::finish): Renamed, was cleanup.
7461 (Plugin_manager::should_defer_layout): New function.
7462 (Plugin_manager::add_deferred_layout_object): New function.
7463 (Plugin_manager::Deferred_layout_list): New type.
7464 (Plugin_manager::deferred_layout_objects_): New field.
7465 (Plugin_hook::do_plugin_hook): Remove.
7467 2008-12-17 Ian Lance Taylor <iant@google.com>
7469 * options.h (class General_options): Add --no case for
7472 2008-12-16 Cary Coutant <ccoutant@google.com>
7474 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
7476 (Plugin_manager::claim_file): Create plugin object even if
7477 plugin did not call the add_symbols callback.
7478 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
7479 asking for more symbols than were added.
7480 * testsuite/Makefile.am (plugin_test_1): Add test case with
7482 (empty.syms): New target.
7483 * testsuite/Makefile.in: Regenerate.
7484 * testsuite/plugin_test.c (claim_file_hook): Add new debug
7485 message. Don't call add_symbols if no globals.
7486 (all_symbols_read_hook): Don't provide replacement for empty
7489 2008-12-12 Ian Lance Taylor <iant@google.com>
7491 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
7492 r_type == 0 for a local symbol with r_sym == 0.
7493 (scan_relocatable_relocs): Pass r_sym to
7494 local_non_section_strategy.
7495 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
7498 * configure.ac: Update test for TLS descriptors: they are
7499 supported as of glibc 2.9.
7500 * configure: Rebuild.
7502 2008-12-11 Ian Lance Taylor <iant@google.com>
7505 * target-reloc.h (Default_scan_relocatable_relocs): For each
7506 function, map r_type == 0 to RELOC_DISCARD.
7508 2008-12-10 Cary Coutant <ccoutant@google.com>
7510 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
7511 object to override a kept COMDAT group from a plugin object.
7513 2008-12-09 Ian Lance Taylor <iant@google.com>
7516 * yyscript.y (file_cmd): Handle INPUT.
7518 * testsuite/initpri1.c: Change all declarations to be full
7519 prototypes by adding void, to avoid compiler warnings.
7521 2008-12-05 Rafael Avila de Espindola <espindola@google.com>
7523 * options.cc (General_options::parse_plugin_opt): New.
7524 (General_options::add_plugin): The argument now is just the filename.
7525 (General_options::add_plugin_option): New.
7526 * options.h (plugin_opt): New.
7527 (add_plugin): Change argument name.
7528 (add_plugin_option): New.
7529 * plugin.cc (Plugin::load): Don't parse the plugin option.
7530 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
7531 (Plugin::add_option): New.
7532 (Plugin::args_): Change type.
7533 (Plugin::filename_): New.
7534 (Plugin_manager::add_plugin_option): New.
7535 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
7536 * testsuite/Makefile.in: Regenerate.
7538 2008-12-05 Cary Coutant <ccoutant@google.com>
7540 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
7541 Handle --strip-lto-sections option.
7542 * options.h (strip_lto_sections): New option.
7544 2008-12-01 Cary Coutant <ccoutant@google.com>
7546 * plugin.cc (ld_plugin_message): Change format parameter to const.
7547 Fix mismatch between new[] and delete.
7549 2008-11-14 Cary Coutant <ccoutant@google.com>
7551 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
7554 2008-11-05 Craig Silverstein <csilvers@google.com>
7556 * options.cc (General_options::parse_dynamic_list): New function.
7557 * options.h (General_options): New flags dynamic_list,
7558 dynamic_list_data, dynamic_list_cpp_new, and
7559 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
7560 (General_options::in_dynamic_list): New function.
7561 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
7562 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
7563 (Lex::can_continue_name): Likewise.
7565 (read_script_file): New parameter script_options.
7566 (read_dynamic_list): New function.
7567 (Script_options::define_dynamic_list): New function.
7568 (dynamic_list_keyword_parsecodes): New variable.
7569 (dynamic_list_keywords): New variable.
7570 * script.h (Script_options::define_dynamic_list): New function
7572 (read_dynamic_list): New function prototype.
7573 * symtab.cc (strprefix): New macro.
7574 (Symbol::should_add_dynsym_entry): Support dynamic_list,
7575 dynamic_list_data, dynamic_list_cpp_new, and
7576 dynamic_list_cpp_typeinfo.
7577 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
7578 (dynamic_list_expr): New rule.
7579 (dynamic_list_nodes): Likewise.
7580 (dynamic_list_node): Likewise.
7581 * testsuite/Makefile.am (dynamic_list): New test.
7582 * testsuite/Makefile.in: Regenerated.
7583 * testsuite/dynamic_list.t: New file.
7584 * testsuite/dynamic_list.sh: New file.
7586 2008-11-05 Craig Silverstein <csilvers@google.com>
7588 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
7589 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
7590 (t11_last): Likewise.
7591 * testsuite/ver_test_6.c (main): Likewise.
7593 2008-10-07 Cary Coutant <ccoutant@google.com>
7595 * options.c (General_options::finalize): Add check for -static and
7597 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
7600 2008-10-02 Cary Coutant <ccoutant@google.com>
7602 * plugin.cc (make_sized_plugin_object): Fix conditional
7603 compilation to work when not all targets are enabled.
7605 2008-09-29 Cary Coutant <ccoutant@google.com>
7607 * archive.cc (Archive::get_file_and_offset): Use filename instead
7608 of name to get library path.
7609 (Archive::include_member): Unlock external member of a thin archive.
7611 * testsuite/Makefile.am (TEST_AR): New variable.
7612 (thin_archive_test_1): New test.
7613 (thin_archive_test_2): New test.
7614 * testsuite/Makefile.in: Regenerate.
7615 * testsuite/thin_archive_main.cc: New file.
7616 * testsuite/thin_archive_test_1.cc: New file.
7617 * testsuite/thin_archive_test_2.cc: New file.
7618 * testsuite/thin_archive_test_3.cc: New file.
7619 * testsuite/thin_archive_test_4.cc: New file.
7621 2008-09-29 Cary Coutant <ccoutant@google.com>
7623 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
7624 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
7626 (Sized_relobj::do_finalize_local_symbols): Likewise.
7627 (Sized_relobj::map_to_kept_section): Likewise.
7628 * object.h (Sized_relobj::invalid_address): New constant.
7629 (Sized_relobj::do_output_section_offset): Check for invalid_address
7631 * output.cc (Output_reloc::local_section_offset): Use constant
7632 invalid_address instead of -1U.
7633 (Output_reloc::get_address): Likewise.
7634 (Output_section::output_address): Change -1U to -1ULL.
7635 * output.h (Output_reloc::invalid_address): New constant.
7636 * reloc.cc (Sized_relobj::write_sections): Use constant
7637 invalid_address instead of -1U.
7638 (Sized_relobj::relocate_sections): Likewise.
7639 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
7640 values for merge sections.
7641 * target-reloc.h (relocate_for_relocatable): Use constant
7642 invalid_address instead of -1U.
7644 2008-09-19 Cary Coutant <ccoutant@google.com>
7646 Add plugin functionality for link-time optimization (LTO).
7647 * configure.ac (plugins): Add --enable-plugins option.
7648 * configure: Regenerate.
7649 * config.in: Regenerate.
7650 * Makefile.am (LIBDL): New variable.
7651 (CCFILES): Add plugin.cc.
7652 (HFILES): Add plugin.h.
7653 (ldadd_var): Add LIBDL.
7654 * Makefile.in: Regenerate.
7656 * archive.cc: Include "plugin.h".
7657 (Archive::setup): Don't preread archive symbols when using a plugin.
7658 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
7659 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
7661 (Archive::include_member): Add symbols from plugin objects.
7662 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
7663 * descriptors.cc (Descriptors::open): Check for file descriptors
7664 abandoned by plugins.
7665 (Descriptors::claim_for_plugin): New function.
7666 * descriptors.h (Descriptors::claim_for_plugin): New function.
7667 (Open_descriptor::is_claimed): New field.
7668 (claim_descriptor_for_plugin): New function.
7669 * fileread.cc (File_read::claim_for_plugin): New function.
7670 * fileread.h (File_read::claim_for_plugin): New function.
7671 (File_read::descriptor): New function.
7672 * gold.cc: Include "plugin.h".
7673 (queue_initial_tasks): Add task to call plugin hooks for generating
7675 * main.cc: Include "plugin.h".
7676 (main): Load plugin libraries.
7677 * object.h (Pluginobj): Declare.
7678 (Object::pluginobj): New function.
7679 (Object::do_pluginobj): New function.
7680 (Object::set_target): New function.
7681 * options.cc: Include "plugin.h".
7682 (General_options::parse_plugin): New function.
7683 (General_options::General_options): Initialize plugins_ field.
7684 (General_options::add_plugin): New function.
7685 * options.h (Plugin_manager): Declare.
7686 (General_options): Add --plugin option.
7687 (General_options::has_plugins): New function.
7688 (General_options::plugins): New function.
7689 (General_options::add_plugin): New function.
7690 (General_options::plugins_): New field.
7691 * plugin.cc: New file.
7692 * plugin.h: New file.
7693 * readsyms.cc: Include "plugin.h".
7694 (Read_symbols::do_read_symbols): Check for archive before checking
7695 for ELF file. Call plugin hooks to claim files.
7696 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
7697 from a real object file; force override when processing replacement
7699 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
7700 (Symbol::init_base_object): Likewise.
7701 (Symbol::init_base_output_data): Likewise.
7702 (Symbol::init_base_output_segment): Likewise.
7703 (Symbol::init_base_constant): Likewise.
7704 (Symbol::init_base_undefined): Likewise.
7705 (Symbol::output_section): Assert that object is not a plugin.
7706 (Symbol_table::add_from_pluginobj): New function.
7707 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
7709 (Symbol_table::sized_write_globals): Likewise.
7710 (Symbol_table::add_from_pluginobj): Instantiate template.
7711 * symtab.h (Sized_pluginobj): Declare.
7712 (Symbol::in_real_elf): New function.
7713 (Symbol::set_in_real_elf): New function.
7714 (Symbol::in_real_elf_): New field.
7715 (Symbol_table::add_from_pluginobj): New function.
7717 * testsuite/Makefile.am (AM_CFLAGS): New variable.
7718 (LIBDL): New variable.
7720 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
7721 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
7722 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
7723 (MOSTLYCLEANFILES): Likewise.
7724 * testsuite/Makefile.in: Regenerate.
7725 * testsuite/plugin_test.c: New file.
7726 * testsuite/plugin_test_1.sh: New file.
7727 * testsuite/plugin_test_2.sh: New file.
7729 2008-09-16 Ian Lance Taylor <iant@google.com>
7731 * target-reloc.h (relocate_section): Check whether a symbol is
7732 defined by the ABI before reporting an undefined symbol error.
7733 * target.h (Target::is_defined_by_abi): Make parameter const.
7734 (Target::do_is_defined_by_abi): Likewise.
7735 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
7736 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
7737 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
7738 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
7739 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
7740 * testsuite/Makefile.in: Rebuild.
7742 * fileread.cc (make_view): Add casts to avoid warning.
7744 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
7746 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
7747 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
7749 2008-09-16 Alexandre Oliva <aoliva@redhat.com>
7751 * options.h (General_options::output_is_executable): New.
7752 (General_options::output_is_pie): New.
7753 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
7754 for shared libraries.
7755 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
7757 2008-09-11 Chris Demetriou <cgd@google.com>
7759 * options.h (origin): New -z option.
7760 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
7761 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
7764 2008-09-05 Cary Coutant <ccoutant@google.com>
7766 * fileread.cc (File_read::make_view): Add check for attempt to map
7769 2008-09-05 Cary Coutant <ccoutant@google.com>
7771 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
7772 explicit instantiations.
7774 2008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
7777 * options.cc (General_options::finalize): Allow undefined symbols
7778 in shlibs if linking -shared.
7781 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
7782 symbols as not needing a dynsym entry.
7784 2008-08-20 Craig Silverstein <csilvers@google.com>
7786 * fileread.cc (File_read::open): Do not lock the file unless it
7787 was successfully opened.
7789 2008-08-14 Cary Coutant <ccoutant@google.com>
7791 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
7792 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
7793 * testsuite/tls_test.cc (struct int128): 128-bit struct
7794 for testing TLS relocs with non-zero addend.
7795 (v12): New TLS variable.
7797 (t_last): Add check for v12.
7798 * testsuite/tls_test.h (t12): New function.
7799 * testsuite/tls_test_main.cc (thread_routine): Call new test.
7801 2008-08-13 Ian Lance Taylor <iant@google.com>
7803 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
7804 set tls_segment_ or relro_segment_.
7805 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
7807 * output.h (Output_section::clear_is_relro): New function.
7808 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
7809 sections specially even when output_data_ is empty.
7810 (Output_segment::maximum_alignment): When first section is relro,
7811 only force alignment for PT_LOAD segments.
7812 * script.cc (script_data_segment_align): New function.
7813 (script_data_segment_relro_end): New function.
7814 * script-c.h (script_data_segment_align): Declare.
7815 (script_data_segment_relro_end): Declare.
7816 * script-sections.h (class Script_sections): Declare
7817 data_segment_align and data_segment_relro_end. Add fields
7818 segment_align_index_ and saw_relro_end_.
7819 * script-sections.cc (class Sections_element): Add set_is_relro
7820 virtual function. Add new bool* parameter to place_orphan_here.
7821 Add get_output_section virtual function.
7822 (class Output_section_definition): Add set_is_relro. Add new
7823 bool* parameter to place_orphan_here. Add get_output_section.
7824 Add is_relro_ field.
7825 (Output_section_definition::Output_section_definition): Initialize
7826 evaluated_address_, evaluated_load_address, evaluated_addralign_,
7827 and is_relro_ fields.
7828 (Output_section_definition::place_orphan_here): Add is_relro
7830 (Output_section_definition::set_section_addresses): Set relro for
7832 (Output_section_definition::alternate_constraint): Likewise.
7833 (class Orphan_output_section): Add new bool* parameter to
7834 place_orphan_here. Add get_output_section.
7835 (Orphan_output_section::place_orphan_here): Add is_relro
7837 (Script_sections::Script_sections): Initialize
7838 data_segment_align_index_ and saw_relro_end_.
7839 (Script_sections::data_segment_align): New function.
7840 (Script_sections::data_segment_relro_end): New function.
7841 (Script_sections::place_orphan): Set or clear is_relro.
7842 (Script_sections::set_section_addresses): Force alignment of first
7844 * yyscript.y (exp): Call script_data_segment_align and
7845 script_data_segment_relro_end.
7846 * testsuite/relro_script_test.t: New file.
7847 * testsuite/relro_test.cc (using_script): Declare.
7848 (t1, t2): Test using_script.
7849 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
7850 (relro_script_test_SOURCES): Define.
7851 (relro_script_test_DEPENDENCIES): Define.
7852 (relro_script_test_LDFLAGS): Define.
7853 (relro_script_test_LDADD): Define.
7854 (relro_script_test.so): New target.
7855 * testsuite/Makefile.in: Rebuild.
7857 2008-08-06 Cary Coutant <ccoutant@google.com>
7859 * archive.cc (Archive::total_archives, Archive::total_members)
7860 (Archive::total_members_loaded): New variables.
7861 (Archive::setup): Add parameter. Add option to preread
7863 (Archive::read_armap): Add counter.
7864 (Archive::get_file_and_offset): New function.
7865 (Archive::get_elf_object_for_member): New function.
7866 (Archive::read_all_symbols): New function.
7867 (Archive::read_symbols): New function.
7868 (Archive::add_symbols): Add counters.
7869 (Archive::include_all_members): Use armap to find members if it's
7871 (Archive::include_member): Skip reading symbols if already read.
7872 Factored code into Archive::get_file_and_offset and
7873 Archive::get_elf_object_for_member. Changed call to
7874 Mapfile::report_include_archive_member.
7875 (Archive::print_stats): New function.
7876 * archive.h: Declare Object and Read_symbols_data classes.
7877 (Archive::Archive): Add initializers for new members.
7878 (Archive::setup): Add parameter.
7879 (Archive::print_stats): New function.
7880 (Archive::total_archives, Archive::total_members)
7881 (Archive::total_members_loaded): New variables.
7882 (Archive::get_file_and_offset): New function.
7883 (Archive::get_elf_object_for_member): New function.
7884 (Archive::read_all_symbols): New function.
7885 (Archive::read_symbols): New function.
7886 (Archive::Archive_member): New class.
7887 (Archive::members_): New member.
7888 (Archive::num_members_): New member.
7889 * main.cc: Include archive.h.
7890 (main): Call Archive::print_stats.
7891 * mapfile.cc (Mapfile::report_include_archive_member): Delete
7892 archive parameter; member_name is now the fully-decorated name.
7893 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
7894 * options.h: (General_options): Add --preread-archive-symbols option.
7895 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
7898 2008-08-04 Ian Lance Taylor <iant@google.com>
7900 * symtab.h (Symbol::use_plt_offset): New function.
7901 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
7902 * powerpc.cc (Relocate::relocate): Likewise.
7903 * sparc.cc (Relocate::relocate): Likewise.
7904 * x86_64.cc (Relocate::relocate): Likewise.
7905 * testsuite/weak_plt.sh: New test.
7906 * testsuite/weak_plt_main.cc: New test.
7907 * testsuite/weak_plt_shared.cc: New test.
7908 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
7909 (check_PROGRAMS): Add weak_plt.
7910 (check_DATA): Add weak_plt_shared.so.
7911 (weak_plt_main_pic.o, weak_plt): New targets.
7912 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
7913 * testsuite/Makefile.in: Rebuild.
7915 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
7917 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
7918 * testsuite/Makefile.in: Rebuild.
7920 2008-08-04 Alan Modra <amodra@bigpond.net.au>
7922 * Makefile.am (POTFILES.in): Set LC_ALL=C.
7923 * Makefile.in: Regenerate.
7924 * po/POTFILES.in: Regenerate.
7926 2008-07-29 Ian Lance Taylor <iant@google.com>
7928 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
7929 symbols before other symbols.
7930 * testsuite/script_test_2.cc (test_addr): Declare.
7931 (test_addr_alias): Declare.
7932 (main): Check that test_addr and test_addr_alias have the right
7934 * testsuite/script_test_2.t: Define test_addr_alias and
7937 2008-07-24 Ian Lance Taylor <iant@google.com>
7940 * descriptors.cc: New file.
7941 * descriptors.h: New file.
7942 * gold-threads.h (class Hold_optional_lock): New class.
7943 * fileread.cc: Include "descriptors.h".
7944 (File_read::~File_read): Release descriptor rather than closing
7946 (File_read::open) [file]: Call open_descriptor rather than open.
7947 Set is_descriptor_opened_.
7948 (File_read::open) [memory]: Assert that descriptor is not open.
7949 (File_read::reopen_descriptor): New function.
7950 (File_read::release): Release descriptor.
7951 (File_read::do_read): Make non-const. Reopen descriptor.
7952 (File_read::read): Make non-const.
7953 (File_read::make_view): Reopen descriptor.
7954 (File_read::do_readv): Likewise.
7955 * fileread.h (class File_read): Add is_descriptor_opened_ field.
7956 Update declarations.
7957 * layout.cc: Include "descriptors.h".
7958 (Layout::create_build_id): Use open_descriptor rather than open.
7959 * output.cc: Include "descriptors.h".
7960 (Output_file::open): Use open_descriptor rather than open.
7961 * archive.cc (Archive::const_iterator): Change Archive to be
7963 (Archive::begin, Archive::end): Make non-const.
7964 (Archive::count_members): Likewise.
7965 * archive.h (class Archive): Update declarations.
7966 * object.h (Object::read): Make non-const.
7967 * Makefile.am (CCFILES): Add descriptors.cc.
7968 (HFILES): Add descriptors.h.
7969 * Makefile.in: Rebuild.
7972 * gold.h: Always include <clocale>. Add Solaris workarounds
7973 following code in binutils/sysdep.h.
7976 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
7977 this->eh_frame_hdr_ is NULL before using it.
7979 * dynobj.cc (Versions::Versions): Update comment.
7981 * dynobj.cc (Versions::Versions): If there is an soname, use it as
7982 the base version name.
7984 * stringpool.cc (Stringpool_template::add_with_length): Set key to
7985 array size plus one.
7986 (Stringpool_template::set_string_offsets): Subtract one from key
7987 before using it as an array index.
7988 (Stringpool_template::get_offset_with_length): Likewise.
7989 (Stringpool_template::write_to_buffer): Likewise.
7990 * stringpool.h (Stringpool_template::get_offset_from_key):
7993 2008-07-23 Ian Lance Taylor <iant@google.com>
7996 * object.h (Merged_symbol_value::value): Do our best to handle a
8000 * script.cc (Version_script_info::get_versions): Don't add empty
8001 version tag to return value.
8002 (Version_script_info::get_symbol_version_helper): Change return
8003 type to bool. Add pversion parameter. Change all callers.
8004 (script_register_vers_node): Don't require a non-NULL tag.
8005 * script.h (class Version_script_info): Update declarations.
8006 (Version_script_info::get_symbol_version): Change return type to
8007 bool. Add version parameter. Change all callers.
8008 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
8009 handling. Handle an empty version from a version script.
8010 (Symbol_table::define_special_symbol): Likewise.
8011 * testsuite/ver_test_10.script: New file.
8012 * testsuite/ver_test_10.sh: New file.
8013 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
8014 (check_DATA): Add ver_test_10.syms.
8015 (ver_test_10.syms, ver_test_10.so): New target.
8016 * testsuite/Makefile.in: Rebuild.
8018 2008-07-23 Simon Baldwin <simonb@google.com>
8020 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
8021 to zero for undefined symbols from dynamic libraries.
8023 2008-07-23 Ian Lance Taylor <iant@google.com>
8025 * symtab.cc (Symbol_table::resolve): Remove version parameter.
8027 * symtab.h (class Symbol_table): Update declaration.
8028 * testsuite/ver_test_9.cc: New file.
8029 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
8030 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
8031 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
8032 (ver_test_9.so, ver_test_9.o): New targets.
8033 * testsuite/Makefile.in: Rebuild.
8035 2008-07-22 Ian Lance Taylor <iant@google.com>
8037 * options.h (class General_options): Define --check-sections.
8038 * layout.cc (Layout::set_segment_offsets): Handle
8041 * options.h (class General_options): Define -n/--nmagic and
8043 * options.cc (General_options::finalize): For -n/--nmagic or
8044 -N/--omagic, set -static.
8045 * layout.cc (Layout::attach_allocated_section_to_segment): If
8046 -N/--omagic, don't put read-only and read-write sections in
8048 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
8049 finding a read-only segment.
8050 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
8051 don't set the minimum segment alignment to the common page size,
8052 and don't set the file offset to the address modulo the page size.
8053 * script-sections.cc (Script_sections::create_segments): If
8054 -n/--omagic, don't put read-only and read-write sections in
8057 * cref.cc: New file.
8059 * options.h (class General_options): Add --print-symbol-counts.
8060 * main.cc (main): Issue defined symbol report if requested.
8061 * archive.cc (Archive::interpret_header): Make into a const member
8063 (Archive::add_symbols): Call Input_objects::archive_start and
8065 (Archive::const_iterator): Define new class.
8066 (Archive::begin, Archive::end): New functions.
8067 (Archive::include_all_members): Rewrite to use iterator.
8068 (Archive::count_members): New function.
8069 * archive.h (class Archive): Update declarations.
8070 (Archive::filename): New function.
8071 * object.cc: Include "cref.h".
8072 (Sized_relobj::Sized_relobj): Initialize defined_count_.
8073 (Sized_relobj::do_get_global_symbol_counts): New function.
8074 (Input_objects::add_object): Add object to cross-referencer.
8075 (Input_objects::archive_start): New function.
8076 (Input_objects::archive_stop): New function.
8077 (Input_objects::print_symbol_counts): New function.
8078 * object.h: Declare Cref and Archive.
8079 (Object::get_global_symbol_counts): New function.
8080 (Object::do_get_global_symbol_counts): New pure virtual function.
8081 (class Sized_relobj): Add defined_count_ field. Update
8083 (class Input_objects): Add cref_ field. Update constructor.
8084 Update declarations.
8085 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
8087 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
8089 (Sized_dynobj::do_get_global_symbol_counts): New function.
8090 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
8091 defined_count_. Update declarations. Define Symbols typedef.
8092 * symtab.cc (Symbol_table::add_from_relobj): Add defined
8093 parameter. Change all callers.
8094 (Symbol_table::add_from_dynobj): Add sympointers and defined
8095 parameters. Change all callers.
8096 * symtab.h (class Symbol_table): Update declarations.
8097 * Makefile.am (CCFILES): Add cref.cc.
8098 (HFILES): Add cref.h.
8099 * Makefile.in: Rebuild.
8101 2008-07-22 Simon Baldwin <simonb@google.com>
8103 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
8104 to zero when writing undefined symbols.
8106 2008-07-22 Ian Lance Taylor <iant@google.com>
8108 * output.cc (Output_section::add_input_section): Don't try to
8109 merge empty merge sections.
8111 2008-07-21 Craig Silverstein <csilvers@google.com>
8113 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
8114 Include symbol version in error message.
8116 2008-07-20 Chris Demetriou <cgd@google.com>
8118 * configure.ac (gold_cv_c_random_seed): New configured variable.
8119 (RANDOM_SEED_CFLAGS): New substituted variable.
8120 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
8121 * configure: Rebuild.
8122 * Makefile.in: Likewise.
8123 * testsuite/Makefile.in: Likewise.
8125 2008-07-18 Ian Lance Taylor <iant@google.com>
8127 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
8128 where we see NAME/NULL and NAME/VERSION as separate symbols.
8129 * testsuite/ver_test_main.cc (main): Call t4.
8130 (t4, t4_2a): Define.
8131 * testsuite/ver_test_2.cc (t4_2): Define.
8132 * testsuite/ver_test_2.script: Put t4_2a in VER2.
8133 * testsuite/ver_test_4.cc (t4_2a): Define.
8134 * testsuite/ver_test_4.script: Put t4_2a in VER2.
8135 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
8137 2008-07-17 Ian Lance Taylor <iant@google.com>
8139 * dynobj.cc (Versions::add_def): If we give an error about a
8140 missing version, go ahead and create the version anyhow.
8142 2008-07-10 Ian Lance Taylor <iant@google.com>
8144 Handle output sections with more than 0x7fffffff bytes.
8145 * object.h (class Relobj): Change map_to_output_ to
8146 output_sections_, and just keep a section pointer. Change all
8147 uses. Move comdat group support to Sized_relobj.
8148 (Relobj::is_section_specially_mapped): Remove.
8149 (Relobj::output_section): Remove poff parameter. Change all
8151 (Relobj::output_section_offset): New function.
8152 (Relobj::set_section_offset): Rewrite.
8153 (Relobj::map_to_output): Remove.
8154 (Relobj::output_sections): New function.
8155 (Relobj::do_output_section_offset): New pure virtual function.
8156 (Relobj::do_set_section_offset): Likewise.
8157 (class Sized_relobj): Add section_offsets_ field. Add comdat
8158 group support from Relobj. Update declarations.
8159 (Sized_relobj::get_output_section_offset): New function.
8160 (Sized_relobj::do_output_section_offset): New function.
8161 (Sized_relobj::do_set_section_offset): New function.
8162 * object.cc (Relobj::output_section_address): Remove.
8163 (Sized_relobj::Sized_relobj): Initialize new fields.
8164 (Sized_relobj::include_section_group): Cast find_kept_object to
8166 (Sized_relobj::include_linkonce_section): Likewise.
8167 (Sized_relobj::do_layout): Use separate arrays for output section
8169 (Sized_relobj::do_count_local_symbols): Change map_to_output to
8171 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
8172 output_sections and section_offsets.
8173 (Sized_relobj::write_local_symbols): Likewise.
8174 (map_to_kept_section): Compute output address directly.
8175 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
8176 output_sections and section_offsets.
8177 (Sized_relobj::write_sections): Likewise.
8178 (Sized_relobj::relocate_sections): Likewise.
8179 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
8180 * output.h (class Output_reloc): Update declarations. Change
8181 u2_.relobj to Sized_relobj*.
8182 (class Output_data_reloc): Change add functions to use
8184 * output.cc (Output_reloc::Output_reloc): Change relobj to
8186 (Output_reloc::local_section_offset): Change return type to
8187 Elf_Addr. Use get_output_section_offset.
8188 (Output_reloc::get_address): Likewise.
8189 (Output_section::is_input_address_mapped): Don't call
8190 is_section_specially_mapped.
8191 (Output_section::output_offset): Likewise.
8192 (Output_section::output_address): Likewise.
8193 (Output_section::starting_output_address): Likewise.
8194 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
8195 parameter to Sized_relobj*.
8196 (Copy_relocs::need_copy_reloc): Likewise.
8197 (Copy_relocs::save): Likewise.
8198 * copy-relocs.h (class Copy_relocs): Update declarations.
8199 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
8200 Sized_relobj*. Change relobj_ field to Sized_relobj*.
8201 * target-reloc.h (relocate_for_relocatable): Change
8202 offset_in_output_section type to Elf_Addr. Change code that uses
8204 * layout.cc (Layout::layout): Always set *off.
8205 * mapfile.cc (Mapfile::print_input_section): Use
8206 output_section_offset.
8207 * i386.cc (Target_i386::copy_reloc): Change object parameter to
8209 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
8210 * sparc.cc (Target_sparc::copy_reloc): Likewise.
8211 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
8213 2008-07-03 Ian Lance Taylor <iant@google.com>
8215 * layout.cc (Layout::include_section): Do not discard unrecognized
8216 SHT_STRTAB sections.
8218 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
8220 * script.cc (Lex::can_continue_name): Make '?' allowable in
8221 version-script names.
8222 * testsuite/version_script.map: Change glob pattern to use '?'
8224 2008-06-30 Manish Singh <yosh@gimp.org>
8227 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
8230 2008-06-30 Ian Lance Taylor <iant@google.com>
8234 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
8235 versions]: Don't try to read the value in the contents, since we
8236 don't use it. Use the template endianness when writing.
8238 2008-06-25 Cary Coutant <ccoutant@google.com>
8240 * fileread.cc (File_read::make_view): Assert on zero-length view.
8241 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
8242 symbol table when there are no symbols to read.
8244 2008-06-23 Craig Silverstein <csilvers@google.com>
8246 * version.cc (version_string): Bump to 1.7
8248 2008-06-18 Craig Silverstein <csilvers@google.com>
8250 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
8251 constant 0xFFFF to type Valtype.
8252 (Powerpc_relocate_functions::rel16_ha): Likewise.
8254 2008-06-17 Ian Lance Taylor <iant@google.com>
8256 * output.h (Output_section::Input_section): Initialize p2align_ to
8257 zero for Output_section_data constructors.
8258 (Output_section::Input_section::addralign): If not an input
8259 section, return the alignment of the Output_section_data.
8260 * testsuite/copy_test.cc: New file.
8261 * testsuite/copy_test_1.cc: New file.
8262 * testsuite/copy_test_2.cc: New file.
8263 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
8264 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
8265 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
8266 (copy_test_1_pic.o, copy_test_1.so): New targets.
8267 (copy_test_2_pic.o, copy_test_2.so): New targets.
8268 * testsuite/Makefile.in: Rebuild.
8270 * script-sections.cc (Script_sections::place_orphan): Initialize
8271 local variable exact.
8273 2008-06-13 David Edelsohn <edelsohn@gnu.org>
8275 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
8277 2008-06-12 David Edelsohn <edelsohn@gnu.org>
8278 David S. Miller <davem@davemloft.net>
8280 * powerpc.cc: New file.
8281 * Makefile.am (TARGETSOURCES): Add powerpc.cc
8282 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
8283 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
8284 * Makefile.in: Rebuild.
8286 2008-06-09 Ian Lance Taylor <iant@google.com>
8288 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
8290 (throwing, orig_terminate): New static variables.
8291 (terminate_handler): New static function.
8292 (t2): Set terminate handler.
8294 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
8297 * binary.cc (Binary_to_elf::sized_convert): Fix .data
8300 2008-05-30 Cary Coutant <ccoutant@google.com>
8302 * archive.cc (Archive::include_all_members) Correct to step
8303 over symbol table and extended name table in thin archives.
8305 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
8308 * target-reloc.h (relocate_for_relocatable): Fix new_offset
8311 2008-05-28 Caleb Howe <cshowe@google.com>
8313 * reduced_debug_output.cc: New file.
8314 * reduced_debug_output.h: New file.
8315 * options.h (class General_options): Add --strip-debug-non-line.
8316 * options.cc (General_options::finalize): Add strip_debug_non_line
8317 to the strip heirarchy.
8318 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
8320 * layout.cc: Include "reduced_debug_output.h".
8321 (Layout::Layout): Initialize new fields.
8322 (line_only_debug_sections): New static array.
8323 (is_lines_only_debug_sections): New static inline function.
8324 (Layout::include_section): Handle --strip-debug-non-line.
8325 (Layout::make_output_section): If --strip-debug-non-line, build
8326 new output sections for .debug_abbrev and .debug_info.
8327 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
8328 gold. Warn about possible overflow.
8329 (read_signed_LEB_128): Likewise.
8330 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
8331 (read_signed_LEB_128): Declare.
8332 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
8333 (HFILES): Add reduced_debug_output.h.
8334 * Makefile.in: Rebuild.
8336 2008-05-21 Ian Lance Taylor <iant@google.com>
8338 * mapfile.cc: New file.
8339 * mapfile.h: New file.
8340 * options.h (class General_options): Add -M/--print-map and -Map.
8341 * options.cc (General_options::finalize): Make -M equivalent to
8343 * main.cc: Include <cstdio> and "mapfile.h".
8344 (main): Open mapfile if requested.
8345 * gold.cc (class Middle_runner): Add mapfile_ field. Update
8346 constructor. Change caller.
8347 (queue_initial_tasks): Add mapfile parameter. Change caller.
8348 (queue_middle_tasks): Likewise.
8349 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
8351 * archive.cc: Include "mapfile.h".
8352 (Archive::add_symbols): Add mapfile parameter. Change all
8353 callers. Pass mapfile, symbol, and reason to include_member.
8354 (Archive::include_all_members): Add mapfile parameter. Change all
8356 (Archive::include_member): Add mapfile, sym, and why parameters.
8357 Change all callers. Report inclusion to map file.
8358 * archive.h: Include "fileread.h".
8359 (class Archive): Update declarations.
8360 (Archive::file): New const method.
8361 (class Add_archive_symbols): Add mapfile_ field. Update
8362 constructor. Change all callers.
8363 * readsyms.h (class Read_symbols): Likewise.
8364 (class Finish_group): Likewise.
8365 (class Read_script): Likewise.
8366 * common.cc: Include "mapfile.h".
8367 (Symbol_table::allocate_commons): Add mapfile parameter. Change
8369 (Symbol_table::do_allocate_commons): Likewise.
8370 (Symbol_table::do_allocate_commons_list): Likewise. Report common
8371 symbol allocation to mapfile.
8372 * common.h (class Allocate_commons_task): Add mapfile_ field.
8373 Update constructor. Change all callers.
8374 * symtab.h (class Symbol_table): Update declarations.
8375 * layout.cc: Include "mapfile.h".
8376 (Layout_task_runner::run): Print information to mapfile.
8377 (Layout::create_gold_note): Change Output_data_fixed_space to
8378 Output_data_zero_fill.
8379 (Layout::create_build_id): Likewise.
8380 (Layout::print_to_mapfile): New function.
8381 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
8382 constructor. Change caller.
8383 (class Layout): Declare print_to_mapfile.
8384 * output.cc (Output_section::Input_section::print_to_mapfile): New
8386 (Output_section::add_input_section): If producing a map, always
8387 add to input_sections_ list.
8388 (Output_section::do_print_to_mapfile): New function.
8389 (Output_segment::print_sections_to_mapfile): New function.
8390 (Output_segment::print_section_list_to_mapfile): New function.
8391 * output.h: Include "mapfile.h".
8392 (Output_data::print_to_mapfile): New function.
8393 (Output_data::do_print_to_mapfile): New virtual function.
8394 (Output_segment_headers::do_print_to_mapfile): New function.
8395 (Output_file_header::do_print_to_mapfile): New function.
8396 (Output_data_const::do_print_to_mapfile): New function.
8397 (class Output_data_const_buffer): Add map_name_ field. Update
8398 constructor. Change all callers. Add do_print_to_mapfile
8400 (class Output_data_fixed_space): Likewise.
8401 (class Output_data_space): Likewise.
8402 (class Output_data_zero_fill): New class.
8403 (Output_data_strtab::do_print_to_mapfile): New function.
8404 (Output_data_reloc_base::do_print_to_mapfile): New function.
8405 (Output_relocatable_relocs::do_print_to_mapfile): New function.
8406 (Output_data_group::do_print_to_mapfile): New function.
8407 (Output_data_got::do_print_to_mapfile): New function.
8408 (Output_data_dynamic::do_print_to_mapfile): New function.
8409 (Output_symtab_xindex::do_print_to_mapfile): New function.
8410 (class Output_section): Declare do_print_to_mapflie. Declare
8411 print_to_mapfile in Input_section.
8412 (class Output_segment): Declare new functions.
8413 * object.h (Sized_relobj::symbol_count): New function.
8414 * script-sections.cc
8415 (Output_section_element_dot_assignment::set_section_addresses):
8416 Change Output_data_fixed_space to Output_data_zero_fill.
8417 (Output_data_expression::do_print_to_mapfile): New function.
8418 * script.cc (read_input_script): Add mapfile parameter. Change
8420 * script.h (read_input_script): Update declaration.
8421 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
8422 (Eh_frame::do_print_to_mapfile): New function.
8423 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
8424 (Output_merge_string::do_print_to_mapfile): New function.
8425 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
8427 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
8429 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
8431 * Makefile.am (CCFILES): Add mapfile.cc.
8432 (HFILES): Add mapfile.h.
8433 * Makefile.in: Rebuild.
8435 2008-05-19 Ian Lance Taylor <iant@google.com>
8437 * options.h (class General_options): Add -z relro.
8438 * layout.cc (Layout::Layout): Initialize relro_segment_.
8439 (Layout::add_output_section_data): Return the output section.
8440 (Layout::make_output_section): Rcognize relro sections and mark
8442 (Layout::attach_allocated_section_to_segment): Put relro sections
8443 in a PT_GNU_RELRO segment.
8444 (Layout::create_initial_dynamic_sections): Mark the .dynamic
8446 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
8448 (Layout::linkonce_mapping): Map d.rel.ro.local to
8450 (Layout::output_section_name): Us .data.rel.ro.local for any
8451 section which begins with that.
8452 * layout.h (class Layout): Update add_output_section_data
8453 declaration. Add relro_segment_ field.
8454 * output.cc (Output_section::Output_section): Initialize is_relro_
8455 and is_relro_local_ fields.
8456 (Output_segment::add_output_section): Group relro sections.
8457 (Output_segment::is_first_section_relro): New function.
8458 (Output_segment::maximum_alignment): If there is a relro section,
8459 align the segment to the common page size.
8460 (Output_segment::set_section_addresses): Track whether we are
8461 looking at relro sections. If the last section is a relro
8462 section, align to the common page size.
8463 (Output_segment::set_section_list_addresses): Add in_relro
8464 parameter. Change all callers. Align to the page size when
8465 moving from relro to non-relro section.
8466 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
8468 * output.h (class Output_section): Add is_relro_ and
8469 is_relro_local_ fields.
8470 (Output_section::is_relro): New function.
8471 (Output_section::set_is_relro): New function.
8472 (Output_section::is_relro_local): New function.
8473 (Output_section::set_is_relro_local): New function.
8474 (class Output_segment): Update declarations.
8475 * i386.cc (Target_i386::got_section): Mark .got section as relro.
8476 * sparc.cc (Target_sparc::got_section): Likewise.
8477 * x86_64.cc (Target_x86_64::got_section): Likewise.
8478 * testsuite/relro_test_main.cc: New file.
8479 * testsuite/relro_test.cc: New file.
8480 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
8481 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
8482 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
8483 (relro_test.so, relro_test_pic.o): New targets.
8484 * testsuite/Makefile.in: Rebuild.
8486 2008-05-16 Ian Lance Taylor <iant@google.com>
8488 * output.cc (Output_segment::add_output_section): Remove front
8490 * output.h (class Output_segment): Remove
8491 add_initial_output_section and overloaded add_output_section.
8492 Update declaration of remaining add_output_section.
8493 * layout.cc (Layout::create_interp): Call add_output_section
8494 rather than add_initial_output_section.
8495 (Layout::finish_dynamic_section): Likewise.
8497 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
8498 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
8499 know the dynamic type.
8500 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
8501 field. Initialize it in constructor.
8502 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
8503 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
8504 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
8507 * output.cc (Output_reloc::get_address): Change return type to
8509 * output.h (class Output_reloc): Update get_address declaration.
8510 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
8511 for section addresses.
8513 2008-05-09 Ian Lance Taylor <iant@google.com>
8516 * gold.cc (gold_nomem): Use return value of write.
8518 2008-05-08 Ian Lance Taylor <iant@google.com>
8520 * symtab.c (Symbol::init_base_output_data): Add version
8521 parameter. Change all callers.
8522 (Symbol::init_base_output_segment): Likewise.
8523 (Symbol::init_base_constant): Likewise.
8524 (Symbol::init_base_undefined): Likewise.
8525 (Sized_symbol::init_output_data): Likewise.
8526 (Sized_symbol::init_output_segment): Likewise.
8527 (Sized_symbol::init_constant): Likewise.
8528 (Sized_symbol::init_undefined): Likewise.
8529 (Symbol_table::do_define_in_output_data): If the new symbol has a
8530 version, mark it as the default.
8531 (Symbol_table::do_define_in_output_segment): Likewise.
8532 (Symbol_table::do_define_as_constant): Likewise.
8533 * symtab.h (class Symbol): Update declarations.
8534 (class Sized_symbol): Likewise.
8535 * resolve.cc (Symbol::override_version): New function.
8536 (Symbol::override_base): Call override_version.
8537 (Symbol::override_base_with_special): Likewise.
8538 * testsuite/ver_script_8.script: New file.
8539 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
8540 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
8541 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
8542 (ver_test_8_1.so, ver_test_8_2.so): New targets.
8544 2008-05-06 Ian Lance Taylor <iant@google.com>
8547 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
8549 (class General_options): Remove existing --undefined, and add
8550 --no-undefined instead. Add new --undefined as synonym for -u.
8551 * archive.cc (Archive::add_symbols): Check whether symbol was
8553 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
8554 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
8555 all uses. Add IS_UNDEFINED. Update declarations to split
8556 different versions of init_base. Declare init_base_undefined.
8557 (Symbol::is_defined): Handle IS_UNDEFINED.
8558 (Symbol::is_undefined): Likewise.
8559 (Symbol::is_weak_undefined): Call is_undefined.
8560 (Symbol::is_absolute): Handle IS_CONSTANT.
8561 (class Sized_symbol): Update declarations to split different
8562 versions of init. Declare init_undefined.
8563 (class Symbol_table): Declare new functions.
8564 * symtab.cc (Symbol::init_base_object): Rename from init_base.
8566 (Symbol::init_base_output_data): Likewise.
8567 (Symbol::init_base_output_segment): Likewise.
8568 (Symbol::init_base_constant): Likewise.
8569 (Symbol::init_base_undefined): New function.
8570 (Sized_symbol::init_object): Rename from init. Change all
8572 (Sized_symbol::init_output_data): Likewise.
8573 (Sized_symbol::init_output_segment): Likewise.
8574 (Sized_symbol::init_constant): Likewise.
8575 (Sized_symbol::init_undefined): New function.
8576 (Symbol_table::add_undefined_symbols_from_command_line): New
8578 (Symbol_table::do_add_undefined_symbols_from_command_line): New
8580 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
8581 (Symbol::output_section): Likewise.
8582 (Symbol::set_output_section): Likewise.
8583 (Symbol_table::sized_finalize_symbol): Likewise.
8584 (Symbol_table::sized_write_globals): Likewise.
8585 * resolve.cc (Symbol_table::should_override): Likewise.
8586 (Symbol::override_base_with_special): Likewise.
8588 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
8589 symbol, change it to have default visibility.
8590 * testsuite/protected_1.cc: New file.
8591 * testsuite/protected_2.cc: New file.
8592 * testsuite/protected_3.cc: New file.
8593 * testsuite/protected_main_1.cc: New file.
8594 * testsuite/protected_main_2.cc: New file.
8595 * testsuite/protected_main_3.cc: New file.
8596 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
8597 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
8598 (protected_1_LDFLAGS, protected_1_LDADD): Define.
8599 (protected_1.so): New target.
8600 (protected_1_pic.o, protected_2_pic.o): New targets.
8601 (protected_3_pic.o): New target.
8602 (check_PROGRAMS): Add protected_2.
8603 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
8604 (protected_2_LDFLAGS, protected_2_LDADD): Define.
8605 * testsuite/Makefile.in: Rebuild.
8607 * options.h (DEFINE_var): Add set_user_set_##varname__.
8608 (DEFINE_bool_alias): New macro.
8609 (class General_options): Define -Bstatic using DEFINE_bool_alias
8610 rather than DEFINE_special. Add --undefined as an alias for -z
8612 * options.cc (General_options::parse_Bstatic): Remove.
8614 * options.h (class General_options): Add --fatal-warnings.
8615 * main.cc (main): Implement --fatal-warnings.
8616 * errors.h (Errors::warning_count): New function.
8618 * options.h (class General_options): Add -Bsymbolic-functions.
8619 * symtab.h (Symbol::is_preemptible): Check for
8620 -Bsymbolic-functions.
8622 2008-05-05 Ian Lance Taylor <iant@google.com>
8624 * options.h (DEFINE_bool): For DASH_Z, create the negative option
8625 as noVARNAME rather than no-VARNAME.
8626 (class General_options): Add option -z combreloc.
8627 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
8629 (Output_reloc::sort_before) [SHT_REL]: New function.
8630 (Output_reloc::sort_before) [SHT_RELA]: New function.
8631 (class Output_data_reloc_base): Add sort_relocs_ field. Define
8632 Sort_relocs_comparison.
8633 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
8634 parameter. Change all callers.
8635 (Output_data_reloc::Output_data_reloc) [both versions]: Add
8636 sort_relocs parameter. Change all callers.
8637 * output.cc (Output_reloc::get_address): New function, broken out
8639 (Output_reloc::write_rel): Call it.
8640 (Output_reloc::compare): New function.
8641 (Output_data_reloc_base::do_write): Optionally sort relocs.
8643 * configure.ac: If targ_extra_obj is set, link it in.
8644 * configure.tgt: Initialize all variables.
8645 (x86_64*): Set targ_extra_obj and targ_extra_size.
8646 * configure: Rebuild.
8648 * object.cc (Sized_relobj::include_section_group): Adjust section
8649 indexes read from group data. Build vector to pass to
8651 * layout.cc (Layout::layout_group): Add flags and shndxes
8652 parameters. Remove contents parameter. Change caller. Update
8653 explicit instantiations.
8654 * layout.h (class Layout): Update layout_group declaration.
8655 * output.cc (Output_data_group::Output_data_group): Add flags and
8656 input_shndxes parameters. Remove contents parameter. Change
8658 (Output_data_group::do_write): Change input_sections_ to
8660 * output.h (class Output_data_group): Update constructor
8661 declaration. Rename input_sections_ to input_shndxes_.
8662 * testsuite/many_sections_test.cc: Add template.
8664 2008-04-30 Cary Coutant <ccoutant@google.com>
8666 * target-reloc.h (relocate_section): Fix dead-pointer bug.
8668 * layout.cc (Layout::include_section): Refactored check for debug
8670 (Layout::add_comdat): Add new parameters. Change type
8671 of signature parameter. Add object and shndx to signatures table.
8672 (Layout::find_kept_object): New function.
8673 * layout.h: Include <cstring>.
8674 (Layout::is_debug_info_section): New function.
8675 (Layout::add_comdat): Add new parameters.
8676 (Layout::find_kept_object): New function.
8677 (Layout::Kept_section): New struct.
8678 (Layout::Signatures): Change type of map range.
8679 * object.cc (Relobj::output_section_address): New function.
8680 (Sized_relobj::include_section_group): Add new parameters. Change
8681 calls to Layout::add_comdat. Change to build table of kept comdat
8682 groups and table mapping discarded sections to kept sections.
8683 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
8684 (Sized_relobj::do_layout): Change calls to include_section_group and
8685 include_linkonce_section.
8686 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
8687 value to zero when section is discarded.
8688 (Sized_relobj::map_to_kept_section): New function.
8689 * object.h (Relobj::output_section_address): New function.
8690 (Relobj::Comdat_group): New type.
8691 (Relobj::find_comdat_group): New function.
8692 (Relobj::Comdat_group_table): New type.
8693 (Relobj::Kept_comdat_section): New type.
8694 (Relobj::Kept_comdat_section_table): New type.
8695 (Relobj::add_comdat_group): New function.
8696 (Relobj::set_kept_comdat_section): New function.
8697 (Relobj::get_kept_comdat_section): New function.
8698 (Relobj::comdat_groups_): New field.
8699 (Relobj::kept_comdat_sections_): New field.
8700 (Symbol_value::input_value): Update comment.
8701 (Sized_relobj::map_to_kept_section) New function.
8702 (Sized_relobj::include_linkonce_section): Add new parameter.
8703 * target-reloc.h (Comdat_behavior): New type.
8704 (get_comdat_behavior): New function.
8705 (relocate_section): Add code to map a discarded section to the
8706 corresponding kept section when applying a relocation.
8708 2008-04-30 Craig Silverstein <csilvers@google.com>
8710 * dwarf_reader.cc (next_generation_count): New static var.
8711 (Addr2line_cache_entry): New struct.
8712 (addr2line_cache): New static var.
8713 (Dwarf_line_info::one_addr2line): Added caching.
8714 (Dwarf_line_info::clear_addr2line_cache): New function.
8715 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
8716 cache-size parameter.
8717 (Dwarf_line_info::one_addr2line_cache): New function.
8718 * symtab.cc (Symbol_table::detect_odr_violations): Pass
8719 new cache-size argument to one_addr2line(), and clear cache.
8721 2008-04-28 Cary Coutant <ccoutant@google.com>
8723 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
8724 R_386_PC8 relocations.
8726 2008-04-23 Ian Lance Taylor <iant@google.com>
8728 * object.cc (Sized_relobj::include_section_group): Check for
8729 invalid section group.
8731 * object.cc (make_elf_object): Correct test for 64-bit ELF file
8734 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
8735 than read for file header.
8736 * archive.cc (Archive::include_member): Likewise.
8738 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
8740 * aclocal.m4: Regenerate.
8741 * configure: Regenerate.
8743 2008-04-19 Ian Lance Taylor <iant@google.com>
8745 * version.cc (version_string): Bump to 1.6.
8747 * testsuite/Makefile.am (many_sections_r_test): New target.
8748 (many_sections_r_test_SOURCES): Remove.
8749 (many_sections_r_test_DEPENDENCIES): Remove.
8750 (many_sections_r_test_LDFLAGS): Remove.
8751 (many_sections_r_test_LDADD): Remove.
8753 * object.cc (Sized_relobj::do_add_symbols): Always pass
8754 local_symbol_count_ to add_from_relobj.
8756 * testsuite/Makefile.am (many_sections_check.h): Only check one in
8757 every thousand variables.
8758 * testsuite/Makefile.in: Rebuild.
8760 * object.cc (Xindex::initialize_symtab_xindex): New function.
8761 (Xindex::read_symtab_xindex): New function.
8762 (Xindex::sym_xindex_to_shndx): New function.
8763 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
8765 (Sized_relobj::do_initialize_xindex): New function.
8766 (Sized_relobj::do_read_symbols): Adjust section links.
8767 (Sized_relobj::symbol_section_and_value): Add is_ordinary
8768 parameter. Change all callers.
8769 (Sized_relobj::include_section_group): Adjust section links and
8770 symbol section indexes.
8771 (Sized_relobj::do_layout): Adjust section links.
8772 (Sized_relobj::do_count_local_symbols): Adjust section links and
8773 symbol section indexes.
8774 (Sized_relobj::do_finalize_local_symbols): Distinguish between
8775 ordinary and special symbols.
8776 (Sized_relobj::write_local_symbols): Add symtab_xindex and
8777 dynsym_xindex parameters. Change all callers. Adjust section
8778 links. Use SHN_XINDEX when needed.
8779 (Sized_relobj::get_symbol_location_info): Adjust section links.
8780 Don't get fooled by special symbols.
8781 * object.h (class Xindex): Define.
8782 (class Object): Add xindex_ parameter. Declare virtual functoin
8783 do_initialize_xindex.
8784 (Object::adjust_sym_shndx): New function.
8785 (Object::set_xindex): New protected function.
8786 (class Symbol_value): Add is_ordinary_shndx_ field.
8787 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
8788 (Symbol_value::value): Assert ordinary section.
8789 (Symbol_value::initialize_input_to_output_map): Likewise.
8790 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
8792 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
8794 (class Sized_relobj): Update declarations.
8795 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
8796 parameter. Change all callers.
8797 (Sized_relobj::adjust_shndx): New function.
8798 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
8800 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
8801 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
8802 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
8803 (Sized_dynobj::read_dynsym_section): Adjust section links.
8804 (Sized_dynobj::read_dynamic): Likewise.
8805 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
8807 (Sized_dynobj::do_initialize_xindex): New function.
8808 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
8809 do_initialize_xindex.
8810 (Sized_dynobj::adjust_shndx): New function.
8811 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
8812 dynsym_xindex_ fields.
8813 (Layout::finalize): Add a call to set_section_indexes before
8814 creating the symtab sections.
8815 (Layout::set_section_indexes): Don't do anything if the section
8816 already has a section index.
8817 (Layout::create_symtab_sections): Add shnum parameter. Change
8818 caller. Create .symtab_shndx section if needed.
8819 (Layout::create_shdrs): Add shstrtab_section parameter. Change
8821 (Layout::allocated_output_section_count): New function.
8822 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
8824 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
8825 fields. Update declarations.
8826 (Layout::symtab_xindex): New function.
8827 (Layout::dynsym_xindex): New function.
8828 (class Write_symbols_task): Add layout_ field.
8829 (Write_symbols_task::Write_symbols_task): Add layout parameter.
8831 * output.cc (Output_section_headers::Output_section_headers): Add
8832 shstrtab_section parameter. Change all callers.
8833 (Output_section_headers::do_sized_write): Store overflow values
8834 for section count and section string table section index in
8835 section header zero.
8836 (Output_file_header::do_sized_write): Check for overflow of
8837 section count and section string table section index.
8838 (Output_symtab_xindex::do_write): New function.
8839 (Output_symtab_xindex::endian_do_write): New function.
8840 * output.h (class Output_section_headers): Add shstrtab_section_.
8841 Update declarations.
8842 (class Output_symtab_xindex): Define.
8843 (Output_section::has_out_shndx): New function.
8844 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
8846 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
8848 (Sized_symbol::init): Likewise.
8849 (Symbol::output_section): Check for ordinary symbol.
8850 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
8851 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
8853 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
8854 Change all callers. Simplify handling of symbols from sections
8855 not included in the link.
8856 (Symbol_table::add_from_dynobj): Handle ordinary symbol
8858 (Weak_alias_sorter::operator()): Assert that symbols are
8860 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
8862 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
8863 parameters. Change all callers.
8864 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
8865 symbol distinction. Use SHN_XINDEX when needed.
8866 (Symbol_table::write_section_symbol): Add symtab_xindex
8867 parameter. Change all callers.
8868 (Symbol_table::sized_write_section_symbol): Likewise. Use
8869 SHN_XINDEX when needed.
8870 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
8872 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
8873 (Symbol::is_defined): Check is_ordinary.
8874 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
8875 (Symbol::is_absolute, Symbol::is_common): Likewise.
8876 (class Sized_symbol): Update declarations.
8877 (class Symbol_table): Update declarations.
8878 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
8879 parameters. Change all callers.
8880 (Sized_symbol::override): Likewise.
8881 (Symbol_table::override): Likewise.
8882 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
8883 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
8884 is_ordinary, and orig_st_shndx parameters. Change all callers.
8885 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
8886 to be in an ordinary section.
8887 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
8888 object and is_ordinary parameters. Change all callers.
8889 (Sized_dwarf_line_info::read_relocs): Add object parameter.
8890 Change all callers. Don't add undefined or non-ordinary symbols
8892 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
8894 * dwarf_reader.h (class Sized_dwarf_line_info): Update
8896 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
8897 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
8898 (Sized_relobj::relocate_sections): Likewise.
8899 * target-reloc.h (scan_relocs): Adjust section symbol index.
8900 (scan_relocatable_relocs): Likewise.
8901 * i386.cc (Scan::local): Check for ordinary symbols.
8902 * sparc.cc (Scan::local): Likewise.
8903 * x86_64.cc (Scan::local): Likewise.
8904 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
8905 to symbol_section_and_value.
8906 * testsuite/many_sections_test.cc: New file.
8907 * testsuite/Makefile.am (BUILT_SOURCES): Define.
8908 (check_PROGRAMS): Add many_sections_test.
8909 (many_sections_test_SOURCES): Define.
8910 (many_sections_test_DEPENDENCIES): Define.
8911 (many_sections_test_LDFLAGS): Define.
8912 (BUILT_SOURCES): Add many_sections_define.h.
8913 (many_sections_define.h): New target.
8914 (BUILT_SOURCES): Add many_sections_check.h.
8915 (many_sections_check.h): New target.
8916 (check_PROGRAMS): Add many_sections_r_test.
8917 (many_sections_r_test_SOURCES): Define.
8918 (many_sections_r_test_DEPENDENCIES): Define.
8919 (many_sections_r_test_LDFLAGS): Define.
8920 (many_sections_r_test_LDADD): Define.
8921 (many_sections_r_test.o): New target.
8922 * testsuite/Makefile.in: Rebuild.
8924 2008-04-17 Cary Coutant <ccoutant@google.com>
8926 * errors.cc (Errors::info): New function.
8927 (gold_info): New function.
8928 * errors.h (Errors::info): New function.
8929 * gold.h (gold_info): New function.
8930 * object.cc (Input_objects::add_object): Print trace output.
8931 * options.cc (options::parse_set): New function.
8932 (General_options::parse_wrap): Deleted.
8933 (General_options::General_options): Deleted initializer.
8934 * options.h (options::String_set): New typedef.
8935 (options::parse_set): New function.
8936 (DEFINE_set): New macro.
8937 (General_options::wrap): Changed to use DEFINE_set. Changed
8938 callers of any_wrap_symbols and is_wrap_symbol.
8939 (General_options::trace, General_options::trace_symbol):
8941 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
8942 (General_options::wrap_symbols_): Deleted.
8943 * symtab.cc (Symbol_table::add_from_object): Print trace output.
8945 2008-04-17 David S. Miller <davem@davemloft.net>
8947 * options.cc (General_options::parse_V): New function.
8948 * options.h: Add entries for -V and -Qy.
8950 2008-04-17 Ian Lance Taylor <iant@google.com>
8952 * common.cc (Symbol_table::allocate_commons): Remove options
8953 parameter. Change caller.
8954 (Symbol_table::do_allocate_commons): Remove options parameter.
8955 Change caller. Just call do_allocate_commons_list twice.
8956 (Symbol_table::do_allocate_commons_list): New function, broken out
8957 of do_allocate_commons.
8958 * common.h (class Allocate_commons_task): Remove options_ field.
8960 * symtab.cc (Symbol_table::Symbol_table): Initialize
8962 (Symbol_table::add_from_object): Put TLS common symbols on
8964 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
8965 which are IN_OUTPUT_DATA.
8966 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
8967 allocate_commons and do_allocate_commons declarations. Declare
8968 do_allocate_commons_list.
8969 * gold.cc (queue_middle_tasks): Update creation of
8970 Allocate_commons_task to not pass options.
8971 * testsuite/Makefile.am (INCLUDES): Add -I.. .
8972 (TLS_TEST_C_FLAGS): New variable.
8973 (tls_test_c_pic.o): New target.
8974 (tls_test_shared.so): Link in tls_test_c_pic.o.
8975 (tls_test_c_pic_ie.o): New target.
8976 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
8977 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
8978 (tls_test_c.o): New target.
8979 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
8980 (tls_pic_test_LDADD): Likewise.
8981 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
8982 (tls_shared_gd_to_ie_test_LDADD): Likewise.
8983 (tls_test_c_gnu2.o): New target.
8984 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
8986 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
8987 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
8988 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
8989 * testsuite/tls_test.cc: Include "config.h".
8990 (t_last): Call t11_last.
8991 * testsuite/tls_test.h (t11, t11_last): Declare.
8992 * testsuite/tls_test_c.c: New file.
8993 * testsuite/tls_test_main.cc (thread_routine): Call t11.
8994 * configure.ac: Check for OpenMP support.
8995 * configure, config.in, Makefile.in: Rebuild.
8996 * testsuite/Makefile.in: Rebuild.
8998 2008-04-16 Cary Coutant <ccoutant@google.com>
9000 * i386.cc (Target_i386::define_tls_base_symbol): New function.
9001 (Target_i386::tls_base_symbol_defined_): New field.
9002 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9003 (Target_i386::Scan::global): Likewise.
9004 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
9005 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
9006 (Target_x86_64::tls_base_symbol_defined_): New field.
9007 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
9008 (Target_x86_64::Scan::global): Likewise.
9010 2008-04-16 Cary Coutant <ccoutant@google.com>
9012 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
9013 (Symbol::needs_plt_entry): Allow weak undefined symbols.
9014 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
9015 building shared libraries.
9016 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
9017 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
9018 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
9019 * testsuite/Makefile.in: Rebuild.
9020 * testsuite/weak_undef.h: New file.
9021 * testsuite/weak_undef_file1.cc: Add extra test cases.
9022 * testsuite/weak_undef_file2.cc: Likewise.
9023 * testsuite/weak_undef_test.cc: Likewise.
9025 2008-04-16 David S. Miller <davem@davemloft.net>
9027 * sparc.cc (Target_sparc::Scan): Change from struct to class.
9028 Add issued_non_pic_error_ field. Declare check_non_pic.
9029 (Target_sparc::Scan::check_non_pic): New function.
9030 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
9031 (Target_sparc::Scan::global): Likewise.
9033 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
9034 * configure: Rebuild.
9036 * options.h (DEFINE_enable): New macro.
9037 (new_dtags): New enable option.
9038 (initfirst, interpose, loadfltr, nodefaultlib,
9039 nodelete, nodlopen, nodump): New -z options.
9040 * layout.cc (Layout:finish_dynamic_section): If new
9041 dtags enabled, emit DT_RUNPATH. Also, emit a
9042 DT_FLAGS_1 containing any specified -z flags.
9044 2008-04-16 Ian Lance Taylor <iant@google.com>
9046 * copy-relocs.cc: New file.
9047 * copy-relocs.h: New file.
9048 * reloc.cc: Remove Copy_relocs code.
9049 * reloc.h: Likewise.
9050 * reloc-types.h (struct Reloc_types) [both versions]: Add
9051 get_reloc_addend_noerror.
9052 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
9053 variants of add_global which take an addend which must be zero.
9054 * i386.cc: Include "copy-relocs.h".
9055 (class Target_i386): Change type of copy_relocs_ to variable,
9057 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
9059 (Target_i386::do_finalize_sections): Change handling of
9061 * sparc.cc: Include "copy-relocs.h".
9062 (class Target_sparc): Change type of copy_relocs_ to variable,
9064 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
9066 (Target_sparc::do_finalize_sections): Change handling of
9068 * x86_64.cc: Include "copy-relocs.h".
9069 (class Target_x86_64): Change type of copy_relocs_ to variable,
9071 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
9072 class. Change all callers.
9073 (Target_x86_64::do_finalize_sections): Change handling of
9075 * Makefile.am (CCFILES): Add copy-relocs.cc.
9076 (HFILES): Add copy-relocs.h.
9078 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
9080 * testsuite/script_test_4.sh: Permit leading zeroes.
9082 2008-04-15 Ian Lance Taylor <iant@google.com>
9084 * script-sections.cc (Script_sections::create_segments): Use
9085 header_size_adjustment even when there is enough room for the
9087 * testsuite/script_test_4.sh: New file.
9088 * testsuite/script_test_4.t: New file.
9089 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
9090 (check_DATA): Add script_test_4.stdout.
9091 (MOSTLYCLEANFILES): Likewise.
9092 (script_test_4): New target.
9093 (script_test_4.stdout): New target.
9094 * testsuite/Makefile.in: Rebuild.
9096 * sparc.cc: Add definitions for Output_data_plt_sparc class
9099 2008-04-14 David S. Miller <davem@davemloft.net>
9101 * sparc.cc: New file.
9102 * Makefile.am (TARGETSOURCES): Add sparc.cc
9103 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
9104 * configure.tgt: Document targ_extra_size and
9105 targ_extra_big_endian. Add entries for sparc-* and
9107 * configure.ac: Handle targ_extra_size and
9108 targ_extra_big_endian.
9109 * Makefile.in: Rebuild.
9110 * configure: Likewise.
9111 * po/POTFILES.in: Likewise.
9112 * po/gold.pot: Likewise.
9114 2008-04-14 Ian Lance Taylor <iant@google.com>
9116 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
9117 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
9118 in the name/type/flags to section mapping. Don't call
9119 allocate_output_section.
9120 (Layout::choose_output_section): Change parameter from adjust_name
9121 to is_input_section. Don't permit input sections after sections
9122 are attached to segments. Don't call allocate_output_section.
9123 (Layout::layout_eh_frame): Call update_flags_for_input_section,
9124 not write_enable_output_section.
9125 (Layout::make_output_section): Don't push to
9126 unattached_section_list_ nor call attach_to_segment. Call
9127 attach_section_to_segment if sections are attached.
9128 (Layout::attach_sections_to_segments): New function.
9129 (Layout::attach_section_to_segment): New function.
9130 (Layout::attach_allocated_section_to_segment): Rename from
9131 attach_to_segment. Remove flags parameter.
9132 (Layout::allocate_output_section): Remove function.
9133 (Layout::write_enable_output_section): Remove function.
9134 * layout.h (class Layout): Update for above changes. Add new
9135 field sections_are_attached_.
9136 * output.h (Output_section::update_flags_for_input_section): New
9138 * output.cc (Output_section::add_input_section): Call
9139 update_flags_for_input_section.
9140 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
9142 2008-04-11 Cary Coutant <ccoutant@google.com>
9144 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
9145 thought unnecessary.
9146 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
9148 2008-04-11 Ian Lance Taylor <iant@google.com>
9150 * output.h (class Output_section_data): Remove inline definition
9152 * output.cc (Output_section_data::set_addralign): New function.
9154 2008-04-11 Cary Coutant <ccoutant@google.com>
9156 Add support for TLS descriptors for i386 and x86_64.
9157 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
9158 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
9159 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
9161 (Target_i386::got_mod_index_entry): Remove unnecessary code.
9162 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
9163 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
9165 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
9166 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
9167 Fix problem with initial-exec relocations.
9168 (Target_i386::Relocate::relocate_tls): Likewise.
9169 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
9171 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
9172 support for section-plus-offset dynamic table entries.
9173 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
9174 (Output_data_dynamic::Dynamic_entry): Add support for
9175 section-plus-offset dynamic table entries.
9176 (Output_data_dynamic::Classification): Likewise.
9177 (Output_data_dynamic::classification_): Renamed offset_.
9178 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
9179 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
9180 (Target_x86_64::make_plt_section): New function.
9181 (Target_x86_64::reserve_tlsdesc_entries): New function.
9182 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
9183 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
9184 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
9185 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
9186 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
9187 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
9188 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
9189 add extra PLT entry for TLS descriptors.
9190 (Output_data_plt_x86_64::got_): New field.
9191 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
9192 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
9194 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
9196 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
9197 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
9198 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
9199 R_386_TLS_DESC_CALL relocations.
9200 (Target_x86_64::Scan::global): Likewise.
9201 (Target_x86_64::do_finalize_sections): Add dynamic table entries
9202 for TLS descriptors.
9203 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
9204 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
9205 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
9206 GD-to-IE relaxation.
9207 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
9208 and TLS_DESCRIPTORS.
9209 * Makefile.in: Rebuild.
9210 * configure: Rebuild.
9211 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
9212 (tls_test_shared2.so): New target.
9213 (tls_shared_gd_to_ie_test_SOURCES): New variable.
9214 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
9215 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
9216 (tls_shared_gd_to_ie_test_LDADD): New variable.
9217 (tls_shared_gnu2_gd_to_ie_test): New target.
9218 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
9220 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
9221 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
9222 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
9223 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
9224 (tls_shared_gnu2_test): New target.
9225 (tls_test_gnu2_shared.so): New target.
9226 (tls_shared_gnu2_test_SOURCES): New variable.
9227 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
9228 (tls_shared_gnu2_test_LDFLAGS): New variable.
9229 (tls_shared_gnu2_test_LDADD): New variable.
9230 * testsuite/Makefile.in: Rebuild.
9231 * testsuite/Makefile.
9233 2008-04-11 Ian Lance Taylor <iant@google.com>
9235 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
9237 * testsuite/Makefile.in: Rebuild.
9239 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
9241 * testsuite/script_test_2.cc (main): Adjust test.
9243 2008-04-11 David S. Miller <davem@davemloft.net>
9244 Ian Lance Taylor <iant@google.com>
9246 * options.h (General_options): Add entries for '-Y' and
9248 * options.cc (General_options:finalize): If -Y was used, add those
9249 entries to the library path instead of the default "/lib" and
9252 2008-04-11 David S. Miller <davem@davemloft.net>
9254 * testsuite/justsyms.t: Start at 0x100.
9255 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
9256 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
9258 * testsuite/script_test_2.cc: Adjust string and section length
9261 2008-04-09 Ian Lance Taylor <iant@google.com>
9264 * script-sections.cc (Sections_element::allocate_to_segment): Add
9266 (Output_section_definition::allocate_to_segment): Likewise.
9267 (Orphan_output_section::allocate_to_segment): Likewise.
9268 (Script_sections::attach_sections_using_phdrs_clause): Don't
9269 propagate non-PT_LOAD segments to orphan sections.
9270 * testsuite/Makefile.am (script_test_3.stdout): Generate using
9271 readelf rather than objdump.
9272 * testsuite/script_test_3.sh: Adjust accordingly. Test that
9273 .interp section and PT_INTERP segment are the same size.
9274 * testsuite/Makefile.in: Rebuild.
9276 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
9277 aliases for symbols defined in the same object.
9278 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
9279 (weak_alias_test_SOURCES): New variable.
9280 (weak_alias_test_DEPENDENCIES): New variable.
9281 (weak_alias_test_LDFLAGS): New variable.
9282 (weak_alias_test_LDADD): New variable.
9283 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
9284 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
9285 (weak_alias_test_3.o): New target.
9286 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
9287 * testsuite/weak_alias_test_main.cc: New file.
9288 * testsuite/weak_alias_test_1.cc: New file.
9289 * testsuite/weak_alias_test_2.cc: New file.
9290 * testsuite/weak_alias_test_3.cc: New file.
9292 2008-04-08 Ian Lance Taylor <iant@google.com>
9294 * options.h (class General_options): Add --noinhibit-exec option.
9295 * main.cc (main): Check --noinhibit-exec.
9297 * options.h (class General_options): Define --wrap as a special
9298 option. Add wrap_symbols_ field.
9299 (General_options::any_wrap_symbols): New function.
9300 (General_options::is_wrap_symbol): New function.
9301 * options.cc (General_options::parse_wrap): New function.
9302 (General_options::General_options): Initialize wrap_symbols_.
9303 * symtab.cc (Symbol_table::wrap_symbol): New function.
9304 (Symbol_table::add_from_object): Handle --wrap.
9305 * symtab.h (class Symbol_table): Declare wrap_symbol.
9306 * target.h (Target::wrap_char): New function.
9307 (Target::Target_info): Add wrap_char field.
9308 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
9309 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
9310 * testsuite/testfile.cc (Target_test::test_target_info):
9313 * errors.cc (Errors::undefined_symbol): Mention symbol version if
9316 * layout.h (class Layout): Add added_eh_frame_data_ field.
9317 * layout.cc (Layout::Layout): Initialize new field.
9318 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
9319 output section until we find a section we merged successfully.
9320 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
9321 that the size be non-zero.
9323 * merge.cc (Object_merge_map::get_output_offset): Remove inline
9326 2008-04-08 Craig Silverstein <csilvers@google.com>
9328 * configure.ac: Export new conditional variable HAVE_ZLIB.
9329 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
9331 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
9332 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9334 2008-04-07 Ian Lance Taylor <iant@google.com>
9336 * version.cc (version_string): Set to "1.5".
9338 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
9339 Add issued_non_pic_error_ field. Declare check_non_pic.
9340 (Target_x86_64::Scan::check_non_pic): New function.
9341 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
9342 (Target_x86_64::Scan::global): Likewise.
9344 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
9345 addend parameter. Change caller. Handle merge sections.
9346 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
9347 Address to Addend. Don't add in the result of
9348 local_section_offset, pass down the addend and use the returned
9350 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
9351 Update declarations of local_section_offset and symbol_value.
9352 * testsuite/two_file_test_1.cc (t18): New function.
9353 * testsuite/two_file_test_2.cc (f18): New function.
9354 * testsuite/two_file_test_main.cc (main): Call t18.
9355 * testsuite/two_file_test.h (t18, f18): Declare.
9357 * configure.ac: Don't test for objdump, c++filt, or readelf.
9358 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
9360 (TEST_READELF): New variable.
9361 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
9362 (check_PROGRAMS): Add two_file_strip_test.
9363 (two_file_strip_test): New target.
9364 (check_PROGRAMS): Add two_file_same_shared_strip_test.
9365 (two_file_same_shared_strip_test_SOURCES): New variable.
9366 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
9367 (two_file_same_shared_strip_test_LDFLAGS): New variable.
9368 (two_file_same_shared_strip_test_LDADD): New variable.
9369 (two_file_shared_strip.so): New target.
9370 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
9371 (ver_test_5.syms, ver_test_7.syms): Likewise.
9372 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
9373 (strip_test_3.stdout): Use TEST_OBJDUMP.
9374 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9376 2008-04-04 Cary Coutant <ccoutant@google.com>
9378 * symtab.h (Symbol::is_weak_undefined): New function.
9379 (Symbol::is_strong_undefined): New function.
9380 (Symbol::is_absolute): New function.
9381 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
9382 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
9384 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
9385 (weak_undef_test): New target.
9386 * testsuite/Makefile.in: Rebuild.
9387 * testsuite/weak_undef_file1.cc: New file.
9388 * testsuite/weak_undef_file2.cc: New file.
9389 * testsuite/weak_undef_test.cc: New file.
9391 2008-04-03 Craig Silverstein <csilvers@google.com>
9393 * compressed_output.h (class Output_compressed_section): Use
9395 * compressed_output.cc (zlib_compress): Use unsigned buffers,
9397 (zlib_compressed_suffix): Removed.
9398 (Output_compressed_section::set_final_data_size): Use unsigned
9400 * testsuite/Makefile.am (flagstest_compress_debug_sections):
9401 Fix linker invocation.
9402 (flagstest_o_specialfile_and_compress_debug_sections):
9404 * testsuite/Makefile.in: Regenerated.
9406 2008-04-02 David S. Miller <davem@davemloft.net>
9408 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
9409 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
9411 2008-04-02 Craig Silverstein <csilvers@google.com>
9415 2008-04-02 Ian Lance Taylor <iant@google.com>
9417 * fileread.cc (File_read::find_view): Add byteshift and vshifted
9418 parameters. Update for new key type to views_. Change all
9420 (File_read::read): Adjust for byteshift in returned view.
9421 (File_read::add_view): New function, broken out of
9423 (File_read::make_view): New function, broken out of
9425 (File_read::find_or_make_view): Add offset and aligned
9426 parameters. Rewrite accordingly. Change all callers.
9427 (File_read::get_view): Add offset and aligned parameters. Adjust
9428 for byteshift in return value.
9429 (File_read::get_lasting_view): Likewise.
9430 * fileread.h (class File_read): Update declarations.
9431 (class File_read::View): Add byteshift_ field. Add byteshift to
9432 constructor. Add byteshift method.
9433 * archive.h (Archive::clear_uncached_views): New function.
9434 (Archive::get_view): Add aligned parameter. Change all callers.
9435 * object.h (Object::get_view): Add aligned parameter. Change all
9437 (Object::get_lasting_view): Likewise.
9439 * fileread.cc (File_read::release): Don't call clear_views if
9440 there are multiple objects.
9441 * fileread.h (File_read::clear_uncached_views): New function.
9442 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
9445 2008-03-31 Cary Coutant <ccoutant@google.com>
9447 Add thin archive support.
9448 * archive.cc (Archive::armagt): New const.
9449 (Archive::setup): Remove task parameter and calls to unlock.
9450 (Archive::unlock_nested_archives): New function.
9451 (Archive::read_header): Add nested_off parameter. Change
9453 (Archive::interpret_header): Likewise.
9454 (Archive::include_all_members): Change to handle thin
9456 (Archive::include_member): Likewise.
9457 * archive.h (Archive::Archive): Add new parameters and
9459 (Archive::armagt): New const.
9460 (Archive::setup): Remove task parameter.
9461 (Archive::unlock_nested_archives): New function.
9462 (Archive::read_header): Add nested_off parameter.
9463 (Archive::interpret_header): Likewise.
9464 (Archive::Nested_archive_table): New typedef.
9465 (Archive::is_thin_archive_): New field.
9466 (Archive::nested_archives_): New field.
9467 (Archive::options_): New field.
9468 (Archive::dirpath_): New field.
9469 (Archive::task_): New field.
9470 * readsyms.cc (Read_symbols::do_read_symbols): Add check
9471 for thin archives. Pass additional parameters to
9472 Archive::Archive. Unlock the archive file after calling
9475 2008-03-29 Ian Lance Taylor <iant@google.com>
9477 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
9478 version symbol to be local.
9479 * testsuite/ver_test_4.sh: New file.
9480 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
9481 (check_DATA): Add ver_test_4.syms.
9482 (ver_test_4.syms): New target.
9483 * testsuite/Makefile.in: Rebuild.
9486 (Output_section::Input_section_sort_entry::has_priority): New
9488 (Output_section::Input_section_sort_entry::match_file_name): New
9490 (Output_section::Input_section_sort_entry::match_section_name):
9492 (Output_section::Input_section_sort_entry::match_section_name_prefix):
9494 (Output_section::Input_section_sort_entry::match_section_file):
9496 (Output_section::Input_section_sort_compare::operator()): Rewrite
9497 using new Input_section_sort_entry functions. Sort crtbegin and
9498 crtend first. Sort sections with no priority before sections with
9500 * testsuite/initpri1.c (d3): Check j != 4.
9501 (cd5): New constructor/destructor function.
9502 (main): Check j != 2.
9504 * symtab.cc (Symbol_table::add_from_object): If we don't use the
9505 new symbol when resolving, don't call set_is_default.
9506 * testsuite/ver_test_7.cc: New file.
9507 * testsuite/ver_test_7.sh: New file.
9508 * testsuite/Makefile.am (ver_test_7.so): New target.
9509 (ver_test_7.o): New target.
9510 (check_SCRIPTS): Add ver_test_7.sh.
9511 (check_DATA): Add ver_test_7.syms.
9512 (ver_test_7.syms): New target.
9514 2008-03-28 Ian Lance Taylor <iant@google.com>
9516 * layout.cc (Layout::layout): If we see an input section with a
9517 name that needs sorting, set the must_sort flag for the output
9519 (Layout::make_output_section): If the name of the output section
9520 indicates that it might require sorting, set the may_sort flag.
9521 * output.h (Output_section::may_sort_attached_input_sections): New
9523 (Output_section::set_may_sort_attached_input_sections): New
9525 (Output_section::must_sort_attached_input_sections): New
9527 (Output_section::set_must_sort_attached_input_sections): New
9529 (class Output_section): Declare Input_section_sort_entry. Define
9530 Input_section_sort_compare. Declare
9531 sort_attached_input_sections. Add new fields:
9532 may_sort_attached_input_sections_,
9533 must_sort_attached_input_sections_,
9534 attached_input_sections_are_sorted_.
9535 * output.cc (Output_section::Output_section): Initialize new
9537 (Output_section::add_input_section): Add an entry to
9538 input_sections_ if may_sort or must_sort are true.
9539 (Output_section::set_final_data_size): Call
9540 sort_attached_input_sections if necessary.
9541 (Output_section::Input_section_sort_entry): Define new class.
9542 (Output_section::Input_section_sort_compare::operator()): New
9544 (Output_section::sort_attached_input_sections): New function.
9545 * configure.ac: Check whether the compiler supports constructor
9546 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
9547 * testsuite/initpri1.c: New file.
9548 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
9549 CONSTRUCTOR_PRIORITY.
9550 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
9551 (initpri1_LDFLAGS): New variable.
9552 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
9554 2008-03-27 Ian Lance Taylor <iant@google.com>
9556 * common.cc (Sort_commons::operator): Correct sorting algorithm.
9557 * testsuite/common_test_1.c: New file.
9558 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
9559 (common_test_1_SOURCES): New variable.
9560 (common_test_1_DEPENDENCIES): New variable.
9561 (common_test_1_LDFLAGS): New variable.
9563 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
9564 and commons_ correctly when NAME/VERSION does not override
9566 * testsuite/ver_test_6.c: New file.
9567 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
9568 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
9569 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
9571 2008-03-26 Ian Lance Taylor <iant@google.com>
9573 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
9574 of an undefined symbol from a version script.
9575 * testsuite/Makefile.am (ver_test_5.so): New target.
9576 (ver_test_5.o): New target.
9577 (check_SCRIPTS): Add ver_test_5.sh.
9578 (check_DATA): Add ver_test_5.syms.
9579 (ver_test_5.syms): New target.
9580 * testsuite/ver_test_5.cc: New file.
9581 * testsuite/ver_test_5.script: New file.
9582 * testsuite/ver_test_5.sh: New file.
9583 * Makefile.in, testsuite/Makefile.in: Rebuild.
9586 Fix problems building gold with gcc 4.3.0.
9587 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
9588 (gold_error_at_location, gold_warning_at_location): Use it.
9589 * configure.ac: Check whether we can compile and use a template
9590 function with a printf attribute.
9591 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
9592 when jumping over bytes.
9593 * object.cc: Instantiate Object::read_section_data.
9594 * debug.h: Include <cstring>
9595 * dwarf_reader.cc: Include <algorithm>
9596 * main.cc: Include <cstring>.
9597 * options.cc: Include <cstring>.
9598 * output.cc: Include <cstring>.
9599 * script.cc: Include <cstring>.
9600 * script.h: Include <string>.
9601 * symtab.cc: Include <cstring> and <algorithm>.
9602 * target-select.cc: Include <cstring>.
9603 * version.cc: Include <string>.
9604 * testsuite/testmain.cc: Include <cstdlib>.
9605 * configure, config.in: Rebuild.
9607 2008-03-25 Ian Lance Taylor <iant@google.com>
9609 * options.cc: Include "../bfd/bfdver.h".
9610 (options::help): Print bug reporting address.
9612 * version.cc (print_version): Adjust output for current value of
9617 * options.cc (options::help): Print list of supported targets.
9618 * target-select.h: Include <vector>.
9619 (class Target_selector): Make machine_, size_, and is_big_endian_
9620 fields const. Add bfd_name_ and instantiated_target_ fields.
9621 (Target_selector::Target_selector): Add bfd_name parameter.
9622 (Target_selector::recognize): Make non-virtual, call
9624 (Target_selector::recognize_by_name): Make non-virtual, call
9625 do_recognize_by_name.
9626 (Target_selector::supported_names): New function.
9627 (Target_selector::bfd_name): New function.
9628 (Target_selector::do_instantiate_target): New pure virtual
9630 (Target_selector::do_recognize): New virtual function.
9631 (Target_selector::do_recognize_by_name): New virtual function.
9632 (Target_selector::instantiate_target): New private function.
9633 (supported_target_names): Declare.
9634 * target-select.cc (Target_selector::Target_selector): Update for
9635 new parameter and fields.
9636 (select_target_by_name): Check that the name matches before
9637 calling recognize_by_name.
9638 (supported_target_names): New function.
9639 * i386.cc (class Target_selector_i386): Update Target_selector
9640 constructor call. Remove recognize and recognize_by_name. Add
9641 do_instantiate_target.
9642 * x86_64.cc (class Target_selector_x86_64): Likewise.
9643 * testsuite/testfile.cc (class Target_selector_test): Update for
9644 changes to Target_selector.
9646 * README: Rewrite, with some notes on unsupported features.
9648 2008-03-24 Cary Coutant <ccoutant@google.com>
9650 * i386.cc (Target_i386::Got_type): New enum declaration.
9651 (Target_i386::Scan::local): Updated callers of Output_data_got
9653 (Target_i386::Scan::global): Likewise.
9654 (Target_i386::Relocate::relocate): Likewise.
9655 (Target_i386::Relocate::relocate_tls): Likewise.
9656 * object.h (Got_offset_list): New class.
9657 (Sized_relobj::local_has_got_offset): Added got_type parameter.
9658 (Sized_relobj::local_got_offset): Likewise.
9659 (Sized_relobj::set_local_got_offset): Likewise.
9660 (Sized_relobj::local_has_tls_got_offset): Removed.
9661 (Sized_relobj::local_tls_got_offset): Removed.
9662 (Sized_relobj::set_local_tls_got_offset): Removed.
9663 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
9664 * output.cc (Output_data_got::add_global): Added got_type parameter.
9665 (Output_data_got::add_global_with_rel): Likewise.
9666 (Output_data_got::add_global_with_rela): Likewise.
9667 (Output_data_got::add_global_pair_with_rel): New function.
9668 (Output_data_got::add_global_pair_with_rela): New function.
9669 (Output_data_got::add_local): Added got_type parameter.
9670 (Output_data_got::add_local_with_rel): Likewise.
9671 (Output_data_got::add_local_with_rela): Likewise.
9672 (Output_data_got::add_local_pair_with_rel): New function.
9673 (Output_data_got::add_local_pair_with_rela): New function.
9674 (Output_data_got::add_global_tls): Removed.
9675 (Output_data_got::add_global_tls_with_rel): Removed.
9676 (Output_data_got::add_global_tls_with_rela): Removed.
9677 (Output_data_got::add_local_tls): Removed.
9678 (Output_data_got::add_local_tls_with_rel): Removed.
9679 (Output_data_got::add_local_tls_with_rela): Removed.
9680 * output.h (Output_data_got::add_global): Added got_type parameter.
9681 (Output_data_got::add_global_with_rel): Likewise.
9682 (Output_data_got::add_global_with_rela): Likewise.
9683 (Output_data_got::add_global_pair_with_rel): New function.
9684 (Output_data_got::add_global_pair_with_rela): New function.
9685 (Output_data_got::add_local): Added got_type parameter.
9686 (Output_data_got::add_local_with_rel): Likewise.
9687 (Output_data_got::add_local_with_rela): Likewise.
9688 (Output_data_got::add_local_pair_with_rel): New function.
9689 (Output_data_got::add_local_pair_with_rela): New function.
9690 (Output_data_got::add_global_tls): Removed.
9691 (Output_data_got::add_global_tls_with_rel): Removed.
9692 (Output_data_got::add_global_tls_with_rela): Removed.
9693 (Output_data_got::add_local_tls): Removed.
9694 (Output_data_got::add_local_tls_with_rel): Removed.
9695 (Output_data_got::add_local_tls_with_rela): Removed.
9696 * resolve.cc (Symbol::override_base_with_special): Removed
9697 reference to has_got_offset_ field.
9698 * symtab.cc (Symbol::init_fields): Replaced initialization
9699 of got_offset_ with got_offsets_. Removed initialization
9701 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
9702 (Symbol::got_offset): Likewise.
9703 (Symbol::set_got_offset): Likewise.
9704 (Symbol::has_tls_got_offset): Removed.
9705 (Symbol::tls_got_offset): Removed.
9706 (Symbol::set_tls_got_offset): Removed.
9707 (Symbol::got_offset_): Removed.
9708 (Symbol::tls_mod_got_offset_): Removed.
9709 (Symbol::tls_pair_got_offset_): Removed.
9710 (Symbol::got_offsets_): New field.
9711 (Symbol::has_got_offset): Removed.
9712 (Symbol::has_tls_mod_got_offset): Removed.
9713 (Symbol::has_tls_pair_got_offset): Removed.
9714 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
9715 (Target_x86_64::Scan::local): Updated callers of Output_data_got
9717 (Target_x86_64::Scan::global): Likewise.
9718 (Target_x86_64::Relocate::relocate): Likewise.
9719 (Target_x86_64::Relocate::relocate_tls): Likewise.
9721 2008-03-25 Ben Elliston <bje@au.ibm.com>
9723 * yyscript.y: Fix spelling error in comment.
9725 2008-03-24 Ian Lance Taylor <iant@google.com>
9727 * options.h (class General_options): Define build_id option.
9728 * layout.h (class Layout): Declare write_build_id, create_note,
9729 create_build_id. Add build_id_note_ member.
9730 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
9731 "libiberty.h", "md5.h", "sha1.h".
9732 (Layout::Layout): Initialize eh_frame_data_,
9733 eh_frame_hdr_section_, and build_id_note_.
9734 (Layout::finalize): Call create_build_id.
9735 (Layout::create_note): New function, broken out of
9736 Layout::create_gold_note.
9737 (Layout::create_gold_note): Call create_note.
9738 (Layout::create_build_id): New function.
9739 (Layout::write_build_id): New function.
9740 (Close_task_runner::run): Call write_build_id.
9742 * x86_64.cc: Correct license to GPLv3.
9744 2008-03-23 Ian Lance Taylor <iant@google.com>
9746 * options.cc: Include "demangle.h".
9747 (parse_optional_string): New function.
9748 (parse_long_option): Handle takes_optional_argument.
9749 (parse_short_option): Update dash_z initializer. Handle
9750 takes_optional_argument.
9751 (General_options::General_options): Initialize do_demangle_.
9752 (General_options::finalize): Set do_demangle_. Handle demangling
9754 * options.h (parse_optional_string): Declare.
9755 (struct One_option): Add optional_arg field. Update constructor.
9756 Update call constructor calls. Add takes_optional_argument
9758 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
9759 (DEFINE_optional_string): Define.
9760 (General_options::demangle): Change from DEFINE_bool to
9761 DEFINE_optional_string.
9762 (General_options::no_demangle): New function.
9763 (General_options::do_demangle): New function.
9764 (General_options::set_do_demangle): New function.
9765 (General_options::execstack_status_): Move definition to end of
9767 (General_options::static_): Likewise.
9768 (General_options::do_demangle_): New field.
9769 * object.cc (big_endian>::get_symbol_location_info): Call
9770 Options::do_demangle, not Options::demangle.
9771 * symtab.cc (demangle): Likewise.
9773 2008-03-22 Ian Lance Taylor <iant@google.com>
9775 * gold.h: Include <cstddef> and <sys/types.h>
9776 * options.h: Include <cstring>.
9778 2008-03-21 Ian Lance Taylor <iant@google.com>
9780 * Added source code to GNU binutils.