Line 4682... |
Line 4682... |
continue;
|
continue;
|
}
|
}
|
}
|
}
|
else
|
else
|
{
|
{
|
if (p->p_type == PT_LOAD
|
if (p->p_type == PT_LOAD)
|
|| (this_hdr->sh_type == SHT_NOBITS
|
|
&& (this_hdr->sh_flags & SHF_TLS) != 0
|
|
&& this_hdr->sh_offset == 0))
|
|
{
|
{
|
if (this_hdr->sh_type == SHT_NOBITS)
|
this_hdr->sh_offset = sec->filepos = off;
|
|
if (this_hdr->sh_type != SHT_NOBITS)
|
|
off += this_hdr->sh_size;
|
|
}
|
|
else if (this_hdr->sh_type == SHT_NOBITS
|
|
&& (this_hdr->sh_flags & SHF_TLS) != 0
|
|
&& this_hdr->sh_offset == 0)
|
{
|
{
|
/* These sections don't really need sh_offset,
|
/* This is a .tbss section that didn't get a PT_LOAD.
|
but give them one anyway. */
|
(See _bfd_elf_map_sections_to_segments "Create a
|
|
final PT_LOAD".) Set sh_offset to the value it
|
|
would have if we had created a zero p_filesz and
|
|
p_memsz PT_LOAD header for the section. This
|
|
also makes the PT_TLS header have the same
|
|
p_offset value. */
|
bfd_vma adjust = vma_page_aligned_bias (this_hdr->sh_addr,
|
bfd_vma adjust = vma_page_aligned_bias (this_hdr->sh_addr,
|
off, align);
|
off, align);
|
this_hdr->sh_offset = sec->filepos = off + adjust;
|
this_hdr->sh_offset = sec->filepos = off + adjust;
|
}
|
}
|
else
|
|
{
|
|
this_hdr->sh_offset = sec->filepos = off;
|
|
off += this_hdr->sh_size;
|
|
}
|
|
}
|
|
|
|
if (this_hdr->sh_type != SHT_NOBITS)
|
if (this_hdr->sh_type != SHT_NOBITS)
|
{
|
{
|
p->p_filesz += this_hdr->sh_size;
|
p->p_filesz += this_hdr->sh_size;
|
/* A load section without SHF_ALLOC is something like
|
/* A load section without SHF_ALLOC is something like
|
Line 7389... |
Line 7391... |
make a better choice of file name for local symbols by ignoring
|
make a better choice of file name for local symbols by ignoring
|
file symbols appearing after a given local symbol. */
|
file symbols appearing after a given local symbol. */
|
enum { nothing_seen, symbol_seen, file_after_symbol_seen } state;
|
enum { nothing_seen, symbol_seen, file_after_symbol_seen } state;
|
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
|
|
|
if (symbols == NULL)
|
|
return FALSE;
|
|
|
filename = NULL;
|
filename = NULL;
|
func = NULL;
|
func = NULL;
|
file = NULL;
|
file = NULL;
|
low_func = 0;
|
low_func = 0;
|
state = nothing_seen;
|
state = nothing_seen;
|
Line 7974... |
Line 7979... |
elfcore_grok_s390_prefix (bfd *abfd, Elf_Internal_Note *note)
|
elfcore_grok_s390_prefix (bfd *abfd, Elf_Internal_Note *note)
|
{
|
{
|
return elfcore_make_note_pseudosection (abfd, ".reg-s390-prefix", note);
|
return elfcore_make_note_pseudosection (abfd, ".reg-s390-prefix", note);
|
}
|
}
|
|
|
|
static bfd_boolean
|
|
elfcore_grok_arm_vfp (bfd *abfd, Elf_Internal_Note *note)
|
|
{
|
|
return elfcore_make_note_pseudosection (abfd, ".reg-arm-vfp", note);
|
|
}
|
|
|
#if defined (HAVE_PRPSINFO_T)
|
#if defined (HAVE_PRPSINFO_T)
|
typedef prpsinfo_t elfcore_psinfo_t;
|
typedef prpsinfo_t elfcore_psinfo_t;
|
#if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */
|
#if defined (HAVE_PRPSINFO32_T) /* Sparc64 cross Sparc32 */
|
typedef prpsinfo32_t elfcore_psinfo32_t;
|
typedef prpsinfo32_t elfcore_psinfo32_t;
|
#endif
|
#endif
|
Line 8393... |
Line 8404... |
&& strcmp (note->namedata, "LINUX") == 0)
|
&& strcmp (note->namedata, "LINUX") == 0)
|
return elfcore_grok_s390_prefix (abfd, note);
|
return elfcore_grok_s390_prefix (abfd, note);
|
else
|
else
|
return TRUE;
|
return TRUE;
|
|
|
|
case NT_ARM_VFP:
|
|
if (note->namesz == 6
|
|
&& strcmp (note->namedata, "LINUX") == 0)
|
|
return elfcore_grok_arm_vfp (abfd, note);
|
|
else
|
|
return TRUE;
|
|
|
case NT_PRPSINFO:
|
case NT_PRPSINFO:
|
case NT_PSINFO:
|
case NT_PSINFO:
|
if (bed->elf_backend_grok_psinfo)
|
if (bed->elf_backend_grok_psinfo)
|
if ((*bed->elf_backend_grok_psinfo) (abfd, note))
|
if ((*bed->elf_backend_grok_psinfo) (abfd, note))
|
return TRUE;
|
return TRUE;
|
Line 9147... |
Line 9165... |
return elfcore_write_note (abfd, buf, bufsiz,
|
return elfcore_write_note (abfd, buf, bufsiz,
|
note_name, NT_S390_PREFIX, s390_prefix, size);
|
note_name, NT_S390_PREFIX, s390_prefix, size);
|
}
|
}
|
|
|
char *
|
char *
|
|
elfcore_write_arm_vfp (bfd *abfd,
|
|
char *buf,
|
|
int *bufsiz,
|
|
const void *arm_vfp,
|
|
int size)
|
|
{
|
|
char *note_name = "LINUX";
|
|
return elfcore_write_note (abfd, buf, bufsiz,
|
|
note_name, NT_ARM_VFP, arm_vfp, size);
|
|
}
|
|
|
|
char *
|
elfcore_write_register_note (bfd *abfd,
|
elfcore_write_register_note (bfd *abfd,
|
char *buf,
|
char *buf,
|
int *bufsiz,
|
int *bufsiz,
|
const char *section,
|
const char *section,
|
const void *data,
|
const void *data,
|
Line 9176... |
Line 9206... |
return elfcore_write_s390_todpreg (abfd, buf, bufsiz, data, size);
|
return elfcore_write_s390_todpreg (abfd, buf, bufsiz, data, size);
|
if (strcmp (section, ".reg-s390-ctrs") == 0)
|
if (strcmp (section, ".reg-s390-ctrs") == 0)
|
return elfcore_write_s390_ctrs (abfd, buf, bufsiz, data, size);
|
return elfcore_write_s390_ctrs (abfd, buf, bufsiz, data, size);
|
if (strcmp (section, ".reg-s390-prefix") == 0)
|
if (strcmp (section, ".reg-s390-prefix") == 0)
|
return elfcore_write_s390_prefix (abfd, buf, bufsiz, data, size);
|
return elfcore_write_s390_prefix (abfd, buf, bufsiz, data, size);
|
|
if (strcmp (section, ".reg-arm-vfp") == 0)
|
|
return elfcore_write_arm_vfp (abfd, buf, bufsiz, data, size);
|
return NULL;
|
return NULL;
|
}
|
}
|
|
|
static bfd_boolean
|
static bfd_boolean
|
elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset)
|
elf_parse_notes (bfd *abfd, char *buf, size_t size, file_ptr offset)
|
Line 9576... |
Line 9608... |
i_ehdrp = elf_elfheader (abfd);
|
i_ehdrp = elf_elfheader (abfd);
|
|
|
i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
|
i_ehdrp->e_ident[EI_OSABI] = get_elf_backend_data (abfd)->elf_osabi;
|
|
|
/* To make things simpler for the loader on Linux systems we set the
|
/* To make things simpler for the loader on Linux systems we set the
|
osabi field to ELFOSABI_LINUX if the binary contains symbols of
|
osabi field to ELFOSABI_GNU if the binary contains symbols of
|
the STT_GNU_IFUNC type or STB_GNU_UNIQUE binding. */
|
the STT_GNU_IFUNC type or STB_GNU_UNIQUE binding. */
|
if (i_ehdrp->e_ident[EI_OSABI] == ELFOSABI_NONE
|
if (i_ehdrp->e_ident[EI_OSABI] == ELFOSABI_NONE
|
&& elf_tdata (abfd)->has_gnu_symbols)
|
&& elf_tdata (abfd)->has_gnu_symbols)
|
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX;
|
i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_GNU;
|
}
|
}
|
|
|
|
|
/* Return TRUE for ELF symbol types that represent functions.
|
/* Return TRUE for ELF symbol types that represent functions.
|
This is the default version of this function, which is sufficient for
|
This is the default version of this function, which is sufficient for
|