2013-06-26 12:49:29 +02:00
|
|
|
/* AArch64-specific support for ELF.
|
2018-01-03 06:17:27 +01:00
|
|
|
Copyright (C) 2009-2018 Free Software Foundation, Inc.
|
2013-06-26 12:49:29 +02:00
|
|
|
Contributed by ARM Ltd.
|
|
|
|
|
|
|
|
This file is part of BFD, the Binary File Descriptor library.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; see the file COPYING3. If not,
|
|
|
|
see <http://www.gnu.org/licenses/>. */
|
|
|
|
|
|
|
|
#include "sysdep.h"
|
|
|
|
#include "elfxx-aarch64.h"
|
2014-06-13 18:07:21 +02:00
|
|
|
#include <stdarg.h>
|
|
|
|
#include <string.h>
|
2013-06-26 12:49:29 +02:00
|
|
|
|
|
|
|
#define MASK(n) ((1u << (n)) - 1)
|
|
|
|
|
2015-02-24 13:04:41 +01:00
|
|
|
/* Sign-extend VALUE, which has the indicated number of BITS. */
|
|
|
|
|
|
|
|
bfd_signed_vma
|
|
|
|
_bfd_aarch64_sign_extend (bfd_vma value, int bits)
|
|
|
|
{
|
|
|
|
if (value & ((bfd_vma) 1 << (bits - 1)))
|
|
|
|
/* VALUE is negative. */
|
|
|
|
value |= ((bfd_vma) - 1) << bits;
|
|
|
|
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Decode the IMM field of ADRP. */
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
_bfd_aarch64_decode_adrp_imm (uint32_t insn)
|
|
|
|
{
|
|
|
|
return (((insn >> 5) & MASK (19)) << 2) | ((insn >> 29) & MASK (2));
|
|
|
|
}
|
|
|
|
|
2013-06-26 12:49:29 +02:00
|
|
|
/* Reencode the imm field of add immediate. */
|
|
|
|
static inline uint32_t
|
|
|
|
reencode_add_imm (uint32_t insn, uint32_t imm)
|
|
|
|
{
|
|
|
|
return (insn & ~(MASK (12) << 10)) | ((imm & MASK (12)) << 10);
|
|
|
|
}
|
|
|
|
|
2015-02-24 13:04:41 +01:00
|
|
|
/* Reencode the IMM field of ADR. */
|
|
|
|
|
|
|
|
uint32_t
|
|
|
|
_bfd_aarch64_reencode_adr_imm (uint32_t insn, uint32_t imm)
|
2013-06-26 12:49:29 +02:00
|
|
|
{
|
|
|
|
return (insn & ~((MASK (2) << 29) | (MASK (19) << 5)))
|
|
|
|
| ((imm & MASK (2)) << 29) | ((imm & (MASK (19) << 2)) << 3);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Reencode the imm field of ld/st pos immediate. */
|
|
|
|
static inline uint32_t
|
|
|
|
reencode_ldst_pos_imm (uint32_t insn, uint32_t imm)
|
|
|
|
{
|
|
|
|
return (insn & ~(MASK (12) << 10)) | ((imm & MASK (12)) << 10);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Encode the 26-bit offset of unconditional branch. */
|
|
|
|
static inline uint32_t
|
|
|
|
reencode_branch_ofs_26 (uint32_t insn, uint32_t ofs)
|
|
|
|
{
|
|
|
|
return (insn & ~MASK (26)) | (ofs & MASK (26));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Encode the 19-bit offset of conditional branch and compare & branch. */
|
|
|
|
static inline uint32_t
|
|
|
|
reencode_cond_branch_ofs_19 (uint32_t insn, uint32_t ofs)
|
|
|
|
{
|
|
|
|
return (insn & ~(MASK (19) << 5)) | ((ofs & MASK (19)) << 5);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Decode the 19-bit offset of load literal. */
|
|
|
|
static inline uint32_t
|
|
|
|
reencode_ld_lit_ofs_19 (uint32_t insn, uint32_t ofs)
|
|
|
|
{
|
|
|
|
return (insn & ~(MASK (19) << 5)) | ((ofs & MASK (19)) << 5);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Encode the 14-bit offset of test & branch. */
|
|
|
|
static inline uint32_t
|
|
|
|
reencode_tst_branch_ofs_14 (uint32_t insn, uint32_t ofs)
|
|
|
|
{
|
|
|
|
return (insn & ~(MASK (14) << 5)) | ((ofs & MASK (14)) << 5);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Reencode the imm field of move wide. */
|
|
|
|
static inline uint32_t
|
|
|
|
reencode_movw_imm (uint32_t insn, uint32_t imm)
|
|
|
|
{
|
|
|
|
return (insn & ~(MASK (16) << 5)) | ((imm & MASK (16)) << 5);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Reencode mov[zn] to movz. */
|
|
|
|
static inline uint32_t
|
|
|
|
reencode_movzn_to_movz (uint32_t opcode)
|
|
|
|
{
|
|
|
|
return opcode | (1 << 30);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Reencode mov[zn] to movn. */
|
|
|
|
static inline uint32_t
|
|
|
|
reencode_movzn_to_movn (uint32_t opcode)
|
|
|
|
{
|
|
|
|
return opcode & ~(1 << 30);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return non-zero if the indicated VALUE has overflowed the maximum
|
|
|
|
range expressible by a unsigned number with the indicated number of
|
|
|
|
BITS. */
|
|
|
|
|
|
|
|
static bfd_reloc_status_type
|
|
|
|
aarch64_unsigned_overflow (bfd_vma value, unsigned int bits)
|
|
|
|
{
|
|
|
|
bfd_vma lim;
|
|
|
|
if (bits >= sizeof (bfd_vma) * 8)
|
|
|
|
return bfd_reloc_ok;
|
|
|
|
lim = (bfd_vma) 1 << bits;
|
|
|
|
if (value >= lim)
|
|
|
|
return bfd_reloc_overflow;
|
|
|
|
return bfd_reloc_ok;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return non-zero if the indicated VALUE has overflowed the maximum
|
|
|
|
range expressible by an signed number with the indicated number of
|
|
|
|
BITS. */
|
|
|
|
|
|
|
|
static bfd_reloc_status_type
|
|
|
|
aarch64_signed_overflow (bfd_vma value, unsigned int bits)
|
|
|
|
{
|
|
|
|
bfd_signed_vma svalue = (bfd_signed_vma) value;
|
|
|
|
bfd_signed_vma lim;
|
|
|
|
|
|
|
|
if (bits >= sizeof (bfd_vma) * 8)
|
|
|
|
return bfd_reloc_ok;
|
|
|
|
lim = (bfd_signed_vma) 1 << (bits - 1);
|
|
|
|
if (svalue < -lim || svalue >= lim)
|
|
|
|
return bfd_reloc_overflow;
|
|
|
|
return bfd_reloc_ok;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Insert the addend/value into the instruction or data object being
|
|
|
|
relocated. */
|
|
|
|
bfd_reloc_status_type
|
|
|
|
_bfd_aarch64_elf_put_addend (bfd *abfd,
|
|
|
|
bfd_byte *address, bfd_reloc_code_real_type r_type,
|
|
|
|
reloc_howto_type *howto, bfd_signed_vma addend)
|
|
|
|
{
|
|
|
|
bfd_reloc_status_type status = bfd_reloc_ok;
|
|
|
|
bfd_signed_vma old_addend = addend;
|
|
|
|
bfd_vma contents;
|
|
|
|
int size;
|
|
|
|
|
|
|
|
size = bfd_get_reloc_size (howto);
|
|
|
|
switch (size)
|
|
|
|
{
|
2015-01-19 01:06:26 +01:00
|
|
|
case 0:
|
|
|
|
return status;
|
2013-06-26 12:49:29 +02:00
|
|
|
case 2:
|
|
|
|
contents = bfd_get_16 (abfd, address);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (howto->src_mask != 0xffffffff)
|
|
|
|
/* Must be 32-bit instruction, always little-endian. */
|
|
|
|
contents = bfd_getl32 (address);
|
|
|
|
else
|
|
|
|
/* Must be 32-bit data (endianness dependent). */
|
|
|
|
contents = bfd_get_32 (abfd, address);
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
contents = bfd_get_64 (abfd, address);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (howto->complain_on_overflow)
|
|
|
|
{
|
|
|
|
case complain_overflow_dont:
|
|
|
|
break;
|
|
|
|
case complain_overflow_signed:
|
|
|
|
status = aarch64_signed_overflow (addend,
|
|
|
|
howto->bitsize + howto->rightshift);
|
|
|
|
break;
|
|
|
|
case complain_overflow_unsigned:
|
|
|
|
status = aarch64_unsigned_overflow (addend,
|
|
|
|
howto->bitsize + howto->rightshift);
|
|
|
|
break;
|
|
|
|
case complain_overflow_bitfield:
|
|
|
|
default:
|
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
|
|
|
|
addend >>= howto->rightshift;
|
|
|
|
|
|
|
|
switch (r_type)
|
|
|
|
{
|
|
|
|
case BFD_RELOC_AARCH64_CALL26:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_JUMP26:
|
2013-06-26 12:49:29 +02:00
|
|
|
contents = reencode_branch_ofs_26 (contents, addend);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_BRANCH19:
|
|
|
|
contents = reencode_cond_branch_ofs_19 (contents, addend);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_TSTBR14:
|
|
|
|
contents = reencode_tst_branch_ofs_14 (contents, addend);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_GOT_LD_PREL19:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_LD_LO19_PCREL:
|
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19:
|
2015-02-13 10:57:11 +01:00
|
|
|
case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
|
2013-06-26 12:49:29 +02:00
|
|
|
if (old_addend & ((1 << howto->rightshift) - 1))
|
|
|
|
return bfd_reloc_overflow;
|
|
|
|
contents = reencode_ld_lit_ofs_19 (contents, addend);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_CALL:
|
|
|
|
break;
|
|
|
|
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_ADR_GOT_PAGE:
|
|
|
|
case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
|
|
|
|
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
|
|
|
|
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
|
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
|
2015-02-18 16:36:40 +01:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
|
2015-08-11 18:05:34 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
|
2015-07-16 16:46:21 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
|
2015-02-24 13:04:41 +01:00
|
|
|
contents = _bfd_aarch64_reencode_adr_imm (contents, addend);
|
2013-06-26 12:49:29 +02:00
|
|
|
break;
|
|
|
|
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_ADD_LO12:
|
2017-03-13 10:58:04 +01:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
|
2015-08-19 12:18:25 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12:
|
2015-08-11 18:44:30 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12:
|
2015-08-19 11:58:13 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC:
|
2015-08-11 18:20:17 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADD_LO12_NC:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
|
|
|
|
/* Corresponds to: add rd, rn, #uimm12 to provide the low order
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
12 bits of the page offset following
|
|
|
|
BFD_RELOC_AARCH64_ADR_HI21_PCREL which computes the
|
|
|
|
(pc-relative) page base. */
|
2013-06-26 12:49:29 +02:00
|
|
|
contents = reencode_add_imm (contents, addend);
|
|
|
|
break;
|
|
|
|
|
2015-06-01 16:45:25 +02:00
|
|
|
case BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
|
2015-10-02 15:51:26 +02:00
|
|
|
case BFD_RELOC_AARCH64_LD64_GOTOFF_LO15:
|
2015-06-01 11:26:00 +02:00
|
|
|
case BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_LDST128_LO12:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_LDST16_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_LDST32_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_LDST64_LO12:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_LDST8_LO12:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC:
|
2017-03-13 10:58:04 +01:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
|
2015-08-19 12:26:56 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC:
|
2018-03-28 19:06:05 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC:
|
2013-06-26 12:49:29 +02:00
|
|
|
if (old_addend & ((1 << howto->rightshift) - 1))
|
|
|
|
return bfd_reloc_overflow;
|
|
|
|
/* Used for ldr*|str* rt, [rn, #uimm12] to provide the low order
|
2018-03-28 19:06:05 +02:00
|
|
|
12 bits address offset. */
|
2013-06-26 12:49:29 +02:00
|
|
|
contents = reencode_ldst_pos_imm (contents, addend);
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Group relocations to create high bits of a 16, 32, 48 or 64
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
bit signed data or abs address inline. Will change
|
|
|
|
instruction to MOVN or MOVZ depending on sign of calculated
|
|
|
|
value. */
|
2013-06-26 12:49:29 +02:00
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G0_S:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G1_S:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G2_S:
|
[LD][AARCH64]Add group relocations to create PC-relative offset.
This is a patch to add linker support for group relocations to create a
16, 32, 48, or 64 bit PC-relative offset inline.
The following relocations are added along with the test cases:
BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G3.
bfd/
2018-01-24 Renlin Li <renlin.li@arm.com>
* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G3.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/
2018-01-24 Renlin Li <renlin.li@arm.com>
* testsuite/ld-aarch64/aarch64-elf.exp: Run new testes.
* testsuite/ld-aarch64/emit-relocs-287.s: Fix test case.
* testsuite/ld-aarch64/emit-relocs-287.d: Fix expected output.
* testsuite/ld-aarch64/emit-relocs-287-overflow.s: New.
* testsuite/ld-aarch64/emit-relocs-287-overflow.d: New.
* testsuite/ld-aarch64/emit-relocs-288.d: New.
* testsuite/ld-aarch64/emit-relocs-288.s: New.
* testsuite/ld-aarch64/emit-relocs-289.d: New.
* testsuite/ld-aarch64/emit-relocs-289.s: New.
* testsuite/ld-aarch64/emit-relocs-289-overflow.s: New.
* testsuite/ld-aarch64/emit-relocs-289-overflow.d: New.
* testsuite/ld-aarch64/emit-relocs-290.d: New.
* testsuite/ld-aarch64/emit-relocs-290.s: New.
* testsuite/ld-aarch64/emit-relocs-291.d: New.
* testsuite/ld-aarch64/emit-relocs-291.s: New.
* testsuite/ld-aarch64/emit-relocs-291-overflow.s: New.
* testsuite/ld-aarch64/emit-relocs-291-overflow.d: New.
* testsuite/ld-aarch64/emit-relocs-292.d: New.
* testsuite/ld-aarch64/emit-relocs-292.s: New.
* testsuite/ld-aarch64/emit-relocs-293.d: New.
* testsuite/ld-aarch64/emit-relocs-293.s: New.
2018-01-18 13:17:55 +01:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G0:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G1:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G2:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G3:
|
2015-08-19 12:18:25 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2:
|
2013-06-26 12:49:29 +02:00
|
|
|
/* NOTE: We can only come here with movz or movn. */
|
|
|
|
if (addend < 0)
|
|
|
|
{
|
|
|
|
/* Force use of MOVN. */
|
|
|
|
addend = ~addend;
|
|
|
|
contents = reencode_movzn_to_movn (contents);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* Force use of MOVZ. */
|
|
|
|
contents = reencode_movzn_to_movz (contents);
|
|
|
|
}
|
2016-10-05 09:47:02 +02:00
|
|
|
/* Fall through. */
|
2013-06-26 12:49:29 +02:00
|
|
|
|
|
|
|
/* Group relocations to create a 16, 32, 48 or 64 bit unsigned
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
data or abs address inline. */
|
2013-06-26 12:49:29 +02:00
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G0:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G0_NC:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G1:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G1_NC:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G2:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G2_NC:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G3:
|
2015-10-02 16:54:40 +02:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC:
|
2015-10-02 16:29:41 +02:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_GOTOFF_G1:
|
[LD][AARCH64]Add group relocations to create PC-relative offset.
This is a patch to add linker support for group relocations to create a
16, 32, 48, or 64 bit PC-relative offset inline.
The following relocations are added along with the test cases:
BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G3.
bfd/
2018-01-24 Renlin Li <renlin.li@arm.com>
* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G3.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/
2018-01-24 Renlin Li <renlin.li@arm.com>
* testsuite/ld-aarch64/aarch64-elf.exp: Run new testes.
* testsuite/ld-aarch64/emit-relocs-287.s: Fix test case.
* testsuite/ld-aarch64/emit-relocs-287.d: Fix expected output.
* testsuite/ld-aarch64/emit-relocs-287-overflow.s: New.
* testsuite/ld-aarch64/emit-relocs-287-overflow.d: New.
* testsuite/ld-aarch64/emit-relocs-288.d: New.
* testsuite/ld-aarch64/emit-relocs-288.s: New.
* testsuite/ld-aarch64/emit-relocs-289.d: New.
* testsuite/ld-aarch64/emit-relocs-289.s: New.
* testsuite/ld-aarch64/emit-relocs-289-overflow.s: New.
* testsuite/ld-aarch64/emit-relocs-289-overflow.d: New.
* testsuite/ld-aarch64/emit-relocs-290.d: New.
* testsuite/ld-aarch64/emit-relocs-290.s: New.
* testsuite/ld-aarch64/emit-relocs-291.d: New.
* testsuite/ld-aarch64/emit-relocs-291.s: New.
* testsuite/ld-aarch64/emit-relocs-291-overflow.s: New.
* testsuite/ld-aarch64/emit-relocs-291-overflow.d: New.
* testsuite/ld-aarch64/emit-relocs-292.d: New.
* testsuite/ld-aarch64/emit-relocs-292.s: New.
* testsuite/ld-aarch64/emit-relocs-293.d: New.
* testsuite/ld-aarch64/emit-relocs-293.s: New.
2018-01-18 13:17:55 +01:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G0_NC:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G1_NC:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G2_NC:
|
2015-10-02 18:43:08 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_OFF_G1:
|
2015-10-02 17:37:22 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC:
|
2015-10-02 17:21:31 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSGD_MOVW_G1:
|
2015-10-02 17:59:46 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
|
2015-08-19 12:18:25 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
|
2013-06-26 12:49:29 +02:00
|
|
|
contents = reencode_movw_imm (contents, addend);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
/* Repack simple data */
|
|
|
|
if (howto->dst_mask & (howto->dst_mask + 1))
|
|
|
|
return bfd_reloc_notsupported;
|
|
|
|
|
|
|
|
contents = ((contents & ~howto->dst_mask) | (addend & howto->dst_mask));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (size)
|
|
|
|
{
|
|
|
|
case 2:
|
|
|
|
bfd_put_16 (abfd, contents, address);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
if (howto->dst_mask != 0xffffffff)
|
|
|
|
/* must be 32-bit instruction, always little-endian */
|
|
|
|
bfd_putl32 (contents, address);
|
|
|
|
else
|
|
|
|
/* must be 32-bit data (endianness dependent) */
|
|
|
|
bfd_put_32 (abfd, contents, address);
|
|
|
|
break;
|
|
|
|
case 8:
|
|
|
|
bfd_put_64 (abfd, contents, address);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
abort ();
|
|
|
|
}
|
|
|
|
|
|
|
|
return status;
|
|
|
|
}
|
|
|
|
|
|
|
|
bfd_vma
|
|
|
|
_bfd_aarch64_elf_resolve_relocation (bfd_reloc_code_real_type r_type,
|
|
|
|
bfd_vma place, bfd_vma value,
|
|
|
|
bfd_vma addend, bfd_boolean weak_undef_p)
|
|
|
|
{
|
|
|
|
switch (r_type)
|
|
|
|
{
|
|
|
|
case BFD_RELOC_AARCH64_NONE:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_CALL:
|
2013-06-26 12:49:29 +02:00
|
|
|
break;
|
|
|
|
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_16_PCREL:
|
|
|
|
case BFD_RELOC_AARCH64_32_PCREL:
|
|
|
|
case BFD_RELOC_AARCH64_64_PCREL:
|
|
|
|
case BFD_RELOC_AARCH64_ADR_LO21_PCREL:
|
|
|
|
case BFD_RELOC_AARCH64_BRANCH19:
|
|
|
|
case BFD_RELOC_AARCH64_LD_LO19_PCREL:
|
[LD][AARCH64]Add group relocations to create PC-relative offset.
This is a patch to add linker support for group relocations to create a
16, 32, 48, or 64 bit PC-relative offset inline.
The following relocations are added along with the test cases:
BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G3.
bfd/
2018-01-24 Renlin Li <renlin.li@arm.com>
* elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
BFD_RELOC_AARCH64_MOVW_PREL_G3.
* elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
(_bfd_aarch64_elf_resolve_relocation): Likewise.
ld/
2018-01-24 Renlin Li <renlin.li@arm.com>
* testsuite/ld-aarch64/aarch64-elf.exp: Run new testes.
* testsuite/ld-aarch64/emit-relocs-287.s: Fix test case.
* testsuite/ld-aarch64/emit-relocs-287.d: Fix expected output.
* testsuite/ld-aarch64/emit-relocs-287-overflow.s: New.
* testsuite/ld-aarch64/emit-relocs-287-overflow.d: New.
* testsuite/ld-aarch64/emit-relocs-288.d: New.
* testsuite/ld-aarch64/emit-relocs-288.s: New.
* testsuite/ld-aarch64/emit-relocs-289.d: New.
* testsuite/ld-aarch64/emit-relocs-289.s: New.
* testsuite/ld-aarch64/emit-relocs-289-overflow.s: New.
* testsuite/ld-aarch64/emit-relocs-289-overflow.d: New.
* testsuite/ld-aarch64/emit-relocs-290.d: New.
* testsuite/ld-aarch64/emit-relocs-290.s: New.
* testsuite/ld-aarch64/emit-relocs-291.d: New.
* testsuite/ld-aarch64/emit-relocs-291.s: New.
* testsuite/ld-aarch64/emit-relocs-291-overflow.s: New.
* testsuite/ld-aarch64/emit-relocs-291-overflow.d: New.
* testsuite/ld-aarch64/emit-relocs-292.d: New.
* testsuite/ld-aarch64/emit-relocs-292.s: New.
* testsuite/ld-aarch64/emit-relocs-293.d: New.
* testsuite/ld-aarch64/emit-relocs-293.s: New.
2018-01-18 13:17:55 +01:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G0:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G0_NC:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G1:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G1_NC:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G2:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G2_NC:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_PREL_G3:
|
2015-02-18 16:36:40 +01:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_ADR_PREL21:
|
2015-02-18 16:37:35 +01:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_LD_PREL19:
|
2015-02-13 08:13:57 +01:00
|
|
|
case BFD_RELOC_AARCH64_TLSGD_ADR_PREL21:
|
2015-02-13 10:57:11 +01:00
|
|
|
case BFD_RELOC_AARCH64_TLSIE_LD_GOTTPREL_PREL19:
|
2015-07-16 16:46:21 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADR_PREL21:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TSTBR14:
|
|
|
|
if (weak_undef_p)
|
|
|
|
value = place;
|
|
|
|
value = value + addend - place;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_CALL26:
|
|
|
|
case BFD_RELOC_AARCH64_JUMP26:
|
|
|
|
value = value + addend - place;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_16:
|
|
|
|
case BFD_RELOC_AARCH64_32:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G0:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G0_NC:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_G0_S:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_G1:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G1_NC:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_G1_S:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_G2:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_G2_NC:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_G2_S:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_MOVW_G3:
|
2015-10-02 18:43:08 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_OFF_G0_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_OFF_G1:
|
2015-10-02 17:37:22 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSGD_MOVW_G0_NC:
|
2015-10-02 17:21:31 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSGD_MOVW_G1:
|
2015-08-19 12:18:25 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_HI12:
|
2015-08-11 18:44:30 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12:
|
2015-08-19 11:58:13 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADD_DTPREL_LO12_NC:
|
2015-08-19 12:26:56 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12:
|
2015-08-19 12:18:25 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G0_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G1_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_MOVW_DTPREL_G2:
|
2018-03-28 19:06:05 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12:
|
2013-06-26 12:49:29 +02:00
|
|
|
value = value + addend;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_ADR_HI21_NC_PCREL:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_ADR_HI21_PCREL:
|
2013-06-26 12:49:29 +02:00
|
|
|
if (weak_undef_p)
|
|
|
|
value = PG (place);
|
|
|
|
value = PG (value + addend) - PG (place);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_GOT_LD_PREL19:
|
|
|
|
value = value + addend - place;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_ADR_GOT_PAGE:
|
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21:
|
|
|
|
case BFD_RELOC_AARCH64_TLSGD_ADR_PAGE21:
|
|
|
|
case BFD_RELOC_AARCH64_TLSIE_ADR_GOTTPREL_PAGE21:
|
2015-08-11 18:05:34 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_ADR_PAGE21:
|
2013-06-26 12:49:29 +02:00
|
|
|
value = PG (value + addend) - PG (place);
|
|
|
|
break;
|
|
|
|
|
2017-06-29 12:45:24 +02:00
|
|
|
/* Caller must make sure addend is the base address of .got section. */
|
2015-06-01 16:45:25 +02:00
|
|
|
case BFD_RELOC_AARCH64_LD32_GOTPAGE_LO14:
|
2015-06-01 11:26:00 +02:00
|
|
|
case BFD_RELOC_AARCH64_LD64_GOTPAGE_LO15:
|
2017-06-29 12:45:24 +02:00
|
|
|
addend = PG (addend);
|
|
|
|
/* Fall through. */
|
|
|
|
case BFD_RELOC_AARCH64_LD64_GOTOFF_LO15:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC:
|
|
|
|
case BFD_RELOC_AARCH64_MOVW_GOTOFF_G1:
|
|
|
|
value = value - addend;
|
2015-06-01 11:26:00 +02:00
|
|
|
break;
|
|
|
|
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_ADD_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_LD32_GOT_LO12_NC:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_LD64_GOT_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_LDST128_LO12:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_LDST16_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_LDST32_LO12:
|
|
|
|
case BFD_RELOC_AARCH64_LDST64_LO12:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_LDST8_LO12:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_ADD:
|
2017-03-13 10:58:04 +01:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_ADD_LO12:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_LD32_LO12_NC:
|
2017-03-13 10:58:04 +01:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_LD64_LO12:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSDESC_LDR:
|
|
|
|
case BFD_RELOC_AARCH64_TLSGD_ADD_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSIE_LD32_GOTTPREL_LO12_NC:
|
2015-05-20 11:58:43 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSIE_LD64_GOTTPREL_LO12_NC:
|
2018-04-27 11:48:18 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST16_DTPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST32_DTPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST64_DTPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLD_LDST8_DTPREL_LO12_NC:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12_NC:
|
2018-04-27 11:48:18 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST16_TPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST32_TPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST64_TPREL_LO12_NC:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_LDST8_TPREL_LO12_NC:
|
2013-06-26 12:49:29 +02:00
|
|
|
value = PG_OFFSET (value + addend);
|
|
|
|
break;
|
|
|
|
|
2015-06-01 11:31:38 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_LO12:
|
|
|
|
value = value + addend;
|
|
|
|
break;
|
|
|
|
|
2015-10-02 17:59:46 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G1:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G1_NC:
|
|
|
|
value = (value + addend) & (bfd_vma) 0xffff0000;
|
|
|
|
break;
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_ADD_TPREL_HI12:
|
2015-01-13 12:18:10 +01:00
|
|
|
/* Mask off low 12bits, keep all other high bits, so that the later
|
|
|
|
generic code could check whehter there is overflow. */
|
|
|
|
value = (value + addend) & ~(bfd_vma) 0xfff;
|
2013-06-26 12:49:29 +02:00
|
|
|
break;
|
|
|
|
|
2015-10-02 17:59:46 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSIE_MOVW_GOTTPREL_G0_NC:
|
2013-06-26 12:49:29 +02:00
|
|
|
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0:
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G0_NC:
|
|
|
|
value = (value + addend) & (bfd_vma) 0xffff;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case BFD_RELOC_AARCH64_TLSLE_MOVW_TPREL_G2:
|
|
|
|
value = (value + addend) & ~(bfd_vma) 0xffffffff;
|
|
|
|
value -= place & ~(bfd_vma) 0xffffffff;
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Support for core dump NOTE sections. */
|
|
|
|
|
|
|
|
bfd_boolean
|
|
|
|
_bfd_aarch64_elf_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
|
|
|
|
{
|
|
|
|
int offset;
|
|
|
|
size_t size;
|
|
|
|
|
|
|
|
switch (note->descsz)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
|
2013-11-11 11:26:41 +01:00
|
|
|
case 392: /* sizeof(struct elf_prstatus) on Linux/arm64. */
|
2013-06-26 12:49:29 +02:00
|
|
|
/* pr_cursig */
|
|
|
|
elf_tdata (abfd)->core->signal
|
|
|
|
= bfd_get_16 (abfd, note->descdata + 12);
|
|
|
|
|
|
|
|
/* pr_pid */
|
|
|
|
elf_tdata (abfd)->core->lwpid
|
|
|
|
= bfd_get_32 (abfd, note->descdata + 32);
|
|
|
|
|
|
|
|
/* pr_reg */
|
|
|
|
offset = 112;
|
|
|
|
size = 272;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Make a ".reg/999" section. */
|
|
|
|
return _bfd_elfcore_make_pseudosection (abfd, ".reg",
|
|
|
|
size, note->descpos + offset);
|
|
|
|
}
|
2014-06-13 18:07:21 +02:00
|
|
|
|
|
|
|
bfd_boolean
|
|
|
|
_bfd_aarch64_elf_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
|
|
|
|
{
|
|
|
|
switch (note->descsz)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
return FALSE;
|
|
|
|
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
case 136: /* This is sizeof(struct elf_prpsinfo) on Linux/aarch64. */
|
2014-06-13 18:07:21 +02:00
|
|
|
elf_tdata (abfd)->core->pid = bfd_get_32 (abfd, note->descdata + 24);
|
|
|
|
elf_tdata (abfd)->core->program
|
|
|
|
= _bfd_elfcore_strndup (abfd, note->descdata + 40, 16);
|
|
|
|
elf_tdata (abfd)->core->command
|
|
|
|
= _bfd_elfcore_strndup (abfd, note->descdata + 56, 80);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Note that for some reason, a spurious space is tacked
|
|
|
|
onto the end of the args in some (at least one anyway)
|
|
|
|
implementations, so strip it off if it exists. */
|
|
|
|
|
|
|
|
{
|
|
|
|
char *command = elf_tdata (abfd)->core->command;
|
|
|
|
int n = strlen (command);
|
|
|
|
|
|
|
|
if (0 < n && command[n - 1] == ' ')
|
|
|
|
command[n - 1] = '\0';
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
char *
|
|
|
|
_bfd_aarch64_elf_write_core_note (bfd *abfd, char *buf, int *bufsiz, int note_type,
|
|
|
|
...)
|
|
|
|
{
|
|
|
|
switch (note_type)
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
case NT_PRPSINFO:
|
|
|
|
{
|
2018-04-27 02:12:11 +02:00
|
|
|
char data[136] ATTRIBUTE_NONSTRING;
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
va_list ap;
|
2014-06-13 18:07:21 +02:00
|
|
|
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
va_start (ap, note_type);
|
|
|
|
memset (data, 0, sizeof (data));
|
|
|
|
strncpy (data + 40, va_arg (ap, const char *), 16);
|
2018-07-06 07:37:08 +02:00
|
|
|
#if GCC_VERSION == 8001
|
2018-06-04 19:01:34 +02:00
|
|
|
DIAGNOSTIC_PUSH;
|
|
|
|
/* GCC 8.1 warns about 80 equals destination size with
|
|
|
|
-Wstringop-truncation:
|
|
|
|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85643
|
|
|
|
*/
|
|
|
|
DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION;
|
|
|
|
#endif
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
strncpy (data + 56, va_arg (ap, const char *), 80);
|
2018-07-06 07:37:08 +02:00
|
|
|
#if GCC_VERSION == 8001
|
2018-06-04 19:01:34 +02:00
|
|
|
DIAGNOSTIC_POP;
|
2018-07-06 07:37:08 +02:00
|
|
|
#endif
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
va_end (ap);
|
2014-06-13 18:07:21 +02:00
|
|
|
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
return elfcore_write_note (abfd, buf, bufsiz, "CORE",
|
2014-06-13 18:07:21 +02:00
|
|
|
note_type, data, sizeof (data));
|
|
|
|
}
|
|
|
|
|
|
|
|
case NT_PRSTATUS:
|
|
|
|
{
|
BFD whitespace fixes
Binutils is supposed to use tabs. In my git config I have
whitespace = indent-with-non-tab,space-before-tab,trailing-space
and I got annoyed enough seeing red in "git diff" output to fix
the problems.
* doc/header.sed: Trim trailing space when splitting lines.
* aix386-core.c, * aout-adobe.c, * aout-arm.c, * aout-cris.c,
* aout-ns32k.c, * aout-target.h, * aout-tic30.c, * aoutf1.h, * aoutx.h,
* arc-got.h, * arc-plt.def, * arc-plt.h, * archive.c, * archive64.c,
* archures.c, * armnetbsd.c, * bfd-in.h, * bfd.c, * bfdio.c, * binary.c,
* bout.c, * cache.c, * cisco-core.c, * coff-alpha.c, * coff-apollo.c,
* coff-arm.c, * coff-h8300.c, * coff-i386.c, * coff-i860.c,
* coff-i960.c, * coff-m68k.c, * coff-m88k.c, * coff-mcore.c,
* coff-mips.c, * coff-ppc.c, * coff-rs6000.c, * coff-sh.c,
* coff-stgo32.c, * coff-tic4x.c, * coff-tic54x.c, * coff-tic80.c,
* coff-we32k.c, * coff-x86_64.c, * coff-z80.c, * coff-z8k.c,
* coff64-rs6000.c, * coffcode.h, * coffgen.c, * cofflink.c,
* coffswap.h, * compress.c, * corefile.c, * cpu-alpha.c, * cpu-arm.c,
* cpu-avr.c, * cpu-bfin.c, * cpu-cr16.c, * cpu-cr16c.c, * cpu-crx.c,
* cpu-d10v.c, * cpu-frv.c, * cpu-ft32.c, * cpu-i370.c, * cpu-i960.c,
* cpu-ia64-opc.c, * cpu-ip2k.c, * cpu-lm32.c, * cpu-m32r.c,
* cpu-mcore.c, * cpu-microblaze.c, * cpu-mips.c, * cpu-moxie.c,
* cpu-mt.c, * cpu-nios2.c, * cpu-ns32k.c, * cpu-or1k.c, * cpu-powerpc.c,
* cpu-pru.c, * cpu-sh.c, * cpu-spu.c, * cpu-v850.c, * cpu-v850_rh850.c,
* cpu-xgate.c, * cpu-z80.c, * dwarf1.c, * dwarf2.c, * ecoff.c,
* ecofflink.c, * ecoffswap.h, * elf-bfd.h, * elf-eh-frame.c,
* elf-hppa.h, * elf-m10200.c, * elf-m10300.c, * elf-s390-common.c,
* elf-strtab.c, * elf-vxworks.c, * elf.c, * elf32-am33lin.c,
* elf32-arc.c, * elf32-arm.c, * elf32-avr.c, * elf32-avr.h,
* elf32-bfin.c, * elf32-cr16.c, * elf32-cr16c.c, * elf32-cris.c,
* elf32-crx.c, * elf32-d10v.c, * elf32-d30v.c, * elf32-dlx.c,
* elf32-epiphany.c, * elf32-fr30.c, * elf32-frv.c, * elf32-ft32.c,
* elf32-h8300.c, * elf32-hppa.c, * elf32-i386.c, * elf32-i860.c,
* elf32-i960.c, * elf32-ip2k.c, * elf32-lm32.c, * elf32-m32c.c,
* elf32-m32r.c, * elf32-m68hc11.c, * elf32-m68hc12.c, * elf32-m68hc1x.c,
* elf32-m68hc1x.h, * elf32-m68k.c, * elf32-m88k.c, * elf32-mcore.c,
* elf32-mep.c, * elf32-metag.c, * elf32-microblaze.c, * elf32-mips.c,
* elf32-moxie.c, * elf32-msp430.c, * elf32-mt.c, * elf32-nds32.c,
* elf32-nds32.h, * elf32-nios2.c, * elf32-or1k.c, * elf32-pj.c,
* elf32-ppc.c, * elf32-ppc.h, * elf32-pru.c, * elf32-rl78.c,
* elf32-rx.c, * elf32-s390.c, * elf32-score.c, * elf32-score.h,
* elf32-score7.c, * elf32-sh-symbian.c, * elf32-sh.c, * elf32-sh64.c,
* elf32-sparc.c, * elf32-spu.c, * elf32-tic6x.c, * elf32-tilegx.c,
* elf32-tilegx.h, * elf32-tilepro.c, * elf32-tilepro.h, * elf32-v850.c,
* elf32-vax.c, * elf32-wasm32.c, * elf32-xc16x.c, * elf32-xgate.c,
* elf32-xgate.h, * elf32-xstormy16.c, * elf32-xtensa.c, * elf64-alpha.c,
* elf64-hppa.c, * elf64-ia64-vms.c, * elf64-mips.c, * elf64-mmix.c,
* elf64-ppc.c, * elf64-s390.c, * elf64-sh64.c, * elf64-sparc.c,
* elf64-tilegx.c, * elf64-tilegx.h, * elf64-x86-64.c, * elfcore.h,
* elflink.c, * elfn32-mips.c, * elfnn-aarch64.c, * elfnn-ia64.c,
* elfnn-riscv.c, * elfxx-aarch64.c, * elfxx-aarch64.h, * elfxx-ia64.c,
* elfxx-ia64.h, * elfxx-mips.c, * elfxx-riscv.c, * elfxx-sparc.c,
* elfxx-tilegx.c, * elfxx-x86.c, * elfxx-x86.h, * freebsd.h, * hash.c,
* host-aout.c, * hp300hpux.c, * hppabsd-core.c, * hpux-core.c,
* i386aout.c, * i386linux.c, * i386lynx.c, * i386mach3.c, * i386msdos.c,
* i386netbsd.c, * ieee.c, * ihex.c, * irix-core.c, * libaout.h,
* libbfd-in.h, * libbfd.c, * libcoff-in.h, * libnlm.h, * libpei.h,
* libxcoff.h, * linker.c, * lynx-core.c, * m68k4knetbsd.c,
* m68klinux.c, * m68knetbsd.c, * m88kmach3.c, * mach-o-aarch64.c,
* mach-o-arm.c, * mach-o-i386.c, * mach-o-target.c, * mach-o-x86-64.c,
* mach-o.c, * mach-o.h, * merge.c, * mipsbsd.c, * mmo.c, * netbsd.h,
* netbsd-core.c, * newsos3.c, * nlm-target.h, * nlm32-ppc.c,
* nlm32-sparc.c, * nlmcode.h, * ns32k.h, * ns32knetbsd.c, * oasys.c,
* opncls.c, * pc532-mach.c, * pdp11.c, * pe-arm.c, * pe-i386.c,
* pe-mcore.c, * pe-mips.c, * pe-x86_64.c, * peXXigen.c, * pef.c,
* pef.h, * pei-arm.c, * pei-i386.c, * pei-mcore.c, * pei-x86_64.c,
* peicode.h, * plugin.c, * ppcboot.c, * ptrace-core.c, * reloc.c,
* riscix.c, * rs6000-core.c, * section.c, * som.c, * som.h,
* sparclinux.c, * sparcnetbsd.c, * srec.c, * stabs.c, * sunos.c,
* syms.c, * targets.c, * tekhex.c, * trad-core.c, * vax1knetbsd.c,
* vaxnetbsd.c, * verilog.c, * versados.c, * vms-alpha.c, * vms-lib.c,
* vms-misc.c, * wasm-module.c, * wasm-module.h, * xcofflink.c,
* xsym.c, * xsym.h: Whitespace fixes.
* bfd-in2.h, * libbfd.h, * libcoff.h: Regenerate.
2017-12-05 23:56:00 +01:00
|
|
|
char data[392];
|
|
|
|
va_list ap;
|
|
|
|
long pid;
|
|
|
|
int cursig;
|
|
|
|
const void *greg;
|
|
|
|
|
|
|
|
va_start (ap, note_type);
|
|
|
|
memset (data, 0, sizeof (data));
|
|
|
|
pid = va_arg (ap, long);
|
|
|
|
bfd_put_32 (abfd, pid, data + 32);
|
|
|
|
cursig = va_arg (ap, int);
|
|
|
|
bfd_put_16 (abfd, cursig, data + 12);
|
|
|
|
greg = va_arg (ap, const void *);
|
|
|
|
memcpy (data + 112, greg, 272);
|
|
|
|
va_end (ap);
|
|
|
|
|
|
|
|
return elfcore_write_note (abfd, buf, bufsiz, "CORE",
|
2014-06-13 18:07:21 +02:00
|
|
|
note_type, data, sizeof (data));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|