/* X86-64 specific support for ELF
- Copyright (C) 2000-2022 Free Software Foundation, Inc.
+ Copyright (C) 2000-2023 Free Software Foundation, Inc.
Contributed by Jan Hubicka <jh@suse.cz>.
This file is part of BFD, the Binary File Descriptor library.
default:
return false;
- case 124: /* sizeof(struct elf_prpsinfo) on Linux/x32 */
+ case 124:
+ /* sizeof (struct elf_external_linux_prpsinfo32_ugid16). */
elf_tdata (abfd)->core->pid
= bfd_get_32 (abfd, note->descdata + 12);
elf_tdata (abfd)->core->program
= _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
break;
- case 136: /* sizeof(struct elf_prpsinfo) on Linux/x86_64 */
+ case 128:
+ /* sizeof (struct elf_external_linux_prpsinfo32_ugid32). */
+ elf_tdata (abfd)->core->pid
+ = bfd_get_32 (abfd, note->descdata + 12);
+ elf_tdata (abfd)->core->program
+ = _bfd_elfcore_strndup (abfd, note->descdata + 32, 16);
+ elf_tdata (abfd)->core->command
+ = _bfd_elfcore_strndup (abfd, note->descdata + 48, 80);
+ break;
+
+ case 136:
+ /* sizeof (struct elf_prpsinfo) on Linux/x86_64. */
elf_tdata (abfd)->core->pid
= bfd_get_32 (abfd, note->descdata + 24);
elf_tdata (abfd)->core->program
{ &elf_x86_64_sframe_pltn_fre1, &elf_x86_64_sframe_pltn_fre2 },
NON_LAZY_PLT_ENTRY_SIZE,
1, /* Number of FREs for PLTn for second PLT. */
- /* FREs for second plt ( unwind info for .plt.got is
+ /* FREs for second plt (stack trace info for .plt.got is
identical). Used when IBT or non-lazy PLT is in effect. */
{ &elf_x86_64_sframe_sec_pltn_fre1 }
};
if (largepic)
return r_type == R_X86_64_PLTOFF64;
else if (indirect_call)
- return r_type == R_X86_64_GOTPCRELX;
+ return (r_type == R_X86_64_GOTPCRELX || r_type == R_X86_64_GOTPCREL);
else
return (r_type == R_X86_64_PC32 || r_type == R_X86_64_PLT32);
}
for (j = 0; plts[j].name != NULL; j++)
{
plt = bfd_get_section_by_name (abfd, plts[j].name);
- if (plt == NULL || plt->size == 0)
+ if (plt == NULL
+ || plt->size == 0
+ || (plt->flags & SEC_HAS_CONTENTS) == 0)
continue;
/* Get the PLT section contents. */