1 2008-07-20 Chris Demetriou <cgd@google.com>
3 * configure.ac (gold_cv_c_random_seed): New configured variable.
4 (RANDOM_SEED_CFLAGS): New substituted variable.
5 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
7 * Makefile.in: Likewise.
8 * testsuite/Makefile.in: Likewise.
10 2008-07-18 Ian Lance Taylor <iant@google.com>
12 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
13 where we see NAME/NULL and NAME/VERSION as separate symbols.
14 * testsuite/ver_test_main.cc (main): Call t4.
16 * testsuite/ver_test_2.cc (t4_2): Define.
17 * testsuite/ver_test_2.script: Put t4_2a in VER2.
18 * testsuite/ver_test_4.cc (t4_2a): Define.
19 * testsuite/ver_test_4.script: Put t4_2a in VER2.
20 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
22 2008-07-17 Ian Lance Taylor <iant@google.com>
24 * dynobj.cc (Versions::add_def): If we give an error about a
25 missing version, go ahead and create the version anyhow.
27 2008-07-10 Ian Lance Taylor <iant@google.com>
29 Handle output sections with more than 0x7fffffff bytes.
30 * object.h (class Relobj): Change map_to_output_ to
31 output_sections_, and just keep a section pointer. Change all
32 uses. Move comdat group support to Sized_relobj.
33 (Relobj::is_section_specially_mapped): Remove.
34 (Relobj::output_section): Remove poff parameter. Change all
36 (Relobj::output_section_offset): New function.
37 (Relobj::set_section_offset): Rewrite.
38 (Relobj::map_to_output): Remove.
39 (Relobj::output_sections): New function.
40 (Relobj::do_output_section_offset): New pure virtual function.
41 (Relobj::do_set_section_offset): Likewise.
42 (class Sized_relobj): Add section_offsets_ field. Add comdat
43 group support from Relobj. Update declarations.
44 (Sized_relobj::get_output_section_offset): New function.
45 (Sized_relobj::do_output_section_offset): New function.
46 (Sized_relobj::do_set_section_offset): New function.
47 * object.cc (Relobj::output_section_address): Remove.
48 (Sized_relobj::Sized_relobj): Initialize new fields.
49 (Sized_relobj::include_section_group): Cast find_kept_object to
51 (Sized_relobj::include_linkonce_section): Likewise.
52 (Sized_relobj::do_layout): Use separate arrays for output section
54 (Sized_relobj::do_count_local_symbols): Change map_to_output to
56 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
57 output_sections and section_offsets.
58 (Sized_relobj::write_local_symbols): Likewise.
59 (map_to_kept_section): Compute output address directly.
60 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
61 output_sections and section_offsets.
62 (Sized_relobj::write_sections): Likewise.
63 (Sized_relobj::relocate_sections): Likewise.
64 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
65 * output.h (class Output_reloc): Update declarations. Change
66 u2_.relobj to Sized_relobj*.
67 (class Output_data_reloc): Change add functions to use
69 * output.cc (Output_reloc::Output_reloc): Change relobj to
71 (Output_reloc::local_section_offset): Change return type to
72 Elf_Addr. Use get_output_section_offset.
73 (Output_reloc::get_address): Likewise.
74 (Output_section::is_input_address_mapped): Don't call
75 is_section_specially_mapped.
76 (Output_section::output_offset): Likewise.
77 (Output_section::output_address): Likewise.
78 (Output_section::starting_output_address): Likewise.
79 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
80 parameter to Sized_relobj*.
81 (Copy_relocs::need_copy_reloc): Likewise.
82 (Copy_relocs::save): Likewise.
83 * copy-relocs.h (class Copy_relocs): Update declarations.
84 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
85 Sized_relobj*. Change relobj_ field to Sized_relobj*.
86 * target-reloc.h (relocate_for_relocatable): Change
87 offset_in_output_section type to Elf_Addr. Change code that uses
89 * layout.cc (Layout::layout): Always set *off.
90 * mapfile.cc (Mapfile::print_input_section): Use
91 output_section_offset.
92 * i386.cc (Target_i386::copy_reloc): Change object parameter to
94 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
95 * sparc.cc (Target_sparc::copy_reloc): Likewise.
96 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
98 2008-07-03 Ian Lance Taylor <iant@google.com>
100 * layout.cc (Layout::include_section): Do not discard unrecognized
103 2008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
105 * script.cc (Lex::can_continue_name): Make '?' allowable in
106 version-script names.
107 * testsuite/version_script.map: Change glob pattern to use '?'
109 2008-06-30 Manish Singh <yosh@gimp.org>
112 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
115 2008-06-30 Ian Lance Taylor <iant@google.com>
119 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
120 versions]: Don't try to read the value in the contents, since we
121 don't use it. Use the template endianness when writing.
123 2008-06-25 Cary Coutant <ccoutant@google.com>
125 * fileread.cc (File_read::make_view): Assert on zero-length view.
126 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
127 symbol table when there are no symbols to read.
129 2008-06-23 Craig Silverstein <csilvers@google.com>
131 * version.cc (version_string): Bump to 1.7
133 2008-06-18 Craig Silverstein <csilvers@google.com>
135 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
136 constant 0xFFFF to type Valtype.
137 (Powerpc_relocate_functions::rel16_ha): Likewise.
139 2008-06-17 Ian Lance Taylor <iant@google.com>
141 * output.h (Output_section::Input_section): Initialize p2align_ to
142 zero for Output_section_data constructors.
143 (Output_section::Input_section::addralign): If not an input
144 section, return the alignment of the Output_section_data.
145 * testsuite/copy_test.cc: New file.
146 * testsuite/copy_test_1.cc: New file.
147 * testsuite/copy_test_2.cc: New file.
148 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
149 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
150 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
151 (copy_test_1_pic.o, copy_test_1.so): New targets.
152 (copy_test_2_pic.o, copy_test_2.so): New targets.
153 * testsuite/Makefile.in: Rebuild.
155 * script-sections.cc (Script_sections::place_orphan): Initialize
156 local variable exact.
158 2008-06-13 David Edelsohn <edelsohn@gnu.org>
160 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
162 2008-06-12 David Edelsohn <edelsohn@gnu.org>
163 David S. Miller <davem@davemloft.net>
165 * powerpc.cc: New file.
166 * Makefile.am (TARGETSOURCES): Add powerpc.cc
167 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
168 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
169 * Makefile.in: Rebuild.
171 2008-06-09 Ian Lance Taylor <iant@google.com>
173 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
175 (throwing, orig_terminate): New static variables.
176 (terminate_handler): New static function.
177 (t2): Set terminate handler.
179 2008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
182 * binary.cc (Binary_to_elf::sized_convert): Fix .data
185 2008-05-30 Cary Coutant <ccoutant@google.com>
187 * archive.cc (Archive::include_all_members) Correct to step
188 over symbol table and extended name table in thin archives.
190 2008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
193 * target-reloc.h (relocate_for_relocatable): Fix new_offset
196 2008-05-28 Caleb Howe <cshowe@google.com>
198 * reduced_debug_output.cc: New file.
199 * reduced_debug_output.h: New file.
200 * options.h (class General_optoins): Add --strip-debug-non-line.
201 * options.cc (General_options::finalize): Add strip_debug_non_line
202 to the strip heirarchy.
203 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
205 * layout.cc: Include "reduced_debug_output.h".
206 (Layout::Layout): Initialize new fields.
207 (line_only_debug_sections): New static array.
208 (is_lines_only_debug_sections): New static inline function.
209 (Layout::include_section): Handle --strip-debug-non-line.
210 (Layout::make_output_section): If --strip-debug-non-line, build
211 new output sections for .debug_abbrev and .debug_info.
212 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
213 gold. Warn about possible overflow.
214 (read_signed_LEB_128): Likewise.
215 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
216 (read_signed_LEB_128): Declare.
217 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
218 (HFILES): Add reduced_debug_output.h.
219 * Makefile.in: Rebuild.
221 2008-05-21 Ian Lance Taylor <iant@google.com>
223 * mapfile.cc: New file.
224 * mapfile.h: New file.
225 * options.h (class General_options): Add -M/--print-map and -Map.
226 * options.cc (General_options::finalize): Make -M equivalent to
228 * main.cc: Include <cstdio> and "mapfile.h".
229 (main): Open mapfile if requested.
230 * gold.cc (class Middle_runner): Add mapfile_ field. Update
231 constructor. Change caller.
232 (queue_initial_tasks): Add mapfile parameter. Change caller.
233 (queue_middle_tasks): Likewise.
234 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
236 * archive.cc: Include "mapfile.h".
237 (Archive::add_symbols): Add mapfile parameter. Change all
238 callers. Pass mapfile, symbol, and reason to include_member.
239 (Archive::include_all_members): Add mapfile parameter. Change all
241 (Archive::include_member): Add mapfile, sym, and why parameters.
242 Change all callers. Report inclusion to map file.
243 * archive.h: Include "fileread.h".
244 (class Archive): Update declarations.
245 (Archive::file): New const method.
246 (class Add_archive_symbols): Add mapfile_ field. Update
247 constructor. Change all callers.
248 * readsyms.h (class Read_symbols): Likewise.
249 (class Finish_group): Likewise.
250 (class Read_script): Likewise.
251 * common.cc: Include "mapfile.h".
252 (Symbol_table::allocate_commons): Add mapfile parameter. Change
254 (Symbol_table::do_allocate_commons): Likewise.
255 (Symbol_table::do_allocate_commons_list): Likewise. Report common
256 symbol allocation to mapfile.
257 * common.h (class Allocate_commons_task): Add mapfile_ field.
258 Update constructor. Change all callers.
259 * symtab.h (class Symbol_table): Update declarations.
260 * layout.cc: Include "mapfile.h".
261 (Layout_task_runner::run): Print information to mapfile.
262 (Layout::create_gold_note): Change Output_data_fixed_space to
263 Output_data_zero_fill.
264 (Layout::create_build_id): Likewise.
265 (Layout::print_to_mapfile): New function.
266 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
267 constructor. Change caller.
268 (class Layout): Declare print_to_mapfile.
269 * output.cc (Output_section::Input_section::print_to_mapfile): New
271 (Output_section::add_input_section): If producing a map, always
272 add to input_sections_ list.
273 (Output_section::do_print_to_mapfile): New function.
274 (Output_segment::print_sections_to_mapfile): New function.
275 (Output_segment::print_section_list_to_mapfile): New function.
276 * output.h: Include "mapfile.h".
277 (Output_data::print_to_mapfile): New function.
278 (Output_data::do_print_to_mapfile): New virtual function.
279 (Output_segment_headers::do_print_to_mapfile): New function.
280 (Output_file_header::do_print_to_mapfile): New function.
281 (Output_data_const::do_print_to_mapfile): New function.
282 (class Output_data_const_buffer): Add map_name_ field. Update
283 constructor. Change all callers. Add do_print_to_mapfile
285 (class Output_data_fixed_space): Likewise.
286 (class Output_data_space): Likewise.
287 (class Output_data_zero_fill): New class.
288 (Output_data_strtab::do_print_to_mapfile): New function.
289 (Output_data_reloc_base::do_print_to_mapfile): New function.
290 (Output_relocatable_relocs::do_print_to_mapfile): New function.
291 (Output_data_group::do_print_to_mapfile): New function.
292 (Output_data_got::do_print_to_mapfile): New function.
293 (Output_data_dynamic::do_print_to_mapfile): New function.
294 (Output_symtab_xindex::do_print_to_mapfile): New function.
295 (class Output_section): Declare do_print_to_mapflie. Declare
296 print_to_mapfile in Input_section.
297 (class Output_segment): Declare new functions.
298 * object.h (Sized_relobj::symbol_count): New function.
300 (Output_section_element_dot_assignment::set_section_addresses):
301 Change Output_data_fixed_space to Output_data_zero_fill.
302 (Output_data_expression::do_print_to_mapfile): New function.
303 * script.cc (read_input_script): Add mapfile parameter. Change
305 * script.h (read_input_script): Update declaration.
306 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
307 (Eh_frame::do_print_to_mapfile): New function.
308 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
309 (Output_merge_string::do_print_to_mapfile): New function.
310 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
312 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
314 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
316 * Makefile.am (CCFILES): Add mapfile.cc.
317 (HFILES): Add mapfile.h.
318 * Makefile.in: Rebuild.
320 2008-05-19 Ian Lance Taylor <iant@google.com>
322 * options.h (class General_options): Add -z relro.
323 * layout.cc (Layout::Layout): Initialize relro_segment_.
324 (Layout::add_output_section_data): Return the output section.
325 (Layout::make_output_section): Rcognize relro sections and mark
327 (Layout::attach_allocated_section_to_segment): Put relro sections
328 in a PT_GNU_RELRO segment.
329 (Layout::create_initial_dynamic_sections): Mark the .dynamic
331 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
333 (Layout::linkonce_mapping): Map d.rel.ro.local to
335 (Layout::output_section_name): Us .data.rel.ro.local for any
336 section which begins with that.
337 * layout.h (class Layout): Update add_output_section_data
338 declaration. Add relro_segment_ field.
339 * output.cc (Output_section::Output_section): Initialize is_relro_
340 and is_relro_local_ fields.
341 (Output_segment::add_output_section): Group relro sections.
342 (Output_segment::is_first_section_relro): New function.
343 (Output_segment::maximum_alignment): If there is a relro section,
344 align the segment to the common page size.
345 (Output_segment::set_section_addresses): Track whether we are
346 looking at relro sections. If the last section is a relro
347 section, align to the common page size.
348 (Output_segment::set_section_list_addresses): Add in_relro
349 parameter. Change all callers. Align to the page size when
350 moving from relro to non-relro section.
351 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
353 * output.h (class Output_section): Add is_relro_ and
354 is_relro_local_ fields.
355 (Output_section::is_relro): New function.
356 (Output_section::set_is_relro): New function.
357 (Output_section::is_relro_local): New function.
358 (Output_section::set_is_relro_local): New function.
359 (class Output_segment): Update declarations.
360 * i386.cc (Target_i386::got_section): Mark .got section as relro.
361 * sparc.cc (Target_sparc::got_section): Likewise.
362 * x86_64.cc (Target_x86_64::got_section): Likewise.
363 * testsuite/relro_test_main.cc: New file.
364 * testsuite/relro_test.cc: New file.
365 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
366 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
367 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
368 (relro_test.so, relro_test_pic.o): New targets.
369 * testsuite/Makefile.in: Rebuild.
371 2008-05-16 Ian Lance Taylor <iant@google.com>
373 * output.cc (Output_segment::add_output_section): Remove front
375 * output.h (class Output_segment): Remove
376 add_initial_output_section and overloaded add_output_section.
377 Update declaration of remaining add_output_section.
378 * layout.cc (Layout::create_interp): Call add_output_section
379 rather than add_initial_output_section.
380 (Layout::finish_dynamic_section): Likewise.
382 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
383 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
384 know the dynamic type.
385 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
386 field. Initialize it in constructor.
387 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
388 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
389 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
392 * output.cc (Output_reloc::get_address): Change return type to
394 * output.h (class Output_reloc): Update get_address declaration.
395 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
396 for section addresses.
398 2008-05-09 Ian Lance Taylor <iant@google.com>
401 * gold.cc (gold_nomem): Use return value of write.
403 2008-05-08 Ian Lance Taylor <iant@google.com>
405 * symtab.c (Symbol::init_base_output_data): Add version
406 parameter. Change all callers.
407 (Symbol::init_base_output_segment): Likewise.
408 (Symbol::init_base_constant): Likewise.
409 (Symbol::init_base_undefined): Likewise.
410 (Sized_symbol::init_output_data): Likewise.
411 (Sized_symbol::init_output_segment): Likewise.
412 (Sized_symbol::init_constant): Likewise.
413 (Sized_symbol::init_undefined): Likewise.
414 (Symbol_table::do_define_in_output_data): If the new symbol has a
415 version, mark it as the default.
416 (Symbol_table::do_define_in_output_segment): Likewise.
417 (Symbol_table::do_define_as_constant): Likewise.
418 * symtab.h (class Symbol): Update declarations.
419 (class Sized_symbol): Likewise.
420 * resolve.cc (Symbol::override_version): New function.
421 (Symbol::override_base): Call override_version.
422 (Symbol::override_base_with_special): Likewise.
423 * testsuite/ver_script_8.script: New file.
424 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
425 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
426 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
427 (ver_test_8_1.so, ver_test_8_2.so): New targets.
429 2008-05-06 Ian Lance Taylor <iant@google.com>
432 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
434 (class General_options): Remove existing --undefined, and add
435 --no-undefined instead. Add new --undefined as synonym for -u.
436 * archive.cc (Archive::add_symbols): Check whether symbol was
438 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
439 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
440 all uses. Add IS_UNDEFINED. Update declarations to split
441 different versions of init_base. Declare init_base_undefined.
442 (Symbol::is_defined): Handle IS_UNDEFINED.
443 (Symbol::is_undefined): Likewise.
444 (Symbol::is_weak_undefined): Call is_undefined.
445 (Symbol::is_absolute): Handle IS_CONSTANT.
446 (class Sized_symbol): Update declarations to split different
447 versions of init. Declare init_undefined.
448 (class Symbol_table): Declare new functions.
449 * symtab.cc (Symbol::init_base_object): Rename from init_base.
451 (Symbol::init_base_output_data): Likewise.
452 (Symbol::init_base_output_segment): Likewise.
453 (Symbol::init_base_constant): Likewise.
454 (Symbol::init_base_undefined): New function.
455 (Sized_symbol::init_object): Rename from init. Change all
457 (Sized_symbol::init_output_data): Likewise.
458 (Sized_symbol::init_output_segment): Likewise.
459 (Sized_symbol::init_constant): Likewise.
460 (Sized_symbol::init_undefined): New function.
461 (Symbol_table::add_undefined_symbols_from_command_line): New
463 (Symbol_table::do_add_undefined_symbols_from_command_line): New
465 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
466 (Symbol::output_section): Likewise.
467 (Symbol::set_output_section): Likewise.
468 (Symbol_table::sized_finalize_symbol): Likewise.
469 (Symbol_table::sized_write_globals): Likewise.
470 * resolve.cc (Symbol_table::should_override): Likewise.
471 (Symbol::override_base_with_special): Likewise.
473 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
474 symbol, change it to have default visibility.
475 * testsuite/protected_1.cc: New file.
476 * testsuite/protected_2.cc: New file.
477 * testsuite/protected_3.cc: New file.
478 * testsuite/protected_main_1.cc: New file.
479 * testsuite/protected_main_2.cc: New file.
480 * testsuite/protected_main_3.cc: New file.
481 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
482 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
483 (protected_1_LDFLAGS, protected_1_LDADD): Define.
484 (protected_1.so): New target.
485 (protected_1_pic.o, protected_2_pic.o): New targets.
486 (protected_3_pic.o): New target.
487 (check_PROGRAMS): Add protected_2.
488 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
489 (protected_2_LDFLAGS, protected_2_LDADD): Define.
490 * testsuite/Makefile.in: Rebuild.
492 * options.h (DEFINE_var): Add set_user_set_##varname__.
493 (DEFINE_bool_alias): New macro.
494 (class General_options): Define -Bstatic using DEFINE_bool_alias
495 rather than DEFINE_special. Add --undefined as an alias for -z
497 * options.cc (General_options::parse_Bstatic): Remove.
499 * options.h (class General_options): Add --fatal-warnings.
500 * main.cc (main): Implement --fatal-warnings.
501 * errors.h (Errors::warning_count): New function.
503 * options.h (class General_options): Add -Bsymbolic-functions.
504 * symtab.h (Symbol::is_preemptible): Check for
505 -Bsymbolic-functions.
507 2008-05-05 Ian Lance Taylor <iant@google.com>
509 * options.h (DEFINE_bool): For DASH_Z, create the negative option
510 as noVARNAME rather than no-VARNAME.
511 (class General_options): Add option -z combreloc.
512 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
514 (Output_reloc::sort_before) [SHT_REL]: New function.
515 (Output_reloc::sort_before) [SHT_RELA]: New function.
516 (class Output_data_reloc_base): Add sort_relocs_ field. Define
517 Sort_relocs_comparison.
518 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
519 parameter. Change all callers.
520 (Output_data_reloc::Output_data_reloc) [both versions]: Add
521 sort_relocs parameter. Change all callers.
522 * output.cc (Output_reloc::get_address): New function, broken out
524 (Output_reloc::write_rel): Call it.
525 (Output_reloc::compare): New function.
526 (Output_data_reloc_base::do_write): Optionally sort relocs.
528 * configure.ac: If targ_extra_obj is set, link it in.
529 * configure.tgt: Initialize all variables.
530 (x86_64*): Set targ_extra_obj and targ_extra_size.
531 * configure: Rebuild.
533 * object.cc (Sized_relobj::include_section_group): Adjust section
534 indexes read from group data. Build vector to pass to
536 * layout.cc (Layout::layout_group): Add flags and shndxes
537 parameters. Remove contents parameter. Change caller. Update
538 explicit instantiations.
539 * layout.h (class Layout): Update layout_group declaration.
540 * output.cc (Output_data_group::Output_data_group): Add flags and
541 input_shndxes parameters. Remove contents parameter. Change
543 (Output_data_group::do_write): Change input_sections_ to
545 * output.h (class Output_data_group): Update constructor
546 declaration. Rename input_sections_ to input_shndxes_.
547 * testsuite/many_sections_test.cc: Add template.
549 2008-04-30 Cary Coutant <ccoutant@google.com>
551 * target-reloc.h (relocate_section): Fix dead-pointer bug.
553 * layout.cc (Layout::include_section): Refactored check for debug
555 (Layout::add_comdat): Add new parameters. Change type
556 of signature parameter. Add object and shndx to signatures table.
557 (Layout::find_kept_object): New function.
558 * layout.h: Include <cstring>.
559 (Layout::is_debug_info_section): New function.
560 (Layout::add_comdat): Add new parameters.
561 (Layout::find_kept_object): New function.
562 (Layout::Kept_section): New struct.
563 (Layout::Signatures): Change type of map range.
564 * object.cc (Relobj::output_section_address): New function.
565 (Sized_relobj::include_section_group): Add new parameters. Change
566 calls to Layout::add_comdat. Change to build table of kept comdat
567 groups and table mapping discarded sections to kept sections.
568 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
569 (Sized_relobj::do_layout): Change calls to include_section_group and
570 include_linkonce_section.
571 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
572 value to zero when section is discarded.
573 (Sized_relobj::map_to_kept_section): New function.
574 * object.h (Relobj::output_section_address): New function.
575 (Relobj::Comdat_group): New type.
576 (Relobj::find_comdat_group): New function.
577 (Relobj::Comdat_group_table): New type.
578 (Relobj::Kept_comdat_section): New type.
579 (Relobj::Kept_comdat_section_table): New type.
580 (Relobj::add_comdat_group): New function.
581 (Relobj::set_kept_comdat_section): New function.
582 (Relobj::get_kept_comdat_section): New function.
583 (Relobj::comdat_groups_): New field.
584 (Relobj::kept_comdat_sections_): New field.
585 (Symbol_value::input_value): Update comment.
586 (Sized_relobj::map_to_kept_section) New function.
587 (Sized_relobj::include_linkonce_section): Add new parameter.
588 * target-reloc.h (Comdat_behavior): New type.
589 (get_comdat_behavior): New function.
590 (relocate_section): Add code to map a discarded section to the
591 corresponding kept section when applying a relocation.
593 2008-04-30 Craig Silverstein <csilvers@google.com>
595 * dwarf_reader.cc (next_generation_count): New static var.
596 (Addr2line_cache_entry): New struct.
597 (addr2line_cache): New static var.
598 (Dwarf_line_info::one_addr2line): Added caching.
599 (Dwarf_line_info::clear_addr2line_cache): New function.
600 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
601 cache-size parameter.
602 (Dwarf_line_info::one_addr2line_cache): New function.
603 * symtab.cc (Symbol_table::detect_odr_violations): Pass
604 new cache-size argument to one_addr2line(), and clear cache.
606 2008-04-28 Cary Coutant <ccoutant@google.com>
608 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
609 R_386_PC8 relocations.
611 2008-04-23 Ian Lance Taylor <iant@google.com>
613 * object.cc (Sized_relobj::include_section_group): Check for
614 invalid section group.
616 * object.cc (make_elf_object): Correct test for 64-bit ELF file
619 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
620 than read for file header.
621 * archive.cc (Archive::include_member): Likewise.
623 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
625 * aclocal.m4: Regenerate.
626 * configure: Regenerate.
628 2008-04-19 Ian Lance Taylor <iant@google.com>
630 * version.cc (version_string): Bump to 1.6.
632 * testsuite/Makefile.am (many_sections_r_test): New target.
633 (many_sections_r_test_SOURCES): Remove.
634 (many_sections_r_test_DEPENDENCIES): Remove.
635 (many_sections_r_test_LDFLAGS): Remove.
636 (many_sections_r_test_LDADD): Remove.
638 * object.cc (Sized_relobj::do_add_symbols): Always pass
639 local_symbol_count_ to add_from_relobj.
641 * testsuite/Makefile.am (many_sections_check.h): Only check one in
642 every thousand variables.
643 * testsuite/Makefile.in: Rebuild.
645 * object.cc (Xindex::initialize_symtab_xindex): New function.
646 (Xindex::read_symtab_xindex): New function.
647 (Xindex::sym_xindex_to_shndx): New function.
648 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
650 (Sized_relobj::do_initialize_xindex): New function.
651 (Sized_relobj::do_read_symbols): Adjust section links.
652 (Sized_relobj::symbol_section_and_value): Add is_ordinary
653 parameter. Change all callers.
654 (Sized_relobj::include_section_group): Adjust section links and
655 symbol section indexes.
656 (Sized_relobj::do_layout): Adjust section links.
657 (Sized_relobj::do_count_local_symbols): Adjust section links and
658 symbol section indexes.
659 (Sized_relobj::do_finalize_local_symbols): Distinguish between
660 ordinary and special symbols.
661 (Sized_relobj::write_local_symbols): Add symtab_xindex and
662 dynsym_xindex parameters. Change all callers. Adjust section
663 links. Use SHN_XINDEX when needed.
664 (Sized_relobj::get_symbol_location_info): Adjust section links.
665 Don't get fooled by special symbols.
666 * object.h (class Xindex): Define.
667 (class Object): Add xindex_ parameter. Declare virtual functoin
668 do_initialize_xindex.
669 (Object::adjust_sym_shndx): New function.
670 (Object::set_xindex): New protected function.
671 (class Symbol_value): Add is_ordinary_shndx_ field.
672 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
673 (Symbol_value::value): Assert ordinary section.
674 (Symbol_value::initialize_input_to_output_map): Likewise.
675 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
677 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
679 (class Sized_relobj): Update declarations.
680 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
681 parameter. Change all callers.
682 (Sized_relobj::adjust_shndx): New function.
683 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
685 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
686 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
687 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
688 (Sized_dynobj::read_dynsym_section): Adjust section links.
689 (Sized_dynobj::read_dynamic): Likewise.
690 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
692 (Sized_dynobj::do_initialize_xindex): New function.
693 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
694 do_initialize_xindex.
695 (Sized_dynobj::adjust_shndx): New function.
696 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
697 dynsym_xindex_ fields.
698 (Layout::finalize): Add a call to set_section_indexes before
699 creating the symtab sections.
700 (Layout::set_section_indexes): Don't do anything if the section
701 already has a section index.
702 (Layout::create_symtab_sections): Add shnum parameter. Change
703 caller. Create .symtab_shndx section if needed.
704 (Layout::create_shdrs): Add shstrtab_section parameter. Change
706 (Layout::allocated_output_section_count): New function.
707 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
709 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
710 fields. Update declarations.
711 (Layout::symtab_xindex): New function.
712 (Layout::dynsym_xindex): New function.
713 (class Write_symbols_task): Add layout_ field.
714 (Write_symbols_task::Write_symbols_task): Add layout parameter.
716 * output.cc (Output_section_headers::Output_section_headers): Add
717 shstrtab_section parameter. Change all callers.
718 (Output_section_headers::do_sized_write): Store overflow values
719 for section count and section string table section index in
721 (Output_file_header::do_sized_write): Check for overflow of
722 section count and section string table section index.
723 (Output_symtab_xindex::do_write): New function.
724 (Output_symtab_xindex::endian_do_write): New function.
725 * output.h (class Output_section_headers): Add shstrtab_section_.
727 (class Output_symtab_xindex): Define.
728 (Output_section::has_out_shndx): New function.
729 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
731 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
733 (Sized_symbol::init): Likewise.
734 (Symbol::output_section): Check for ordinary symbol.
735 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
736 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
738 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
739 Change all callers. Simplify handling of symbols from sections
740 not included in the link.
741 (Symbol_table::add_from_dynobj): Handle ordinary symbol
743 (Weak_alias_sorter::operator()): Assert that symbols are
745 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
747 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
748 parameters. Change all callers.
749 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
750 symbol distinction. Use SHN_XINDEX when needed.
751 (Symbol_table::write_section_symbol): Add symtab_xindex
752 parameter. Change all callers.
753 (Symbol_table::sized_write_section_symbol): Likewise. Use
754 SHN_XINDEX when needed.
755 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
757 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
758 (Symbol::is_defined): Check is_ordinary.
759 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
760 (Symbol::is_absolute, Symbol::is_common): Likewise.
761 (class Sized_symbol): Update declarations.
762 (class Symbol_table): Update declarations.
763 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
764 parameters. Change all callers.
765 (Sized_symbol::override): Likewise.
766 (Symbol_table::override): Likewise.
767 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
768 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
769 is_ordinary, and orig_st_shndx parameters. Change all callers.
770 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
771 to be in an ordinary section.
772 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
773 object and is_ordinary parameters. Change all callers.
774 (Sized_dwarf_line_info::read_relocs): Add object parameter.
775 Change all callers. Don't add undefined or non-ordinary symbols
777 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
779 * dwarf_reader.h (class Sized_dwarf_line_info): Update
781 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
782 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
783 (Sized_relobj::relocate_sections): Likewise.
784 * target-reloc.h (scan_relocs): Adjust section symbol index.
785 (scan_relocatable_relocs): Likewise.
786 * i386.cc (Scan::local): Check for ordinary symbols.
787 * sparc.cc (Scan::local): Likewise.
788 * x86_64.cc (Scan::local): Likewise.
789 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
790 to symbol_section_and_value.
791 * testsuite/many_sections_test.cc: New file.
792 * testsuite/Makefile.am (BUILT_SOURCES): Define.
793 (check_PROGRAMS): Add many_sections_test.
794 (many_sections_test_SOURCES): Define.
795 (many_sections_test_DEPENDENCIES): Define.
796 (many_sections_test_LDFLAGS): Define.
797 (BUILT_SOURCES): Add many_sections_define.h.
798 (many_sections_define.h): New target.
799 (BUILT_SOURCES): Add many_sections_check.h.
800 (many_sections_check.h): New target.
801 (check_PROGRAMS): Add many_sections_r_test.
802 (many_sections_r_test_SOURCES): Define.
803 (many_sections_r_test_DEPENDENCIES): Define.
804 (many_sections_r_test_LDFLAGS): Define.
805 (many_sections_r_test_LDADD): Define.
806 (many_sections_r_test.o): New target.
807 * testsuite/Makefile.in: Rebuild.
809 2008-04-17 Cary Coutant <ccoutant@google.com>
811 * errors.cc (Errors::info): New function.
812 (gold_info): New function.
813 * errors.h (Errors::info): New function.
814 * gold.h (gold_info): New function.
815 * object.cc (Input_objects::add_object): Print trace output.
816 * options.cc (options::parse_set): New function.
817 (General_options::parse_wrap): Deleted.
818 (General_options::General_options): Deleted initializer.
819 * options.h (options::String_set): New typedef.
820 (options::parse_set): New function.
821 (DEFINE_set): New macro.
822 (General_options::wrap): Changed to use DEFINE_set. Changed
823 callers of any_wrap_symbols and is_wrap_symbol.
824 (General_options::trace, General_options::trace_symbol):
826 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
827 (General_options::wrap_symbols_): Deleted.
828 * symtab.cc (Symbol_table::add_from_object): Print trace output.
830 2008-04-17 David S. Miller <davem@davemloft.net>
832 * options.cc (General_options::parse_V): New function.
833 * options.h: Add entries for -V and -Qy.
835 2008-04-17 Ian Lance Taylor <iant@google.com>
837 * common.cc (Symbol_table::allocate_commons): Remove options
838 parameter. Change caller.
839 (Symbol_table::do_allocate_commons): Remove options parameter.
840 Change caller. Just call do_allocate_commons_list twice.
841 (Symbol_table::do_allocate_commons_list): New function, broken out
842 of do_allocate_commons.
843 * common.h (class Allocate_commons_task): Remove options_ field.
845 * symtab.cc (Symbol_table::Symbol_table): Initialize
847 (Symbol_table::add_from_object): Put TLS common symbols on
849 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
850 which are IN_OUTPUT_DATA.
851 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
852 allocate_commons and do_allocate_commons declarations. Declare
853 do_allocate_commons_list.
854 * gold.cc (queue_middle_tasks): Update creation of
855 Allocate_commons_task to not pass options.
856 * testsuite/Makefile.am (INCLUDES): Add -I.. .
857 (TLS_TEST_C_FLAGS): New variable.
858 (tls_test_c_pic.o): New target.
859 (tls_test_shared.so): Link in tls_test_c_pic.o.
860 (tls_test_c_pic_ie.o): New target.
861 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
862 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
863 (tls_test_c.o): New target.
864 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
865 (tls_pic_test_LDADD): Likewise.
866 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
867 (tls_shared_gd_to_ie_test_LDADD): Likewise.
868 (tls_test_c_gnu2.o): New target.
869 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
871 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
872 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
873 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
874 * testsuite/tls_test.cc: Include "config.h".
875 (t_last): Call t11_last.
876 * testsuite/tls_test.h (t11, t11_last): Declare.
877 * testsuite/tls_test_c.c: New file.
878 * testsuite/tls_test_main.cc (thread_routine): Call t11.
879 * configure.ac: Check for OpenMP support.
880 * configure, config.in, Makefile.in: Rebuild.
881 * testsuite/Makefile.in: Rebuild.
883 2008-04-16 Cary Coutant <ccoutant@google.com>
885 * i386.cc (Target_i386::define_tls_base_symbol): New function.
886 (Target_i386::tls_base_symbol_defined_): New field.
887 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
888 (Target_i386::Scan::global): Likewise.
889 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
890 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
891 (Target_x86_64::tls_base_symbol_defined_): New field.
892 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
893 (Target_x86_64::Scan::global): Likewise.
895 2008-04-16 Cary Coutant <ccoutant@google.com>
897 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
898 (Symbol::needs_plt_entry): Allow weak undefined symbols.
899 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
900 building shared libraries.
901 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
902 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
903 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
904 * testsuite/Makefile.in: Rebuild.
905 * testsuite/weak_undef.h: New file.
906 * testsuite/weak_undef_file1.cc: Add extra test cases.
907 * testsuite/weak_undef_file2.cc: Likewise.
908 * testsuite/weak_undef_test.cc: Likewise.
910 2008-04-16 David S. Miller <davem@davemloft.net>
912 * sparc.cc (Target_sparc::Scan): Change from struct to class.
913 Add issued_non_pic_error_ field. Declare check_non_pic.
914 (Target_sparc::Scan::check_non_pic): New function.
915 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
916 (Target_sparc::Scan::global): Likewise.
918 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
919 * configure: Rebuild.
921 * options.h (DEFINE_enable): New macro.
922 (new_dtags): New enable option.
923 (initfirst, interpose, loadfltr, nodefaultlib,
924 nodelete, nodlopen, nodump): New -z options.
925 * layout.cc (Layout:finish_dynamic_section): If new
926 dtags enabled, emit DT_RUNPATH. Also, emit a
927 DT_FLAGS_1 containing any specified -z flags.
929 2008-04-16 Ian Lance Taylor <iant@google.com>
931 * copy-relocs.cc: New file.
932 * copy-relocs.h: New file.
933 * reloc.cc: Remove Copy_relocs code.
935 * reloc-types.h (struct Reloc_types) [both versions]: Add
936 get_reloc_addend_noerror.
937 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
938 variants of add_global which take an addend which must be zero.
939 * i386.cc: Include "copy-relocs.h".
940 (class Target_i386): Change type of copy_relocs_ to variable,
942 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
944 (Target_i386::do_finalize_sections): Change handling of
946 * sparc.cc: Include "copy-relocs.h".
947 (class Target_sparc): Change type of copy_relocs_ to variable,
949 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
951 (Target_sparc::do_finalize_sections): Change handling of
953 * x86_64.cc: Include "copy-relocs.h".
954 (class Target_x86_64): Change type of copy_relocs_ to variable,
956 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
957 class. Change all callers.
958 (Target_x86_64::do_finalize_sections): Change handling of
960 * Makefile.am (CCFILES): Add copy-relocs.cc.
961 (HFILES): Add copy-relocs.h.
963 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
965 * testsuite/script_test_4.sh: Permit leading zeroes.
967 2008-04-15 Ian Lance Taylor <iant@google.com>
969 * script-sections.cc (Script_sections::create_segments): Use
970 header_size_adjustment even when there is enough room for the
972 * testsuite/script_test_4.sh: New file.
973 * testsuite/script_test_4.t: New file.
974 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
975 (check_DATA): Add script_test_4.stdout.
976 (MOSTLYCLEANFILES): Likewise.
977 (script_test_4): New target.
978 (script_test_4.stdout): New target.
979 * testsuite/Makefile.in: Rebuild.
981 * sparc.cc: Add definitions for Output_data_plt_sparc class
984 2008-04-14 David S. Miller <davem@davemloft.net>
986 * sparc.cc: New file.
987 * Makefile.am (TARGETSOURCES): Add sparc.cc
988 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
989 * configure.tgt: Document targ_extra_size and
990 targ_extra_big_endian. Add entries for sparc-* and
992 * configure.ac: Handle targ_extra_size and
993 targ_extra_big_endian.
994 * Makefile.in: Rebuild.
995 * configure: Likewise.
996 * po/POTFILES.in: Likewise.
997 * po/gold.pot: Likewise.
999 2008-04-14 Ian Lance Taylor <iant@google.com>
1001 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
1002 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
1003 in the name/type/flags to section mapping. Don't call
1004 allocate_output_section.
1005 (Layout::choose_output_section): Change parameter from adjust_name
1006 to is_input_section. Don't permit input sections after sections
1007 are attached to segments. Don't call allocate_output_section.
1008 (Layout::layout_eh_frame): Call update_flags_for_input_section,
1009 not write_enable_output_section.
1010 (Layout::make_output_section): Don't push to
1011 unattached_section_list_ nor call attach_to_segment. Call
1012 attach_section_to_segment if sections are attached.
1013 (Layout::attach_sections_to_segments): New function.
1014 (Layout::attach_section_to_segment): New function.
1015 (Layout::attach_allocated_section_to_segment): Rename from
1016 attach_to_segment. Remove flags parameter.
1017 (Layout::allocate_output_section): Remove function.
1018 (Layout::write_enable_output_section): Remove function.
1019 * layout.h (class Layout): Update for above changes. Add new
1020 field sections_are_attached_.
1021 * output.h (Output_section::update_flags_for_input_section): New
1023 * output.cc (Output_section::add_input_section): Call
1024 update_flags_for_input_section.
1025 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
1027 2008-04-11 Cary Coutant <ccoutant@google.com>
1029 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
1030 thought unnecessary.
1031 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
1033 2008-04-11 Ian Lance Taylor <iant@google.com>
1035 * output.h (class Output_section_data): Remove inline definition
1037 * output.cc (Output_section_data::set_addralign): New function.
1039 2008-04-11 Cary Coutant <ccoutant@google.com>
1041 Add support for TLS descriptors for i386 and x86_64.
1042 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
1043 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
1044 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
1046 (Target_i386::got_mod_index_entry): Remove unnecessary code.
1047 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
1048 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
1050 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
1051 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
1052 Fix problem with initial-exec relocations.
1053 (Target_i386::Relocate::relocate_tls): Likewise.
1054 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
1056 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
1057 support for section-plus-offset dynamic table entries.
1058 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
1059 (Output_data_dynamic::Dynamic_entry): Add support for
1060 section-plus-offset dynamic table entries.
1061 (Output_data_dynamic::Classification): Likewise.
1062 (Output_data_dynamic::classification_): Renamed offset_.
1063 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
1064 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
1065 (Target_x86_64::make_plt_section): New function.
1066 (Target_x86_64::reserve_tlsdesc_entries): New function.
1067 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
1068 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
1069 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
1070 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
1071 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
1072 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
1073 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
1074 add extra PLT entry for TLS descriptors.
1075 (Output_data_plt_x86_64::got_): New field.
1076 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
1077 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
1079 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
1081 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
1082 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
1083 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
1084 R_386_TLS_DESC_CALL relocations.
1085 (Target_x86_64::Scan::global): Likewise.
1086 (Target_x86_64::do_finalize_sections): Add dynamic table entries
1087 for TLS descriptors.
1088 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
1089 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
1090 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
1091 GD-to-IE relaxation.
1092 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
1093 and TLS_DESCRIPTORS.
1094 * Makefile.in: Rebuild.
1095 * configure: Rebuild.
1096 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
1097 (tls_test_shared2.so): New target.
1098 (tls_shared_gd_to_ie_test_SOURCES): New variable.
1099 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
1100 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
1101 (tls_shared_gd_to_ie_test_LDADD): New variable.
1102 (tls_shared_gnu2_gd_to_ie_test): New target.
1103 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
1105 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
1106 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
1107 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
1108 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
1109 (tls_shared_gnu2_test): New target.
1110 (tls_test_gnu2_shared.so): New target.
1111 (tls_shared_gnu2_test_SOURCES): New variable.
1112 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
1113 (tls_shared_gnu2_test_LDFLAGS): New variable.
1114 (tls_shared_gnu2_test_LDADD): New variable.
1115 * testsuite/Makefile.in: Rebuild.
1116 * testsuite/Makefile.
1118 2008-04-11 Ian Lance Taylor <iant@google.com>
1120 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
1122 * testsuite/Makefile.in: Rebuild.
1124 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
1126 * testsuite/script_test_2.cc (main): Adjust test.
1128 2008-04-11 David S. Miller <davem@davemloft.net>
1129 Ian Lance Taylor <iant@google.com>
1131 * options.h (General_options): Add entries for '-Y' and
1133 * options.cc (General_options:finalize): If -Y was used, add those
1134 entries to the library path instead of the default "/lib" and
1137 2008-04-11 David S. Miller <davem@davemloft.net>
1139 * testsuite/justsyms.t: Start at 0x100.
1140 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
1141 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
1143 * testsuite/script_test_2.cc: Adjust string and section length
1146 2008-04-09 Ian Lance Taylor <iant@google.com>
1149 * script-sections.cc (Sections_element::allocate_to_segment): Add
1151 (Output_section_definition::allocate_to_segment): Likewise.
1152 (Orphan_output_section::allocate_to_segment): Likewise.
1153 (Script_sections::attach_sections_using_phdrs_clause): Don't
1154 propagate non-PT_LOAD segments to orphan sections.
1155 * testsuite/Makefile.am (script_test_3.stdout): Generate using
1156 readelf rather than objdump.
1157 * testsuite/script_test_3.sh: Adjust accordingly. Test that
1158 .interp section and PT_INTERP segment are the same size.
1159 * testsuite/Makefile.in: Rebuild.
1161 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
1162 aliases for symbols defined in the same object.
1163 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
1164 (weak_alias_test_SOURCES): New variable.
1165 (weak_alias_test_DEPENDENCIES): New variable.
1166 (weak_alias_test_LDFLAGS): New variable.
1167 (weak_alias_test_LDADD): New variable.
1168 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
1169 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
1170 (weak_alias_test_3.o): New target.
1171 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
1172 * testsuite/weak_alias_test_main.cc: New file.
1173 * testsuite/weak_alias_test_1.cc: New file.
1174 * testsuite/weak_alias_test_2.cc: New file.
1175 * testsuite/weak_alias_test_3.cc: New file.
1177 2008-04-08 Ian Lance Taylor <iant@google.com>
1179 * options.h (class General_options): Add --noinhibit-exec option.
1180 * main.cc (main): Check --noinhibit-exec.
1182 * options.h (class General_options): Define --wrap as a special
1183 option. Add wrap_symbols_ field.
1184 (General_options::any_wrap_symbols): New function.
1185 (General_options::is_wrap_symbol): New function.
1186 * options.cc (General_options::parse_wrap): New function.
1187 (General_options::General_options): Initialize wrap_symbols_.
1188 * symtab.cc (Symbol_table::wrap_symbol): New function.
1189 (Symbol_table::add_from_object): Handle --wrap.
1190 * symtab.h (class Symbol_table): Declare wrap_symbol.
1191 * target.h (Target::wrap_char): New function.
1192 (Target::Target_info): Add wrap_char field.
1193 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
1194 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1195 * testsuite/testfile.cc (Target_test::test_target_info):
1198 * errors.cc (Errors::undefined_symbol): Mention symbol version if
1201 * layout.h (class Layout): Add added_eh_frame_data_ field.
1202 * layout.cc (Layout::Layout): Initialize new field.
1203 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
1204 output section until we find a section we merged successfully.
1205 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
1206 that the size be non-zero.
1208 * merge.cc (Object_merge_map::get_output_offset): Remove inline
1211 2008-04-08 Craig Silverstein <csilvers@google.com>
1213 * configure.ac: Export new conditional variable HAVE_ZLIB.
1214 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
1216 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
1217 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1219 2008-04-07 Ian Lance Taylor <iant@google.com>
1221 * version.cc (version_string): Set to "1.5".
1223 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
1224 Add issued_non_pic_error_ field. Declare check_non_pic.
1225 (Target_x86_64::Scan::check_non_pic): New function.
1226 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
1227 (Target_x86_64::Scan::global): Likewise.
1229 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
1230 addend parameter. Change caller. Handle merge sections.
1231 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
1232 Address to Addend. Don't add in the result of
1233 local_section_offset, pass down the addend and use the returned
1235 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
1236 Update declarations of local_section_offset and symbol_value.
1237 * testsuite/two_file_test_1.cc (t18): New function.
1238 * testsuite/two_file_test_2.cc (f18): New function.
1239 * testsuite/two_file_test_main.cc (main): Call t18.
1240 * testsuite/two_file_test.h (t18, f18): Declare.
1242 * configure.ac: Don't test for objdump, c++filt, or readelf.
1243 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
1245 (TEST_READELF): New variable.
1246 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
1247 (check_PROGRAMS): Add two_file_strip_test.
1248 (two_file_strip_test): New target.
1249 (check_PROGRAMS): Add two_file_same_shared_strip_test.
1250 (two_file_same_shared_strip_test_SOURCES): New variable.
1251 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
1252 (two_file_same_shared_strip_test_LDFLAGS): New variable.
1253 (two_file_same_shared_strip_test_LDADD): New variable.
1254 (two_file_shared_strip.so): New target.
1255 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
1256 (ver_test_5.syms, ver_test_7.syms): Likewise.
1257 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
1258 (strip_test_3.stdout): Use TEST_OBJDUMP.
1259 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1261 2008-04-04 Cary Coutant <ccoutant@google.com>
1263 * symtab.h (Symbol::is_weak_undefined): New function.
1264 (Symbol::is_strong_undefined): New function.
1265 (Symbol::is_absolute): New function.
1266 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
1267 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
1269 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
1270 (weak_undef_test): New target.
1271 * testsuite/Makefile.in: Rebuild.
1272 * testsuite/weak_undef_file1.cc: New file.
1273 * testsuite/weak_undef_file2.cc: New file.
1274 * testsuite/weak_undef_test.cc: New file.
1276 2008-04-03 Craig Silverstein <csilvers@google.com>
1278 * compressed_output.h (class Output_compressed_section): Use
1280 * compressed_output.cc (zlib_compress): Use unsigned buffers,
1282 (zlib_compressed_suffix): Removed.
1283 (Output_compressed_section::set_final_data_size): Use unsigned
1285 * testsuite/Makefile.am (flagstest_compress_debug_sections):
1286 Fix linker invocation.
1287 (flagstest_o_specialfile_and_compress_debug_sections):
1289 * testsuite/Makefile.in: Regenerated.
1291 2008-04-02 David S. Miller <davem@davemloft.net>
1293 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
1294 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
1296 2008-04-02 Craig Silverstein <csilvers@google.com>
1300 2008-04-02 Ian Lance Taylor <iant@google.com>
1302 * fileread.cc (File_read::find_view): Add byteshift and vshifted
1303 parameters. Update for new key type to views_. Change all
1305 (File_read::read): Adjust for byteshift in returned view.
1306 (File_read::add_view): New function, broken out of
1308 (File_read::make_view): New function, broken out of
1310 (File_read::find_or_make_view): Add offset and aligned
1311 parameters. Rewrite accordingly. Change all callers.
1312 (File_read::get_view): Add offset and aligned parameters. Adjust
1313 for byteshift in return value.
1314 (File_read::get_lasting_view): Likewise.
1315 * fileread.h (class File_read): Update declarations.
1316 (class File_read::View): Add byteshift_ field. Add byteshift to
1317 constructor. Add byteshift method.
1318 * archive.h (Archive::clear_uncached_views): New function.
1319 (Archive::get_view): Add aligned parameter. Change all callers.
1320 * object.h (Object::get_view): Add aligned parameter. Change all
1322 (Object::get_lasting_view): Likewise.
1324 * fileread.cc (File_read::release): Don't call clear_views if
1325 there are multiple objects.
1326 * fileread.h (File_read::clear_uncached_views): New function.
1327 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
1330 2008-03-31 Cary Coutant <ccoutant@google.com>
1332 Add thin archive support.
1333 * archive.cc (Archive::armagt): New const.
1334 (Archive::setup): Remove task parameter and calls to unlock.
1335 (Archive::unlock_nested_archives): New function.
1336 (Archive::read_header): Add nested_off parameter. Change
1338 (Archive::interpret_header): Likewise.
1339 (Archive::include_all_members): Change to handle thin
1341 (Archive::include_member): Likewise.
1342 * archive.h (Archive::Archive): Add new parameters and
1344 (Archive::armagt): New const.
1345 (Archive::setup): Remove task parameter.
1346 (Archive::unlock_nested_archives): New function.
1347 (Archive::read_header): Add nested_off parameter.
1348 (Archive::interpret_header): Likewise.
1349 (Archive::Nested_archive_table): New typedef.
1350 (Archive::is_thin_archive_): New field.
1351 (Archive::nested_archives_): New field.
1352 (Archive::options_): New field.
1353 (Archive::dirpath_): New field.
1354 (Archive::task_): New field.
1355 * readsyms.cc (Read_symbols::do_read_symbols): Add check
1356 for thin archives. Pass additional parameters to
1357 Archive::Archive. Unlock the archive file after calling
1360 2008-03-29 Ian Lance Taylor <iant@google.com>
1362 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
1363 version symbol to be local.
1364 * testsuite/ver_test_4.sh: New file.
1365 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
1366 (check_DATA): Add ver_test_4.syms.
1367 (ver_test_4.syms): New target.
1368 * testsuite/Makefile.in: Rebuild.
1371 (Output_section::Input_section_sort_entry::has_priority): New
1373 (Output_section::Input_section_sort_entry::match_file_name): New
1375 (Output_section::Input_section_sort_entry::match_section_name):
1377 (Output_section::Input_section_sort_entry::match_section_name_prefix):
1379 (Output_section::Input_section_sort_entry::match_section_file):
1381 (Output_section::Input_section_sort_compare::operator()): Rewrite
1382 using new Input_section_sort_entry functions. Sort crtbegin and
1383 crtend first. Sort sections with no priority before sections with
1385 * testsuite/initpri1.c (d3): Check j != 4.
1386 (cd5): New constructor/destructor function.
1387 (main): Check j != 2.
1389 * symtab.cc (Symbol_table::add_from_object): If we don't use the
1390 new symbol when resolving, don't call set_is_default.
1391 * testsuite/ver_test_7.cc: New file.
1392 * testsuite/ver_test_7.sh: New file.
1393 * testsuite/Makefile.am (ver_test_7.so): New target.
1394 (ver_test_7.o): New target.
1395 (check_SCRIPTS): Add ver_test_7.sh.
1396 (check_DATA): Add ver_test_7.syms.
1397 (ver_test_7.syms): New target.
1399 2008-03-28 Ian Lance Taylor <iant@google.com>
1401 * layout.cc (Layout::layout): If we see an input section with a
1402 name that needs sorting, set the must_sort flag for the output
1404 (Layout::make_output_section): If the name of the output section
1405 indicates that it might require sorting, set the may_sort flag.
1406 * output.h (Output_section::may_sort_attached_input_sections): New
1408 (Output_section::set_may_sort_attached_input_sections): New
1410 (Output_section::must_sort_attached_input_sections): New
1412 (Output_section::set_must_sort_attached_input_sections): New
1414 (class Output_section): Declare Input_section_sort_entry. Define
1415 Input_section_sort_compare. Declare
1416 sort_attached_input_sections. Add new fields:
1417 may_sort_attached_input_sections_,
1418 must_sort_attached_input_sections_,
1419 attached_input_sections_are_sorted_.
1420 * output.cc (Output_section::Output_section): Initialize new
1422 (Output_section::add_input_section): Add an entry to
1423 input_sections_ if may_sort or must_sort are true.
1424 (Output_section::set_final_data_size): Call
1425 sort_attached_input_sections if necessary.
1426 (Output_section::Input_section_sort_entry): Define new class.
1427 (Output_section::Input_section_sort_compare::operator()): New
1429 (Output_section::sort_attached_input_sections): New function.
1430 * configure.ac: Check whether the compiler supports constructor
1431 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
1432 * testsuite/initpri1.c: New file.
1433 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
1434 CONSTRUCTOR_PRIORITY.
1435 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
1436 (initpri1_LDFLAGS): New variable.
1437 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1439 2008-03-27 Ian Lance Taylor <iant@google.com>
1441 * common.cc (Sort_commons::operator): Correct sorting algorithm.
1442 * testsuite/common_test_1.c: New file.
1443 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
1444 (common_test_1_SOURCES): New variable.
1445 (common_test_1_DEPENDENCIES): New variable.
1446 (common_test_1_LDFLAGS): New variable.
1448 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
1449 and commons_ correctly when NAME/VERSION does not override
1451 * testsuite/ver_test_6.c: New file.
1452 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
1453 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
1454 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
1456 2008-03-26 Ian Lance Taylor <iant@google.com>
1458 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
1459 of an undefined symbol from a version script.
1460 * testsuite/Makefile.am (ver_test_5.so): New target.
1461 (ver_test_5.o): New target.
1462 (check_SCRIPTS): Add ver_test_5.sh.
1463 (check_DATA): Add ver_test_5.syms.
1464 (ver_test_5.syms): New target.
1465 * testsuite/ver_test_5.cc: New file.
1466 * testsuite/ver_test_5.script: New file.
1467 * testsuite/ver_test_5.sh: New file.
1468 * Makefile.in, testsuite/Makefile.in: Rebuild.
1471 Fix problems building gold with gcc 4.3.0.
1472 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
1473 (gold_error_at_location, gold_warning_at_location): Use it.
1474 * configure.ac: Check whether we can compile and use a template
1475 function with a printf attribute.
1476 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
1477 when jumping over bytes.
1478 * object.cc: Instantiate Object::read_section_data.
1479 * debug.h: Include <cstring>
1480 * dwarf_reader.cc: Include <algorithm>
1481 * main.cc: Include <cstring>.
1482 * options.cc: Include <cstring>.
1483 * output.cc: Include <cstring>.
1484 * script.cc: Include <cstring>.
1485 * script.h: Include <string>.
1486 * symtab.cc: Include <cstring> and <algorithm>.
1487 * target-select.cc: Include <cstring>.
1488 * version.cc: Include <string>.
1489 * testsuite/testmain.cc: Include <cstdlib>.
1490 * configure, config.in: Rebuild.
1492 2008-03-25 Ian Lance Taylor <iant@google.com>
1494 * options.cc: Include "../bfd/bfdver.h".
1495 (options::help): Print bug reporting address.
1497 * version.cc (print_version): Adjust output for current value of
1502 * options.cc (options::help): Print list of supported targets.
1503 * target-select.h: Include <vector>.
1504 (class Target_selector): Make machine_, size_, and is_big_endian_
1505 fields const. Add bfd_name_ and instantiated_target_ fields.
1506 (Target_selector::Target_selector): Add bfd_name parameter.
1507 (Target_selector::recognize): Make non-virtual, call
1509 (Target_selector::recognize_by_name): Make non-virtual, call
1510 do_recognize_by_name.
1511 (Target_selector::supported_names): New function.
1512 (Target_selector::bfd_name): New function.
1513 (Target_selector::do_instantiate_target): New pure virtual
1515 (Target_selector::do_recognize): New virtual function.
1516 (Target_selector::do_recognize_by_name): New virtual function.
1517 (Target_selector::instantiate_target): New private function.
1518 (supported_target_names): Declare.
1519 * target-select.cc (Target_selector::Target_selector): Update for
1520 new parameter and fields.
1521 (select_target_by_name): Check that the name matches before
1522 calling recognize_by_name.
1523 (supported_target_names): New function.
1524 * i386.cc (class Target_selector_i386): Update Target_selector
1525 constructor call. Remove recognize and recognize_by_name. Add
1526 do_instantiate_target.
1527 * x86_64.cc (class Target_selector_x86_64): Likewise.
1528 * testsuite/testfile.cc (class Target_selector_test): Update for
1529 changes to Target_selector.
1531 * README: Rewrite, with some notes on unsupported features.
1533 2008-03-24 Cary Coutant <ccoutant@google.com>
1535 * i386.cc (Target_i386::Got_type): New enum declaration.
1536 (Target_i386::Scan::local): Updated callers of Output_data_got
1538 (Target_i386::Scan::global): Likewise.
1539 (Target_i386::Relocate::relocate): Likewise.
1540 (Target_i386::Relocate::relocate_tls): Likewise.
1541 * object.h (Got_offset_list): New class.
1542 (Sized_relobj::local_has_got_offset): Added got_type parameter.
1543 (Sized_relobj::local_got_offset): Likewise.
1544 (Sized_relobj::set_local_got_offset): Likewise.
1545 (Sized_relobj::local_has_tls_got_offset): Removed.
1546 (Sized_relobj::local_tls_got_offset): Removed.
1547 (Sized_relobj::set_local_tls_got_offset): Removed.
1548 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
1549 * output.cc (Output_data_got::add_global): Added got_type parameter.
1550 (Output_data_got::add_global_with_rel): Likewise.
1551 (Output_data_got::add_global_with_rela): Likewise.
1552 (Output_data_got::add_global_pair_with_rel): New function.
1553 (Output_data_got::add_global_pair_with_rela): New function.
1554 (Output_data_got::add_local): Added got_type parameter.
1555 (Output_data_got::add_local_with_rel): Likewise.
1556 (Output_data_got::add_local_with_rela): Likewise.
1557 (Output_data_got::add_local_pair_with_rel): New function.
1558 (Output_data_got::add_local_pair_with_rela): New function.
1559 (Output_data_got::add_global_tls): Removed.
1560 (Output_data_got::add_global_tls_with_rel): Removed.
1561 (Output_data_got::add_global_tls_with_rela): Removed.
1562 (Output_data_got::add_local_tls): Removed.
1563 (Output_data_got::add_local_tls_with_rel): Removed.
1564 (Output_data_got::add_local_tls_with_rela): Removed.
1565 * output.h (Output_data_got::add_global): Added got_type parameter.
1566 (Output_data_got::add_global_with_rel): Likewise.
1567 (Output_data_got::add_global_with_rela): Likewise.
1568 (Output_data_got::add_global_pair_with_rel): New function.
1569 (Output_data_got::add_global_pair_with_rela): New function.
1570 (Output_data_got::add_local): Added got_type parameter.
1571 (Output_data_got::add_local_with_rel): Likewise.
1572 (Output_data_got::add_local_with_rela): Likewise.
1573 (Output_data_got::add_local_pair_with_rel): New function.
1574 (Output_data_got::add_local_pair_with_rela): New function.
1575 (Output_data_got::add_global_tls): Removed.
1576 (Output_data_got::add_global_tls_with_rel): Removed.
1577 (Output_data_got::add_global_tls_with_rela): Removed.
1578 (Output_data_got::add_local_tls): Removed.
1579 (Output_data_got::add_local_tls_with_rel): Removed.
1580 (Output_data_got::add_local_tls_with_rela): Removed.
1581 * resolve.cc (Symbol::override_base_with_special): Removed
1582 reference to has_got_offset_ field.
1583 * symtab.cc (Symbol::init_fields): Replaced initialization
1584 of got_offset_ with got_offsets_. Removed initialization
1586 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
1587 (Symbol::got_offset): Likewise.
1588 (Symbol::set_got_offset): Likewise.
1589 (Symbol::has_tls_got_offset): Removed.
1590 (Symbol::tls_got_offset): Removed.
1591 (Symbol::set_tls_got_offset): Removed.
1592 (Symbol::got_offset_): Removed.
1593 (Symbol::tls_mod_got_offset_): Removed.
1594 (Symbol::tls_pair_got_offset_): Removed.
1595 (Symbol::got_offsets_): New field.
1596 (Symbol::has_got_offset): Removed.
1597 (Symbol::has_tls_mod_got_offset): Removed.
1598 (Symbol::has_tls_pair_got_offset): Removed.
1599 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
1600 (Target_x86_64::Scan::local): Updated callers of Output_data_got
1602 (Target_x86_64::Scan::global): Likewise.
1603 (Target_x86_64::Relocate::relocate): Likewise.
1604 (Target_x86_64::Relocate::relocate_tls): Likewise.
1606 2008-03-25 Ben Elliston <bje@au.ibm.com>
1608 * yyscript.y: Fix spelling error in comment.
1610 2008-03-24 Ian Lance Taylor <iant@google.com>
1612 * options.h (class General_options): Define build_id option.
1613 * layout.h (class Layout): Declare write_build_id, create_note,
1614 create_build_id. Add build_id_note_ member.
1615 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
1616 "libiberty.h", "md5.h", "sha1.h".
1617 (Layout::Layout): Initialize eh_frame_data_,
1618 eh_frame_hdr_section_, and build_id_note_.
1619 (Layout::finalize): Call create_build_id.
1620 (Layout::create_note): New function, broken out of
1621 Layout::create_gold_note.
1622 (Layout::create_gold_note): Call create_note.
1623 (Layout::create_build_id): New function.
1624 (Layout::write_build_id): New function.
1625 (Close_task_runner::run): Call write_build_id.
1627 * x86_64.cc: Correct license to GPLv3.
1629 2008-03-23 Ian Lance Taylor <iant@google.com>
1631 * options.cc: Include "demangle.h".
1632 (parse_optional_string): New function.
1633 (parse_long_option): Handle takes_optional_argument.
1634 (parse_short_option): Update dash_z initializer. Handle
1635 takes_optional_argument.
1636 (General_options::General_options): Initialize do_demangle_.
1637 (General_options::finalize): Set do_demangle_. Handle demangling
1639 * options.h (parse_optional_string): Declare.
1640 (struct One_option): Add optional_arg field. Update constructor.
1641 Update call constructor calls. Add takes_optional_argument
1643 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
1644 (DEFINE_optional_string): Define.
1645 (General_options::demangle): Change from DEFINE_bool to
1646 DEFINE_optional_string.
1647 (General_options::no_demangle): New function.
1648 (General_options::do_demangle): New function.
1649 (General_options::set_do_demangle): New function.
1650 (General_options::execstack_status_): Move definition to end of
1652 (General_options::static_): Likewise.
1653 (General_options::do_demangle_): New field.
1654 * object.cc (big_endian>::get_symbol_location_info): Call
1655 Options::do_demangle, not Options::demangle.
1656 * symtab.cc (demangle): Likewise.
1658 2008-03-22 Ian Lance Taylor <iant@google.com>
1660 * gold.h: Include <cstddef> and <sys/types.h>
1661 * options.h: Include <cstring>.
1663 2008-03-21 Ian Lance Taylor <iant@google.com>
1665 * Added source code to GNU binutils.