Line 418... |
Line 418... |
static char *
|
static char *
|
elf_x86_64_write_core_note (bfd *abfd, char *buf, int *bufsiz,
|
elf_x86_64_write_core_note (bfd *abfd, char *buf, int *bufsiz,
|
int note_type, ...)
|
int note_type, ...)
|
{
|
{
|
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
const struct elf_backend_data *bed = get_elf_backend_data (abfd);
|
const void *p;
|
|
int size;
|
|
va_list ap;
|
va_list ap;
|
const char *fname, *psargs;
|
const char *fname, *psargs;
|
long pid;
|
long pid;
|
int cursig;
|
int cursig;
|
const void *gregs;
|
const void *gregs;
|
Line 443... |
Line 441... |
{
|
{
|
prpsinfo32_t data;
|
prpsinfo32_t data;
|
memset (&data, 0, sizeof (data));
|
memset (&data, 0, sizeof (data));
|
strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
|
strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
|
strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
|
strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
|
p = (const void *) &data;
|
return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type,
|
size = sizeof (data);
|
&data, sizeof (data));
|
}
|
}
|
else
|
else
|
{
|
{
|
prpsinfo_t data;
|
prpsinfo_t data;
|
memset (&data, 0, sizeof (data));
|
memset (&data, 0, sizeof (data));
|
strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
|
strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
|
strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
|
strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
|
p = (const void *) &data;
|
return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type,
|
size = sizeof (data);
|
&data, sizeof (data));
|
}
|
}
|
break;
|
/* NOTREACHED */
|
|
|
case NT_PRSTATUS:
|
case NT_PRSTATUS:
|
va_start (ap, note_type);
|
va_start (ap, note_type);
|
pid = va_arg (ap, long);
|
pid = va_arg (ap, long);
|
cursig = va_arg (ap, int);
|
cursig = va_arg (ap, int);
|
Line 473... |
Line 471... |
prstatusx32_t prstat;
|
prstatusx32_t prstat;
|
memset (&prstat, 0, sizeof (prstat));
|
memset (&prstat, 0, sizeof (prstat));
|
prstat.pr_pid = pid;
|
prstat.pr_pid = pid;
|
prstat.pr_cursig = cursig;
|
prstat.pr_cursig = cursig;
|
memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg));
|
memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg));
|
p = (const void *) &prstat;
|
return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type,
|
size = sizeof (prstat);
|
&prstat, sizeof (prstat));
|
}
|
}
|
else
|
else
|
{
|
{
|
prstatus32_t prstat;
|
prstatus32_t prstat;
|
memset (&prstat, 0, sizeof (prstat));
|
memset (&prstat, 0, sizeof (prstat));
|
prstat.pr_pid = pid;
|
prstat.pr_pid = pid;
|
prstat.pr_cursig = cursig;
|
prstat.pr_cursig = cursig;
|
memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg));
|
memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg));
|
p = (const void *) &prstat;
|
return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type,
|
size = sizeof (prstat);
|
&prstat, sizeof (prstat));
|
}
|
}
|
}
|
}
|
else
|
else
|
{
|
{
|
prstatus_t prstat;
|
prstatus_t prstat;
|
memset (&prstat, 0, sizeof (prstat));
|
memset (&prstat, 0, sizeof (prstat));
|
prstat.pr_pid = pid;
|
prstat.pr_pid = pid;
|
prstat.pr_cursig = cursig;
|
prstat.pr_cursig = cursig;
|
memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg));
|
memcpy (&prstat.pr_reg, gregs, sizeof (prstat.pr_reg));
|
p = (const void *) &prstat;
|
return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type,
|
size = sizeof (prstat);
|
&prstat, sizeof (prstat));
|
}
|
}
|
break;
|
|
}
|
}
|
|
/* NOTREACHED */
|
return elfcore_write_note (abfd, buf, bufsiz, "CORE", note_type, p,
|
|
size);
|
|
}
|
}
|
#endif
|
#endif
|
|
|
/* Functions for the x86-64 ELF linker. */
|
/* Functions for the x86-64 ELF linker. */
|
|
|
/* The name of the dynamic interpreter. This is put in the .interp
|
/* The name of the dynamic interpreter. This is put in the .interp
|
section. */
|
section. */
|
|
|
#define ELF64_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
|
#define ELF64_DYNAMIC_INTERPRETER "/lib/ld64.so.1"
|
#define ELF32_DYNAMIC_INTERPRETER "/lib/ld32.so.1"
|
#define ELF32_DYNAMIC_INTERPRETER "/lib/ldx32.so.1"
|
|
|
/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
|
/* If ELIMINATE_COPY_RELOCS is non-zero, the linker will try to avoid
|
copying dynamic variables from a shared lib into an app's dynbss
|
copying dynamic variables from a shared lib into an app's dynbss
|
section, and instead use a dynamic relocation to point into the
|
section, and instead use a dynamic relocation to point into the
|
shared lib. */
|
shared lib. */
|
Line 3475... |
Line 3470... |
|
|
case R_X86_64_PC8:
|
case R_X86_64_PC8:
|
case R_X86_64_PC16:
|
case R_X86_64_PC16:
|
case R_X86_64_PC32:
|
case R_X86_64_PC32:
|
if (info->shared
|
if (info->shared
|
&& ABI_64_P (output_bfd)
|
|
&& (input_section->flags & SEC_ALLOC) != 0
|
&& (input_section->flags & SEC_ALLOC) != 0
|
&& (input_section->flags & SEC_READONLY) != 0
|
&& (input_section->flags & SEC_READONLY) != 0
|
&& h != NULL)
|
&& h != NULL)
|
{
|
{
|
bfd_boolean fail = FALSE;
|
bfd_boolean fail = FALSE;
|