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

	PR binutils/2258
	* elf.c (copy_private_bfd_data): Renamed to ...
	(rewrite_elf_program_header): This.
	(copy_elf_program_header): New function.
	(copy_private_bfd_data): Likewise.

binutils/

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

	PR binutils/2258
	* readelf.c (process_program_headers): Use
	ELF_IS_SECTION_IN_SEGMENT_MEMORY.

include/elf/

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

	PR binutils/2258
	* internal.h (ELF_IS_SECTION_IN_SEGMENT_FILE): New.
	(ELF_IS_SECTION_IN_SEGMENT_MEMORY): Likewise.
This commit is contained in:
H.J. Lu
2006-02-10 15:04:19 +00:00
parent 70e45ad9bb
commit 84d1d6507c
6 changed files with 229 additions and 28 deletions

View File

@@ -3447,24 +3447,7 @@ process_program_headers (FILE *file)
for (j = 1; j < elf_header.e_shnum; j++, section++)
{
if (section->sh_size > 0
/* PT_TLS segment contains only SHF_TLS sections. */
&& (segment->p_type != PT_TLS
|| (section->sh_flags & SHF_TLS) != 0)
/* Compare allocated sections by VMA, unallocated
sections by file offset. */
&& (section->sh_flags & SHF_ALLOC
? (section->sh_addr >= segment->p_vaddr
&& section->sh_addr + section->sh_size
<= segment->p_vaddr + segment->p_memsz)
: ((bfd_vma) section->sh_offset >= segment->p_offset
&& (section->sh_offset + section->sh_size
<= segment->p_offset + segment->p_filesz)))
/* .tbss is special. It doesn't contribute memory space
to normal segments. */
&& (!((section->sh_flags & SHF_TLS) != 0
&& section->sh_type == SHT_NOBITS)
|| segment->p_type == PT_TLS))
if (ELF_IS_SECTION_IN_SEGMENT_MEMORY(section, segment))
printf ("%s ", SECTION_NAME (section));
}