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