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