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