1 2008-04-02 David S. Miller <davem@davemloft.net>
3 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
4 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
6 2008-04-02 Craig Silverstein <csilvers@google.com>
10 2008-04-02 Ian Lance Taylor <iant@google.com>
12 * fileread.cc (File_read::find_view): Add byteshift and vshifted
13 parameters. Update for new key type to views_. Change all
15 (File_read::read): Adjust for byteshift in returned view.
16 (File_read::add_view): New function, broken out of
18 (File_read::make_view): New function, broken out of
20 (File_read::find_or_make_view): Add offset and aligned
21 parameters. Rewrite accordingly. Change all callers.
22 (File_read::get_view): Add offset and aligned parameters. Adjust
23 for byteshift in return value.
24 (File_read::get_lasting_view): Likewise.
25 * fileread.h (class File_read): Update declarations.
26 (class File_read::View): Add byteshift_ field. Add byteshift to
27 constructor. Add byteshift method.
28 * archive.h (Archive::clear_uncached_views): New function.
29 (Archive::get_view): Add aligned parameter. Change all callers.
30 * object.h (Object::get_view): Add aligned parameter. Change all
32 (Object::get_lasting_view): Likewise.
34 * fileread.cc (File_read::release): Don't call clear_views if
35 there are multiple objects.
36 * fileread.h (File_read::clear_uncached_views): New function.
37 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
40 2008-03-31 Cary Coutant <ccoutant@google.com>
42 Add thin archive support.
43 * archive.cc (Archive::armagt): New const.
44 (Archive::setup): Remove task parameter and calls to unlock.
45 (Archive::unlock_nested_archives): New function.
46 (Archive::read_header): Add nested_off parameter. Change
48 (Archive::interpret_header): Likewise.
49 (Archive::include_all_members): Change to handle thin
51 (Archive::include_member): Likewise.
52 * archive.h (Archive::Archive): Add new parameters and
54 (Archive::armagt): New const.
55 (Archive::setup): Remove task parameter.
56 (Archive::unlock_nested_archives): New function.
57 (Archive::read_header): Add nested_off parameter.
58 (Archive::interpret_header): Likewise.
59 (Archive::Nested_archive_table): New typedef.
60 (Archive::is_thin_archive_): New field.
61 (Archive::nested_archives_): New field.
62 (Archive::options_): New field.
63 (Archive::dirpath_): New field.
64 (Archive::task_): New field.
65 * readsyms.cc (Read_symbols::do_read_symbols): Add check
66 for thin archives. Pass additional parameters to
67 Archive::Archive. Unlock the archive file after calling
70 2008-03-29 Ian Lance Taylor <iant@google.com>
72 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
73 version symbol to be local.
74 * testsuite/ver_test_4.sh: New file.
75 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
76 (check_DATA): Add ver_test_4.syms.
77 (ver_test_4.syms): New target.
78 * testsuite/Makefile.in: Rebuild.
81 (Output_section::Input_section_sort_entry::has_priority): New
83 (Output_section::Input_section_sort_entry::match_file_name): New
85 (Output_section::Input_section_sort_entry::match_section_name):
87 (Output_section::Input_section_sort_entry::match_section_name_prefix):
89 (Output_section::Input_section_sort_entry::match_section_file):
91 (Output_section::Input_section_sort_compare::operator()): Rewrite
92 using new Input_section_sort_entry functions. Sort crtbegin and
93 crtend first. Sort sections with no priority before sections with
95 * testsuite/initpri1.c (d3): Check j != 4.
96 (cd5): New constructor/destructor function.
99 * symtab.cc (Symbol_table::add_from_object): If we don't use the
100 new symbol when resolving, don't call set_is_default.
101 * testsuite/ver_test_7.cc: New file.
102 * testsuite/ver_test_7.sh: New file.
103 * testsuite/Makefile.am (ver_test_7.so): New target.
104 (ver_test_7.o): New target.
105 (check_SCRIPTS): Add ver_test_7.sh.
106 (check_DATA): Add ver_test_7.syms.
107 (ver_test_7.syms): New target.
109 2008-03-28 Ian Lance Taylor <iant@google.com>
111 * layout.cc (Layout::layout): If we see an input section with a
112 name that needs sorting, set the must_sort flag for the output
114 (Layout::make_output_section): If the name of the output section
115 indicates that it might require sorting, set the may_sort flag.
116 * output.h (Output_section::may_sort_attached_input_sections): New
118 (Output_section::set_may_sort_attached_input_sections): New
120 (Output_section::must_sort_attached_input_sections): New
122 (Output_section::set_must_sort_attached_input_sections): New
124 (class Output_section): Declare Input_section_sort_entry. Define
125 Input_section_sort_compare. Declare
126 sort_attached_input_sections. Add new fields:
127 may_sort_attached_input_sections_,
128 must_sort_attached_input_sections_,
129 attached_input_sections_are_sorted_.
130 * output.cc (Output_section::Output_section): Initialize new
132 (Output_section::add_input_section): Add an entry to
133 input_sections_ if may_sort or must_sort are true.
134 (Output_section::set_final_data_size): Call
135 sort_attached_input_sections if necessary.
136 (Output_section::Input_section_sort_entry): Define new class.
137 (Output_section::Input_section_sort_compare::operator()): New
139 (Output_section::sort_attached_input_sections): New function.
140 * configure.ac: Check whether the compiler supports constructor
141 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
142 * testsuite/initpri1.c: New file.
143 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
144 CONSTRUCTOR_PRIORITY.
145 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
146 (initpri1_LDFLAGS): New variable.
147 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
149 2008-03-27 Ian Lance Taylor <iant@google.com>
151 * common.cc (Sort_commons::operator): Correct sorting algorithm.
152 * testsuite/common_test_1.c: New file.
153 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
154 (common_test_1_SOURCES): New variable.
155 (common_test_1_DEPENDENCIES): New variable.
156 (common_test_1_LDFLAGS): New variable.
158 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
159 and commons_ correctly when NAME/VERSION does not override
161 * testsuite/ver_test_6.c: New file.
162 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
163 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
164 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
166 2008-03-26 Ian Lance Taylor <iant@google.com>
168 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
169 of an undefined symbol from a version script.
170 * testsuite/Makefile.am (ver_test_5.so): New target.
171 (ver_test_5.o): New target.
172 (check_SCRIPTS): Add ver_test_5.sh.
173 (check_DATA): Add ver_test_5.syms.
174 (ver_test_5.syms): New target.
175 * testsuite/ver_test_5.cc: New file.
176 * testsuite/ver_test_5.script: New file.
177 * testsuite/ver_test_5.sh: New file.
178 * Makefile.in, testsuite/Makefile.in: Rebuild.
181 Fix problems building gold with gcc 4.3.0.
182 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
183 (gold_error_at_location, gold_warning_at_location): Use it.
184 * configure.ac: Check whether we can compile and use a template
185 function with a printf attribute.
186 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
187 when jumping over bytes.
188 * object.cc: Instantiate Object::read_section_data.
189 * debug.h: Include <cstring>
190 * dwarf_reader.cc: Include <algorithm>
191 * main.cc: Include <cstring>.
192 * options.cc: Include <cstring>.
193 * output.cc: Include <cstring>.
194 * script.cc: Include <cstring>.
195 * script.h: Include <string>.
196 * symtab.cc: Include <cstring> and <algorithm>.
197 * target-select.cc: Include <cstring>.
198 * version.cc: Include <string>.
199 * testsuite/testmain.cc: Include <cstdlib>.
200 * configure, config.in: Rebuild.
202 2008-03-25 Ian Lance Taylor <iant@google.com>
204 * options.cc: Include "../bfd/bfdver.h".
205 (options::help): Print bug reporting address.
207 * version.cc (print_version): Adjust output for current value of
212 * options.cc (options::help): Print list of supported targets.
213 * target-select.h: Include <vector>.
214 (class Target_selector): Make machine_, size_, and is_big_endian_
215 fields const. Add bfd_name_ and instantiated_target_ fields.
216 (Target_selector::Target_selector): Add bfd_name parameter.
217 (Target_selector::recognize): Make non-virtual, call
219 (Target_selector::recognize_by_name): Make non-virtual, call
220 do_recognize_by_name.
221 (Target_selector::supported_names): New function.
222 (Target_selector::bfd_name): New function.
223 (Target_selector::do_instantiate_target): New pure virtual
225 (Target_selector::do_recognize): New virtual function.
226 (Target_selector::do_recognize_by_name): New virtual function.
227 (Target_selector::instantiate_target): New private function.
228 (supported_target_names): Declare.
229 * target-select.cc (Target_selector::Target_selector): Update for
230 new parameter and fields.
231 (select_target_by_name): Check that the name matches before
232 calling recognize_by_name.
233 (supported_target_names): New function.
234 * i386.cc (class Target_selector_i386): Update Target_selector
235 constructor call. Remove recognize and recognize_by_name. Add
236 do_instantiate_target.
237 * x86_64.cc (class Target_selector_x86_64): Likewise.
238 * testsuite/testfile.cc (class Target_selector_test): Update for
239 changes to Target_selector.
241 * README: Rewrite, with some notes on unsupported features.
243 2008-03-24 Cary Coutant <ccoutant@google.com>
245 * i386.cc (Target_i386::Got_type): New enum declaration.
246 (Target_i386::Scan::local): Updated callers of Output_data_got
248 (Target_i386::Scan::global): Likewise.
249 (Target_i386::Relocate::relocate): Likewise.
250 (Target_i386::Relocate::relocate_tls): Likewise.
251 * object.h (Got_offset_list): New class.
252 (Sized_relobj::local_has_got_offset): Added got_type parameter.
253 (Sized_relobj::local_got_offset): Likewise.
254 (Sized_relobj::set_local_got_offset): Likewise.
255 (Sized_relobj::local_has_tls_got_offset): Removed.
256 (Sized_relobj::local_tls_got_offset): Removed.
257 (Sized_relobj::set_local_tls_got_offset): Removed.
258 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
259 * output.cc (Output_data_got::add_global): Added got_type parameter.
260 (Output_data_got::add_global_with_rel): Likewise.
261 (Output_data_got::add_global_with_rela): Likewise.
262 (Output_data_got::add_global_pair_with_rel): New function.
263 (Output_data_got::add_global_pair_with_rela): New function.
264 (Output_data_got::add_local): Added got_type parameter.
265 (Output_data_got::add_local_with_rel): Likewise.
266 (Output_data_got::add_local_with_rela): Likewise.
267 (Output_data_got::add_local_pair_with_rel): New function.
268 (Output_data_got::add_local_pair_with_rela): New function.
269 (Output_data_got::add_global_tls): Removed.
270 (Output_data_got::add_global_tls_with_rel): Removed.
271 (Output_data_got::add_global_tls_with_rela): Removed.
272 (Output_data_got::add_local_tls): Removed.
273 (Output_data_got::add_local_tls_with_rel): Removed.
274 (Output_data_got::add_local_tls_with_rela): Removed.
275 * output.h (Output_data_got::add_global): Added got_type parameter.
276 (Output_data_got::add_global_with_rel): Likewise.
277 (Output_data_got::add_global_with_rela): Likewise.
278 (Output_data_got::add_global_pair_with_rel): New function.
279 (Output_data_got::add_global_pair_with_rela): New function.
280 (Output_data_got::add_local): Added got_type parameter.
281 (Output_data_got::add_local_with_rel): Likewise.
282 (Output_data_got::add_local_with_rela): Likewise.
283 (Output_data_got::add_local_pair_with_rel): New function.
284 (Output_data_got::add_local_pair_with_rela): New function.
285 (Output_data_got::add_global_tls): Removed.
286 (Output_data_got::add_global_tls_with_rel): Removed.
287 (Output_data_got::add_global_tls_with_rela): Removed.
288 (Output_data_got::add_local_tls): Removed.
289 (Output_data_got::add_local_tls_with_rel): Removed.
290 (Output_data_got::add_local_tls_with_rela): Removed.
291 * resolve.cc (Symbol::override_base_with_special): Removed
292 reference to has_got_offset_ field.
293 * symtab.cc (Symbol::init_fields): Replaced initialization
294 of got_offset_ with got_offsets_. Removed initialization
296 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
297 (Symbol::got_offset): Likewise.
298 (Symbol::set_got_offset): Likewise.
299 (Symbol::has_tls_got_offset): Removed.
300 (Symbol::tls_got_offset): Removed.
301 (Symbol::set_tls_got_offset): Removed.
302 (Symbol::got_offset_): Removed.
303 (Symbol::tls_mod_got_offset_): Removed.
304 (Symbol::tls_pair_got_offset_): Removed.
305 (Symbol::got_offsets_): New field.
306 (Symbol::has_got_offset): Removed.
307 (Symbol::has_tls_mod_got_offset): Removed.
308 (Symbol::has_tls_pair_got_offset): Removed.
309 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
310 (Target_x86_64::Scan::local): Updated callers of Output_data_got
312 (Target_x86_64::Scan::global): Likewise.
313 (Target_x86_64::Relocate::relocate): Likewise.
314 (Target_x86_64::Relocate::relocate_tls): Likewise.
316 2008-03-25 Ben Elliston <bje@au.ibm.com>
318 * yyscript.y: Fix spelling error in comment.
320 2008-03-24 Ian Lance Taylor <iant@google.com>
322 * options.h (class General_options): Define build_id option.
323 * layout.h (class Layout): Declare write_build_id, create_note,
324 create_build_id. Add build_id_note_ member.
325 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
326 "libiberty.h", "md5.h", "sha1.h".
327 (Layout::Layout): Initialize eh_frame_data_,
328 eh_frame_hdr_section_, and build_id_note_.
329 (Layout::finalize): Call create_build_id.
330 (Layout::create_note): New function, broken out of
331 Layout::create_gold_note.
332 (Layout::create_gold_note): Call create_note.
333 (Layout::create_build_id): New function.
334 (Layout::write_build_id): New function.
335 (Close_task_runner::run): Call write_build_id.
337 * x86_64.cc: Correct license to GPLv3.
339 2008-03-23 Ian Lance Taylor <iant@google.com>
341 * options.cc: Include "demangle.h".
342 (parse_optional_string): New function.
343 (parse_long_option): Handle takes_optional_argument.
344 (parse_short_option): Update dash_z initializer. Handle
345 takes_optional_argument.
346 (General_options::General_options): Initialize do_demangle_.
347 (General_options::finalize): Set do_demangle_. Handle demangling
349 * options.h (parse_optional_string): Declare.
350 (struct One_option): Add optional_arg field. Update constructor.
351 Update call constructor calls. Add takes_optional_argument
353 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
354 (DEFINE_optional_string): Define.
355 (General_options::demangle): Change from DEFINE_bool to
356 DEFINE_optional_string.
357 (General_options::no_demangle): New function.
358 (General_options::do_demangle): New function.
359 (General_options::set_do_demangle): New function.
360 (General_options::execstack_status_): Move definition to end of
362 (General_options::static_): Likewise.
363 (General_options::do_demangle_): New field.
364 * object.cc (big_endian>::get_symbol_location_info): Call
365 Options::do_demangle, not Options::demangle.
366 * symtab.cc (demangle): Likewise.
368 2008-03-22 Ian Lance Taylor <iant@google.com>
370 * gold.h: Include <cstddef> and <sys/types.h>
371 * options.h: Include <cstring>.
373 2008-03-21 Ian Lance Taylor <iant@google.com>
375 * Added source code to GNU binutils.