* layout.h (class Layout): Add added_eh_frame_data_ field.
[binutils.git] / gold / ChangeLog
blob78ff07e83c4f323de4087902b66a99f3584c3052
1 2008-04-08  Ian Lance Taylor  <iant@google.com>
3         * layout.h (class Layout): Add added_eh_frame_data_ field.
4         * layout.cc (Layout::Layout): Initialize new field.
5         (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
6         output section until we find a section we merged successfully.
7         * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
8         that the size be non-zero.
10         * merge.cc (Object_merge_map::get_output_offset): Remove inline
11         qualifier.
13 2008-04-08  Craig Silverstein  <csilvers@google.com>
15         * configure.ac: Export new conditional variable HAVE_ZLIB.
16         * testsuite/Makefile.am (flagstest_o_specialfile): Condition
17         on HAVE_ZLIB.
18         (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
19         * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
21 2008-04-07  Ian Lance Taylor  <iant@google.com>
23         * version.cc (version_string): Set to "1.5".
25         * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
26         Add issued_non_pic_error_ field.  Declare check_non_pic.
27         (Target_x86_64::Scan::check_non_pic): New function.
28         (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
29         (Target_x86_64::Scan::global): Likewise.
31         * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
32         addend parameter.  Change caller.  Handle merge sections.
33         (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
34         Address to Addend.  Don't add in the result of
35         local_section_offset, pass down the addend and use the returned
36         value.
37         * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
38         Update declarations of local_section_offset and symbol_value.
39         * testsuite/two_file_test_1.cc (t18): New function.
40         * testsuite/two_file_test_2.cc (f18): New function.
41         * testsuite/two_file_test_main.cc (main): Call t18.
42         * testsuite/two_file_test.h (t18, f18): Declare.
44         * configure.ac: Don't test for objdump, c++filt, or readelf.
45         * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
46         conditionals.
47         (TEST_READELF): New variable.
48         (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
49         (check_PROGRAMS): Add two_file_strip_test.
50         (two_file_strip_test): New target.
51         (check_PROGRAMS): Add two_file_same_shared_strip_test.
52         (two_file_same_shared_strip_test_SOURCES): New variable.
53         (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
54         (two_file_same_shared_strip_test_LDFLAGS): New variable.
55         (two_file_same_shared_strip_test_LDADD): New variable.
56         (two_file_shared_strip.so): New target.
57         (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
58         (ver_test_5.syms, ver_test_7.syms): Likewise.
59         (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
60         (strip_test_3.stdout): Use TEST_OBJDUMP.
61         * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
63 2008-04-04  Cary Coutant  <ccoutant@google.com>
65         * symtab.h (Symbol::is_weak_undefined): New function.
66         (Symbol::is_strong_undefined): New function.
67         (Symbol::is_absolute): New function.
68         (Symbol::needs_plt_entry): Exclude weak undefined symbols.
69         (Symbol::needs_dynamic_reloc): Exclude weak undefined and
70         absolute symbols.
71         * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
72         (weak_undef_test): New target.
73         * testsuite/Makefile.in: Rebuild.
74         * testsuite/weak_undef_file1.cc: New file.
75         * testsuite/weak_undef_file2.cc: New file.
76         * testsuite/weak_undef_test.cc: New file.
78 2008-04-03  Craig Silverstein  <csilvers@google.com>
80         * compressed_output.h (class Output_compressed_section): Use
81         unsigned buffer.
82         * compressed_output.cc (zlib_compress): Use unsigned buffers,
83         add zlib header.
84         (zlib_compressed_suffix): Removed.
85         (Output_compressed_section::set_final_data_size): Use unsigned
86         buffers.
87         * testsuite/Makefile.am (flagstest_compress_debug_sections):
88         Fix linker invocation.
89         (flagstest_o_specialfile_and_compress_debug_sections):
90         Likewise.
91         * testsuite/Makefile.in: Regenerated.
93 2008-04-02  David S. Miller  <davem@davemloft.net>
95         *  dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
96         Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
98 2008-04-02  Craig Silverstein  <csilvers@google.com>
100         * TODO: New file.
102 2008-04-02  Ian Lance Taylor  <iant@google.com>
104         * fileread.cc (File_read::find_view): Add byteshift and vshifted
105         parameters.  Update for new key type to views_.  Change all
106         callers.
107         (File_read::read): Adjust for byteshift in returned view.
108         (File_read::add_view): New function, broken out of
109         find_and_make_view.
110         (File_read::make_view): New function, broken out of
111         find_and_make_view.
112         (File_read::find_or_make_view): Add offset and aligned
113         parameters.  Rewrite accordingly.  Change all callers.
114         (File_read::get_view): Add offset and aligned parameters.  Adjust
115         for byteshift in return value.
116         (File_read::get_lasting_view): Likewise.
117         * fileread.h (class File_read): Update declarations.
118         (class File_read::View): Add byteshift_ field.  Add byteshift to
119         constructor.  Add byteshift method.
120         * archive.h (Archive::clear_uncached_views): New function.
121         (Archive::get_view): Add aligned parameter.  Change all callers.
122         * object.h (Object::get_view): Add aligned parameter.  Change all
123         callers.
124         (Object::get_lasting_view): Likewise.
126         * fileread.cc (File_read::release): Don't call clear_views if
127         there are multiple objects.
128         * fileread.h (File_read::clear_uncached_views): New function.
129         * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
130         on the archive.
132 2008-03-31  Cary Coutant  <ccoutant@google.com>
134         Add thin archive support.
135         * archive.cc (Archive::armagt): New const.
136         (Archive::setup): Remove task parameter and calls to unlock.
137         (Archive::unlock_nested_archives): New function.
138         (Archive::read_header): Add nested_off parameter. Change
139         all callers.
140         (Archive::interpret_header): Likewise.
141         (Archive::include_all_members): Change to handle thin
142         archives.
143         (Archive::include_member): Likewise.
144         * archive.h (Archive::Archive): Add new parameters and
145         initializers.
146         (Archive::armagt): New const.
147         (Archive::setup): Remove task parameter.
148         (Archive::unlock_nested_archives): New function.
149         (Archive::read_header): Add nested_off parameter.
150         (Archive::interpret_header): Likewise.
151         (Archive::Nested_archive_table): New typedef.
152         (Archive::is_thin_archive_): New field.
153         (Archive::nested_archives_): New field.
154         (Archive::options_): New field.
155         (Archive::dirpath_): New field.
156         (Archive::task_): New field.
157         * readsyms.cc (Read_symbols::do_read_symbols): Add check
158         for thin archives.  Pass additional parameters to
159         Archive::Archive.  Unlock the archive file after calling
160         Archive::setup.
161         
162 2008-03-29  Ian Lance Taylor  <iant@google.com>
164         * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
165         version symbol to be local.
166         * testsuite/ver_test_4.sh: New file.
167         * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
168         (check_DATA): Add ver_test_4.syms.
169         (ver_test_4.syms): New target.
170         * testsuite/Makefile.in: Rebuild.
172         * output.cc
173         (Output_section::Input_section_sort_entry::has_priority): New
174         function.
175         (Output_section::Input_section_sort_entry::match_file_name): New
176         function.
177         (Output_section::Input_section_sort_entry::match_section_name):
178         Remove.
179         (Output_section::Input_section_sort_entry::match_section_name_prefix):
180         Remove.
181         (Output_section::Input_section_sort_entry::match_section_file):
182         Remove.
183         (Output_section::Input_section_sort_compare::operator()): Rewrite
184         using new Input_section_sort_entry functions.  Sort crtbegin and
185         crtend first.  Sort sections with no priority before sections with
186         a priority.
187         * testsuite/initpri1.c (d3): Check j != 4.
188         (cd5): New constructor/destructor function.
189         (main): Check j != 2.
191         * symtab.cc (Symbol_table::add_from_object): If we don't use the
192         new symbol when resolving, don't call set_is_default.
193         * testsuite/ver_test_7.cc: New file.
194         * testsuite/ver_test_7.sh: New file.
195         * testsuite/Makefile.am (ver_test_7.so): New target.
196         (ver_test_7.o): New target.
197         (check_SCRIPTS): Add ver_test_7.sh.
198         (check_DATA): Add ver_test_7.syms.
199         (ver_test_7.syms): New target.
201 2008-03-28  Ian Lance Taylor  <iant@google.com>
203         * layout.cc (Layout::layout): If we see an input section with a
204         name that needs sorting, set the must_sort flag for the output
205         section.
206         (Layout::make_output_section): If the name of the output section
207         indicates that it might require sorting, set the may_sort flag.
208         * output.h (Output_section::may_sort_attached_input_sections): New
209         function.
210         (Output_section::set_may_sort_attached_input_sections): New
211         function.
212         (Output_section::must_sort_attached_input_sections): New
213         function.
214         (Output_section::set_must_sort_attached_input_sections): New
215         function.
216         (class Output_section): Declare Input_section_sort_entry.  Define
217         Input_section_sort_compare.  Declare
218         sort_attached_input_sections.  Add new fields:
219         may_sort_attached_input_sections_,
220         must_sort_attached_input_sections_,
221         attached_input_sections_are_sorted_.
222         * output.cc (Output_section::Output_section): Initialize new
223         fields.
224         (Output_section::add_input_section): Add an entry to
225         input_sections_ if may_sort or must_sort are true.
226         (Output_section::set_final_data_size): Call
227         sort_attached_input_sections if necessary.
228         (Output_section::Input_section_sort_entry): Define new class.
229         (Output_section::Input_section_sort_compare::operator()): New
230         function.
231         (Output_section::sort_attached_input_sections): New function.
232         * configure.ac: Check whether the compiler supports constructor
233         priorities.  Define a CONSTRUCTOR_PRIORITY automake conditional.
234         * testsuite/initpri1.c: New file.
235         * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
236         CONSTRUCTOR_PRIORITY.
237         (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
238         (initpri1_LDFLAGS): New variable.
239         * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
241 2008-03-27  Ian Lance Taylor  <iant@google.com>
243         * common.cc (Sort_commons::operator): Correct sorting algorithm.
244         * testsuite/common_test_1.c: New file.
245         * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
246         (common_test_1_SOURCES): New variable.
247         (common_test_1_DEPENDENCIES): New variable.
248         (common_test_1_LDFLAGS): New variable.
250         * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
251         and commons_ correctly when NAME/VERSION does not override
252         NAME/NULL.
253         * testsuite/ver_test_6.c: New file.
254         * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
255         (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
256         (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
258 2008-03-26  Ian Lance Taylor  <iant@google.com>
260         * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
261         of an undefined symbol from a version script.
262         * testsuite/Makefile.am (ver_test_5.so): New target.
263         (ver_test_5.o): New target.
264         (check_SCRIPTS): Add ver_test_5.sh.
265         (check_DATA): Add ver_test_5.syms.
266         (ver_test_5.syms): New target.
267         * testsuite/ver_test_5.cc: New file.
268         * testsuite/ver_test_5.script: New file.
269         * testsuite/ver_test_5.sh: New file.
270         * Makefile.in, testsuite/Makefile.in: Rebuild.
272         PR gold/5986
273         Fix problems building gold with gcc 4.3.0.
274         * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
275         (gold_error_at_location, gold_warning_at_location): Use it.
276         * configure.ac: Check whether we can compile and use a template
277         function with a printf attribute.
278         * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
279         when jumping over bytes.
280         * object.cc: Instantiate Object::read_section_data.
281         * debug.h: Include <cstring>
282         * dwarf_reader.cc: Include <algorithm>
283         * main.cc: Include <cstring>.
284         * options.cc: Include <cstring>.
285         * output.cc: Include <cstring>.
286         * script.cc: Include <cstring>.
287         * script.h: Include <string>.
288         * symtab.cc: Include <cstring> and <algorithm>.
289         * target-select.cc: Include <cstring>.
290         * version.cc: Include <string>.
291         * testsuite/testmain.cc: Include <cstdlib>.
292         * configure, config.in: Rebuild.
294 2008-03-25  Ian Lance Taylor  <iant@google.com>
296         * options.cc: Include "../bfd/bfdver.h".
297         (options::help): Print bug reporting address.
299         * version.cc (print_version): Adjust output for current value of
300         BFD_VERSION_STRING.
302         * NEWS: New file.
304         * options.cc (options::help): Print list of supported targets.
305         * target-select.h: Include <vector>.
306         (class Target_selector): Make machine_, size_, and is_big_endian_
307         fields const.  Add bfd_name_ and instantiated_target_ fields.
308         (Target_selector::Target_selector): Add bfd_name parameter.
309         (Target_selector::recognize): Make non-virtual, call
310         do_recognize.
311         (Target_selector::recognize_by_name): Make non-virtual, call
312         do_recognize_by_name.
313         (Target_selector::supported_names): New function.
314         (Target_selector::bfd_name): New function.
315         (Target_selector::do_instantiate_target): New pure virtual
316         function.
317         (Target_selector::do_recognize): New virtual function.
318         (Target_selector::do_recognize_by_name): New virtual function.
319         (Target_selector::instantiate_target): New private function.
320         (supported_target_names): Declare.
321         * target-select.cc (Target_selector::Target_selector): Update for
322         new parameter and fields.
323         (select_target_by_name): Check that the name matches before
324         calling recognize_by_name.
325         (supported_target_names): New function.
326         * i386.cc (class Target_selector_i386): Update Target_selector
327         constructor call.  Remove recognize and recognize_by_name.  Add
328         do_instantiate_target.
329         * x86_64.cc (class Target_selector_x86_64): Likewise.
330         * testsuite/testfile.cc (class Target_selector_test): Update for
331         changes to Target_selector.
333         * README: Rewrite, with some notes on unsupported features.
335 2008-03-24  Cary Coutant  <ccoutant@google.com>
337         * i386.cc (Target_i386::Got_type): New enum declaration.
338         (Target_i386::Scan::local): Updated callers of Output_data_got
339         member functions.
340         (Target_i386::Scan::global): Likewise.
341         (Target_i386::Relocate::relocate): Likewise.
342         (Target_i386::Relocate::relocate_tls): Likewise.
343         * object.h (Got_offset_list): New class.
344         (Sized_relobj::local_has_got_offset): Added got_type parameter.
345         (Sized_relobj::local_got_offset): Likewise.
346         (Sized_relobj::set_local_got_offset): Likewise.
347         (Sized_relobj::local_has_tls_got_offset): Removed.
348         (Sized_relobj::local_tls_got_offset): Removed.
349         (Sized_relobj::set_local_tls_got_offset): Removed.
350         (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
351         * output.cc (Output_data_got::add_global): Added got_type parameter.
352         (Output_data_got::add_global_with_rel): Likewise.
353         (Output_data_got::add_global_with_rela): Likewise.
354         (Output_data_got::add_global_pair_with_rel): New function.
355         (Output_data_got::add_global_pair_with_rela): New function.
356         (Output_data_got::add_local): Added got_type parameter.
357         (Output_data_got::add_local_with_rel): Likewise.
358         (Output_data_got::add_local_with_rela): Likewise.
359         (Output_data_got::add_local_pair_with_rel): New function.
360         (Output_data_got::add_local_pair_with_rela): New function.
361         (Output_data_got::add_global_tls): Removed.
362         (Output_data_got::add_global_tls_with_rel): Removed.
363         (Output_data_got::add_global_tls_with_rela): Removed.
364         (Output_data_got::add_local_tls): Removed.
365         (Output_data_got::add_local_tls_with_rel): Removed.
366         (Output_data_got::add_local_tls_with_rela): Removed.
367         * output.h (Output_data_got::add_global): Added got_type parameter.
368         (Output_data_got::add_global_with_rel): Likewise.
369         (Output_data_got::add_global_with_rela): Likewise.
370         (Output_data_got::add_global_pair_with_rel): New function.
371         (Output_data_got::add_global_pair_with_rela): New function.
372         (Output_data_got::add_local): Added got_type parameter.
373         (Output_data_got::add_local_with_rel): Likewise.
374         (Output_data_got::add_local_with_rela): Likewise.
375         (Output_data_got::add_local_pair_with_rel): New function.
376         (Output_data_got::add_local_pair_with_rela): New function.
377         (Output_data_got::add_global_tls): Removed.
378         (Output_data_got::add_global_tls_with_rel): Removed.
379         (Output_data_got::add_global_tls_with_rela): Removed.
380         (Output_data_got::add_local_tls): Removed.
381         (Output_data_got::add_local_tls_with_rel): Removed.
382         (Output_data_got::add_local_tls_with_rela): Removed.
383         * resolve.cc (Symbol::override_base_with_special): Removed
384         reference to has_got_offset_ field.
385         * symtab.cc (Symbol::init_fields): Replaced initialization
386         of got_offset_ with got_offsets_.  Removed initialization
387         of has_got_offset_
388         * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
389         (Symbol::got_offset): Likewise.
390         (Symbol::set_got_offset): Likewise.
391         (Symbol::has_tls_got_offset): Removed.
392         (Symbol::tls_got_offset): Removed.
393         (Symbol::set_tls_got_offset): Removed.
394         (Symbol::got_offset_): Removed.
395         (Symbol::tls_mod_got_offset_): Removed.
396         (Symbol::tls_pair_got_offset_): Removed.
397         (Symbol::got_offsets_): New field.
398         (Symbol::has_got_offset): Removed.
399         (Symbol::has_tls_mod_got_offset): Removed.
400         (Symbol::has_tls_pair_got_offset): Removed.
401         * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
402         (Target_x86_64::Scan::local): Updated callers of Output_data_got
403         member functions.
404         (Target_x86_64::Scan::global): Likewise.
405         (Target_x86_64::Relocate::relocate): Likewise.
406         (Target_x86_64::Relocate::relocate_tls): Likewise.
408 2008-03-25  Ben Elliston  <bje@au.ibm.com>
410         * yyscript.y: Fix spelling error in comment.
412 2008-03-24  Ian Lance Taylor  <iant@google.com>
414         * options.h (class General_options): Define build_id option.
415         * layout.h (class Layout): Declare write_build_id, create_note,
416         create_build_id.  Add build_id_note_ member.
417         * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
418         "libiberty.h", "md5.h", "sha1.h".
419         (Layout::Layout): Initialize eh_frame_data_,
420         eh_frame_hdr_section_, and build_id_note_.
421         (Layout::finalize): Call create_build_id.
422         (Layout::create_note): New function, broken out of
423         Layout::create_gold_note.
424         (Layout::create_gold_note): Call create_note.
425         (Layout::create_build_id): New function.
426         (Layout::write_build_id): New function.
427         (Close_task_runner::run): Call write_build_id.
429         * x86_64.cc: Correct license to GPLv3.
431 2008-03-23  Ian Lance Taylor  <iant@google.com>
433         * options.cc: Include "demangle.h".
434         (parse_optional_string): New function.
435         (parse_long_option): Handle takes_optional_argument.
436         (parse_short_option): Update dash_z initializer.  Handle
437         takes_optional_argument.
438         (General_options::General_options): Initialize do_demangle_.
439         (General_options::finalize): Set do_demangle_.  Handle demangling
440         style.
441         * options.h (parse_optional_string): Declare.
442         (struct One_option): Add optional_arg field.  Update constructor.
443         Update call constructor calls.  Add takes_optional_argument
444         function.
445         (DEFINE_var): Add optional_arg__ parameter.  Change all callers.
446         (DEFINE_optional_string): Define.
447         (General_options::demangle): Change from DEFINE_bool to
448         DEFINE_optional_string.
449         (General_options::no_demangle): New function.
450         (General_options::do_demangle): New function.
451         (General_options::set_do_demangle): New function.
452         (General_options::execstack_status_): Move definition to end of
453         class definition.
454         (General_options::static_): Likewise.
455         (General_options::do_demangle_): New field.
456         * object.cc (big_endian>::get_symbol_location_info): Call
457         Options::do_demangle, not Options::demangle.
458         * symtab.cc (demangle): Likewise.
460 2008-03-22  Ian Lance Taylor  <iant@google.com>
462         * gold.h: Include <cstddef> and <sys/types.h>
463         * options.h: Include <cstring>.
465 2008-03-21  Ian Lance Taylor  <iant@google.com>
467         * Added source code to GNU binutils.
468