Commit Graph

399 Commits

Author SHA1 Message Date
Alan Modra a5d1b3b53e * elf-bfd.h (struct sym_sec_cache): Delete "sec". Add "shndx".
* elf.c (bfd_section_from_r_symndx): Don't cache bfd section of
	symbol.  Instead cache ELF section index.  Remove redundant
	checks of st_shndx.
2007-07-18 11:23:37 +00:00
Roland McGrath bfb53a4f5b 2007-07-13 Roland McGrath <roland@redhat.com>
* elf-bfd.h (struct elf_obj_tdata): Revert last change.
	Add after_write_object_contents, after_write_object_contents_info.
	* elf.c (_bfd_elf_write_object_contents): Revert last change.
	Instead, call after_write_object_contents if set.
2007-07-13 10:44:12 +00:00
Roland McGrath ff59fc360e 2007-07-09 Roland McGrath <roland@redhat.com>
* elf-bfd.h (struct elf_obj_tdata): Add members
	emit_note_gnu_build_id and note_gnu_build_id_sec.
	* elf.c (_bfd_id_note_section_size): New global function.
	(read_hex, _bfd_elf_write_build_id_section): New static functions.
	(_bfd_elf_write_object_contents): Call _bfd_elf_write_build_id_section
	if emit_note_gnu_build_id is set.
	* Makefile.am (elf.lo): Update dependencies.
2007-07-09 21:23:43 +00:00
Nick Clifton cd123cb70c Switch sources over to use the GPL version 3 2007-07-03 14:26:43 +00:00
Alan Modra 08a40648e5 PR 4712
* elf.c (assign_file_positions_for_load_sections): Adjust lma
	by p_vaddr_offset.
2007-07-02 06:47:43 +00:00
Joseph Myers 104d59d19c bfd:
* elf-attrs.c: New.
	* Makefile.am (BFD32_BACKENDS): Add elf-attrs.lo.
	(BFD32_BACKENDS_CFILES): Add elf-attrs.c.
	(elf-attrs.lo): Generate dependencies.
	* Makefile.in: Regenerate.
	* configure.in (elf): Add elf-attrs.lo.
	* configure: Regenerate.
	* elf-bfd.h (struct elf_backend_data): Add entries for object
	attributes.
	(NUM_KNOWN_OBJ_ATTRIBUTES, obj_attribute, obj_attribute_list,
	OBJ_ATTR_PROC, OBJ_ATTR_GNU, OBJ_ATTR_FIRST, OBJ_ATTR_LAST,
	Tag_NULL, Tag_File, Tag_Section, Tag_Symbol, Tag_compatibility):
	New.
	(struct elf_obj_tdata): Add entries for object attributes.
	(elf_known_obj_attributes, elf_other_obj_attributes,
	elf_known_obj_attributes_proc, elf_other_obj_attributes_proc):
	New.
	(bfd_elf_obj_attr_size, bfd_elf_set_obj_attr_contents,
	bfd_elf_get_obj_attr_int, bfd_elf_add_obj_attr_int,
	bfd_elf_add_proc_attr_int, bfd_elf_add_obj_attr_string,
	bfd_elf_add_proc_attr_string, bfd_elf_add_obj_attr_compat,
	bfd_elf_add_proc_attr_compat, _bfd_elf_attr_strdup,
	_bfd_elf_copy_obj_attributes, _bfd_elf_obj_attrs_arg_type,
	_bfd_elf_parse_attributes, _bfd_elf_merge_object_attributes): New.
	* elf.c (_bfd_elf_copy_private_bfd_data): Copy object attributes.
	(bfd_section_from_shdr): Handle attributes sections.
	* elflink.c (bfd_elf_final_link): Handle attributes sections.
	* elfxx-target.h (elf_backend_obj_attrs_vendor,
	elf_backend_obj_attrs_section, elf_backend_obj_attrs_arg_type,
	elf_backend_obj_attrs_section_type): New.
	(elfNN_bed): Update.
	* elf32-arm.c (NUM_KNOWN_ATTRIBUTES, aeabi_attribute,
	aeabi_attribute_list): Remove.
	(struct elf32_arm_obj_tdata): Remove object attributes fields.
	(check_use_blx, bfd_elf32_arm_set_vfp11_fix, using_thumb2,
	elf32_arm_copy_private_bfd_data, elf32_arm_merge_eabi_attributes):
	Update for new object attributes interfaces.
	(uleb128_size, is_default_attr, eabi_attr_size,
	elf32_arm_eabi_attr_size, write_uleb128, write_eabi_attribute,
	elf32_arm_set_eabi_attr_contents, elf32_arm_bfd_final_link,
	elf32_arm_new_eabi_attr, elf32_arm_get_eabi_attr_int,
	elf32_arm_add_eabi_attr_int, attr_strdup,
	elf32_arm_add_eabi_attr_string, elf32_arm_add_eabi_attr_compat,
	copy_eabi_attributes, elf32_arm_parse_attributes): Remove.  Moved
	to generic code in elf-attrs.c.
	(elf32_arm_obj_attrs_arg_type): New.
	(elf32_arm_fake_sections): Do not handle .ARM.attributes.
	(elf32_arm_section_from_shdr): Do not handle SHT_ARM_ATTRIBUTES.
	(bfd_elf32_bfd_final_link): Remove.
	(elf_backend_obj_attrs_vendor, elf_backend_obj_attrs_section,
	elf_backend_obj_attrs_arg_type,
	elf_backend_obj_attrs_section_type): New.
	* elf32-bfin.c (bfin_elf_copy_private_bfd_data): Copy object
	attributes.
	* elf32-frv.c (frv_elf_copy_private_bfd_data): Likewise.
	* elf32-iq2000.c (iq2000_elf_copy_private_bfd_data): Likewise.
	* elf32-mep.c (mep_elf_copy_private_bfd_data): Likewise.
	* elf32-mt.c (mt_elf_copy_private_bfd_data): Likewise.
	* elf32-sh.c (sh_elf_copy_private_data): Likewise.
	* elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise.

