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