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