binutils:
	* readelf.c (display_gnu_attribute): New.
	(process_arm_specific): Rearrange as process_attributes.
	(process_arm_specific): Replace by wrapper of process_attributes.

gas:
	* as.c (create_obj_attrs_section): New.
	(main): Call create_obj_attrs_section for ELF.
	* read.c (s_gnu_attribute, skip_whitespace, skip_past_char,
	skip_past_comma, s_vendor_attribute): New.
	(potable): Add gnu_attribute for ELF.
	* read.h (s_vendor_attribute): Declare.
	* config/tc-arm.c (s_arm_eabi_attribute): Replace by wrapper
	round s_vendor_attribute.
	(aeabi_set_public_attributes): Update for new attributes
	interfaces.
	(arm_md_end): Remove attributes contents setting now done
	generically.

include/elf:
	* arm.h (elf32_arm_add_eabi_attr_int,
	elf32_arm_add_eabi_attr_string, elf32_arm_add_eabi_attr_compat,
	elf32_arm_get_eabi_attr_int, elf32_arm_set_eabi_attr_contents,
	elf32_arm_eabi_attr_size, Tag_NULL, Tag_File, Tag_Section,
	Tag_Symbol, Tag_compatibility): Remove.
	* common.h (SHT_GNU_ATTRIBUTES): Define.

ld:
	* emulparams/armelf.sh (OTHER_SECTIONS): Remove .ARM.attributes.
	(ATTRS_SECTIONS): Define.
	* scripttempl/elf.sc, scripttempl/elf32sh-symbian.sc,
	scripttempl/elf_chaos.sc, scripttempl/elfi370.sc,
	scripttempl/elfxtensa.sc: Handle ATTRS_SECTIONS.
2007-06-29 16:29:17 +00:00
Alan Modra 6a3cd2b4ed * elf.c (assign_file_positions_for_load_sections): Use elf
section header sh_size rather than bfd section size, simplifying
	.tbss handling.
2007-06-29 01:21:08 +00:00
Alan Modra bf988460f1 * elf.c (assign_file_positions_for_load_sections): Ensure bss
segments meet gABI alignment requirements.  Don't allocate
	file space for bss sections in a segment also containing file
	or program headers.
