* cref.cc: New file.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
92de84a6
ILT
12008-07-22 Ian Lance Taylor <iant@google.com>
2
3 * cref.cc: New file.
4 * cref.h: New file.
5 * options.h (class General_options): Add --print-symbol-counts.
6 * main.cc (main): Issue defined symbol report if requested.
7 * archive.cc (Archive::interpret_header): Make into a const member
8 function.
9 (Archive::add_symbols): Call Input_objects::archive_start and
10 archive_stop.
11 (Archive::const_iterator): Define new class.
12 (Archive::begin, Archive::end): New functions.
13 (Archive::include_all_members): Rewrite to use iterator.
14 (Archive::count_members): New function.
15 * archive.h (class Archive): Update declarations.
16 (Archive::filename): New function.
17 * object.cc: Include "cref.h".
18 (Sized_relobj::Sized_relobj): Initialize defined_count_.
19 (Sized_relobj::do_get_global_symbol_counts): New function.
20 (Input_objects::add_object): Add object to cross-referencer.
21 (Input_objects::archive_start): New function.
22 (Input_objects::archive_stop): New function.
23 (Input_objects::print_symbol_counts): New function.
24 * object.h: Declare Cref and Archive.
25 (Object::get_global_symbol_counts): New function.
26 (Object::do_get_global_symbol_counts): New pure virtual function.
27 (class Sized_relobj): Add defined_count_ field. Update
28 declarations.
29 (class Input_objects): Add cref_ field. Update constructor.
30 Update declarations.
31 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
32 defined_count_.
33 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
34 symbol counts.
35 (Sized_dynobj::do_get_global_symbol_counts): New function.
36 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
37 defined_count_. Update declarations. Define Symbols typedef.
38 * symtab.cc (Symbol_table::add_from_relobj): Add defined
39 parameter. Change all callers.
40 (Symbol_table::add_from_dynobj): Add sympointers and defined
41 parameters. Change all callers.
42 * symtab.h (class Symbol_table): Update declarations.
43 * Makefile.am (CCFILES): Add cref.cc.
44 (HFILES): Add cref.h.
45 * Makefile.in: Rebuild.
46
3f7c5e1d
CD
472008-07-22 Simon Baldwin <simonb@google.com>
48
49 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
50 to zero when writing undefined symbols.
51
e0b64032
ILT
522008-07-22 Ian Lance Taylor <iant@google.com>
53
54 * output.cc (Output_section::add_input_section): Don't try to
55 merge empty merge sections.
56
096b02cf
CS
572008-07-21 Craig Silverstein <csilvers@google.com>
58
59 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
60 Include symbol version in error message.
61
1d1f116d
CD
622008-07-20 Chris Demetriou <cgd@google.com>
63
64 * configure.ac (gold_cv_c_random_seed): New configured variable.
65 (RANDOM_SEED_CFLAGS): New substituted variable.
66 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
67 * configure: Rebuild.
68 * Makefile.in: Likewise.
69 * testsuite/Makefile.in: Likewise.
70
a18f591e
ILT
712008-07-18 Ian Lance Taylor <iant@google.com>
72
73 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
74 where we see NAME/NULL and NAME/VERSION as separate symbols.
75 * testsuite/ver_test_main.cc (main): Call t4.
76 (t4, t4_2a): Define.
77 * testsuite/ver_test_2.cc (t4_2): Define.
78 * testsuite/ver_test_2.script: Put t4_2a in VER2.
79 * testsuite/ver_test_4.cc (t4_2a): Define.
80 * testsuite/ver_test_4.script: Put t4_2a in VER2.
81 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
82
c6e3f6ed
ILT
832008-07-17 Ian Lance Taylor <iant@google.com>
84
85 * dynobj.cc (Versions::add_def): If we give an error about a
86 missing version, go ahead and create the version anyhow.
87
ef9beddf
ILT
882008-07-10 Ian Lance Taylor <iant@google.com>
89
90 Handle output sections with more than 0x7fffffff bytes.
91 * object.h (class Relobj): Change map_to_output_ to
92 output_sections_, and just keep a section pointer. Change all
93 uses. Move comdat group support to Sized_relobj.
94 (Relobj::is_section_specially_mapped): Remove.
95 (Relobj::output_section): Remove poff parameter. Change all
96 callers.
97 (Relobj::output_section_offset): New function.
98 (Relobj::set_section_offset): Rewrite.
99 (Relobj::map_to_output): Remove.
100 (Relobj::output_sections): New function.
101 (Relobj::do_output_section_offset): New pure virtual function.
102 (Relobj::do_set_section_offset): Likewise.
103 (class Sized_relobj): Add section_offsets_ field. Add comdat
104 group support from Relobj. Update declarations.
105 (Sized_relobj::get_output_section_offset): New function.
106 (Sized_relobj::do_output_section_offset): New function.
107 (Sized_relobj::do_set_section_offset): New function.
108 * object.cc (Relobj::output_section_address): Remove.
109 (Sized_relobj::Sized_relobj): Initialize new fields.
110 (Sized_relobj::include_section_group): Cast find_kept_object to
111 Sized_relobj.
112 (Sized_relobj::include_linkonce_section): Likewise.
113 (Sized_relobj::do_layout): Use separate arrays for output section
114 and output offset.
115 (Sized_relobj::do_count_local_symbols): Change map_to_output to
116 output_sections.
117 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
118 output_sections and section_offsets.
119 (Sized_relobj::write_local_symbols): Likewise.
120 (map_to_kept_section): Compute output address directly.
121 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
122 output_sections and section_offsets.
123 (Sized_relobj::write_sections): Likewise.
124 (Sized_relobj::relocate_sections): Likewise.
125 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
126 * output.h (class Output_reloc): Update declarations. Change
127 u2_.relobj to Sized_relobj*.
128 (class Output_data_reloc): Change add functions to use
129 Sized_relobj*.
130 * output.cc (Output_reloc::Output_reloc): Change relobj to
131 Sized_relobj*.
132 (Output_reloc::local_section_offset): Change return type to
133 Elf_Addr. Use get_output_section_offset.
134 (Output_reloc::get_address): Likewise.
135 (Output_section::is_input_address_mapped): Don't call
136 is_section_specially_mapped.
137 (Output_section::output_offset): Likewise.
138 (Output_section::output_address): Likewise.
139 (Output_section::starting_output_address): Likewise.
140 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
141 parameter to Sized_relobj*.
142 (Copy_relocs::need_copy_reloc): Likewise.
143 (Copy_relocs::save): Likewise.
144 * copy-relocs.h (class Copy_relocs): Update declarations.
145 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
146 Sized_relobj*. Change relobj_ field to Sized_relobj*.
147 * target-reloc.h (relocate_for_relocatable): Change
148 offset_in_output_section type to Elf_Addr. Change code that uses
149 it as well.
150 * layout.cc (Layout::layout): Always set *off.
151 * mapfile.cc (Mapfile::print_input_section): Use
152 output_section_offset.
153 * i386.cc (Target_i386::copy_reloc): Change object parameter to
154 Sized_relobj*.
155 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
156 * sparc.cc (Target_sparc::copy_reloc): Likewise.
157 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
158
5cb66f97
ILT
1592008-07-03 Ian Lance Taylor <iant@google.com>
160
161 * layout.cc (Layout::include_section): Do not discard unrecognized
162 SHT_STRTAB sections.
163
afe47622
CS
1642008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
165
166 * script.cc (Lex::can_continue_name): Make '?' allowable in
167 version-script names.
168 * testsuite/version_script.map: Change glob pattern to use '?'
169
5adf9721
ILT
1702008-06-30 Manish Singh <yosh@gimp.org>
171
172 PR 6585
173 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
174 Correct typo.
175
e6fde208
ILT
1762008-06-30 Ian Lance Taylor <iant@google.com>
177
178 PR 6660
179 PR 6682
180 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
181 versions]: Don't try to read the value in the contents, since we
182 don't use it. Use the template endianness when writing.
183
3f2e6a2d
CC
1842008-06-25 Cary Coutant <ccoutant@google.com>
185
186 * fileread.cc (File_read::make_view): Assert on zero-length view.
187 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
188 symbol table when there are no symbols to read.
189
c43d3a48
CS
1902008-06-23 Craig Silverstein <csilvers@google.com>
191
192 * version.cc (version_string): Bump to 1.7
193
5f494ea0
CS
1942008-06-18 Craig Silverstein <csilvers@google.com>
195
196 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
197 constant 0xFFFF to type Valtype.
198 (Powerpc_relocate_functions::rel16_ha): Likewise.
199
c42e122e
ILT
2002008-06-17 Ian Lance Taylor <iant@google.com>
201
f34787f8
ILT
202 * output.h (Output_section::Input_section): Initialize p2align_ to
203 zero for Output_section_data constructors.
204 (Output_section::Input_section::addralign): If not an input
205 section, return the alignment of the Output_section_data.
206 * testsuite/copy_test.cc: New file.
207 * testsuite/copy_test_1.cc: New file.
208 * testsuite/copy_test_2.cc: New file.
209 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
210 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
211 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
212 (copy_test_1_pic.o, copy_test_1.so): New targets.
213 (copy_test_2_pic.o, copy_test_2.so): New targets.
214 * testsuite/Makefile.in: Rebuild.
215
c42e122e
ILT
216 * script-sections.cc (Script_sections::place_orphan): Initialize
217 local variable exact.
218
ce3ac18a
DE
2192008-06-13 David Edelsohn <edelsohn@gnu.org>
220
221 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
222
42cacb20
DE
2232008-06-12 David Edelsohn <edelsohn@gnu.org>
224 David S. Miller <davem@davemloft.net>
225
226 * powerpc.cc: New file.
227 * Makefile.am (TARGETSOURCES): Add powerpc.cc
228 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
229 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
230 * Makefile.in: Rebuild.
231
7b308235
ILT
2322008-06-09 Ian Lance Taylor <iant@google.com>
233
234 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
235 <exception>.
236 (throwing, orig_terminate): New static variables.
237 (terminate_handler): New static function.
238 (t2): Set terminate handler.
239
f0b886e3
ILT
2402008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
241
242 PR 6584
243 * binary.cc (Binary_to_elf::sized_convert): Fix .data
244 alignment.
245
3e90f135
CC
2462008-05-30 Cary Coutant <ccoutant@google.com>
247
248 * archive.cc (Archive::include_all_members) Correct to step
249 over symbol table and extended name table in thin archives.
250
e09ad04a
ILT
2512008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
252
253 PR 6407
254 * target-reloc.h (relocate_for_relocatable): Fix new_offset
255 calculation.
256
62b01cb5
ILT
2572008-05-28 Caleb Howe <cshowe@google.com>
258
259 * reduced_debug_output.cc: New file.
260 * reduced_debug_output.h: New file.
92de84a6 261 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
262 * options.cc (General_options::finalize): Add strip_debug_non_line
263 to the strip heirarchy.
264 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
265 fields.
266 * layout.cc: Include "reduced_debug_output.h".
267 (Layout::Layout): Initialize new fields.
268 (line_only_debug_sections): New static array.
269 (is_lines_only_debug_sections): New static inline function.
270 (Layout::include_section): Handle --strip-debug-non-line.
271 (Layout::make_output_section): If --strip-debug-non-line, build
272 new output sections for .debug_abbrev and .debug_info.
273 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
274 gold. Warn about possible overflow.
275 (read_signed_LEB_128): Likewise.
276 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
277 (read_signed_LEB_128): Declare.
278 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
279 (HFILES): Add reduced_debug_output.h.
280 * Makefile.in: Rebuild.
281
7d9e3d98
ILT
2822008-05-21 Ian Lance Taylor <iant@google.com>
283
284 * mapfile.cc: New file.
285 * mapfile.h: New file.
286 * options.h (class General_options): Add -M/--print-map and -Map.
287 * options.cc (General_options::finalize): Make -M equivalent to
288 -Map -.
289 * main.cc: Include <cstdio> and "mapfile.h".
290 (main): Open mapfile if requested.
291 * gold.cc (class Middle_runner): Add mapfile_ field. Update
292 constructor. Change caller.
293 (queue_initial_tasks): Add mapfile parameter. Change caller.
294 (queue_middle_tasks): Likewise.
295 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
296 declarations.
297 * archive.cc: Include "mapfile.h".
298 (Archive::add_symbols): Add mapfile parameter. Change all
299 callers. Pass mapfile, symbol, and reason to include_member.
300 (Archive::include_all_members): Add mapfile parameter. Change all
301 callers.
302 (Archive::include_member): Add mapfile, sym, and why parameters.
303 Change all callers. Report inclusion to map file.
304 * archive.h: Include "fileread.h".
305 (class Archive): Update declarations.
306 (Archive::file): New const method.
307 (class Add_archive_symbols): Add mapfile_ field. Update
308 constructor. Change all callers.
309 * readsyms.h (class Read_symbols): Likewise.
310 (class Finish_group): Likewise.
311 (class Read_script): Likewise.
312 * common.cc: Include "mapfile.h".
313 (Symbol_table::allocate_commons): Add mapfile parameter. Change
314 all callers.
315 (Symbol_table::do_allocate_commons): Likewise.
316 (Symbol_table::do_allocate_commons_list): Likewise. Report common
317 symbol allocation to mapfile.
318 * common.h (class Allocate_commons_task): Add mapfile_ field.
319 Update constructor. Change all callers.
320 * symtab.h (class Symbol_table): Update declarations.
321 * layout.cc: Include "mapfile.h".
322 (Layout_task_runner::run): Print information to mapfile.
323 (Layout::create_gold_note): Change Output_data_fixed_space to
324 Output_data_zero_fill.
325 (Layout::create_build_id): Likewise.
326 (Layout::print_to_mapfile): New function.
327 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
328 constructor. Change caller.
329 (class Layout): Declare print_to_mapfile.
330 * output.cc (Output_section::Input_section::print_to_mapfile): New
331 function.
332 (Output_section::add_input_section): If producing a map, always
333 add to input_sections_ list.
334 (Output_section::do_print_to_mapfile): New function.
335 (Output_segment::print_sections_to_mapfile): New function.
336 (Output_segment::print_section_list_to_mapfile): New function.
337 * output.h: Include "mapfile.h".
338 (Output_data::print_to_mapfile): New function.
339 (Output_data::do_print_to_mapfile): New virtual function.
340 (Output_segment_headers::do_print_to_mapfile): New function.
341 (Output_file_header::do_print_to_mapfile): New function.
342 (Output_data_const::do_print_to_mapfile): New function.
343 (class Output_data_const_buffer): Add map_name_ field. Update
344 constructor. Change all callers. Add do_print_to_mapfile
345 function.
346 (class Output_data_fixed_space): Likewise.
347 (class Output_data_space): Likewise.
348 (class Output_data_zero_fill): New class.
349 (Output_data_strtab::do_print_to_mapfile): New function.
350 (Output_data_reloc_base::do_print_to_mapfile): New function.
351 (Output_relocatable_relocs::do_print_to_mapfile): New function.
352 (Output_data_group::do_print_to_mapfile): New function.
353 (Output_data_got::do_print_to_mapfile): New function.
354 (Output_data_dynamic::do_print_to_mapfile): New function.
355 (Output_symtab_xindex::do_print_to_mapfile): New function.
356 (class Output_section): Declare do_print_to_mapflie. Declare
357 print_to_mapfile in Input_section.
358 (class Output_segment): Declare new functions.
359 * object.h (Sized_relobj::symbol_count): New function.
360 * script-sections.cc
361 (Output_section_element_dot_assignment::set_section_addresses):
362 Change Output_data_fixed_space to Output_data_zero_fill.
363 (Output_data_expression::do_print_to_mapfile): New function.
364 * script.cc (read_input_script): Add mapfile parameter. Change
365 all callers.
366 * script.h (read_input_script): Update declaration.
367 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
368 (Eh_frame::do_print_to_mapfile): New function.
369 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
370 (Output_merge_string::do_print_to_mapfile): New function.
371 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
372 function.
373 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
374 function.
375 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
376 function.
377 * Makefile.am (CCFILES): Add mapfile.cc.
378 (HFILES): Add mapfile.h.
379 * Makefile.in: Rebuild.
380
9f1d377b
ILT
3812008-05-19 Ian Lance Taylor <iant@google.com>
382
383 * options.h (class General_options): Add -z relro.
384 * layout.cc (Layout::Layout): Initialize relro_segment_.
385 (Layout::add_output_section_data): Return the output section.
386 (Layout::make_output_section): Rcognize relro sections and mark
387 them appropriately.
388 (Layout::attach_allocated_section_to_segment): Put relro sections
389 in a PT_GNU_RELRO segment.
390 (Layout::create_initial_dynamic_sections): Mark the .dynamic
391 section as relro.
392 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
393 PT_TLS segments.
394 (Layout::linkonce_mapping): Map d.rel.ro.local to
395 .data.rel.ro.local.
396 (Layout::output_section_name): Us .data.rel.ro.local for any
397 section which begins with that.
398 * layout.h (class Layout): Update add_output_section_data
399 declaration. Add relro_segment_ field.
400 * output.cc (Output_section::Output_section): Initialize is_relro_
401 and is_relro_local_ fields.
402 (Output_segment::add_output_section): Group relro sections.
403 (Output_segment::is_first_section_relro): New function.
404 (Output_segment::maximum_alignment): If there is a relro section,
405 align the segment to the common page size.
406 (Output_segment::set_section_addresses): Track whether we are
407 looking at relro sections. If the last section is a relro
408 section, align to the common page size.
409 (Output_segment::set_section_list_addresses): Add in_relro
410 parameter. Change all callers. Align to the page size when
411 moving from relro to non-relro section.
412 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
413 segment.
414 * output.h (class Output_section): Add is_relro_ and
415 is_relro_local_ fields.
416 (Output_section::is_relro): New function.
417 (Output_section::set_is_relro): New function.
418 (Output_section::is_relro_local): New function.
419 (Output_section::set_is_relro_local): New function.
420 (class Output_segment): Update declarations.
421 * i386.cc (Target_i386::got_section): Mark .got section as relro.
422 * sparc.cc (Target_sparc::got_section): Likewise.
423 * x86_64.cc (Target_x86_64::got_section): Likewise.
424 * testsuite/relro_test_main.cc: New file.
425 * testsuite/relro_test.cc: New file.
426 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
427 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
428 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
429 (relro_test.so, relro_test_pic.o): New targets.
430 * testsuite/Makefile.in: Rebuild.
431
a984ee1d
ILT
4322008-05-16 Ian Lance Taylor <iant@google.com>
433
01676dcd
ILT
434 * output.cc (Output_segment::add_output_section): Remove front
435 parameter.
436 * output.h (class Output_segment): Remove
437 add_initial_output_section and overloaded add_output_section.
438 Update declaration of remaining add_output_section.
439 * layout.cc (Layout::create_interp): Call add_output_section
440 rather than add_initial_output_section.
441 (Layout::finish_dynamic_section): Likewise.
442
497897f9
ILT
443 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
444 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
445 know the dynamic type.
446 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
447 field. Initialize it in constructor.
448 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
449 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
450 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
451 reloc.
452
a984ee1d
ILT
453 * output.cc (Output_reloc::get_address): Change return type to
454 Elf_Addr.
455 * output.h (class Output_reloc): Update get_address declaration.
456 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
457 for section addresses.
458
55ba0940
ILT
4592008-05-09 Ian Lance Taylor <iant@google.com>
460
461 PR 6493
462 * gold.cc (gold_nomem): Use return value of write.
463
75517b77
ILT
4642008-05-08 Ian Lance Taylor <iant@google.com>
465
466 * symtab.c (Symbol::init_base_output_data): Add version
467 parameter. Change all callers.
468 (Symbol::init_base_output_segment): Likewise.
469 (Symbol::init_base_constant): Likewise.
470 (Symbol::init_base_undefined): Likewise.
471 (Sized_symbol::init_output_data): Likewise.
472 (Sized_symbol::init_output_segment): Likewise.
473 (Sized_symbol::init_constant): Likewise.
474 (Sized_symbol::init_undefined): Likewise.
475 (Symbol_table::do_define_in_output_data): If the new symbol has a
476 version, mark it as the default.
477 (Symbol_table::do_define_in_output_segment): Likewise.
478 (Symbol_table::do_define_as_constant): Likewise.
479 * symtab.h (class Symbol): Update declarations.
480 (class Sized_symbol): Likewise.
481 * resolve.cc (Symbol::override_version): New function.
c42e122e 482 (Symbol::override_base): Call override_version.
75517b77
ILT
483 (Symbol::override_base_with_special): Likewise.
484 * testsuite/ver_script_8.script: New file.
485 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
486 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
487 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
488 (ver_test_8_1.so, ver_test_8_2.so): New targets.
489
f1f70eae
ILT
4902008-05-06 Ian Lance Taylor <iant@google.com>
491
f3e9c5c5
ILT
492 PR 6049
493 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
494 functions.
495 (class General_options): Remove existing --undefined, and add
496 --no-undefined instead. Add new --undefined as synonym for -u.
497 * archive.cc (Archive::add_symbols): Check whether symbol was
498 named with -u.
499 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
500 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
501 all uses. Add IS_UNDEFINED. Update declarations to split
502 different versions of init_base. Declare init_base_undefined.
503 (Symbol::is_defined): Handle IS_UNDEFINED.
504 (Symbol::is_undefined): Likewise.
505 (Symbol::is_weak_undefined): Call is_undefined.
506 (Symbol::is_absolute): Handle IS_CONSTANT.
507 (class Sized_symbol): Update declarations to split different
508 versions of init. Declare init_undefined.
509 (class Symbol_table): Declare new functions.
510 * symtab.cc (Symbol::init_base_object): Rename from init_base.
511 Change all callers.
512 (Symbol::init_base_output_data): Likewise.
513 (Symbol::init_base_output_segment): Likewise.
514 (Symbol::init_base_constant): Likewise.
515 (Symbol::init_base_undefined): New function.
516 (Sized_symbol::init_object): Rename from init. Change all
517 callers.
518 (Sized_symbol::init_output_data): Likewise.
519 (Sized_symbol::init_output_segment): Likewise.
520 (Sized_symbol::init_constant): Likewise.
521 (Sized_symbol::init_undefined): New function.
522 (Symbol_table::add_undefined_symbols_from_command_line): New
523 function.
524 (Symbol_table::do_add_undefined_symbols_from_command_line): New
525 function.
526 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
527 (Symbol::output_section): Likewise.
528 (Symbol::set_output_section): Likewise.
529 (Symbol_table::sized_finalize_symbol): Likewise.
530 (Symbol_table::sized_write_globals): Likewise.
531 * resolve.cc (Symbol_table::should_override): Likewise.
532 (Symbol::override_base_with_special): Likewise.
533
8bdcdf2c
ILT
534 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
535 symbol, change it to have default visibility.
536 * testsuite/protected_1.cc: New file.
537 * testsuite/protected_2.cc: New file.
538 * testsuite/protected_3.cc: New file.
539 * testsuite/protected_main_1.cc: New file.
540 * testsuite/protected_main_2.cc: New file.
541 * testsuite/protected_main_3.cc: New file.
542 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
543 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
544 (protected_1_LDFLAGS, protected_1_LDADD): Define.
545 (protected_1.so): New target.
546 (protected_1_pic.o, protected_2_pic.o): New targets.
547 (protected_3_pic.o): New target.
548 (check_PROGRAMS): Add protected_2.
549 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
550 (protected_2_LDFLAGS, protected_2_LDADD): Define.
551 * testsuite/Makefile.in: Rebuild.
552
2b706932
ILT
553 * options.h (DEFINE_var): Add set_user_set_##varname__.
554 (DEFINE_bool_alias): New macro.
555 (class General_options): Define -Bstatic using DEFINE_bool_alias
556 rather than DEFINE_special. Add --undefined as an alias for -z
557 defs.
558 * options.cc (General_options::parse_Bstatic): Remove.
559
d82a5bcc
ILT
560 * options.h (class General_options): Add --fatal-warnings.
561 * main.cc (main): Implement --fatal-warnings.
562 * errors.h (Errors::warning_count): New function.
563
f1f70eae
ILT
564 * options.h (class General_options): Add -Bsymbolic-functions.
565 * symtab.h (Symbol::is_preemptible): Check for
566 -Bsymbolic-functions.
567
8825ac63
ILT
5682008-05-05 Ian Lance Taylor <iant@google.com>
569
d98bc257
ILT
570 * options.h (DEFINE_bool): For DASH_Z, create the negative option
571 as noVARNAME rather than no-VARNAME.
572 (class General_options): Add option -z combreloc.
573 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
574 get_address.
575 (Output_reloc::sort_before) [SHT_REL]: New function.
576 (Output_reloc::sort_before) [SHT_RELA]: New function.
577 (class Output_data_reloc_base): Add sort_relocs_ field. Define
578 Sort_relocs_comparison.
579 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
580 parameter. Change all callers.
581 (Output_data_reloc::Output_data_reloc) [both versions]: Add
582 sort_relocs parameter. Change all callers.
583 * output.cc (Output_reloc::get_address): New function, broken out
584 of write_rel.
585 (Output_reloc::write_rel): Call it.
586 (Output_reloc::compare): New function.
587 (Output_data_reloc_base::do_write): Optionally sort relocs.
588
60b2b4e7
ILT
589 * configure.ac: If targ_extra_obj is set, link it in.
590 * configure.tgt: Initialize all variables.
591 (x86_64*): Set targ_extra_obj and targ_extra_size.
592 * configure: Rebuild.
593
8825ac63
ILT
594 * object.cc (Sized_relobj::include_section_group): Adjust section
595 indexes read from group data. Build vector to pass to
596 layout_group.
597 * layout.cc (Layout::layout_group): Add flags and shndxes
598 parameters. Remove contents parameter. Change caller. Update
599 explicit instantiations.
600 * layout.h (class Layout): Update layout_group declaration.
601 * output.cc (Output_data_group::Output_data_group): Add flags and
602 input_shndxes parameters. Remove contents parameter. Change
603 caller.
604 (Output_data_group::do_write): Change input_sections_ to
605 input_shndxes_.
606 * output.h (class Output_data_group): Update constructor
607 declaration. Rename input_sections_ to input_shndxes_.
608 * testsuite/many_sections_test.cc: Add template.
609
e94cf127
CC
6102008-04-30 Cary Coutant <ccoutant@google.com>
611
4418b2d5
CC
612 * target-reloc.h (relocate_section): Fix dead-pointer bug.
613
e94cf127
CC
614 * layout.cc (Layout::include_section): Refactored check for debug
615 info section.
616 (Layout::add_comdat): Add new parameters. Change type
617 of signature parameter. Add object and shndx to signatures table.
618 (Layout::find_kept_object): New function.
619 * layout.h: Include <cstring>.
620 (Layout::is_debug_info_section): New function.
621 (Layout::add_comdat): Add new parameters.
622 (Layout::find_kept_object): New function.
623 (Layout::Kept_section): New struct.
624 (Layout::Signatures): Change type of map range.
625 * object.cc (Relobj::output_section_address): New function.
626 (Sized_relobj::include_section_group): Add new parameters. Change
627 calls to Layout::add_comdat. Change to build table of kept comdat
628 groups and table mapping discarded sections to kept sections.
629 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
630 (Sized_relobj::do_layout): Change calls to include_section_group and
631 include_linkonce_section.
632 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
633 value to zero when section is discarded.
634 (Sized_relobj::map_to_kept_section): New function.
635 * object.h (Relobj::output_section_address): New function.
636 (Relobj::Comdat_group): New type.
637 (Relobj::find_comdat_group): New function.
638 (Relobj::Comdat_group_table): New type.
639 (Relobj::Kept_comdat_section): New type.
640 (Relobj::Kept_comdat_section_table): New type.
641 (Relobj::add_comdat_group): New function.
642 (Relobj::set_kept_comdat_section): New function.
643 (Relobj::get_kept_comdat_section): New function.
644 (Relobj::comdat_groups_): New field.
645 (Relobj::kept_comdat_sections_): New field.
646 (Symbol_value::input_value): Update comment.
647 (Sized_relobj::map_to_kept_section) New function.
648 (Sized_relobj::include_linkonce_section): Add new parameter.
649 * target-reloc.h (Comdat_behavior): New type.
650 (get_comdat_behavior): New function.
651 (relocate_section): Add code to map a discarded section to the
652 corresponding kept section when applying a relocation.
653
e4e5049b
CS
6542008-04-30 Craig Silverstein <csilvers@google.com>
655
656 * dwarf_reader.cc (next_generation_count): New static var.
657 (Addr2line_cache_entry): New struct.
658 (addr2line_cache): New static var.
659 (Dwarf_line_info::one_addr2line): Added caching.
660 (Dwarf_line_info::clear_addr2line_cache): New function.
661 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
662 cache-size parameter.
663 (Dwarf_line_info::one_addr2line_cache): New function.
664 * symtab.cc (Symbol_table::detect_odr_violations): Pass
665 new cache-size argument to one_addr2line(), and clear cache.
666
d09e9154
CC
6672008-04-28 Cary Coutant <ccoutant@google.com>
668
669 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
670 R_386_PC8 relocations.
671
7ef73768
ILT
6722008-04-23 Ian Lance Taylor <iant@google.com>
673
55438702
ILT
674 * object.cc (Sized_relobj::include_section_group): Check for
675 invalid section group.
676
c165fb93
ILT
677 * object.cc (make_elf_object): Correct test for 64-bit ELF file
678 header size.
679
7ef73768
ILT
680 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
681 than read for file header.
682 * archive.cc (Archive::include_member): Likewise.
683
6194aaab
L
6842008-04-23 Paolo Bonzini <bonzini@gnu.org>
685
686 * aclocal.m4: Regenerate.
687 * configure: Regenerate.
688
d491d34e
ILT
6892008-04-19 Ian Lance Taylor <iant@google.com>
690
5ea2bac6
ILT
691 * version.cc (version_string): Bump to 1.6.
692
7bc3e21a
ILT
693 * testsuite/Makefile.am (many_sections_r_test): New target.
694 (many_sections_r_test_SOURCES): Remove.
695 (many_sections_r_test_DEPENDENCIES): Remove.
696 (many_sections_r_test_LDFLAGS): Remove.
697 (many_sections_r_test_LDADD): Remove.
698
7fcd3aa9
ILT
699 * object.cc (Sized_relobj::do_add_symbols): Always pass
700 local_symbol_count_ to add_from_relobj.
701
4c94d6ae
ILT
702 * testsuite/Makefile.am (many_sections_check.h): Only check one in
703 every thousand variables.
704 * testsuite/Makefile.in: Rebuild.
705
d491d34e
ILT
706 * object.cc (Xindex::initialize_symtab_xindex): New function.
707 (Xindex::read_symtab_xindex): New function.
708 (Xindex::sym_xindex_to_shndx): New function.
709 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
710 available.
711 (Sized_relobj::do_initialize_xindex): New function.
712 (Sized_relobj::do_read_symbols): Adjust section links.
713 (Sized_relobj::symbol_section_and_value): Add is_ordinary
714 parameter. Change all callers.
715 (Sized_relobj::include_section_group): Adjust section links and
716 symbol section indexes.
717 (Sized_relobj::do_layout): Adjust section links.
718 (Sized_relobj::do_count_local_symbols): Adjust section links and
719 symbol section indexes.
720 (Sized_relobj::do_finalize_local_symbols): Distinguish between
721 ordinary and special symbols.
722 (Sized_relobj::write_local_symbols): Add symtab_xindex and
723 dynsym_xindex parameters. Change all callers. Adjust section
724 links. Use SHN_XINDEX when needed.
725 (Sized_relobj::get_symbol_location_info): Adjust section links.
726 Don't get fooled by special symbols.
727 * object.h (class Xindex): Define.
728 (class Object): Add xindex_ parameter. Declare virtual functoin
729 do_initialize_xindex.
730 (Object::adjust_sym_shndx): New function.
731 (Object::set_xindex): New protected function.
732 (class Symbol_value): Add is_ordinary_shndx_ field.
733 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
734 (Symbol_value::value): Assert ordinary section.
735 (Symbol_value::initialize_input_to_output_map): Likewise.
736 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
737 Change all callers.
738 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
739 all callers.
740 (class Sized_relobj): Update declarations.
741 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
742 parameter. Change all callers.
743 (Sized_relobj::adjust_shndx): New function.
744 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
745 field.
746 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
747 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
748 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
749 (Sized_dynobj::read_dynsym_section): Adjust section links.
750 (Sized_dynobj::read_dynamic): Likewise.
751 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
752 section links.
753 (Sized_dynobj::do_initialize_xindex): New function.
754 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
755 do_initialize_xindex.
756 (Sized_dynobj::adjust_shndx): New function.
757 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
758 dynsym_xindex_ fields.
759 (Layout::finalize): Add a call to set_section_indexes before
760 creating the symtab sections.
761 (Layout::set_section_indexes): Don't do anything if the section
762 already has a section index.
763 (Layout::create_symtab_sections): Add shnum parameter. Change
764 caller. Create .symtab_shndx section if needed.
765 (Layout::create_shdrs): Add shstrtab_section parameter. Change
766 caller.
767 (Layout::allocated_output_section_count): New function.
768 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
769 needed.
770 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
771 fields. Update declarations.
772 (Layout::symtab_xindex): New function.
773 (Layout::dynsym_xindex): New function.
774 (class Write_symbols_task): Add layout_ field.
775 (Write_symbols_task::Write_symbols_task): Add layout parameter.
776 Change caller.
777 * output.cc (Output_section_headers::Output_section_headers): Add
778 shstrtab_section parameter. Change all callers.
779 (Output_section_headers::do_sized_write): Store overflow values
780 for section count and section string table section index in
781 section header zero.
782 (Output_file_header::do_sized_write): Check for overflow of
783 section count and section string table section index.
784 (Output_symtab_xindex::do_write): New function.
785 (Output_symtab_xindex::endian_do_write): New function.
786 * output.h (class Output_section_headers): Add shstrtab_section_.
787 Update declarations.
788 (class Output_symtab_xindex): Define.
789 (Output_section::has_out_shndx): New function.
790 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
791 field.
792 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
793 Change all callers.
794 (Sized_symbol::init): Likewise.
795 (Symbol::output_section): Check for ordinary symbol.
796 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
797 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
798 callers.
799 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
800 Change all callers. Simplify handling of symbols from sections
801 not included in the link.
802 (Symbol_table::add_from_dynobj): Handle ordinary symbol
803 distinction.
804 (Weak_alias_sorter::operator()): Assert that symbols are
805 ordinary.
806 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
807 distinction.
808 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
809 parameters. Change all callers.
810 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
811 symbol distinction. Use SHN_XINDEX when needed.
812 (Symbol_table::write_section_symbol): Add symtab_xindex
813 parameter. Change all callers.
814 (Symbol_table::sized_write_section_symbol): Likewise. Use
815 SHN_XINDEX when needed.
816 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
817 declarations.
818 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
819 (Symbol::is_defined): Check is_ordinary.
820 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
821 (Symbol::is_absolute, Symbol::is_common): Likewise.
822 (class Sized_symbol): Update declarations.
823 (class Symbol_table): Update declarations.
824 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
825 parameters. Change all callers.
826 (Sized_symbol::override): Likewise.
827 (Symbol_table::override): Likewise.
828 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
829 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
830 is_ordinary, and orig_st_shndx parameters. Change all callers.
831 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
832 to be in an ordinary section.
833 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
834 object and is_ordinary parameters. Change all callers.
835 (Sized_dwarf_line_info::read_relocs): Add object parameter.
836 Change all callers. Don't add undefined or non-ordinary symbols
837 to reloc_map_.
838 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
839 Change all callers.
840 * dwarf_reader.h (class Sized_dwarf_line_info): Update
841 declarations.
842 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
843 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
844 (Sized_relobj::relocate_sections): Likewise.
845 * target-reloc.h (scan_relocs): Adjust section symbol index.
846 (scan_relocatable_relocs): Likewise.
847 * i386.cc (Scan::local): Check for ordinary symbols.
848 * sparc.cc (Scan::local): Likewise.
849 * x86_64.cc (Scan::local): Likewise.
850 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
851 to symbol_section_and_value.
852 * testsuite/many_sections_test.cc: New file.
853 * testsuite/Makefile.am (BUILT_SOURCES): Define.
854 (check_PROGRAMS): Add many_sections_test.
855 (many_sections_test_SOURCES): Define.
856 (many_sections_test_DEPENDENCIES): Define.
857 (many_sections_test_LDFLAGS): Define.
858 (BUILT_SOURCES): Add many_sections_define.h.
859 (many_sections_define.h): New target.
860 (BUILT_SOURCES): Add many_sections_check.h.
861 (many_sections_check.h): New target.
862 (check_PROGRAMS): Add many_sections_r_test.
863 (many_sections_r_test_SOURCES): Define.
864 (many_sections_r_test_DEPENDENCIES): Define.
865 (many_sections_r_test_LDFLAGS): Define.
866 (many_sections_r_test_LDADD): Define.
867 (many_sections_r_test.o): New target.
868 * testsuite/Makefile.in: Rebuild.
869
c5818ff1
CC
8702008-04-17 Cary Coutant <ccoutant@google.com>
871
872 * errors.cc (Errors::info): New function.
873 (gold_info): New function.
874 * errors.h (Errors::info): New function.
875 * gold.h (gold_info): New function.
876 * object.cc (Input_objects::add_object): Print trace output.
877 * options.cc (options::parse_set): New function.
878 (General_options::parse_wrap): Deleted.
879 (General_options::General_options): Deleted initializer.
880 * options.h (options::String_set): New typedef.
881 (options::parse_set): New function.
882 (DEFINE_set): New macro.
883 (General_options::wrap): Changed to use DEFINE_set. Changed
884 callers of any_wrap_symbols and is_wrap_symbol.
885 (General_options::trace, General_options::trace_symbol):
886 New options.
887 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
888 (General_options::wrap_symbols_): Deleted.
889 * symtab.cc (Symbol_table::add_from_object): Print trace output.
890
b5be4a7c
DM
8912008-04-17 David S. Miller <davem@davemloft.net>
892
893 * options.cc (General_options::parse_V): New function.
894 * options.h: Add entries for -V and -Qy.
895
155a0dd7
ILT
8962008-04-17 Ian Lance Taylor <iant@google.com>
897
898 * common.cc (Symbol_table::allocate_commons): Remove options
899 parameter. Change caller.
900 (Symbol_table::do_allocate_commons): Remove options parameter.
901 Change caller. Just call do_allocate_commons_list twice.
902 (Symbol_table::do_allocate_commons_list): New function, broken out
903 of do_allocate_commons.
904 * common.h (class Allocate_commons_task): Remove options_ field.
905 Update constructor.
906 * symtab.cc (Symbol_table::Symbol_table): Initialize
907 tls_commons_.
908 (Symbol_table::add_from_object): Put TLS common symbols on
909 tls_commons_ list.
910 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
911 which are IN_OUTPUT_DATA.
912 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
913 allocate_commons and do_allocate_commons declarations. Declare
914 do_allocate_commons_list.
915 * gold.cc (queue_middle_tasks): Update creation of
916 Allocate_commons_task to not pass options.
917 * testsuite/Makefile.am (INCLUDES): Add -I.. .
918 (TLS_TEST_C_FLAGS): New variable.
919 (tls_test_c_pic.o): New target.
920 (tls_test_shared.so): Link in tls_test_c_pic.o.
921 (tls_test_c_pic_ie.o): New target.
922 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
923 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
924 (tls_test_c.o): New target.
925 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
926 (tls_pic_test_LDADD): Likewise.
927 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
928 (tls_shared_gd_to_ie_test_LDADD): Likewise.
929 (tls_test_c_gnu2.o): New target.
930 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
931 tls_test_c_gnu2.o.
932 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
933 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
934 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
935 * testsuite/tls_test.cc: Include "config.h".
936 (t_last): Call t11_last.
937 * testsuite/tls_test.h (t11, t11_last): Declare.
938 * testsuite/tls_test_c.c: New file.
939 * testsuite/tls_test_main.cc (thread_routine): Call t11.
940 * configure.ac: Check for OpenMP support.
941 * configure, config.in, Makefile.in: Rebuild.
942 * testsuite/Makefile.in: Rebuild.
943
edfbb029
CC
9442008-04-16 Cary Coutant <ccoutant@google.com>
945
946 * i386.cc (Target_i386::define_tls_base_symbol): New function.
947 (Target_i386::tls_base_symbol_defined_): New field.
948 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
949 (Target_i386::Scan::global): Likewise.
950 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
951 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
952 (Target_x86_64::tls_base_symbol_defined_): New field.
953 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
954 (Target_x86_64::Scan::global): Likewise.
955
f3c69fca
CC
9562008-04-16 Cary Coutant <ccoutant@google.com>
957
958 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
959 (Symbol::needs_plt_entry): Allow weak undefined symbols.
960 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
961 building shared libraries.
962 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
963 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
964 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
965 * testsuite/Makefile.in: Rebuild.
966 * testsuite/weak_undef.h: New file.
967 * testsuite/weak_undef_file1.cc: Add extra test cases.
968 * testsuite/weak_undef_file2.cc: Likewise.
969 * testsuite/weak_undef_test.cc: Likewise.
970
7c414435
DM
9712008-04-16 David S. Miller <davem@davemloft.net>
972
32b769e1
DM
973 * sparc.cc (Target_sparc::Scan): Change from struct to class.
974 Add issued_non_pic_error_ field. Declare check_non_pic.
975 (Target_sparc::Scan::check_non_pic): New function.
976 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
977 (Target_sparc::Scan::global): Likewise.
978
11936fb1
DM
979 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
980 * configure: Rebuild.
981
7c414435
DM
982 * options.h (DEFINE_enable): New macro.
983 (new_dtags): New enable option.
984 (initfirst, interpose, loadfltr, nodefaultlib,
985 nodelete, nodlopen, nodump): New -z options.
986 * layout.cc (Layout:finish_dynamic_section): If new
987 dtags enabled, emit DT_RUNPATH. Also, emit a
988 DT_FLAGS_1 containing any specified -z flags.
989
85c7bf8b
ILT
9902008-04-16 Ian Lance Taylor <iant@google.com>
991
12c0daef
ILT
992 * copy-relocs.cc: New file.
993 * copy-relocs.h: New file.
994 * reloc.cc: Remove Copy_relocs code.
995 * reloc.h: Likewise.
996 * reloc-types.h (struct Reloc_types) [both versions]: Add
997 get_reloc_addend_noerror.
998 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
999 variants of add_global which take an addend which must be zero.
1000 * i386.cc: Include "copy-relocs.h".
1001 (class Target_i386): Change type of copy_relocs_ to variable,
1002 update initializer.
1003 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
1004 Change all callers.
1005 (Target_i386::do_finalize_sections): Change handling of
1006 copy_relocs_.
1007 * sparc.cc: Include "copy-relocs.h".
1008 (class Target_sparc): Change type of copy_relocs_ to variable,
1009 update initializer.
1010 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
1011 Change all callers.
1012 (Target_sparc::do_finalize_sections): Change handling of
1013 copy_relocs_.
1014 * x86_64.cc: Include "copy-relocs.h".
1015 (class Target_x86_64): Change type of copy_relocs_ to variable,
1016 update initializer.
1017 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
1018 class. Change all callers.
1019 (Target_x86_64::do_finalize_sections): Change handling of
1020 copy_relocs_.
1021 * Makefile.am (CCFILES): Add copy-relocs.cc.
1022 (HFILES): Add copy-relocs.h.
1023
4f4995b6
ILT
1024 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
1025
85c7bf8b
ILT
1026 * testsuite/script_test_4.sh: Permit leading zeroes.
1027
4f2a9edd
ILT
10282008-04-15 Ian Lance Taylor <iant@google.com>
1029
e6188289
ILT
1030 * script-sections.cc (Script_sections::create_segments): Use
1031 header_size_adjustment even when there is enough room for the
1032 headers.
1033 * testsuite/script_test_4.sh: New file.
1034 * testsuite/script_test_4.t: New file.
1035 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
1036 (check_DATA): Add script_test_4.stdout.
1037 (MOSTLYCLEANFILES): Likewise.
1038 (script_test_4): New target.
1039 (script_test_4.stdout): New target.
1040 * testsuite/Makefile.in: Rebuild.
1041
4f2a9edd
ILT
1042 * sparc.cc: Add definitions for Output_data_plt_sparc class
1043 constants.
1044
f5314dd5
DM
10452008-04-14 David S. Miller <davem@davemloft.net>
1046
1047 * sparc.cc: New file.
1048 * Makefile.am (TARGETSOURCES): Add sparc.cc
1049 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
1050 * configure.tgt: Document targ_extra_size and
1051 targ_extra_big_endian. Add entries for sparc-* and
1052 sparc64-*.
1053 * configure.ac: Handle targ_extra_size and
1054 targ_extra_big_endian.
1055 * Makefile.in: Rebuild.
1056 * configure: Likewise.
1057 * po/POTFILES.in: Likewise.
1058 * po/gold.pot: Likewise.
1059
154e0e9a
ILT
10602008-04-14 Ian Lance Taylor <iant@google.com>
1061
1062 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
1063 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
1064 in the name/type/flags to section mapping. Don't call
1065 allocate_output_section.
1066 (Layout::choose_output_section): Change parameter from adjust_name
1067 to is_input_section. Don't permit input sections after sections
1068 are attached to segments. Don't call allocate_output_section.
1069 (Layout::layout_eh_frame): Call update_flags_for_input_section,
1070 not write_enable_output_section.
1071 (Layout::make_output_section): Don't push to
1072 unattached_section_list_ nor call attach_to_segment. Call
1073 attach_section_to_segment if sections are attached.
1074 (Layout::attach_sections_to_segments): New function.
1075 (Layout::attach_section_to_segment): New function.
1076 (Layout::attach_allocated_section_to_segment): Rename from
1077 attach_to_segment. Remove flags parameter.
1078 (Layout::allocate_output_section): Remove function.
1079 (Layout::write_enable_output_section): Remove function.
1080 * layout.h (class Layout): Update for above changes. Add new
1081 field sections_are_attached_.
1082 * output.h (Output_section::update_flags_for_input_section): New
1083 function.
1084 * output.cc (Output_section::add_input_section): Call
1085 update_flags_for_input_section.
1086 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
1087
009a67a2
CC
10882008-04-11 Cary Coutant <ccoutant@google.com>
1089
1090 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
1091 thought unnecessary.
1092 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
1093
759b1a24
ILT
10942008-04-11 Ian Lance Taylor <iant@google.com>
1095
1096 * output.h (class Output_section_data): Remove inline definition
1097 of set_addralign.
1098 * output.cc (Output_section_data::set_addralign): New function.
1099
c2b45e22
CC
11002008-04-11 Cary Coutant <ccoutant@google.com>
1101
1102 Add support for TLS descriptors for i386 and x86_64.
1103 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
1104 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
1105 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
1106 GOT_TYPE_TLS_DESC.
1107 (Target_i386::got_mod_index_entry): Remove unnecessary code.
1108 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
1109 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
1110 relocations.
1111 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
1112 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
1113 Fix problem with initial-exec relocations.
1114 (Target_i386::Relocate::relocate_tls): Likewise.
1115 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
1116 relaxation.
1117 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
1118 support for section-plus-offset dynamic table entries.
1119 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
1120 (Output_data_dynamic::Dynamic_entry): Add support for
1121 section-plus-offset dynamic table entries.
1122 (Output_data_dynamic::Classification): Likewise.
1123 (Output_data_dynamic::classification_): Renamed offset_.
1124 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
1125 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
1126 (Target_x86_64::make_plt_section): New function.
1127 (Target_x86_64::reserve_tlsdesc_entries): New function.
1128 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
1129 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
1130 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
1131 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
1132 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
1133 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
1134 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
1135 add extra PLT entry for TLS descriptors.
1136 (Output_data_plt_x86_64::got_): New field.
1137 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
1138 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
1139 fields.
1140 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
1141 descriptors.
1142 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
1143 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
1144 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
1145 R_386_TLS_DESC_CALL relocations.
1146 (Target_x86_64::Scan::global): Likewise.
1147 (Target_x86_64::do_finalize_sections): Add dynamic table entries
1148 for TLS descriptors.
1149 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
1150 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
1151 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
1152 GD-to-IE relaxation.
1153 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
1154 and TLS_DESCRIPTORS.
1155 * Makefile.in: Rebuild.
1156 * configure: Rebuild.
1157 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
1158 (tls_test_shared2.so): New target.
1159 (tls_shared_gd_to_ie_test_SOURCES): New variable.
1160 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
1161 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
1162 (tls_shared_gd_to_ie_test_LDADD): New variable.
1163 (tls_shared_gnu2_gd_to_ie_test): New target.
1164 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
1165 New targets.
1166 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
1167 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
1168 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
1169 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
1170 (tls_shared_gnu2_test): New target.
1171 (tls_test_gnu2_shared.so): New target.
1172 (tls_shared_gnu2_test_SOURCES): New variable.
1173 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
1174 (tls_shared_gnu2_test_LDFLAGS): New variable.
1175 (tls_shared_gnu2_test_LDADD): New variable.
1176 * testsuite/Makefile.in: Rebuild.
1177 * testsuite/Makefile.
1178
83bfb6b7
ILT
11792008-04-11 Ian Lance Taylor <iant@google.com>
1180
1181 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
1182 justsyms.t.
1183 * testsuite/Makefile.in: Rebuild.
1184
1185 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
1186 long.
1187 * testsuite/script_test_2.cc (main): Adjust test.
1188
706e1f5e
ILT
11892008-04-11 David S. Miller <davem@davemloft.net>
1190 Ian Lance Taylor <iant@google.com>
1191
1192 * options.h (General_options): Add entries for '-Y' and
1193 '-relax'.
1194 * options.cc (General_options:finalize): If -Y was used, add those
1195 entries to the library path instead of the default "/lib" and
1196 "/usr/lib".
1197
7c98e6bb
DM
11982008-04-11 David S. Miller <davem@davemloft.net>
1199
1200 * testsuite/justsyms.t: Start at 0x100.
1201 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
1202 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
1203 long.
1204 * testsuite/script_test_2.cc: Adjust string and section length
1205 checks.
7c98e6bb 1206
99a37bfd
ILT
12072008-04-09 Ian Lance Taylor <iant@google.com>
1208
2cefc357
ILT
1209 PR gold/5996
1210 * script-sections.cc (Sections_element::allocate_to_segment): Add
1211 orphan parameter.
1212 (Output_section_definition::allocate_to_segment): Likewise.
1213 (Orphan_output_section::allocate_to_segment): Likewise.
1214 (Script_sections::attach_sections_using_phdrs_clause): Don't
1215 propagate non-PT_LOAD segments to orphan sections.
1216 * testsuite/Makefile.am (script_test_3.stdout): Generate using
1217 readelf rather than objdump.
1218 * testsuite/script_test_3.sh: Adjust accordingly. Test that
1219 .interp section and PT_INTERP segment are the same size.
1220 * testsuite/Makefile.in: Rebuild.
1221
99a37bfd
ILT
1222 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
1223 aliases for symbols defined in the same object.
1224 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
1225 (weak_alias_test_SOURCES): New variable.
1226 (weak_alias_test_DEPENDENCIES): New variable.
1227 (weak_alias_test_LDFLAGS): New variable.
1228 (weak_alias_test_LDADD): New variable.
1229 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
1230 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
1231 (weak_alias_test_3.o): New target.
1232 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
1233 * testsuite/weak_alias_test_main.cc: New file.
1234 * testsuite/weak_alias_test_1.cc: New file.
1235 * testsuite/weak_alias_test_2.cc: New file.
1236 * testsuite/weak_alias_test_3.cc: New file.
1237
780e49c5
ILT
12382008-04-08 Ian Lance Taylor <iant@google.com>
1239
cdb0b8f5
ILT
1240 * options.h (class General_options): Add --noinhibit-exec option.
1241 * main.cc (main): Check --noinhibit-exec.
1242
0864d551
ILT
1243 * options.h (class General_options): Define --wrap as a special
1244 option. Add wrap_symbols_ field.
1245 (General_options::any_wrap_symbols): New function.
1246 (General_options::is_wrap_symbol): New function.
1247 * options.cc (General_options::parse_wrap): New function.
1248 (General_options::General_options): Initialize wrap_symbols_.
1249 * symtab.cc (Symbol_table::wrap_symbol): New function.
1250 (Symbol_table::add_from_object): Handle --wrap.
1251 * symtab.h (class Symbol_table): Declare wrap_symbol.
1252 * target.h (Target::wrap_char): New function.
1253 (Target::Target_info): Add wrap_char field.
1254 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
1255 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1256 * testsuite/testfile.cc (Target_test::test_target_info):
1257 Likewise.
1258
789aa6de
ILT
1259 * errors.cc (Errors::undefined_symbol): Mention symbol version if
1260 there is one.
1261
2c38906f
ILT
1262 * layout.h (class Layout): Add added_eh_frame_data_ field.
1263 * layout.cc (Layout::Layout): Initialize new field.
1264 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
1265 output section until we find a section we merged successfully.
1266 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
1267 that the size be non-zero.
1268
780e49c5
ILT
1269 * merge.cc (Object_merge_map::get_output_offset): Remove inline
1270 qualifier.
1271
7fcd0256
ILT
12722008-04-08 Craig Silverstein <csilvers@google.com>
1273
1274 * configure.ac: Export new conditional variable HAVE_ZLIB.
1275 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
1276 on HAVE_ZLIB.
1277 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
1278 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1279
6835af53
ILT
12802008-04-07 Ian Lance Taylor <iant@google.com>
1281
e24f324c
ILT
1282 * version.cc (version_string): Set to "1.5".
1283
a036edd8
ILT
1284 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
1285 Add issued_non_pic_error_ field. Declare check_non_pic.
1286 (Target_x86_64::Scan::check_non_pic): New function.
1287 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
1288 (Target_x86_64::Scan::global): Likewise.
1289
624f8810
ILT
1290 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
1291 addend parameter. Change caller. Handle merge sections.
1292 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
1293 Address to Addend. Don't add in the result of
1294 local_section_offset, pass down the addend and use the returned
1295 value.
1296 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
1297 Update declarations of local_section_offset and symbol_value.
1298 * testsuite/two_file_test_1.cc (t18): New function.
1299 * testsuite/two_file_test_2.cc (f18): New function.
1300 * testsuite/two_file_test_main.cc (main): Call t18.
1301 * testsuite/two_file_test.h (t18, f18): Declare.
1302
6835af53
ILT
1303 * configure.ac: Don't test for objdump, c++filt, or readelf.
1304 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
1305 conditionals.
1306 (TEST_READELF): New variable.
1307 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
1308 (check_PROGRAMS): Add two_file_strip_test.
1309 (two_file_strip_test): New target.
1310 (check_PROGRAMS): Add two_file_same_shared_strip_test.
1311 (two_file_same_shared_strip_test_SOURCES): New variable.
1312 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
1313 (two_file_same_shared_strip_test_LDFLAGS): New variable.
1314 (two_file_same_shared_strip_test_LDADD): New variable.
1315 (two_file_shared_strip.so): New target.
1316 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
1317 (ver_test_5.syms, ver_test_7.syms): Likewise.
1318 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
1319 (strip_test_3.stdout): Use TEST_OBJDUMP.
1320 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1321
86925eef
CC
13222008-04-04 Cary Coutant <ccoutant@google.com>
1323
1324 * symtab.h (Symbol::is_weak_undefined): New function.
1325 (Symbol::is_strong_undefined): New function.
1326 (Symbol::is_absolute): New function.
1327 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
1328 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
1329 absolute symbols.
1330 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
1331 (weak_undef_test): New target.
1332 * testsuite/Makefile.in: Rebuild.
1333 * testsuite/weak_undef_file1.cc: New file.
1334 * testsuite/weak_undef_file2.cc: New file.
1335 * testsuite/weak_undef_test.cc: New file.
1336
126f3ece
ILT
13372008-04-03 Craig Silverstein <csilvers@google.com>
1338
1339 * compressed_output.h (class Output_compressed_section): Use
1340 unsigned buffer.
1341 * compressed_output.cc (zlib_compress): Use unsigned buffers,
1342 add zlib header.
1343 (zlib_compressed_suffix): Removed.
1344 (Output_compressed_section::set_final_data_size): Use unsigned
1345 buffers.
1346 * testsuite/Makefile.am (flagstest_compress_debug_sections):
1347 Fix linker invocation.
1348 (flagstest_o_specialfile_and_compress_debug_sections):
1349 Likewise.
1350 * testsuite/Makefile.in: Regenerated.
1351
deae2a14
DM
13522008-04-02 David S. Miller <davem@davemloft.net>
1353
1354 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
1355 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
1356
70752818
ILT
13572008-04-02 Craig Silverstein <csilvers@google.com>
1358
1359 * TODO: New file.
1360
39d0cb0e
ILT
13612008-04-02 Ian Lance Taylor <iant@google.com>
1362
1363 * fileread.cc (File_read::find_view): Add byteshift and vshifted
1364 parameters. Update for new key type to views_. Change all
1365 callers.
1366 (File_read::read): Adjust for byteshift in returned view.
1367 (File_read::add_view): New function, broken out of
1368 find_and_make_view.
1369 (File_read::make_view): New function, broken out of
1370 find_and_make_view.
1371 (File_read::find_or_make_view): Add offset and aligned
1372 parameters. Rewrite accordingly. Change all callers.
1373 (File_read::get_view): Add offset and aligned parameters. Adjust
1374 for byteshift in return value.
1375 (File_read::get_lasting_view): Likewise.
1376 * fileread.h (class File_read): Update declarations.
1377 (class File_read::View): Add byteshift_ field. Add byteshift to
1378 constructor. Add byteshift method.
1379 * archive.h (Archive::clear_uncached_views): New function.
1380 (Archive::get_view): Add aligned parameter. Change all callers.
1381 * object.h (Object::get_view): Add aligned parameter. Change all
1382 callers.
1383 (Object::get_lasting_view): Likewise.
1384
1385 * fileread.cc (File_read::release): Don't call clear_views if
1386 there are multiple objects.
1387 * fileread.h (File_read::clear_uncached_views): New function.
1388 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
1389 on the archive.
1390
a1207466
CC
13912008-03-31 Cary Coutant <ccoutant@google.com>
1392
1393 Add thin archive support.
1394 * archive.cc (Archive::armagt): New const.
1395 (Archive::setup): Remove task parameter and calls to unlock.
1396 (Archive::unlock_nested_archives): New function.
1397 (Archive::read_header): Add nested_off parameter. Change
1398 all callers.
1399 (Archive::interpret_header): Likewise.
1400 (Archive::include_all_members): Change to handle thin
1401 archives.
1402 (Archive::include_member): Likewise.
1403 * archive.h (Archive::Archive): Add new parameters and
1404 initializers.
1405 (Archive::armagt): New const.
1406 (Archive::setup): Remove task parameter.
1407 (Archive::unlock_nested_archives): New function.
1408 (Archive::read_header): Add nested_off parameter.
1409 (Archive::interpret_header): Likewise.
1410 (Archive::Nested_archive_table): New typedef.
1411 (Archive::is_thin_archive_): New field.
1412 (Archive::nested_archives_): New field.
1413 (Archive::options_): New field.
1414 (Archive::dirpath_): New field.
1415 (Archive::task_): New field.
1416 * readsyms.cc (Read_symbols::do_read_symbols): Add check
1417 for thin archives. Pass additional parameters to
1418 Archive::Archive. Unlock the archive file after calling
1419 Archive::setup.
1420
479f6503
ILT
14212008-03-29 Ian Lance Taylor <iant@google.com>
1422
686c8caf
ILT
1423 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
1424 version symbol to be local.
1425 * testsuite/ver_test_4.sh: New file.
1426 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
1427 (check_DATA): Add ver_test_4.syms.
1428 (ver_test_4.syms): New target.
1429 * testsuite/Makefile.in: Rebuild.
1430
ab794b6b
ILT
1431 * output.cc
1432 (Output_section::Input_section_sort_entry::has_priority): New
1433 function.
1434 (Output_section::Input_section_sort_entry::match_file_name): New
1435 function.
1436 (Output_section::Input_section_sort_entry::match_section_name):
1437 Remove.
1438 (Output_section::Input_section_sort_entry::match_section_name_prefix):
1439 Remove.
1440 (Output_section::Input_section_sort_entry::match_section_file):
1441 Remove.
1442 (Output_section::Input_section_sort_compare::operator()): Rewrite
1443 using new Input_section_sort_entry functions. Sort crtbegin and
1444 crtend first. Sort sections with no priority before sections with
1445 a priority.
1446 * testsuite/initpri1.c (d3): Check j != 4.
1447 (cd5): New constructor/destructor function.
1448 (main): Check j != 2.
1449
479f6503
ILT
1450 * symtab.cc (Symbol_table::add_from_object): If we don't use the
1451 new symbol when resolving, don't call set_is_default.
1452 * testsuite/ver_test_7.cc: New file.
1453 * testsuite/ver_test_7.sh: New file.
1454 * testsuite/Makefile.am (ver_test_7.so): New target.
1455 (ver_test_7.o): New target.
1456 (check_SCRIPTS): Add ver_test_7.sh.
1457 (check_DATA): Add ver_test_7.syms.
1458 (ver_test_7.syms): New target.
1459
2fd32231
ILT
14602008-03-28 Ian Lance Taylor <iant@google.com>
1461
1462 * layout.cc (Layout::layout): If we see an input section with a
1463 name that needs sorting, set the must_sort flag for the output
1464 section.
1465 (Layout::make_output_section): If the name of the output section
1466 indicates that it might require sorting, set the may_sort flag.
1467 * output.h (Output_section::may_sort_attached_input_sections): New
1468 function.
1469 (Output_section::set_may_sort_attached_input_sections): New
1470 function.
1471 (Output_section::must_sort_attached_input_sections): New
1472 function.
1473 (Output_section::set_must_sort_attached_input_sections): New
1474 function.
1475 (class Output_section): Declare Input_section_sort_entry. Define
1476 Input_section_sort_compare. Declare
1477 sort_attached_input_sections. Add new fields:
1478 may_sort_attached_input_sections_,
1479 must_sort_attached_input_sections_,
1480 attached_input_sections_are_sorted_.
1481 * output.cc (Output_section::Output_section): Initialize new
1482 fields.
1483 (Output_section::add_input_section): Add an entry to
1484 input_sections_ if may_sort or must_sort are true.
1485 (Output_section::set_final_data_size): Call
1486 sort_attached_input_sections if necessary.
1487 (Output_section::Input_section_sort_entry): Define new class.
1488 (Output_section::Input_section_sort_compare::operator()): New
1489 function.
1490 (Output_section::sort_attached_input_sections): New function.
1491 * configure.ac: Check whether the compiler supports constructor
1492 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
1493 * testsuite/initpri1.c: New file.
1494 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
1495 CONSTRUCTOR_PRIORITY.
1496 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
1497 (initpri1_LDFLAGS): New variable.
1498 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1499
18e6b24e
ILT
15002008-03-27 Ian Lance Taylor <iant@google.com>
1501
49bdd526
ILT
1502 * common.cc (Sort_commons::operator): Correct sorting algorithm.
1503 * testsuite/common_test_1.c: New file.
1504 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
1505 (common_test_1_SOURCES): New variable.
1506 (common_test_1_DEPENDENCIES): New variable.
1507 (common_test_1_LDFLAGS): New variable.
1508
18e6b24e
ILT
1509 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
1510 and commons_ correctly when NAME/VERSION does not override
1511 NAME/NULL.
1512 * testsuite/ver_test_6.c: New file.
1513 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
1514 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
1515 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
1516
04bf7072
ILT
15172008-03-26 Ian Lance Taylor <iant@google.com>
1518
5871526f
ILT
1519 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
1520 of an undefined symbol from a version script.
1521 * testsuite/Makefile.am (ver_test_5.so): New target.
1522 (ver_test_5.o): New target.
1523 (check_SCRIPTS): Add ver_test_5.sh.
1524 (check_DATA): Add ver_test_5.syms.
1525 (ver_test_5.syms): New target.
1526 * testsuite/ver_test_5.cc: New file.
1527 * testsuite/ver_test_5.script: New file.
1528 * testsuite/ver_test_5.sh: New file.
1529 * Makefile.in, testsuite/Makefile.in: Rebuild.
1530
04bf7072
ILT
1531 PR gold/5986
1532 Fix problems building gold with gcc 4.3.0.
1533 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
1534 (gold_error_at_location, gold_warning_at_location): Use it.
1535 * configure.ac: Check whether we can compile and use a template
1536 function with a printf attribute.
1537 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
1538 when jumping over bytes.
1539 * object.cc: Instantiate Object::read_section_data.
1540 * debug.h: Include <cstring>
1541 * dwarf_reader.cc: Include <algorithm>
1542 * main.cc: Include <cstring>.
1543 * options.cc: Include <cstring>.
1544 * output.cc: Include <cstring>.
1545 * script.cc: Include <cstring>.
1546 * script.h: Include <string>.
1547 * symtab.cc: Include <cstring> and <algorithm>.
1548 * target-select.cc: Include <cstring>.
1549 * version.cc: Include <string>.
1550 * testsuite/testmain.cc: Include <cstdlib>.
1551 * configure, config.in: Rebuild.
1552
874c5b28
ILT
15532008-03-25 Ian Lance Taylor <iant@google.com>
1554
819d6c3a
ILT
1555 * options.cc: Include "../bfd/bfdver.h".
1556 (options::help): Print bug reporting address.
1557
f4b2c6f5
ILT
1558 * version.cc (print_version): Adjust output for current value of
1559 BFD_VERSION_STRING.
1560
1561 * NEWS: New file.
1562
e96caa79
ILT
1563 * options.cc (options::help): Print list of supported targets.
1564 * target-select.h: Include <vector>.
1565 (class Target_selector): Make machine_, size_, and is_big_endian_
1566 fields const. Add bfd_name_ and instantiated_target_ fields.
1567 (Target_selector::Target_selector): Add bfd_name parameter.
1568 (Target_selector::recognize): Make non-virtual, call
1569 do_recognize.
1570 (Target_selector::recognize_by_name): Make non-virtual, call
1571 do_recognize_by_name.
1572 (Target_selector::supported_names): New function.
1573 (Target_selector::bfd_name): New function.
1574 (Target_selector::do_instantiate_target): New pure virtual
1575 function.
1576 (Target_selector::do_recognize): New virtual function.
1577 (Target_selector::do_recognize_by_name): New virtual function.
1578 (Target_selector::instantiate_target): New private function.
1579 (supported_target_names): Declare.
1580 * target-select.cc (Target_selector::Target_selector): Update for
1581 new parameter and fields.
1582 (select_target_by_name): Check that the name matches before
1583 calling recognize_by_name.
1584 (supported_target_names): New function.
1585 * i386.cc (class Target_selector_i386): Update Target_selector
1586 constructor call. Remove recognize and recognize_by_name. Add
1587 do_instantiate_target.
1588 * x86_64.cc (class Target_selector_x86_64): Likewise.
1589 * testsuite/testfile.cc (class Target_selector_test): Update for
1590 changes to Target_selector.
1591
874c5b28
ILT
1592 * README: Rewrite, with some notes on unsupported features.
1593
0a65a3a7
CC
15942008-03-24 Cary Coutant <ccoutant@google.com>
1595
1596 * i386.cc (Target_i386::Got_type): New enum declaration.
1597 (Target_i386::Scan::local): Updated callers of Output_data_got
1598 member functions.
1599 (Target_i386::Scan::global): Likewise.
1600 (Target_i386::Relocate::relocate): Likewise.
1601 (Target_i386::Relocate::relocate_tls): Likewise.
1602 * object.h (Got_offset_list): New class.
1603 (Sized_relobj::local_has_got_offset): Added got_type parameter.
1604 (Sized_relobj::local_got_offset): Likewise.
1605 (Sized_relobj::set_local_got_offset): Likewise.
1606 (Sized_relobj::local_has_tls_got_offset): Removed.
1607 (Sized_relobj::local_tls_got_offset): Removed.
1608 (Sized_relobj::set_local_tls_got_offset): Removed.
1609 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
1610 * output.cc (Output_data_got::add_global): Added got_type parameter.
1611 (Output_data_got::add_global_with_rel): Likewise.
1612 (Output_data_got::add_global_with_rela): Likewise.
1613 (Output_data_got::add_global_pair_with_rel): New function.
1614 (Output_data_got::add_global_pair_with_rela): New function.
1615 (Output_data_got::add_local): Added got_type parameter.
1616 (Output_data_got::add_local_with_rel): Likewise.
1617 (Output_data_got::add_local_with_rela): Likewise.
1618 (Output_data_got::add_local_pair_with_rel): New function.
1619 (Output_data_got::add_local_pair_with_rela): New function.
1620 (Output_data_got::add_global_tls): Removed.
1621 (Output_data_got::add_global_tls_with_rel): Removed.
1622 (Output_data_got::add_global_tls_with_rela): Removed.
1623 (Output_data_got::add_local_tls): Removed.
1624 (Output_data_got::add_local_tls_with_rel): Removed.
1625 (Output_data_got::add_local_tls_with_rela): Removed.
1626 * output.h (Output_data_got::add_global): Added got_type parameter.
1627 (Output_data_got::add_global_with_rel): Likewise.
1628 (Output_data_got::add_global_with_rela): Likewise.
1629 (Output_data_got::add_global_pair_with_rel): New function.
1630 (Output_data_got::add_global_pair_with_rela): New function.
1631 (Output_data_got::add_local): Added got_type parameter.
1632 (Output_data_got::add_local_with_rel): Likewise.
1633 (Output_data_got::add_local_with_rela): Likewise.
1634 (Output_data_got::add_local_pair_with_rel): New function.
1635 (Output_data_got::add_local_pair_with_rela): New function.
1636 (Output_data_got::add_global_tls): Removed.
1637 (Output_data_got::add_global_tls_with_rel): Removed.
1638 (Output_data_got::add_global_tls_with_rela): Removed.
1639 (Output_data_got::add_local_tls): Removed.
1640 (Output_data_got::add_local_tls_with_rel): Removed.
1641 (Output_data_got::add_local_tls_with_rela): Removed.
1642 * resolve.cc (Symbol::override_base_with_special): Removed
1643 reference to has_got_offset_ field.
1644 * symtab.cc (Symbol::init_fields): Replaced initialization
1645 of got_offset_ with got_offsets_. Removed initialization
1646 of has_got_offset_
53fcba31 1647 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
1648 (Symbol::got_offset): Likewise.
1649 (Symbol::set_got_offset): Likewise.
1650 (Symbol::has_tls_got_offset): Removed.
1651 (Symbol::tls_got_offset): Removed.
1652 (Symbol::set_tls_got_offset): Removed.
1653 (Symbol::got_offset_): Removed.
1654 (Symbol::tls_mod_got_offset_): Removed.
1655 (Symbol::tls_pair_got_offset_): Removed.
1656 (Symbol::got_offsets_): New field.
1657 (Symbol::has_got_offset): Removed.
1658 (Symbol::has_tls_mod_got_offset): Removed.
1659 (Symbol::has_tls_pair_got_offset): Removed.
1660 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
1661 (Target_x86_64::Scan::local): Updated callers of Output_data_got
1662 member functions.
1663 (Target_x86_64::Scan::global): Likewise.
1664 (Target_x86_64::Relocate::relocate): Likewise.
1665 (Target_x86_64::Relocate::relocate_tls): Likewise.
1666
bd52eafb
BE
16672008-03-25 Ben Elliston <bje@au.ibm.com>
1668
1669 * yyscript.y: Fix spelling error in comment.
1670
8b105e34
ILT
16712008-03-24 Ian Lance Taylor <iant@google.com>
1672
8ed814a9
ILT
1673 * options.h (class General_options): Define build_id option.
1674 * layout.h (class Layout): Declare write_build_id, create_note,
1675 create_build_id. Add build_id_note_ member.
1676 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
1677 "libiberty.h", "md5.h", "sha1.h".
1678 (Layout::Layout): Initialize eh_frame_data_,
1679 eh_frame_hdr_section_, and build_id_note_.
1680 (Layout::finalize): Call create_build_id.
1681 (Layout::create_note): New function, broken out of
1682 Layout::create_gold_note.
1683 (Layout::create_gold_note): Call create_note.
1684 (Layout::create_build_id): New function.
1685 (Layout::write_build_id): New function.
1686 (Close_task_runner::run): Call write_build_id.
1687
8b105e34
ILT
1688 * x86_64.cc: Correct license to GPLv3.
1689
086a1841
ILT
16902008-03-23 Ian Lance Taylor <iant@google.com>
1691
1692 * options.cc: Include "demangle.h".
1693 (parse_optional_string): New function.
1694 (parse_long_option): Handle takes_optional_argument.
1695 (parse_short_option): Update dash_z initializer. Handle
1696 takes_optional_argument.
1697 (General_options::General_options): Initialize do_demangle_.
1698 (General_options::finalize): Set do_demangle_. Handle demangling
1699 style.
1700 * options.h (parse_optional_string): Declare.
1701 (struct One_option): Add optional_arg field. Update constructor.
1702 Update call constructor calls. Add takes_optional_argument
1703 function.
1704 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
1705 (DEFINE_optional_string): Define.
1706 (General_options::demangle): Change from DEFINE_bool to
1707 DEFINE_optional_string.
1708 (General_options::no_demangle): New function.
1709 (General_options::do_demangle): New function.
1710 (General_options::set_do_demangle): New function.
1711 (General_options::execstack_status_): Move definition to end of
1712 class definition.
1713 (General_options::static_): Likewise.
1714 (General_options::do_demangle_): New field.
1715 * object.cc (big_endian>::get_symbol_location_info): Call
1716 Options::do_demangle, not Options::demangle.
1717 * symtab.cc (demangle): Likewise.
1718
cbb93e63
ILT
17192008-03-22 Ian Lance Taylor <iant@google.com>
1720
1721 * gold.h: Include <cstddef> and <sys/types.h>
1722 * options.h: Include <cstring>.
1723
ec531623
ILT
17242008-03-21 Ian Lance Taylor <iant@google.com>
1725
1726 * Added source code to GNU binutils.
1727
This page took 0.107907 seconds and 4 git commands to generate.