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