2007-06-29 01:12:52 +00:00
Alan Modra 42bb2e3317 bfd/
* elf.c (elf_fake_sections): Adjust test for SHT_NOBITS sections
	created by objcopy --only-keep-debug.
	(_bfd_elf_init_private_section_data): Only change elf_section_type
	if it is SHT_NULL.
binutils/
	* objcopy.c (copy_object): Revert 2007-05-11 change.  Don't
	avoid calling bfd_copy_private_bfd_data for ELF STRIP_NONDEBUG.
	(setup_section): Don't modify flags, and don't avoid calling
	bfd_copy_private_section_data for ELF STRIP_NONDEBUG.
	* readelf.c (process_program_headers): Ignore .dynamic of type
	SHT_NOBITS.
2007-05-30 14:29:27 +00:00
Alan Modra 02bf8d82b5 * elf.c (assign_file_positions_for_load_sections): Correct sh_type
to SHT_NOBITS earlier.  Base actions in rest of function on sh_type
	and sh_flags instead of bfd section flags.  Delete voff and code
	keeping nobits segments aligned.
2007-05-30 13:38:50 +00:00
Alan Modra 0414f35b82 PR 4479
* elf.c (elf_fake_sections): Don't allow backend to change
	SHT_NOBITS if called for strip/objcopy --only-keep-debug.
	* elfxx-mips.c (_bfd_mips_elf_fake_sections): Remove similar
	fix from here.
2007-05-15 08:39:58 +00:00
Alan Modra 74f2e02bf4 * elf.c (bfd_elf_string_from_elf_section): Return NULL on
invalid shstrndx.
	(bfd_elf_get_str_section): Likewise.
2007-05-14 04:15:53 +00:00
Richard Sandiford 8c252fd9c3 bfd/
* elf.c (assign_file_positions_for_load_sections): Use p_memsz
	rather than p_filesz to calculate the LMA of the end of a segment.

ld/testsuite/
	* ld-elf/multibss1.d, ld-elf/multibss1.s: New test.
2007-05-10 14:46:48 +00:00
Alan Modra 7c9283002d * elf.c (assign_file_positions_for_load_sections): Don't check
core segment.
2007-05-07 01:05:46 +00:00
Alan Modra 627b32bcf9 include/elf/
* internal.h (ELF_IS_SECTION_IN_SEGMENT): Check both file offset
	and vma for appropriate sections.
bfd/
	* elf.c (assign_file_positions_for_load_sections): Set sh_offset
	here.  Set sh_type to SHT_NOBITS if we won't be allocating
	file space.  Don't bump p_memsz for non-alloc sections.  Adjust
	section-in-segment check.
	(assign_file_positions_for_non_load_sections): Don't set sh_offset
	here for sections that have already been handled above.
2007-05-02 13:44:37 +00:00
Alan Modra 3db64b0092 bfd/
Many files: Include sysdep.h before bfd.h.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
binutils/
	* bucumm.h: Split off host dependencies to..
	* sysdep.h: ..here.
	Many files: Include sysdep.h.  Remove duplicate headers and reorder.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
ld/
	Many files: Include sysdep.h first.  Remove duplicate headers.
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
opcodes/
	* Makefile.am: Run "make dep-am".
	* Makefile.in: Regenerate.
	* ns32k-dis.c: Include sysdep.h first.
2007-04-26 14:47:00 +00:00
Paul Brook fcb93ecfc2 2007-04-17 Paul Brook <paul@codesourcery.com>
bfd/
	* elf.c (_bfd_elf_is_function_type): New function.
	* elflink.c (_bfd_elf_merge_symbol): Use bed->is_function_type.
	(_bfd_elf_dynamic_symbol_p, _bfd_elf_symbol_refs_local_p,
	is_global_data_symbol_definition, elf_link_add_object_symbols): Ditto.
	* elf-bfd.h (elf_backend_data): Add is_function_type.
	(_bfd_elf_is_function_type): Add prototype.
	* elfxx-target.h (elf_backend_is_function_type): Add default
	definition.
	(elfNN_bed): Add elf_backend_is_function_type.
	* elf32-arm.c (elf32_arm_is_function_type): New function.
	(elf_backend_is_function_type): Define.

	ld/testsuite/
	* ld-arm/preempt-app.s: New test.
	* ld-arm/preempt-app.sym: New.
	* ld-arm/arm-elf.exp: Add preempt-app.
