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