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