2007-04-17 20:09:52 +00:00
Nick Clifton 1783205a77 PR binutils/4110
* elf.c (IS_VALID_GROUP_SECTION_HEADER): New macro.
  (setup_group): Use it.  Report corrupt group section headers.
  (bfd_section_from_shdr): Use new macro.  Replace constant 4 with
      GRP_ENTRY_SIZE.  Cope with NULLs in the group section table.
  (elf_fake_section): Replace constant 4 with GRP_ENTRY_SIZE.
2007-03-29 14:37:02 +00:00
H.J. Lu 0920dee7ba bfd/
2007-03-22  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4007
	* elf.c (assign_file_positions_for_load_sections): Check if
	all sections are in the segment.

ld/testsuite/

2007-03-22  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/4007
	* ld-elf/note-1.d: New file.
	* ld-elf/note-1.s: Likewise.
	* ld-elf/note-1.t: Likewise.
	* ld-i386/alloc.d: Likewise.
	* ld-i386/alloc.s: Likewise.
	* ld-i386/alloc.t: Likewise.

	* ld-i386/i386.exp: Run "alloc".
2007-03-22 15:50:38 +00:00
Nick Clifton 5f6999aa00 PR binutils/3535
* elf.c (copy_private_bfd_data): Widen the scope of Solaris specific
  conditions that need the program headers to be rewritten.
