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