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