2007-03-20 12:18:18 +00:00
H.J. Lu d1036acbe7 2007-03-13 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/3826
	* elf-bfd.h (elf_backend_data): Add elf_osabi.
	(_bfd_elf_set_osabi): New.

	* elf.c (_bfd_elf_set_osabi): New.

	* elf32-hppa.c (elf32_hppa_post_process_headers): Removed.
	(elf_backend_post_process_headers): Defined with
	_bfd_elf_set_osabi.
	(ELF_OSABI): Properly defined for each target.

	* elf32-i370.c (i370_elf_post_process_headers): Removed.
	(ELF_OSABI): Defined.
	(elf_backend_post_process_headers): Defined with
	_bfd_elf_set_osabi.

	* elf32-i386.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for
	freebsd.
	(elf_i386_post_process_headers): Set EI_OSABI with elf_osabi.

	* elf32-msp430.c (elf32_msp430_post_process_headers): Removed.
	(ELF_OSABI): Defined.
	(elf_backend_post_process_headers): Defined with
	_bfd_elf_set_osabi.

	* elf64-alpha.c (ELF_OSABI): Defined to ELFOSABI_FREEBSD for
	freebsd.
	(elf64_alpha_fbsd_post_process_headers): Set EI_OSABI with
	elf_osabi.

	* elf64-hppa.c (elf64_hppa_post_process_headers): Set EI_OSABI
	with elf_osabi.
	(ELF_OSABI): Properly defined for each target.
	(elf_backend_post_process_headers): Defined with
	_bfd_elf_set_osabi for Linux.

	* elf64-sparc.c (elf64_sparc_fbsd_post_process_headers): Removed.
	(ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd.
	(elf_backend_post_process_headers): Defined with
	_bfd_elf_set_osabi.

	* elf64-x86-64.c (elf64_x86_64_fbsd_post_process_headers): Removed.
	(ELF_OSABI): Defined to ELFOSABI_FREEBSD for freebsd.
	(elf_backend_post_process_headers): Defined with
	_bfd_elf_set_osabi.

	* elfcode.h (elf_object_p): Match the ELFOSABI_NONE ELF target
	with any ELF target of the compatible machine for which we do not
	have a specific backend.

	* elfxx-ia64.c (elfNN_hpux_post_process_headers): Set EI_OSABI
	with elf_osabi.

	* elfxx-target.h (ELF_OSABI): Default to ELFOSABI_NONE.
	(elfNN_bed): Initialize elf_osabi with ELF_OSABI.
2007-03-14 02:56:45 +00:00
Alan Modra 0e922b770e PR 4144
* elf.c (assign_file_positions_for_load_sections): Don't
	adjust p_memsz for !SEC_LOAD section vma modulo page size.
	Instead, use the same lma based adjustment for SEC_LOAD
	sections.
2007-03-07 02:14:40 +00:00
Nick Clifton cb3ff1e5f7 PR binutils/3535
* elf.c (copy_private_bfd_data): Always rewrite the program headers when a
  Solaris interpreter segment is involved.
2007-02-23 11:47:47 +00:00
Nick Clifton 2889e75bfb Take into account MEMORY regions when creating a segment map. 2007-02-21 16:43:50 +00:00
Dave Brolley d93525185c Support for Toshiba MeP and for complex relocations. 2007-02-05 19:50:12 +00:00
Jakub Jelinek c15f73f931 * elf-bfd.h (struct elf_obj_tdata): Change symbuf type to void *.
* elf.c (struct elf_symbuf_symbol, struct elf_symbuf_head): New types.
	(struct elf_symbol): Change first member into union.
	(elf_sort_elf_symbol): Compare pointers to internal syms rather than
	internal syms.  Only compare st_shndx fields.
	(elf_create_symbuf): New function.
	(bfd_elf_match_symbols_in_sections): Use it.  If symbufs are available
	for bfds, use a binary search, otherwise don't qsort symbols
	unnecessarily only to select which symbols are for the particular
	shndx.
2007-02-02 21:10:50 +00:00
Nick Clifton effdf42a7b PR ld/3852
* elf.c (_bfd_elf_link_hash_table_init): Initialize all the fields in the
elf_link_hash_table structure.
2007-02-01 09:03:25 +00:00
Alan Modra 183e98bed2 * elf-bfd.h (struct elf_backend_data): Add elf_backend_write_core_note.
* elfxx-target.h (elf_backend_write_core_note): Define and use.
	* elf.c (elfcore_write_prpsinfo): Call the above.  Add support for
	32-bit core note on 64-bit target.
	(elfcore_write_prstatus): Likewise.
	(elfcore_write_lwpstatus): Make note_name const.
	(elfcore_write_prfpreg): Likewise.
	(elfcore_write_pstatus): Add support for 32-bit core note on 64-bit
	target.
	* elf32-ppc.c (ppc_elf_write_core_note): New function.
	(elf_backend_write_core_note): Define.
	* elf64-ppc.c (ppc64_elf_write_core_note): New function.
	(elf_backend_write_core_note): Define.
2007-02-01 05:35:58 +00:00
H.J. Lu 53020534c8 2007-01-30 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (copy_elf_program_header): Start from the first section
	in a segment and stop when all sections in a segment are
	accounted for.
2007-01-30 15:47:19 +00:00
Nathan Sidwell 59e0647f0d bfd/
* elf.c (assign_file_positions_for_load_sections): We can
	require fewer phdrs than expected.
ld/
	* emultempl/elf-generic.em (gdl_map_segments): Only allow header
	shrinkage for the first few iterations.
ld/testsuite/
	* ld-elf/header.d: New.
	* ld-elf/header.t: New.
	* ld-elf/header.s: New.
2007-01-11 12:23:53 +00:00
Nathan Sidwell 3271a81418 bfd/
* elf.c (assign_file_positions_for_load_sections): Adjust p_vaddr
	by p_vaddr_offset.  Copy alignment & use if it is valid.
	(rewrite_elf_program_headers): Cope with leading padding in a
	segment that does not contain file or program headers.
	(copy_elf_program_header): Likewise.

	include/elf/
	* internal.h (struct elf_segment_map): Add p_vaddr_offset field.
2006-12-19 08:49:38 +00:00
H.J. Lu 945c025aaf 2006-12-01 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/3609
	* elf.c (rewrite_elf_program_header): Preserve segment physical
	address in the output segment if the first section in the
	corresponding input segment is null.
2006-12-01 15:55:29 +00:00
Nick Clifton 55d55ac712 PR 3609
* elf.c (rewrite_elf_program_header): Do not use the first_section pointer if it is null.
2006-12-01 12:28:18 +00:00
H.J. Lu 9f17e2a6cd 2006-11-24 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (IS_SECTION_IN_INPUT_SEGMENT): New.
	(INCLUDE_SECTION_IN_SEGMENT): Use IS_SECTION_IN_INPUT_SEGMENT.
	(rewrite_elf_program_header): Don't preserve segment physical
	address in the output segment if the first section in the
	corresponding input segment is removed.
2006-11-25 00:38:14 +00:00
Alan Modra a39f33461a * elf.c (elfcore_write_note): Pad note descriptor to 4-byte
boundary.  Tidy.  Comment.
2006-10-31 02:36:18 +00:00
H.J. Lu c0f0068602 bfd/
2006-10-30  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3111
	* elf-bfd.h (elf_obj_tdata): Add symbuf.
	(_bfd_elf_section_already_linked): Add struct bfd_link_info *.
	(_bfd_elf_check_kept_section): Likewise.
	(bfd_elf_match_symbols_in_sections): Likewise.

	* elf.c (assign_section_numbers): Updated to add
	struct bfd_link_info *.
	(bfd_elf_match_symbols_in_sections): Updated. Cache symbol
	buffer if info->reduce_memory_overheads is false.

	* elflink.c (match_group_member): Updated to add
	struct bfd_link_info *.
	(_bfd_elf_check_kept_section): Likewise.
	(elf_link_input_bfd): Likewise.
	(_bfd_elf_section_already_linked): Likewise.
	(bfd_elf_final_link): Free symbol buffer if
	info->reduce_memory_overheads is false.

	* libbfd-in.h (_bfd_nolink_section_already_linked): Add
	struct bfd_link_info *.
	(_bfd_generic_section_already_linked): Likewise.
	* libbfd.h: Regenerated.

	* linker.c (bfd_section_already_linked): Add
	struct bfd_link_info *.
	(_bfd_generic_section_already_linked): Likewise.
	* targets.c (bfd_target): Add struct bfd_link_info * to
	_section_already_linked.
	* bfd-in2.h: Regenerated.

include/

2006-10-30  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3111
	* bfdlink.h (bfd_link_info): Add reduce_memory_overheads.

ld/

2006-10-30  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3111
	* ld.h (args_type): Remove reduce_memory_overheads.

	* ldlang.c (lang_map): Updated.
	(section_already_linked): Likewise.
	(print_input_section): Likewise.
	* ldmain.c (main): Likewise.
	* lexsup.c (parse_args): Likewise.
2006-10-30 23:25:51 +00:00
Alan Modra 017657f056 * elf.c (elfcore_write_note): Pad to 4-byte boundary. 2006-10-29 23:49:37 +00:00
H.J. Lu d270463e93 2006-10-26 H.J. Lu <hongjiu.lu@intel.com>
* elf.c (_bfd_elf_init_private_section_data): Assert output
	section ELF type instead of check if it is SHT_NULL.  Copy
	OS/PROC specific flags from input section to output section.
2006-10-27 04:15:50 +00:00
Ben Elliston 761c7f08ff * elf.c (bfd_section_from_shdr): Remove extraneous breaks.
* targets.c (find_target): Remove extraneous break.
2006-10-26 00:14:39 +00:00
Ben Elliston 23fe95776c * elf.c (bfd_elf_set_dyn_lib_class): Change second argument type
from int to enum dynamic_lib_link_class lib_class.
	* bfd-in.h (bfd_elf_set_dyn_lib_class): Likewise.
	* bfd-in2.h: Regenerate.
2006-10-26 00:01:31 +00:00
H.J. Lu 3ba7113878 2006-10-15 H.J. Lu <hongjiu.lu@intel.com>
PR ld/3314
	* elf.c (assign_file_positions_for_non_load_sections): Don't
	page align empty SHF_ALLOC sections.
2006-10-15 14:22:13 +00:00
H.J. Lu 49c13adb16 bfd/
2006-09-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3223
	PR ld/3267
	* elf.c (assign_file_positions_for_non_load_sections): Don't
	warn zero size allocated sections.

ld/

2006-09-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3223
	PR ld/3267
	* ld.texinfo: Updated Output Section Discarding.

	* ldlang.h (lang_output_section_statement_type): Add
	section_relative_symbol.
	* ldlang.c (strip_excluded_output_sections): Don't strip a
	section with a symbol relative to it.
	(lang_size_sections_1): Mark if an output section has a symbol
	symbol relative to it.

ld/testsuite/

2006-09-26  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3223
	PR ld/3267
	* ld-scripts/empty-address-1.d: New file.
	* ld-scripts/empty-address-1.s: Likewise.
	* ld-scripts/empty-address-1.t: Likewise.
	* ld-scripts/empty-address-2.s: Likewise.
	* ld-scripts/empty-address-2a.d: Likewise.
	* ld-scripts/empty-address-2a.t: Likewise.
	* ld-scripts/empty-address-2b.d: Likewise.
	* ld-scripts/empty-address-2b.t: Likewise.
	* ld-scripts/empty-address-3.s: Likewise.
	* ld-scripts/empty-address-3a.d: Likewise.
	* ld-scripts/empty-address-3a.t: Likewise.
	* ld-scripts/empty-address-3b.d: Likewise.
	* ld-scripts/empty-address-3b.t: Likewise.
	* ld-scripts/empty-address-3c.d: Likewise.
	* ld-scripts/empty-address-3c.t: Likewise.
	* ld-scripts/empty-address.exp: Likewise.
2006-09-27 04:18:16 +00:00
H.J. Lu 41f8ce693c 2006-09-26 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/3262
	* elf.c (rewrite_elf_program_header): Use bfd_zalloc instead of
	bfd_alloc to allocate segment map.
	(copy_elf_program_header): Likewise.
2006-09-26 19:11:03 +00:00
Alan Modra 8384fb8f0c * elfcode.h (elf_swap_symbol_in): Return bfd_boolean. Don't abort
on error.
	* elf-bfd.h (elf_size_info <swap_symbol_in>): Adjust decl.
	(bfd_elf32_swap_symbol_in, bfd_elf64_swap_symbol_in): Likewise.
	* elf.c (bfd_elf_get_elf_syms): Test return of swap_symbol_in,
	and report error.
	* elf32-arm.c (elf32_arm_swap_symbol_in): Return bfd_boolean.
2006-09-22 13:16:45 +00:00
Hans-Peter Nilsson 60ff4dc4b5 * elf.c (special_sections_s): Revert last STRING_COMMA_LEN change
for .stabstr entry, explain why.
2006-09-17 18:57:43 +00:00
Nick Clifton 0112cd268b * bfd-in.h (STRING_AND_COMMA): New macro. Takes one constant string as its
argument and emits the string followed by a comma and then the length of
  the string.
  (CONST_STRNEQ): New macro.  Checks to see if a variable string has a constant
  string as its initial characters.
  (CONST_STRNCPY): New macro.  Copies a constant string to the start of a
  variable string.
* bfd-in2.h: Regenerate.
* <remainign files>: Make use of the new macros.
2006-09-16 18:12:17 +00:00
Alan Modra 30288845d6 PR 3182
* elf.c (_bfd_elf_copy_private_header_data): Fix group members
	that have had their SHT_GROUP section removed.
	* objcopy.c (group_signature): New function, split out from..
	(setup_section): ..here.
	(is_strip_section): Return true for SHT_GROUP sections that are
	going to lose their group signature symbol.
2006-09-14 12:11:33 +00:00
H.J. Lu 168dd6670b 2006-09-10 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/3186
	* elf.c (_bfd_elf_make_section_from_shdr): Correct length of
	"gnu.linkonce.wi.".
2006-09-10 23:51:09 +00:00
H.J. Lu c9df6640d5 bfd/
2006-08-16  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3015
	* elf.c (get_program_header_size): Add a PT_GNU_RELRO segment
	only if there is a PT_DYNAMIC segment.
	(_bfd_elf_map_sections_to_segments): Likewise.
	(assign_file_positions_for_load_sections): Set PT_GNU_RELRO
	segment alignment to 1.

ld/testsuite/

2006-08-16  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/3015
	* ld-elf/binutils.exp: Add tests for "-z relro".
2006-08-17 02:04:53 +00:00
Alan Modra 252e386ec7 * elf.c (elf_modify_segment_map): Delete empty PT_LOAD segments.
* elf32-xtensa.c (elf_xtensa_modify_segment_map): Delete.
	(define elf_backend_modify_segment_map): Don't define.
2006-07-26 12:32:27 +00:00