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