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