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