* varobj.c (update_dynamic_varobj_children): Wrap error text in
[deliverable/binutils-gdb.git] / gold / ChangeLog
CommitLineData
805bb01c
DK
12009-06-05 Doug Kwan <dougkwan@google.com>
2
3 * object.cc (Sized_relobj::Sized_relobj): Initialize
4 discarded_eh_frame_shndx_ to -1U.
5 (Sized_relobj::do_layout): Record index of a discard .eh_frame
6 section.
7 (Sized_relobj::do_count_local_symbols): Skip local symbols in
8 a discarded .eh_frame section.
9 (Sized_relobj::do_finalize_local_symbols): Ditto.
10 * object.h (class Sized_relobj): Declare new member
11 discarded_eh_frame_shndx_.
12 * testsuite/Makefile.am (check_PROGRAMS): Add local_labels_test.
13 (local_labels_test.o, local_labels_test): New rules.
14 * testsuite/Makefile.in: Regenerate.
15
1dcd334d
DK
162009-06-04 Doug Kwan <dougkwan@google.com>
17
18 * layout.cc (Layout::section_name_mapping): Add mapping for
19 special ARM sections.
20
96d49306
DK
212009-06-03 Doug Kwan <dougkwan@google.com>
22
23 * arm.cc (utils::sign_extend): Reverse test in gold_assert.
24 (utils::has_overflow): Same.
25
dff16297
ILT
262009-06-03 Ian Lance Taylor <iant@google.com>
27
28 * layout.cc (Layout::section_name_mapping): New array, replacing
29 Layout::linkonce_mapping.
30 (Layout::section_name_mapping_count): New variable, replacing
31 Layout::linkonce_mapping_count.
32 (Layout::linkonce_output_name): Remove.
33 (Layout::output_section_name): Rewrite.
34 * layout.h (class Layout): Rename Linkonce_mapping to
35 Section_name_mapping, linkonce_mapping to section_name_mapping,
36 linkonce_mapping_count to section_name_mapping_count. Don't
37 declare linkonce_output_name.
38
c121c671
DK
392009-06-03 Doug Kwan <dougkwan@google.com>
40
41 * gold/arm.cc (namespace utils): New.
42 (Target_arm::reloc_is_non_pic): Define new method.
43 (class Arm_relocate_functions): New.
44 (Target_arm::Relocate::relocate): Handle relocation types used by
45 Android.
46
07800fab
ILT
472009-06-03 Ian Lance Taylor <iant@google.com>
48
49 * arm.cc (Target_arm::scan::global): Use || instead of |.
50
c121c671
DK
512009-06-02 Doug Kwan <dougkwan@google.com>
52
53 * gold/arm.cc (Target_arm::Scan::Scan): Initialize
54 issued_non_pic_error_.
55 (class Target_arm::Scan): Declare new method check_non_pic.
56 Define new method symbol_needs_plt_entry.
57 Declare new data member issued_non_pic_error_.
58 (class Target_arm::Relocate): Declare new method
59 should_apply_static_reloc.
60 (Target_arm::may_need_copy_reloc): Handle STT_ARM_TFUNC.
61 (Target_arm::Scan::check_non_pic): Define new method.
62 (Target_arm::Scan::local): Handle a small subset of reloc types used
63 by Android.
64 (Target_arm::Scan::local): Same.
65 (Target_arm::Relocate::should_apply_statci_reloc): Define new method.
66
b19b0c6d
ILT
672009-05-31 Mikolaj Zalewski <mikolajz@google.com>
68
69 * incremental.cc (Incremental_inputs::report_command_line): Filter
70 out --incremental-* options.
71
94cdfcff
DK
722009-05-29 Doug Kwan <dougkwan@google.com>
73
74 * gold/arm.cc (Output_data_plt_arm): Forward declaration for new
75 template class.
76 (class Target_arm): Update comment.
77 (Target_arm::Target_arm): Initialize new data members GOT_,
78 PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_ and DYNBSS_.
79 Declare new methods Target_arm::got_section, Target_arm::make_plt_entry
80 and Target_arm::rel_dyn_section.
81 Declare new_enum Target_arm::Got_type.
82 Declare new data members GOT_, PLT_, GOT_PLT_, REL_DYN_, COPY_RELOCS_
83 and DYNBSS_.
84 Update commments for member do_dynsym_value.
85 (Target_arm::got_size, Target_arm::plt_section,
86 Target_arm::may_need_copy_reloc and Target_arm::copy_reloc): Define
87 new methods inside class defintion.
88 (Target_arm::got_section): Define new method.
89 (Target_arm::rel_dyn_section): Same.
90 (Output_data_plt_arm): New template class.
91 (Output_data_plt_arm::Output_data_plt_arm): Define constructor.
92 (Output_data_plt_arm:do_adjust_output_section): Define new method.
93 (Output_data_plt_arm::add_entry): Same.
94 (Output_data_plt_arm::first_plt_entry): Define new
95 static data member for PLT instruction template.
96 (Output_data_plt_arm::plt_entry): Same.
97 (Output_data_plt_arm::do_write): Define new method.
98 (Target_arm::make_plt_entry): Same.
99 (Target_arm::do_finalize_sections): Same.
100 (Target_arm::do_dynsym_value): Same.
101
4a657b0d
DK
1022009-05-28 Doug Kwan <dougkwan@google.com>
103
104 * Makefile.am (TARGETSOURCES): Add arm.cc.
105 (ALL_TARGETOBJECTS): Add arm.$(OBJEXT)
106 * Makefile.in: Regenerate.
107 * arm.cc: New file.
108 * configure.tgt: Add armbe*-*-*, armeb*-*-* and arm*-*-* targets.
109
e7ae8c36
DK
1102009-05-26 Doug Kwan <dougkwan@google.com>
111
112 * options.cc (General_options::parse_exclude_libs). Fix a comment.
113 (General_options::check_excluded_libs): Strip off directories in
114 archive name before matching like GNU ld does.
115 * testsuite/Makefile.am (MOSTLYCLEANFILES,
116 exclude_libs_test_DEPENDENCIES): Add alt/libexclude_libs_test_3.a
117 (exclude_libs_test_LDFLAGS): Add linker option
118 -Wl,--exclude-libs,libexclude_libs_test_3
119 (exclude_libs_test_LADD): Add alt/libexclude_libs_test_3.a as
120 an explicit archive without using -l.
121 (alt/libexclude_libs_test_3.a): New make rule.
122 * testsuite/Makefile.in: Regenerate.
123 * testsuite/exclude_libs_test.c : Declare lib3_default().
124 (main): Call it.
125 * exclude_libs_test.sh: Add tests for alt/exclude_libs_test_3.a.
126 * exclude_libs_test_3.c: New file.
127
f12e7348
NC
1282009-05-26 Nick Clifton <nickc@redhat.com>
129
130 * po/id.po: New Indonesian translation.
131 * po/gold.pot: Updated template file.
132
4daadc0d
ST
1332009-05-22 Sriraman Tallam <tmsriram@google.com>
134
135 * testsuite/Makefile.am: Add -ffunction-sections to compile
136 gc_comdat_test files. Add -Wl,--gc-sections to build
137 gc_comdat_test.
138 * testsuite/Makefile.in: Regenerate.
139 * testsuite/gc_comdat_test.sh: Fix the condition around grep.
140
531813ad
ST
1412009-05-21 Sriraman Tallam <tmsriram@google.com>
142
143 * object.cc (Sized_relobj::map_to_kept_section): Return NULL if the
144 kept comdat section was garbage collected.
145 * testsuite/Makefile.am: Add test gc_comdat_test.sh.
146 * testsuite/Makefile.in: Regenerate.
147 * testsuite/gc_comdat_test.sh: New file.
148 * testsuite/gc_comdat_test_1.cc: New file.
149 * testsuite/gc_comdat_test_2.cc: New file.
150
65514900
CC
1512009-05-19 Doug Kwan <dougkwan@google.com>
152
153 * archive.cc (Archive::Archive): Move constructor from archive.h
154 to here. Initialize no_export_.
155 (Archive::get_elf_object_for_member): Set no_export flag of object.
156 * archive.h (Archive::Archive): Move constructor body to
157 archive.cc.
158 (Archive::no_export): New method.
159 (Archive::no_export_): New field.
160 * object.h (Object::Object): Initialize no_export_ to false.
161 (Object::no_export, Object::set_no_export): New methods.
162 (Object::no_export_): New field.
163 * options.cc (General_options::parse_exclude_libs): New method.
164 (General_options::check_excluded_libs) Same.
165 * options.h (exclude_libs): New option.
166 (General_options::check_excluded_libs): New method declaration.
167 (General_options::excluded_libs_): New field.
168 * symtab.cc (Symbol_table::add_from_relobj): Hide symbols with
169 default or protected visibility if an object has no-export flag set.
170 testsuite/Makefile.am (check_PROGRAMS): Add exclude_libs_test.
171 (check_SCRIPTS): Add exclude_libs_test.sh.
172 (check_DATA): Add exclude_libs_test.syms.
173 (MOSTLYCLEANFILES): Add exclude_libs_test.syms,
174 libexclude_libs_test_1.a and libexclude_libs_test_2.a.
175 (exclude_libs_test_SOURCES, exclude_libs_test_DEPENDENCIES,
176 exclude_libs_test_LDFLAGS and exclude_libs_test_LDADD): Define.
177 (exclude_libs_test.syms, libexclude_libs_test_1.a,
178 libexclude_libs_test_2.a): New rules.
179 * testsuite/Makefile.in: Regenerate.
180 * testsuite/exclude_libs_test.c: New file.
181 * testsuite/exclude_libs_test.sh: Ditto.
182 * testsuite/exclude_libs_test_1.c: Ditto.
183 * testsuite/exclude_libs_test_2.c: Ditto.
184
1b77ea50
ILT
1852009-05-15 Ian Lance Taylor <iant@google.com>
186
187 * configure.ac: Check for declarations for cases where libiberty.h
188 checks HAVE_DECL_xxx.
189 * configure, config.in: Rebuild.
190
072fe7ce
ILT
1912009-05-15 Mikolaj Zalewski <mikolajz@google.com>
192
193 * gold.h (Incremental_argument_list): Remove (invalid) forward
194 declaration.
195 * incremental.cc (Incremental_inputs::report_achive): New method.
196 (Incremental_inputs::report_object): New method.
197 (Incremental_inputs::report_script): New method.
198 (Incremental_inputs::finalize_inputs): New method.
199 (Incremental_inputs::finalize): Call finalize_inputs().
200 (Incremental_inputs::sized_create_incremental_inputs_section_data):
201 Create inputs entries.
202 * incremental.h (Incremental_input_type): New enum.
203 (Incremental_inputs::Incremental_input): Initialize new fields.
204 (Incremental_inputs::report_inputs): New method.
205 (Incremental_inputs::report_achive): New method.
206 (Incremental_inputs::report_object): New method.
207 (Incremental_inputs::report_script): New method.
208 (Incremental_inputs::finalize_inputs): New method.
209 (Incremental_inputs::Input_info): New struct.
210 (Incremental_inputs::Input_info_map): New typedef.
211 (Incremental_inputs::lock_): New field.
212 (Incremental_inputs::Inputs_): New field.
213 (Incremental_inputs::Inputs_map): New field.
214 * main.cc (main): Call Incremental_input::report_inputs.
215 * options.h (Input_argument_list): Typedef moved from
216 Input_arguments.
217 (Input_file_group::Files): Remove, use ::Input_argument_list.
218 (Input_file_group::Input_argument_list): Remove, use
219 ::Input_argument_list.
220 * plugin.cc (Plugin_manager::add_input_file): Add error in
221 incremental build.
222 * read_syms.cc (do_read_syms): Call Incremental_input::report_*
223 functions.
224 * script.cc (read_input_script): Call
225 Incremental_input::report_script.
226 * script.h (Script_info): New class.
227
b0481b0b
ILT
2282009-04-27 Ian Lance Taylor <iant@google.com>
229
230 * x86_64.cc (do_adjust_output_section): Set entsize to
231 plt_entry_size.
232
b22a5a41 2332009-04-23 Elliott Hughes <enh@google.com>
6d1e3092
CD
234
235 * output.cc (Output_file::close): After short writes, continue
236 writing from the correct offset in the buffer being written.
237
40fde488
CD
2382009-04-23 Chris Demetriou <cgd@google.com>
239
240 * configure.ac (HAVE_TR1_UNORDERED_MAP_REHASH): New define.
241 * configure: Regenerate.
242 * config.in: Regenerate.
243 * gold.h: Avoid std::tr1::unordered_map and std::tr1::unordered_set
244 if HAVE_TR1_UNORDERED_MAP_REHASH is not defined.
245
3ce2c28e
ILT
2462009-04-21 Mikolaj Zalewski <mikolajz@google.com>
247
248 * incremental.cc (Incremental_inputs_header_data): Renamed from
249 Incremental_input_header_data.
250 (Incremental_inputs_header_data::data_size): New field.
251 (Incremental_inputs_header_data::put_input_file_count): Renamed
252 from input_file_count.
253 (Incremental_inputs_header_data::put_command_line_offset): Renamed
254 from command_line_offset.
255 (Incremental_inputs_header_data::put_reserved): Renamed from
256 put_reserved.
257 (Incremental_inputs_entry_data): Renamed from
258 Incremental_input_entry_data.
259 (Incremental_inputs_entry_data::data_size): New field.
260 (Incremental_inputs::report_command_line): New method.
261 (Incremental_inputs::finalize): New method.
262 (Incremental_inputs::create_incremental_inputs_data): New method.
263 (Incremental_inputs::sized_create_incremental_inputs_data): New method.
264 * incremental.h: New file.
265 * layout.cc (Layout::Layout): Handle new incremental_inputs_.
266 (Layout::finalize): Create incremental inputs section in
267 incremental builds.
268 (Layout::create_incremental_info_sections): New method.
269 * layout.h (Layout::incremental_inputs): New method.
270 (Layout::create_incremental_info_sections): New method.
271 (Layout::incremental_inputs_): New field.
272 * main.cc (main): Notify Incremental_input of the command line.
273
e55bde5e
ILT
2742009-04-01 Ian Lance Taylor <iant@google.com>
275 Mikolaj Zalewski <mikolajz@google.com>
276
277 * gold.h (reserve_unordered_map): Define, three versions, one for
278 each version of Unordered_map.
279 * layout.cc (Layout::Layout): Remove options parameter. Add
280 number_of_input_files parameter. Don't initialize options_.
281 Initialize number_of_input_files_ and resized_signatures_. Move
282 sections_are_attached_.
283 (Layout::layout_group): Reserve space for group_signatures_.
284 (Layout::find_or_add_kept_section): Change name parameter to be a
285 reference. Resize signatures_ map when it gets large enough.
286 (Layout::layout_eh_frame): Use parameters->options() instead of
287 this->options_.
288 (Layout::make_output_section): Likewise.
289 (Layout::attach_allocated_section_to_segment): Likewise.
290 (Layout::finalize, Layout::create_executable_stack): Likewise.
291 (Layout::set_segment_offsets, Layout::create_interp): Likewise.
292 (Layout::finish_dynamic_section, Layout::write_binary): Likewise.
293 * layout.h (class Layout): Update declarations. Remove options_
294 field. Add number_of_input_files_ and resized_signatures_
295 fields. Move sections_are_attached_ field.
296 * main.cc (main): Pass number of input files to Layout
297 constructor. Don't pass options.
298
154b857c
ILT
2992009-03-30 Ian Lance Taylor <iant@google.com>
300
301 * ffsll.c (ffsll): Correct implementation.
302
2f35ab9b
ILT
3032009-03-27 Ian Lance Taylor <iant@google.com>
304
fd03461a
ILT
305 * ffsll.c: New file.
306 * configure.ac: Call AC_REPLACE_FUNCS on ffsll.
307 * gold.h (ffsll): Declare if HAVE_FFSLL is not defined.
308 * ftruncate.c (ftruncate): Declare before definition.
309 * mremap.c (mremap): Likewise.
310 * pread.c (pread): Likewise.
311 * configure, Makefile.in, config.in: Rebuild.
312
2f35ab9b
ILT
313 * mremap.c: New file.
314 * configure.ac: Call AC_REPLACE_FUNCS on mremap.
315 * gold.h (MREMAP_MAYMOVE): Define if HAVE_MREMAP is not defined.
316 (mremap): Declare if HAVE_MREMAP is not defined.
317 * configure, Makefile.in, config.in: Rebuild.
318
33aea2fd
CC
3192009-03-27 Cary Coutant <ccoutant@google.com>
320
321 * powerpc.cc (Target_powerpc::check_non_pic): Assert that output is
322 position independent.
323 * sparc.cc (Target_sparc::check_non_pic): Likewise.
324 * x86_64.cc (Target_x86_64::check_non_pic): Likewise.
325
6d479619
CC
3262009-03-24 Cary Coutant <ccoutant@google.com>
327
328 * symtab.h (needs_plt_entry): Check for unsatisfied reference from
329 an executable.
330 (needs_dynamic_reloc): Likewise.
331
afc06bb8
ILT
3322009-03-24 Ian Lance Taylor <iant@google.com>
333
334 * yyscript.y (file_cmd): Recognize EXTERN.
335 (extern_name_list, extern_name_list_body): New nonterminals.
336 * script.cc (script_add_extern): Define.
337 * script-c.h (script_add_extern): Declare.
338
f6060a4d
ILT
3392009-03-24 Rafael Avila de Espindola <espindola@google.com>
340
341 * object.cc (is_elf_object): Define.
342 * object.h (is_elf_object): Declare.
343 * archive.cc (Archive::get_elf_object_for_member): Call
344 is_elf_object.
33aea2fd 345 * readsyms.cc (Read_symbols::do_read_symbols): Likewise.
f6060a4d 346
26736d8e
ILT
3472009-03-24 Elliott Hughes <enh@google.com>
348
349 * output.cc (Output_file::map_anonymous): Define.
350 (Output_file::map): Use map_anonymous. If the regular mmap fails,
351 try an anonymous one. Report the size if the mmap fails.
352 * output.h (class Output_file): Declare map_anonymous.
353
22fd9730
ILT
3542009-03-24 Ian Lance Taylor <iant@google.com>
355
356 * target-select.cc (instantiate_target): Don't acquire the lock if
357 the instantiated_target_ field has already been set.
358
cb010894
ILT
3592009-03-23 Ian Lance Taylor <iant@google.com>
360
7f055c20
ILT
361 * gold-threads.h (class Initialize_lock): Define.
362 * gold-threads.cc (class Initialize_lock_once): Define.
363 (initialize_lock_control): New static variable.
364 (initialize_lock_pointer): New static variable.
365 (initialize_lock_once): New static function.
366 (Initialize_lock::Initialize_lock): Define.
367 (Initialize_lock::initialize): Define.
368 * target-select.h: Include "gold-threads.h".
369 (class Target_selector): Add lock_ and initialize_lock_ fields.
370 Don't define instantiate_target, just declare it.
371 * target-select.cc (Target_selector::Target_selector): Initialize
372 new fields.
373 (Target_selector::instantiate_target): Define.
374 * descriptors.h: Include "gold-threads.h".
375 (class Descriptors): Add initialize_lock_ field.
376 * descriptors.cc (Descriptors::Descriptors): Initialize new
377 field.
378 (Descriptors::open): Use initialize_lock_ field
379 * errors.h (class Errors): Add initialize_lock_ field.
380 * errors.cc (Errors::Errors): Initialize new field.
381 (Errors::initialize_lock): Use initialize_lock_ field.
382 * powerpc.cc (class Target_selector_powerpc): Remove
383 instantiated_target_ field. In do_recognize call
384 instantiate_target rather than do_instantiate_target. In
385 do_instantiate_target just allocate a new target.
386 * sparc.cc (class Target_selector_sparc): Likewise.
387
36959681
ILT
388 * freebsd.h: New file.
389 * i386.cc: Include "freebsd.h".
390 (Target_i386): Derive from Target_freebsd rather than
391 Sized_target.
392 (Target_selector_i386): Derive from Target_selector_freebsd rather
393 than Target_selector.
394 * x86_64.cc: Include "freebsd.h".
395 (Target_x86_64): Derive from Target_freebsd rather than
396 Sized_target.
397 (Target_selector_x86_64): Derive from Target_selector_freebsd
398 rather than Target_selector.
399 * target.h (class Target): Add adjust_elf_header and
400 do_adjust_elf_header.
401 * output.cc (Output_file_header:: do_sized_write): Call target
402 adjust_elf_header routine.
403 * configure.tgt: Set targ_osabi.
404 * configure.ac: Define GOLD_DEFAULT_OSABI.
405 * parameters.cc (Parameters::default_target): Pass
406 GOLD_DEFAULT_OSABI to select_target.
407 * target-select.h (class Target_selector): Make instantiate_target
408 protected rather than private.
409 * Makefile.am (HFILES): Add freebsd.h.
410 * configure, Makefile.in, config.in: Rebuild.
411
cb010894
ILT
412 * merge.cc (do_add_input_section): Correct pend value. Change
413 message about last entry not being null terminated from error to
414 warning.
415
0e879927
ILT
4162009-03-20 Mikolaj Zalewski <mikolajz@google.com>
417
418 * incremental.cc: New file.
419 * Makefile.am (CCFILES): Add incremental.cc.
420 * Makefile.in: Rebuild.
421
41105937
PP
4222009-03-19 Paul Pluzhnikov <ppluzhnikov@google.com>
423
424 * layout.cc (Layout::output_section_name): Preserve names
425 of '.note.' sections.
426
60439920
ILT
4272009-03-19 Ian Lance Taylor <iant@google.com>
428
429 * descriptors.cc (Descriptors::open): Check that the options are
430 valid before using them.
431
0d371ad3
ILT
4322009-03-18 Ian Lance Taylor <iant@google.com>
433
434 * script-sections.h: Include <list>.
435 (class Script_sections): Change Sections_elements from std::vector
436 to std::list. Typedef public Elements_iterator. Add
437 orphan_section_placement_, data_segment_align_start_, and
438 saw_data_segment_align_ fields. Remove data_segment_align_index_
439 field.
440 * script-sections.cc (class Orphan_section_placement): New class.
441 (class Sections_element): Add virtual functions is_relro and
442 orphan_section_init. Remove virtual function place_orphan_here.
443 (class Output_section_definition): Add is_relro and
444 orphan_section_init. Remove place_orphan_here.
445 (class Orphan_output_section): Likewise.
446 (Script_sections::Script_sections): Update for field changes.
447 (Script_sections::data_segment_align): Set saw_data_segment_align_
448 and data_segment_align_start_, not data_segment_align_index.
449 (Script_sections::data_segment_relro_end): Check
450 saw_data_segment_align_. Use data_segment_align_start_ rather
451 than data_segment_align_index_.
452 (Script_sections::place_orphan): Rewrite to use
453 Orphan_section_placement.
454
9201d894
ILT
4552009-03-17 Ian Lance Taylor <iant@google.com>
456
9c5b8369
ILT
457 * archive.cc (Archive::add_symbols): Check for a version attached
458 to the symbol name in the archive map.
459 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_11.
460 (ver_test_11_SOURCES, ver_test_11_DEPENDENCIES): Define.
461 (ver_test_11_LDFLAGS, ver_test_11_LDADD): Define.
462 (ver_test_11.a): New target.
463 * testsuite/Makefile.in: Rebuild.
464
9201d894
ILT
465 * configure.ac: Check for chsize and posix_fallocate. Replace
466 ftruncate.
467 * ftruncate.c: New file, from gnulib.
468 * output.cc (posix_fallocate): Define dummy version if not
469 HAVE_POSIX_FALLOCATE.
470 (Output_file::map): Call posix_fallocate rather than lseek and
471 write.
472 * gold.h (ftruncate): Declare if not HAVE_FTRUNCATE.
473 * configure, Makefile.in, config.in: Rebuild.
474
ef4ab7a8
PP
4752009-03-17 Paul Pluzhnikov <ppluzhnikov@google.com>
476
477 * layout.h (Layout::create_note): Add section_name parameter.
478 * layout.cc (Layout::create_note): Likewise.
479 (Layout::create_build_id, Layout::create_gold_note): Fix callers.
480
8c500701
ILT
4812009-03-17 Ian Lance Taylor <iant@google.com>
482
e85b18e1
ILT
483 * descriptors.cc: Include "options.h".
484 (FD_CLOEXEC, O_CLOEXEC): Define if not defined.
485 (Descriptors::open): Always use O_CLOEXEC when opening a new
486 descriptor. If we have a plugin, and O_CLOEXEC was not defined,
487 then set FD_CLOEXEC.
488
9efe6174
ILT
489 * sparc.cc (class Target_sparc): Add has_got_section.
490 (Target_sparc::Scan::global): If we see _GLOBAL_OFFSET_TABLE_,
491 make sure we have a GOT section.
492
493 * sparc.cc (optimize_tls_reloc): Recognize R_SPARC_TLS_IE_ADD.
494 (Target_sparc::Scan::local): Likewise.
495 (Target_sparc::Scan::global): Likewise.
496 (Target_sparc::Relocate::relocate): Likewise.
497 (Target_sparc::Relocate::relocate_tls): Likewise.
498
8c500701
ILT
499 * symtab.cc (Symbol_table::define_default_version): New function,
500 broken out of add_from_object.
501 (Symbol_table::add_from_object): Call define_default_version.
502 (Symbol_table::define_special_symbol): Add resolve_oldsym
503 parameter. Change all callers. If the version for a symbol comes
504 from a version script, resolve it with the symbol with the same
505 name with no version. Also add the symbol without a version if
506 appropriate.
507 (do_define_in_output_data): If resolving with oldsym, don't delete
508 sym.
509 (do_define_in_output_segment): Likewise.
510 (do_define_as_constant): Likewise.
511 * symtab.h (class Symbol_table): Update declarations.
512
f1ed28fb
ILT
5132009-03-13 Ian Lance Taylor <iant@google.com>
514
15f8229b
ILT
515 * readsyms.cc (Read_symbols::incompatible_warning): New function.
516 (Read_symbols::requeue): New function.
517 (Read_symbols::do_read_symbols): If make_elf_object fails because
518 the target type is not configured, and the file was searched for,
519 issue a warning and retry with the next directory.
520 (Add_symbols::run): If the file has an incompatible format, and
521 it was searched for, requeue the Read_symbols task. On error,
522 release the object.
523 * readsyms.h (class Read_symbols): Add dirindex_ field. Add
524 dirindex parameter to constructor. Change all callers. Declare
525 incompatible_warning and requeue.
526 (class Add_symbols): Add dirpath_, dirindex_, mapfile_,
527 input_argument_ and input_group_ fields. Add them to
528 constructor. Change all callers.
529 (class Read_script): Add dirindex_ field. Add it to constructor.
530 Change all callers.
531 * archive.cc (Archive::setup): Remove input_objects parameter.
532 Change all callers.
533 (Archive::get_file_and_offset): Likewise.
534 (Archive::read_all_symbols): Likewise.
535 (Archive::read_symbols): Likewise.
536 (Archive::get_elf_object_for_member): Remove input_objects
537 parameter. Add punconfigured parameter. Change all callers.
538 (Archive::add_symbols): Change return type to bool. Check return
539 value of include_member.
540 (Archive::include_all_members): Likewise.
541 (Archive::include_member): Change return type to bool. Return
542 false if first included object has incompatible target. Set
543 included_member_ field.
544 (Add_archive_symbols::run): If add_symbols returns false, requeue
545 Read_symbols task.
546 * archive.h (class Archive): Add included_member_ field.
547 Initialize it in constructor. Add input_file and searched_for
548 methods. Update declarations.
549 (class Add_archive_symbols): Add dirpath_, dirindex_, and
550 input_argument_ fields. Add them to constructor. Change all
551 callers.
552 * script.cc: Include "target-select.h".
553 (class Parser_closure): Add skip_on_incompatible_target_ and
554 found_incompatible_target_ fields. Add
555 skip_on_incompatible_target parameter to constructor. Change all
556 callers. Add methods skip_on_incompatible_target,
557 clear_skip_on_incompatible_target, found_incompatible_target, and
558 set_found_incompatible_target.
559 (read_input_script): Add dirindex parameter. Change all callers.
560 If parser finds an incompatible target, requeue Read_symbols
561 task.
562 (script_set_symbol): Clear skip_on_incompatible_target in
563 closure.
564 (script_add_assertion, script_parse_option): Likewise.
565 (script_start_sections, script_add_phdr): Likewise.
566 (script_check_output_format): New function.
567 * script.h (read_input_script): Update declaration.
568 * script-c.h (script_check_output_format): Declare.
569 * yyscript.y (file_cmd): Handle OUTPUT_FORMAT.
570 (ignore_cmd): Remove OUTPUT_FORMAT.
571 * fileread.cc (Input_file::Input_file): Add explicit this.
572 (Input_file::will_search_for): New function.
573 (Input_file::open): Add pindex parameter. Change all callers.
574 * fileread.h (class Input_file): Add input_file_argument method.
575 Declare will_search_for. Update declarations.
576 * object.cc (make_elf_object): Add punconfigured parameter.
577 Change all callers.
578 * object.h (class Object): Make input_file public. Add
579 searched_for method.
580 (make_elf_object): Update declaration.
581 * dirsearch.cc (Dirsearch::find): Add pindex parameter. Use it to
582 restart search.
583 * dirsearch.h (class Dirsearch): Update declaration.
584 * options.h (class General_options): Add --warn-search-mismatch.
585 * parameters.cc (Parameters::is_compatible_target): New function.
586 * parameters.h (class Parameters): Declare is_compatible_target.
587 * workqueue.cc (Workqueue::add_blocker): New function.
588 * workqueue.h (class Workqueue): Declare add_blocker.
589
f1ed28fb
ILT
590 * fileread.cc (Input_file::open): Remove options parameter.
591 Change all callers.
592 (Input_file::open_binary): Likewise.
593 * script.cc (read_input_script): Likewise.
594 * readsyms.h (class Read_symbols): Remove options_ field. Remove
595 options parameter from constructor. Change all callers.
596 (class Read_script): Likewise.
597 * fileread.h (class Input_file): Update declarations.
598 * script.h (read_input_script): Update declaration.
599
34dd024a
NC
6002009-03-10 Nick Clifton <nickc@redhat.com>
601
602 * po/es.po: New Spanish translation.
603
6d71b17c
CC
6042009-03-06 Cary Coutant <ccoutant@google.com>
605
606 * options.cc (parse_short_option): Keep dash_z from registering itself.
607
031cdbed
ILT
6082009-03-03 Ian Lance Taylor <iant@google.com>
609
610 PR 9918
611 * target-reloc.h (relocate_section): Pass output_section to
612 relocate.
613 * i386.cc (Target_i386::should_apply_static_reloc): Add
614 output_section parameter. Change all callers.
615 (Target_i386::Relocate::relocate): Add output_section parameter.
616 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
617 * sparc.cc (Target_sparc::Relocate::relocate): Likewise.
618 * powerpc.cc (Target_powerpc::Relocate::relocate): Likewise.
619 * testsuite/two_file_shared.sh: New script.
620 * testsuite/Makefile.am (check_SCRIPTS): Add two_file_shared.sh.
621 (check_DATA): Add two_file_shared.dbg.
622 (two_file_shared.dbg): New target.
623 * testsuite/Makefile.in: Rebuild.
624
15d5fa16
ILT
6252009-03-01 Ian Lance Taylor <iant@google.com>
626
627 * configure.ac: Check for byteswap.h.
628 * configure: Rebuild.
629 * config.in: Rebuild.
630
8a4c0b0d
ILT
6312009-03-01 Mikolaj Zalewski <mikolajz@google.com>
632
633 * layout.cc (Layout::find_or_add_kept_section): New function.
634 (Layout::add_comdat): Removed.
635 * layout.h (struct Kept_section): Move out of class Layout.
636 Remove trailing underscores from field names. Add group_sections
637 field. Rename group_ field to is_group. Change all uses.
638 (class Layout): Declare find_or_add_kept_section, not add_comdat.
639 * object.cc (Sized_relobj::Sized_relobj): Don't initialize
640 comdat_groups_ field.
641 (Sized_relobj::include_section_group): Use
642 find_or_add_kept_section and Kept_section::group_sections.
643 (Sized_relobj::include_linkonce_section): Likewise.
644 * object.cc (class Sized_relobj): Don't define Comdat_group or
645 Comdat_group_table. Remove find_comdat_group and
646 add_comdat_group. Remove comdat_groups_ field.
647 * plugin.cc (include_comdat_group): Use
648 Layout::find_or_add_kept_section.
649
b4ecf66b
ILT
6502009-02-28 Ian Lance Taylor <iant@google.com>
651
14359ca0
ILT
652 * README: --gc-sections and map files are now supported. Document
653 some build requirements.
654
b4ecf66b
ILT
655 PR 6992
656 * symtab.cc (Symbol_table::sized_write_section_symbol): In a
657 relocatable link set the value of the section symbol to zero.
658 * object.cc (Sized_relobj::do_finalize_local_symbols): In a
659 relocatable link don't include the section address in the local
660 symbol value.
661
0602e05a
ILT
6622009-02-27 Ian Lance Taylor <iant@google.com>
663
fd9d194f
ILT
664 PR 6811
665 * options.h (class Search_directory): Add is_system_directory.
666 (class General_options): Declare is_in_system_directory.
667 * options.cc (get_relative_sysroot): Make static.
668 (get_default_sysroot): Make static.
669 (General_optoins::is_in_system_directory): New function.
670 * fileread.cc (Input_file::is_in_system_directory): New function.
671 * fileread.h (class Input_file): Declare is_in_system_directory.
672 * object.h (class Object): Add is_in_system_directory.
673 (class Input_objects): Remove system_library_directory_ field.
674 * object.cc (Input_objects::add_object): Don't set
675 system_library_directory_.
676 (input_objects::found_in_system_library_directory): Remove.
677 * symtab.cc (Symbol_table::write_globals): Remove input_objects
678 parameter. Change all callers.
679 (Symbol_table::sized_write_globals): Likewise.
680 (Symbol_table::warn_about_undefined_dynobj_symbol): Likewise.
681 Call Object::is_in_system_directory.
682 * symtab.h (class Symbol_table): Update declarations.
683
61edd21f
ILT
684 PR 5990
685 * descriptors.h (Open_descriptor): Add is_on_stack field.
686 * descriptors.cc (Descriptors::open): If the descriptor is on the
687 top of the stack, remove it. Initialize is_on_stack field.
688 (Descriptors::release): Only add pod to stack if it is not on the
689 stack already.
690 (Descriptors::close_some_descriptor): Clear stack_next and
691 is_on_stack fields.
692
e29e076a
ILT
693 PR 7091
694 * output.cc (Output_section::find_starting_output_address): Rename
695 from starting_output_address; add PADDR parameter; change return
696 type.
697 * output.h (class Output_section): Declare
698 find_starting_output_address instead of starting_output_address.
699 * object.cc (Sized_relobj::do_finalize_local_symbols): Handle a
700 section symbol for which we can't find a merge section.
701
0602e05a
ILT
702 PR 9836
703 * symtab.cc (Symbol_table::add_from_object): If the visibility is
704 hidden or internal, force the symbol to be local.
705 * resolve.cc (Symbol::override_visibility): Define.
706 (Symbol::override_base): Use override_visibility.
707 (Symbol_table::resolve): Likewise.
708 (Symbol::override_base_with_special): Likewise.
709 (Symbol_table::override_with_special): If the visibility is hidden
710 or internal, force the symbol to be local.
711 * symtab.h (class Symbol): Add set_visibility and
712 override_visibility.
713 * testsuite/ver_test_1.sh: New file.
714 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_1.sh.
715 (check_DATA): Add ver_test_1.syms.
716 (ver_test_1.syms): New target.
717 * testsuite/Makefile.in: Rebuild.
718
401a9a73
CC
7192009-02-25 Cary Coutant <ccoutant@google.com>
720
721 * layout.cc (Layout::choose_output_section): Don't rename sections
722 when using a linker script that has a SECTIONS clause.
723 * Makefile.in: Regenerate.
724
725 * testsuite/Makefile.am (script_test_5.sh): New test case.
726 * testsuite/Makefile.in: Regenerate.
727 * testsuite/script_test_5.cc: New file.
728 * testsuite/script_test_5.sh: New file.
729 * testsuite/script_test_5.t: New file.
730
f488e4b0
CC
7312009-02-13 Rafael Avila de Espindola <espindola@google.com>
732
733 * archive.cc (Archive::include_member): Update calls to add_symbols.
734 * dynobj.cc (Sized_dynobj<size, big_endian>::make_version_map): Add
735 the Layout argument.
736 * dynobj.h (do_add_symbols): Add the Layout argument.
737 * object.cc (Sized_relobj<size, big_endian>::do_add_symbols): Add the
738 Layout argument.
739 * object.h (Object::add_symbols): Add the Layout argument.
740 (Object::do_add_symbols): Add the Layout argument.
741 (Sized_relobj::do_add_symbols): Add the Layout argument.
742 * plugin.cc (Sized_pluginobj<size, big_endian>::do_add_symbols):
743 Unify the two versions.
744 (Add_plugin_symbols): Remove.
745 * plugin.h (Pluginobj::add_symbols, Pluginobj::do_add_symbols): Remove.
746 (Sized_pluginobj::do_add_symbols): Unify the two versions.
747 (Add_plugin_symbols): Remove.
748 * readsyms.cc (Read_symbols::do_read_symbols): Update call to
749 Add_symbols. Use Add_symbols instead of Add_plugin_symbols.
750 (Add_symbols::run): Make it work with Pulginobj.
751
89dd1680
ILT
7522009-02-06 Ian Lance Taylor <iant@google.com>
753
754 * object.cc (Sized_relobj::do_layout): Make info message start
755 with lower case letter.
756
266d0a74
ILT
7572009-02-06 Mikolaj Zalewski <mikolajz@google.com>
758
602b464e
ILT
759 * binary.cc: Fix file comment.
760
266d0a74
ILT
761 * options.h (enum Incremental_disposition): Define.
762 (class General_options): Add new options: --incremental,
763 --incremental_changed, --incremental_unchanged,
764 --incremental_unknown. Add incremental_disposition_ and
765 implicit_incremental_ fields.
766 (General_options::incremental_disposition): New function.
767 (class Position_dependent_options): Add incremental_disposition
768 option.
769 (Position_dependent_options::copy_from_options): Set incremental
770 dispositions.
771 * options.cc (General_options::parse_incremental_changed): New
772 function.
773 (General_options::parse_incremental_unchanged): New function.
774 (General_options::parse_incremental_unknown): New function.
775 (General_options::General_options): Initialize new fields
776 incremental_disposition_ and implicit_incremental_.
777 (General_options::finalize): Check for uasge of --incremental-*
778 without --incremental.
779
f073bbf7
CD
7802009-02-06 Chris Demetriou <cgd@google.com>
781
782 * gold.h (gold_undefined_symbol): Change to take only a Symbol
783 pointer and to report location as the file name associated with
784 the symbol.
785 (gold_undefined_symbol_at_location): New function to replace the
786 old gold_undefined_symbol functionality.
787 * target-reloc.h (relocate_section): Update to use
788 gold_undefined_symbol_at_location.
789 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
790 Call gold_undefined_symbol function rather than gold_error.
791 * errors.h (Errors::undefined_symbol): Take location as a
792 string, rather than calculating it from a relocation.
793 * errors.cc (Errors::fatal): Print "fatal error:" before the
794 formatted message.
795 (Errors::error, Errors::error_at_location): Print "error: "
796 before the formatted message.
797 (Errors::undefined_symbol): Take location as a string, rather
798 than calculating it from a relocation.
799 (gold_undefined_symbol_at_location): New function akin to
800 old gold_undefined_symbol, calculates location from relocation.
801 (gold_undefined_symbol): Change to take only a Symbol pointer
802 and to report location as the file name associated with the symbol.
803 * testsuite/debug_msg.sh: Update for changed error messages.
804 * testsuite/undef_symbol.sh: Likewise.
805
8e94a90c
ILT
8062009-02-04 Duncan Sands <baldrick@free.fr>
807
808 PR 9812
809 * reduced_debug_output.h
810 (Output_reduced_debug_abbrev_section::failed): Use format for
811 gold_warning.
812 (Output_reduced_debug_info_section::faild): Likewise.
813
88a0e15b
ILT
8142009-01-31 Mikolaj Zalewski <mikolajz@google.com>
815
816 * script.cc (Lazy_demangler): New class.
817 (Version_script_info::get_symbol_version_helper): Demangle a
818 symbol only once.
819
5efc7cd2
CC
8202009-01-29 Cary Coutant <ccoutant@google.com>
821
822 * i386.cc (Target_i386::Relocate::relocate): Recognize non-PIC calls
823 to __tls_get_addr.
824 * x86_64.cc (Target_x86_64::Relocate::relocate): Likewise.
825
e0ebcf42
ILT
8262009-01-28 Ian Lance Taylor <iant@google.com>
827
5efc7cd2 828 * version.cc (version_string): Bump to 1.9.
75fe7426 829
e0ebcf42
ILT
830 * gold.h: Include <cstring> and <stdint.h>.
831 * version.cc: Include <cstdio>.
832 * object.cc (Sized_relobj::do_layout): Initialize gc_sd to avoid a
833 warning.
834 * reduced_debug_output.cc (insert_into_vector): Rename from
835 Insert_into_vector; change all callers. Use Swap_unaligned to
836 avoid aliasing issue; remove union since it is unnecessary.
837
8e2813be 8382009-01-27 Sriraman Tallam <tmsriram@google.com>
6d03d481
ST
839
840 * Makefile.am (CCFILES): Add gc.cc.
841 (HFILES): Add gc.h.
842 * Makefile.in: Regenerate.
843 * gold.cc (Gc_runner): New class.
844 (queue_initial_tasks): Call garbage collection related tasks
845 when corresponding options are invoked.
846 (queue_middle_gc_tasks): New function.
847 (queue_middle_tasks): Reorder tasks to allow relocs to be read and
848 processed early before laying out sections during garbage collection.
849 * gold.h (queue_middle_gc_tasks): New function.
850 (is_prefix_of): Move from "layout.cc".
851 * i386.cc (Target_i386::gc_process_relocs): New function.
852 * layout.cc (is_prefix_of): Remove. Move to "gold.h"
853 * main.cc (main): Create object of class "Garbage_collection".
854 * object.cc (Relobj::copy_symbols_data): New function.
855 (Relobj::is_section_name_included): New function.
856 (Sized_relobj::do_layout): Allow this function to be called twice
857 during garbage collection and defer layout of section during the
858 first call.
859 * object.h (Relobj::get_symbols_data): New function.
860 (Relobj::is_section_name_included): New function.
861 (Relobj::copy_symbols_data): New function.
862 (Relobj::set_symbols_data): New function.
863 (Relobj::get_relocs_data): New function.
864 (Relobj::set_relocs_data): New function.
865 (Relobj::is_output_section_offset_invalid): New pure virtual function.
866 (Relobj::gc_process_relocs): New function.
867 (Relobj::do_gc_process_relocs): New pure virtual function.
868 (Relobj::sd_): New data member.
869 (Sized_relobj::is_output_section_offset_invalid): New function.
870 (Sized_relobj::do_gc_process_relocs): New function.
871 * options.h (General_options::gc_sections): Modify to not be a no-op.
872 (General_options::print_gc_sections): New option.
873 * plugin.cc (Plugin_finish::run): Remove function call to
874 Plugin_manager::layout_deferred_objects. Move it to "gold.cc".
875 * powerpc.cc (Target_powerpc::gc_process_relocs): New function.
876 * reloc.cc (Read_relocs::run): Add task to process relocs and
877 determine unreferenced sections when doing garbage collection.
878 (Gc_process_relocs): New class.
879 (Sized_relobj::do_gc_process_relocs): New function.
880 (Sized_relobj::do_scan_relocs): Don't try to scan the relocs for
881 sections that are garbage collected.
882 * reloc.h (Gc_process_relocs): New class.
883 * sparc.cc (Target_sparc::gc_process_relocs): New function.
884 * symtab.cc (Symbol::should_add_dynsym_entry): Do not add entries for
885 symbols whose corresponding sections are garbage collected.
886 (Symbol_table::Symbol_table): Add new parameter for the garbage
887 collection object.
888 (Symbol_table::gc_mark_undef_symbols): New function.
889 (Symbol_table::gc_mark_symbol_for_shlib): New function.
890 (Symbol_table::gc_mark_dyn_syms): New function.
891 (Symbol_table::resolve): Do not treat symbols seen in dynamic objects
892 as garbage.
893 (Symbol_table::add_from_object): Likewise.
894 (Symbol_table::add_from_relobj): When building shared objects, do not
895 treat externally visible symbols as garbage.
896 (Symbol_table::sized_finalize_symbol): Do not check dynamic symbol
897 table information for static and relocatable links.
898 * symtab.h (Symbol_table::set_gc): New function.
899 (Symbol_table::gc): New function.
900 (Symbol_table::gc_mark_undef_symbols): New function.
901 (Symbol_table::gc_mark_symbol_for_shlib): New function.
902 (Symbol_table::gc_mark_dyn_syms): New function.
903 (Symbol_table::gc_): New data member.
904 * target.h (Sized_target::gc_process_relocs): New pure virtual
905 function.
906 * x86_64.cc (Target_x86_64::gc_process_relocs): New function.
907 * testsuite/testfile.cc (Target_test::gc_process_relocs): New function.
908
3b293544
CF
9092009-01-20 Chris Faylor <me.sourceware@sourceware.org>
910
911 * options.h (General_options::gc_sections): Define as a no-op for now.
912 (General_options::no_keep_memory): Ditto.
913 (General_options::Bshareable): Define.
914 * options.cc (General_options::finalize): Honor -Bshareable.
915
83d22aa8
AS
9162009-01-20 Andreas Schwab <schwab@suse.de>
917
918 * powerpc.cc (Powerpc_relocate_functions::rel16_ha): Don't try to
919 read the value in the contents, since we don't use it. Use the
920 template endianness when writing.
921 (Relocate::relocate): Use it for R_PPC_REL16_HA.
922
cd536b21
AS
9232009-01-19 Andreas Schwab <schwab@suse.de>
924
925 * configure.tgt (powerpc64-*): Fix targ_obj.
926
99e9a495
ILT
9272009-01-15 Ian Lance Taylor <iant@google.com>
928
929 * object.cc (Sized_relobj::write_local_symbols): Don't write out
930 local symbols when stripping all symbols.
931
bbbfea06
CC
9322009-01-14 Cary Coutant <ccoutant@google.com>
933
99e9a495 934 * output.cc (Output_reloc): Add explicit instantiations.
bbbfea06 935
0f7c0701
CC
9362009-01-14 Cary Coutant <ccoutant@google.com>
937
938 * archive.cc (Archive::get_elf_object_for_member): Remove call
939 to File_read::claim_for_plugin.
940 * descriptors.cc (Descriptors::open): Remove reference to
941 is_claimed.
942 (Descriptors::claim_for_plugin): Remove.
943 * descriptors.h (Descriptors::claim_for_plugin): Remove.
944 (Descriptors::is_claimed): Remove.
945 (claim_descriptor_for_plugin): Remove.
946 * fileread.cc (File_read::claim_for_plugin): Remove.
947 * fileread.h (File_read::claim_for_plugin): Remove.
948 (File_read::descriptor): Reopen descriptor if necessary.
949 * plugin.cc (Plugin::load): Add two new APIs to transfer vector.
950 (Plugin_manager::all_symbols_read): Add task parameter. Change
951 all callers.
952 (Plugin_manager::get_input_file): New function.
953 (Plugin_manager::release_input_file): New function.
954 (Pluginobj::Pluginobj): Add filesize parameter and initialize
955 corresponding data member.
956 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter
957 and pass to base constructor. Change all callers.
958 (get_input_file, release_input_file): New functions.
959 (make_sized_plugin_object): Add filesize parameter. Change all callers.
960 * plugin.h (Plugin_manager::Plugin_manager): Initialize task_ member.
961 (Plugin_manager::all_symbols_read): Add task parameter.
962 (Plugin_manager::get_input_file): New function.
963 (Plugin_manager::release_input_file): New function.
964 (Plugin_manager::task_): New data member.
965 (Pluginobj::Pluginobj): Add filesize parameter.
966 (Pluginobj::filename): New function.
967 (Pluginobj::descriptor): New function.
968 (Pluginobj::filesize): New function.
969 (Pluginobj::filesize_): New data member.
970 (Sized_pluginobj::Sized_pluginobj): Add filesize parameter.
971 * readsyms.cc (Read_symbols::do_read_symbols): Remove call to
972 File_read::claim_for_plugin; use Object::unlock to unlock the file.
973
974 * testsuite/Makefile.am (plugin_test_4): New test case for plugins
975 with archive libraries.
976 * testsuite/Makefile.in: Regenerate.
977 * testsuite/plugin_test.c (struct sym_info): New type.
978 (get_input_file, release_input_file): New static variables.
979 (onload): Capture new transfer vector entries.
980 (claim_file_hook): Stop reading at end of file according to filesize.
981 Factor out parsing of readelf output into separate function.
982 (all_symbols_read_hook): Exercise get_input_file and release_input_file
983 APIs and get the source file name from the symbol table. Convert
984 source file name to corresponding object file name. Print info
985 message when adding new input files.
986 (parse_readelf_line): New function.
987 * testsuite/plugin_test_1.sh: Add checks for new info messages.
988 * testsuite/plugin_test_2.sh: Likewise.
989 * testsuite/plugin_test_3.sh: Likewise.
990 * testsuite/plugin_test_4.sh: New test case.
991
62a6d109
ILT
9922009-01-07 Ian Lance Taylor <iant@google.com>
993
994 * version.cc (version_string): Bump to 1.8.
995
483620e8
CC
9962008-12-23 Cary Coutant <ccoutant@google.com>
997
998 * gold.cc (gold_exit): Call plugin cleanup handlers on exit.
999 * plugin.cc (Plugin_manager::finish): Rename as
1000 layout_deferred_objects. Move cleanup to separate function.
1001 (Plugin_manager::cleanup): New function.
1002 (Plugin_finish::run): Call layout_deferred_objects and cleanup
1003 separately.
1004 * plugin.h (Plugin_manager::finish): Rename as
1005 layout_deferred_objects.
1006 (Plugin_manager::cleanup): New function.
1007 (Plugin_manager::cleanup_done): New field.
1008
d66a9eb3
CC
10092008-12-23 Cary Coutant <ccoutant@google.com>
1010
1011 * plugin.cc (is_visible_from_outside): New function.
1012 (Pluginobj::get_symbol_resolution_info): Call is_visible_from_outside
1013 so we don't return "IR only" status for exported symbols or -r links.
1014
1015 * testsuite/Makefile.am (plugin_test_3): New test case.
1016 * testsuite/Makefile.in: Regenerate.
1017 * testsuite/plugin_test_3.sh: New file.
1018
5995b570
CC
10192008-12-22 Cary Coutant <ccoutant@google.com>
1020
1021 * object.cc (Sized_relobj::layout_section): New function.
1022 (Sized_relobj::do_layout): Defer layout of input sections until after
1023 plugin has provided replacement files.
1024 (Sized_relobj::do_layout_deferred_sections): New function.
1025 * object.h (Relobj::set_section_offset): Remove virtual keyword.
1026 (Relobj::layout_deferred_sections): New function.
1027 (Relobj::do_layout_deferred_sections): New function.
1028 (Sized_relobj::do_layout_deferred_sections): New function.
1029 (Sized_relobj::layout_section): New function.
1030 (Sized_relobj::Deferred_layout): New structure.
1031 (Sized_relobj::deferred_layout_): New field.
1032 * plugin.cc (Plugin_manager::finish): Renamed, was cleanup.
1033 Change all callers. Layout deferred sections.
1034 (class Plugin_finish): Renamed, was Plugin_cleanup. Change all
1035 references.
1036 (Plugin_hook::run): Move code from do_plugin_hook inline.
1037 (Plugin_hook::do_plugin_hook): Remove.
1038 * plugin.h (Plugin_manager::Plugin_manager): Add missing initializers.
1039 (Plugin_manager::finish): Renamed, was cleanup.
1040 (Plugin_manager::should_defer_layout): New function.
1041 (Plugin_manager::add_deferred_layout_object): New function.
1042 (Plugin_manager::Deferred_layout_list): New type.
1043 (Plugin_manager::deferred_layout_objects_): New field.
1044 (Plugin_hook::do_plugin_hook): Remove.
1045
ee769c88
ILT
10462008-12-17 Ian Lance Taylor <iant@google.com>
1047
1048 * options.h (class General_options): Add --no case for
1049 --export-dynamic.
1050
abc8dcba
CC
10512008-12-16 Cary Coutant <ccoutant@google.com>
1052
1053 * plugin.cc (Plugin::load): Move LDPT_MESSAGE to front of transfer
1054 vector.
1055 (Plugin_manager::claim_file): Create plugin object even if
1056 plugin did not call the add_symbols callback.
1057 (Plugin_obj::get_symbol_resolution_info): Guard against plugin
1058 asking for more symbols than were added.
1059 * testsuite/Makefile.am (plugin_test_1): Add test case with
1060 no global symbols.
1061 (empty.syms): New target.
1062 * testsuite/Makefile.in: Regenerate.
1063 * testsuite/plugin_test.c (claim_file_hook): Add new debug
1064 message. Don't call add_symbols if no globals.
1065 (all_symbols_read_hook): Don't provide replacement for empty
1066 claimed file.
1067
b0074644
ILT
10682008-12-12 Ian Lance Taylor <iant@google.com>
1069
68943102
ILT
1070 * target-reloc.h (Default_scan_relocatable_relocs): Only discard
1071 r_type == 0 for a local symbol with r_sym == 0.
1072 (scan_relocatable_relocs): Pass r_sym to
1073 local_non_section_strategy.
1074 * reloc.cc (Emit_relocs_strategy::local_non_section_strategy): Add
1075 r_sym parameter.
1076
b0074644
ILT
1077 * configure.ac: Update test for TLS descriptors: they are
1078 supported as of glibc 2.9.
1079 * configure: Rebuild.
1080
c2508178
ILT
10812008-12-11 Ian Lance Taylor <iant@google.com>
1082
1083 PR 7091
1084 * target-reloc.h (Default_scan_relocatable_relocs): For each
1085 function, map r_type == 0 to RELOC_DISCARD.
1086
2756a258
CC
10872008-12-10 Cary Coutant <ccoutant@google.com>
1088
1089 * layout.cc (Layout::add_comdat): Allow COMDAT group from a replacement
1090 object to override a kept COMDAT group from a plugin object.
1091
bb6f53d3
ILT
10922008-12-09 Ian Lance Taylor <iant@google.com>
1093
fbc558e1
ILT
1094 PR 7088
1095 * yyscript.y (file_cmd): Handle INPUT.
1096
bb6f53d3
ILT
1097 * testsuite/initpri1.c: Change all declarations to be full
1098 prototypes by adding void, to avoid compiler warnings.
1099
4674ecfc
CC
11002008-12-05 Rafael Avila de Espindola <espindola@google.com>
1101
1102 * options.cc (General_options::parse_plugin_opt): New.
1103 (General_options::add_plugin): The argument now is just the filename.
1104 (General_options::add_plugin_option): New.
1105 * options.h (plugin_opt): New.
1106 (add_plugin): Change argument name.
1107 (add_plugin_option): New.
1108 * plugin.cc (Plugin::load): Don't parse the plugin option.
1109 * plugin.h (Plugin::Plugin): Rename argument. Init filename_.
1110 (Plugin::add_option): New.
1111 (Plugin::args_): Change type.
1112 (Plugin::filename_): New.
1113 (Plugin_manager::add_plugin_option): New.
1114 * testsuite/Makefile.am (plugin_test_1): Use new syntax.
1115 * testsuite/Makefile.in: Regenerate.
1116
fd06b4aa
CC
11172008-12-05 Cary Coutant <ccoutant@google.com>
1118
1119 * layout.cc (Layout::include_section): Check for SHF_EXCLUDE.
1120 Handle --strip-lto-sections option.
1121 * options.h (strip_lto_sections): New option.
1122
6c52134c
CC
11232008-12-01 Cary Coutant <ccoutant@google.com>
1124
1125 * plugin.cc (ld_plugin_message): Change format parameter to const.
1126 Fix mismatch between new[] and delete.
1127
a45248e0
CC
11282008-11-14 Cary Coutant <ccoutant@google.com>
1129
1130 * reloc.cc (Sized_relobj::do_read_relocs): Use constant invalid_address
1131 instead of -1U.
1132
c82fbeee
CS
11332008-11-05 Craig Silverstein <csilvers@google.com>
1134
1135 * options.cc (General_options::parse_dynamic_list): New function.
1136 * options.h (General_options): New flags dynamic_list,
1137 dynamic_list_data, dynamic_list_cpp_new, and
1138 dynamic_list_cpp_typeinfo. New variable dynamic_list_.
1139 (General_options::in_dynamic_list): New function.
1140 * script.cc (Lex::Mode): New enum DYNAMIC_LIST.
1141 (Lex::can_start_name): Add support for DYNAMIC_LIST mode.
1142 (Lex::can_continue_name): Likewise.
1143 (yylex): Likewise.
1144 (read_script_file): New parameter script_options.
1145 (read_dynamic_list): New function.
1146 (Script_options::define_dynamic_list): New function.
1147 (dynamic_list_keyword_parsecodes): New variable.
1148 (dynamic_list_keywords): New variable.
1149 * script.h (Script_options::define_dynamic_list): New function
1150 prototype.
1151 (read_dynamic_list): New function prototype.
1152 * symtab.cc (strprefix): New macro.
1153 (Symbol::should_add_dynsym_entry): Support dynamic_list,
1154 dynamic_list_data, dynamic_list_cpp_new, and
1155 dynamic_list_cpp_typeinfo.
1156 * yyscript.y (PARSING_DYNAMIC_LIST): New token.
1157 (dynamic_list_expr): New rule.
1158 (dynamic_list_nodes): Likewise.
1159 (dynamic_list_node): Likewise.
1160 * testsuite/Makefile.am (dynamic_list): New test.
1161 * testsuite/Makefile.in: Regenerated.
1162 * testsuite/dynamic_list.t: New file.
1163 * testsuite/dynamic_list.sh: New file.
1164
e0bb29a5
CS
11652008-11-05 Craig Silverstein <csilvers@google.com>
1166
1167 * testsuite/tls_test_c.c: Add prototype for t11 and t11_last.
1168 * testsuite/tls_test_c.c (t11): Add explicit "void" to prototype.
1169 (t11_last): Likewise.
1170 * testsuite/ver_test_6.c (main): Likewise.
1171
4e1e25e0
CC
11722008-10-07 Cary Coutant <ccoutant@google.com>
1173
1174 * options.c (General_options::finalize): Add check for -static and
1175 -shared.
1176 * gold.cc (queue_middle_tasks): Assert that list of dynamic objects
1177 is not empty.
1178
92f03fcb
CC
11792008-10-02 Cary Coutant <ccoutant@google.com>
1180
1181 * plugin.cc (make_sized_plugin_object): Fix conditional
1182 compilation to work when not all targets are enabled.
1183
fbd8a257
CC
11842008-09-29 Cary Coutant <ccoutant@google.com>
1185
1186 * archive.cc (Archive::get_file_and_offset): Use filename instead
1187 of name to get library path.
1188 (Archive::include_member): Unlock external member of a thin archive.
1189
1190 * testsuite/Makefile.am (TEST_AR): New variable.
1191 (thin_archive_test_1): New test.
1192 (thin_archive_test_2): New test.
81636b3f
CC
1193 * testsuite/Makefile.in: Regenerate.
1194 * testsuite/thin_archive_main.cc: New file.
1195 * testsuite/thin_archive_test_1.cc: New file.
1196 * testsuite/thin_archive_test_2.cc: New file.
1197 * testsuite/thin_archive_test_3.cc: New file.
1198 * testsuite/thin_archive_test_4.cc: New file.
fbd8a257 1199
eff45813
CC
12002008-09-29 Cary Coutant <ccoutant@google.com>
1201
1202 * mapfile.cc (Mapfile::print_input_section): Change -1U to -1ULL.
1203 * object.cc (Sized_relobj::do_layout): Use constant invalid_address
1204 instead of -1U.
1205 (Sized_relobj::do_finalize_local_symbols): Likewise.
1206 (Sized_relobj::map_to_kept_section): Likewise.
1207 * object.h (Sized_relobj::invalid_address): New constant.
1208 (Sized_relobj::do_output_section_offset): Check for invalid_address
1209 and return -1ULL.
1210 * output.cc (Output_reloc::local_section_offset): Use constant
1211 invalid_address instead of -1U.
1212 (Output_reloc::get_address): Likewise.
1213 (Output_section::output_address): Change -1U to -1ULL.
1214 * output.h (Output_reloc::invalid_address): New constant.
1215 * reloc.cc (Sized_relobj::write_sections): Use constant
1216 invalid_address instead of -1U.
1217 (Sized_relobj::relocate_sections): Likewise.
1218 * symtab.cc (Symbol_table::sized_finalize_symbol): Handle symbol
1219 values for merge sections.
1220 * target-reloc.h (relocate_for_relocatable): Use constant
1221 invalid_address instead of -1U.
1222
89fc3421
CC
12232008-09-19 Cary Coutant <ccoutant@google.com>
1224
1225 Add plugin functionality for link-time optimization (LTO).
1226 * configure.ac (plugins): Add --enable-plugins option.
1227 * configure: Regenerate.
1228 * config.in: Regenerate.
1229 * Makefile.am (LIBDL): New variable.
1230 (CCFILES): Add plugin.cc.
1231 (HFILES): Add plugin.h.
1232 (ldadd_var): Add LIBDL.
1233 * Makefile.in: Regenerate.
1234
1235 * archive.cc: Include "plugin.h".
1236 (Archive::setup): Don't preread archive symbols when using a plugin.
1237 (Archive::get_file_and_offset): Add memsize parameter. Change callers.
1238 (Archive::get_elf_object_for_member): Call plugin hooks for claiming
1239 files.
1240 (Archive::include_member): Add symbols from plugin objects.
1241 * archive.h (Archive::get_file_and_offset): Add memsize parameter.
1242 * descriptors.cc (Descriptors::open): Check for file descriptors
1243 abandoned by plugins.
1244 (Descriptors::claim_for_plugin): New function.
1245 * descriptors.h (Descriptors::claim_for_plugin): New function.
1246 (Open_descriptor::is_claimed): New field.
1247 (claim_descriptor_for_plugin): New function.
1248 * fileread.cc (File_read::claim_for_plugin): New function.
1249 * fileread.h (File_read::claim_for_plugin): New function.
1250 (File_read::descriptor): New function.
1251 * gold.cc: Include "plugin.h".
1252 (queue_initial_tasks): Add task to call plugin hooks for generating
1253 new object files.
1254 * main.cc: Include "plugin.h".
1255 (main): Load plugin libraries.
1256 * object.h (Pluginobj): Declare.
1257 (Object::pluginobj): New function.
1258 (Object::do_pluginobj): New function.
1259 (Object::set_target): New function.
1260 * options.cc: Include "plugin.h".
1261 (General_options::parse_plugin): New function.
1262 (General_options::General_options): Initialize plugins_ field.
1263 (General_options::add_plugin): New function.
1264 * options.h (Plugin_manager): Declare.
1265 (General_options): Add --plugin option.
1266 (General_options::has_plugins): New function.
1267 (General_options::plugins): New function.
1268 (General_options::add_plugin): New function.
1269 (General_options::plugins_): New field.
1270 * plugin.cc: New file.
1271 * plugin.h: New file.
1272 * readsyms.cc: Include "plugin.h".
1273 (Read_symbols::do_read_symbols): Check for archive before checking
1274 for ELF file. Call plugin hooks to claim files.
1275 * resolve.cc (Symbol_table::resolve): Record when symbol is referenced
1276 from a real object file; force override when processing replacement
1277 files.
1278 * symtab.cc (Symbol::init_fields): Initialize in_real_elf_ field.
1279 (Symbol::init_base_object): Likewise.
1280 (Symbol::init_base_output_data): Likewise.
1281 (Symbol::init_base_output_segment): Likewise.
1282 (Symbol::init_base_constant): Likewise.
1283 (Symbol::init_base_undefined): Likewise.
1284 (Symbol::output_section): Assert that object is not a plugin.
1285 (Symbol_table::add_from_pluginobj): New function.
1286 (Symbol_table::sized_finalize_symbol): Treat symbols from plugins as
1287 undefined.
1288 (Symbol_table::sized_write_globals): Likewise.
1289 (Symbol_table::add_from_pluginobj): Instantiate template.
1290 * symtab.h (Sized_pluginobj): Declare.
1291 (Symbol::in_real_elf): New function.
1292 (Symbol::set_in_real_elf): New function.
1293 (Symbol::in_real_elf_): New field.
1294 (Symbol_table::add_from_pluginobj): New function.
1295
1296 * testsuite/Makefile.am (AM_CFLAGS): New variable.
1297 (LIBDL): New variable.
1298 (LDADD): Add LIBDL.
1299 (check_PROGRAMS): Add plugin_test_1 and plugin_test_2.
1300 (check_SCRIPTS): Add plugin_test_1.sh and plugin_test_2.sh.
1301 (check_DATA): Add plugin_test_1.err and plugin_test_2.err.
1302 (MOSTLYCLEANFILES): Likewise.
1303 * testsuite/Makefile.in: Regenerate.
1304 * testsuite/plugin_test.c: New file.
1305 * testsuite/plugin_test_1.sh: New file.
1306 * testsuite/plugin_test_2.sh: New file.
1307
de31bda5
ILT
13082008-09-16 Ian Lance Taylor <iant@google.com>
1309
9c2d0ef9
ILT
1310 * target-reloc.h (relocate_section): Check whether a symbol is
1311 defined by the ABI before reporting an undefined symbol error.
1312 * target.h (Target::is_defined_by_abi): Make parameter const.
1313 (Target::do_is_defined_by_abi): Likewise.
1314 * i386.cc (Target_i386::do_is_defined_by_abi): Likewise.
1315 * powerpc.cc (Target_powerpc::do_is_defined_by_abi): Likewise.
1316 * sparc.cc (Target_sparc::do_is_defined_by_abi): Likewise.
1317 * x86_64.cc (Target_x86_64::do_is_defined_by_abi): Likewise.
1318 * testsuite/Makefile.am (tls_test_shared.so): Add -Wl,-z,defs.
1319 * testsuite/Makefile.in: Rebuild.
1320
de31bda5
ILT
1321 * fileread.cc (make_view): Add casts to avoid warning.
1322
9fa33bee
AO
13232008-09-16 Alexandre Oliva <aoliva@redhat.com>
1324
1325 * i386.cc (Target_i386::define_tls_base_symbol): Update comments.
1326 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
1327
183fd0e3
AO
13282008-09-16 Alexandre Oliva <aoliva@redhat.com>
1329
1330 * options.h (General_options::output_is_executable): New.
1331 (General_options::output_is_pie): New.
1332 * i386.cc (Target_i386::define_tls_base_symbol): Use SEGMENT_START
1333 for shared libraries.
1334 * x86_64.cc (Target_x86_64::define_tls_base_symbol): Likewise.
1335
7be8330a
CD
13362008-09-11 Chris Demetriou <cgd@google.com>
1337
1338 * options.h (origin): New -z option.
1339 * layout.cc (Layout:finish_dynamic_section): If "-z origin"
1340 is specified, set DF_ORIGIN in DT_FLAGS and set DF_1_ORIGIN
1341 in DT_FLAGS_1.
1342
a9caad02
CC
13432008-09-05 Cary Coutant <ccoutant@google.com>
1344
1345 * fileread.cc (File_read::make_view): Add check for attempt to map
1346 beyond end of file.
1347
ae6dce4d
CC
13482008-09-05 Cary Coutant <ccoutant@google.com>
1349
1350 * symtab.cc (Symbol_table::add_from_dynobj): Fix typos in
1351 explicit instantiations.
1352
d7ab2a47
KVH
13532008-08-28 Kris Van Hees <kris.van.hees@oracle.com>
1354
1355 PR gold/6858
1356 * options.cc (General_options::finalize): Allow undefined symbols
1357 in shlibs if linking -shared.
1358
1359 PR gold/6859
1360 * symtab.cc (Symbol::init_base_undefined): Mark explicitly undefined
1361 symbols as not needing a dynsym entry.
1362
1e52a9c1
CS
13632008-08-20 Craig Silverstein <csilvers@google.com>
1364
1365 * fileread.cc (File_read::open): Do not lock the file unless it
1366 was successfully opened.
1367
d85c80a3
CC
13682008-08-14 Cary Coutant <ccoutant@google.com>
1369
1370 * x86_64.cc (Target_x86_64::Relocate::relocat_tls):
1371 Use addend for DTPOFF32, DTPOFF64, and TPOFF32 relocs.
1372 * testsuite/tls_test.cc (struct int128): 128-bit struct
1373 for testing TLS relocs with non-zero addend.
1374 (v12): New TLS variable.
1375 (t12): New test.
1376 (t_last): Add check for v12.
1377 * testsuite/tls_test.h (t12): New function.
1378 * testsuite/tls_test_main.cc (thread_routine): Call new test.
1379
2d924fd9
ILT
13802008-08-13 Ian Lance Taylor <iant@google.com>
1381
1382 * layout.cc (Layout::attach_allocated_section_to_segment): Don't
1383 set tls_segment_ or relro_segment_.
1384 (Layout::make_output_segment): Set tls_segment_ and relro_segment_
1385 when appropriate.
1386 * output.h (Output_section::clear_is_relro): New function.
1387 * output.cc (Output_segment::add_output_section): Handle SHF_TLS
1388 sections specially even when output_data_ is empty.
1389 (Output_segment::maximum_alignment): When first section is relro,
1390 only force alignment for PT_LOAD segments.
1391 * script.cc (script_data_segment_align): New function.
1392 (script_data_segment_relro_end): New function.
1393 * script-c.h (script_data_segment_align): Declare.
1394 (script_data_segment_relro_end): Declare.
1395 * script-sections.h (class Script_sections): Declare
1396 data_segment_align and data_segment_relro_end. Add fields
1397 segment_align_index_ and saw_relro_end_.
1398 * script-sections.cc (class Sections_element): Add set_is_relro
1399 virtual function. Add new bool* parameter to place_orphan_here.
1400 Add get_output_section virtual function.
1401 (class Output_section_definition): Add set_is_relro. Add new
1402 bool* parameter to place_orphan_here. Add get_output_section.
1403 Add is_relro_ field.
1404 (Output_section_definition::Output_section_definition): Initialize
1405 evaluated_address_, evaluated_load_address, evaluated_addralign_,
1406 and is_relro_ fields.
1407 (Output_section_definition::place_orphan_here): Add is_relro
1408 parameter.
1409 (Output_section_definition::set_section_addresses): Set relro for
1410 output section.
1411 (Output_section_definition::alternate_constraint): Likewise.
1412 (class Orphan_output_section): Add new bool* parameter to
1413 place_orphan_here. Add get_output_section.
1414 (Orphan_output_section::place_orphan_here): Add is_relro
1415 parameter.
1416 (Script_sections::Script_sections): Initialize
1417 data_segment_align_index_ and saw_relro_end_.
1418 (Script_sections::data_segment_align): New function.
1419 (Script_sections::data_segment_relro_end): New function.
1420 (Script_sections::place_orphan): Set or clear is_relro.
1421 (Script_sections::set_section_addresses): Force alignment of first
1422 TLS section.
1423 * yyscript.y (exp): Call script_data_segment_align and
1424 script_data_segment_relro_end.
1425 * testsuite/relro_script_test.t: New file.
1426 * testsuite/relro_test.cc (using_script): Declare.
1427 (t1, t2): Test using_script.
1428 * testsuite/Makefile.am (check_PROGRAMS): Add relro_script_test.
1429 (relro_script_test_SOURCES): Define.
1430 (relro_script_test_DEPENDENCIES): Define.
1431 (relro_script_test_LDFLAGS): Define.
1432 (relro_script_test_LDADD): Define.
1433 (relro_script_test.so): New target.
1434 * testsuite/Makefile.in: Rebuild.
1435
f827c9a9
CC
14362008-08-06 Cary Coutant <ccoutant@google.com>
1437
1438 * archive.cc (Archive::total_archives, Archive::total_members)
1439 (Archive::total_members_loaded): New variables.
1440 (Archive::setup): Add parameter. Add option to preread
1441 archive symbols.
1442 (Archive::read_armap): Add counter.
1443 (Archive::get_file_and_offset): New function.
1444 (Archive::get_elf_object_for_member): New function.
1445 (Archive::read_all_symbols): New function.
1446 (Archive::read_symbols): New function.
1447 (Archive::add_symbols): Add counters.
1448 (Archive::include_all_members): Use armap to find members if it's
1449 already built.
1450 (Archive::include_member): Skip reading symbols if already read.
1451 Factored code into Archive::get_file_and_offset and
1452 Archive::get_elf_object_for_member. Changed call to
1453 Mapfile::report_include_archive_member.
1454 (Archive::print_stats): New function.
1455 * archive.h: Declare Object and Read_symbols_data classes.
1456 (Archive::Archive): Add initializers for new members.
1457 (Archive::setup): Add parameter.
1458 (Archive::print_stats): New function.
1459 (Archive::total_archives, Archive::total_members)
1460 (Archive::total_members_loaded): New variables.
1461 (Archive::get_file_and_offset): New function.
1462 (Archive::get_elf_object_for_member): New function.
1463 (Archive::read_all_symbols): New function.
1464 (Archive::read_symbols): New function.
1465 (Archive::Archive_member): New class.
1466 (Archive::members_): New member.
1467 (Archive::num_members_): New member.
1468 * main.cc: Include archive.h.
1469 (main): Call Archive::print_stats.
1470 * mapfile.cc (Mapfile::report_include_archive_member): Delete
1471 archive parameter; member_name is now the fully-decorated name.
1472 * mapfile.h (Mapfile::report_include_archive_member): Likewise.
1473 * options.h: (General_options): Add --preread-archive-symbols option.
1474 * readsyms.cc (Read_symbols::do_read_symbols): Change call to
1475 Archive::setup.
1476
de4c45bd
ILT
14772008-08-04 Ian Lance Taylor <iant@google.com>
1478
1479 * symtab.h (Symbol::use_plt_offset): New function.
1480 * i386.cc (Relocate::relocate): Call Symbol::use_plt_offset.
1481 * powerpc.cc (Relocate::relocate): Likewise.
1482 * sparc.cc (Relocate::relocate): Likewise.
1483 * x86_64.cc (Relocate::relocate): Likewise.
1484 * testsuite/weak_plt.sh: New test.
1485 * testsuite/weak_plt_main.cc: New test.
1486 * testsuite/weak_plt_shared.cc: New test.
1487 * testsuite/Makefile.am (check_SCRIPTS): Add weak_plt.sh.
1488 (check_PROGRAMS): Add weak_plt.
1489 (check_DATA): Add weak_plt_shared.so.
1490 (weak_plt_main_pic.o, weak_plt): New targets.
1491 (weak_plt_shared_pic.o, weak_plt_shared.so): New targets.
1492 * testsuite/Makefile.in: Rebuild.
1493
1494 * testsuite/Makefile.am (weak_alias_test_1.so): Depend upon
1495 gcctestdir/ld.
1496 (weak_alias_test_2.so, weak_alias_test_4.so): Likewise.
1497 * testsuite/Makefile.in: Rebuild.
1498
323ee3f4
AM
14992008-08-04 Alan Modra <amodra@bigpond.net.au>
1500
1501 * Makefile.am (POTFILES.in): Set LC_ALL=C.
1502 * Makefile.in: Regenerate.
1503 * po/POTFILES.in: Regenerate.
1504
7c07ecec
ILT
15052008-07-29 Ian Lance Taylor <iant@google.com>
1506
1507 * script.cc (Script_options::finalize_symbols): Finalize SECTIONS
1508 symbols before other symbols.
1509 * testsuite/script_test_2.cc (test_addr): Declare.
1510 (test_addr_alias): Declare.
1511 (main): Check that test_addr and test_addr_alias have the right
cd536b21 1512 values.
7c07ecec
ILT
1513 * testsuite/script_test_2.t: Define test_addr_alias and
1514 test_addr.
1515
5778530e
ILT
15162008-07-24 Ian Lance Taylor <iant@google.com>
1517
2a00e4fb
ILT
1518 PR 5990
1519 * descriptors.cc: New file.
1520 * descriptors.h: New file.
1521 * gold-threads.h (class Hold_optional_lock): New class.
1522 * fileread.cc: Include "descriptors.h".
1523 (File_read::~File_read): Release descriptor rather than closing
1524 it.
1525 (File_read::open) [file]: Call open_descriptor rather than open.
1526 Set is_descriptor_opened_.
1527 (File_read::open) [memory]: Assert that descriptor is not open.
1528 (File_read::reopen_descriptor): New function.
1529 (File_read::release): Release descriptor.
1530 (File_read::do_read): Make non-const. Reopen descriptor.
1531 (File_read::read): Make non-const.
1532 (File_read::make_view): Reopen descriptor.
1533 (File_read::do_readv): Likewise.
1534 * fileread.h (class File_read): Add is_descriptor_opened_ field.
1535 Update declarations.
1536 * layout.cc: Include "descriptors.h".
1537 (Layout::create_build_id): Use open_descriptor rather than open.
1538 * output.cc: Include "descriptors.h".
1539 (Output_file::open): Use open_descriptor rather than open.
1540 * archive.cc (Archive::const_iterator): Change Archive to be
1541 non-const.
1542 (Archive::begin, Archive::end): Make non-const.
1543 (Archive::count_members): Likewise.
1544 * archive.h (class Archive): Update declarations.
1545 * object.h (Object::read): Make non-const.
1546 * Makefile.am (CCFILES): Add descriptors.cc.
1547 (HFILES): Add descriptors.h.
1548 * Makefile.in: Rebuild.
1549
801647d1
ILT
1550 PR 6716
1551 * gold.h: Always include <clocale>. Add Solaris workarounds
1552 following code in binutils/sysdep.h.
1553
5edd166e
ILT
1554 PR 6048
1555 * ehframe.cc (Eh_frame::add_ehframe_input_section): Check whether
1556 this->eh_frame_hdr_ is NULL before using it.
1557
c89ad728
ILT
1558 * dynobj.cc (Versions::Versions): Update comment.
1559
aa86f06b
ILT
1560 * dynobj.cc (Versions::Versions): If there is an soname, use it as
1561 the base version name.
1562
5778530e
ILT
1563 * stringpool.cc (Stringpool_template::add_with_length): Set key to
1564 array size plus one.
1565 (Stringpool_template::set_string_offsets): Subtract one from key
1566 before using it as an array index.
1567 (Stringpool_template::get_offset_with_length): Likewise.
1568 (Stringpool_template::write_to_buffer): Likewise.
1569 * stringpool.h (Stringpool_template::get_offset_from_key):
1570 Likewise.
1571
057ead22
ILT
15722008-07-23 Ian Lance Taylor <iant@google.com>
1573
7f649c59
ILT
1574 PR 6658
1575 * object.h (Merged_symbol_value::value): Do our best to handle a
1576 negative addend.
1577
057ead22
ILT
1578 PR 6647
1579 * script.cc (Version_script_info::get_versions): Don't add empty
1580 version tag to return value.
1581 (Version_script_info::get_symbol_version_helper): Change return
1582 type to bool. Add pversion parameter. Change all callers.
1583 (script_register_vers_node): Don't require a non-NULL tag.
1584 * script.h (class Version_script_info): Update declarations.
1585 (Version_script_info::get_symbol_version): Change return type to
1586 bool. Add version parameter. Change all callers.
1587 * symtab.cc (Sized_symbol::add_from_relobj): Rework version
1588 handling. Handle an empty version from a version script.
1589 (Symbol_table::define_special_symbol): Likewise.
1590 * testsuite/ver_test_10.script: New file.
1591 * testsuite/ver_test_10.sh: New file.
1592 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_10.sh.
1593 (check_DATA): Add ver_test_10.syms.
1594 (ver_test_10.syms, ver_test_10.so): New target.
1595 * testsuite/Makefile.in: Rebuild.
1596
58e54ac2
CD
15972008-07-23 Simon Baldwin <simonb@google.com>
1598
1599 * symtab.cc (Symbol_table::sized_write_symbol): Only set st_size
1600 to zero for undefined symbols from dynamic libraries.
1601
95d14cd3
ILT
16022008-07-23 Ian Lance Taylor <iant@google.com>
1603
1604 * symtab.cc (Symbol_table::resolve): Remove version parameter.
1605 Change all callers.
1606 * symtab.h (class Symbol_table): Update declaration.
1607 * testsuite/ver_test_9.cc: New file.
1608 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_9.
1609 (ver_test_9_SOURCES, ver_test_9_DEPENDENCIES): Define.
1610 (ver_test_9_LDFLAGS, ver_test_9_LDADD): Define.
1611 (ver_test_9.so, ver_test_9.o): New targets.
1612 * testsuite/Makefile.in: Rebuild.
1613
92de84a6
ILT
16142008-07-22 Ian Lance Taylor <iant@google.com>
1615
34810851
ILT
1616 * options.h (class General_options): Define --check-sections.
1617 * layout.cc (Layout::set_segment_offsets): Handle
1618 --check-sections.
1619
af6156ef
ILT
1620 * options.h (class General_options): Define -n/--nmagic and
1621 -N/--omagic.
1622 * options.cc (General_options::finalize): For -n/--nmagic or
1623 -N/--omagic, set -static.
1624 * layout.cc (Layout::attach_allocated_section_to_segment): If
1625 -N/--omagic, don't put read-only and read-write sections in
1626 different segments.
1627 (Layout::find_first_load_seg): If -N/--omagic, don't insist on
1628 finding a read-only segment.
1629 (Layout::set_segment_offsets): If -N/--omagic or -n/--nmagic,
1630 don't set the minimum segment alignment to the common page size,
1631 and don't set the file offset to the address modulo the page size.
1632 * script-sections.cc (Script_sections::create_segments): If
1633 -n/--omagic, don't put read-only and read-write sections in
1634 different segments.
1635
92de84a6
ILT
1636 * cref.cc: New file.
1637 * cref.h: New file.
1638 * options.h (class General_options): Add --print-symbol-counts.
1639 * main.cc (main): Issue defined symbol report if requested.
1640 * archive.cc (Archive::interpret_header): Make into a const member
1641 function.
1642 (Archive::add_symbols): Call Input_objects::archive_start and
1643 archive_stop.
1644 (Archive::const_iterator): Define new class.
1645 (Archive::begin, Archive::end): New functions.
1646 (Archive::include_all_members): Rewrite to use iterator.
1647 (Archive::count_members): New function.
1648 * archive.h (class Archive): Update declarations.
1649 (Archive::filename): New function.
1650 * object.cc: Include "cref.h".
1651 (Sized_relobj::Sized_relobj): Initialize defined_count_.
1652 (Sized_relobj::do_get_global_symbol_counts): New function.
1653 (Input_objects::add_object): Add object to cross-referencer.
1654 (Input_objects::archive_start): New function.
1655 (Input_objects::archive_stop): New function.
1656 (Input_objects::print_symbol_counts): New function.
1657 * object.h: Declare Cref and Archive.
1658 (Object::get_global_symbol_counts): New function.
1659 (Object::do_get_global_symbol_counts): New pure virtual function.
1660 (class Sized_relobj): Add defined_count_ field. Update
1661 declarations.
1662 (class Input_objects): Add cref_ field. Update constructor.
1663 Update declarations.
1664 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize symbols_ and
1665 defined_count_.
1666 (Sized_dynobj::do_add_symbols): Allocate symbols_ if printing
1667 symbol counts.
1668 (Sized_dynobj::do_get_global_symbol_counts): New function.
1669 * dynobj.h (class Sized_dynobj): Add fields symbols_ and
1670 defined_count_. Update declarations. Define Symbols typedef.
1671 * symtab.cc (Symbol_table::add_from_relobj): Add defined
1672 parameter. Change all callers.
1673 (Symbol_table::add_from_dynobj): Add sympointers and defined
1674 parameters. Change all callers.
1675 * symtab.h (class Symbol_table): Update declarations.
1676 * Makefile.am (CCFILES): Add cref.cc.
1677 (HFILES): Add cref.h.
1678 * Makefile.in: Rebuild.
1679
3f7c5e1d
CD
16802008-07-22 Simon Baldwin <simonb@google.com>
1681
1682 * symtab.cc (Symbol_table::sized_write_symbol): Set symbol size
1683 to zero when writing undefined symbols.
1684
e0b64032
ILT
16852008-07-22 Ian Lance Taylor <iant@google.com>
1686
1687 * output.cc (Output_section::add_input_section): Don't try to
1688 merge empty merge sections.
1689
096b02cf
CS
16902008-07-21 Craig Silverstein <csilvers@google.com>
1691
1692 * symtab.cc (Symbol_table::warn_about_undefined_dynobj_symbol):
1693 Include symbol version in error message.
cd536b21 1694
1d1f116d
CD
16952008-07-20 Chris Demetriou <cgd@google.com>
1696
cd536b21 1697 * configure.ac (gold_cv_c_random_seed): New configured variable.
1d1f116d
CD
1698 (RANDOM_SEED_CFLAGS): New substituted variable.
1699 * Makefile.am (AM_CFLAGS, AM_CXXFLAGS): Add $(RANDOM_SEED_CFLAGS).
1700 * configure: Rebuild.
1701 * Makefile.in: Likewise.
1702 * testsuite/Makefile.in: Likewise.
1703
a18f591e
ILT
17042008-07-18 Ian Lance Taylor <iant@google.com>
1705
1706 * symtab.cc (Symbol_table::add_from_object): Rewrite the case
1707 where we see NAME/NULL and NAME/VERSION as separate symbols.
1708 * testsuite/ver_test_main.cc (main): Call t4.
1709 (t4, t4_2a): Define.
1710 * testsuite/ver_test_2.cc (t4_2): Define.
1711 * testsuite/ver_test_2.script: Put t4_2a in VER2.
1712 * testsuite/ver_test_4.cc (t4_2a): Define.
1713 * testsuite/ver_test_4.script: Put t4_2a in VER2.
1714 * testsuite/ver_test.h (t4, t4_2, t4_2a): Declare.
1715
c6e3f6ed
ILT
17162008-07-17 Ian Lance Taylor <iant@google.com>
1717
1718 * dynobj.cc (Versions::add_def): If we give an error about a
1719 missing version, go ahead and create the version anyhow.
1720
ef9beddf
ILT
17212008-07-10 Ian Lance Taylor <iant@google.com>
1722
1723 Handle output sections with more than 0x7fffffff bytes.
1724 * object.h (class Relobj): Change map_to_output_ to
1725 output_sections_, and just keep a section pointer. Change all
1726 uses. Move comdat group support to Sized_relobj.
1727 (Relobj::is_section_specially_mapped): Remove.
1728 (Relobj::output_section): Remove poff parameter. Change all
1729 callers.
1730 (Relobj::output_section_offset): New function.
1731 (Relobj::set_section_offset): Rewrite.
1732 (Relobj::map_to_output): Remove.
1733 (Relobj::output_sections): New function.
1734 (Relobj::do_output_section_offset): New pure virtual function.
1735 (Relobj::do_set_section_offset): Likewise.
1736 (class Sized_relobj): Add section_offsets_ field. Add comdat
1737 group support from Relobj. Update declarations.
1738 (Sized_relobj::get_output_section_offset): New function.
1739 (Sized_relobj::do_output_section_offset): New function.
1740 (Sized_relobj::do_set_section_offset): New function.
1741 * object.cc (Relobj::output_section_address): Remove.
1742 (Sized_relobj::Sized_relobj): Initialize new fields.
1743 (Sized_relobj::include_section_group): Cast find_kept_object to
1744 Sized_relobj.
1745 (Sized_relobj::include_linkonce_section): Likewise.
1746 (Sized_relobj::do_layout): Use separate arrays for output section
1747 and output offset.
1748 (Sized_relobj::do_count_local_symbols): Change map_to_output to
1749 output_sections.
1750 (Sized_relobj::do_finalize_local_symbols): Change map_to_output to
1751 output_sections and section_offsets.
1752 (Sized_relobj::write_local_symbols): Likewise.
1753 (map_to_kept_section): Compute output address directly.
1754 * reloc.cc (Sized_relobj::do_read_relocs): Change map_to_output to
1755 output_sections and section_offsets.
1756 (Sized_relobj::write_sections): Likewise.
1757 (Sized_relobj::relocate_sections): Likewise.
1758 * symtab.cc (sized_finalize_symbol): Use output_section_offset.
1759 * output.h (class Output_reloc): Update declarations. Change
1760 u2_.relobj to Sized_relobj*.
1761 (class Output_data_reloc): Change add functions to use
1762 Sized_relobj*.
1763 * output.cc (Output_reloc::Output_reloc): Change relobj to
1764 Sized_relobj*.
1765 (Output_reloc::local_section_offset): Change return type to
1766 Elf_Addr. Use get_output_section_offset.
1767 (Output_reloc::get_address): Likewise.
1768 (Output_section::is_input_address_mapped): Don't call
1769 is_section_specially_mapped.
1770 (Output_section::output_offset): Likewise.
1771 (Output_section::output_address): Likewise.
1772 (Output_section::starting_output_address): Likewise.
1773 * copy-relocs.cc (Copy_relocs::copy_reloc): Change object
1774 parameter to Sized_relobj*.
1775 (Copy_relocs::need_copy_reloc): Likewise.
1776 (Copy_relocs::save): Likewise.
1777 * copy-relocs.h (class Copy_relocs): Update declarations.
1778 (class Copy_relocs::Copy_reloc_entry): Change constructor to use
1779 Sized_relobj*. Change relobj_ field to Sized_relobj*.
1780 * target-reloc.h (relocate_for_relocatable): Change
1781 offset_in_output_section type to Elf_Addr. Change code that uses
1782 it as well.
1783 * layout.cc (Layout::layout): Always set *off.
1784 * mapfile.cc (Mapfile::print_input_section): Use
1785 output_section_offset.
1786 * i386.cc (Target_i386::copy_reloc): Change object parameter to
1787 Sized_relobj*.
1788 * powerpc.cc (Target_powerpc::copy_reloc): Likewise.
1789 * sparc.cc (Target_sparc::copy_reloc): Likewise.
1790 * x86_64.cc (Target_x86_64::copy_reloc): Likewise.
1791
5cb66f97
ILT
17922008-07-03 Ian Lance Taylor <iant@google.com>
1793
1794 * layout.cc (Layout::include_section): Do not discard unrecognized
1795 SHT_STRTAB sections.
1796
afe47622
CS
17972008-06-30 Craig Silverstein <csilvers@cs.stanford.edu>
1798
1799 * script.cc (Lex::can_continue_name): Make '?' allowable in
1800 version-script names.
1801 * testsuite/version_script.map: Change glob pattern to use '?'
1802
5adf9721
ILT
18032008-06-30 Manish Singh <yosh@gimp.org>
1804
1805 PR 6585
1806 * symtab.cc (Symbol_table::add_undefined_symbols_from_command_line):
1807 Correct typo.
1808
e6fde208
ILT
18092008-06-30 Ian Lance Taylor <iant@google.com>
1810
1811 PR 6660
1812 PR 6682
1813 * powerpc.cc (Powerpc_relocate_functions::addr16_ha) [both
1814 versions]: Don't try to read the value in the contents, since we
1815 don't use it. Use the template endianness when writing.
1816
3f2e6a2d
CC
18172008-06-25 Cary Coutant <ccoutant@google.com>
1818
1819 * fileread.cc (File_read::make_view): Assert on zero-length view.
1820 * object.cc (Sized_relobj::do_read_symbols): Don't try to read
1821 symbol table when there are no symbols to read.
1822
c43d3a48
CS
18232008-06-23 Craig Silverstein <csilvers@google.com>
1824
1825 * version.cc (version_string): Bump to 1.7
1826
5f494ea0
CS
18272008-06-18 Craig Silverstein <csilvers@google.com>
1828
1829 * powerpc.cc (Powerpc_relocate_functions::addr16_ha): cast
1830 constant 0xFFFF to type Valtype.
1831 (Powerpc_relocate_functions::rel16_ha): Likewise.
1832
c42e122e
ILT
18332008-06-17 Ian Lance Taylor <iant@google.com>
1834
f34787f8
ILT
1835 * output.h (Output_section::Input_section): Initialize p2align_ to
1836 zero for Output_section_data constructors.
1837 (Output_section::Input_section::addralign): If not an input
1838 section, return the alignment of the Output_section_data.
1839 * testsuite/copy_test.cc: New file.
1840 * testsuite/copy_test_1.cc: New file.
1841 * testsuite/copy_test_2.cc: New file.
1842 * testsuite/Makefile.am (check_PROGRAMS): Add copy_test.
1843 (copy_test_SOURCES, copy_test_DEPENDENCIES): New variables.
1844 (copy_test_LDFLAGS, copy_test_LDADD): New variables.
1845 (copy_test_1_pic.o, copy_test_1.so): New targets.
1846 (copy_test_2_pic.o, copy_test_2.so): New targets.
1847 * testsuite/Makefile.in: Rebuild.
1848
c42e122e
ILT
1849 * script-sections.cc (Script_sections::place_orphan): Initialize
1850 local variable exact.
1851
ce3ac18a
DE
18522008-06-13 David Edelsohn <edelsohn@gnu.org>
1853
1854 * powerpc.cc (Output_data_plt_powerpc::do_write): 8 + 4 = 0xC.
1855
42cacb20
DE
18562008-06-12 David Edelsohn <edelsohn@gnu.org>
1857 David S. Miller <davem@davemloft.net>
1858
1859 * powerpc.cc: New file.
1860 * Makefile.am (TARGETSOURCES): Add powerpc.cc
1861 (ALL_TARGETOBJS): Add powerpc.$(OBJEXT)
1862 * configure.tgt: Add entries for powerpc-* and powerpc64-*.
1863 * Makefile.in: Rebuild.
1864
7b308235
ILT
18652008-06-09 Ian Lance Taylor <iant@google.com>
1866
1867 * testsuite/relro_test.cc: Include <cstdio>, <cstdlib>, and
1868 <exception>.
1869 (throwing, orig_terminate): New static variables.
1870 (terminate_handler): New static function.
1871 (t2): Set terminate handler.
1872
f0b886e3
ILT
18732008-06-05 Kris Van Hees <kris.van.hees@oracle.com>
1874
1875 PR 6584
cd536b21 1876 * binary.cc (Binary_to_elf::sized_convert): Fix .data
f0b886e3
ILT
1877 alignment.
1878
3e90f135
CC
18792008-05-30 Cary Coutant <ccoutant@google.com>
1880
1881 * archive.cc (Archive::include_all_members) Correct to step
1882 over symbol table and extended name table in thin archives.
1883
e09ad04a
ILT
18842008-05-29 Kris Van Hees <kris.van.hees@oracle.com>
1885
1886 PR 6407
1887 * target-reloc.h (relocate_for_relocatable): Fix new_offset
1888 calculation.
1889
62b01cb5
ILT
18902008-05-28 Caleb Howe <cshowe@google.com>
1891
1892 * reduced_debug_output.cc: New file.
1893 * reduced_debug_output.h: New file.
92de84a6 1894 * options.h (class General_options): Add --strip-debug-non-line.
62b01cb5
ILT
1895 * options.cc (General_options::finalize): Add strip_debug_non_line
1896 to the strip heirarchy.
1897 * layout.h (class Layout): Add debug_abbrev_ and debug_info_
1898 fields.
1899 * layout.cc: Include "reduced_debug_output.h".
1900 (Layout::Layout): Initialize new fields.
1901 (line_only_debug_sections): New static array.
1902 (is_lines_only_debug_sections): New static inline function.
1903 (Layout::include_section): Handle --strip-debug-non-line.
1904 (Layout::make_output_section): If --strip-debug-non-line, build
1905 new output sections for .debug_abbrev and .debug_info.
1906 * dwarf_reader.cc (read_unsigned_LEB_128): Move to namespace
1907 gold. Warn about possible overflow.
1908 (read_signed_LEB_128): Likewise.
1909 * dwarf_reader.h: (read_unsigned_LEB_128): Declare.
1910 (read_signed_LEB_128): Declare.
1911 * Makefile.am (CCFILES): Add reduced_debug_output.cc.
1912 (HFILES): Add reduced_debug_output.h.
1913 * Makefile.in: Rebuild.
1914
7d9e3d98
ILT
19152008-05-21 Ian Lance Taylor <iant@google.com>
1916
1917 * mapfile.cc: New file.
1918 * mapfile.h: New file.
1919 * options.h (class General_options): Add -M/--print-map and -Map.
1920 * options.cc (General_options::finalize): Make -M equivalent to
1921 -Map -.
1922 * main.cc: Include <cstdio> and "mapfile.h".
1923 (main): Open mapfile if requested.
1924 * gold.cc (class Middle_runner): Add mapfile_ field. Update
1925 constructor. Change caller.
1926 (queue_initial_tasks): Add mapfile parameter. Change caller.
1927 (queue_middle_tasks): Likewise.
1928 * gold.h (queue_initial_tasks, queue_middle_tasks): Update
1929 declarations.
1930 * archive.cc: Include "mapfile.h".
1931 (Archive::add_symbols): Add mapfile parameter. Change all
1932 callers. Pass mapfile, symbol, and reason to include_member.
1933 (Archive::include_all_members): Add mapfile parameter. Change all
1934 callers.
1935 (Archive::include_member): Add mapfile, sym, and why parameters.
1936 Change all callers. Report inclusion to map file.
1937 * archive.h: Include "fileread.h".
1938 (class Archive): Update declarations.
1939 (Archive::file): New const method.
1940 (class Add_archive_symbols): Add mapfile_ field. Update
1941 constructor. Change all callers.
1942 * readsyms.h (class Read_symbols): Likewise.
1943 (class Finish_group): Likewise.
1944 (class Read_script): Likewise.
1945 * common.cc: Include "mapfile.h".
1946 (Symbol_table::allocate_commons): Add mapfile parameter. Change
1947 all callers.
1948 (Symbol_table::do_allocate_commons): Likewise.
1949 (Symbol_table::do_allocate_commons_list): Likewise. Report common
1950 symbol allocation to mapfile.
1951 * common.h (class Allocate_commons_task): Add mapfile_ field.
1952 Update constructor. Change all callers.
1953 * symtab.h (class Symbol_table): Update declarations.
1954 * layout.cc: Include "mapfile.h".
1955 (Layout_task_runner::run): Print information to mapfile.
1956 (Layout::create_gold_note): Change Output_data_fixed_space to
1957 Output_data_zero_fill.
1958 (Layout::create_build_id): Likewise.
1959 (Layout::print_to_mapfile): New function.
1960 * layout.h (class Layout_task_runner): Add mapfile_ field. Update
1961 constructor. Change caller.
1962 (class Layout): Declare print_to_mapfile.
1963 * output.cc (Output_section::Input_section::print_to_mapfile): New
1964 function.
1965 (Output_section::add_input_section): If producing a map, always
1966 add to input_sections_ list.
1967 (Output_section::do_print_to_mapfile): New function.
1968 (Output_segment::print_sections_to_mapfile): New function.
1969 (Output_segment::print_section_list_to_mapfile): New function.
1970 * output.h: Include "mapfile.h".
1971 (Output_data::print_to_mapfile): New function.
1972 (Output_data::do_print_to_mapfile): New virtual function.
1973 (Output_segment_headers::do_print_to_mapfile): New function.
1974 (Output_file_header::do_print_to_mapfile): New function.
1975 (Output_data_const::do_print_to_mapfile): New function.
1976 (class Output_data_const_buffer): Add map_name_ field. Update
1977 constructor. Change all callers. Add do_print_to_mapfile
1978 function.
1979 (class Output_data_fixed_space): Likewise.
1980 (class Output_data_space): Likewise.
1981 (class Output_data_zero_fill): New class.
1982 (Output_data_strtab::do_print_to_mapfile): New function.
1983 (Output_data_reloc_base::do_print_to_mapfile): New function.
1984 (Output_relocatable_relocs::do_print_to_mapfile): New function.
1985 (Output_data_group::do_print_to_mapfile): New function.
1986 (Output_data_got::do_print_to_mapfile): New function.
1987 (Output_data_dynamic::do_print_to_mapfile): New function.
1988 (Output_symtab_xindex::do_print_to_mapfile): New function.
1989 (class Output_section): Declare do_print_to_mapflie. Declare
1990 print_to_mapfile in Input_section.
1991 (class Output_segment): Declare new functions.
1992 * object.h (Sized_relobj::symbol_count): New function.
1993 * script-sections.cc
1994 (Output_section_element_dot_assignment::set_section_addresses):
1995 Change Output_data_fixed_space to Output_data_zero_fill.
1996 (Output_data_expression::do_print_to_mapfile): New function.
1997 * script.cc (read_input_script): Add mapfile parameter. Change
1998 all callers.
1999 * script.h (read_input_script): Update declaration.
2000 * ehframe.h (Eh_frame_hdr::do_print_to_mapfile): New function.
2001 (Eh_frame::do_print_to_mapfile): New function.
2002 * merge.h (Output_merge_data::do_print_to_mapfile): New function.
2003 (Output_merge_string::do_print_to_mapfile): New function.
2004 * i386.cc (Output_data_plt_i386::do_print_to_mapfile): New
2005 function.
2006 * sparc.cc (Output_data_plt_sparc::do_print_to_mapfile): New
2007 function.
2008 * x86_64.cc (Output_data_plt_x86_64::do_print_to_mapfile): New
2009 function.
2010 * Makefile.am (CCFILES): Add mapfile.cc.
2011 (HFILES): Add mapfile.h.
2012 * Makefile.in: Rebuild.
2013
9f1d377b
ILT
20142008-05-19 Ian Lance Taylor <iant@google.com>
2015
2016 * options.h (class General_options): Add -z relro.
2017 * layout.cc (Layout::Layout): Initialize relro_segment_.
2018 (Layout::add_output_section_data): Return the output section.
2019 (Layout::make_output_section): Rcognize relro sections and mark
2020 them appropriately.
2021 (Layout::attach_allocated_section_to_segment): Put relro sections
2022 in a PT_GNU_RELRO segment.
2023 (Layout::create_initial_dynamic_sections): Mark the .dynamic
2024 section as relro.
2025 (Layout::segment_precedes): Sort PT_GNU_RELRO segments after
2026 PT_TLS segments.
2027 (Layout::linkonce_mapping): Map d.rel.ro.local to
2028 .data.rel.ro.local.
2029 (Layout::output_section_name): Us .data.rel.ro.local for any
2030 section which begins with that.
2031 * layout.h (class Layout): Update add_output_section_data
2032 declaration. Add relro_segment_ field.
2033 * output.cc (Output_section::Output_section): Initialize is_relro_
2034 and is_relro_local_ fields.
2035 (Output_segment::add_output_section): Group relro sections.
2036 (Output_segment::is_first_section_relro): New function.
2037 (Output_segment::maximum_alignment): If there is a relro section,
2038 align the segment to the common page size.
2039 (Output_segment::set_section_addresses): Track whether we are
2040 looking at relro sections. If the last section is a relro
2041 section, align to the common page size.
2042 (Output_segment::set_section_list_addresses): Add in_relro
2043 parameter. Change all callers. Align to the page size when
2044 moving from relro to non-relro section.
2045 (Output_segment::set_offset): Align memsz of a PT_GNU_RELRO
2046 segment.
2047 * output.h (class Output_section): Add is_relro_ and
2048 is_relro_local_ fields.
2049 (Output_section::is_relro): New function.
2050 (Output_section::set_is_relro): New function.
2051 (Output_section::is_relro_local): New function.
2052 (Output_section::set_is_relro_local): New function.
2053 (class Output_segment): Update declarations.
2054 * i386.cc (Target_i386::got_section): Mark .got section as relro.
2055 * sparc.cc (Target_sparc::got_section): Likewise.
2056 * x86_64.cc (Target_x86_64::got_section): Likewise.
2057 * testsuite/relro_test_main.cc: New file.
2058 * testsuite/relro_test.cc: New file.
2059 * testsuite/Makefile.am (check_PROGRAMS): Add relro_test.
2060 (relro_test_SOURCES, relro_test_DEPENDENCIES): New variables.
2061 (relro_test_LDFLAGS, relro_test_LDADD): New variables.
2062 (relro_test.so, relro_test_pic.o): New targets.
2063 * testsuite/Makefile.in: Rebuild.
2064
a984ee1d
ILT
20652008-05-16 Ian Lance Taylor <iant@google.com>
2066
01676dcd
ILT
2067 * output.cc (Output_segment::add_output_section): Remove front
2068 parameter.
2069 * output.h (class Output_segment): Remove
2070 add_initial_output_section and overloaded add_output_section.
2071 Update declaration of remaining add_output_section.
2072 * layout.cc (Layout::create_interp): Call add_output_section
2073 rather than add_initial_output_section.
2074 (Layout::finish_dynamic_section): Likewise.
2075
497897f9
ILT
2076 * i386.cc (Target_i386::Relocate::relocate_tls): Set dynamic type
2077 for TLS_GOTDESC and TLS_DESC_CALL. Only optimize TLS_LDO_32 if we
2078 know the dynamic type.
2079 * x86_64.cc (Target_x86_64::Relocate): Add saw_tls_block_reloc_
2080 field. Initialize it in constructor.
2081 (Target_x86_64::Relocate::relocate_tls): Record that we saw a TLS
2082 block reloc for TLSGD, GOTPC32_TLSDESC, TLSDESC_CALL, and TLSLD.
2083 Only optimize DTPOFF32 and DTPOFF64 if we have seen a TLS block
2084 reloc.
2085
a984ee1d
ILT
2086 * output.cc (Output_reloc::get_address): Change return type to
2087 Elf_Addr.
2088 * output.h (class Output_reloc): Update get_address declaration.
2089 * x86_64.cc (Output_data_plt_x86_64::do_write): Use 64-bit types
2090 for section addresses.
2091
55ba0940
ILT
20922008-05-09 Ian Lance Taylor <iant@google.com>
2093
2094 PR 6493
2095 * gold.cc (gold_nomem): Use return value of write.
2096
75517b77
ILT
20972008-05-08 Ian Lance Taylor <iant@google.com>
2098
2099 * symtab.c (Symbol::init_base_output_data): Add version
2100 parameter. Change all callers.
2101 (Symbol::init_base_output_segment): Likewise.
2102 (Symbol::init_base_constant): Likewise.
2103 (Symbol::init_base_undefined): Likewise.
2104 (Sized_symbol::init_output_data): Likewise.
2105 (Sized_symbol::init_output_segment): Likewise.
2106 (Sized_symbol::init_constant): Likewise.
2107 (Sized_symbol::init_undefined): Likewise.
2108 (Symbol_table::do_define_in_output_data): If the new symbol has a
2109 version, mark it as the default.
2110 (Symbol_table::do_define_in_output_segment): Likewise.
2111 (Symbol_table::do_define_as_constant): Likewise.
2112 * symtab.h (class Symbol): Update declarations.
2113 (class Sized_symbol): Likewise.
2114 * resolve.cc (Symbol::override_version): New function.
c42e122e 2115 (Symbol::override_base): Call override_version.
75517b77
ILT
2116 (Symbol::override_base_with_special): Likewise.
2117 * testsuite/ver_script_8.script: New file.
2118 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_8.
2119 (ver_test_8_SOURCES, ver_test_8_DEPENDENCIES): Define.
2120 (ver_test_8_LDFLAGS, ver_test_8_LDADD): Define.
2121 (ver_test_8_1.so, ver_test_8_2.so): New targets.
2122
f1f70eae
ILT
21232008-05-06 Ian Lance Taylor <iant@google.com>
2124
f3e9c5c5
ILT
2125 PR 6049
2126 * options.h (DEFINE_set): Add VARNAME_begin and VARNAME_end
2127 functions.
2128 (class General_options): Remove existing --undefined, and add
2129 --no-undefined instead. Add new --undefined as synonym for -u.
2130 * archive.cc (Archive::add_symbols): Check whether symbol was
2131 named with -u.
2132 * gold.cc (queue_middle_tasks): Add -u symbols to symbol table.
2133 * symtab.h (class Symbol): Rename CONSTANT to IS_CONSTANT; change
2134 all uses. Add IS_UNDEFINED. Update declarations to split
2135 different versions of init_base. Declare init_base_undefined.
2136 (Symbol::is_defined): Handle IS_UNDEFINED.
2137 (Symbol::is_undefined): Likewise.
2138 (Symbol::is_weak_undefined): Call is_undefined.
2139 (Symbol::is_absolute): Handle IS_CONSTANT.
2140 (class Sized_symbol): Update declarations to split different
2141 versions of init. Declare init_undefined.
2142 (class Symbol_table): Declare new functions.
2143 * symtab.cc (Symbol::init_base_object): Rename from init_base.
2144 Change all callers.
2145 (Symbol::init_base_output_data): Likewise.
2146 (Symbol::init_base_output_segment): Likewise.
2147 (Symbol::init_base_constant): Likewise.
2148 (Symbol::init_base_undefined): New function.
2149 (Sized_symbol::init_object): Rename from init. Change all
2150 callers.
2151 (Sized_symbol::init_output_data): Likewise.
2152 (Sized_symbol::init_output_segment): Likewise.
2153 (Sized_symbol::init_constant): Likewise.
2154 (Sized_symbol::init_undefined): New function.
2155 (Symbol_table::add_undefined_symbols_from_command_line): New
2156 function.
2157 (Symbol_table::do_add_undefined_symbols_from_command_line): New
2158 function.
2159 (Symbol::final_value_is_known): Handle IS_UNDEFINED.
2160 (Symbol::output_section): Likewise.
2161 (Symbol::set_output_section): Likewise.
2162 (Symbol_table::sized_finalize_symbol): Likewise.
2163 (Symbol_table::sized_write_globals): Likewise.
2164 * resolve.cc (Symbol_table::should_override): Likewise.
2165 (Symbol::override_base_with_special): Likewise.
2166
8bdcdf2c
ILT
2167 * symtab.cc (Symbol_table::add_from_dynobj): If we see a protected
2168 symbol, change it to have default visibility.
2169 * testsuite/protected_1.cc: New file.
2170 * testsuite/protected_2.cc: New file.
2171 * testsuite/protected_3.cc: New file.
2172 * testsuite/protected_main_1.cc: New file.
2173 * testsuite/protected_main_2.cc: New file.
2174 * testsuite/protected_main_3.cc: New file.
2175 * testsuite/Makefile.am (check_PROGRAMS): Add protected_1.
2176 (protected_1_SOURCES, protected_1_DEPENDENCIES): Define.
2177 (protected_1_LDFLAGS, protected_1_LDADD): Define.
2178 (protected_1.so): New target.
2179 (protected_1_pic.o, protected_2_pic.o): New targets.
2180 (protected_3_pic.o): New target.
2181 (check_PROGRAMS): Add protected_2.
2182 (protected_2_SOURCES, protected_2_DEPENDENCIES): Define.
2183 (protected_2_LDFLAGS, protected_2_LDADD): Define.
2184 * testsuite/Makefile.in: Rebuild.
2185
2b706932
ILT
2186 * options.h (DEFINE_var): Add set_user_set_##varname__.
2187 (DEFINE_bool_alias): New macro.
2188 (class General_options): Define -Bstatic using DEFINE_bool_alias
2189 rather than DEFINE_special. Add --undefined as an alias for -z
2190 defs.
2191 * options.cc (General_options::parse_Bstatic): Remove.
2192
d82a5bcc
ILT
2193 * options.h (class General_options): Add --fatal-warnings.
2194 * main.cc (main): Implement --fatal-warnings.
2195 * errors.h (Errors::warning_count): New function.
2196
f1f70eae
ILT
2197 * options.h (class General_options): Add -Bsymbolic-functions.
2198 * symtab.h (Symbol::is_preemptible): Check for
2199 -Bsymbolic-functions.
2200
8825ac63
ILT
22012008-05-05 Ian Lance Taylor <iant@google.com>
2202
d98bc257
ILT
2203 * options.h (DEFINE_bool): For DASH_Z, create the negative option
2204 as noVARNAME rather than no-VARNAME.
2205 (class General_options): Add option -z combreloc.
2206 * output.h (class Output_reloc) [SHT_REL]: Declare compare and
2207 get_address.
2208 (Output_reloc::sort_before) [SHT_REL]: New function.
2209 (Output_reloc::sort_before) [SHT_RELA]: New function.
2210 (class Output_data_reloc_base): Add sort_relocs_ field. Define
2211 Sort_relocs_comparison.
2212 (Output_data_reloc_base::Output_data_reloc_base): Add sort_relocs
2213 parameter. Change all callers.
2214 (Output_data_reloc::Output_data_reloc) [both versions]: Add
2215 sort_relocs parameter. Change all callers.
2216 * output.cc (Output_reloc::get_address): New function, broken out
2217 of write_rel.
2218 (Output_reloc::write_rel): Call it.
2219 (Output_reloc::compare): New function.
2220 (Output_data_reloc_base::do_write): Optionally sort relocs.
2221
60b2b4e7
ILT
2222 * configure.ac: If targ_extra_obj is set, link it in.
2223 * configure.tgt: Initialize all variables.
2224 (x86_64*): Set targ_extra_obj and targ_extra_size.
2225 * configure: Rebuild.
2226
8825ac63
ILT
2227 * object.cc (Sized_relobj::include_section_group): Adjust section
2228 indexes read from group data. Build vector to pass to
2229 layout_group.
2230 * layout.cc (Layout::layout_group): Add flags and shndxes
2231 parameters. Remove contents parameter. Change caller. Update
2232 explicit instantiations.
2233 * layout.h (class Layout): Update layout_group declaration.
2234 * output.cc (Output_data_group::Output_data_group): Add flags and
2235 input_shndxes parameters. Remove contents parameter. Change
2236 caller.
2237 (Output_data_group::do_write): Change input_sections_ to
2238 input_shndxes_.
2239 * output.h (class Output_data_group): Update constructor
2240 declaration. Rename input_sections_ to input_shndxes_.
2241 * testsuite/many_sections_test.cc: Add template.
2242
e94cf127
CC
22432008-04-30 Cary Coutant <ccoutant@google.com>
2244
4418b2d5
CC
2245 * target-reloc.h (relocate_section): Fix dead-pointer bug.
2246
e94cf127
CC
2247 * layout.cc (Layout::include_section): Refactored check for debug
2248 info section.
2249 (Layout::add_comdat): Add new parameters. Change type
2250 of signature parameter. Add object and shndx to signatures table.
2251 (Layout::find_kept_object): New function.
2252 * layout.h: Include <cstring>.
2253 (Layout::is_debug_info_section): New function.
2254 (Layout::add_comdat): Add new parameters.
2255 (Layout::find_kept_object): New function.
2256 (Layout::Kept_section): New struct.
2257 (Layout::Signatures): Change type of map range.
2258 * object.cc (Relobj::output_section_address): New function.
2259 (Sized_relobj::include_section_group): Add new parameters. Change
2260 calls to Layout::add_comdat. Change to build table of kept comdat
2261 groups and table mapping discarded sections to kept sections.
2262 (Sized_relobj::include_linkonce_section): Likewise. Add new parameter.
2263 (Sized_relobj::do_layout): Change calls to include_section_group and
2264 include_linkonce_section.
2265 (Sized_relobj::do_finalize_local_symbols): Do not set local symbol
2266 value to zero when section is discarded.
2267 (Sized_relobj::map_to_kept_section): New function.
2268 * object.h (Relobj::output_section_address): New function.
2269 (Relobj::Comdat_group): New type.
2270 (Relobj::find_comdat_group): New function.
2271 (Relobj::Comdat_group_table): New type.
2272 (Relobj::Kept_comdat_section): New type.
2273 (Relobj::Kept_comdat_section_table): New type.
2274 (Relobj::add_comdat_group): New function.
2275 (Relobj::set_kept_comdat_section): New function.
2276 (Relobj::get_kept_comdat_section): New function.
2277 (Relobj::comdat_groups_): New field.
2278 (Relobj::kept_comdat_sections_): New field.
2279 (Symbol_value::input_value): Update comment.
2280 (Sized_relobj::map_to_kept_section) New function.
2281 (Sized_relobj::include_linkonce_section): Add new parameter.
2282 * target-reloc.h (Comdat_behavior): New type.
2283 (get_comdat_behavior): New function.
2284 (relocate_section): Add code to map a discarded section to the
2285 corresponding kept section when applying a relocation.
2286
e4e5049b
CS
22872008-04-30 Craig Silverstein <csilvers@google.com>
2288
2289 * dwarf_reader.cc (next_generation_count): New static var.
2290 (Addr2line_cache_entry): New struct.
2291 (addr2line_cache): New static var.
2292 (Dwarf_line_info::one_addr2line): Added caching.
2293 (Dwarf_line_info::clear_addr2line_cache): New function.
2294 * dwarf_reader.h (Dwarf_line_info::one_addr2line): Add
2295 cache-size parameter.
2296 (Dwarf_line_info::one_addr2line_cache): New function.
2297 * symtab.cc (Symbol_table::detect_odr_violations): Pass
2298 new cache-size argument to one_addr2line(), and clear cache.
2299
d09e9154
CC
23002008-04-28 Cary Coutant <ccoutant@google.com>
2301
2302 * i386.cc (Relocate::relocate): Fix typos for R_386_PC16 and
2303 R_386_PC8 relocations.
2304
7ef73768
ILT
23052008-04-23 Ian Lance Taylor <iant@google.com>
2306
55438702
ILT
2307 * object.cc (Sized_relobj::include_section_group): Check for
2308 invalid section group.
2309
c165fb93
ILT
2310 * object.cc (make_elf_object): Correct test for 64-bit ELF file
2311 header size.
2312
7ef73768
ILT
2313 * readsyms.cc (Read_symbols::do_read_symbols): Use get_view rather
2314 than read for file header.
2315 * archive.cc (Archive::include_member): Likewise.
2316
6194aaab
L
23172008-04-23 Paolo Bonzini <bonzini@gnu.org>
2318
2319 * aclocal.m4: Regenerate.
2320 * configure: Regenerate.
2321
d491d34e
ILT
23222008-04-19 Ian Lance Taylor <iant@google.com>
2323
5ea2bac6
ILT
2324 * version.cc (version_string): Bump to 1.6.
2325
7bc3e21a
ILT
2326 * testsuite/Makefile.am (many_sections_r_test): New target.
2327 (many_sections_r_test_SOURCES): Remove.
2328 (many_sections_r_test_DEPENDENCIES): Remove.
2329 (many_sections_r_test_LDFLAGS): Remove.
2330 (many_sections_r_test_LDADD): Remove.
2331
7fcd3aa9
ILT
2332 * object.cc (Sized_relobj::do_add_symbols): Always pass
2333 local_symbol_count_ to add_from_relobj.
2334
4c94d6ae
ILT
2335 * testsuite/Makefile.am (many_sections_check.h): Only check one in
2336 every thousand variables.
2337 * testsuite/Makefile.in: Rebuild.
2338
d491d34e
ILT
2339 * object.cc (Xindex::initialize_symtab_xindex): New function.
2340 (Xindex::read_symtab_xindex): New function.
2341 (Xindex::sym_xindex_to_shndx): New function.
2342 (Sized_relobj::find_symtab): Pick up SHT_SYMTAB_SHNDX section if
2343 available.
2344 (Sized_relobj::do_initialize_xindex): New function.
2345 (Sized_relobj::do_read_symbols): Adjust section links.
2346 (Sized_relobj::symbol_section_and_value): Add is_ordinary
2347 parameter. Change all callers.
2348 (Sized_relobj::include_section_group): Adjust section links and
2349 symbol section indexes.
2350 (Sized_relobj::do_layout): Adjust section links.
2351 (Sized_relobj::do_count_local_symbols): Adjust section links and
2352 symbol section indexes.
2353 (Sized_relobj::do_finalize_local_symbols): Distinguish between
2354 ordinary and special symbols.
2355 (Sized_relobj::write_local_symbols): Add symtab_xindex and
2356 dynsym_xindex parameters. Change all callers. Adjust section
2357 links. Use SHN_XINDEX when needed.
2358 (Sized_relobj::get_symbol_location_info): Adjust section links.
2359 Don't get fooled by special symbols.
2360 * object.h (class Xindex): Define.
2361 (class Object): Add xindex_ parameter. Declare virtual functoin
2362 do_initialize_xindex.
2363 (Object::adjust_sym_shndx): New function.
2364 (Object::set_xindex): New protected function.
2365 (class Symbol_value): Add is_ordinary_shndx_ field.
2366 (Symbol_value::Symbol_value): Initialize is_ordinary_shndx_.
2367 (Symbol_value::value): Assert ordinary section.
2368 (Symbol_value::initialize_input_to_output_map): Likewise.
2369 (Symbol_value::set_input_shndx): Add is_ordinary parameter.
2370 Change all callers.
2371 (Symbol_value::input_shndx): Add is_ordinary parameter. Change
2372 all callers.
2373 (class Sized_relobj): Update declarations.
2374 (Sized_relobj::local_symbol_input_shndx): Add is_ordinary
2375 parameter. Change all callers.
2376 (Sized_relobj::adjust_shndx): New function.
2377 * dynobj.cc (Sized_dynobj::Sized_dynobj): Initialize dynsym_shndx_
2378 field.
2379 (Sized_dynobj::find_dynsym_sections): Remove pdynsym_shndx
2380 parameter. Change all callers. Pick up SHT_DYNSYM_SHNDX section
2381 for SHT_DYNSYM section if available. Set dynsym_shndx_ field.
2382 (Sized_dynobj::read_dynsym_section): Adjust section links.
2383 (Sized_dynobj::read_dynamic): Likewise.
2384 (Sized_dynobj::do_read_symbols): Use dynsym_shndx_ field. Adjust
2385 section links.
2386 (Sized_dynobj::do_initialize_xindex): New function.
2387 * dynobj.h (class Sized_dynobj): Add dynsym_shndx_ field. Declare
2388 do_initialize_xindex.
2389 (Sized_dynobj::adjust_shndx): New function.
2390 * layout.cc (Layout::Layout): Initialize symtab_xindex_ and
2391 dynsym_xindex_ fields.
2392 (Layout::finalize): Add a call to set_section_indexes before
2393 creating the symtab sections.
2394 (Layout::set_section_indexes): Don't do anything if the section
2395 already has a section index.
2396 (Layout::create_symtab_sections): Add shnum parameter. Change
2397 caller. Create .symtab_shndx section if needed.
2398 (Layout::create_shdrs): Add shstrtab_section parameter. Change
2399 caller.
2400 (Layout::allocated_output_section_count): New function.
2401 (Layout::create_dynamic_symtab): Create .dynsym_shndx section if
2402 needed.
2403 * layout.h (class Layout): Add symtab_xindex_ and dynsym_xindex_
2404 fields. Update declarations.
2405 (Layout::symtab_xindex): New function.
2406 (Layout::dynsym_xindex): New function.
2407 (class Write_symbols_task): Add layout_ field.
2408 (Write_symbols_task::Write_symbols_task): Add layout parameter.
2409 Change caller.
2410 * output.cc (Output_section_headers::Output_section_headers): Add
2411 shstrtab_section parameter. Change all callers.
2412 (Output_section_headers::do_sized_write): Store overflow values
2413 for section count and section string table section index in
2414 section header zero.
2415 (Output_file_header::do_sized_write): Check for overflow of
2416 section count and section string table section index.
2417 (Output_symtab_xindex::do_write): New function.
2418 (Output_symtab_xindex::endian_do_write): New function.
2419 * output.h (class Output_section_headers): Add shstrtab_section_.
2420 Update declarations.
2421 (class Output_symtab_xindex): Define.
2422 (Output_section::has_out_shndx): New function.
2423 * symtab.cc (Symbol::init_fields): Initialize is_ordinary_shndx_
2424 field.
2425 (Symbol::init_base): Add st_shndx and is_ordinary parameters.
2426 Change all callers.
2427 (Sized_symbol::init): Likewise.
2428 (Symbol::output_section): Check for ordinary symbol.
2429 (Symbol_table::add_from_object): Remove orig_sym parameter. Add
2430 st_shndx, is_ordinary, and orig_st_shndx parameters. Change all
2431 callers.
2432 (Symbol_table::add_from_relobj): Add symndx_offset parameter.
2433 Change all callers. Simplify handling of symbols from sections
2434 not included in the link.
2435 (Symbol_table::add_from_dynobj): Handle ordinary symbol
2436 distinction.
2437 (Weak_alias_sorter::operator()): Assert that symbols are
2438 ordinary.
2439 (Symbol_table::sized_finalize_symbol): Handle ordinary symbol
2440 distinction.
2441 (Symbol_table::write_globals): Add symtab_xindex and dynsym_xindex
2442 parameters. Change all callers.
2443 (Symbol_table::sized_write_globals): Likewise. Handle ordinary
2444 symbol distinction. Use SHN_XINDEX when needed.
2445 (Symbol_table::write_section_symbol): Add symtab_xindex
2446 parameter. Change all callers.
2447 (Symbol_table::sized_write_section_symbol): Likewise. Use
2448 SHN_XINDEX when needed.
2449 * symtab.h (class Symbol): Add is_ordinary_shndx_ field. Update
2450 declarations.
2451 (Symbol::shndx): Add is_ordinary parameter. Change all callers.
2452 (Symbol::is_defined): Check is_ordinary.
2453 (Symbol::is_undefined, Symbol::is_weak_undefined): Likewise.
2454 (Symbol::is_absolute, Symbol::is_common): Likewise.
2455 (class Sized_symbol): Update declarations.
2456 (class Symbol_table): Update declarations.
2457 * resolve.cc (Symbol::override_base): Add st_shndx and is_ordinary
2458 parameters. Change all callers.
2459 (Sized_symbol::override): Likewise.
2460 (Symbol_table::override): Likewise.
2461 (symbol_to_bits): Add is_ordinary parameter. Change all callers.
2462 (Symbol_table::resolve): Remove orig_sym parameter. Add st_shndx,
2463 is_ordinary, and orig_st_shndx parameters. Change all callers.
2464 * copy-relocs.cc (Copy_relocs::emit_copy_reloc): Require symbol
2465 to be in an ordinary section.
2466 * dwarf_reader.cc (Sized_dwarf_line_info::symbol_section): Add
2467 object and is_ordinary parameters. Change all callers.
2468 (Sized_dwarf_line_info::read_relocs): Add object parameter.
2469 Change all callers. Don't add undefined or non-ordinary symbols
2470 to reloc_map_.
2471 (Sized_dwarf_line_info::read_line_mappings): Add object parameter.
2472 Change all callers.
2473 * dwarf_reader.h (class Sized_dwarf_line_info): Update
2474 declarations.
2475 * ehframe.cc (Eh_frame::read_fde): Check for ordinary symbol.
2476 * reloc.cc (Sized_relobj::do_read_relocs): Adjust section links.
2477 (Sized_relobj::relocate_sections): Likewise.
2478 * target-reloc.h (scan_relocs): Adjust section symbol index.
2479 (scan_relocatable_relocs): Likewise.
2480 * i386.cc (Scan::local): Check for ordinary symbols.
2481 * sparc.cc (Scan::local): Likewise.
2482 * x86_64.cc (Scan::local): Likewise.
2483 * testsuite/binary_unittest.cc (Sized_binary_test): Update calls
2484 to symbol_section_and_value.
2485 * testsuite/many_sections_test.cc: New file.
2486 * testsuite/Makefile.am (BUILT_SOURCES): Define.
2487 (check_PROGRAMS): Add many_sections_test.
2488 (many_sections_test_SOURCES): Define.
2489 (many_sections_test_DEPENDENCIES): Define.
2490 (many_sections_test_LDFLAGS): Define.
2491 (BUILT_SOURCES): Add many_sections_define.h.
2492 (many_sections_define.h): New target.
2493 (BUILT_SOURCES): Add many_sections_check.h.
2494 (many_sections_check.h): New target.
2495 (check_PROGRAMS): Add many_sections_r_test.
2496 (many_sections_r_test_SOURCES): Define.
2497 (many_sections_r_test_DEPENDENCIES): Define.
2498 (many_sections_r_test_LDFLAGS): Define.
2499 (many_sections_r_test_LDADD): Define.
2500 (many_sections_r_test.o): New target.
2501 * testsuite/Makefile.in: Rebuild.
2502
c5818ff1
CC
25032008-04-17 Cary Coutant <ccoutant@google.com>
2504
2505 * errors.cc (Errors::info): New function.
2506 (gold_info): New function.
2507 * errors.h (Errors::info): New function.
2508 * gold.h (gold_info): New function.
2509 * object.cc (Input_objects::add_object): Print trace output.
2510 * options.cc (options::parse_set): New function.
2511 (General_options::parse_wrap): Deleted.
2512 (General_options::General_options): Deleted initializer.
2513 * options.h (options::String_set): New typedef.
2514 (options::parse_set): New function.
2515 (DEFINE_set): New macro.
2516 (General_options::wrap): Changed to use DEFINE_set. Changed
2517 callers of any_wrap_symbols and is_wrap_symbol.
2518 (General_options::trace, General_options::trace_symbol):
2519 New options.
2520 (General_options::any_wrap_symbols, General_options::is_wrap_symbol)
2521 (General_options::wrap_symbols_): Deleted.
2522 * symtab.cc (Symbol_table::add_from_object): Print trace output.
2523
b5be4a7c
DM
25242008-04-17 David S. Miller <davem@davemloft.net>
2525
2526 * options.cc (General_options::parse_V): New function.
2527 * options.h: Add entries for -V and -Qy.
2528
155a0dd7
ILT
25292008-04-17 Ian Lance Taylor <iant@google.com>
2530
2531 * common.cc (Symbol_table::allocate_commons): Remove options
2532 parameter. Change caller.
2533 (Symbol_table::do_allocate_commons): Remove options parameter.
2534 Change caller. Just call do_allocate_commons_list twice.
2535 (Symbol_table::do_allocate_commons_list): New function, broken out
2536 of do_allocate_commons.
2537 * common.h (class Allocate_commons_task): Remove options_ field.
2538 Update constructor.
2539 * symtab.cc (Symbol_table::Symbol_table): Initialize
2540 tls_commons_.
2541 (Symbol_table::add_from_object): Put TLS common symbols on
2542 tls_commons_ list.
2543 (Symbol_table::sized_finalize_symbol): Handle STT_TLS symbols
2544 which are IN_OUTPUT_DATA.
2545 * symtab.h (class Symbol_table): Add tls_commons_ field. Update
2546 allocate_commons and do_allocate_commons declarations. Declare
2547 do_allocate_commons_list.
2548 * gold.cc (queue_middle_tasks): Update creation of
2549 Allocate_commons_task to not pass options.
2550 * testsuite/Makefile.am (INCLUDES): Add -I.. .
2551 (TLS_TEST_C_FLAGS): New variable.
2552 (tls_test_c_pic.o): New target.
2553 (tls_test_shared.so): Link in tls_test_c_pic.o.
2554 (tls_test_c_pic_ie.o): New target.
2555 (tls_test_ie_shared.so): Link in tls_test_c_pic_ie.o.
2556 (tls_test_DEPENDENCIES, tls_test_LDADD): Add tls_test_c.o.
2557 (tls_test_c.o): New target.
2558 (tls_pic_test_DEPENDENCIES): Add tls_test_c_pic.o.
2559 (tls_pic_test_LDADD): Likewise.
2560 (tls_shared_gd_to_ie_test_DEPENDENCIES): Add tls_test_c_pic.o.
2561 (tls_shared_gd_to_ie_test_LDADD): Likewise.
2562 (tls_test_c_gnu2.o): New target.
2563 (tls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): Add
2564 tls_test_c_gnu2.o.
2565 (tls_shared_gnu2_gd_to_ie_test_LDADD): Likewise.
2566 (tls_test_gnu2_shared.so): Link in tls_test_c_gnu2.o.
2567 (tls_test_shared_nonpic.so): Link in tls_test_c.o.
2568 * testsuite/tls_test.cc: Include "config.h".
2569 (t_last): Call t11_last.
2570 * testsuite/tls_test.h (t11, t11_last): Declare.
2571 * testsuite/tls_test_c.c: New file.
2572 * testsuite/tls_test_main.cc (thread_routine): Call t11.
2573 * configure.ac: Check for OpenMP support.
2574 * configure, config.in, Makefile.in: Rebuild.
2575 * testsuite/Makefile.in: Rebuild.
2576
edfbb029
CC
25772008-04-16 Cary Coutant <ccoutant@google.com>
2578
2579 * i386.cc (Target_i386::define_tls_base_symbol): New function.
2580 (Target_i386::tls_base_symbol_defined_): New field.
2581 (Target_i386::Scan::local): Define _TLS_MODULE_BASE_ symbol.
2582 (Target_i386::Scan::global): Likewise.
2583 * symtab.cc (sized_finalize_symbol): Add check for TLS symbol.
2584 * x86_64.cc (Target_x86_64::define_tls_base_symbol): New function.
2585 (Target_x86_64::tls_base_symbol_defined_): New field.
2586 (Target_x86_64::Scan::local): Define _TLS_MODULE_BASE_ symbol.
2587 (Target_x86_64::Scan::global): Likewise.
2588
f3c69fca
CC
25892008-04-16 Cary Coutant <ccoutant@google.com>
2590
2591 * symtab.h (Symbol::is_strong_undefined): Removed unused function.
2592 (Symbol::needs_plt_entry): Allow weak undefined symbols.
2593 (Symbol::needs_dynamic_reloc): Allow weak undefined symbols when
2594 building shared libraries.
2595 * testsuite/Makefile.am (weak_undef_nonpic_test): New target.
2596 (weak_undef_file1_nonpic.o, weak_undef_file2_nonpic.o)
2597 (weak_undef_lib_nonpic.so, alt/weak_undef_lib_nonpic.so): New targets.
2598 * testsuite/Makefile.in: Rebuild.
2599 * testsuite/weak_undef.h: New file.
2600 * testsuite/weak_undef_file1.cc: Add extra test cases.
2601 * testsuite/weak_undef_file2.cc: Likewise.
2602 * testsuite/weak_undef_test.cc: Likewise.
2603
7c414435
DM
26042008-04-16 David S. Miller <davem@davemloft.net>
2605
32b769e1
DM
2606 * sparc.cc (Target_sparc::Scan): Change from struct to class.
2607 Add issued_non_pic_error_ field. Declare check_non_pic.
2608 (Target_sparc::Scan::check_non_pic): New function.
2609 (Target_sparc::Scan::local): Call check_non_pic as appropriate.
2610 (Target_sparc::Scan::global): Likewise.
2611
11936fb1
DM
2612 * configure.ac (FN_PTRS_IN_SO_WITHOUT_PIC): Add sparc64.
2613 * configure: Rebuild.
2614
7c414435
DM
2615 * options.h (DEFINE_enable): New macro.
2616 (new_dtags): New enable option.
2617 (initfirst, interpose, loadfltr, nodefaultlib,
2618 nodelete, nodlopen, nodump): New -z options.
2619 * layout.cc (Layout:finish_dynamic_section): If new
2620 dtags enabled, emit DT_RUNPATH. Also, emit a
2621 DT_FLAGS_1 containing any specified -z flags.
2622
85c7bf8b
ILT
26232008-04-16 Ian Lance Taylor <iant@google.com>
2624
12c0daef
ILT
2625 * copy-relocs.cc: New file.
2626 * copy-relocs.h: New file.
2627 * reloc.cc: Remove Copy_relocs code.
2628 * reloc.h: Likewise.
2629 * reloc-types.h (struct Reloc_types) [both versions]: Add
2630 get_reloc_addend_noerror.
2631 * output.h (class Output_data_reloc<elfcpp::SHT_REL>): Add
2632 variants of add_global which take an addend which must be zero.
2633 * i386.cc: Include "copy-relocs.h".
2634 (class Target_i386): Change type of copy_relocs_ to variable,
2635 update initializer.
2636 (Target_i386::copy_reloc): Rewrite to pass to Copy_relocs class.
2637 Change all callers.
2638 (Target_i386::do_finalize_sections): Change handling of
2639 copy_relocs_.
2640 * sparc.cc: Include "copy-relocs.h".
2641 (class Target_sparc): Change type of copy_relocs_ to variable,
2642 update initializer.
2643 (Target_sparc::copy_reloc): Rewrite to pass to Copy_relocs class.
2644 Change all callers.
2645 (Target_sparc::do_finalize_sections): Change handling of
2646 copy_relocs_.
2647 * x86_64.cc: Include "copy-relocs.h".
2648 (class Target_x86_64): Change type of copy_relocs_ to variable,
2649 update initializer.
2650 (Target_x86_64::copy_reloc): Rewrite to pass to Copy_relocs
2651 class. Change all callers.
2652 (Target_x86_64::do_finalize_sections): Change handling of
2653 copy_relocs_.
2654 * Makefile.am (CCFILES): Add copy-relocs.cc.
2655 (HFILES): Add copy-relocs.h.
2656
4f4995b6
ILT
2657 * Makefile.in, aclocal.m4, testsuite/Makefile.in: Rebuild.
2658
85c7bf8b
ILT
2659 * testsuite/script_test_4.sh: Permit leading zeroes.
2660
4f2a9edd
ILT
26612008-04-15 Ian Lance Taylor <iant@google.com>
2662
e6188289
ILT
2663 * script-sections.cc (Script_sections::create_segments): Use
2664 header_size_adjustment even when there is enough room for the
2665 headers.
2666 * testsuite/script_test_4.sh: New file.
2667 * testsuite/script_test_4.t: New file.
2668 * testsuite/Makefile.am (check_SCRIPTS): Add script_test_4.sh.
2669 (check_DATA): Add script_test_4.stdout.
2670 (MOSTLYCLEANFILES): Likewise.
2671 (script_test_4): New target.
2672 (script_test_4.stdout): New target.
2673 * testsuite/Makefile.in: Rebuild.
2674
4f2a9edd
ILT
2675 * sparc.cc: Add definitions for Output_data_plt_sparc class
2676 constants.
2677
f5314dd5
DM
26782008-04-14 David S. Miller <davem@davemloft.net>
2679
2680 * sparc.cc: New file.
2681 * Makefile.am (TARGETSOURCES): Add sparc.cc
2682 (ALL_TARGETOBJS): Add sparc.$(OBJEXT)
2683 * configure.tgt: Document targ_extra_size and
2684 targ_extra_big_endian. Add entries for sparc-* and
2685 sparc64-*.
2686 * configure.ac: Handle targ_extra_size and
2687 targ_extra_big_endian.
2688 * Makefile.in: Rebuild.
2689 * configure: Likewise.
2690 * po/POTFILES.in: Likewise.
2691 * po/gold.pot: Likewise.
2692
154e0e9a
ILT
26932008-04-14 Ian Lance Taylor <iant@google.com>
2694
2695 * layout.cc (Layout::Layout): Initialize sections_are_attached_.
2696 (Layout::get_output_section): Ignore SHF_WRITE and SHF_EXECINSTR
2697 in the name/type/flags to section mapping. Don't call
2698 allocate_output_section.
2699 (Layout::choose_output_section): Change parameter from adjust_name
2700 to is_input_section. Don't permit input sections after sections
2701 are attached to segments. Don't call allocate_output_section.
2702 (Layout::layout_eh_frame): Call update_flags_for_input_section,
2703 not write_enable_output_section.
2704 (Layout::make_output_section): Don't push to
2705 unattached_section_list_ nor call attach_to_segment. Call
2706 attach_section_to_segment if sections are attached.
2707 (Layout::attach_sections_to_segments): New function.
2708 (Layout::attach_section_to_segment): New function.
2709 (Layout::attach_allocated_section_to_segment): Rename from
2710 attach_to_segment. Remove flags parameter.
2711 (Layout::allocate_output_section): Remove function.
2712 (Layout::write_enable_output_section): Remove function.
2713 * layout.h (class Layout): Update for above changes. Add new
2714 field sections_are_attached_.
2715 * output.h (Output_section::update_flags_for_input_section): New
2716 function.
2717 * output.cc (Output_section::add_input_section): Call
2718 update_flags_for_input_section.
2719 * gold.cc (queue_middle_tasks): Call attach_sections_to_segments.
2720
009a67a2
CC
27212008-04-11 Cary Coutant <ccoutant@google.com>
2722
2723 * i386.cc (Target_i386::got_mod_index_entry): Restore code previously
2724 thought unnecessary.
2725 * x86_64.cc (Target_x86_64::got_mod_index_entry): Likewise.
2726
759b1a24
ILT
27272008-04-11 Ian Lance Taylor <iant@google.com>
2728
2729 * output.h (class Output_section_data): Remove inline definition
2730 of set_addralign.
2731 * output.cc (Output_section_data::set_addralign): New function.
2732
c2b45e22
CC
27332008-04-11 Cary Coutant <ccoutant@google.com>
2734
2735 Add support for TLS descriptors for i386 and x86_64.
2736 * i386.cc (Target_i386::Relocate::tls_desc_gd_to_ie): New function.
2737 (Target_i386::Relocate::tls_desc_gd_to_le): New function.
2738 (Target_i386::Got_type): Add GOT_TYPE_TLS_NOFFSET and
2739 GOT_TYPE_TLS_DESC.
2740 (Target_i386::got_mod_index_entry): Remove unnecessary code.
2741 (Target_i386::Scan::local): Implement R_386_TLS_GOTDESC and
2742 R_386_TLS_DESC_CALL relocations. Fix problem with initial-exec
2743 relocations.
2744 (Target_i386::Scan::global): Fix problem with GD-to-IE relaxation.
2745 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations;
2746 Fix problem with initial-exec relocations.
2747 (Target_i386::Relocate::relocate_tls): Likewise.
2748 (Target_i386::Relocate::tls_gd_to_ie): Fix problem with GD-to-IE
2749 relaxation.
2750 * output.cc (Output_data_dynamic::Dynamic_entry::write): Add
2751 support for section-plus-offset dynamic table entries.
2752 * output.h (Output_data_dynamic::add_section_plus_offset): New function.
2753 (Output_data_dynamic::Dynamic_entry): Add support for
2754 section-plus-offset dynamic table entries.
2755 (Output_data_dynamic::Classification): Likewise.
2756 (Output_data_dynamic::classification_): Renamed offset_.
2757 * x86_64.cc (Target_x86_64::Relocate::tls_desc_gd_to_ie): New function.
2758 (Target_x86_64::Relocate::tls_desc_gd_to_le): New function.
2759 (Target_x86_64::make_plt_section): New function.
2760 (Target_x86_64::reserve_tlsdesc_entries): New function.
2761 (Output_data_plt_x86_64::Output_data_plt_x86_64): Add new parameter.
2762 (Output_data_plt_x86_64::reserve_tlsdesc_entry): New function.
2763 (Output_data_plt_x86_64::has_tlsdesc_entry): New function.
2764 (Output_data_plt_x86_64::get_tlsdesc_got_offset): New function.
2765 (Output_data_plt_x86_64::get_tlsdesc_plt_offset): New function.
2766 (Output_data_plt_x86_64::tlsdesc_plt_entry): New field.
2767 (Output_data_plt_x86_64::set_final_data_size): Move out of line;
2768 add extra PLT entry for TLS descriptors.
2769 (Output_data_plt_x86_64::got_): New field.
2770 (Output_data_plt_x86_64::tlsdesc_got_offset_): New field.
2771 (Output_data_plt_x86_64::Output_data_plt_x86_64): Initialize new
2772 fields.
2773 (Output_data_plt_x86_64::do_write): Write extra PLT entry for TLS
2774 descriptors.
2775 (Target_x86_64::make_plt_entry): Factor out make_plt_section.
2776 (Target_x86_64::got_mod_index_entry): Remove unnecessary code.
2777 (Target_x86_64::Scan::local): Implement R_386_TLS_GOTDESC and
2778 R_386_TLS_DESC_CALL relocations.
2779 (Target_x86_64::Scan::global): Likewise.
2780 (Target_x86_64::do_finalize_sections): Add dynamic table entries
2781 for TLS descriptors.
2782 (Relocate::relocate_tls): Fix problem with GD-to-IE relaxation.
2783 Implement R_386_TLS_GOTDESC and R_386_TLS_DESC_CALL relocations.
2784 (Target_x86_64::Relocate::tls_gd_to_ie): Fix problem with
2785 GD-to-IE relaxation.
2786 * configure.ac: Export new conditional variables TLS_GNU2_DIALECT
2787 and TLS_DESCRIPTORS.
2788 * Makefile.in: Rebuild.
2789 * configure: Rebuild.
2790 * testsuite/Makefile.am (tls_shared_gd_to_ie_test): New target.
2791 (tls_test_shared2.so): New target.
2792 (tls_shared_gd_to_ie_test_SOURCES): New variable.
2793 (tls_shared_gd_to_ie_test_DEPENDENCIES): New variable.
2794 (tls_shared_gd_to_ie_test_LDFLAGS): New variable.
2795 (tls_shared_gd_to_ie_test_LDADD): New variable.
2796 (tls_shared_gnu2_gd_to_ie_test): New target.
2797 (tls_test_gnu2.o, tls_test_file2_gnu2.o, tls_test_gnu2_shared2.so):
2798 New targets.
2799 (tls_shared_gnu2_gd_to_ie_test_SOURCES): New variable.
2800 (ls_shared_gnu2_gd_to_ie_test_DEPENDENCIES): New variable.
2801 (tls_shared_gnu2_gd_to_ie_test_LDFLAGS): New variable.
2802 (tls_shared_gnu2_gd_to_ie_test_LDADD): New variable.
2803 (tls_shared_gnu2_test): New target.
2804 (tls_test_gnu2_shared.so): New target.
2805 (tls_shared_gnu2_test_SOURCES): New variable.
2806 (tls_shared_gnu2_test_DEPENDENCIES): New variable.
2807 (tls_shared_gnu2_test_LDFLAGS): New variable.
2808 (tls_shared_gnu2_test_LDADD): New variable.
2809 * testsuite/Makefile.in: Rebuild.
2810 * testsuite/Makefile.
2811
83bfb6b7
ILT
28122008-04-11 Ian Lance Taylor <iant@google.com>
2813
2814 * testsuite/Makefile.am (justsyms_2r.o): Add dependency on
2815 justsyms.t.
2816 * testsuite/Makefile.in: Rebuild.
2817
2818 * testsuite/script_test_2a.cc (script_test_string_a): Make 8 bytes
2819 long.
2820 * testsuite/script_test_2.cc (main): Adjust test.
2821
706e1f5e
ILT
28222008-04-11 David S. Miller <davem@davemloft.net>
2823 Ian Lance Taylor <iant@google.com>
2824
2825 * options.h (General_options): Add entries for '-Y' and
2826 '-relax'.
2827 * options.cc (General_options:finalize): If -Y was used, add those
2828 entries to the library path instead of the default "/lib" and
2829 "/usr/lib".
2830
7c98e6bb
DM
28312008-04-11 David S. Miller <davem@davemloft.net>
2832
2833 * testsuite/justsyms.t: Start at 0x100.
2834 * testsuite/justsyms_1.cc: Adjust justsyms_string assertion.
83bfb6b7
ILT
2835 * testsuite/script_test_2b.cc (script_test_string_b): Make 8 bytes
2836 long.
2837 * testsuite/script_test_2.cc: Adjust string and section length
2838 checks.
7c98e6bb 2839
99a37bfd
ILT
28402008-04-09 Ian Lance Taylor <iant@google.com>
2841
2cefc357
ILT
2842 PR gold/5996
2843 * script-sections.cc (Sections_element::allocate_to_segment): Add
2844 orphan parameter.
2845 (Output_section_definition::allocate_to_segment): Likewise.
2846 (Orphan_output_section::allocate_to_segment): Likewise.
2847 (Script_sections::attach_sections_using_phdrs_clause): Don't
2848 propagate non-PT_LOAD segments to orphan sections.
2849 * testsuite/Makefile.am (script_test_3.stdout): Generate using
2850 readelf rather than objdump.
2851 * testsuite/script_test_3.sh: Adjust accordingly. Test that
2852 .interp section and PT_INTERP segment are the same size.
2853 * testsuite/Makefile.in: Rebuild.
2854
99a37bfd
ILT
2855 * symtab.cc (Symbol_table::add_from_dynobj): Only look for weak
2856 aliases for symbols defined in the same object.
2857 * testsuite/Makefile.am (check_PROGRAMS): Add weak_alias_test.
2858 (weak_alias_test_SOURCES): New variable.
2859 (weak_alias_test_DEPENDENCIES): New variable.
2860 (weak_alias_test_LDFLAGS): New variable.
2861 (weak_alias_test_LDADD): New variable.
2862 (weak_alias_test_1_pic.o, weak_alias_test_1.so): New targets.
2863 (weak_alias_test_2_pic.o, weak_alias_test_2.so): New targets.
2864 (weak_alias_test_3.o): New target.
2865 (weak_alias_test_4_pic.o, weak_alias_test_4.so): New targets.
2866 * testsuite/weak_alias_test_main.cc: New file.
2867 * testsuite/weak_alias_test_1.cc: New file.
2868 * testsuite/weak_alias_test_2.cc: New file.
2869 * testsuite/weak_alias_test_3.cc: New file.
2870
780e49c5
ILT
28712008-04-08 Ian Lance Taylor <iant@google.com>
2872
cdb0b8f5
ILT
2873 * options.h (class General_options): Add --noinhibit-exec option.
2874 * main.cc (main): Check --noinhibit-exec.
2875
0864d551
ILT
2876 * options.h (class General_options): Define --wrap as a special
2877 option. Add wrap_symbols_ field.
2878 (General_options::any_wrap_symbols): New function.
2879 (General_options::is_wrap_symbol): New function.
2880 * options.cc (General_options::parse_wrap): New function.
2881 (General_options::General_options): Initialize wrap_symbols_.
2882 * symtab.cc (Symbol_table::wrap_symbol): New function.
2883 (Symbol_table::add_from_object): Handle --wrap.
2884 * symtab.h (class Symbol_table): Declare wrap_symbol.
2885 * target.h (Target::wrap_char): New function.
2886 (Target::Target_info): Add wrap_char field.
2887 * i386.cc (Target_i386::i386_info): Initialize wrap_char.
2888 * x86_64.cc (Target_x86_64::x86_64_info): Likewise.
2889 * testsuite/testfile.cc (Target_test::test_target_info):
2890 Likewise.
2891
789aa6de
ILT
2892 * errors.cc (Errors::undefined_symbol): Mention symbol version if
2893 there is one.
2894
2c38906f
ILT
2895 * layout.h (class Layout): Add added_eh_frame_data_ field.
2896 * layout.cc (Layout::Layout): Initialize new field.
2897 (Layout::layout_eh_frame): Don't add eh_frame_data_ to .eh_frame
2898 output section until we find a section we merged successfully.
2899 * object.cc (Sized_relobj::check_eh_frame_flags): Don't require
2900 that the size be non-zero.
2901
780e49c5
ILT
2902 * merge.cc (Object_merge_map::get_output_offset): Remove inline
2903 qualifier.
2904
7fcd0256
ILT
29052008-04-08 Craig Silverstein <csilvers@google.com>
2906
2907 * configure.ac: Export new conditional variable HAVE_ZLIB.
2908 * testsuite/Makefile.am (flagstest_o_specialfile): Condition
2909 on HAVE_ZLIB.
2910 (flagstest_o_specialfile_and_compress_debug_sections): Likewise.
2911 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
2912
6835af53
ILT
29132008-04-07 Ian Lance Taylor <iant@google.com>
2914
e24f324c
ILT
2915 * version.cc (version_string): Set to "1.5".
2916
a036edd8
ILT
2917 * x86_64.cc (Target_x86_64::Scan): Change from struct to class.
2918 Add issued_non_pic_error_ field. Declare check_non_pic.
2919 (Target_x86_64::Scan::check_non_pic): New function.
2920 (Target_x86_64::Scan::local): Call check_non_pic as appropriate.
2921 (Target_x86_64::Scan::global): Likewise.
2922
624f8810
ILT
2923 * output.cc (Output_reloc<SHT_REL>::local_section_offset): Add
2924 addend parameter. Change caller. Handle merge sections.
2925 (Output_reloc<SHT_REL>::symbol_value): Change parameter type from
2926 Address to Addend. Don't add in the result of
2927 local_section_offset, pass down the addend and use the returned
2928 value.
2929 * output.h (class Output_reloc<SHT_REL>): Add Addend typedef.
2930 Update declarations of local_section_offset and symbol_value.
2931 * testsuite/two_file_test_1.cc (t18): New function.
2932 * testsuite/two_file_test_2.cc (f18): New function.
2933 * testsuite/two_file_test_main.cc (main): Call t18.
2934 * testsuite/two_file_test.h (t18, f18): Declare.
2935
6835af53
ILT
2936 * configure.ac: Don't test for objdump, c++filt, or readelf.
2937 * testsuite/Makefile.am: Remove READELF and OBJDUMP_AND_CPPFILT
2938 conditionals.
2939 (TEST_READELF): New variable.
2940 (TEST_OBJDUMP, TEST_CXXFILT, TEST_STRIP): New variables.
2941 (check_PROGRAMS): Add two_file_strip_test.
2942 (two_file_strip_test): New target.
2943 (check_PROGRAMS): Add two_file_same_shared_strip_test.
2944 (two_file_same_shared_strip_test_SOURCES): New variable.
2945 (two_file_same_shared_strip_test_DEPENDENCIES): New variable.
2946 (two_file_same_shared_strip_test_LDFLAGS): New variable.
2947 (two_file_same_shared_strip_test_LDADD): New variable.
2948 (two_file_shared_strip.so): New target.
2949 (ver_test_2.syms, ver_test_4.syms): Use TEST_READELF.
2950 (ver_test_5.syms, ver_test_7.syms): Likewise.
2951 (ver_matching_test.stdout): Use TEST_OBJDUMP and TEST_CXXFILT.
2952 (strip_test_3.stdout): Use TEST_OBJDUMP.
2953 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
2954
86925eef
CC
29552008-04-04 Cary Coutant <ccoutant@google.com>
2956
2957 * symtab.h (Symbol::is_weak_undefined): New function.
2958 (Symbol::is_strong_undefined): New function.
2959 (Symbol::is_absolute): New function.
2960 (Symbol::needs_plt_entry): Exclude weak undefined symbols.
2961 (Symbol::needs_dynamic_reloc): Exclude weak undefined and
2962 absolute symbols.
2963 * testsuite/Makefile.am (check_PROGRAMS): Add weak_undef_test.
2964 (weak_undef_test): New target.
2965 * testsuite/Makefile.in: Rebuild.
2966 * testsuite/weak_undef_file1.cc: New file.
2967 * testsuite/weak_undef_file2.cc: New file.
2968 * testsuite/weak_undef_test.cc: New file.
2969
126f3ece
ILT
29702008-04-03 Craig Silverstein <csilvers@google.com>
2971
2972 * compressed_output.h (class Output_compressed_section): Use
2973 unsigned buffer.
2974 * compressed_output.cc (zlib_compress): Use unsigned buffers,
2975 add zlib header.
2976 (zlib_compressed_suffix): Removed.
2977 (Output_compressed_section::set_final_data_size): Use unsigned
2978 buffers.
2979 * testsuite/Makefile.am (flagstest_compress_debug_sections):
2980 Fix linker invocation.
2981 (flagstest_o_specialfile_and_compress_debug_sections):
2982 Likewise.
2983 * testsuite/Makefile.in: Regenerated.
2984
deae2a14
DM
29852008-04-02 David S. Miller <davem@davemloft.net>
2986
2987 * dwarf_reader.cc (Sized_dwarf_line_info::read_header_prolog,
2988 Sized_dwarf_line_info::process_one_opcode): Use Swap_unaligned.
2989
70752818
ILT
29902008-04-02 Craig Silverstein <csilvers@google.com>
2991
2992 * TODO: New file.
2993
39d0cb0e
ILT
29942008-04-02 Ian Lance Taylor <iant@google.com>
2995
2996 * fileread.cc (File_read::find_view): Add byteshift and vshifted
2997 parameters. Update for new key type to views_. Change all
2998 callers.
2999 (File_read::read): Adjust for byteshift in returned view.
3000 (File_read::add_view): New function, broken out of
3001 find_and_make_view.
3002 (File_read::make_view): New function, broken out of
3003 find_and_make_view.
3004 (File_read::find_or_make_view): Add offset and aligned
3005 parameters. Rewrite accordingly. Change all callers.
3006 (File_read::get_view): Add offset and aligned parameters. Adjust
3007 for byteshift in return value.
3008 (File_read::get_lasting_view): Likewise.
3009 * fileread.h (class File_read): Update declarations.
3010 (class File_read::View): Add byteshift_ field. Add byteshift to
3011 constructor. Add byteshift method.
3012 * archive.h (Archive::clear_uncached_views): New function.
3013 (Archive::get_view): Add aligned parameter. Change all callers.
3014 * object.h (Object::get_view): Add aligned parameter. Change all
3015 callers.
3016 (Object::get_lasting_view): Likewise.
3017
3018 * fileread.cc (File_read::release): Don't call clear_views if
3019 there are multiple objects.
3020 * fileread.h (File_read::clear_uncached_views): New function.
3021 * archive.cc (Add_archive_symbols::run): Call clear_uncached_views
3022 on the archive.
3023
a1207466
CC
30242008-03-31 Cary Coutant <ccoutant@google.com>
3025
3026 Add thin archive support.
3027 * archive.cc (Archive::armagt): New const.
3028 (Archive::setup): Remove task parameter and calls to unlock.
3029 (Archive::unlock_nested_archives): New function.
3030 (Archive::read_header): Add nested_off parameter. Change
3031 all callers.
3032 (Archive::interpret_header): Likewise.
3033 (Archive::include_all_members): Change to handle thin
3034 archives.
3035 (Archive::include_member): Likewise.
3036 * archive.h (Archive::Archive): Add new parameters and
3037 initializers.
3038 (Archive::armagt): New const.
3039 (Archive::setup): Remove task parameter.
3040 (Archive::unlock_nested_archives): New function.
3041 (Archive::read_header): Add nested_off parameter.
3042 (Archive::interpret_header): Likewise.
3043 (Archive::Nested_archive_table): New typedef.
3044 (Archive::is_thin_archive_): New field.
3045 (Archive::nested_archives_): New field.
3046 (Archive::options_): New field.
3047 (Archive::dirpath_): New field.
3048 (Archive::task_): New field.
3049 * readsyms.cc (Read_symbols::do_read_symbols): Add check
3050 for thin archives. Pass additional parameters to
3051 Archive::Archive. Unlock the archive file after calling
3052 Archive::setup.
cd536b21 3053
479f6503
ILT
30542008-03-29 Ian Lance Taylor <iant@google.com>
3055
686c8caf
ILT
3056 * symtab.cc (Symbol_table::do_define_as_constant): Don't force a
3057 version symbol to be local.
3058 * testsuite/ver_test_4.sh: New file.
3059 * testsuite/Makefile.am (check_SCRIPTS): Add ver_test_4.sh.
3060 (check_DATA): Add ver_test_4.syms.
3061 (ver_test_4.syms): New target.
3062 * testsuite/Makefile.in: Rebuild.
3063
ab794b6b
ILT
3064 * output.cc
3065 (Output_section::Input_section_sort_entry::has_priority): New
3066 function.
3067 (Output_section::Input_section_sort_entry::match_file_name): New
3068 function.
3069 (Output_section::Input_section_sort_entry::match_section_name):
3070 Remove.
3071 (Output_section::Input_section_sort_entry::match_section_name_prefix):
3072 Remove.
3073 (Output_section::Input_section_sort_entry::match_section_file):
3074 Remove.
3075 (Output_section::Input_section_sort_compare::operator()): Rewrite
3076 using new Input_section_sort_entry functions. Sort crtbegin and
3077 crtend first. Sort sections with no priority before sections with
3078 a priority.
3079 * testsuite/initpri1.c (d3): Check j != 4.
3080 (cd5): New constructor/destructor function.
3081 (main): Check j != 2.
3082
479f6503
ILT
3083 * symtab.cc (Symbol_table::add_from_object): If we don't use the
3084 new symbol when resolving, don't call set_is_default.
3085 * testsuite/ver_test_7.cc: New file.
3086 * testsuite/ver_test_7.sh: New file.
3087 * testsuite/Makefile.am (ver_test_7.so): New target.
3088 (ver_test_7.o): New target.
3089 (check_SCRIPTS): Add ver_test_7.sh.
3090 (check_DATA): Add ver_test_7.syms.
3091 (ver_test_7.syms): New target.
3092
2fd32231
ILT
30932008-03-28 Ian Lance Taylor <iant@google.com>
3094
3095 * layout.cc (Layout::layout): If we see an input section with a
3096 name that needs sorting, set the must_sort flag for the output
3097 section.
3098 (Layout::make_output_section): If the name of the output section
3099 indicates that it might require sorting, set the may_sort flag.
3100 * output.h (Output_section::may_sort_attached_input_sections): New
3101 function.
3102 (Output_section::set_may_sort_attached_input_sections): New
3103 function.
3104 (Output_section::must_sort_attached_input_sections): New
3105 function.
3106 (Output_section::set_must_sort_attached_input_sections): New
3107 function.
3108 (class Output_section): Declare Input_section_sort_entry. Define
3109 Input_section_sort_compare. Declare
3110 sort_attached_input_sections. Add new fields:
3111 may_sort_attached_input_sections_,
3112 must_sort_attached_input_sections_,
3113 attached_input_sections_are_sorted_.
3114 * output.cc (Output_section::Output_section): Initialize new
3115 fields.
3116 (Output_section::add_input_section): Add an entry to
3117 input_sections_ if may_sort or must_sort are true.
3118 (Output_section::set_final_data_size): Call
3119 sort_attached_input_sections if necessary.
3120 (Output_section::Input_section_sort_entry): Define new class.
3121 (Output_section::Input_section_sort_compare::operator()): New
3122 function.
3123 (Output_section::sort_attached_input_sections): New function.
3124 * configure.ac: Check whether the compiler supports constructor
3125 priorities. Define a CONSTRUCTOR_PRIORITY automake conditional.
3126 * testsuite/initpri1.c: New file.
3127 * testsuite/Makefile.am (check_PROGRAMS): Add initpri1 if
3128 CONSTRUCTOR_PRIORITY.
3129 (initpri1_SOURCES, initpri1_DEPENDENCIES): New variables.
3130 (initpri1_LDFLAGS): New variable.
3131 * configure, Makefile.in, testsuite/Makefile.in: Rebuild.
3132
18e6b24e
ILT
31332008-03-27 Ian Lance Taylor <iant@google.com>
3134
49bdd526
ILT
3135 * common.cc (Sort_commons::operator): Correct sorting algorithm.
3136 * testsuite/common_test_1.c: New file.
3137 * testsuite/Makefile.am (check_PROGRAMS): Add common_test_1.
3138 (common_test_1_SOURCES): New variable.
3139 (common_test_1_DEPENDENCIES): New variable.
3140 (common_test_1_LDFLAGS): New variable.
3141
18e6b24e
ILT
3142 * symtab.cc (Symbol_table::add_from_object): Handle saw_undefined_
3143 and commons_ correctly when NAME/VERSION does not override
3144 NAME/NULL.
3145 * testsuite/ver_test_6.c: New file.
3146 * testsuite/Makefile.am (check_PROGRAMS): Add ver_test_6
3147 (ver_test_6_SOURCES, ver_test_6_DEPENDENCIES): New variables.
3148 (ver_test_6_LDFLAGS, ver_test_6_LDADD): New variables.
3149
04bf7072
ILT
31502008-03-26 Ian Lance Taylor <iant@google.com>
3151
5871526f
ILT
3152 * symtab.cc (Symbol_table::add_from_relobj): Don't set the version
3153 of an undefined symbol from a version script.
3154 * testsuite/Makefile.am (ver_test_5.so): New target.
3155 (ver_test_5.o): New target.
3156 (check_SCRIPTS): Add ver_test_5.sh.
3157 (check_DATA): Add ver_test_5.syms.
3158 (ver_test_5.syms): New target.
3159 * testsuite/ver_test_5.cc: New file.
3160 * testsuite/ver_test_5.script: New file.
3161 * testsuite/ver_test_5.sh: New file.
3162 * Makefile.in, testsuite/Makefile.in: Rebuild.
3163
04bf7072
ILT
3164 PR gold/5986
3165 Fix problems building gold with gcc 4.3.0.
3166 * gold.h (TEMPLATE_ATTRIBUTE_PRINTF_4): Define.
3167 (gold_error_at_location, gold_warning_at_location): Use it.
3168 * configure.ac: Check whether we can compile and use a template
3169 function with a printf attribute.
3170 * x86_64.cc (Target_x86_64::do_code_fill): Swap out a 32-bit value
3171 when jumping over bytes.
3172 * object.cc: Instantiate Object::read_section_data.
3173 * debug.h: Include <cstring>
3174 * dwarf_reader.cc: Include <algorithm>
3175 * main.cc: Include <cstring>.
3176 * options.cc: Include <cstring>.
3177 * output.cc: Include <cstring>.
3178 * script.cc: Include <cstring>.
3179 * script.h: Include <string>.
3180 * symtab.cc: Include <cstring> and <algorithm>.
3181 * target-select.cc: Include <cstring>.
3182 * version.cc: Include <string>.
3183 * testsuite/testmain.cc: Include <cstdlib>.
3184 * configure, config.in: Rebuild.
3185
874c5b28
ILT
31862008-03-25 Ian Lance Taylor <iant@google.com>
3187
819d6c3a
ILT
3188 * options.cc: Include "../bfd/bfdver.h".
3189 (options::help): Print bug reporting address.
3190
f4b2c6f5
ILT
3191 * version.cc (print_version): Adjust output for current value of
3192 BFD_VERSION_STRING.
3193
3194 * NEWS: New file.
3195
e96caa79
ILT
3196 * options.cc (options::help): Print list of supported targets.
3197 * target-select.h: Include <vector>.
3198 (class Target_selector): Make machine_, size_, and is_big_endian_
3199 fields const. Add bfd_name_ and instantiated_target_ fields.
3200 (Target_selector::Target_selector): Add bfd_name parameter.
3201 (Target_selector::recognize): Make non-virtual, call
3202 do_recognize.
3203 (Target_selector::recognize_by_name): Make non-virtual, call
3204 do_recognize_by_name.
3205 (Target_selector::supported_names): New function.
3206 (Target_selector::bfd_name): New function.
3207 (Target_selector::do_instantiate_target): New pure virtual
3208 function.
3209 (Target_selector::do_recognize): New virtual function.
3210 (Target_selector::do_recognize_by_name): New virtual function.
3211 (Target_selector::instantiate_target): New private function.
3212 (supported_target_names): Declare.
3213 * target-select.cc (Target_selector::Target_selector): Update for
3214 new parameter and fields.
3215 (select_target_by_name): Check that the name matches before
3216 calling recognize_by_name.
3217 (supported_target_names): New function.
3218 * i386.cc (class Target_selector_i386): Update Target_selector
3219 constructor call. Remove recognize and recognize_by_name. Add
3220 do_instantiate_target.
3221 * x86_64.cc (class Target_selector_x86_64): Likewise.
3222 * testsuite/testfile.cc (class Target_selector_test): Update for
3223 changes to Target_selector.
3224
874c5b28
ILT
3225 * README: Rewrite, with some notes on unsupported features.
3226
0a65a3a7
CC
32272008-03-24 Cary Coutant <ccoutant@google.com>
3228
3229 * i386.cc (Target_i386::Got_type): New enum declaration.
3230 (Target_i386::Scan::local): Updated callers of Output_data_got
3231 member functions.
3232 (Target_i386::Scan::global): Likewise.
3233 (Target_i386::Relocate::relocate): Likewise.
3234 (Target_i386::Relocate::relocate_tls): Likewise.
3235 * object.h (Got_offset_list): New class.
3236 (Sized_relobj::local_has_got_offset): Added got_type parameter.
3237 (Sized_relobj::local_got_offset): Likewise.
3238 (Sized_relobj::set_local_got_offset): Likewise.
3239 (Sized_relobj::local_has_tls_got_offset): Removed.
3240 (Sized_relobj::local_tls_got_offset): Removed.
3241 (Sized_relobj::set_local_tls_got_offset): Removed.
3242 (Sized_relobj::Local_got_offsets): Changed to store a list of offsets.
3243 * output.cc (Output_data_got::add_global): Added got_type parameter.
3244 (Output_data_got::add_global_with_rel): Likewise.
3245 (Output_data_got::add_global_with_rela): Likewise.
3246 (Output_data_got::add_global_pair_with_rel): New function.
3247 (Output_data_got::add_global_pair_with_rela): New function.
3248 (Output_data_got::add_local): Added got_type parameter.
3249 (Output_data_got::add_local_with_rel): Likewise.
3250 (Output_data_got::add_local_with_rela): Likewise.
3251 (Output_data_got::add_local_pair_with_rel): New function.
3252 (Output_data_got::add_local_pair_with_rela): New function.
3253 (Output_data_got::add_global_tls): Removed.
3254 (Output_data_got::add_global_tls_with_rel): Removed.
3255 (Output_data_got::add_global_tls_with_rela): Removed.
3256 (Output_data_got::add_local_tls): Removed.
3257 (Output_data_got::add_local_tls_with_rel): Removed.
3258 (Output_data_got::add_local_tls_with_rela): Removed.
3259 * output.h (Output_data_got::add_global): Added got_type parameter.
3260 (Output_data_got::add_global_with_rel): Likewise.
3261 (Output_data_got::add_global_with_rela): Likewise.
3262 (Output_data_got::add_global_pair_with_rel): New function.
3263 (Output_data_got::add_global_pair_with_rela): New function.
3264 (Output_data_got::add_local): Added got_type parameter.
3265 (Output_data_got::add_local_with_rel): Likewise.
3266 (Output_data_got::add_local_with_rela): Likewise.
3267 (Output_data_got::add_local_pair_with_rel): New function.
3268 (Output_data_got::add_local_pair_with_rela): New function.
3269 (Output_data_got::add_global_tls): Removed.
3270 (Output_data_got::add_global_tls_with_rel): Removed.
3271 (Output_data_got::add_global_tls_with_rela): Removed.
3272 (Output_data_got::add_local_tls): Removed.
3273 (Output_data_got::add_local_tls_with_rel): Removed.
3274 (Output_data_got::add_local_tls_with_rela): Removed.
3275 * resolve.cc (Symbol::override_base_with_special): Removed
3276 reference to has_got_offset_ field.
3277 * symtab.cc (Symbol::init_fields): Replaced initialization
3278 of got_offset_ with got_offsets_. Removed initialization
3279 of has_got_offset_
53fcba31 3280 * symtab.h (Symbol::has_got_offset): Aded got_type parameter.
0a65a3a7
CC
3281 (Symbol::got_offset): Likewise.
3282 (Symbol::set_got_offset): Likewise.
3283 (Symbol::has_tls_got_offset): Removed.
3284 (Symbol::tls_got_offset): Removed.
3285 (Symbol::set_tls_got_offset): Removed.
3286 (Symbol::got_offset_): Removed.
3287 (Symbol::tls_mod_got_offset_): Removed.
3288 (Symbol::tls_pair_got_offset_): Removed.
3289 (Symbol::got_offsets_): New field.
3290 (Symbol::has_got_offset): Removed.
3291 (Symbol::has_tls_mod_got_offset): Removed.
3292 (Symbol::has_tls_pair_got_offset): Removed.
3293 * x86_64.cc (Target_x86_64::Got_type): New enum declaration.
3294 (Target_x86_64::Scan::local): Updated callers of Output_data_got
3295 member functions.
3296 (Target_x86_64::Scan::global): Likewise.
3297 (Target_x86_64::Relocate::relocate): Likewise.
3298 (Target_x86_64::Relocate::relocate_tls): Likewise.
3299
bd52eafb
BE
33002008-03-25 Ben Elliston <bje@au.ibm.com>
3301
3302 * yyscript.y: Fix spelling error in comment.
3303
8b105e34
ILT
33042008-03-24 Ian Lance Taylor <iant@google.com>
3305
8ed814a9
ILT
3306 * options.h (class General_options): Define build_id option.
3307 * layout.h (class Layout): Declare write_build_id, create_note,
3308 create_build_id. Add build_id_note_ member.
3309 * layout.cc: Include <cerrno>, <fcntl.h>, <unistd.h>,
3310 "libiberty.h", "md5.h", "sha1.h".
3311 (Layout::Layout): Initialize eh_frame_data_,
3312 eh_frame_hdr_section_, and build_id_note_.
3313 (Layout::finalize): Call create_build_id.
3314 (Layout::create_note): New function, broken out of
3315 Layout::create_gold_note.
3316 (Layout::create_gold_note): Call create_note.
3317 (Layout::create_build_id): New function.
3318 (Layout::write_build_id): New function.
3319 (Close_task_runner::run): Call write_build_id.
3320
8b105e34
ILT
3321 * x86_64.cc: Correct license to GPLv3.
3322
086a1841
ILT
33232008-03-23 Ian Lance Taylor <iant@google.com>
3324
3325 * options.cc: Include "demangle.h".
3326 (parse_optional_string): New function.
3327 (parse_long_option): Handle takes_optional_argument.
3328 (parse_short_option): Update dash_z initializer. Handle
3329 takes_optional_argument.
3330 (General_options::General_options): Initialize do_demangle_.
3331 (General_options::finalize): Set do_demangle_. Handle demangling
3332 style.
3333 * options.h (parse_optional_string): Declare.
3334 (struct One_option): Add optional_arg field. Update constructor.
3335 Update call constructor calls. Add takes_optional_argument
3336 function.
3337 (DEFINE_var): Add optional_arg__ parameter. Change all callers.
3338 (DEFINE_optional_string): Define.
3339 (General_options::demangle): Change from DEFINE_bool to
3340 DEFINE_optional_string.
3341 (General_options::no_demangle): New function.
3342 (General_options::do_demangle): New function.
3343 (General_options::set_do_demangle): New function.
3344 (General_options::execstack_status_): Move definition to end of
3345 class definition.
3346 (General_options::static_): Likewise.
3347 (General_options::do_demangle_): New field.
3348 * object.cc (big_endian>::get_symbol_location_info): Call
3349 Options::do_demangle, not Options::demangle.
3350 * symtab.cc (demangle): Likewise.
3351
cbb93e63
ILT
33522008-03-22 Ian Lance Taylor <iant@google.com>
3353
3354 * gold.h: Include <cstddef> and <sys/types.h>
3355 * options.h: Include <cstring>.
3356
ec531623
ILT
33572008-03-21 Ian Lance Taylor <iant@google.com>
3358
3359 * Added source code to GNU binutils.
This page took 0.214617 seconds and 4 git commands to generate.