* configure.ac: If targ_extra_obj is set, link it in.
[deliverable/binutils-gdb.git] / gold / ChangeLog
1 2008-05-05 Ian Lance Taylor <iant@google.com>
2
3 * configure.ac: If targ_extra_obj is set, link it in.
4 * configure.tgt: Initialize all variables.
5 (x86_64*): Set targ_extra_obj and targ_extra_size.
6 * configure: Rebuild.
7
8 * object.cc (Sized_relobj::include_section_group): Adjust section
9 indexes read from group data. Build vector to pass to
10 layout_group.
11 * layout.cc (Layout::layout_group): Add flags and shndxes
12 parameters. Remove contents parameter. Change caller. Update
13 explicit instantiations.
14 * layout.h (class Layout): Update layout_group declaration.
15 * output.cc (Output_data_group::Output_data_group): Add flags and
16 input_shndxes parameters. Remove contents parameter. Change
17 caller.
18 (Output_data_group::do_write): Change input_sections_ to
19 input_shndxes_.
20 * output.h (class Output_data_group): Update constructor
21 declaration. Rename input_sections_ to input_shndxes_.
22 * testsuite/many_sections_test.cc: Add template.
23
24 2008-04-30 Cary Coutant <ccoutant@google.com>
25
26 * target-reloc.h (relocate_section): Fix dead-pointer bug.
27
28 * layout.cc (Layout::include_section): Refactored check for debug
29 info section.
30 (Layout::add_comdat): Add new parameters. Change type
31 of signature parameter. Add object and shndx to signatures table.
32 (Layout::find_kept_object): New function.
33 * layout.h: Include <cstring>.
34 (Layout::is_debug_info_section): New function.
35 (Layout::add_comdat): Add new parameters.
36 (Layout::find_kept_object): New function.
37 (Layout::Kept_section): New struct.
38 (Layout::Signatures): Change type of map range.
39 * object.cc (Relobj::output_section_address): New function.
40 (Sized_relobj::include_section_group): Add new parameters. Change
41 calls to Layout::add_comdat. Change to build table of kept comdat
42 groups and table mapping discarded sections to kept sections.
43 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
44 (Sized_relobj::do_layout): Change calls to include_section_group and
45 include_linkonce_section.
46 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
47 value to zero when section is discarded.
48 (Sized_relobj::map_to_kept_section): New function.
49 * object.h (Relobj::output_section_address): New function.
50 (Relobj::Comdat_group): New type.
51 (Relobj::find_comdat_group): New function.
52 (Relobj::Comdat_group_table): New type.
53 (Relobj::Kept_comdat_section): New type.
54 (Relobj::Kept_comdat_section_table): New type.
55 (Relobj::add_comdat_group): New function.
56 (Relobj::set_kept_comdat_section): New function.
57 (Relobj::get_kept_comdat_section): New function.
58 (Relobj::comdat_groups_): New field.
59 (Relobj::kept_comdat_sections_): New field.
60 (Symbol_value::input_value): Update comment.
61 (Sized_relobj::map_to_kept_section) New function.
62 (Sized_relobj::include_linkonce_section): Add new parameter.
63 * target-reloc.h (Comdat_behavior): New type.
64 (get_comdat_behavior): New function.
65 (relocate_section): Add code to map a discarded section to the
66 corresponding kept section when applying a relocation.
67
68 2008-04-30 Craig Silverstein <csilvers@google.com>
69
70 * dwarf_reader.cc (next_generation_count): New static var.
71 (Addr2line_cache_entry): New struct.
72 (addr2line_cache): New static var.
73 (Dwarf_line_info::one_addr2line): Added caching.
74 (Dwarf_line_info::clear_addr2line_cache): New function.
75 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
76 cache-size parameter.
77 (Dwarf_line_info::one_addr2line_cache): New function.
78 * symtab.cc (Symbol_table::detect_odr_violations): Pass
79 new cache-size argument to one_addr2line(), and clear cache.
80
81 2008-04-28 Cary Coutant <ccoutant@google.com>
82
83 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
84 R_386_PC8 relocations.
85
86 2008-04-23 Ian Lance Taylor <iant@google.com>
87
88 * object.cc (Sized_relobj::include_section_group): Check for
89 invalid section group.
90
91 * object.cc (make_elf_object): Correct test for 64-bit ELF file
92 header size.
93
94 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
95 than read for file header.
96 * archive.cc (Archive::include_member): Likewise.
97
98 2008-04-23 Paolo Bonzini <bonzini@gnu.org>
99
100 * aclocal.m4: Regenerate.
101 * configure: Regenerate.
102
103 2008-04-19 Ian Lance Taylor <iant@google.com>
104
105 * version.cc (version_string): Bump to 1.6.
106
107 * testsuite/Makefile.am (many_sections_r_test): New target.
108 (many_sections_r_test_SOURCES): Remove.
109 (many_sections_r_test_DEPENDENCIES): Remove.
110 (many_sections_r_test_LDFLAGS): Remove.
111 (many_sections_r_test_LDADD): Remove.
112
113 * object.cc (Sized_relobj::do_add_symbols): Always pass
114 local_symbol_count_ to add_from_relobj.
115
116 * testsuite/Makefile.am (many_sections_check.h): Only check one in
117 every thousand variables.
118 * testsuite/Makefile.in: Rebuild.
119
120 * object.cc (Xindex::initialize_symtab_xindex): New function.
121 (Xindex::read_symtab_xindex): New function.
122 (Xindex::sym_xindex_to_shndx): New function.
123 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
124 available.
125 (Sized_relobj::do_initialize_xindex): New function.
126 (Sized_relobj::do_read_symbols): Adjust section links.
127 (Sized_relobj::symbol_section_and_value): Add is_ordinary
128 parameter. Change all callers.
129 (Sized_relobj::include_section_group): Adjust section links and
130 symbol section indexes.
131 (Sized_relobj::do_layout): Adjust section links.
132 (Sized_relobj::do_count_local_symbols): Adjust section links and
133 symbol section indexes.
134 (Sized_relobj::do_finalize_local_symbols): Distinguish between
135 ordinary and special symbols.
136 (Sized_relobj::write_local_symbols): Add symtab_xindex and
137 dynsym_xindex parameters. Change all callers. Adjust section
138 links. Use SHN_XINDEX when needed.
139 (Sized_relobj::get_symbol_location_info): Adjust section links.
140 Don't get fooled by special symbols.
141 * object.h (class Xindex): Define.
142 (class Object): Add xindex_ parameter. Declare virtual functoin
143 do_initialize_xindex.
144 (Object::adjust_sym_shndx): New function.
145 (Object::set_xindex): New protected function.
146 (class Symbol_value): Add is_ordinary_shndx_ field.
147 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
148 (Symbol_value::value): Assert ordinary section.
149 (Symbol_value::initialize_input_to_output_map): Likewise.
150 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
151 Change all callers.
152 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
153 all callers.
154 (class Sized_relobj): Update declarations.
155 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
156 parameter. Change all callers.
157 (Sized_relobj::adjust_shndx): New function.
158 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
159 field.
160 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
161 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
162 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
163 (Sized_dynobj::read_dynsym_section): Adjust section links.
164 (Sized_dynobj::read_dynamic): Likewise.
165 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
166 section links.
167 (Sized_dynobj::do_initialize_xindex): New function.
168 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
169 do_initialize_xindex.
170 (Sized_dynobj::adjust_shndx): New function.
171 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
172 dynsym_xindex_ fields.
173 (Layout::finalize): Add a call to set_section_indexes before
174 creating the symtab sections.
175 (Layout::set_section_indexes): Don't do anything if the section
176 already has a section index.
177 (Layout::create_symtab_sections): Add shnum parameter. Change
178 caller. Create .symtab_shndx section if needed.
179 (Layout::create_shdrs): Add shstrtab_section parameter. Change
180 caller.
181 (Layout::allocated_output_section_count): New function.
182 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
183 needed.
184 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
185 fields. Update declarations.
186 (Layout::symtab_xindex): New function.
187 (Layout::dynsym_xindex): New function.
188 (class Write_symbols_task): Add layout_ field.
189 (Write_symbols_task::Write_symbols_task): Add layout parameter.
190 Change caller.
191 * output.cc (Output_section_headers::Output_section_headers): Add
192 shstrtab_section parameter. Change all callers.
193 (Output_section_headers::do_sized_write): Store overflow values
194 for section count and section string table section index in
195 section header zero.
196 (Output_file_header::do_sized_write): Check for overflow of
197 section count and section string table section index.
198 (Output_symtab_xindex::do_write): New function.
199 (Output_symtab_xindex::endian_do_write): New function.
200 * output.h (class Output_section_headers): Add shstrtab_section_.
201 Update declarations.
202 (class Output_symtab_xindex): Define.
203 (Output_section::has_out_shndx): New function.
204 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
205 field.
206 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
207 Change all callers.
208 (Sized_symbol::init): Likewise.
209 (Symbol::output_section): Check for ordinary symbol.
210 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
211 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
212 callers.
213 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
214 Change all callers. Simplify handling of symbols from sections
215 not included in the link.
216 (Symbol_table::add_from_dynobj): Handle ordinary symbol
217 distinction.
218 (Weak_alias_sorter::operator()): Assert that symbols are
219 ordinary.
220 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
221 distinction.
222 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
223 parameters. Change all callers.
224 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
225 symbol distinction. Use SHN_XINDEX when needed.
226 (Symbol_table::write_section_symbol): Add symtab_xindex
227 parameter. Change all callers.
228 (Symbol_table::sized_write_section_symbol): Likewise. Use
229 SHN_XINDEX when needed.
230 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
231 declarations.
232 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
233 (Symbol::is_defined): Check is_ordinary.
234 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
235 (Symbol::is_absolute, Symbol::is_common): Likewise.
236 (class Sized_symbol): Update declarations.
237 (class Symbol_table): Update declarations.
238 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
239 parameters. Change all callers.
240 (Sized_symbol::override): Likewise.
241 (Symbol_table::override): Likewise.
242 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
243 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
244 is_ordinary, and orig_st_shndx parameters. Change all callers.
245 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
246 to be in an ordinary section.
247 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
248 object and is_ordinary parameters. Change all callers.
249 (Sized_dwarf_line_info::read_relocs): Add object parameter.
250 Change all callers. Don't add undefined or non-ordinary symbols
251 to reloc_map_.
252 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
253 Change all callers.
254 * dwarf_reader.h (class Sized_dwarf_line_info): Update
255 declarations.
256 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
257 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
258 (Sized_relobj::relocate_sections): Likewise.
259 * target-reloc.h (scan_relocs): Adjust section symbol index.
260 (scan_relocatable_relocs): Likewise.
261 * i386.cc (Scan::local): Check for ordinary symbols.
262 * sparc.cc (Scan::local): Likewise.
263 * x86_64.cc (Scan::local): Likewise.
264 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
265 to symbol_section_and_value.
266 * testsuite/many_sections_test.cc: New file.
267 * testsuite/Makefile.am (BUILT_SOURCES): Define.
268 (check_PROGRAMS): Add many_sections_test.
269 (many_sections_test_SOURCES): Define.
270 (many_sections_test_DEPENDENCIES): Define.
271 (many_sections_test_LDFLAGS): Define.
272 (BUILT_SOURCES): Add many_sections_define.h.
273 (many_sections_define.h): New target.
274 (BUILT_SOURCES): Add many_sections_check.h.
275 (many_sections_check.h): New target.
276 (check_PROGRAMS): Add many_sections_r_test.
277 (many_sections_r_test_SOURCES): Define.
278 (many_sections_r_test_DEPENDENCIES): Define.
279 (many_sections_r_test_LDFLAGS): Define.
280 (many_sections_r_test_LDADD): Define.
281 (many_sections_r_test.o): New target.
282 * testsuite/Makefile.in: Rebuild.
283
284 2008-04-17 Cary Coutant <ccoutant@google.com>
285
286 * errors.cc (Errors::info): New function.
287 (gold_info): New function.
288 * errors.h (Errors::info): New function.
289 * gold.h (gold_info): New function.
290 * object.cc (Input_objects::add_object): Print trace output.
291 * options.cc (options::parse_set): New function.
292 (General_options::parse_wrap): Deleted.
293 (General_options::General_options): Deleted initializer.
294 * options.h (options::String_set): New typedef.
295 (options::parse_set): New function.
296 (DEFINE_set): New macro.
297 (General_options::wrap): Changed to use DEFINE_set. Changed
298 callers of any_wrap_symbols and is_wrap_symbol.
299 (General_options::trace, General_options::trace_symbol):
300 New options.
301 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
302 (General_options::wrap_symbols_): Deleted.
303 * symtab.cc (Symbol_table::add_from_object): Print trace output.
304
305 2008-04-17 David S. Miller <davem@davemloft.net>
306
307 * options.cc (General_options::parse_V): New function.
308 * options.h: Add entries for -V and -Qy.
309
310 2008-04-17 Ian Lance Taylor <iant@google.com>
311
312 * common.cc (Symbol_table::allocate_commons): Remove options
313 parameter. Change caller.
314 (Symbol_table::do_allocate_commons): Remove options parameter.
315 Change caller. Just call do_allocate_commons_list twice.
316 (Symbol_table::do_allocate_commons_list): New function, broken out
317 of do_allocate_commons.
318 * common.h (class Allocate_commons_task): Remove options_ field.
319 Update constructor.
320 * symtab.cc (Symbol_table::Symbol_table): Initialize
321 tls_commons_.
322 (Symbol_table::add_from_object): Put TLS common symbols on
323 tls_commons_ list.
324 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
325 which are IN_OUTPUT_DATA.
326 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
327 allocate_commons and do_allocate_commons declarations. Declare
328 do_allocate_commons_list.
329 * gold.cc (queue_middle_tasks): Update creation of
330 Allocate_commons_task to not pass options.
331 * testsuite/Makefile.am (INCLUDES): Add -I.. .
332 (TLS_TEST_C_FLAGS): New variable.
333 (tls_test_c_pic.o): New target.
334 (tls_test_shared.so): Link in tls_test_c_pic.o.
335 (tls_test_c_pic_ie.o): New target.
336 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
337 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
338 (tls_test_c.o): New target.
339 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
340 (tls_pic_test_LDADD): Likewise.
341 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
342 (tls_shared_gd_to_ie_test_LDADD): Likewise.
343 (tls_test_c_gnu2.o): New target.
344 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
345 tls_test_c_gnu2.o.
346 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
347 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
348 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
349 * testsuite/tls_test.cc: Include "config.h".
350 (t_last): Call t11_last.
351 * testsuite/tls_test.h (t11, t11_last): Declare.
352 * testsuite/tls_test_c.c: New file.
353 * testsuite/tls_test_main.cc (thread_routine): Call t11.
354 * configure.ac: Check for OpenMP support.
355 * configure, config.in, Makefile.in: Rebuild.
356 * testsuite/Makefile.in: Rebuild.
357
358 2008-04-16 Cary Coutant <ccoutant@google.com>
359
360 * i386.cc (Target_i386::define_tls_base_symbol): New function.
361 (Target_i386::tls_base_symbol_defined_): New field.
362 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
363 (Target_i386::Scan::global): Likewise.
364 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
365 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
366 (Target_x86_64::tls_base_symbol_defined_): New field.
367 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
368 (Target_x86_64::Scan::global): Likewise.
369
370 2008-04-16 Cary Coutant <ccoutant@google.com>
371
372 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
373 (Symbol::needs_plt_entry): Allow weak undefined symbols.
374 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
375 building shared libraries.
376 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
377 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
378 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
379 * testsuite/Makefile.in: Rebuild.
380 * testsuite/weak_undef.h: New file.
381 * testsuite/weak_undef_file1.cc: Add extra test cases.
382 * testsuite/weak_undef_file2.cc: Likewise.
383 * testsuite/weak_undef_test.cc: Likewise.
384
385 2008-04-16 David S. Miller <davem@davemloft.net>
386
387 * sparc.cc (Target_sparc::Scan): Change from struct to class.
388 Add issued_non_pic_error_ field. Declare check_non_pic.
389 (Target_sparc::Scan::check_non_pic): New function.
390 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
391 (Target_sparc::Scan::global): Likewise.
392
393 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
394 * configure: Rebuild.
395
396 * options.h (DEFINE_enable): New macro.
397 (new_dtags): New enable option.
398 (initfirst, interpose, loadfltr, nodefaultlib,
399 nodelete, nodlopen, nodump): New -z options.
400 * layout.cc (Layout:finish_dynamic_section): If new
401 dtags enabled, emit DT_RUNPATH. Also, emit a
402 DT_FLAGS_1 containing any specified -z flags.
403
404 2008-04-16 Ian Lance Taylor <iant@google.com>
405
406 * copy-relocs.cc: New file.
407 * copy-relocs.h: New file.
408 * reloc.cc: Remove Copy_relocs code.
409 * reloc.h: Likewise.
410 * reloc-types.h (struct Reloc_types) [both versions]: Add
411 get_reloc_addend_noerror.
412 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
413 variants of add_global which take an addend which must be zero.
414 * i386.cc: Include "copy-relocs.h".
415 (class Target_i386): Change type of copy_relocs_ to variable,
416 update initializer.
417 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
418 Change all callers.
419 (Target_i386::do_finalize_sections): Change handling of
420 copy_relocs_.
421 * sparc.cc: Include "copy-relocs.h".
422 (class Target_sparc): Change type of copy_relocs_ to variable,
423 update initializer.
424 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
425 Change all callers.
426 (Target_sparc::do_finalize_sections): Change handling of
427 copy_relocs_.
428 * x86_64.cc: Include "copy-relocs.h".
429 (class Target_x86_64): Change type of copy_relocs_ to variable,
430 update initializer.
431 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
432 class. Change all callers.
433 (Target_x86_64::do_finalize_sections): Change handling of
434 copy_relocs_.
435 * Makefile.am (CCFILES): Add copy-relocs.cc.
436 (HFILES): Add copy-relocs.h.
437
438 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
439
440 * testsuite/script_test_4.sh: Permit leading zeroes.
441
442 2008-04-15 Ian Lance Taylor <iant@google.com>
443
444 * script-sections.cc (Script_sections::create_segments): Use
445 header_size_adjustment even when there is enough room for the
446 headers.
447 * testsuite/script_test_4.sh: New file.
448 * testsuite/script_test_4.t: New file.
449 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
450 (check_DATA): Add script_test_4.stdout.
451 (MOSTLYCLEANFILES): Likewise.
452 (script_test_4): New target.
453 (script_test_4.stdout): New target.
454 * testsuite/Makefile.in: Rebuild.
455
456 * sparc.cc: Add definitions for Output_data_plt_sparc class
457 constants.
458
459 2008-04-14 David S. Miller <davem@davemloft.net>
460
461 * sparc.cc: New file.
462 * Makefile.am (TARGETSOURCES): Add sparc.cc
463 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
464 * configure.tgt: Document targ_extra_size and
465 targ_extra_big_endian. Add entries for sparc-* and
466 sparc64-*.
467 * configure.ac: Handle targ_extra_size and
468 targ_extra_big_endian.
469 * Makefile.in: Rebuild.
470 * configure: Likewise.
471 * po/POTFILES.in: Likewise.
472 * po/gold.pot: Likewise.
473
474 2008-04-14 Ian Lance Taylor <iant@google.com>
475
476 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
477 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
478 in the name/type/flags to section mapping. Don't call
479 allocate_output_section.
480 (Layout::choose_output_section): Change parameter from adjust_name
481 to is_input_section. Don't permit input sections after sections
482 are attached to segments. Don't call allocate_output_section.
483 (Layout::layout_eh_frame): Call update_flags_for_input_section,
484 not write_enable_output_section.
485 (Layout::make_output_section): Don't push to
486 unattached_section_list_ nor call attach_to_segment. Call
487 attach_section_to_segment if sections are attached.
488 (Layout::attach_sections_to_segments): New function.
489 (Layout::attach_section_to_segment): New function.
490 (Layout::attach_allocated_section_to_segment): Rename from
491 attach_to_segment. Remove flags parameter.
492 (Layout::allocate_output_section): Remove function.
493 (Layout::write_enable_output_section): Remove function.
494 * layout.h (class Layout): Update for above changes. Add new
495 field sections_are_attached_.
496 * output.h (Output_section::update_flags_for_input_section): New
497 function.
498 * output.cc (Output_section::add_input_section): Call
499 update_flags_for_input_section.
500 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
501
502 2008-04-11 Cary Coutant <ccoutant@google.com>
503
504 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
505 thought unnecessary.
506 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
507
508 2008-04-11 Ian Lance Taylor <iant@google.com>
509
510 * output.h (class Output_section_data): Remove inline definition
511 of set_addralign.
512 * output.cc (Output_section_data::set_addralign): New function.
513
514 2008-04-11 Cary Coutant <ccoutant@google.com>
515
516 Add support for TLS descriptors for i386 and x86_64.
517 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
518 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
519 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
520 GOT_TYPE_TLS_DESC.
521 (Target_i386::got_mod_index_entry): Remove unnecessary code.
522 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
523 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
524 relocations.
525 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
526 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
527 Fix problem with initial-exec relocations.
528 (Target_i386::Relocate::relocate_tls): Likewise.
529 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
530 relaxation.
531 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
532 support for section-plus-offset dynamic table entries.
533 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
534 (Output_data_dynamic::Dynamic_entry): Add support for
535 section-plus-offset dynamic table entries.
536 (Output_data_dynamic::Classification): Likewise.
537 (Output_data_dynamic::classification_): Renamed offset_.
538 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
539 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
540 (Target_x86_64::make_plt_section): New function.
541 (Target_x86_64::reserve_tlsdesc_entries): New function.
542 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
543 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
544 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
545 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
546 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
547 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
548 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
549 add extra PLT entry for TLS descriptors.
550 (Output_data_plt_x86_64::got_): New field.
551 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
552 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
553 fields.
554 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
555 descriptors.
556 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
557 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
558 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
559 R_386_TLS_DESC_CALL relocations.
560 (Target_x86_64::Scan::global): Likewise.
561 (Target_x86_64::do_finalize_sections): Add dynamic table entries
562 for TLS descriptors.
563 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
564 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
565 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
566 GD-to-IE relaxation.
567 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
568 and TLS_DESCRIPTORS.
569 * Makefile.in: Rebuild.
570 * configure: Rebuild.
571 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
572 (tls_test_shared2.so): New target.
573 (tls_shared_gd_to_ie_test_SOURCES): New variable.
574 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
575 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
576 (tls_shared_gd_to_ie_test_LDADD): New variable.
577 (tls_shared_gnu2_gd_to_ie_test): New target.
578 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
579 New targets.
580 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
581 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
582 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
583 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
584 (tls_shared_gnu2_test): New target.
585 (tls_test_gnu2_shared.so): New target.
586 (tls_shared_gnu2_test_SOURCES): New variable.
587 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
588 (tls_shared_gnu2_test_LDFLAGS): New variable.
589 (tls_shared_gnu2_test_LDADD): New variable.
590 * testsuite/Makefile.in: Rebuild.
591 * testsuite/Makefile.
592
593 2008-04-11 Ian Lance Taylor <iant@google.com>
594
595 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
596 justsyms.t.
597 * testsuite/Makefile.in: Rebuild.
598
599 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
600 long.
601 * testsuite/script_test_2.cc (main): Adjust test.
602
603 2008-04-11 David S. Miller <davem@davemloft.net>
604 Ian Lance Taylor <iant@google.com>
605
606 * options.h (General_options): Add entries for '-Y' and
607 '-relax'.
608 * options.cc (General_options:finalize): If -Y was used, add those
609 entries to the library path instead of the default "/lib" and
610 "/usr/lib".
611
612 2008-04-11 David S. Miller <davem@davemloft.net>
613
614 * testsuite/justsyms.t: Start at 0x100.
615 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
616 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
617 long.
618 * testsuite/script_test_2.cc: Adjust string and section length
619 checks.
620
621 2008-04-09 Ian Lance Taylor <iant@google.com>
622
623 PR gold/5996
624 * script-sections.cc (Sections_element::allocate_to_segment): Add
625 orphan parameter.
626 (Output_section_definition::allocate_to_segment): Likewise.
627 (Orphan_output_section::allocate_to_segment): Likewise.
628 (Script_sections::attach_sections_using_phdrs_clause): Don't
629 propagate non-PT_LOAD segments to orphan sections.
630 * testsuite/Makefile.am (script_test_3.stdout): Generate using
631 readelf rather than objdump.
632 * testsuite/script_test_3.sh: Adjust accordingly. Test that
633 .interp section and PT_INTERP segment are the same size.
634 * testsuite/Makefile.in: Rebuild.
635
636 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
637 aliases for symbols defined in the same object.
638 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
639 (weak_alias_test_SOURCES): New variable.
640 (weak_alias_test_DEPENDENCIES): New variable.
641 (weak_alias_test_LDFLAGS): New variable.
642 (weak_alias_test_LDADD): New variable.
643 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
644 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
645 (weak_alias_test_3.o): New target.
646 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
647 * testsuite/weak_alias_test_main.cc: New file.
648 * testsuite/weak_alias_test_1.cc: New file.
649 * testsuite/weak_alias_test_2.cc: New file.
650 * testsuite/weak_alias_test_3.cc: New file.
651
652 2008-04-08 Ian Lance Taylor <iant@google.com>
653
654 * options.h (class General_options): Add --noinhibit-exec option.
655 * main.cc (main): Check --noinhibit-exec.
656
657 * options.h (class General_options): Define --wrap as a special
658 option. Add wrap_symbols_ field.
659 (General_options::any_wrap_symbols): New function.
660 (General_options::is_wrap_symbol): New function.
661 * options.cc (General_options::parse_wrap): New function.
662 (General_options::General_options): Initialize wrap_symbols_.
663 * symtab.cc (Symbol_table::wrap_symbol): New function.
664 (Symbol_table::add_from_object): Handle --wrap.
665 * symtab.h (class Symbol_table): Declare wrap_symbol.
666 * target.h (Target::wrap_char): New function.
667 (Target::Target_info): Add wrap_char field.
668 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
669 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
670 * testsuite/testfile.cc (Target_test::test_target_info):
671 Likewise.
672
673 * errors.cc (Errors::undefined_symbol): Mention symbol version if
674 there is one.
675
676 * layout.h (class Layout): Add added_eh_frame_data_ field.
677 * layout.cc (Layout::Layout): Initialize new field.
678 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
679 output section until we find a section we merged successfully.
680 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
681 that the size be non-zero.
682
683 * merge.cc (Object_merge_map::get_output_offset): Remove inline
684 qualifier.
685
686 2008-04-08 Craig Silverstein <csilvers@google.com>
687
688 * configure.ac: Export new conditional variable HAVE_ZLIB.
689 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
690 on HAVE_ZLIB.
691 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
692 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
693
694 2008-04-07 Ian Lance Taylor <iant@google.com>
695
696 * version.cc (version_string): Set to "1.5".
697
698 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
699 Add issued_non_pic_error_ field. Declare check_non_pic.
700 (Target_x86_64::Scan::check_non_pic): New function.
701 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
702 (Target_x86_64::Scan::global): Likewise.
703
704 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
705 addend parameter. Change caller. Handle merge sections.
706 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
707 Address to Addend. Don't add in the result of
708 local_section_offset, pass down the addend and use the returned
709 value.
710 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
711 Update declarations of local_section_offset and symbol_value.
712 * testsuite/two_file_test_1.cc (t18): New function.
713 * testsuite/two_file_test_2.cc (f18): New function.
714 * testsuite/two_file_test_main.cc (main): Call t18.
715 * testsuite/two_file_test.h (t18, f18): Declare.
716
717 * configure.ac: Don't test for objdump, c++filt, or readelf.
718 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
719 conditionals.
720 (TEST_READELF): New variable.
721 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
722 (check_PROGRAMS): Add two_file_strip_test.
723 (two_file_strip_test): New target.
724 (check_PROGRAMS): Add two_file_same_shared_strip_test.
725 (two_file_same_shared_strip_test_SOURCES): New variable.
726 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
727 (two_file_same_shared_strip_test_LDFLAGS): New variable.
728 (two_file_same_shared_strip_test_LDADD): New variable.
729 (two_file_shared_strip.so): New target.
730 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
731 (ver_test_5.syms, ver_test_7.syms): Likewise.
732 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
733 (strip_test_3.stdout): Use TEST_OBJDUMP.
734 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
735
736 2008-04-04 Cary Coutant <ccoutant@google.com>
737
738 * symtab.h (Symbol::is_weak_undefined): New function.
739 (Symbol::is_strong_undefined): New function.
740 (Symbol::is_absolute): New function.
741 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
742 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
743 absolute symbols.
744 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
745 (weak_undef_test): New target.
746 * testsuite/Makefile.in: Rebuild.
747 * testsuite/weak_undef_file1.cc: New file.
748 * testsuite/weak_undef_file2.cc: New file.
749 * testsuite/weak_undef_test.cc: New file.
750
751 2008-04-03 Craig Silverstein <csilvers@google.com>
752
753 * compressed_output.h (class Output_compressed_section): Use
754 unsigned buffer.
755 * compressed_output.cc (zlib_compress): Use unsigned buffers,
756 add zlib header.
757 (zlib_compressed_suffix): Removed.
758 (Output_compressed_section::set_final_data_size): Use unsigned
759 buffers.
760 * testsuite/Makefile.am (flagstest_compress_debug_sections):
761 Fix linker invocation.
762 (flagstest_o_specialfile_and_compress_debug_sections):
763 Likewise.
764 * testsuite/Makefile.in: Regenerated.
765
766 2008-04-02 David S. Miller <davem@davemloft.net>
767
768 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
769 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
770
771 2008-04-02 Craig Silverstein <csilvers@google.com>
772
773 * TODO: New file.
774
775 2008-04-02 Ian Lance Taylor <iant@google.com>
776
777 * fileread.cc (File_read::find_view): Add byteshift and vshifted
778 parameters. Update for new key type to views_. Change all
779 callers.
780 (File_read::read): Adjust for byteshift in returned view.
781 (File_read::add_view): New function, broken out of
782 find_and_make_view.
783 (File_read::make_view): New function, broken out of
784 find_and_make_view.
785 (File_read::find_or_make_view): Add offset and aligned
786 parameters. Rewrite accordingly. Change all callers.
787 (File_read::get_view): Add offset and aligned parameters. Adjust
788 for byteshift in return value.
789 (File_read::get_lasting_view): Likewise.
790 * fileread.h (class File_read): Update declarations.
791 (class File_read::View): Add byteshift_ field. Add byteshift to
792 constructor. Add byteshift method.
793 * archive.h (Archive::clear_uncached_views): New function.
794 (Archive::get_view): Add aligned parameter. Change all callers.
795 * object.h (Object::get_view): Add aligned parameter. Change all
796 callers.
797 (Object::get_lasting_view): Likewise.
798
799 * fileread.cc (File_read::release): Don't call clear_views if
800 there are multiple objects.
801 * fileread.h (File_read::clear_uncached_views): New function.
802 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
803 on the archive.
804
805 2008-03-31 Cary Coutant <ccoutant@google.com>
806
807 Add thin archive support.
808 * archive.cc (Archive::armagt): New const.
809 (Archive::setup): Remove task parameter and calls to unlock.
810 (Archive::unlock_nested_archives): New function.
811 (Archive::read_header): Add nested_off parameter. Change
812 all callers.
813 (Archive::interpret_header): Likewise.
814 (Archive::include_all_members): Change to handle thin
815 archives.
816 (Archive::include_member): Likewise.
817 * archive.h (Archive::Archive): Add new parameters and
818 initializers.
819 (Archive::armagt): New const.
820 (Archive::setup): Remove task parameter.
821 (Archive::unlock_nested_archives): New function.
822 (Archive::read_header): Add nested_off parameter.
823 (Archive::interpret_header): Likewise.
824 (Archive::Nested_archive_table): New typedef.
825 (Archive::is_thin_archive_): New field.
826 (Archive::nested_archives_): New field.
827 (Archive::options_): New field.
828 (Archive::dirpath_): New field.
829 (Archive::task_): New field.
830 * readsyms.cc (Read_symbols::do_read_symbols): Add check
831 for thin archives. Pass additional parameters to
832 Archive::Archive. Unlock the archive file after calling
833 Archive::setup.
834
835 2008-03-29 Ian Lance Taylor <iant@google.com>
836
837 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
838 version symbol to be local.
839 * testsuite/ver_test_4.sh: New file.
840 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
841 (check_DATA): Add ver_test_4.syms.
842 (ver_test_4.syms): New target.
843 * testsuite/Makefile.in: Rebuild.
844
845 * output.cc
846 (Output_section::Input_section_sort_entry::has_priority): New
847 function.
848 (Output_section::Input_section_sort_entry::match_file_name): New
849 function.
850 (Output_section::Input_section_sort_entry::match_section_name):
851 Remove.
852 (Output_section::Input_section_sort_entry::match_section_name_prefix):
853 Remove.
854 (Output_section::Input_section_sort_entry::match_section_file):
855 Remove.
856 (Output_section::Input_section_sort_compare::operator()): Rewrite
857 using new Input_section_sort_entry functions. Sort crtbegin and
858 crtend first. Sort sections with no priority before sections with
859 a priority.
860 * testsuite/initpri1.c (d3): Check j != 4.
861 (cd5): New constructor/destructor function.
862 (main): Check j != 2.
863
864 * symtab.cc (Symbol_table::add_from_object): If we don't use the
865 new symbol when resolving, don't call set_is_default.
866 * testsuite/ver_test_7.cc: New file.
867 * testsuite/ver_test_7.sh: New file.
868 * testsuite/Makefile.am (ver_test_7.so): New target.
869 (ver_test_7.o): New target.
870 (check_SCRIPTS): Add ver_test_7.sh.
871 (check_DATA): Add ver_test_7.syms.
872 (ver_test_7.syms): New target.
873
874 2008-03-28 Ian Lance Taylor <iant@google.com>
875
876 * layout.cc (Layout::layout): If we see an input section with a
877 name that needs sorting, set the must_sort flag for the output
878 section.
879 (Layout::make_output_section): If the name of the output section
880 indicates that it might require sorting, set the may_sort flag.
881 * output.h (Output_section::may_sort_attached_input_sections): New
882 function.
883 (Output_section::set_may_sort_attached_input_sections): New
884 function.
885 (Output_section::must_sort_attached_input_sections): New
886 function.
887 (Output_section::set_must_sort_attached_input_sections): New
888 function.
889 (class Output_section): Declare Input_section_sort_entry. Define
890 Input_section_sort_compare. Declare
891 sort_attached_input_sections. Add new fields:
892 may_sort_attached_input_sections_,
893 must_sort_attached_input_sections_,
894 attached_input_sections_are_sorted_.
895 * output.cc (Output_section::Output_section): Initialize new
896 fields.
897 (Output_section::add_input_section): Add an entry to
898 input_sections_ if may_sort or must_sort are true.
899 (Output_section::set_final_data_size): Call
900 sort_attached_input_sections if necessary.
901 (Output_section::Input_section_sort_entry): Define new class.
902 (Output_section::Input_section_sort_compare::operator()): New
903 function.
904 (Output_section::sort_attached_input_sections): New function.
905 * configure.ac: Check whether the compiler supports constructor
906 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
907 * testsuite/initpri1.c: New file.
908 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
909 CONSTRUCTOR_PRIORITY.
910 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
911 (initpri1_LDFLAGS): New variable.
912 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
913
914 2008-03-27 Ian Lance Taylor <iant@google.com>
915
916 * common.cc (Sort_commons::operator): Correct sorting algorithm.
917 * testsuite/common_test_1.c: New file.
918 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
919 (common_test_1_SOURCES): New variable.
920 (common_test_1_DEPENDENCIES): New variable.
921 (common_test_1_LDFLAGS): New variable.
922
923 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
924 and commons_ correctly when NAME/VERSION does not override
925 NAME/NULL.
926 * testsuite/ver_test_6.c: New file.
927 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
928 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
929 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
930
931 2008-03-26 Ian Lance Taylor <iant@google.com>
932
933 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
934 of an undefined symbol from a version script.
935 * testsuite/Makefile.am (ver_test_5.so): New target.
936 (ver_test_5.o): New target.
937 (check_SCRIPTS): Add ver_test_5.sh.
938 (check_DATA): Add ver_test_5.syms.
939 (ver_test_5.syms): New target.
940 * testsuite/ver_test_5.cc: New file.
941 * testsuite/ver_test_5.script: New file.
942 * testsuite/ver_test_5.sh: New file.
943 * Makefile.in, testsuite/Makefile.in: Rebuild.
944
945 PR gold/5986
946 Fix problems building gold with gcc 4.3.0.
947 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
948 (gold_error_at_location, gold_warning_at_location): Use it.
949 * configure.ac: Check whether we can compile and use a template
950 function with a printf attribute.
951 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
952 when jumping over bytes.
953 * object.cc: Instantiate Object::read_section_data.
954 * debug.h: Include <cstring>
955 * dwarf_reader.cc: Include <algorithm>
956 * main.cc: Include <cstring>.
957 * options.cc: Include <cstring>.
958 * output.cc: Include <cstring>.
959 * script.cc: Include <cstring>.
960 * script.h: Include <string>.
961 * symtab.cc: Include <cstring> and <algorithm>.
962 * target-select.cc: Include <cstring>.
963 * version.cc: Include <string>.
964 * testsuite/testmain.cc: Include <cstdlib>.
965 * configure, config.in: Rebuild.
966
967 2008-03-25 Ian Lance Taylor <iant@google.com>
968
969 * options.cc: Include "../bfd/bfdver.h".
970 (options::help): Print bug reporting address.
971
972 * version.cc (print_version): Adjust output for current value of
973 BFD_VERSION_STRING.
974
975 * NEWS: New file.
976
977 * options.cc (options::help): Print list of supported targets.
978 * target-select.h: Include <vector>.
979 (class Target_selector): Make machine_, size_, and is_big_endian_
980 fields const. Add bfd_name_ and instantiated_target_ fields.
981 (Target_selector::Target_selector): Add bfd_name parameter.
982 (Target_selector::recognize): Make non-virtual, call
983 do_recognize.
984 (Target_selector::recognize_by_name): Make non-virtual, call
985 do_recognize_by_name.
986 (Target_selector::supported_names): New function.
987 (Target_selector::bfd_name): New function.
988 (Target_selector::do_instantiate_target): New pure virtual
989 function.
990 (Target_selector::do_recognize): New virtual function.
991 (Target_selector::do_recognize_by_name): New virtual function.
992 (Target_selector::instantiate_target): New private function.
993 (supported_target_names): Declare.
994 * target-select.cc (Target_selector::Target_selector): Update for
995 new parameter and fields.
996 (select_target_by_name): Check that the name matches before
997 calling recognize_by_name.
998 (supported_target_names): New function.
999 * i386.cc (class Target_selector_i386): Update Target_selector
1000 constructor call. Remove recognize and recognize_by_name. Add
1001 do_instantiate_target.
1002 * x86_64.cc (class Target_selector_x86_64): Likewise.
1003 * testsuite/testfile.cc (class Target_selector_test): Update for
1004 changes to Target_selector.
1005
1006 * README: Rewrite, with some notes on unsupported features.
1007
1008 2008-03-24 Cary Coutant <ccoutant@google.com>
1009
1010 * i386.cc (Target_i386::Got_type): New enum declaration.
1011 (Target_i386::Scan::local): Updated callers of Output_data_got
1012 member functions.
1013 (Target_i386::Scan::global): Likewise.
1014 (Target_i386::Relocate::relocate): Likewise.
1015 (Target_i386::Relocate::relocate_tls): Likewise.
1016 * object.h (Got_offset_list): New class.
1017 (Sized_relobj::local_has_got_offset): Added got_type parameter.
1018 (Sized_relobj::local_got_offset): Likewise.
1019 (Sized_relobj::set_local_got_offset): Likewise.
1020 (Sized_relobj::local_has_tls_got_offset): Removed.
1021 (Sized_relobj::local_tls_got_offset): Removed.
1022 (Sized_relobj::set_local_tls_got_offset): Removed.
1023 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
1024 * output.cc (Output_data_got::add_global): Added got_type parameter.
1025 (Output_data_got::add_global_with_rel): Likewise.
1026 (Output_data_got::add_global_with_rela): Likewise.
1027 (Output_data_got::add_global_pair_with_rel): New function.
1028 (Output_data_got::add_global_pair_with_rela): New function.
1029 (Output_data_got::add_local): Added got_type parameter.
1030 (Output_data_got::add_local_with_rel): Likewise.
1031 (Output_data_got::add_local_with_rela): Likewise.
1032 (Output_data_got::add_local_pair_with_rel): New function.
1033 (Output_data_got::add_local_pair_with_rela): New function.
1034 (Output_data_got::add_global_tls): Removed.
1035 (Output_data_got::add_global_tls_with_rel): Removed.
1036 (Output_data_got::add_global_tls_with_rela): Removed.
1037 (Output_data_got::add_local_tls): Removed.
1038 (Output_data_got::add_local_tls_with_rel): Removed.
1039 (Output_data_got::add_local_tls_with_rela): Removed.
1040 * output.h (Output_data_got::add_global): Added got_type parameter.
1041 (Output_data_got::add_global_with_rel): Likewise.
1042 (Output_data_got::add_global_with_rela): Likewise.
1043 (Output_data_got::add_global_pair_with_rel): New function.
1044 (Output_data_got::add_global_pair_with_rela): New function.
1045 (Output_data_got::add_local): Added got_type parameter.
1046 (Output_data_got::add_local_with_rel): Likewise.
1047 (Output_data_got::add_local_with_rela): Likewise.
1048 (Output_data_got::add_local_pair_with_rel): New function.
1049 (Output_data_got::add_local_pair_with_rela): New function.
1050 (Output_data_got::add_global_tls): Removed.
1051 (Output_data_got::add_global_tls_with_rel): Removed.
1052 (Output_data_got::add_global_tls_with_rela): Removed.
1053 (Output_data_got::add_local_tls): Removed.
1054 (Output_data_got::add_local_tls_with_rel): Removed.
1055 (Output_data_got::add_local_tls_with_rela): Removed.
1056 * resolve.cc (Symbol::override_base_with_special): Removed
1057 reference to has_got_offset_ field.
1058 * symtab.cc (Symbol::init_fields): Replaced initialization
1059 of got_offset_ with got_offsets_. Removed initialization
1060 of has_got_offset_
1061 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
1062 (Symbol::got_offset): Likewise.
1063 (Symbol::set_got_offset): Likewise.
1064 (Symbol::has_tls_got_offset): Removed.
1065 (Symbol::tls_got_offset): Removed.
1066 (Symbol::set_tls_got_offset): Removed.
1067 (Symbol::got_offset_): Removed.
1068 (Symbol::tls_mod_got_offset_): Removed.
1069 (Symbol::tls_pair_got_offset_): Removed.
1070 (Symbol::got_offsets_): New field.
1071 (Symbol::has_got_offset): Removed.
1072 (Symbol::has_tls_mod_got_offset): Removed.
1073 (Symbol::has_tls_pair_got_offset): Removed.
1074 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
1075 (Target_x86_64::Scan::local): Updated callers of Output_data_got
1076 member functions.
1077 (Target_x86_64::Scan::global): Likewise.
1078 (Target_x86_64::Relocate::relocate): Likewise.
1079 (Target_x86_64::Relocate::relocate_tls): Likewise.
1080
1081 2008-03-25 Ben Elliston <bje@au.ibm.com>
1082
1083 * yyscript.y: Fix spelling error in comment.
1084
1085 2008-03-24 Ian Lance Taylor <iant@google.com>
1086
1087 * options.h (class General_options): Define build_id option.
1088 * layout.h (class Layout): Declare write_build_id, create_note,
1089 create_build_id. Add build_id_note_ member.
1090 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
1091 "libiberty.h", "md5.h", "sha1.h".
1092 (Layout::Layout): Initialize eh_frame_data_,
1093 eh_frame_hdr_section_, and build_id_note_.
1094 (Layout::finalize): Call create_build_id.
1095 (Layout::create_note): New function, broken out of
1096 Layout::create_gold_note.
1097 (Layout::create_gold_note): Call create_note.
1098 (Layout::create_build_id): New function.
1099 (Layout::write_build_id): New function.
1100 (Close_task_runner::run): Call write_build_id.
1101
1102 * x86_64.cc: Correct license to GPLv3.
1103
1104 2008-03-23 Ian Lance Taylor <iant@google.com>
1105
1106 * options.cc: Include "demangle.h".
1107 (parse_optional_string): New function.
1108 (parse_long_option): Handle takes_optional_argument.
1109 (parse_short_option): Update dash_z initializer. Handle
1110 takes_optional_argument.
1111 (General_options::General_options): Initialize do_demangle_.
1112 (General_options::finalize): Set do_demangle_. Handle demangling
1113 style.
1114 * options.h (parse_optional_string): Declare.
1115 (struct One_option): Add optional_arg field. Update constructor.
1116 Update call constructor calls. Add takes_optional_argument
1117 function.
1118 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
1119 (DEFINE_optional_string): Define.
1120 (General_options::demangle): Change from DEFINE_bool to
1121 DEFINE_optional_string.
1122 (General_options::no_demangle): New function.
1123 (General_options::do_demangle): New function.
1124 (General_options::set_do_demangle): New function.
1125 (General_options::execstack_status_): Move definition to end of
1126 class definition.
1127 (General_options::static_): Likewise.
1128 (General_options::do_demangle_): New field.
1129 * object.cc (big_endian>::get_symbol_location_info): Call
1130 Options::do_demangle, not Options::demangle.
1131 * symtab.cc (demangle): Likewise.
1132
1133 2008-03-22 Ian Lance Taylor <iant@google.com>
1134
1135 * gold.h: Include <cstddef> and <sys/types.h>
1136 * options.h: Include <cstring>.
1137
1138 2008-03-21 Ian Lance Taylor <iant@google.com>
1139
1140 * Added source code to GNU binutils.
1141
This page took 0.06342 seconds and 4 git commands to generate.