Update for elf_link_output_extsym change
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
e0b64032
ILT
12008-07-22 Ian Lance Taylor <iant@google.com>
2
3 * output.cc (Output_section::add_input_section): Don't try to
4 merge empty merge sections.
5
096b02cf
CS
62008-07-21 Craig Silverstein <csilvers@google.com>
7
8 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
9 Include symbol version in error message.
10
1d1f116d
CD
112008-07-20 Chris Demetriou <cgd@google.com>
12
13 * configure.ac (gold_cv_c_random_seed): New configured variable.
14 (RANDOM_SEED_CFLAGS): New substituted variable.
15 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
16 * configure: Rebuild.
17 * Makefile.in: Likewise.
18 * testsuite/Makefile.in: Likewise.
19
a18f591e
ILT
202008-07-18 Ian Lance Taylor <iant@google.com>
21
22 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
23 where we see NAME/NULL and NAME/VERSION as separate symbols.
24 * testsuite/ver_test_main.cc (main): Call t4.
25 (t4, t4_2a): Define.
26 * testsuite/ver_test_2.cc (t4_2): Define.
27 * testsuite/ver_test_2.script: Put t4_2a in VER2.
28 * testsuite/ver_test_4.cc (t4_2a): Define.
29 * testsuite/ver_test_4.script: Put t4_2a in VER2.
30 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
31
c6e3f6ed
ILT
322008-07-17 Ian Lance Taylor <iant@google.com>
33
34 * dynobj.cc (Versions::add_def): If we give an error about a
35 missing version, go ahead and create the version anyhow.
36
ef9beddf
ILT
372008-07-10 Ian Lance Taylor <iant@google.com>
38
39 Handle output sections with more than 0x7fffffff bytes.
40 * object.h (class Relobj): Change map_to_output_ to
41 output_sections_, and just keep a section pointer. Change all
42 uses. Move comdat group support to Sized_relobj.
43 (Relobj::is_section_specially_mapped): Remove.
44 (Relobj::output_section): Remove poff parameter. Change all
45 callers.
46 (Relobj::output_section_offset): New function.
47 (Relobj::set_section_offset): Rewrite.
48 (Relobj::map_to_output): Remove.
49 (Relobj::output_sections): New function.
50 (Relobj::do_output_section_offset): New pure virtual function.
51 (Relobj::do_set_section_offset): Likewise.
52 (class Sized_relobj): Add section_offsets_ field. Add comdat
53 group support from Relobj. Update declarations.
54 (Sized_relobj::get_output_section_offset): New function.
55 (Sized_relobj::do_output_section_offset): New function.
56 (Sized_relobj::do_set_section_offset): New function.
57 * object.cc (Relobj::output_section_address): Remove.
58 (Sized_relobj::Sized_relobj): Initialize new fields.
59 (Sized_relobj::include_section_group): Cast find_kept_object to
60 Sized_relobj.
61 (Sized_relobj::include_linkonce_section): Likewise.
62 (Sized_relobj::do_layout): Use separate arrays for output section
63 and output offset.
64 (Sized_relobj::do_count_local_symbols): Change map_to_output to
65 output_sections.
66 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
67 output_sections and section_offsets.
68 (Sized_relobj::write_local_symbols): Likewise.
69 (map_to_kept_section): Compute output address directly.
70 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
71 output_sections and section_offsets.
72 (Sized_relobj::write_sections): Likewise.
73 (Sized_relobj::relocate_sections): Likewise.
74 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
75 * output.h (class Output_reloc): Update declarations. Change
76 u2_.relobj to Sized_relobj*.
77 (class Output_data_reloc): Change add functions to use
78 Sized_relobj*.
79 * output.cc (Output_reloc::Output_reloc): Change relobj to
80 Sized_relobj*.
81 (Output_reloc::local_section_offset): Change return type to
82 Elf_Addr. Use get_output_section_offset.
83 (Output_reloc::get_address): Likewise.
84 (Output_section::is_input_address_mapped): Don't call
85 is_section_specially_mapped.
86 (Output_section::output_offset): Likewise.
87 (Output_section::output_address): Likewise.
88 (Output_section::starting_output_address): Likewise.
89 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
90 parameter to Sized_relobj*.
91 (Copy_relocs::need_copy_reloc): Likewise.
92 (Copy_relocs::save): Likewise.
93 * copy-relocs.h (class Copy_relocs): Update declarations.
94 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
95 Sized_relobj*. Change relobj_ field to Sized_relobj*.
96 * target-reloc.h (relocate_for_relocatable): Change
97 offset_in_output_section type to Elf_Addr. Change code that uses
98 it as well.
99 * layout.cc (Layout::layout): Always set *off.
100 * mapfile.cc (Mapfile::print_input_section): Use
101 output_section_offset.
102 * i386.cc (Target_i386::copy_reloc): Change object parameter to
103 Sized_relobj*.
104 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
105 * sparc.cc (Target_sparc::copy_reloc): Likewise.
106 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
107
5cb66f97
ILT
1082008-07-03 Ian Lance Taylor <iant@google.com>
109
110 * layout.cc (Layout::include_section): Do not discard unrecognized
111 SHT_STRTAB sections.
112
afe47622
CS
1132008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
114
115 * script.cc (Lex::can_continue_name): Make '?' allowable in
116 version-script names.
117 * testsuite/version_script.map: Change glob pattern to use '?'
118
5adf9721
ILT
1192008-06-30 Manish Singh <yosh@gimp.org>
120
121 PR 6585
122 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
123 Correct typo.
124
e6fde208
ILT
1252008-06-30 Ian Lance Taylor <iant@google.com>
126
127 PR 6660
128 PR 6682
129 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
130 versions]: Don't try to read the value in the contents, since we
131 don't use it. Use the template endianness when writing.
132
3f2e6a2d
CC
1332008-06-25 Cary Coutant <ccoutant@google.com>
134
135 * fileread.cc (File_read::make_view): Assert on zero-length view.
136 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
137 symbol table when there are no symbols to read.
138
c43d3a48
CS
1392008-06-23 Craig Silverstein <csilvers@google.com>
140
141 * version.cc (version_string): Bump to 1.7
142
5f494ea0
CS
1432008-06-18 Craig Silverstein <csilvers@google.com>
144
145 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
146 constant 0xFFFF to type Valtype.
147 (Powerpc_relocate_functions::rel16_ha): Likewise.
148
c42e122e
ILT
1492008-06-17 Ian Lance Taylor <iant@google.com>
150
f34787f8
ILT
151 * output.h (Output_section::Input_section): Initialize p2align_ to
152 zero for Output_section_data constructors.
153 (Output_section::Input_section::addralign): If not an input
154 section, return the alignment of the Output_section_data.
155 * testsuite/copy_test.cc: New file.
156 * testsuite/copy_test_1.cc: New file.
157 * testsuite/copy_test_2.cc: New file.
158 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
159 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
160 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
161 (copy_test_1_pic.o, copy_test_1.so): New targets.
162 (copy_test_2_pic.o, copy_test_2.so): New targets.
163 * testsuite/Makefile.in: Rebuild.
164
c42e122e
ILT
165 * script-sections.cc (Script_sections::place_orphan): Initialize
166 local variable exact.
167
ce3ac18a
DE
1682008-06-13 David Edelsohn <edelsohn@gnu.org>
169
170 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
171
42cacb20
DE
1722008-06-12 David Edelsohn <edelsohn@gnu.org>
173 David S. Miller <davem@davemloft.net>
174
175 * powerpc.cc: New file.
176 * Makefile.am (TARGETSOURCES): Add powerpc.cc
177 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
178 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
179 * Makefile.in: Rebuild.
180
7b308235
ILT
1812008-06-09 Ian Lance Taylor <iant@google.com>
182
183 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
184 <exception>.
185 (throwing, orig_terminate): New static variables.
186 (terminate_handler): New static function.
187 (t2): Set terminate handler.
188
f0b886e3
ILT
1892008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
190
191 PR 6584
192 * binary.cc (Binary_to_elf::sized_convert): Fix .data
193 alignment.
194
3e90f135
CC
1952008-05-30 Cary Coutant <ccoutant@google.com>
196
197 * archive.cc (Archive::include_all_members) Correct to step
198 over symbol table and extended name table in thin archives.
199
e09ad04a
ILT
2002008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
201
202 PR 6407
203 * target-reloc.h (relocate_for_relocatable): Fix new_offset
204 calculation.
205
62b01cb5
ILT
2062008-05-28 Caleb Howe <cshowe@google.com>
207
208 * reduced_debug_output.cc: New file.
209 * reduced_debug_output.h: New file.
210 * options.h (class General_optoins): Add --strip-debug-non-line.
211 * options.cc (General_options::finalize): Add strip_debug_non_line
212 to the strip heirarchy.
213 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
214 fields.
215 * layout.cc: Include "reduced_debug_output.h".
216 (Layout::Layout): Initialize new fields.
217 (line_only_debug_sections): New static array.
218 (is_lines_only_debug_sections): New static inline function.
219 (Layout::include_section): Handle --strip-debug-non-line.
220 (Layout::make_output_section): If --strip-debug-non-line, build
221 new output sections for .debug_abbrev and .debug_info.
222 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
223 gold. Warn about possible overflow.
224 (read_signed_LEB_128): Likewise.
225 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
226 (read_signed_LEB_128): Declare.
227 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
228 (HFILES): Add reduced_debug_output.h.
229 * Makefile.in: Rebuild.
230
7d9e3d98
ILT
2312008-05-21 Ian Lance Taylor <iant@google.com>
232
233 * mapfile.cc: New file.
234 * mapfile.h: New file.
235 * options.h (class General_options): Add -M/--print-map and -Map.
236 * options.cc (General_options::finalize): Make -M equivalent to
237 -Map -.
238 * main.cc: Include <cstdio> and "mapfile.h".
239 (main): Open mapfile if requested.
240 * gold.cc (class Middle_runner): Add mapfile_ field. Update
241 constructor. Change caller.
242 (queue_initial_tasks): Add mapfile parameter. Change caller.
243 (queue_middle_tasks): Likewise.
244 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
245 declarations.
246 * archive.cc: Include "mapfile.h".
247 (Archive::add_symbols): Add mapfile parameter. Change all
248 callers. Pass mapfile, symbol, and reason to include_member.
249 (Archive::include_all_members): Add mapfile parameter. Change all
250 callers.
251 (Archive::include_member): Add mapfile, sym, and why parameters.
252 Change all callers. Report inclusion to map file.
253 * archive.h: Include "fileread.h".
254 (class Archive): Update declarations.
255 (Archive::file): New const method.
256 (class Add_archive_symbols): Add mapfile_ field. Update
257 constructor. Change all callers.
258 * readsyms.h (class Read_symbols): Likewise.
259 (class Finish_group): Likewise.
260 (class Read_script): Likewise.
261 * common.cc: Include "mapfile.h".
262 (Symbol_table::allocate_commons): Add mapfile parameter. Change
263 all callers.
264 (Symbol_table::do_allocate_commons): Likewise.
265 (Symbol_table::do_allocate_commons_list): Likewise. Report common
266 symbol allocation to mapfile.
267 * common.h (class Allocate_commons_task): Add mapfile_ field.
268 Update constructor. Change all callers.
269 * symtab.h (class Symbol_table): Update declarations.
270 * layout.cc: Include "mapfile.h".
271 (Layout_task_runner::run): Print information to mapfile.
272 (Layout::create_gold_note): Change Output_data_fixed_space to
273 Output_data_zero_fill.
274 (Layout::create_build_id): Likewise.
275 (Layout::print_to_mapfile): New function.
276 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
277 constructor. Change caller.
278 (class Layout): Declare print_to_mapfile.
279 * output.cc (Output_section::Input_section::print_to_mapfile): New
280 function.
281 (Output_section::add_input_section): If producing a map, always
282 add to input_sections_ list.
283 (Output_section::do_print_to_mapfile): New function.
284 (Output_segment::print_sections_to_mapfile): New function.
285 (Output_segment::print_section_list_to_mapfile): New function.
286 * output.h: Include "mapfile.h".
287 (Output_data::print_to_mapfile): New function.
288 (Output_data::do_print_to_mapfile): New virtual function.
289 (Output_segment_headers::do_print_to_mapfile): New function.
290 (Output_file_header::do_print_to_mapfile): New function.
291 (Output_data_const::do_print_to_mapfile): New function.
292 (class Output_data_const_buffer): Add map_name_ field. Update
293 constructor. Change all callers. Add do_print_to_mapfile
294 function.
295 (class Output_data_fixed_space): Likewise.
296 (class Output_data_space): Likewise.
297 (class Output_data_zero_fill): New class.
298 (Output_data_strtab::do_print_to_mapfile): New function.
299 (Output_data_reloc_base::do_print_to_mapfile): New function.
300 (Output_relocatable_relocs::do_print_to_mapfile): New function.
301 (Output_data_group::do_print_to_mapfile): New function.
302 (Output_data_got::do_print_to_mapfile): New function.
303 (Output_data_dynamic::do_print_to_mapfile): New function.
304 (Output_symtab_xindex::do_print_to_mapfile): New function.
305 (class Output_section): Declare do_print_to_mapflie. Declare
306 print_to_mapfile in Input_section.
307 (class Output_segment): Declare new functions.
308 * object.h (Sized_relobj::symbol_count): New function.
309 * script-sections.cc
310 (Output_section_element_dot_assignment::set_section_addresses):
311 Change Output_data_fixed_space to Output_data_zero_fill.
312 (Output_data_expression::do_print_to_mapfile): New function.
313 * script.cc (read_input_script): Add mapfile parameter. Change
314 all callers.
315 * script.h (read_input_script): Update declaration.
316 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
317 (Eh_frame::do_print_to_mapfile): New function.
318 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
319 (Output_merge_string::do_print_to_mapfile): New function.
320 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
321 function.
322 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
323 function.
324 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
325 function.
326 * Makefile.am (CCFILES): Add mapfile.cc.
327 (HFILES): Add mapfile.h.
328 * Makefile.in: Rebuild.
329
9f1d377b
ILT
3302008-05-19 Ian Lance Taylor <iant@google.com>
331
332 * options.h (class General_options): Add -z relro.
333 * layout.cc (Layout::Layout): Initialize relro_segment_.
334 (Layout::add_output_section_data): Return the output section.
335 (Layout::make_output_section): Rcognize relro sections and mark
336 them appropriately.
337 (Layout::attach_allocated_section_to_segment): Put relro sections
338 in a PT_GNU_RELRO segment.
339 (Layout::create_initial_dynamic_sections): Mark the .dynamic
340 section as relro.
341 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
342 PT_TLS segments.
343 (Layout::linkonce_mapping): Map d.rel.ro.local to
344 .data.rel.ro.local.
345 (Layout::output_section_name): Us .data.rel.ro.local for any
346 section which begins with that.
347 * layout.h (class Layout): Update add_output_section_data
348 declaration. Add relro_segment_ field.
349 * output.cc (Output_section::Output_section): Initialize is_relro_
350 and is_relro_local_ fields.
351 (Output_segment::add_output_section): Group relro sections.
352 (Output_segment::is_first_section_relro): New function.
353 (Output_segment::maximum_alignment): If there is a relro section,
354 align the segment to the common page size.
355 (Output_segment::set_section_addresses): Track whether we are
356 looking at relro sections. If the last section is a relro
357 section, align to the common page size.
358 (Output_segment::set_section_list_addresses): Add in_relro
359 parameter. Change all callers. Align to the page size when
360 moving from relro to non-relro section.
361 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
362 segment.
363 * output.h (class Output_section): Add is_relro_ and
364 is_relro_local_ fields.
365 (Output_section::is_relro): New function.
366 (Output_section::set_is_relro): New function.
367 (Output_section::is_relro_local): New function.
368 (Output_section::set_is_relro_local): New function.
369 (class Output_segment): Update declarations.
370 * i386.cc (Target_i386::got_section): Mark .got section as relro.
371 * sparc.cc (Target_sparc::got_section): Likewise.
372 * x86_64.cc (Target_x86_64::got_section): Likewise.
373 * testsuite/relro_test_main.cc: New file.
374 * testsuite/relro_test.cc: New file.
375 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
376 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
377 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
378 (relro_test.so, relro_test_pic.o): New targets.
379 * testsuite/Makefile.in: Rebuild.
380
a984ee1d
ILT
3812008-05-16 Ian Lance Taylor <iant@google.com>
382
01676dcd
ILT
383 * output.cc (Output_segment::add_output_section): Remove front
384 parameter.
385 * output.h (class Output_segment): Remove
386 add_initial_output_section and overloaded add_output_section.
387 Update declaration of remaining add_output_section.
388 * layout.cc (Layout::create_interp): Call add_output_section
389 rather than add_initial_output_section.
390 (Layout::finish_dynamic_section): Likewise.
391
497897f9
ILT
392 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
393 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
394 know the dynamic type.
395 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
396 field. Initialize it in constructor.
397 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
398 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
399 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
400 reloc.
401
a984ee1d
ILT
402 * output.cc (Output_reloc::get_address): Change return type to
403 Elf_Addr.
404 * output.h (class Output_reloc): Update get_address declaration.
405 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
406 for section addresses.
407
55ba0940
ILT
4082008-05-09 Ian Lance Taylor <iant@google.com>
409
410 PR 6493
411 * gold.cc (gold_nomem): Use return value of write.
412
75517b77
ILT
4132008-05-08 Ian Lance Taylor <iant@google.com>
414
415 * symtab.c (Symbol::init_base_output_data): Add version
416 parameter. Change all callers.
417 (Symbol::init_base_output_segment): Likewise.
418 (Symbol::init_base_constant): Likewise.
419 (Symbol::init_base_undefined): Likewise.
420 (Sized_symbol::init_output_data): Likewise.
421 (Sized_symbol::init_output_segment): Likewise.
422 (Sized_symbol::init_constant): Likewise.
423 (Sized_symbol::init_undefined): Likewise.
424 (Symbol_table::do_define_in_output_data): If the new symbol has a
425 version, mark it as the default.
426 (Symbol_table::do_define_in_output_segment): Likewise.
427 (Symbol_table::do_define_as_constant): Likewise.
428 * symtab.h (class Symbol): Update declarations.
429 (class Sized_symbol): Likewise.
430 * resolve.cc (Symbol::override_version): New function.
c42e122e 431 (Symbol::override_base): Call override_version.
75517b77
ILT
432 (Symbol::override_base_with_special): Likewise.
433 * testsuite/ver_script_8.script: New file.
434 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
435 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
436 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
437 (ver_test_8_1.so, ver_test_8_2.so): New targets.
438
f1f70eae
ILT
4392008-05-06 Ian Lance Taylor <iant@google.com>
440
f3e9c5c5
ILT
441 PR 6049
442 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
443 functions.
444 (class General_options): Remove existing --undefined, and add
445 --no-undefined instead. Add new --undefined as synonym for -u.
446 * archive.cc (Archive::add_symbols): Check whether symbol was
447 named with -u.
448 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
449 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
450 all uses. Add IS_UNDEFINED. Update declarations to split
451 different versions of init_base. Declare init_base_undefined.
452 (Symbol::is_defined): Handle IS_UNDEFINED.
453 (Symbol::is_undefined): Likewise.
454 (Symbol::is_weak_undefined): Call is_undefined.
455 (Symbol::is_absolute): Handle IS_CONSTANT.
456 (class Sized_symbol): Update declarations to split different
457 versions of init. Declare init_undefined.
458 (class Symbol_table): Declare new functions.
459 * symtab.cc (Symbol::init_base_object): Rename from init_base.
460 Change all callers.
461 (Symbol::init_base_output_data): Likewise.
462 (Symbol::init_base_output_segment): Likewise.
463 (Symbol::init_base_constant): Likewise.
464 (Symbol::init_base_undefined): New function.
465 (Sized_symbol::init_object): Rename from init. Change all
466 callers.
467 (Sized_symbol::init_output_data): Likewise.
468 (Sized_symbol::init_output_segment): Likewise.
469 (Sized_symbol::init_constant): Likewise.
470 (Sized_symbol::init_undefined): New function.
471 (Symbol_table::add_undefined_symbols_from_command_line): New
472 function.
473 (Symbol_table::do_add_undefined_symbols_from_command_line): New
474 function.
475 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
476 (Symbol::output_section): Likewise.
477 (Symbol::set_output_section): Likewise.
478 (Symbol_table::sized_finalize_symbol): Likewise.
479 (Symbol_table::sized_write_globals): Likewise.
480 * resolve.cc (Symbol_table::should_override): Likewise.
481 (Symbol::override_base_with_special): Likewise.
482
8bdcdf2c
ILT
483 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
484 symbol, change it to have default visibility.
485 * testsuite/protected_1.cc: New file.
486 * testsuite/protected_2.cc: New file.
487 * testsuite/protected_3.cc: New file.
488 * testsuite/protected_main_1.cc: New file.
489 * testsuite/protected_main_2.cc: New file.
490 * testsuite/protected_main_3.cc: New file.
491 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
492 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
493 (protected_1_LDFLAGS, protected_1_LDADD): Define.
494 (protected_1.so): New target.
495 (protected_1_pic.o, protected_2_pic.o): New targets.
496 (protected_3_pic.o): New target.
497 (check_PROGRAMS): Add protected_2.
498 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
499 (protected_2_LDFLAGS, protected_2_LDADD): Define.
500 * testsuite/Makefile.in: Rebuild.
501
2b706932
ILT
502 * options.h (DEFINE_var): Add set_user_set_##varname__.
503 (DEFINE_bool_alias): New macro.
504 (class General_options): Define -Bstatic using DEFINE_bool_alias
505 rather than DEFINE_special. Add --undefined as an alias for -z
506 defs.
507 * options.cc (General_options::parse_Bstatic): Remove.
508
d82a5bcc
ILT
509 * options.h (class General_options): Add --fatal-warnings.
510 * main.cc (main): Implement --fatal-warnings.
511 * errors.h (Errors::warning_count): New function.
512
f1f70eae
ILT
513 * options.h (class General_options): Add -Bsymbolic-functions.
514 * symtab.h (Symbol::is_preemptible): Check for
515 -Bsymbolic-functions.
516
8825ac63
ILT
5172008-05-05 Ian Lance Taylor <iant@google.com>
518
d98bc257
ILT
519 * options.h (DEFINE_bool): For DASH_Z, create the negative option
520 as noVARNAME rather than no-VARNAME.
521 (class General_options): Add option -z combreloc.
522 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
523 get_address.
524 (Output_reloc::sort_before) [SHT_REL]: New function.
525 (Output_reloc::sort_before) [SHT_RELA]: New function.
526 (class Output_data_reloc_base): Add sort_relocs_ field. Define
527 Sort_relocs_comparison.
528 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
529 parameter. Change all callers.
530 (Output_data_reloc::Output_data_reloc) [both versions]: Add
531 sort_relocs parameter. Change all callers.
532 * output.cc (Output_reloc::get_address): New function, broken out
533 of write_rel.
534 (Output_reloc::write_rel): Call it.
535 (Output_reloc::compare): New function.
536 (Output_data_reloc_base::do_write): Optionally sort relocs.
537
60b2b4e7
ILT
538 * configure.ac: If targ_extra_obj is set, link it in.
539 * configure.tgt: Initialize all variables.
540 (x86_64*): Set targ_extra_obj and targ_extra_size.
541 * configure: Rebuild.
542
8825ac63
ILT
543 * object.cc (Sized_relobj::include_section_group): Adjust section
544 indexes read from group data. Build vector to pass to
545 layout_group.
546 * layout.cc (Layout::layout_group): Add flags and shndxes
547 parameters. Remove contents parameter. Change caller. Update
548 explicit instantiations.
549 * layout.h (class Layout): Update layout_group declaration.
550 * output.cc (Output_data_group::Output_data_group): Add flags and
551 input_shndxes parameters. Remove contents parameter. Change
552 caller.
553 (Output_data_group::do_write): Change input_sections_ to
554 input_shndxes_.
555 * output.h (class Output_data_group): Update constructor
556 declaration. Rename input_sections_ to input_shndxes_.
557 * testsuite/many_sections_test.cc: Add template.
558
e94cf127
CC
5592008-04-30 Cary Coutant <ccoutant@google.com>
560
4418b2d5
CC
561 * target-reloc.h (relocate_section): Fix dead-pointer bug.
562
e94cf127
CC
563 * layout.cc (Layout::include_section): Refactored check for debug
564 info section.
565 (Layout::add_comdat): Add new parameters. Change type
566 of signature parameter. Add object and shndx to signatures table.
567 (Layout::find_kept_object): New function.
568 * layout.h: Include <cstring>.
569 (Layout::is_debug_info_section): New function.
570 (Layout::add_comdat): Add new parameters.
571 (Layout::find_kept_object): New function.
572 (Layout::Kept_section): New struct.
573 (Layout::Signatures): Change type of map range.
574 * object.cc (Relobj::output_section_address): New function.
575 (Sized_relobj::include_section_group): Add new parameters. Change
576 calls to Layout::add_comdat. Change to build table of kept comdat
577 groups and table mapping discarded sections to kept sections.
578 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
579 (Sized_relobj::do_layout): Change calls to include_section_group and
580 include_linkonce_section.
581 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
582 value to zero when section is discarded.
583 (Sized_relobj::map_to_kept_section): New function.
584 * object.h (Relobj::output_section_address): New function.
585 (Relobj::Comdat_group): New type.
586 (Relobj::find_comdat_group): New function.
587 (Relobj::Comdat_group_table): New type.
588 (Relobj::Kept_comdat_section): New type.
589 (Relobj::Kept_comdat_section_table): New type.
590 (Relobj::add_comdat_group): New function.
591 (Relobj::set_kept_comdat_section): New function.
592 (Relobj::get_kept_comdat_section): New function.
593 (Relobj::comdat_groups_): New field.
594 (Relobj::kept_comdat_sections_): New field.
595 (Symbol_value::input_value): Update comment.
596 (Sized_relobj::map_to_kept_section) New function.
597 (Sized_relobj::include_linkonce_section): Add new parameter.
598 * target-reloc.h (Comdat_behavior): New type.
599 (get_comdat_behavior): New function.
600 (relocate_section): Add code to map a discarded section to the
601 corresponding kept section when applying a relocation.
602
e4e5049b
CS
6032008-04-30 Craig Silverstein <csilvers@google.com>
604
605 * dwarf_reader.cc (next_generation_count): New static var.
606 (Addr2line_cache_entry): New struct.
607 (addr2line_cache): New static var.
608 (Dwarf_line_info::one_addr2line): Added caching.
609 (Dwarf_line_info::clear_addr2line_cache): New function.
610 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
611 cache-size parameter.
612 (Dwarf_line_info::one_addr2line_cache): New function.
613 * symtab.cc (Symbol_table::detect_odr_violations): Pass
614 new cache-size argument to one_addr2line(), and clear cache.
615
d09e9154
CC
6162008-04-28 Cary Coutant <ccoutant@google.com>
617
618 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
619 R_386_PC8 relocations.
620
7ef73768
ILT
6212008-04-23 Ian Lance Taylor <iant@google.com>
622
55438702
ILT
623 * object.cc (Sized_relobj::include_section_group): Check for
624 invalid section group.
625
c165fb93
ILT
626 * object.cc (make_elf_object): Correct test for 64-bit ELF file
627 header size.
628
7ef73768
ILT
629 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
630 than read for file header.
631 * archive.cc (Archive::include_member): Likewise.
632
6194aaab
L
6332008-04-23 Paolo Bonzini <bonzini@gnu.org>
634
635 * aclocal.m4: Regenerate.
636 * configure: Regenerate.
637
d491d34e
ILT
6382008-04-19 Ian Lance Taylor <iant@google.com>
639
5ea2bac6
ILT
640 * version.cc (version_string): Bump to 1.6.
641
7bc3e21a
ILT
642 * testsuite/Makefile.am (many_sections_r_test): New target.
643 (many_sections_r_test_SOURCES): Remove.
644 (many_sections_r_test_DEPENDENCIES): Remove.
645 (many_sections_r_test_LDFLAGS): Remove.
646 (many_sections_r_test_LDADD): Remove.
647
7fcd3aa9
ILT
648 * object.cc (Sized_relobj::do_add_symbols): Always pass
649 local_symbol_count_ to add_from_relobj.
650
4c94d6ae
ILT
651 * testsuite/Makefile.am (many_sections_check.h): Only check one in
652 every thousand variables.
653 * testsuite/Makefile.in: Rebuild.
654
d491d34e
ILT
655 * object.cc (Xindex::initialize_symtab_xindex): New function.
656 (Xindex::read_symtab_xindex): New function.
657 (Xindex::sym_xindex_to_shndx): New function.
658 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
659 available.
660 (Sized_relobj::do_initialize_xindex): New function.
661 (Sized_relobj::do_read_symbols): Adjust section links.
662 (Sized_relobj::symbol_section_and_value): Add is_ordinary
663 parameter. Change all callers.
664 (Sized_relobj::include_section_group): Adjust section links and
665 symbol section indexes.
666 (Sized_relobj::do_layout): Adjust section links.
667 (Sized_relobj::do_count_local_symbols): Adjust section links and
668 symbol section indexes.
669 (Sized_relobj::do_finalize_local_symbols): Distinguish between
670 ordinary and special symbols.
671 (Sized_relobj::write_local_symbols): Add symtab_xindex and
672 dynsym_xindex parameters. Change all callers. Adjust section
673 links. Use SHN_XINDEX when needed.
674 (Sized_relobj::get_symbol_location_info): Adjust section links.
675 Don't get fooled by special symbols.
676 * object.h (class Xindex): Define.
677 (class Object): Add xindex_ parameter. Declare virtual functoin
678 do_initialize_xindex.
679 (Object::adjust_sym_shndx): New function.
680 (Object::set_xindex): New protected function.
681 (class Symbol_value): Add is_ordinary_shndx_ field.
682 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
683 (Symbol_value::value): Assert ordinary section.
684 (Symbol_value::initialize_input_to_output_map): Likewise.
685 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
686 Change all callers.
687 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
688 all callers.
689 (class Sized_relobj): Update declarations.
690 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
691 parameter. Change all callers.
692 (Sized_relobj::adjust_shndx): New function.
693 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
694 field.
695 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
696 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
697 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
698 (Sized_dynobj::read_dynsym_section): Adjust section links.
699 (Sized_dynobj::read_dynamic): Likewise.
700 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
701 section links.
702 (Sized_dynobj::do_initialize_xindex): New function.
703 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
704 do_initialize_xindex.
705 (Sized_dynobj::adjust_shndx): New function.
706 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
707 dynsym_xindex_ fields.
708 (Layout::finalize): Add a call to set_section_indexes before
709 creating the symtab sections.
710 (Layout::set_section_indexes): Don't do anything if the section
711 already has a section index.
712 (Layout::create_symtab_sections): Add shnum parameter. Change
713 caller. Create .symtab_shndx section if needed.
714 (Layout::create_shdrs): Add shstrtab_section parameter. Change
715 caller.
716 (Layout::allocated_output_section_count): New function.
717 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
718 needed.
719 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
720 fields. Update declarations.
721 (Layout::symtab_xindex): New function.
722 (Layout::dynsym_xindex): New function.
723 (class Write_symbols_task): Add layout_ field.
724 (Write_symbols_task::Write_symbols_task): Add layout parameter.
725 Change caller.
726 * output.cc (Output_section_headers::Output_section_headers): Add
727 shstrtab_section parameter. Change all callers.
728 (Output_section_headers::do_sized_write): Store overflow values
729 for section count and section string table section index in
730 section header zero.
731 (Output_file_header::do_sized_write): Check for overflow of
732 section count and section string table section index.
733 (Output_symtab_xindex::do_write): New function.
734 (Output_symtab_xindex::endian_do_write): New function.
735 * output.h (class Output_section_headers): Add shstrtab_section_.
736 Update declarations.
737 (class Output_symtab_xindex): Define.
738 (Output_section::has_out_shndx): New function.
739 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
740 field.
741 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
742 Change all callers.
743 (Sized_symbol::init): Likewise.
744 (Symbol::output_section): Check for ordinary symbol.
745 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
746 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
747 callers.
748 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
749 Change all callers. Simplify handling of symbols from sections
750 not included in the link.
751 (Symbol_table::add_from_dynobj): Handle ordinary symbol
752 distinction.
753 (Weak_alias_sorter::operator()): Assert that symbols are
754 ordinary.
755 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
756 distinction.
757 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
758 parameters. Change all callers.
759 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
760 symbol distinction. Use SHN_XINDEX when needed.
761 (Symbol_table::write_section_symbol): Add symtab_xindex
762 parameter. Change all callers.
763 (Symbol_table::sized_write_section_symbol): Likewise. Use
764 SHN_XINDEX when needed.
765 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
766 declarations.
767 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
768 (Symbol::is_defined): Check is_ordinary.
769 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
770 (Symbol::is_absolute, Symbol::is_common): Likewise.
771 (class Sized_symbol): Update declarations.
772 (class Symbol_table): Update declarations.
773 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
774 parameters. Change all callers.
775 (Sized_symbol::override): Likewise.
776 (Symbol_table::override): Likewise.
777 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
778 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
779 is_ordinary, and orig_st_shndx parameters. Change all callers.
780 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
781 to be in an ordinary section.
782 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
783 object and is_ordinary parameters. Change all callers.
784 (Sized_dwarf_line_info::read_relocs): Add object parameter.
785 Change all callers. Don't add undefined or non-ordinary symbols
786 to reloc_map_.
787 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
788 Change all callers.
789 * dwarf_reader.h (class Sized_dwarf_line_info): Update
790 declarations.
791 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
792 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
793 (Sized_relobj::relocate_sections): Likewise.
794 * target-reloc.h (scan_relocs): Adjust section symbol index.
795 (scan_relocatable_relocs): Likewise.
796 * i386.cc (Scan::local): Check for ordinary symbols.
797 * sparc.cc (Scan::local): Likewise.
798 * x86_64.cc (Scan::local): Likewise.
799 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
800 to symbol_section_and_value.
801 * testsuite/many_sections_test.cc: New file.
802 * testsuite/Makefile.am (BUILT_SOURCES): Define.
803 (check_PROGRAMS): Add many_sections_test.
804 (many_sections_test_SOURCES): Define.
805 (many_sections_test_DEPENDENCIES): Define.
806 (many_sections_test_LDFLAGS): Define.
807 (BUILT_SOURCES): Add many_sections_define.h.
808 (many_sections_define.h): New target.
809 (BUILT_SOURCES): Add many_sections_check.h.
810 (many_sections_check.h): New target.
811 (check_PROGRAMS): Add many_sections_r_test.
812 (many_sections_r_test_SOURCES): Define.
813 (many_sections_r_test_DEPENDENCIES): Define.
814 (many_sections_r_test_LDFLAGS): Define.
815 (many_sections_r_test_LDADD): Define.
816 (many_sections_r_test.o): New target.
817 * testsuite/Makefile.in: Rebuild.
818
c5818ff1
CC
8192008-04-17 Cary Coutant <ccoutant@google.com>
820
821 * errors.cc (Errors::info): New function.
822 (gold_info): New function.
823 * errors.h (Errors::info): New function.
824 * gold.h (gold_info): New function.
825 * object.cc (Input_objects::add_object): Print trace output.
826 * options.cc (options::parse_set): New function.
827 (General_options::parse_wrap): Deleted.
828 (General_options::General_options): Deleted initializer.
829 * options.h (options::String_set): New typedef.
830 (options::parse_set): New function.
831 (DEFINE_set): New macro.
832 (General_options::wrap): Changed to use DEFINE_set. Changed
833 callers of any_wrap_symbols and is_wrap_symbol.
834 (General_options::trace, General_options::trace_symbol):
835 New options.
836 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
837 (General_options::wrap_symbols_): Deleted.
838 * symtab.cc (Symbol_table::add_from_object): Print trace output.
839
b5be4a7c
DM
8402008-04-17 David S. Miller <davem@davemloft.net>
841
842 * options.cc (General_options::parse_V): New function.
843 * options.h: Add entries for -V and -Qy.
844
155a0dd7
ILT
8452008-04-17 Ian Lance Taylor <iant@google.com>
846
847 * common.cc (Symbol_table::allocate_commons): Remove options
848 parameter. Change caller.
849 (Symbol_table::do_allocate_commons): Remove options parameter.
850 Change caller. Just call do_allocate_commons_list twice.
851 (Symbol_table::do_allocate_commons_list): New function, broken out
852 of do_allocate_commons.
853 * common.h (class Allocate_commons_task): Remove options_ field.
854 Update constructor.
855 * symtab.cc (Symbol_table::Symbol_table): Initialize
856 tls_commons_.
857 (Symbol_table::add_from_object): Put TLS common symbols on
858 tls_commons_ list.
859 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
860 which are IN_OUTPUT_DATA.
861 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
862 allocate_commons and do_allocate_commons declarations. Declare
863 do_allocate_commons_list.
864 * gold.cc (queue_middle_tasks): Update creation of
865 Allocate_commons_task to not pass options.
866 * testsuite/Makefile.am (INCLUDES): Add -I.. .
867 (TLS_TEST_C_FLAGS): New variable.
868 (tls_test_c_pic.o): New target.
869 (tls_test_shared.so): Link in tls_test_c_pic.o.
870 (tls_test_c_pic_ie.o): New target.
871 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
872 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
873 (tls_test_c.o): New target.
874 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
875 (tls_pic_test_LDADD): Likewise.
876 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
877 (tls_shared_gd_to_ie_test_LDADD): Likewise.
878 (tls_test_c_gnu2.o): New target.
879 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
880 tls_test_c_gnu2.o.
881 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
882 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
883 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
884 * testsuite/tls_test.cc: Include "config.h".
885 (t_last): Call t11_last.
886 * testsuite/tls_test.h (t11, t11_last): Declare.
887 * testsuite/tls_test_c.c: New file.
888 * testsuite/tls_test_main.cc (thread_routine): Call t11.
889 * configure.ac: Check for OpenMP support.
890 * configure, config.in, Makefile.in: Rebuild.
891 * testsuite/Makefile.in: Rebuild.
892
edfbb029
CC
8932008-04-16 Cary Coutant <ccoutant@google.com>
894
895 * i386.cc (Target_i386::define_tls_base_symbol): New function.
896 (Target_i386::tls_base_symbol_defined_): New field.
897 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
898 (Target_i386::Scan::global): Likewise.
899 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
900 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
901 (Target_x86_64::tls_base_symbol_defined_): New field.
902 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
903 (Target_x86_64::Scan::global): Likewise.
904
f3c69fca
CC
9052008-04-16 Cary Coutant <ccoutant@google.com>
906
907 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
908 (Symbol::needs_plt_entry): Allow weak undefined symbols.
909 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
910 building shared libraries.
911 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
912 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
913 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
914 * testsuite/Makefile.in: Rebuild.
915 * testsuite/weak_undef.h: New file.
916 * testsuite/weak_undef_file1.cc: Add extra test cases.
917 * testsuite/weak_undef_file2.cc: Likewise.
918 * testsuite/weak_undef_test.cc: Likewise.
919
7c414435
DM
9202008-04-16 David S. Miller <davem@davemloft.net>
921
32b769e1
DM
922 * sparc.cc (Target_sparc::Scan): Change from struct to class.
923 Add issued_non_pic_error_ field. Declare check_non_pic.
924 (Target_sparc::Scan::check_non_pic): New function.
925 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
926 (Target_sparc::Scan::global): Likewise.
927
11936fb1
DM
928 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
929 * configure: Rebuild.
930
7c414435
DM
931 * options.h (DEFINE_enable): New macro.
932 (new_dtags): New enable option.
933 (initfirst, interpose, loadfltr, nodefaultlib,
934 nodelete, nodlopen, nodump): New -z options.
935 * layout.cc (Layout:finish_dynamic_section): If new
936 dtags enabled, emit DT_RUNPATH. Also, emit a
937 DT_FLAGS_1 containing any specified -z flags.
938
85c7bf8b
ILT
9392008-04-16 Ian Lance Taylor <iant@google.com>
940
12c0daef
ILT
941 * copy-relocs.cc: New file.
942 * copy-relocs.h: New file.
943 * reloc.cc: Remove Copy_relocs code.
944 * reloc.h: Likewise.
945 * reloc-types.h (struct Reloc_types) [both versions]: Add
946 get_reloc_addend_noerror.
947 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
948 variants of add_global which take an addend which must be zero.
949 * i386.cc: Include "copy-relocs.h".
950 (class Target_i386): Change type of copy_relocs_ to variable,
951 update initializer.
952 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
953 Change all callers.
954 (Target_i386::do_finalize_sections): Change handling of
955 copy_relocs_.
956 * sparc.cc: Include "copy-relocs.h".
957 (class Target_sparc): Change type of copy_relocs_ to variable,
958 update initializer.
959 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
960 Change all callers.
961 (Target_sparc::do_finalize_sections): Change handling of
962 copy_relocs_.
963 * x86_64.cc: Include "copy-relocs.h".
964 (class Target_x86_64): Change type of copy_relocs_ to variable,
965 update initializer.
966 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
967 class. Change all callers.
968 (Target_x86_64::do_finalize_sections): Change handling of
969 copy_relocs_.
970 * Makefile.am (CCFILES): Add copy-relocs.cc.
971 (HFILES): Add copy-relocs.h.
972
4f4995b6
ILT
973 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
974
85c7bf8b
ILT
975 * testsuite/script_test_4.sh: Permit leading zeroes.
976
4f2a9edd
ILT
9772008-04-15 Ian Lance Taylor <iant@google.com>
978
e6188289
ILT
979 * script-sections.cc (Script_sections::create_segments): Use
980 header_size_adjustment even when there is enough room for the
981 headers.
982 * testsuite/script_test_4.sh: New file.
983 * testsuite/script_test_4.t: New file.
984 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
985 (check_DATA): Add script_test_4.stdout.
986 (MOSTLYCLEANFILES): Likewise.
987 (script_test_4): New target.
988 (script_test_4.stdout): New target.
989 * testsuite/Makefile.in: Rebuild.
990
4f2a9edd
ILT
991 * sparc.cc: Add definitions for Output_data_plt_sparc class
992 constants.
993
f5314dd5
DM
9942008-04-14 David S. Miller <davem@davemloft.net>
995
996 * sparc.cc: New file.
997 * Makefile.am (TARGETSOURCES): Add sparc.cc
998 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
999 * configure.tgt: Document targ_extra_size and
1000 targ_extra_big_endian. Add entries for sparc-* and
1001 sparc64-*.
1002 * configure.ac: Handle targ_extra_size and
1003 targ_extra_big_endian.
1004 * Makefile.in: Rebuild.
1005 * configure: Likewise.
1006 * po/POTFILES.in: Likewise.
1007 * po/gold.pot: Likewise.
1008
154e0e9a
ILT
10092008-04-14 Ian Lance Taylor <iant@google.com>
1010
1011 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
1012 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
1013 in the name/type/flags to section mapping. Don't call
1014 allocate_output_section.
1015 (Layout::choose_output_section): Change parameter from adjust_name
1016 to is_input_section. Don't permit input sections after sections
1017 are attached to segments. Don't call allocate_output_section.
1018 (Layout::layout_eh_frame): Call update_flags_for_input_section,
1019 not write_enable_output_section.
1020 (Layout::make_output_section): Don't push to
1021 unattached_section_list_ nor call attach_to_segment. Call
1022 attach_section_to_segment if sections are attached.
1023 (Layout::attach_sections_to_segments): New function.
1024 (Layout::attach_section_to_segment): New function.
1025 (Layout::attach_allocated_section_to_segment): Rename from
1026 attach_to_segment. Remove flags parameter.
1027 (Layout::allocate_output_section): Remove function.
1028 (Layout::write_enable_output_section): Remove function.
1029 * layout.h (class Layout): Update for above changes. Add new
1030 field sections_are_attached_.
1031 * output.h (Output_section::update_flags_for_input_section): New
1032 function.
1033 * output.cc (Output_section::add_input_section): Call
1034 update_flags_for_input_section.
1035 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
1036
009a67a2
CC
10372008-04-11 Cary Coutant <ccoutant@google.com>
1038
1039 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
1040 thought unnecessary.
1041 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
1042
759b1a24
ILT
10432008-04-11 Ian Lance Taylor <iant@google.com>
1044
1045 * output.h (class Output_section_data): Remove inline definition
1046 of set_addralign.
1047 * output.cc (Output_section_data::set_addralign): New function.
1048
c2b45e22
CC
10492008-04-11 Cary Coutant <ccoutant@google.com>
1050
1051 Add support for TLS descriptors for i386 and x86_64.
1052 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
1053 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
1054 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
1055 GOT_TYPE_TLS_DESC.
1056 (Target_i386::got_mod_index_entry): Remove unnecessary code.
1057 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
1058 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
1059 relocations.
1060 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
1061 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
1062 Fix problem with initial-exec relocations.
1063 (Target_i386::Relocate::relocate_tls): Likewise.
1064 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
1065 relaxation.
1066 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
1067 support for section-plus-offset dynamic table entries.
1068 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
1069 (Output_data_dynamic::Dynamic_entry): Add support for
1070 section-plus-offset dynamic table entries.
1071 (Output_data_dynamic::Classification): Likewise.
1072 (Output_data_dynamic::classification_): Renamed offset_.
1073 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
1074 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
1075 (Target_x86_64::make_plt_section): New function.
1076 (Target_x86_64::reserve_tlsdesc_entries): New function.
1077 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
1078 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
1079 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
1080 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
1081 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
1082 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
1083 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
1084 add extra PLT entry for TLS descriptors.
1085 (Output_data_plt_x86_64::got_): New field.
1086 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
1087 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
1088 fields.
1089 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
1090 descriptors.
1091 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
1092 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
1093 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
1094 R_386_TLS_DESC_CALL relocations.
1095 (Target_x86_64::Scan::global): Likewise.
1096 (Target_x86_64::do_finalize_sections): Add dynamic table entries
1097 for TLS descriptors.
1098 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
1099 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
1100 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
1101 GD-to-IE relaxation.
1102 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
1103 and TLS_DESCRIPTORS.
1104 * Makefile.in: Rebuild.
1105 * configure: Rebuild.
1106 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
1107 (tls_test_shared2.so): New target.
1108 (tls_shared_gd_to_ie_test_SOURCES): New variable.
1109 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
1110 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
1111 (tls_shared_gd_to_ie_test_LDADD): New variable.
1112 (tls_shared_gnu2_gd_to_ie_test): New target.
1113 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
1114 New targets.
1115 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
1116 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
1117 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
1118 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
1119 (tls_shared_gnu2_test): New target.
1120 (tls_test_gnu2_shared.so): New target.
1121 (tls_shared_gnu2_test_SOURCES): New variable.
1122 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
1123 (tls_shared_gnu2_test_LDFLAGS): New variable.
1124 (tls_shared_gnu2_test_LDADD): New variable.
1125 * testsuite/Makefile.in: Rebuild.
1126 * testsuite/Makefile.
1127
83bfb6b7
ILT
11282008-04-11 Ian Lance Taylor <iant@google.com>
1129
1130 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
1131 justsyms.t.
1132 * testsuite/Makefile.in: Rebuild.
1133
1134 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
1135 long.
1136 * testsuite/script_test_2.cc (main): Adjust test.
1137
706e1f5e
ILT
11382008-04-11 David S. Miller <davem@davemloft.net>
1139 Ian Lance Taylor <iant@google.com>
1140
1141 * options.h (General_options): Add entries for '-Y' and
1142 '-relax'.
1143 * options.cc (General_options:finalize): If -Y was used, add those
1144 entries to the library path instead of the default "/lib" and
1145 "/usr/lib".
1146
7c98e6bb
DM
11472008-04-11 David S. Miller <davem@davemloft.net>
1148
1149 * testsuite/justsyms.t: Start at 0x100.
1150 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
1151 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
1152 long.
1153 * testsuite/script_test_2.cc: Adjust string and section length
1154 checks.
7c98e6bb 1155
99a37bfd
ILT
11562008-04-09 Ian Lance Taylor <iant@google.com>
1157
2cefc357
ILT
1158 PR gold/5996
1159 * script-sections.cc (Sections_element::allocate_to_segment): Add
1160 orphan parameter.
1161 (Output_section_definition::allocate_to_segment): Likewise.
1162 (Orphan_output_section::allocate_to_segment): Likewise.
1163 (Script_sections::attach_sections_using_phdrs_clause): Don't
1164 propagate non-PT_LOAD segments to orphan sections.
1165 * testsuite/Makefile.am (script_test_3.stdout): Generate using
1166 readelf rather than objdump.
1167 * testsuite/script_test_3.sh: Adjust accordingly. Test that
1168 .interp section and PT_INTERP segment are the same size.
1169 * testsuite/Makefile.in: Rebuild.
1170
99a37bfd
ILT
1171 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
1172 aliases for symbols defined in the same object.
1173 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
1174 (weak_alias_test_SOURCES): New variable.
1175 (weak_alias_test_DEPENDENCIES): New variable.
1176 (weak_alias_test_LDFLAGS): New variable.
1177 (weak_alias_test_LDADD): New variable.
1178 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
1179 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
1180 (weak_alias_test_3.o): New target.
1181 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
1182 * testsuite/weak_alias_test_main.cc: New file.
1183 * testsuite/weak_alias_test_1.cc: New file.
1184 * testsuite/weak_alias_test_2.cc: New file.
1185 * testsuite/weak_alias_test_3.cc: New file.
1186
780e49c5
ILT
11872008-04-08 Ian Lance Taylor <iant@google.com>
1188
cdb0b8f5
ILT
1189 * options.h (class General_options): Add --noinhibit-exec option.
1190 * main.cc (main): Check --noinhibit-exec.
1191
0864d551
ILT
1192 * options.h (class General_options): Define --wrap as a special
1193 option. Add wrap_symbols_ field.
1194 (General_options::any_wrap_symbols): New function.
1195 (General_options::is_wrap_symbol): New function.
1196 * options.cc (General_options::parse_wrap): New function.
1197 (General_options::General_options): Initialize wrap_symbols_.
1198 * symtab.cc (Symbol_table::wrap_symbol): New function.
1199 (Symbol_table::add_from_object): Handle --wrap.
1200 * symtab.h (class Symbol_table): Declare wrap_symbol.
1201 * target.h (Target::wrap_char): New function.
1202 (Target::Target_info): Add wrap_char field.
1203 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
1204 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1205 * testsuite/testfile.cc (Target_test::test_target_info):
1206 Likewise.
1207
789aa6de
ILT
1208 * errors.cc (Errors::undefined_symbol): Mention symbol version if
1209 there is one.
1210
2c38906f
ILT
1211 * layout.h (class Layout): Add added_eh_frame_data_ field.
1212 * layout.cc (Layout::Layout): Initialize new field.
1213 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
1214 output section until we find a section we merged successfully.
1215 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
1216 that the size be non-zero.
1217
780e49c5
ILT
1218 * merge.cc (Object_merge_map::get_output_offset): Remove inline
1219 qualifier.
1220
7fcd0256
ILT
12212008-04-08 Craig Silverstein <csilvers@google.com>
1222
1223 * configure.ac: Export new conditional variable HAVE_ZLIB.
1224 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
1225 on HAVE_ZLIB.
1226 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
1227 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1228
6835af53
ILT
12292008-04-07 Ian Lance Taylor <iant@google.com>
1230
e24f324c
ILT
1231 * version.cc (version_string): Set to "1.5".
1232
a036edd8
ILT
1233 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
1234 Add issued_non_pic_error_ field. Declare check_non_pic.
1235 (Target_x86_64::Scan::check_non_pic): New function.
1236 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
1237 (Target_x86_64::Scan::global): Likewise.
1238
624f8810
ILT
1239 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
1240 addend parameter. Change caller. Handle merge sections.
1241 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
1242 Address to Addend. Don't add in the result of
1243 local_section_offset, pass down the addend and use the returned
1244 value.
1245 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
1246 Update declarations of local_section_offset and symbol_value.
1247 * testsuite/two_file_test_1.cc (t18): New function.
1248 * testsuite/two_file_test_2.cc (f18): New function.
1249 * testsuite/two_file_test_main.cc (main): Call t18.
1250 * testsuite/two_file_test.h (t18, f18): Declare.
1251
6835af53
ILT
1252 * configure.ac: Don't test for objdump, c++filt, or readelf.
1253 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
1254 conditionals.
1255 (TEST_READELF): New variable.
1256 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
1257 (check_PROGRAMS): Add two_file_strip_test.
1258 (two_file_strip_test): New target.
1259 (check_PROGRAMS): Add two_file_same_shared_strip_test.
1260 (two_file_same_shared_strip_test_SOURCES): New variable.
1261 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
1262 (two_file_same_shared_strip_test_LDFLAGS): New variable.
1263 (two_file_same_shared_strip_test_LDADD): New variable.
1264 (two_file_shared_strip.so): New target.
1265 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
1266 (ver_test_5.syms, ver_test_7.syms): Likewise.
1267 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
1268 (strip_test_3.stdout): Use TEST_OBJDUMP.
1269 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1270
86925eef
CC
12712008-04-04 Cary Coutant <ccoutant@google.com>
1272
1273 * symtab.h (Symbol::is_weak_undefined): New function.
1274 (Symbol::is_strong_undefined): New function.
1275 (Symbol::is_absolute): New function.
1276 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
1277 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
1278 absolute symbols.
1279 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
1280 (weak_undef_test): New target.
1281 * testsuite/Makefile.in: Rebuild.
1282 * testsuite/weak_undef_file1.cc: New file.
1283 * testsuite/weak_undef_file2.cc: New file.
1284 * testsuite/weak_undef_test.cc: New file.
1285
126f3ece
ILT
12862008-04-03 Craig Silverstein <csilvers@google.com>
1287
1288 * compressed_output.h (class Output_compressed_section): Use
1289 unsigned buffer.
1290 * compressed_output.cc (zlib_compress): Use unsigned buffers,
1291 add zlib header.
1292 (zlib_compressed_suffix): Removed.
1293 (Output_compressed_section::set_final_data_size): Use unsigned
1294 buffers.
1295 * testsuite/Makefile.am (flagstest_compress_debug_sections):
1296 Fix linker invocation.
1297 (flagstest_o_specialfile_and_compress_debug_sections):
1298 Likewise.
1299 * testsuite/Makefile.in: Regenerated.
1300
deae2a14
DM
13012008-04-02 David S. Miller <davem@davemloft.net>
1302
1303 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
1304 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
1305
70752818
ILT
13062008-04-02 Craig Silverstein <csilvers@google.com>
1307
1308 * TODO: New file.
1309
39d0cb0e
ILT
13102008-04-02 Ian Lance Taylor <iant@google.com>
1311
1312 * fileread.cc (File_read::find_view): Add byteshift and vshifted
1313 parameters. Update for new key type to views_. Change all
1314 callers.
1315 (File_read::read): Adjust for byteshift in returned view.
1316 (File_read::add_view): New function, broken out of
1317 find_and_make_view.
1318 (File_read::make_view): New function, broken out of
1319 find_and_make_view.
1320 (File_read::find_or_make_view): Add offset and aligned
1321 parameters. Rewrite accordingly. Change all callers.
1322 (File_read::get_view): Add offset and aligned parameters. Adjust
1323 for byteshift in return value.
1324 (File_read::get_lasting_view): Likewise.
1325 * fileread.h (class File_read): Update declarations.
1326 (class File_read::View): Add byteshift_ field. Add byteshift to
1327 constructor. Add byteshift method.
1328 * archive.h (Archive::clear_uncached_views): New function.
1329 (Archive::get_view): Add aligned parameter. Change all callers.
1330 * object.h (Object::get_view): Add aligned parameter. Change all
1331 callers.
1332 (Object::get_lasting_view): Likewise.
1333
1334 * fileread.cc (File_read::release): Don't call clear_views if
1335 there are multiple objects.
1336 * fileread.h (File_read::clear_uncached_views): New function.
1337 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
1338 on the archive.
1339
a1207466
CC
13402008-03-31 Cary Coutant <ccoutant@google.com>
1341
1342 Add thin archive support.
1343 * archive.cc (Archive::armagt): New const.
1344 (Archive::setup): Remove task parameter and calls to unlock.
1345 (Archive::unlock_nested_archives): New function.
1346 (Archive::read_header): Add nested_off parameter. Change
1347 all callers.
1348 (Archive::interpret_header): Likewise.
1349 (Archive::include_all_members): Change to handle thin
1350 archives.
1351 (Archive::include_member): Likewise.
1352 * archive.h (Archive::Archive): Add new parameters and
1353 initializers.
1354 (Archive::armagt): New const.
1355 (Archive::setup): Remove task parameter.
1356 (Archive::unlock_nested_archives): New function.
1357 (Archive::read_header): Add nested_off parameter.
1358 (Archive::interpret_header): Likewise.
1359 (Archive::Nested_archive_table): New typedef.
1360 (Archive::is_thin_archive_): New field.
1361 (Archive::nested_archives_): New field.
1362 (Archive::options_): New field.
1363 (Archive::dirpath_): New field.
1364 (Archive::task_): New field.
1365 * readsyms.cc (Read_symbols::do_read_symbols): Add check
1366 for thin archives. Pass additional parameters to
1367 Archive::Archive. Unlock the archive file after calling
1368 Archive::setup.
1369
479f6503
ILT
13702008-03-29 Ian Lance Taylor <iant@google.com>
1371
686c8caf
ILT
1372 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
1373 version symbol to be local.
1374 * testsuite/ver_test_4.sh: New file.
1375 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
1376 (check_DATA): Add ver_test_4.syms.
1377 (ver_test_4.syms): New target.
1378 * testsuite/Makefile.in: Rebuild.
1379
ab794b6b
ILT
1380 * output.cc
1381 (Output_section::Input_section_sort_entry::has_priority): New
1382 function.
1383 (Output_section::Input_section_sort_entry::match_file_name): New
1384 function.
1385 (Output_section::Input_section_sort_entry::match_section_name):
1386 Remove.
1387 (Output_section::Input_section_sort_entry::match_section_name_prefix):
1388 Remove.
1389 (Output_section::Input_section_sort_entry::match_section_file):
1390 Remove.
1391 (Output_section::Input_section_sort_compare::operator()): Rewrite
1392 using new Input_section_sort_entry functions. Sort crtbegin and
1393 crtend first. Sort sections with no priority before sections with
1394 a priority.
1395 * testsuite/initpri1.c (d3): Check j != 4.
1396 (cd5): New constructor/destructor function.
1397 (main): Check j != 2.
1398
479f6503
ILT
1399 * symtab.cc (Symbol_table::add_from_object): If we don't use the
1400 new symbol when resolving, don't call set_is_default.
1401 * testsuite/ver_test_7.cc: New file.
1402 * testsuite/ver_test_7.sh: New file.
1403 * testsuite/Makefile.am (ver_test_7.so): New target.
1404 (ver_test_7.o): New target.
1405 (check_SCRIPTS): Add ver_test_7.sh.
1406 (check_DATA): Add ver_test_7.syms.
1407 (ver_test_7.syms): New target.
1408
2fd32231
ILT
14092008-03-28 Ian Lance Taylor <iant@google.com>
1410
1411 * layout.cc (Layout::layout): If we see an input section with a
1412 name that needs sorting, set the must_sort flag for the output
1413 section.
1414 (Layout::make_output_section): If the name of the output section
1415 indicates that it might require sorting, set the may_sort flag.
1416 * output.h (Output_section::may_sort_attached_input_sections): New
1417 function.
1418 (Output_section::set_may_sort_attached_input_sections): New
1419 function.
1420 (Output_section::must_sort_attached_input_sections): New
1421 function.
1422 (Output_section::set_must_sort_attached_input_sections): New
1423 function.
1424 (class Output_section): Declare Input_section_sort_entry. Define
1425 Input_section_sort_compare. Declare
1426 sort_attached_input_sections. Add new fields:
1427 may_sort_attached_input_sections_,
1428 must_sort_attached_input_sections_,
1429 attached_input_sections_are_sorted_.
1430 * output.cc (Output_section::Output_section): Initialize new
1431 fields.
1432 (Output_section::add_input_section): Add an entry to
1433 input_sections_ if may_sort or must_sort are true.
1434 (Output_section::set_final_data_size): Call
1435 sort_attached_input_sections if necessary.
1436 (Output_section::Input_section_sort_entry): Define new class.
1437 (Output_section::Input_section_sort_compare::operator()): New
1438 function.
1439 (Output_section::sort_attached_input_sections): New function.
1440 * configure.ac: Check whether the compiler supports constructor
1441 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
1442 * testsuite/initpri1.c: New file.
1443 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
1444 CONSTRUCTOR_PRIORITY.
1445 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
1446 (initpri1_LDFLAGS): New variable.
1447 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1448
18e6b24e
ILT
14492008-03-27 Ian Lance Taylor <iant@google.com>
1450
49bdd526
ILT
1451 * common.cc (Sort_commons::operator): Correct sorting algorithm.
1452 * testsuite/common_test_1.c: New file.
1453 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
1454 (common_test_1_SOURCES): New variable.
1455 (common_test_1_DEPENDENCIES): New variable.
1456 (common_test_1_LDFLAGS): New variable.
1457
18e6b24e
ILT
1458 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
1459 and commons_ correctly when NAME/VERSION does not override
1460 NAME/NULL.
1461 * testsuite/ver_test_6.c: New file.
1462 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
1463 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
1464 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
1465
04bf7072
ILT
14662008-03-26 Ian Lance Taylor <iant@google.com>
1467
5871526f
ILT
1468 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
1469 of an undefined symbol from a version script.
1470 * testsuite/Makefile.am (ver_test_5.so): New target.
1471 (ver_test_5.o): New target.
1472 (check_SCRIPTS): Add ver_test_5.sh.
1473 (check_DATA): Add ver_test_5.syms.
1474 (ver_test_5.syms): New target.
1475 * testsuite/ver_test_5.cc: New file.
1476 * testsuite/ver_test_5.script: New file.
1477 * testsuite/ver_test_5.sh: New file.
1478 * Makefile.in, testsuite/Makefile.in: Rebuild.
1479
04bf7072
ILT
1480 PR gold/5986
1481 Fix problems building gold with gcc 4.3.0.
1482 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
1483 (gold_error_at_location, gold_warning_at_location): Use it.
1484 * configure.ac: Check whether we can compile and use a template
1485 function with a printf attribute.
1486 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
1487 when jumping over bytes.
1488 * object.cc: Instantiate Object::read_section_data.
1489 * debug.h: Include <cstring>
1490 * dwarf_reader.cc: Include <algorithm>
1491 * main.cc: Include <cstring>.
1492 * options.cc: Include <cstring>.
1493 * output.cc: Include <cstring>.
1494 * script.cc: Include <cstring>.
1495 * script.h: Include <string>.
1496 * symtab.cc: Include <cstring> and <algorithm>.
1497 * target-select.cc: Include <cstring>.
1498 * version.cc: Include <string>.
1499 * testsuite/testmain.cc: Include <cstdlib>.
1500 * configure, config.in: Rebuild.
1501
874c5b28
ILT
15022008-03-25 Ian Lance Taylor <iant@google.com>
1503
819d6c3a
ILT
1504 * options.cc: Include "../bfd/bfdver.h".
1505 (options::help): Print bug reporting address.
1506
f4b2c6f5
ILT
1507 * version.cc (print_version): Adjust output for current value of
1508 BFD_VERSION_STRING.
1509
1510 * NEWS: New file.
1511
e96caa79
ILT
1512 * options.cc (options::help): Print list of supported targets.
1513 * target-select.h: Include <vector>.
1514 (class Target_selector): Make machine_, size_, and is_big_endian_
1515 fields const. Add bfd_name_ and instantiated_target_ fields.
1516 (Target_selector::Target_selector): Add bfd_name parameter.
1517 (Target_selector::recognize): Make non-virtual, call
1518 do_recognize.
1519 (Target_selector::recognize_by_name): Make non-virtual, call
1520 do_recognize_by_name.
1521 (Target_selector::supported_names): New function.
1522 (Target_selector::bfd_name): New function.
1523 (Target_selector::do_instantiate_target): New pure virtual
1524 function.
1525 (Target_selector::do_recognize): New virtual function.
1526 (Target_selector::do_recognize_by_name): New virtual function.
1527 (Target_selector::instantiate_target): New private function.
1528 (supported_target_names): Declare.
1529 * target-select.cc (Target_selector::Target_selector): Update for
1530 new parameter and fields.
1531 (select_target_by_name): Check that the name matches before
1532 calling recognize_by_name.
1533 (supported_target_names): New function.
1534 * i386.cc (class Target_selector_i386): Update Target_selector
1535 constructor call. Remove recognize and recognize_by_name. Add
1536 do_instantiate_target.
1537 * x86_64.cc (class Target_selector_x86_64): Likewise.
1538 * testsuite/testfile.cc (class Target_selector_test): Update for
1539 changes to Target_selector.
1540
874c5b28
ILT
1541 * README: Rewrite, with some notes on unsupported features.
1542
0a65a3a7
CC
15432008-03-24 Cary Coutant <ccoutant@google.com>
1544
1545 * i386.cc (Target_i386::Got_type): New enum declaration.
1546 (Target_i386::Scan::local): Updated callers of Output_data_got
1547 member functions.
1548 (Target_i386::Scan::global): Likewise.
1549 (Target_i386::Relocate::relocate): Likewise.
1550 (Target_i386::Relocate::relocate_tls): Likewise.
1551 * object.h (Got_offset_list): New class.
1552 (Sized_relobj::local_has_got_offset): Added got_type parameter.
1553 (Sized_relobj::local_got_offset): Likewise.
1554 (Sized_relobj::set_local_got_offset): Likewise.
1555 (Sized_relobj::local_has_tls_got_offset): Removed.
1556 (Sized_relobj::local_tls_got_offset): Removed.
1557 (Sized_relobj::set_local_tls_got_offset): Removed.
1558 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
1559 * output.cc (Output_data_got::add_global): Added got_type parameter.
1560 (Output_data_got::add_global_with_rel): Likewise.
1561 (Output_data_got::add_global_with_rela): Likewise.
1562 (Output_data_got::add_global_pair_with_rel): New function.
1563 (Output_data_got::add_global_pair_with_rela): New function.
1564 (Output_data_got::add_local): Added got_type parameter.
1565 (Output_data_got::add_local_with_rel): Likewise.
1566 (Output_data_got::add_local_with_rela): Likewise.
1567 (Output_data_got::add_local_pair_with_rel): New function.
1568 (Output_data_got::add_local_pair_with_rela): New function.
1569 (Output_data_got::add_global_tls): Removed.
1570 (Output_data_got::add_global_tls_with_rel): Removed.
1571 (Output_data_got::add_global_tls_with_rela): Removed.
1572 (Output_data_got::add_local_tls): Removed.
1573 (Output_data_got::add_local_tls_with_rel): Removed.
1574 (Output_data_got::add_local_tls_with_rela): Removed.
1575 * output.h (Output_data_got::add_global): Added got_type parameter.
1576 (Output_data_got::add_global_with_rel): Likewise.
1577 (Output_data_got::add_global_with_rela): Likewise.
1578 (Output_data_got::add_global_pair_with_rel): New function.
1579 (Output_data_got::add_global_pair_with_rela): New function.
1580 (Output_data_got::add_local): Added got_type parameter.
1581 (Output_data_got::add_local_with_rel): Likewise.
1582 (Output_data_got::add_local_with_rela): Likewise.
1583 (Output_data_got::add_local_pair_with_rel): New function.
1584 (Output_data_got::add_local_pair_with_rela): New function.
1585 (Output_data_got::add_global_tls): Removed.
1586 (Output_data_got::add_global_tls_with_rel): Removed.
1587 (Output_data_got::add_global_tls_with_rela): Removed.
1588 (Output_data_got::add_local_tls): Removed.
1589 (Output_data_got::add_local_tls_with_rel): Removed.
1590 (Output_data_got::add_local_tls_with_rela): Removed.
1591 * resolve.cc (Symbol::override_base_with_special): Removed
1592 reference to has_got_offset_ field.
1593 * symtab.cc (Symbol::init_fields): Replaced initialization
1594 of got_offset_ with got_offsets_. Removed initialization
1595 of has_got_offset_
53fcba31 1596 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
1597 (Symbol::got_offset): Likewise.
1598 (Symbol::set_got_offset): Likewise.
1599 (Symbol::has_tls_got_offset): Removed.
1600 (Symbol::tls_got_offset): Removed.
1601 (Symbol::set_tls_got_offset): Removed.
1602 (Symbol::got_offset_): Removed.
1603 (Symbol::tls_mod_got_offset_): Removed.
1604 (Symbol::tls_pair_got_offset_): Removed.
1605 (Symbol::got_offsets_): New field.
1606 (Symbol::has_got_offset): Removed.
1607 (Symbol::has_tls_mod_got_offset): Removed.
1608 (Symbol::has_tls_pair_got_offset): Removed.
1609 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
1610 (Target_x86_64::Scan::local): Updated callers of Output_data_got
1611 member functions.
1612 (Target_x86_64::Scan::global): Likewise.
1613 (Target_x86_64::Relocate::relocate): Likewise.
1614 (Target_x86_64::Relocate::relocate_tls): Likewise.
1615
bd52eafb
BE
16162008-03-25 Ben Elliston <bje@au.ibm.com>
1617
1618 * yyscript.y: Fix spelling error in comment.
1619
8b105e34
ILT
16202008-03-24 Ian Lance Taylor <iant@google.com>
1621
8ed814a9
ILT
1622 * options.h (class General_options): Define build_id option.
1623 * layout.h (class Layout): Declare write_build_id, create_note,
1624 create_build_id. Add build_id_note_ member.
1625 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
1626 "libiberty.h", "md5.h", "sha1.h".
1627 (Layout::Layout): Initialize eh_frame_data_,
1628 eh_frame_hdr_section_, and build_id_note_.
1629 (Layout::finalize): Call create_build_id.
1630 (Layout::create_note): New function, broken out of
1631 Layout::create_gold_note.
1632 (Layout::create_gold_note): Call create_note.
1633 (Layout::create_build_id): New function.
1634 (Layout::write_build_id): New function.
1635 (Close_task_runner::run): Call write_build_id.
1636
8b105e34
ILT
1637 * x86_64.cc: Correct license to GPLv3.
1638
086a1841
ILT
16392008-03-23 Ian Lance Taylor <iant@google.com>
1640
1641 * options.cc: Include "demangle.h".
1642 (parse_optional_string): New function.
1643 (parse_long_option): Handle takes_optional_argument.
1644 (parse_short_option): Update dash_z initializer. Handle
1645 takes_optional_argument.
1646 (General_options::General_options): Initialize do_demangle_.
1647 (General_options::finalize): Set do_demangle_. Handle demangling
1648 style.
1649 * options.h (parse_optional_string): Declare.
1650 (struct One_option): Add optional_arg field. Update constructor.
1651 Update call constructor calls. Add takes_optional_argument
1652 function.
1653 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
1654 (DEFINE_optional_string): Define.
1655 (General_options::demangle): Change from DEFINE_bool to
1656 DEFINE_optional_string.
1657 (General_options::no_demangle): New function.
1658 (General_options::do_demangle): New function.
1659 (General_options::set_do_demangle): New function.
1660 (General_options::execstack_status_): Move definition to end of
1661 class definition.
1662 (General_options::static_): Likewise.
1663 (General_options::do_demangle_): New field.
1664 * object.cc (big_endian>::get_symbol_location_info): Call
1665 Options::do_demangle, not Options::demangle.
1666 * symtab.cc (demangle): Likewise.
1667
cbb93e63
ILT
16682008-03-22 Ian Lance Taylor <iant@google.com>
1669
1670 * gold.h: Include <cstddef> and <sys/types.h>
1671 * options.h: Include <cstring>.
1672
ec531623
ILT
16732008-03-21 Ian Lance Taylor <iant@google.com>
1674
1675 * Added source code to GNU binutils.
1676
This page took 0.124816 seconds and 4 git commands to generate.