* options.h (General_options::output_is_executable): New.
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
183fd0e3
AO
12008-09-16 Alexandre Oliva <aoliva@redhat.com>
2
3 * options.h (General_options::output_is_executable): New.
4 (General_options::output_is_pie): New.
5 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
6 for shared libraries.
7 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
8
7be8330a
CD
92008-09-11 Chris Demetriou <cgd@google.com>
10
11 * options.h (origin): New -z option.
12 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
13 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
14 in DT_FLAGS_1.
15
a9caad02
CC
162008-09-05 Cary Coutant <ccoutant@google.com>
17
18 * fileread.cc (File_read::make_view): Add check for attempt to map
19 beyond end of file.
20
ae6dce4d
CC
212008-09-05 Cary Coutant <ccoutant@google.com>
22
23 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
24 explicit instantiations.
25
d7ab2a47
KVH
262008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
27
28 PR gold/6858
29 * options.cc (General_options::finalize): Allow undefined symbols
30 in shlibs if linking -shared.
31
32 PR gold/6859
33 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
34 symbols as not needing a dynsym entry.
35
1e52a9c1
CS
362008-08-20 Craig Silverstein <csilvers@google.com>
37
38 * fileread.cc (File_read::open): Do not lock the file unless it
39 was successfully opened.
40
d85c80a3
CC
412008-08-14 Cary Coutant <ccoutant@google.com>
42
43 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
44 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
45 * testsuite/tls_test.cc (struct int128): 128-bit struct
46 for testing TLS relocs with non-zero addend.
47 (v12): New TLS variable.
48 (t12): New test.
49 (t_last): Add check for v12.
50 * testsuite/tls_test.h (t12): New function.
51 * testsuite/tls_test_main.cc (thread_routine): Call new test.
52
2d924fd9
ILT
532008-08-13 Ian Lance Taylor <iant@google.com>
54
55 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
56 set tls_segment_ or relro_segment_.
57 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
58 when appropriate.
59 * output.h (Output_section::clear_is_relro): New function.
60 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
61 sections specially even when output_data_ is empty.
62 (Output_segment::maximum_alignment): When first section is relro,
63 only force alignment for PT_LOAD segments.
64 * script.cc (script_data_segment_align): New function.
65 (script_data_segment_relro_end): New function.
66 * script-c.h (script_data_segment_align): Declare.
67 (script_data_segment_relro_end): Declare.
68 * script-sections.h (class Script_sections): Declare
69 data_segment_align and data_segment_relro_end. Add fields
70 segment_align_index_ and saw_relro_end_.
71 * script-sections.cc (class Sections_element): Add set_is_relro
72 virtual function. Add new bool* parameter to place_orphan_here.
73 Add get_output_section virtual function.
74 (class Output_section_definition): Add set_is_relro. Add new
75 bool* parameter to place_orphan_here. Add get_output_section.
76 Add is_relro_ field.
77 (Output_section_definition::Output_section_definition): Initialize
78 evaluated_address_, evaluated_load_address, evaluated_addralign_,
79 and is_relro_ fields.
80 (Output_section_definition::place_orphan_here): Add is_relro
81 parameter.
82 (Output_section_definition::set_section_addresses): Set relro for
83 output section.
84 (Output_section_definition::alternate_constraint): Likewise.
85 (class Orphan_output_section): Add new bool* parameter to
86 place_orphan_here. Add get_output_section.
87 (Orphan_output_section::place_orphan_here): Add is_relro
88 parameter.
89 (Script_sections::Script_sections): Initialize
90 data_segment_align_index_ and saw_relro_end_.
91 (Script_sections::data_segment_align): New function.
92 (Script_sections::data_segment_relro_end): New function.
93 (Script_sections::place_orphan): Set or clear is_relro.
94 (Script_sections::set_section_addresses): Force alignment of first
95 TLS section.
96 * yyscript.y (exp): Call script_data_segment_align and
97 script_data_segment_relro_end.
98 * testsuite/relro_script_test.t: New file.
99 * testsuite/relro_test.cc (using_script): Declare.
100 (t1, t2): Test using_script.
101 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
102 (relro_script_test_SOURCES): Define.
103 (relro_script_test_DEPENDENCIES): Define.
104 (relro_script_test_LDFLAGS): Define.
105 (relro_script_test_LDADD): Define.
106 (relro_script_test.so): New target.
107 * testsuite/Makefile.in: Rebuild.
108
f827c9a9
CC
1092008-08-06 Cary Coutant <ccoutant@google.com>
110
111 * archive.cc (Archive::total_archives, Archive::total_members)
112 (Archive::total_members_loaded): New variables.
113 (Archive::setup): Add parameter. Add option to preread
114 archive symbols.
115 (Archive::read_armap): Add counter.
116 (Archive::get_file_and_offset): New function.
117 (Archive::get_elf_object_for_member): New function.
118 (Archive::read_all_symbols): New function.
119 (Archive::read_symbols): New function.
120 (Archive::add_symbols): Add counters.
121 (Archive::include_all_members): Use armap to find members if it's
122 already built.
123 (Archive::include_member): Skip reading symbols if already read.
124 Factored code into Archive::get_file_and_offset and
125 Archive::get_elf_object_for_member. Changed call to
126 Mapfile::report_include_archive_member.
127 (Archive::print_stats): New function.
128 * archive.h: Declare Object and Read_symbols_data classes.
129 (Archive::Archive): Add initializers for new members.
130 (Archive::setup): Add parameter.
131 (Archive::print_stats): New function.
132 (Archive::total_archives, Archive::total_members)
133 (Archive::total_members_loaded): New variables.
134 (Archive::get_file_and_offset): New function.
135 (Archive::get_elf_object_for_member): New function.
136 (Archive::read_all_symbols): New function.
137 (Archive::read_symbols): New function.
138 (Archive::Archive_member): New class.
139 (Archive::members_): New member.
140 (Archive::num_members_): New member.
141 * main.cc: Include archive.h.
142 (main): Call Archive::print_stats.
143 * mapfile.cc (Mapfile::report_include_archive_member): Delete
144 archive parameter; member_name is now the fully-decorated name.
145 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
146 * options.h: (General_options): Add --preread-archive-symbols option.
147 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
148 Archive::setup.
149
de4c45bd
ILT
1502008-08-04 Ian Lance Taylor <iant@google.com>
151
152 * symtab.h (Symbol::use_plt_offset): New function.
153 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
154 * powerpc.cc (Relocate::relocate): Likewise.
155 * sparc.cc (Relocate::relocate): Likewise.
156 * x86_64.cc (Relocate::relocate): Likewise.
157 * testsuite/weak_plt.sh: New test.
158 * testsuite/weak_plt_main.cc: New test.
159 * testsuite/weak_plt_shared.cc: New test.
160 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
161 (check_PROGRAMS): Add weak_plt.
162 (check_DATA): Add weak_plt_shared.so.
163 (weak_plt_main_pic.o, weak_plt): New targets.
164 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
165 * testsuite/Makefile.in: Rebuild.
166
167 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
168 gcctestdir/ld.
169 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
170 * testsuite/Makefile.in: Rebuild.
171
323ee3f4
AM
1722008-08-04 Alan Modra <amodra@bigpond.net.au>
173
174 * Makefile.am (POTFILES.in): Set LC_ALL=C.
175 * Makefile.in: Regenerate.
176 * po/POTFILES.in: Regenerate.
177
7c07ecec
ILT
1782008-07-29 Ian Lance Taylor <iant@google.com>
179
180 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
181 symbols before other symbols.
182 * testsuite/script_test_2.cc (test_addr): Declare.
183 (test_addr_alias): Declare.
184 (main): Check that test_addr and test_addr_alias have the right
185 values.
186 * testsuite/script_test_2.t: Define test_addr_alias and
187 test_addr.
188
5778530e
ILT
1892008-07-24 Ian Lance Taylor <iant@google.com>
190
2a00e4fb
ILT
191 PR 5990
192 * descriptors.cc: New file.
193 * descriptors.h: New file.
194 * gold-threads.h (class Hold_optional_lock): New class.
195 * fileread.cc: Include "descriptors.h".
196 (File_read::~File_read): Release descriptor rather than closing
197 it.
198 (File_read::open) [file]: Call open_descriptor rather than open.
199 Set is_descriptor_opened_.
200 (File_read::open) [memory]: Assert that descriptor is not open.
201 (File_read::reopen_descriptor): New function.
202 (File_read::release): Release descriptor.
203 (File_read::do_read): Make non-const. Reopen descriptor.
204 (File_read::read): Make non-const.
205 (File_read::make_view): Reopen descriptor.
206 (File_read::do_readv): Likewise.
207 * fileread.h (class File_read): Add is_descriptor_opened_ field.
208 Update declarations.
209 * layout.cc: Include "descriptors.h".
210 (Layout::create_build_id): Use open_descriptor rather than open.
211 * output.cc: Include "descriptors.h".
212 (Output_file::open): Use open_descriptor rather than open.
213 * archive.cc (Archive::const_iterator): Change Archive to be
214 non-const.
215 (Archive::begin, Archive::end): Make non-const.
216 (Archive::count_members): Likewise.
217 * archive.h (class Archive): Update declarations.
218 * object.h (Object::read): Make non-const.
219 * Makefile.am (CCFILES): Add descriptors.cc.
220 (HFILES): Add descriptors.h.
221 * Makefile.in: Rebuild.
222
801647d1
ILT
223 PR 6716
224 * gold.h: Always include <clocale>. Add Solaris workarounds
225 following code in binutils/sysdep.h.
226
5edd166e
ILT
227 PR 6048
228 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
229 this->eh_frame_hdr_ is NULL before using it.
230
c89ad728
ILT
231 * dynobj.cc (Versions::Versions): Update comment.
232
aa86f06b
ILT
233 * dynobj.cc (Versions::Versions): If there is an soname, use it as
234 the base version name.
235
5778530e
ILT
236 * stringpool.cc (Stringpool_template::add_with_length): Set key to
237 array size plus one.
238 (Stringpool_template::set_string_offsets): Subtract one from key
239 before using it as an array index.
240 (Stringpool_template::get_offset_with_length): Likewise.
241 (Stringpool_template::write_to_buffer): Likewise.
242 * stringpool.h (Stringpool_template::get_offset_from_key):
243 Likewise.
244
057ead22
ILT
2452008-07-23 Ian Lance Taylor <iant@google.com>
246
7f649c59
ILT
247 PR 6658
248 * object.h (Merged_symbol_value::value): Do our best to handle a
249 negative addend.
250
057ead22
ILT
251 PR 6647
252 * script.cc (Version_script_info::get_versions): Don't add empty
253 version tag to return value.
254 (Version_script_info::get_symbol_version_helper): Change return
255 type to bool. Add pversion parameter. Change all callers.
256 (script_register_vers_node): Don't require a non-NULL tag.
257 * script.h (class Version_script_info): Update declarations.
258 (Version_script_info::get_symbol_version): Change return type to
259 bool. Add version parameter. Change all callers.
260 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
261 handling. Handle an empty version from a version script.
262 (Symbol_table::define_special_symbol): Likewise.
263 * testsuite/ver_test_10.script: New file.
264 * testsuite/ver_test_10.sh: New file.
265 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
266 (check_DATA): Add ver_test_10.syms.
267 (ver_test_10.syms, ver_test_10.so): New target.
268 * testsuite/Makefile.in: Rebuild.
269
58e54ac2
CD
2702008-07-23 Simon Baldwin <simonb@google.com>
271
272 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
273 to zero for undefined symbols from dynamic libraries.
274
95d14cd3
ILT
2752008-07-23 Ian Lance Taylor <iant@google.com>
276
277 * symtab.cc (Symbol_table::resolve): Remove version parameter.
278 Change all callers.
279 * symtab.h (class Symbol_table): Update declaration.
280 * testsuite/ver_test_9.cc: New file.
281 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
282 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
283 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
284 (ver_test_9.so, ver_test_9.o): New targets.
285 * testsuite/Makefile.in: Rebuild.
286
92de84a6
ILT
2872008-07-22 Ian Lance Taylor <iant@google.com>
288
34810851
ILT
289 * options.h (class General_options): Define --check-sections.
290 * layout.cc (Layout::set_segment_offsets): Handle
291 --check-sections.
292
af6156ef
ILT
293 * options.h (class General_options): Define -n/--nmagic and
294 -N/--omagic.
295 * options.cc (General_options::finalize): For -n/--nmagic or
296 -N/--omagic, set -static.
297 * layout.cc (Layout::attach_allocated_section_to_segment): If
298 -N/--omagic, don't put read-only and read-write sections in
299 different segments.
300 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
301 finding a read-only segment.
302 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
303 don't set the minimum segment alignment to the common page size,
304 and don't set the file offset to the address modulo the page size.
305 * script-sections.cc (Script_sections::create_segments): If
306 -n/--omagic, don't put read-only and read-write sections in
307 different segments.
308
92de84a6
ILT
309 * cref.cc: New file.
310 * cref.h: New file.
311 * options.h (class General_options): Add --print-symbol-counts.
312 * main.cc (main): Issue defined symbol report if requested.
313 * archive.cc (Archive::interpret_header): Make into a const member
314 function.
315 (Archive::add_symbols): Call Input_objects::archive_start and
316 archive_stop.
317 (Archive::const_iterator): Define new class.
318 (Archive::begin, Archive::end): New functions.
319 (Archive::include_all_members): Rewrite to use iterator.
320 (Archive::count_members): New function.
321 * archive.h (class Archive): Update declarations.
322 (Archive::filename): New function.
323 * object.cc: Include "cref.h".
324 (Sized_relobj::Sized_relobj): Initialize defined_count_.
325 (Sized_relobj::do_get_global_symbol_counts): New function.
326 (Input_objects::add_object): Add object to cross-referencer.
327 (Input_objects::archive_start): New function.
328 (Input_objects::archive_stop): New function.
329 (Input_objects::print_symbol_counts): New function.
330 * object.h: Declare Cref and Archive.
331 (Object::get_global_symbol_counts): New function.
332 (Object::do_get_global_symbol_counts): New pure virtual function.
333 (class Sized_relobj): Add defined_count_ field. Update
334 declarations.
335 (class Input_objects): Add cref_ field. Update constructor.
336 Update declarations.
337 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
338 defined_count_.
339 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
340 symbol counts.
341 (Sized_dynobj::do_get_global_symbol_counts): New function.
342 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
343 defined_count_. Update declarations. Define Symbols typedef.
344 * symtab.cc (Symbol_table::add_from_relobj): Add defined
345 parameter. Change all callers.
346 (Symbol_table::add_from_dynobj): Add sympointers and defined
347 parameters. Change all callers.
348 * symtab.h (class Symbol_table): Update declarations.
349 * Makefile.am (CCFILES): Add cref.cc.
350 (HFILES): Add cref.h.
351 * Makefile.in: Rebuild.
352
3f7c5e1d
CD
3532008-07-22 Simon Baldwin <simonb@google.com>
354
355 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
356 to zero when writing undefined symbols.
357
e0b64032
ILT
3582008-07-22 Ian Lance Taylor <iant@google.com>
359
360 * output.cc (Output_section::add_input_section): Don't try to
361 merge empty merge sections.
362
096b02cf
CS
3632008-07-21 Craig Silverstein <csilvers@google.com>
364
365 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
366 Include symbol version in error message.
367
1d1f116d
CD
3682008-07-20 Chris Demetriou <cgd@google.com>
369
370 * configure.ac (gold_cv_c_random_seed): New configured variable.
371 (RANDOM_SEED_CFLAGS): New substituted variable.
372 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
373 * configure: Rebuild.
374 * Makefile.in: Likewise.
375 * testsuite/Makefile.in: Likewise.
376
a18f591e
ILT
3772008-07-18 Ian Lance Taylor <iant@google.com>
378
379 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
380 where we see NAME/NULL and NAME/VERSION as separate symbols.
381 * testsuite/ver_test_main.cc (main): Call t4.
382 (t4, t4_2a): Define.
383 * testsuite/ver_test_2.cc (t4_2): Define.
384 * testsuite/ver_test_2.script: Put t4_2a in VER2.
385 * testsuite/ver_test_4.cc (t4_2a): Define.
386 * testsuite/ver_test_4.script: Put t4_2a in VER2.
387 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
388
c6e3f6ed
ILT
3892008-07-17 Ian Lance Taylor <iant@google.com>
390
391 * dynobj.cc (Versions::add_def): If we give an error about a
392 missing version, go ahead and create the version anyhow.
393
ef9beddf
ILT
3942008-07-10 Ian Lance Taylor <iant@google.com>
395
396 Handle output sections with more than 0x7fffffff bytes.
397 * object.h (class Relobj): Change map_to_output_ to
398 output_sections_, and just keep a section pointer. Change all
399 uses. Move comdat group support to Sized_relobj.
400 (Relobj::is_section_specially_mapped): Remove.
401 (Relobj::output_section): Remove poff parameter. Change all
402 callers.
403 (Relobj::output_section_offset): New function.
404 (Relobj::set_section_offset): Rewrite.
405 (Relobj::map_to_output): Remove.
406 (Relobj::output_sections): New function.
407 (Relobj::do_output_section_offset): New pure virtual function.
408 (Relobj::do_set_section_offset): Likewise.
409 (class Sized_relobj): Add section_offsets_ field. Add comdat
410 group support from Relobj. Update declarations.
411 (Sized_relobj::get_output_section_offset): New function.
412 (Sized_relobj::do_output_section_offset): New function.
413 (Sized_relobj::do_set_section_offset): New function.
414 * object.cc (Relobj::output_section_address): Remove.
415 (Sized_relobj::Sized_relobj): Initialize new fields.
416 (Sized_relobj::include_section_group): Cast find_kept_object to
417 Sized_relobj.
418 (Sized_relobj::include_linkonce_section): Likewise.
419 (Sized_relobj::do_layout): Use separate arrays for output section
420 and output offset.
421 (Sized_relobj::do_count_local_symbols): Change map_to_output to
422 output_sections.
423 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
424 output_sections and section_offsets.
425 (Sized_relobj::write_local_symbols): Likewise.
426 (map_to_kept_section): Compute output address directly.
427 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
428 output_sections and section_offsets.
429 (Sized_relobj::write_sections): Likewise.
430 (Sized_relobj::relocate_sections): Likewise.
431 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
432 * output.h (class Output_reloc): Update declarations. Change
433 u2_.relobj to Sized_relobj*.
434 (class Output_data_reloc): Change add functions to use
435 Sized_relobj*.
436 * output.cc (Output_reloc::Output_reloc): Change relobj to
437 Sized_relobj*.
438 (Output_reloc::local_section_offset): Change return type to
439 Elf_Addr. Use get_output_section_offset.
440 (Output_reloc::get_address): Likewise.
441 (Output_section::is_input_address_mapped): Don't call
442 is_section_specially_mapped.
443 (Output_section::output_offset): Likewise.
444 (Output_section::output_address): Likewise.
445 (Output_section::starting_output_address): Likewise.
446 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
447 parameter to Sized_relobj*.
448 (Copy_relocs::need_copy_reloc): Likewise.
449 (Copy_relocs::save): Likewise.
450 * copy-relocs.h (class Copy_relocs): Update declarations.
451 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
452 Sized_relobj*. Change relobj_ field to Sized_relobj*.
453 * target-reloc.h (relocate_for_relocatable): Change
454 offset_in_output_section type to Elf_Addr. Change code that uses
455 it as well.
456 * layout.cc (Layout::layout): Always set *off.
457 * mapfile.cc (Mapfile::print_input_section): Use
458 output_section_offset.
459 * i386.cc (Target_i386::copy_reloc): Change object parameter to
460 Sized_relobj*.
461 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
462 * sparc.cc (Target_sparc::copy_reloc): Likewise.
463 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
464
5cb66f97
ILT
4652008-07-03 Ian Lance Taylor <iant@google.com>
466
467 * layout.cc (Layout::include_section): Do not discard unrecognized
468 SHT_STRTAB sections.
469
afe47622
CS
4702008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
471
472 * script.cc (Lex::can_continue_name): Make '?' allowable in
473 version-script names.
474 * testsuite/version_script.map: Change glob pattern to use '?'
475
5adf9721
ILT
4762008-06-30 Manish Singh <yosh@gimp.org>
477
478 PR 6585
479 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
480 Correct typo.
481
e6fde208
ILT
4822008-06-30 Ian Lance Taylor <iant@google.com>
483
484 PR 6660
485 PR 6682
486 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
487 versions]: Don't try to read the value in the contents, since we
488 don't use it. Use the template endianness when writing.
489
3f2e6a2d
CC
4902008-06-25 Cary Coutant <ccoutant@google.com>
491
492 * fileread.cc (File_read::make_view): Assert on zero-length view.
493 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
494 symbol table when there are no symbols to read.
495
c43d3a48
CS
4962008-06-23 Craig Silverstein <csilvers@google.com>
497
498 * version.cc (version_string): Bump to 1.7
499
5f494ea0
CS
5002008-06-18 Craig Silverstein <csilvers@google.com>
501
502 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
503 constant 0xFFFF to type Valtype.
504 (Powerpc_relocate_functions::rel16_ha): Likewise.
505
c42e122e
ILT
5062008-06-17 Ian Lance Taylor <iant@google.com>
507
f34787f8
ILT
508 * output.h (Output_section::Input_section): Initialize p2align_ to
509 zero for Output_section_data constructors.
510 (Output_section::Input_section::addralign): If not an input
511 section, return the alignment of the Output_section_data.
512 * testsuite/copy_test.cc: New file.
513 * testsuite/copy_test_1.cc: New file.
514 * testsuite/copy_test_2.cc: New file.
515 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
516 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
517 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
518 (copy_test_1_pic.o, copy_test_1.so): New targets.
519 (copy_test_2_pic.o, copy_test_2.so): New targets.
520 * testsuite/Makefile.in: Rebuild.
521
c42e122e
ILT
522 * script-sections.cc (Script_sections::place_orphan): Initialize
523 local variable exact.
524
ce3ac18a
DE
5252008-06-13 David Edelsohn <edelsohn@gnu.org>
526
527 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
528
42cacb20
DE
5292008-06-12 David Edelsohn <edelsohn@gnu.org>
530 David S. Miller <davem@davemloft.net>
531
532 * powerpc.cc: New file.
533 * Makefile.am (TARGETSOURCES): Add powerpc.cc
534 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
535 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
536 * Makefile.in: Rebuild.
537
7b308235
ILT
5382008-06-09 Ian Lance Taylor <iant@google.com>
539
540 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
541 <exception>.
542 (throwing, orig_terminate): New static variables.
543 (terminate_handler): New static function.
544 (t2): Set terminate handler.
545
f0b886e3
ILT
5462008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
547
548 PR 6584
549 * binary.cc (Binary_to_elf::sized_convert): Fix .data
550 alignment.
551
3e90f135
CC
5522008-05-30 Cary Coutant <ccoutant@google.com>
553
554 * archive.cc (Archive::include_all_members) Correct to step
555 over symbol table and extended name table in thin archives.
556
e09ad04a
ILT
5572008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
558
559 PR 6407
560 * target-reloc.h (relocate_for_relocatable): Fix new_offset
561 calculation.
562
62b01cb5
ILT
5632008-05-28 Caleb Howe <cshowe@google.com>
564
565 * reduced_debug_output.cc: New file.
566 * reduced_debug_output.h: New file.
92de84a6 567 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
568 * options.cc (General_options::finalize): Add strip_debug_non_line
569 to the strip heirarchy.
570 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
571 fields.
572 * layout.cc: Include "reduced_debug_output.h".
573 (Layout::Layout): Initialize new fields.
574 (line_only_debug_sections): New static array.
575 (is_lines_only_debug_sections): New static inline function.
576 (Layout::include_section): Handle --strip-debug-non-line.
577 (Layout::make_output_section): If --strip-debug-non-line, build
578 new output sections for .debug_abbrev and .debug_info.
579 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
580 gold. Warn about possible overflow.
581 (read_signed_LEB_128): Likewise.
582 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
583 (read_signed_LEB_128): Declare.
584 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
585 (HFILES): Add reduced_debug_output.h.
586 * Makefile.in: Rebuild.
587
7d9e3d98
ILT
5882008-05-21 Ian Lance Taylor <iant@google.com>
589
590 * mapfile.cc: New file.
591 * mapfile.h: New file.
592 * options.h (class General_options): Add -M/--print-map and -Map.
593 * options.cc (General_options::finalize): Make -M equivalent to
594 -Map -.
595 * main.cc: Include <cstdio> and "mapfile.h".
596 (main): Open mapfile if requested.
597 * gold.cc (class Middle_runner): Add mapfile_ field. Update
598 constructor. Change caller.
599 (queue_initial_tasks): Add mapfile parameter. Change caller.
600 (queue_middle_tasks): Likewise.
601 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
602 declarations.
603 * archive.cc: Include "mapfile.h".
604 (Archive::add_symbols): Add mapfile parameter. Change all
605 callers. Pass mapfile, symbol, and reason to include_member.
606 (Archive::include_all_members): Add mapfile parameter. Change all
607 callers.
608 (Archive::include_member): Add mapfile, sym, and why parameters.
609 Change all callers. Report inclusion to map file.
610 * archive.h: Include "fileread.h".
611 (class Archive): Update declarations.
612 (Archive::file): New const method.
613 (class Add_archive_symbols): Add mapfile_ field. Update
614 constructor. Change all callers.
615 * readsyms.h (class Read_symbols): Likewise.
616 (class Finish_group): Likewise.
617 (class Read_script): Likewise.
618 * common.cc: Include "mapfile.h".
619 (Symbol_table::allocate_commons): Add mapfile parameter. Change
620 all callers.
621 (Symbol_table::do_allocate_commons): Likewise.
622 (Symbol_table::do_allocate_commons_list): Likewise. Report common
623 symbol allocation to mapfile.
624 * common.h (class Allocate_commons_task): Add mapfile_ field.
625 Update constructor. Change all callers.
626 * symtab.h (class Symbol_table): Update declarations.
627 * layout.cc: Include "mapfile.h".
628 (Layout_task_runner::run): Print information to mapfile.
629 (Layout::create_gold_note): Change Output_data_fixed_space to
630 Output_data_zero_fill.
631 (Layout::create_build_id): Likewise.
632 (Layout::print_to_mapfile): New function.
633 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
634 constructor. Change caller.
635 (class Layout): Declare print_to_mapfile.
636 * output.cc (Output_section::Input_section::print_to_mapfile): New
637 function.
638 (Output_section::add_input_section): If producing a map, always
639 add to input_sections_ list.
640 (Output_section::do_print_to_mapfile): New function.
641 (Output_segment::print_sections_to_mapfile): New function.
642 (Output_segment::print_section_list_to_mapfile): New function.
643 * output.h: Include "mapfile.h".
644 (Output_data::print_to_mapfile): New function.
645 (Output_data::do_print_to_mapfile): New virtual function.
646 (Output_segment_headers::do_print_to_mapfile): New function.
647 (Output_file_header::do_print_to_mapfile): New function.
648 (Output_data_const::do_print_to_mapfile): New function.
649 (class Output_data_const_buffer): Add map_name_ field. Update
650 constructor. Change all callers. Add do_print_to_mapfile
651 function.
652 (class Output_data_fixed_space): Likewise.
653 (class Output_data_space): Likewise.
654 (class Output_data_zero_fill): New class.
655 (Output_data_strtab::do_print_to_mapfile): New function.
656 (Output_data_reloc_base::do_print_to_mapfile): New function.
657 (Output_relocatable_relocs::do_print_to_mapfile): New function.
658 (Output_data_group::do_print_to_mapfile): New function.
659 (Output_data_got::do_print_to_mapfile): New function.
660 (Output_data_dynamic::do_print_to_mapfile): New function.
661 (Output_symtab_xindex::do_print_to_mapfile): New function.
662 (class Output_section): Declare do_print_to_mapflie. Declare
663 print_to_mapfile in Input_section.
664 (class Output_segment): Declare new functions.
665 * object.h (Sized_relobj::symbol_count): New function.
666 * script-sections.cc
667 (Output_section_element_dot_assignment::set_section_addresses):
668 Change Output_data_fixed_space to Output_data_zero_fill.
669 (Output_data_expression::do_print_to_mapfile): New function.
670 * script.cc (read_input_script): Add mapfile parameter. Change
671 all callers.
672 * script.h (read_input_script): Update declaration.
673 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
674 (Eh_frame::do_print_to_mapfile): New function.
675 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
676 (Output_merge_string::do_print_to_mapfile): New function.
677 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
678 function.
679 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
680 function.
681 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
682 function.
683 * Makefile.am (CCFILES): Add mapfile.cc.
684 (HFILES): Add mapfile.h.
685 * Makefile.in: Rebuild.
686
9f1d377b
ILT
6872008-05-19 Ian Lance Taylor <iant@google.com>
688
689 * options.h (class General_options): Add -z relro.
690 * layout.cc (Layout::Layout): Initialize relro_segment_.
691 (Layout::add_output_section_data): Return the output section.
692 (Layout::make_output_section): Rcognize relro sections and mark
693 them appropriately.
694 (Layout::attach_allocated_section_to_segment): Put relro sections
695 in a PT_GNU_RELRO segment.
696 (Layout::create_initial_dynamic_sections): Mark the .dynamic
697 section as relro.
698 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
699 PT_TLS segments.
700 (Layout::linkonce_mapping): Map d.rel.ro.local to
701 .data.rel.ro.local.
702 (Layout::output_section_name): Us .data.rel.ro.local for any
703 section which begins with that.
704 * layout.h (class Layout): Update add_output_section_data
705 declaration. Add relro_segment_ field.
706 * output.cc (Output_section::Output_section): Initialize is_relro_
707 and is_relro_local_ fields.
708 (Output_segment::add_output_section): Group relro sections.
709 (Output_segment::is_first_section_relro): New function.
710 (Output_segment::maximum_alignment): If there is a relro section,
711 align the segment to the common page size.
712 (Output_segment::set_section_addresses): Track whether we are
713 looking at relro sections. If the last section is a relro
714 section, align to the common page size.
715 (Output_segment::set_section_list_addresses): Add in_relro
716 parameter. Change all callers. Align to the page size when
717 moving from relro to non-relro section.
718 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
719 segment.
720 * output.h (class Output_section): Add is_relro_ and
721 is_relro_local_ fields.
722 (Output_section::is_relro): New function.
723 (Output_section::set_is_relro): New function.
724 (Output_section::is_relro_local): New function.
725 (Output_section::set_is_relro_local): New function.
726 (class Output_segment): Update declarations.
727 * i386.cc (Target_i386::got_section): Mark .got section as relro.
728 * sparc.cc (Target_sparc::got_section): Likewise.
729 * x86_64.cc (Target_x86_64::got_section): Likewise.
730 * testsuite/relro_test_main.cc: New file.
731 * testsuite/relro_test.cc: New file.
732 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
733 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
734 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
735 (relro_test.so, relro_test_pic.o): New targets.
736 * testsuite/Makefile.in: Rebuild.
737
a984ee1d
ILT
7382008-05-16 Ian Lance Taylor <iant@google.com>
739
01676dcd
ILT
740 * output.cc (Output_segment::add_output_section): Remove front
741 parameter.
742 * output.h (class Output_segment): Remove
743 add_initial_output_section and overloaded add_output_section.
744 Update declaration of remaining add_output_section.
745 * layout.cc (Layout::create_interp): Call add_output_section
746 rather than add_initial_output_section.
747 (Layout::finish_dynamic_section): Likewise.
748
497897f9
ILT
749 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
750 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
751 know the dynamic type.
752 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
753 field. Initialize it in constructor.
754 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
755 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
756 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
757 reloc.
758
a984ee1d
ILT
759 * output.cc (Output_reloc::get_address): Change return type to
760 Elf_Addr.
761 * output.h (class Output_reloc): Update get_address declaration.
762 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
763 for section addresses.
764
55ba0940
ILT
7652008-05-09 Ian Lance Taylor <iant@google.com>
766
767 PR 6493
768 * gold.cc (gold_nomem): Use return value of write.
769
75517b77
ILT
7702008-05-08 Ian Lance Taylor <iant@google.com>
771
772 * symtab.c (Symbol::init_base_output_data): Add version
773 parameter. Change all callers.
774 (Symbol::init_base_output_segment): Likewise.
775 (Symbol::init_base_constant): Likewise.
776 (Symbol::init_base_undefined): Likewise.
777 (Sized_symbol::init_output_data): Likewise.
778 (Sized_symbol::init_output_segment): Likewise.
779 (Sized_symbol::init_constant): Likewise.
780 (Sized_symbol::init_undefined): Likewise.
781 (Symbol_table::do_define_in_output_data): If the new symbol has a
782 version, mark it as the default.
783 (Symbol_table::do_define_in_output_segment): Likewise.
784 (Symbol_table::do_define_as_constant): Likewise.
785 * symtab.h (class Symbol): Update declarations.
786 (class Sized_symbol): Likewise.
787 * resolve.cc (Symbol::override_version): New function.
c42e122e 788 (Symbol::override_base): Call override_version.
75517b77
ILT
789 (Symbol::override_base_with_special): Likewise.
790 * testsuite/ver_script_8.script: New file.
791 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
792 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
793 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
794 (ver_test_8_1.so, ver_test_8_2.so): New targets.
795
f1f70eae
ILT
7962008-05-06 Ian Lance Taylor <iant@google.com>
797
f3e9c5c5
ILT
798 PR 6049
799 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
800 functions.
801 (class General_options): Remove existing --undefined, and add
802 --no-undefined instead. Add new --undefined as synonym for -u.
803 * archive.cc (Archive::add_symbols): Check whether symbol was
804 named with -u.
805 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
806 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
807 all uses. Add IS_UNDEFINED. Update declarations to split
808 different versions of init_base. Declare init_base_undefined.
809 (Symbol::is_defined): Handle IS_UNDEFINED.
810 (Symbol::is_undefined): Likewise.
811 (Symbol::is_weak_undefined): Call is_undefined.
812 (Symbol::is_absolute): Handle IS_CONSTANT.
813 (class Sized_symbol): Update declarations to split different
814 versions of init. Declare init_undefined.
815 (class Symbol_table): Declare new functions.
816 * symtab.cc (Symbol::init_base_object): Rename from init_base.
817 Change all callers.
818 (Symbol::init_base_output_data): Likewise.
819 (Symbol::init_base_output_segment): Likewise.
820 (Symbol::init_base_constant): Likewise.
821 (Symbol::init_base_undefined): New function.
822 (Sized_symbol::init_object): Rename from init. Change all
823 callers.
824 (Sized_symbol::init_output_data): Likewise.
825 (Sized_symbol::init_output_segment): Likewise.
826 (Sized_symbol::init_constant): Likewise.
827 (Sized_symbol::init_undefined): New function.
828 (Symbol_table::add_undefined_symbols_from_command_line): New
829 function.
830 (Symbol_table::do_add_undefined_symbols_from_command_line): New
831 function.
832 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
833 (Symbol::output_section): Likewise.
834 (Symbol::set_output_section): Likewise.
835 (Symbol_table::sized_finalize_symbol): Likewise.
836 (Symbol_table::sized_write_globals): Likewise.
837 * resolve.cc (Symbol_table::should_override): Likewise.
838 (Symbol::override_base_with_special): Likewise.
839
8bdcdf2c
ILT
840 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
841 symbol, change it to have default visibility.
842 * testsuite/protected_1.cc: New file.
843 * testsuite/protected_2.cc: New file.
844 * testsuite/protected_3.cc: New file.
845 * testsuite/protected_main_1.cc: New file.
846 * testsuite/protected_main_2.cc: New file.
847 * testsuite/protected_main_3.cc: New file.
848 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
849 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
850 (protected_1_LDFLAGS, protected_1_LDADD): Define.
851 (protected_1.so): New target.
852 (protected_1_pic.o, protected_2_pic.o): New targets.
853 (protected_3_pic.o): New target.
854 (check_PROGRAMS): Add protected_2.
855 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
856 (protected_2_LDFLAGS, protected_2_LDADD): Define.
857 * testsuite/Makefile.in: Rebuild.
858
2b706932
ILT
859 * options.h (DEFINE_var): Add set_user_set_##varname__.
860 (DEFINE_bool_alias): New macro.
861 (class General_options): Define -Bstatic using DEFINE_bool_alias
862 rather than DEFINE_special. Add --undefined as an alias for -z
863 defs.
864 * options.cc (General_options::parse_Bstatic): Remove.
865
d82a5bcc
ILT
866 * options.h (class General_options): Add --fatal-warnings.
867 * main.cc (main): Implement --fatal-warnings.
868 * errors.h (Errors::warning_count): New function.
869
f1f70eae
ILT
870 * options.h (class General_options): Add -Bsymbolic-functions.
871 * symtab.h (Symbol::is_preemptible): Check for
872 -Bsymbolic-functions.
873
8825ac63
ILT
8742008-05-05 Ian Lance Taylor <iant@google.com>
875
d98bc257
ILT
876 * options.h (DEFINE_bool): For DASH_Z, create the negative option
877 as noVARNAME rather than no-VARNAME.
878 (class General_options): Add option -z combreloc.
879 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
880 get_address.
881 (Output_reloc::sort_before) [SHT_REL]: New function.
882 (Output_reloc::sort_before) [SHT_RELA]: New function.
883 (class Output_data_reloc_base): Add sort_relocs_ field. Define
884 Sort_relocs_comparison.
885 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
886 parameter. Change all callers.
887 (Output_data_reloc::Output_data_reloc) [both versions]: Add
888 sort_relocs parameter. Change all callers.
889 * output.cc (Output_reloc::get_address): New function, broken out
890 of write_rel.
891 (Output_reloc::write_rel): Call it.
892 (Output_reloc::compare): New function.
893 (Output_data_reloc_base::do_write): Optionally sort relocs.
894
60b2b4e7
ILT
895 * configure.ac: If targ_extra_obj is set, link it in.
896 * configure.tgt: Initialize all variables.
897 (x86_64*): Set targ_extra_obj and targ_extra_size.
898 * configure: Rebuild.
899
8825ac63
ILT
900 * object.cc (Sized_relobj::include_section_group): Adjust section
901 indexes read from group data. Build vector to pass to
902 layout_group.
903 * layout.cc (Layout::layout_group): Add flags and shndxes
904 parameters. Remove contents parameter. Change caller. Update
905 explicit instantiations.
906 * layout.h (class Layout): Update layout_group declaration.
907 * output.cc (Output_data_group::Output_data_group): Add flags and
908 input_shndxes parameters. Remove contents parameter. Change
909 caller.
910 (Output_data_group::do_write): Change input_sections_ to
911 input_shndxes_.
912 * output.h (class Output_data_group): Update constructor
913 declaration. Rename input_sections_ to input_shndxes_.
914 * testsuite/many_sections_test.cc: Add template.
915
e94cf127
CC
9162008-04-30 Cary Coutant <ccoutant@google.com>
917
4418b2d5
CC
918 * target-reloc.h (relocate_section): Fix dead-pointer bug.
919
e94cf127
CC
920 * layout.cc (Layout::include_section): Refactored check for debug
921 info section.
922 (Layout::add_comdat): Add new parameters. Change type
923 of signature parameter. Add object and shndx to signatures table.
924 (Layout::find_kept_object): New function.
925 * layout.h: Include <cstring>.
926 (Layout::is_debug_info_section): New function.
927 (Layout::add_comdat): Add new parameters.
928 (Layout::find_kept_object): New function.
929 (Layout::Kept_section): New struct.
930 (Layout::Signatures): Change type of map range.
931 * object.cc (Relobj::output_section_address): New function.
932 (Sized_relobj::include_section_group): Add new parameters. Change
933 calls to Layout::add_comdat. Change to build table of kept comdat
934 groups and table mapping discarded sections to kept sections.
935 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
936 (Sized_relobj::do_layout): Change calls to include_section_group and
937 include_linkonce_section.
938 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
939 value to zero when section is discarded.
940 (Sized_relobj::map_to_kept_section): New function.
941 * object.h (Relobj::output_section_address): New function.
942 (Relobj::Comdat_group): New type.
943 (Relobj::find_comdat_group): New function.
944 (Relobj::Comdat_group_table): New type.
945 (Relobj::Kept_comdat_section): New type.
946 (Relobj::Kept_comdat_section_table): New type.
947 (Relobj::add_comdat_group): New function.
948 (Relobj::set_kept_comdat_section): New function.
949 (Relobj::get_kept_comdat_section): New function.
950 (Relobj::comdat_groups_): New field.
951 (Relobj::kept_comdat_sections_): New field.
952 (Symbol_value::input_value): Update comment.
953 (Sized_relobj::map_to_kept_section) New function.
954 (Sized_relobj::include_linkonce_section): Add new parameter.
955 * target-reloc.h (Comdat_behavior): New type.
956 (get_comdat_behavior): New function.
957 (relocate_section): Add code to map a discarded section to the
958 corresponding kept section when applying a relocation.
959
e4e5049b
CS
9602008-04-30 Craig Silverstein <csilvers@google.com>
961
962 * dwarf_reader.cc (next_generation_count): New static var.
963 (Addr2line_cache_entry): New struct.
964 (addr2line_cache): New static var.
965 (Dwarf_line_info::one_addr2line): Added caching.
966 (Dwarf_line_info::clear_addr2line_cache): New function.
967 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
968 cache-size parameter.
969 (Dwarf_line_info::one_addr2line_cache): New function.
970 * symtab.cc (Symbol_table::detect_odr_violations): Pass
971 new cache-size argument to one_addr2line(), and clear cache.
972
d09e9154
CC
9732008-04-28 Cary Coutant <ccoutant@google.com>
974
975 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
976 R_386_PC8 relocations.
977
7ef73768
ILT
9782008-04-23 Ian Lance Taylor <iant@google.com>
979
55438702
ILT
980 * object.cc (Sized_relobj::include_section_group): Check for
981 invalid section group.
982
c165fb93
ILT
983 * object.cc (make_elf_object): Correct test for 64-bit ELF file
984 header size.
985
7ef73768
ILT
986 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
987 than read for file header.
988 * archive.cc (Archive::include_member): Likewise.
989
6194aaab
L
9902008-04-23 Paolo Bonzini <bonzini@gnu.org>
991
992 * aclocal.m4: Regenerate.
993 * configure: Regenerate.
994
d491d34e
ILT
9952008-04-19 Ian Lance Taylor <iant@google.com>
996
5ea2bac6
ILT
997 * version.cc (version_string): Bump to 1.6.
998
7bc3e21a
ILT
999 * testsuite/Makefile.am (many_sections_r_test): New target.
1000 (many_sections_r_test_SOURCES): Remove.
1001 (many_sections_r_test_DEPENDENCIES): Remove.
1002 (many_sections_r_test_LDFLAGS): Remove.
1003 (many_sections_r_test_LDADD): Remove.
1004
7fcd3aa9
ILT
1005 * object.cc (Sized_relobj::do_add_symbols): Always pass
1006 local_symbol_count_ to add_from_relobj.
1007
4c94d6ae
ILT
1008 * testsuite/Makefile.am (many_sections_check.h): Only check one in
1009 every thousand variables.
1010 * testsuite/Makefile.in: Rebuild.
1011
d491d34e
ILT
1012 * object.cc (Xindex::initialize_symtab_xindex): New function.
1013 (Xindex::read_symtab_xindex): New function.
1014 (Xindex::sym_xindex_to_shndx): New function.
1015 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
1016 available.
1017 (Sized_relobj::do_initialize_xindex): New function.
1018 (Sized_relobj::do_read_symbols): Adjust section links.
1019 (Sized_relobj::symbol_section_and_value): Add is_ordinary
1020 parameter. Change all callers.
1021 (Sized_relobj::include_section_group): Adjust section links and
1022 symbol section indexes.
1023 (Sized_relobj::do_layout): Adjust section links.
1024 (Sized_relobj::do_count_local_symbols): Adjust section links and
1025 symbol section indexes.
1026 (Sized_relobj::do_finalize_local_symbols): Distinguish between
1027 ordinary and special symbols.
1028 (Sized_relobj::write_local_symbols): Add symtab_xindex and
1029 dynsym_xindex parameters. Change all callers. Adjust section
1030 links. Use SHN_XINDEX when needed.
1031 (Sized_relobj::get_symbol_location_info): Adjust section links.
1032 Don't get fooled by special symbols.
1033 * object.h (class Xindex): Define.
1034 (class Object): Add xindex_ parameter. Declare virtual functoin
1035 do_initialize_xindex.
1036 (Object::adjust_sym_shndx): New function.
1037 (Object::set_xindex): New protected function.
1038 (class Symbol_value): Add is_ordinary_shndx_ field.
1039 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
1040 (Symbol_value::value): Assert ordinary section.
1041 (Symbol_value::initialize_input_to_output_map): Likewise.
1042 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
1043 Change all callers.
1044 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
1045 all callers.
1046 (class Sized_relobj): Update declarations.
1047 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
1048 parameter. Change all callers.
1049 (Sized_relobj::adjust_shndx): New function.
1050 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
1051 field.
1052 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
1053 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
1054 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
1055 (Sized_dynobj::read_dynsym_section): Adjust section links.
1056 (Sized_dynobj::read_dynamic): Likewise.
1057 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
1058 section links.
1059 (Sized_dynobj::do_initialize_xindex): New function.
1060 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
1061 do_initialize_xindex.
1062 (Sized_dynobj::adjust_shndx): New function.
1063 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
1064 dynsym_xindex_ fields.
1065 (Layout::finalize): Add a call to set_section_indexes before
1066 creating the symtab sections.
1067 (Layout::set_section_indexes): Don't do anything if the section
1068 already has a section index.
1069 (Layout::create_symtab_sections): Add shnum parameter. Change
1070 caller. Create .symtab_shndx section if needed.
1071 (Layout::create_shdrs): Add shstrtab_section parameter. Change
1072 caller.
1073 (Layout::allocated_output_section_count): New function.
1074 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
1075 needed.
1076 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
1077 fields. Update declarations.
1078 (Layout::symtab_xindex): New function.
1079 (Layout::dynsym_xindex): New function.
1080 (class Write_symbols_task): Add layout_ field.
1081 (Write_symbols_task::Write_symbols_task): Add layout parameter.
1082 Change caller.
1083 * output.cc (Output_section_headers::Output_section_headers): Add
1084 shstrtab_section parameter. Change all callers.
1085 (Output_section_headers::do_sized_write): Store overflow values
1086 for section count and section string table section index in
1087 section header zero.
1088 (Output_file_header::do_sized_write): Check for overflow of
1089 section count and section string table section index.
1090 (Output_symtab_xindex::do_write): New function.
1091 (Output_symtab_xindex::endian_do_write): New function.
1092 * output.h (class Output_section_headers): Add shstrtab_section_.
1093 Update declarations.
1094 (class Output_symtab_xindex): Define.
1095 (Output_section::has_out_shndx): New function.
1096 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
1097 field.
1098 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
1099 Change all callers.
1100 (Sized_symbol::init): Likewise.
1101 (Symbol::output_section): Check for ordinary symbol.
1102 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
1103 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
1104 callers.
1105 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
1106 Change all callers. Simplify handling of symbols from sections
1107 not included in the link.
1108 (Symbol_table::add_from_dynobj): Handle ordinary symbol
1109 distinction.
1110 (Weak_alias_sorter::operator()): Assert that symbols are
1111 ordinary.
1112 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
1113 distinction.
1114 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
1115 parameters. Change all callers.
1116 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
1117 symbol distinction. Use SHN_XINDEX when needed.
1118 (Symbol_table::write_section_symbol): Add symtab_xindex
1119 parameter. Change all callers.
1120 (Symbol_table::sized_write_section_symbol): Likewise. Use
1121 SHN_XINDEX when needed.
1122 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
1123 declarations.
1124 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
1125 (Symbol::is_defined): Check is_ordinary.
1126 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
1127 (Symbol::is_absolute, Symbol::is_common): Likewise.
1128 (class Sized_symbol): Update declarations.
1129 (class Symbol_table): Update declarations.
1130 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
1131 parameters. Change all callers.
1132 (Sized_symbol::override): Likewise.
1133 (Symbol_table::override): Likewise.
1134 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
1135 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
1136 is_ordinary, and orig_st_shndx parameters. Change all callers.
1137 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
1138 to be in an ordinary section.
1139 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
1140 object and is_ordinary parameters. Change all callers.
1141 (Sized_dwarf_line_info::read_relocs): Add object parameter.
1142 Change all callers. Don't add undefined or non-ordinary symbols
1143 to reloc_map_.
1144 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
1145 Change all callers.
1146 * dwarf_reader.h (class Sized_dwarf_line_info): Update
1147 declarations.
1148 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
1149 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
1150 (Sized_relobj::relocate_sections): Likewise.
1151 * target-reloc.h (scan_relocs): Adjust section symbol index.
1152 (scan_relocatable_relocs): Likewise.
1153 * i386.cc (Scan::local): Check for ordinary symbols.
1154 * sparc.cc (Scan::local): Likewise.
1155 * x86_64.cc (Scan::local): Likewise.
1156 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
1157 to symbol_section_and_value.
1158 * testsuite/many_sections_test.cc: New file.
1159 * testsuite/Makefile.am (BUILT_SOURCES): Define.
1160 (check_PROGRAMS): Add many_sections_test.
1161 (many_sections_test_SOURCES): Define.
1162 (many_sections_test_DEPENDENCIES): Define.
1163 (many_sections_test_LDFLAGS): Define.
1164 (BUILT_SOURCES): Add many_sections_define.h.
1165 (many_sections_define.h): New target.
1166 (BUILT_SOURCES): Add many_sections_check.h.
1167 (many_sections_check.h): New target.
1168 (check_PROGRAMS): Add many_sections_r_test.
1169 (many_sections_r_test_SOURCES): Define.
1170 (many_sections_r_test_DEPENDENCIES): Define.
1171 (many_sections_r_test_LDFLAGS): Define.
1172 (many_sections_r_test_LDADD): Define.
1173 (many_sections_r_test.o): New target.
1174 * testsuite/Makefile.in: Rebuild.
1175
c5818ff1
CC
11762008-04-17 Cary Coutant <ccoutant@google.com>
1177
1178 * errors.cc (Errors::info): New function.
1179 (gold_info): New function.
1180 * errors.h (Errors::info): New function.
1181 * gold.h (gold_info): New function.
1182 * object.cc (Input_objects::add_object): Print trace output.
1183 * options.cc (options::parse_set): New function.
1184 (General_options::parse_wrap): Deleted.
1185 (General_options::General_options): Deleted initializer.
1186 * options.h (options::String_set): New typedef.
1187 (options::parse_set): New function.
1188 (DEFINE_set): New macro.
1189 (General_options::wrap): Changed to use DEFINE_set. Changed
1190 callers of any_wrap_symbols and is_wrap_symbol.
1191 (General_options::trace, General_options::trace_symbol):
1192 New options.
1193 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
1194 (General_options::wrap_symbols_): Deleted.
1195 * symtab.cc (Symbol_table::add_from_object): Print trace output.
1196
b5be4a7c
DM
11972008-04-17 David S. Miller <davem@davemloft.net>
1198
1199 * options.cc (General_options::parse_V): New function.
1200 * options.h: Add entries for -V and -Qy.
1201
155a0dd7
ILT
12022008-04-17 Ian Lance Taylor <iant@google.com>
1203
1204 * common.cc (Symbol_table::allocate_commons): Remove options
1205 parameter. Change caller.
1206 (Symbol_table::do_allocate_commons): Remove options parameter.
1207 Change caller. Just call do_allocate_commons_list twice.
1208 (Symbol_table::do_allocate_commons_list): New function, broken out
1209 of do_allocate_commons.
1210 * common.h (class Allocate_commons_task): Remove options_ field.
1211 Update constructor.
1212 * symtab.cc (Symbol_table::Symbol_table): Initialize
1213 tls_commons_.
1214 (Symbol_table::add_from_object): Put TLS common symbols on
1215 tls_commons_ list.
1216 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
1217 which are IN_OUTPUT_DATA.
1218 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
1219 allocate_commons and do_allocate_commons declarations. Declare
1220 do_allocate_commons_list.
1221 * gold.cc (queue_middle_tasks): Update creation of
1222 Allocate_commons_task to not pass options.
1223 * testsuite/Makefile.am (INCLUDES): Add -I.. .
1224 (TLS_TEST_C_FLAGS): New variable.
1225 (tls_test_c_pic.o): New target.
1226 (tls_test_shared.so): Link in tls_test_c_pic.o.
1227 (tls_test_c_pic_ie.o): New target.
1228 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
1229 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
1230 (tls_test_c.o): New target.
1231 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
1232 (tls_pic_test_LDADD): Likewise.
1233 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
1234 (tls_shared_gd_to_ie_test_LDADD): Likewise.
1235 (tls_test_c_gnu2.o): New target.
1236 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
1237 tls_test_c_gnu2.o.
1238 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
1239 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
1240 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
1241 * testsuite/tls_test.cc: Include "config.h".
1242 (t_last): Call t11_last.
1243 * testsuite/tls_test.h (t11, t11_last): Declare.
1244 * testsuite/tls_test_c.c: New file.
1245 * testsuite/tls_test_main.cc (thread_routine): Call t11.
1246 * configure.ac: Check for OpenMP support.
1247 * configure, config.in, Makefile.in: Rebuild.
1248 * testsuite/Makefile.in: Rebuild.
1249
edfbb029
CC
12502008-04-16 Cary Coutant <ccoutant@google.com>
1251
1252 * i386.cc (Target_i386::define_tls_base_symbol): New function.
1253 (Target_i386::tls_base_symbol_defined_): New field.
1254 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
1255 (Target_i386::Scan::global): Likewise.
1256 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
1257 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
1258 (Target_x86_64::tls_base_symbol_defined_): New field.
1259 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
1260 (Target_x86_64::Scan::global): Likewise.
1261
f3c69fca
CC
12622008-04-16 Cary Coutant <ccoutant@google.com>
1263
1264 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
1265 (Symbol::needs_plt_entry): Allow weak undefined symbols.
1266 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
1267 building shared libraries.
1268 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
1269 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
1270 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
1271 * testsuite/Makefile.in: Rebuild.
1272 * testsuite/weak_undef.h: New file.
1273 * testsuite/weak_undef_file1.cc: Add extra test cases.
1274 * testsuite/weak_undef_file2.cc: Likewise.
1275 * testsuite/weak_undef_test.cc: Likewise.
1276
7c414435
DM
12772008-04-16 David S. Miller <davem@davemloft.net>
1278
32b769e1
DM
1279 * sparc.cc (Target_sparc::Scan): Change from struct to class.
1280 Add issued_non_pic_error_ field. Declare check_non_pic.
1281 (Target_sparc::Scan::check_non_pic): New function.
1282 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
1283 (Target_sparc::Scan::global): Likewise.
1284
11936fb1
DM
1285 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
1286 * configure: Rebuild.
1287
7c414435
DM
1288 * options.h (DEFINE_enable): New macro.
1289 (new_dtags): New enable option.
1290 (initfirst, interpose, loadfltr, nodefaultlib,
1291 nodelete, nodlopen, nodump): New -z options.
1292 * layout.cc (Layout:finish_dynamic_section): If new
1293 dtags enabled, emit DT_RUNPATH. Also, emit a
1294 DT_FLAGS_1 containing any specified -z flags.
1295
85c7bf8b
ILT
12962008-04-16 Ian Lance Taylor <iant@google.com>
1297
12c0daef
ILT
1298 * copy-relocs.cc: New file.
1299 * copy-relocs.h: New file.
1300 * reloc.cc: Remove Copy_relocs code.
1301 * reloc.h: Likewise.
1302 * reloc-types.h (struct Reloc_types) [both versions]: Add
1303 get_reloc_addend_noerror.
1304 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
1305 variants of add_global which take an addend which must be zero.
1306 * i386.cc: Include "copy-relocs.h".
1307 (class Target_i386): Change type of copy_relocs_ to variable,
1308 update initializer.
1309 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
1310 Change all callers.
1311 (Target_i386::do_finalize_sections): Change handling of
1312 copy_relocs_.
1313 * sparc.cc: Include "copy-relocs.h".
1314 (class Target_sparc): Change type of copy_relocs_ to variable,
1315 update initializer.
1316 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
1317 Change all callers.
1318 (Target_sparc::do_finalize_sections): Change handling of
1319 copy_relocs_.
1320 * x86_64.cc: Include "copy-relocs.h".
1321 (class Target_x86_64): Change type of copy_relocs_ to variable,
1322 update initializer.
1323 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
1324 class. Change all callers.
1325 (Target_x86_64::do_finalize_sections): Change handling of
1326 copy_relocs_.
1327 * Makefile.am (CCFILES): Add copy-relocs.cc.
1328 (HFILES): Add copy-relocs.h.
1329
4f4995b6
ILT
1330 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
1331
85c7bf8b
ILT
1332 * testsuite/script_test_4.sh: Permit leading zeroes.
1333
4f2a9edd
ILT
13342008-04-15 Ian Lance Taylor <iant@google.com>
1335
e6188289
ILT
1336 * script-sections.cc (Script_sections::create_segments): Use
1337 header_size_adjustment even when there is enough room for the
1338 headers.
1339 * testsuite/script_test_4.sh: New file.
1340 * testsuite/script_test_4.t: New file.
1341 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
1342 (check_DATA): Add script_test_4.stdout.
1343 (MOSTLYCLEANFILES): Likewise.
1344 (script_test_4): New target.
1345 (script_test_4.stdout): New target.
1346 * testsuite/Makefile.in: Rebuild.
1347
4f2a9edd
ILT
1348 * sparc.cc: Add definitions for Output_data_plt_sparc class
1349 constants.
1350
f5314dd5
DM
13512008-04-14 David S. Miller <davem@davemloft.net>
1352
1353 * sparc.cc: New file.
1354 * Makefile.am (TARGETSOURCES): Add sparc.cc
1355 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
1356 * configure.tgt: Document targ_extra_size and
1357 targ_extra_big_endian. Add entries for sparc-* and
1358 sparc64-*.
1359 * configure.ac: Handle targ_extra_size and
1360 targ_extra_big_endian.
1361 * Makefile.in: Rebuild.
1362 * configure: Likewise.
1363 * po/POTFILES.in: Likewise.
1364 * po/gold.pot: Likewise.
1365
154e0e9a
ILT
13662008-04-14 Ian Lance Taylor <iant@google.com>
1367
1368 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
1369 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
1370 in the name/type/flags to section mapping. Don't call
1371 allocate_output_section.
1372 (Layout::choose_output_section): Change parameter from adjust_name
1373 to is_input_section. Don't permit input sections after sections
1374 are attached to segments. Don't call allocate_output_section.
1375 (Layout::layout_eh_frame): Call update_flags_for_input_section,
1376 not write_enable_output_section.
1377 (Layout::make_output_section): Don't push to
1378 unattached_section_list_ nor call attach_to_segment. Call
1379 attach_section_to_segment if sections are attached.
1380 (Layout::attach_sections_to_segments): New function.
1381 (Layout::attach_section_to_segment): New function.
1382 (Layout::attach_allocated_section_to_segment): Rename from
1383 attach_to_segment. Remove flags parameter.
1384 (Layout::allocate_output_section): Remove function.
1385 (Layout::write_enable_output_section): Remove function.
1386 * layout.h (class Layout): Update for above changes. Add new
1387 field sections_are_attached_.
1388 * output.h (Output_section::update_flags_for_input_section): New
1389 function.
1390 * output.cc (Output_section::add_input_section): Call
1391 update_flags_for_input_section.
1392 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
1393
009a67a2
CC
13942008-04-11 Cary Coutant <ccoutant@google.com>
1395
1396 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
1397 thought unnecessary.
1398 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
1399
759b1a24
ILT
14002008-04-11 Ian Lance Taylor <iant@google.com>
1401
1402 * output.h (class Output_section_data): Remove inline definition
1403 of set_addralign.
1404 * output.cc (Output_section_data::set_addralign): New function.
1405
c2b45e22
CC
14062008-04-11 Cary Coutant <ccoutant@google.com>
1407
1408 Add support for TLS descriptors for i386 and x86_64.
1409 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
1410 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
1411 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
1412 GOT_TYPE_TLS_DESC.
1413 (Target_i386::got_mod_index_entry): Remove unnecessary code.
1414 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
1415 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
1416 relocations.
1417 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
1418 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
1419 Fix problem with initial-exec relocations.
1420 (Target_i386::Relocate::relocate_tls): Likewise.
1421 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
1422 relaxation.
1423 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
1424 support for section-plus-offset dynamic table entries.
1425 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
1426 (Output_data_dynamic::Dynamic_entry): Add support for
1427 section-plus-offset dynamic table entries.
1428 (Output_data_dynamic::Classification): Likewise.
1429 (Output_data_dynamic::classification_): Renamed offset_.
1430 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
1431 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
1432 (Target_x86_64::make_plt_section): New function.
1433 (Target_x86_64::reserve_tlsdesc_entries): New function.
1434 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
1435 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
1436 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
1437 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
1438 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
1439 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
1440 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
1441 add extra PLT entry for TLS descriptors.
1442 (Output_data_plt_x86_64::got_): New field.
1443 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
1444 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
1445 fields.
1446 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
1447 descriptors.
1448 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
1449 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
1450 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
1451 R_386_TLS_DESC_CALL relocations.
1452 (Target_x86_64::Scan::global): Likewise.
1453 (Target_x86_64::do_finalize_sections): Add dynamic table entries
1454 for TLS descriptors.
1455 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
1456 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
1457 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
1458 GD-to-IE relaxation.
1459 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
1460 and TLS_DESCRIPTORS.
1461 * Makefile.in: Rebuild.
1462 * configure: Rebuild.
1463 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
1464 (tls_test_shared2.so): New target.
1465 (tls_shared_gd_to_ie_test_SOURCES): New variable.
1466 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
1467 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
1468 (tls_shared_gd_to_ie_test_LDADD): New variable.
1469 (tls_shared_gnu2_gd_to_ie_test): New target.
1470 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
1471 New targets.
1472 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
1473 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
1474 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
1475 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
1476 (tls_shared_gnu2_test): New target.
1477 (tls_test_gnu2_shared.so): New target.
1478 (tls_shared_gnu2_test_SOURCES): New variable.
1479 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
1480 (tls_shared_gnu2_test_LDFLAGS): New variable.
1481 (tls_shared_gnu2_test_LDADD): New variable.
1482 * testsuite/Makefile.in: Rebuild.
1483 * testsuite/Makefile.
1484
83bfb6b7
ILT
14852008-04-11 Ian Lance Taylor <iant@google.com>
1486
1487 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
1488 justsyms.t.
1489 * testsuite/Makefile.in: Rebuild.
1490
1491 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
1492 long.
1493 * testsuite/script_test_2.cc (main): Adjust test.
1494
706e1f5e
ILT
14952008-04-11 David S. Miller <davem@davemloft.net>
1496 Ian Lance Taylor <iant@google.com>
1497
1498 * options.h (General_options): Add entries for '-Y' and
1499 '-relax'.
1500 * options.cc (General_options:finalize): If -Y was used, add those
1501 entries to the library path instead of the default "/lib" and
1502 "/usr/lib".
1503
7c98e6bb
DM
15042008-04-11 David S. Miller <davem@davemloft.net>
1505
1506 * testsuite/justsyms.t: Start at 0x100.
1507 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
1508 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
1509 long.
1510 * testsuite/script_test_2.cc: Adjust string and section length
1511 checks.
7c98e6bb 1512
99a37bfd
ILT
15132008-04-09 Ian Lance Taylor <iant@google.com>
1514
2cefc357
ILT
1515 PR gold/5996
1516 * script-sections.cc (Sections_element::allocate_to_segment): Add
1517 orphan parameter.
1518 (Output_section_definition::allocate_to_segment): Likewise.
1519 (Orphan_output_section::allocate_to_segment): Likewise.
1520 (Script_sections::attach_sections_using_phdrs_clause): Don't
1521 propagate non-PT_LOAD segments to orphan sections.
1522 * testsuite/Makefile.am (script_test_3.stdout): Generate using
1523 readelf rather than objdump.
1524 * testsuite/script_test_3.sh: Adjust accordingly. Test that
1525 .interp section and PT_INTERP segment are the same size.
1526 * testsuite/Makefile.in: Rebuild.
1527
99a37bfd
ILT
1528 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
1529 aliases for symbols defined in the same object.
1530 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
1531 (weak_alias_test_SOURCES): New variable.
1532 (weak_alias_test_DEPENDENCIES): New variable.
1533 (weak_alias_test_LDFLAGS): New variable.
1534 (weak_alias_test_LDADD): New variable.
1535 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
1536 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
1537 (weak_alias_test_3.o): New target.
1538 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
1539 * testsuite/weak_alias_test_main.cc: New file.
1540 * testsuite/weak_alias_test_1.cc: New file.
1541 * testsuite/weak_alias_test_2.cc: New file.
1542 * testsuite/weak_alias_test_3.cc: New file.
1543
780e49c5
ILT
15442008-04-08 Ian Lance Taylor <iant@google.com>
1545
cdb0b8f5
ILT
1546 * options.h (class General_options): Add --noinhibit-exec option.
1547 * main.cc (main): Check --noinhibit-exec.
1548
0864d551
ILT
1549 * options.h (class General_options): Define --wrap as a special
1550 option. Add wrap_symbols_ field.
1551 (General_options::any_wrap_symbols): New function.
1552 (General_options::is_wrap_symbol): New function.
1553 * options.cc (General_options::parse_wrap): New function.
1554 (General_options::General_options): Initialize wrap_symbols_.
1555 * symtab.cc (Symbol_table::wrap_symbol): New function.
1556 (Symbol_table::add_from_object): Handle --wrap.
1557 * symtab.h (class Symbol_table): Declare wrap_symbol.
1558 * target.h (Target::wrap_char): New function.
1559 (Target::Target_info): Add wrap_char field.
1560 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
1561 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
1562 * testsuite/testfile.cc (Target_test::test_target_info):
1563 Likewise.
1564
789aa6de
ILT
1565 * errors.cc (Errors::undefined_symbol): Mention symbol version if
1566 there is one.
1567
2c38906f
ILT
1568 * layout.h (class Layout): Add added_eh_frame_data_ field.
1569 * layout.cc (Layout::Layout): Initialize new field.
1570 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
1571 output section until we find a section we merged successfully.
1572 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
1573 that the size be non-zero.
1574
780e49c5
ILT
1575 * merge.cc (Object_merge_map::get_output_offset): Remove inline
1576 qualifier.
1577
7fcd0256
ILT
15782008-04-08 Craig Silverstein <csilvers@google.com>
1579
1580 * configure.ac: Export new conditional variable HAVE_ZLIB.
1581 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
1582 on HAVE_ZLIB.
1583 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
1584 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1585
6835af53
ILT
15862008-04-07 Ian Lance Taylor <iant@google.com>
1587
e24f324c
ILT
1588 * version.cc (version_string): Set to "1.5".
1589
a036edd8
ILT
1590 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
1591 Add issued_non_pic_error_ field. Declare check_non_pic.
1592 (Target_x86_64::Scan::check_non_pic): New function.
1593 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
1594 (Target_x86_64::Scan::global): Likewise.
1595
624f8810
ILT
1596 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
1597 addend parameter. Change caller. Handle merge sections.
1598 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
1599 Address to Addend. Don't add in the result of
1600 local_section_offset, pass down the addend and use the returned
1601 value.
1602 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
1603 Update declarations of local_section_offset and symbol_value.
1604 * testsuite/two_file_test_1.cc (t18): New function.
1605 * testsuite/two_file_test_2.cc (f18): New function.
1606 * testsuite/two_file_test_main.cc (main): Call t18.
1607 * testsuite/two_file_test.h (t18, f18): Declare.
1608
6835af53
ILT
1609 * configure.ac: Don't test for objdump, c++filt, or readelf.
1610 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
1611 conditionals.
1612 (TEST_READELF): New variable.
1613 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
1614 (check_PROGRAMS): Add two_file_strip_test.
1615 (two_file_strip_test): New target.
1616 (check_PROGRAMS): Add two_file_same_shared_strip_test.
1617 (two_file_same_shared_strip_test_SOURCES): New variable.
1618 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
1619 (two_file_same_shared_strip_test_LDFLAGS): New variable.
1620 (two_file_same_shared_strip_test_LDADD): New variable.
1621 (two_file_shared_strip.so): New target.
1622 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
1623 (ver_test_5.syms, ver_test_7.syms): Likewise.
1624 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
1625 (strip_test_3.stdout): Use TEST_OBJDUMP.
1626 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1627
86925eef
CC
16282008-04-04 Cary Coutant <ccoutant@google.com>
1629
1630 * symtab.h (Symbol::is_weak_undefined): New function.
1631 (Symbol::is_strong_undefined): New function.
1632 (Symbol::is_absolute): New function.
1633 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
1634 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
1635 absolute symbols.
1636 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
1637 (weak_undef_test): New target.
1638 * testsuite/Makefile.in: Rebuild.
1639 * testsuite/weak_undef_file1.cc: New file.
1640 * testsuite/weak_undef_file2.cc: New file.
1641 * testsuite/weak_undef_test.cc: New file.
1642
126f3ece
ILT
16432008-04-03 Craig Silverstein <csilvers@google.com>
1644
1645 * compressed_output.h (class Output_compressed_section): Use
1646 unsigned buffer.
1647 * compressed_output.cc (zlib_compress): Use unsigned buffers,
1648 add zlib header.
1649 (zlib_compressed_suffix): Removed.
1650 (Output_compressed_section::set_final_data_size): Use unsigned
1651 buffers.
1652 * testsuite/Makefile.am (flagstest_compress_debug_sections):
1653 Fix linker invocation.
1654 (flagstest_o_specialfile_and_compress_debug_sections):
1655 Likewise.
1656 * testsuite/Makefile.in: Regenerated.
1657
deae2a14
DM
16582008-04-02 David S. Miller <davem@davemloft.net>
1659
1660 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
1661 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
1662
70752818
ILT
16632008-04-02 Craig Silverstein <csilvers@google.com>
1664
1665 * TODO: New file.
1666
39d0cb0e
ILT
16672008-04-02 Ian Lance Taylor <iant@google.com>
1668
1669 * fileread.cc (File_read::find_view): Add byteshift and vshifted
1670 parameters. Update for new key type to views_. Change all
1671 callers.
1672 (File_read::read): Adjust for byteshift in returned view.
1673 (File_read::add_view): New function, broken out of
1674 find_and_make_view.
1675 (File_read::make_view): New function, broken out of
1676 find_and_make_view.
1677 (File_read::find_or_make_view): Add offset and aligned
1678 parameters. Rewrite accordingly. Change all callers.
1679 (File_read::get_view): Add offset and aligned parameters. Adjust
1680 for byteshift in return value.
1681 (File_read::get_lasting_view): Likewise.
1682 * fileread.h (class File_read): Update declarations.
1683 (class File_read::View): Add byteshift_ field. Add byteshift to
1684 constructor. Add byteshift method.
1685 * archive.h (Archive::clear_uncached_views): New function.
1686 (Archive::get_view): Add aligned parameter. Change all callers.
1687 * object.h (Object::get_view): Add aligned parameter. Change all
1688 callers.
1689 (Object::get_lasting_view): Likewise.
1690
1691 * fileread.cc (File_read::release): Don't call clear_views if
1692 there are multiple objects.
1693 * fileread.h (File_read::clear_uncached_views): New function.
1694 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
1695 on the archive.
1696
a1207466
CC
16972008-03-31 Cary Coutant <ccoutant@google.com>
1698
1699 Add thin archive support.
1700 * archive.cc (Archive::armagt): New const.
1701 (Archive::setup): Remove task parameter and calls to unlock.
1702 (Archive::unlock_nested_archives): New function.
1703 (Archive::read_header): Add nested_off parameter. Change
1704 all callers.
1705 (Archive::interpret_header): Likewise.
1706 (Archive::include_all_members): Change to handle thin
1707 archives.
1708 (Archive::include_member): Likewise.
1709 * archive.h (Archive::Archive): Add new parameters and
1710 initializers.
1711 (Archive::armagt): New const.
1712 (Archive::setup): Remove task parameter.
1713 (Archive::unlock_nested_archives): New function.
1714 (Archive::read_header): Add nested_off parameter.
1715 (Archive::interpret_header): Likewise.
1716 (Archive::Nested_archive_table): New typedef.
1717 (Archive::is_thin_archive_): New field.
1718 (Archive::nested_archives_): New field.
1719 (Archive::options_): New field.
1720 (Archive::dirpath_): New field.
1721 (Archive::task_): New field.
1722 * readsyms.cc (Read_symbols::do_read_symbols): Add check
1723 for thin archives. Pass additional parameters to
1724 Archive::Archive. Unlock the archive file after calling
1725 Archive::setup.
1726
479f6503
ILT
17272008-03-29 Ian Lance Taylor <iant@google.com>
1728
686c8caf
ILT
1729 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
1730 version symbol to be local.
1731 * testsuite/ver_test_4.sh: New file.
1732 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
1733 (check_DATA): Add ver_test_4.syms.
1734 (ver_test_4.syms): New target.
1735 * testsuite/Makefile.in: Rebuild.
1736
ab794b6b
ILT
1737 * output.cc
1738 (Output_section::Input_section_sort_entry::has_priority): New
1739 function.
1740 (Output_section::Input_section_sort_entry::match_file_name): New
1741 function.
1742 (Output_section::Input_section_sort_entry::match_section_name):
1743 Remove.
1744 (Output_section::Input_section_sort_entry::match_section_name_prefix):
1745 Remove.
1746 (Output_section::Input_section_sort_entry::match_section_file):
1747 Remove.
1748 (Output_section::Input_section_sort_compare::operator()): Rewrite
1749 using new Input_section_sort_entry functions. Sort crtbegin and
1750 crtend first. Sort sections with no priority before sections with
1751 a priority.
1752 * testsuite/initpri1.c (d3): Check j != 4.
1753 (cd5): New constructor/destructor function.
1754 (main): Check j != 2.
1755
479f6503
ILT
1756 * symtab.cc (Symbol_table::add_from_object): If we don't use the
1757 new symbol when resolving, don't call set_is_default.
1758 * testsuite/ver_test_7.cc: New file.
1759 * testsuite/ver_test_7.sh: New file.
1760 * testsuite/Makefile.am (ver_test_7.so): New target.
1761 (ver_test_7.o): New target.
1762 (check_SCRIPTS): Add ver_test_7.sh.
1763 (check_DATA): Add ver_test_7.syms.
1764 (ver_test_7.syms): New target.
1765
2fd32231
ILT
17662008-03-28 Ian Lance Taylor <iant@google.com>
1767
1768 * layout.cc (Layout::layout): If we see an input section with a
1769 name that needs sorting, set the must_sort flag for the output
1770 section.
1771 (Layout::make_output_section): If the name of the output section
1772 indicates that it might require sorting, set the may_sort flag.
1773 * output.h (Output_section::may_sort_attached_input_sections): New
1774 function.
1775 (Output_section::set_may_sort_attached_input_sections): New
1776 function.
1777 (Output_section::must_sort_attached_input_sections): New
1778 function.
1779 (Output_section::set_must_sort_attached_input_sections): New
1780 function.
1781 (class Output_section): Declare Input_section_sort_entry. Define
1782 Input_section_sort_compare. Declare
1783 sort_attached_input_sections. Add new fields:
1784 may_sort_attached_input_sections_,
1785 must_sort_attached_input_sections_,
1786 attached_input_sections_are_sorted_.
1787 * output.cc (Output_section::Output_section): Initialize new
1788 fields.
1789 (Output_section::add_input_section): Add an entry to
1790 input_sections_ if may_sort or must_sort are true.
1791 (Output_section::set_final_data_size): Call
1792 sort_attached_input_sections if necessary.
1793 (Output_section::Input_section_sort_entry): Define new class.
1794 (Output_section::Input_section_sort_compare::operator()): New
1795 function.
1796 (Output_section::sort_attached_input_sections): New function.
1797 * configure.ac: Check whether the compiler supports constructor
1798 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
1799 * testsuite/initpri1.c: New file.
1800 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
1801 CONSTRUCTOR_PRIORITY.
1802 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
1803 (initpri1_LDFLAGS): New variable.
1804 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
1805
18e6b24e
ILT
18062008-03-27 Ian Lance Taylor <iant@google.com>
1807
49bdd526
ILT
1808 * common.cc (Sort_commons::operator): Correct sorting algorithm.
1809 * testsuite/common_test_1.c: New file.
1810 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
1811 (common_test_1_SOURCES): New variable.
1812 (common_test_1_DEPENDENCIES): New variable.
1813 (common_test_1_LDFLAGS): New variable.
1814
18e6b24e
ILT
1815 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
1816 and commons_ correctly when NAME/VERSION does not override
1817 NAME/NULL.
1818 * testsuite/ver_test_6.c: New file.
1819 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
1820 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
1821 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
1822
04bf7072
ILT
18232008-03-26 Ian Lance Taylor <iant@google.com>
1824
5871526f
ILT
1825 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
1826 of an undefined symbol from a version script.
1827 * testsuite/Makefile.am (ver_test_5.so): New target.
1828 (ver_test_5.o): New target.
1829 (check_SCRIPTS): Add ver_test_5.sh.
1830 (check_DATA): Add ver_test_5.syms.
1831 (ver_test_5.syms): New target.
1832 * testsuite/ver_test_5.cc: New file.
1833 * testsuite/ver_test_5.script: New file.
1834 * testsuite/ver_test_5.sh: New file.
1835 * Makefile.in, testsuite/Makefile.in: Rebuild.
1836
04bf7072
ILT
1837 PR gold/5986
1838 Fix problems building gold with gcc 4.3.0.
1839 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
1840 (gold_error_at_location, gold_warning_at_location): Use it.
1841 * configure.ac: Check whether we can compile and use a template
1842 function with a printf attribute.
1843 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
1844 when jumping over bytes.
1845 * object.cc: Instantiate Object::read_section_data.
1846 * debug.h: Include <cstring>
1847 * dwarf_reader.cc: Include <algorithm>
1848 * main.cc: Include <cstring>.
1849 * options.cc: Include <cstring>.
1850 * output.cc: Include <cstring>.
1851 * script.cc: Include <cstring>.
1852 * script.h: Include <string>.
1853 * symtab.cc: Include <cstring> and <algorithm>.
1854 * target-select.cc: Include <cstring>.
1855 * version.cc: Include <string>.
1856 * testsuite/testmain.cc: Include <cstdlib>.
1857 * configure, config.in: Rebuild.
1858
874c5b28
ILT
18592008-03-25 Ian Lance Taylor <iant@google.com>
1860
819d6c3a
ILT
1861 * options.cc: Include "../bfd/bfdver.h".
1862 (options::help): Print bug reporting address.
1863
f4b2c6f5
ILT
1864 * version.cc (print_version): Adjust output for current value of
1865 BFD_VERSION_STRING.
1866
1867 * NEWS: New file.
1868
e96caa79
ILT
1869 * options.cc (options::help): Print list of supported targets.
1870 * target-select.h: Include <vector>.
1871 (class Target_selector): Make machine_, size_, and is_big_endian_
1872 fields const. Add bfd_name_ and instantiated_target_ fields.
1873 (Target_selector::Target_selector): Add bfd_name parameter.
1874 (Target_selector::recognize): Make non-virtual, call
1875 do_recognize.
1876 (Target_selector::recognize_by_name): Make non-virtual, call
1877 do_recognize_by_name.
1878 (Target_selector::supported_names): New function.
1879 (Target_selector::bfd_name): New function.
1880 (Target_selector::do_instantiate_target): New pure virtual
1881 function.
1882 (Target_selector::do_recognize): New virtual function.
1883 (Target_selector::do_recognize_by_name): New virtual function.
1884 (Target_selector::instantiate_target): New private function.
1885 (supported_target_names): Declare.
1886 * target-select.cc (Target_selector::Target_selector): Update for
1887 new parameter and fields.
1888 (select_target_by_name): Check that the name matches before
1889 calling recognize_by_name.
1890 (supported_target_names): New function.
1891 * i386.cc (class Target_selector_i386): Update Target_selector
1892 constructor call. Remove recognize and recognize_by_name. Add
1893 do_instantiate_target.
1894 * x86_64.cc (class Target_selector_x86_64): Likewise.
1895 * testsuite/testfile.cc (class Target_selector_test): Update for
1896 changes to Target_selector.
1897
874c5b28
ILT
1898 * README: Rewrite, with some notes on unsupported features.
1899
0a65a3a7
CC
19002008-03-24 Cary Coutant <ccoutant@google.com>
1901
1902 * i386.cc (Target_i386::Got_type): New enum declaration.
1903 (Target_i386::Scan::local): Updated callers of Output_data_got
1904 member functions.
1905 (Target_i386::Scan::global): Likewise.
1906 (Target_i386::Relocate::relocate): Likewise.
1907 (Target_i386::Relocate::relocate_tls): Likewise.
1908 * object.h (Got_offset_list): New class.
1909 (Sized_relobj::local_has_got_offset): Added got_type parameter.
1910 (Sized_relobj::local_got_offset): Likewise.
1911 (Sized_relobj::set_local_got_offset): Likewise.
1912 (Sized_relobj::local_has_tls_got_offset): Removed.
1913 (Sized_relobj::local_tls_got_offset): Removed.
1914 (Sized_relobj::set_local_tls_got_offset): Removed.
1915 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
1916 * output.cc (Output_data_got::add_global): Added got_type parameter.
1917 (Output_data_got::add_global_with_rel): Likewise.
1918 (Output_data_got::add_global_with_rela): Likewise.
1919 (Output_data_got::add_global_pair_with_rel): New function.
1920 (Output_data_got::add_global_pair_with_rela): New function.
1921 (Output_data_got::add_local): Added got_type parameter.
1922 (Output_data_got::add_local_with_rel): Likewise.
1923 (Output_data_got::add_local_with_rela): Likewise.
1924 (Output_data_got::add_local_pair_with_rel): New function.
1925 (Output_data_got::add_local_pair_with_rela): New function.
1926 (Output_data_got::add_global_tls): Removed.
1927 (Output_data_got::add_global_tls_with_rel): Removed.
1928 (Output_data_got::add_global_tls_with_rela): Removed.
1929 (Output_data_got::add_local_tls): Removed.
1930 (Output_data_got::add_local_tls_with_rel): Removed.
1931 (Output_data_got::add_local_tls_with_rela): Removed.
1932 * output.h (Output_data_got::add_global): Added got_type parameter.
1933 (Output_data_got::add_global_with_rel): Likewise.
1934 (Output_data_got::add_global_with_rela): Likewise.
1935 (Output_data_got::add_global_pair_with_rel): New function.
1936 (Output_data_got::add_global_pair_with_rela): New function.
1937 (Output_data_got::add_local): Added got_type parameter.
1938 (Output_data_got::add_local_with_rel): Likewise.
1939 (Output_data_got::add_local_with_rela): Likewise.
1940 (Output_data_got::add_local_pair_with_rel): New function.
1941 (Output_data_got::add_local_pair_with_rela): New function.
1942 (Output_data_got::add_global_tls): Removed.
1943 (Output_data_got::add_global_tls_with_rel): Removed.
1944 (Output_data_got::add_global_tls_with_rela): Removed.
1945 (Output_data_got::add_local_tls): Removed.
1946 (Output_data_got::add_local_tls_with_rel): Removed.
1947 (Output_data_got::add_local_tls_with_rela): Removed.
1948 * resolve.cc (Symbol::override_base_with_special): Removed
1949 reference to has_got_offset_ field.
1950 * symtab.cc (Symbol::init_fields): Replaced initialization
1951 of got_offset_ with got_offsets_. Removed initialization
1952 of has_got_offset_
53fcba31 1953 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
1954 (Symbol::got_offset): Likewise.
1955 (Symbol::set_got_offset): Likewise.
1956 (Symbol::has_tls_got_offset): Removed.
1957 (Symbol::tls_got_offset): Removed.
1958 (Symbol::set_tls_got_offset): Removed.
1959 (Symbol::got_offset_): Removed.
1960 (Symbol::tls_mod_got_offset_): Removed.
1961 (Symbol::tls_pair_got_offset_): Removed.
1962 (Symbol::got_offsets_): New field.
1963 (Symbol::has_got_offset): Removed.
1964 (Symbol::has_tls_mod_got_offset): Removed.
1965 (Symbol::has_tls_pair_got_offset): Removed.
1966 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
1967 (Target_x86_64::Scan::local): Updated callers of Output_data_got
1968 member functions.
1969 (Target_x86_64::Scan::global): Likewise.
1970 (Target_x86_64::Relocate::relocate): Likewise.
1971 (Target_x86_64::Relocate::relocate_tls): Likewise.
1972
bd52eafb
BE
19732008-03-25 Ben Elliston <bje@au.ibm.com>
1974
1975 * yyscript.y: Fix spelling error in comment.
1976
8b105e34
ILT
19772008-03-24 Ian Lance Taylor <iant@google.com>
1978
8ed814a9
ILT
1979 * options.h (class General_options): Define build_id option.
1980 * layout.h (class Layout): Declare write_build_id, create_note,
1981 create_build_id. Add build_id_note_ member.
1982 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
1983 "libiberty.h", "md5.h", "sha1.h".
1984 (Layout::Layout): Initialize eh_frame_data_,
1985 eh_frame_hdr_section_, and build_id_note_.
1986 (Layout::finalize): Call create_build_id.
1987 (Layout::create_note): New function, broken out of
1988 Layout::create_gold_note.
1989 (Layout::create_gold_note): Call create_note.
1990 (Layout::create_build_id): New function.
1991 (Layout::write_build_id): New function.
1992 (Close_task_runner::run): Call write_build_id.
1993
8b105e34
ILT
1994 * x86_64.cc: Correct license to GPLv3.
1995
086a1841
ILT
19962008-03-23 Ian Lance Taylor <iant@google.com>
1997
1998 * options.cc: Include "demangle.h".
1999 (parse_optional_string): New function.
2000 (parse_long_option): Handle takes_optional_argument.
2001 (parse_short_option): Update dash_z initializer. Handle
2002 takes_optional_argument.
2003 (General_options::General_options): Initialize do_demangle_.
2004 (General_options::finalize): Set do_demangle_. Handle demangling
2005 style.
2006 * options.h (parse_optional_string): Declare.
2007 (struct One_option): Add optional_arg field. Update constructor.
2008 Update call constructor calls. Add takes_optional_argument
2009 function.
2010 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
2011 (DEFINE_optional_string): Define.
2012 (General_options::demangle): Change from DEFINE_bool to
2013 DEFINE_optional_string.
2014 (General_options::no_demangle): New function.
2015 (General_options::do_demangle): New function.
2016 (General_options::set_do_demangle): New function.
2017 (General_options::execstack_status_): Move definition to end of
2018 class definition.
2019 (General_options::static_): Likewise.
2020 (General_options::do_demangle_): New field.
2021 * object.cc (big_endian>::get_symbol_location_info): Call
2022 Options::do_demangle, not Options::demangle.
2023 * symtab.cc (demangle): Likewise.
2024
cbb93e63
ILT
20252008-03-22 Ian Lance Taylor <iant@google.com>
2026
2027 * gold.h: Include <cstddef> and <sys/types.h>
2028 * options.h: Include <cstring>.
2029
ec531623
ILT
20302008-03-21 Ian Lance Taylor <iant@google.com>
2031
2032 * Added source code to GNU binutils.
2033
This page took 0.125873 seconds and 4 git commands to generate.