aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-s390.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2017-12-06 09:26:00 +1030
committerAlan Modra <amodra@gmail.com>2017-12-06 17:51:43 +1030
commit07d6d2b8345ef3dc82eab49635acac9ee67dbb18 (patch)
tree380d1e08ae32b2a37d5f9610f1811bb98299ac09 /bfd/elf32-s390.c
parent65281396861dfcfa993eb5af4769d6837104890d (diff)
downloadgdb-07d6d2b8345ef3dc82eab49635acac9ee67dbb18.zip
gdb-07d6d2b8345ef3dc82eab49635acac9ee67dbb18.tar.gz
gdb-07d6d2b8345ef3dc82eab49635acac9ee67dbb18.tar.bz2
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.
Diffstat (limited to 'bfd/elf32-s390.c')
-rw-r--r--bfd/elf32-s390.c282
1 files changed, 141 insertions, 141 deletions
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c
index 74e9582..fbb8aad 100644
--- a/bfd/elf32-s390.c
+++ b/bfd/elf32-s390.c
@@ -52,69 +52,69 @@ static reloc_howto_type elf_howto_table[] =
0, /* dst_mask */
FALSE), /* pcrel_offset */
- HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE),
- HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
- bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE),
- HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE),
+ HOWTO(R_390_8, 0, 0, 8, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_8", FALSE, 0,0x000000ff, FALSE),
+ HOWTO(R_390_12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
+ bfd_elf_generic_reloc, "R_390_12", FALSE, 0,0x00000fff, FALSE),
+ HOWTO(R_390_16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_16", FALSE, 0,0x0000ffff, FALSE),
+ HOWTO(R_390_32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_32", FALSE, 0,0xffffffff, FALSE),
HOWTO(R_390_PC32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE),
+ bfd_elf_generic_reloc, "R_390_PC32", FALSE, 0,0xffffffff, TRUE),
HOWTO(R_390_GOT12, 0, 1, 12, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE),
+ bfd_elf_generic_reloc, "R_390_GOT12", FALSE, 0,0x00000fff, FALSE),
HOWTO(R_390_GOT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE),
+ bfd_elf_generic_reloc, "R_390_GOT32", FALSE, 0,0xffffffff, FALSE),
HOWTO(R_390_PLT32, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_COPY, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_GLOB_DAT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PLT32", FALSE, 0,0xffffffff, TRUE),
+ HOWTO(R_390_COPY, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_COPY", FALSE, 0,0xffffffff, FALSE),
+ HOWTO(R_390_GLOB_DAT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GLOB_DAT", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_JMP_SLOT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_JMP_SLOT, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_JMP_SLOT", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_RELATIVE, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_RELATIVE, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_RELATIVE", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_GOTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTOFF32", FALSE, 0,0xffffffff, FALSE),
- HOWTO(R_390_GOTPC, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE),
- HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE),
- HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPC, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_GOTPC", FALSE, 0,0xffffffff, TRUE),
+ HOWTO(R_390_GOT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_GOT16", FALSE, 0,0x0000ffff, FALSE),
+ HOWTO(R_390_PC16, 0, 1, 16, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC16", FALSE, 0,0x0000ffff, TRUE),
+ HOWTO(R_390_PC16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC16DBL", FALSE, 0,0x0000ffff, TRUE),
+ HOWTO(R_390_PLT16DBL, 1, 1, 16, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT16DBL", FALSE, 0,0x0000ffff, TRUE),
HOWTO(R_390_PC32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE),
+ bfd_elf_generic_reloc, "R_390_PC32DBL", FALSE, 0,0xffffffff, TRUE),
HOWTO(R_390_PLT32DBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT32DBL", FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPCDBL, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPCDBL", FALSE, 0,0xffffffff, TRUE),
EMPTY_HOWTO (R_390_64), /* Empty entry for R_390_64. */
EMPTY_HOWTO (R_390_PC64), /* Empty entry for R_390_PC64. */
EMPTY_HOWTO (R_390_GOT64), /* Empty entry for R_390_GOT64. */
EMPTY_HOWTO (R_390_PLT64), /* Empty entry for R_390_PLT64. */
HOWTO(R_390_GOTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_GOTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_GOTENT", FALSE, 0,0xffffffff, TRUE),
+ HOWTO(R_390_GOTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTOFF16", FALSE, 0,0x0000ffff, FALSE),
EMPTY_HOWTO (R_390_GOTOFF64), /* Empty entry for R_390_GOTOFF64. */
- HOWTO(R_390_GOTPLT12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
+ HOWTO(R_390_GOTPLT12, 0, 1, 12, FALSE, 0, complain_overflow_dont,
bfd_elf_generic_reloc, "R_390_GOTPLT12", FALSE, 0,0x00000fff, FALSE),
- HOWTO(R_390_GOTPLT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPLT16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPLT16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_GOTPLT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_GOTPLT32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPLT32", FALSE, 0,0xffffffff, FALSE),
EMPTY_HOWTO (R_390_GOTPLT64), /* Empty entry for R_390_GOTPLT64. */
HOWTO(R_390_GOTPLTENT, 1, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_GOTPLTENT",FALSE, 0,0xffffffff, TRUE),
- HOWTO(R_390_PLTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_PLTOFF16, 0, 1, 16, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLTOFF16", FALSE, 0,0x0000ffff, FALSE),
- HOWTO(R_390_PLTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
+ HOWTO(R_390_PLTOFF32, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLTOFF32", FALSE, 0,0xffffffff, FALSE),
EMPTY_HOWTO (R_390_PLTOFF64), /* Empty entry for R_390_PLTOFF64. */
HOWTO(R_390_TLS_LOAD, 0, 0, 0, FALSE, 0, complain_overflow_dont,
@@ -151,22 +151,22 @@ static reloc_howto_type elf_howto_table[] =
bfd_elf_generic_reloc, "R_390_TLS_DTPOFF", FALSE, 0, 0xffffffff, FALSE),
HOWTO(R_390_TLS_TPOFF, 0, 2, 32, FALSE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_TLS_TPOFF", FALSE, 0, 0xffffffff, FALSE),
- HOWTO(R_390_20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
+ HOWTO(R_390_20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_20", FALSE, 0,0x0fffff00, FALSE),
HOWTO(R_390_GOT20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_GOT20", FALSE, 0,0x0fffff00, FALSE),
- HOWTO(R_390_GOTPLT20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
+ HOWTO(R_390_GOTPLT20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_GOTPLT20", FALSE, 0,0x0fffff00, FALSE),
HOWTO(R_390_TLS_GOTIE20, 0, 2, 20, FALSE, 8, complain_overflow_dont,
s390_elf_ldisp_reloc, "R_390_TLS_GOTIE20", FALSE, 0,0x0fffff00, FALSE),
HOWTO(R_390_IRELATIVE, 0, 2, 32, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_IRELATIVE", FALSE, 0, 0xffffffff, FALSE),
- HOWTO(R_390_PC12DBL, 1, 1, 12, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC12DBL", FALSE, 0,0x00000fff, TRUE),
+ HOWTO(R_390_PC12DBL, 1, 1, 12, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC12DBL", FALSE, 0,0x00000fff, TRUE),
HOWTO(R_390_PLT12DBL, 1, 1, 12, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT12DBL", FALSE, 0,0x00000fff, TRUE),
- HOWTO(R_390_PC24DBL, 1, 2, 24, TRUE, 0, complain_overflow_bitfield,
- bfd_elf_generic_reloc, "R_390_PC24DBL", FALSE, 0,0x00ffffff, TRUE),
+ HOWTO(R_390_PC24DBL, 1, 2, 24, TRUE, 0, complain_overflow_bitfield,
+ bfd_elf_generic_reloc, "R_390_PC24DBL", FALSE, 0,0x00ffffff, TRUE),
HOWTO(R_390_PLT24DBL, 1, 2, 24, TRUE, 0, complain_overflow_bitfield,
bfd_elf_generic_reloc, "R_390_PLT24DBL", FALSE, 0,0x00ffffff, TRUE),
};
@@ -478,100 +478,100 @@ elf_s390_is_local_label_name (bfd *abfd, const char *name)
and insert the address in the GOT.
Note: 390 can only address +- 64 K relative.
- We check if offset > 65536, then make a relative branch -64xxx
- back to a previous defined branch
-
-PLT1: BASR 1,0 # 2 bytes
- L 1,22(1) # 4 bytes Load offset in GOT in r 1
- L 1,(1,12) # 4 bytes Load address from GOT in r1
- BCR 15,1 # 2 bytes Jump to address
-RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
- L 1,14(1) # 4 bytes Load offset in symol table in r1
+ We check if offset > 65536, then make a relative branch -64xxx
+ back to a previous defined branch
+
+PLT1: BASR 1,0 # 2 bytes
+ L 1,22(1) # 4 bytes Load offset in GOT in r 1
+ L 1,(1,12) # 4 bytes Load address from GOT in r1
+ BCR 15,1 # 2 bytes Jump to address
+RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
+ L 1,14(1) # 4 bytes Load offset in symol table in r1
BRC 15,-x # 4 bytes Jump to start of PLT
- .word 0 # 2 bytes filler
- .long ? # 4 bytes offset in GOT
- .long ? # 4 bytes offset into rela.plt
+ .word 0 # 2 bytes filler
+ .long ? # 4 bytes offset in GOT
+ .long ? # 4 bytes offset into rela.plt
This was the general case. There are two additional, optimizes PLT
definitions. One for GOT offsets < 4096 and one for GOT offsets < 32768.
First the one for GOT offsets < 4096:
-PLT1: L 1,<offset>(12) # 4 bytes Load address from GOT in R1
- BCR 15,1 # 2 bytes Jump to address
- .word 0,0,0 # 6 bytes filler
-RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
- L 1,14(1) # 4 bytes Load offset in rela.plt in r1
- BRC 15,-x # 4 bytes Jump to start of PLT
- .word 0,0,0 # 6 bytes filler
- .long ? # 4 bytes offset into rela.plt
+PLT1: L 1,<offset>(12) # 4 bytes Load address from GOT in R1
+ BCR 15,1 # 2 bytes Jump to address
+ .word 0,0,0 # 6 bytes filler
+RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
+ L 1,14(1) # 4 bytes Load offset in rela.plt in r1
+ BRC 15,-x # 4 bytes Jump to start of PLT
+ .word 0,0,0 # 6 bytes filler
+ .long ? # 4 bytes offset into rela.plt
Second the one for GOT offsets < 32768:
-PLT1: LHI 1,<offset> # 4 bytes Load offset in GOT to r1
- L 1,(1,12) # 4 bytes Load address from GOT to r1
- BCR 15,1 # 2 bytes Jump to address
- .word 0 # 2 bytes filler
-RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
- L 1,14(1) # 4 bytes Load offset in rela.plt in r1
- BRC 15,-x # 4 bytes Jump to start of PLT
- .word 0,0,0 # 6 bytes filler
- .long ? # 4 bytes offset into rela.plt
+PLT1: LHI 1,<offset> # 4 bytes Load offset in GOT to r1
+ L 1,(1,12) # 4 bytes Load address from GOT to r1
+ BCR 15,1 # 2 bytes Jump to address
+ .word 0 # 2 bytes filler
+RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
+ L 1,14(1) # 4 bytes Load offset in rela.plt in r1
+ BRC 15,-x # 4 bytes Jump to start of PLT
+ .word 0,0,0 # 6 bytes filler
+ .long ? # 4 bytes offset into rela.plt
Total = 32 bytes per PLT entry
The code for static build PLT entries looks like this:
-PLT1: BASR 1,0 # 2 bytes
- L 1,22(1) # 4 bytes Load address of GOT entry
- L 1,0(0,1) # 4 bytes Load address from GOT in r1
- BCR 15,1 # 2 bytes Jump to address
-RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
- L 1,14(1) # 4 bytes Load offset in symbol table in r1
+PLT1: BASR 1,0 # 2 bytes
+ L 1,22(1) # 4 bytes Load address of GOT entry
+ L 1,0(0,1) # 4 bytes Load address from GOT in r1
+ BCR 15,1 # 2 bytes Jump to address
+RET1: BASR 1,0 # 2 bytes Return from GOT 1st time
+ L 1,14(1) # 4 bytes Load offset in symbol table in r1
BRC 15,-x # 4 bytes Jump to start of PLT
- .word 0 # 2 bytes filler
- .long ? # 4 bytes address of GOT entry
- .long ? # 4 bytes offset into rela.plt */
+ .word 0 # 2 bytes filler
+ .long ? # 4 bytes address of GOT entry
+ .long ? # 4 bytes offset into rela.plt */
static const bfd_byte elf_s390_plt_entry[PLT_ENTRY_SIZE] =
{
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x16, /* l %r1,22(%r1) */
- 0x58, 0x10, 0x10, 0x00, /* l %r1,0(%r1) */
- 0x07, 0xf1, /* br %r1 */
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
- 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
- 0x00, 0x00, /* padding */
- 0x00, 0x00, 0x00, 0x00, /* GOT offset */
- 0x00, 0x00, 0x00, 0x00 /* rela.plt offset */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x16, /* l %r1,22(%r1) */
+ 0x58, 0x10, 0x10, 0x00, /* l %r1,0(%r1) */
+ 0x07, 0xf1, /* br %r1 */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
+ 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
+ 0x00, 0x00, /* padding */
+ 0x00, 0x00, 0x00, 0x00, /* GOT offset */
+ 0x00, 0x00, 0x00, 0x00 /* rela.plt offset */
};
/* Generic PLT pic entry. */
static const bfd_byte elf_s390_plt_pic_entry[PLT_ENTRY_SIZE] =
{
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x16, /* l %r1,22(%r1) */
- 0x58, 0x11, 0xc0, 0x00, /* l %r1,0(%r1,%r12) */
- 0x07, 0xf1, /* br %r1 */
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
- 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
- 0x00, 0x00, /* padding */
- 0x00, 0x00, 0x00, 0x00, /* GOT offset */
- 0x00, 0x00, 0x00, 0x00 /* rela.plt offset */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x16, /* l %r1,22(%r1) */
+ 0x58, 0x11, 0xc0, 0x00, /* l %r1,0(%r1,%r12) */
+ 0x07, 0xf1, /* br %r1 */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
+ 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
+ 0x00, 0x00, /* padding */
+ 0x00, 0x00, 0x00, 0x00, /* GOT offset */
+ 0x00, 0x00, 0x00, 0x00 /* rela.plt offset */
};
/* Optimized PLT pic entry for GOT offset < 4k. xx will be replaced
when generating the PLT slot with the GOT offset. */
static const bfd_byte elf_s390_plt_pic12_entry[PLT_ENTRY_SIZE] =
{
- 0x58, 0x10, 0xc0, 0x00, /* l %r1,xx(%r12) */
- 0x07, 0xf1, /* br %r1 */
- 0x00, 0x00, 0x00, 0x00, /* padding */
+ 0x58, 0x10, 0xc0, 0x00, /* l %r1,xx(%r12) */
+ 0x07, 0xf1, /* br %r1 */
+ 0x00, 0x00, 0x00, 0x00, /* padding */
0x00, 0x00,
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
- 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
+ 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
};
@@ -580,13 +580,13 @@ static const bfd_byte elf_s390_plt_pic12_entry[PLT_ENTRY_SIZE] =
when generating the PLT slot with the GOT offset. */
static const bfd_byte elf_s390_plt_pic16_entry[PLT_ENTRY_SIZE] =
{
- 0xa7, 0x18, 0x00, 0x00, /* lhi %r1,xx */
- 0x58, 0x11, 0xc0, 0x00, /* l %r1,0(%r1,%r12) */
- 0x07, 0xf1, /* br %r1 */
+ 0xa7, 0x18, 0x00, 0x00, /* lhi %r1,xx */
+ 0x58, 0x11, 0xc0, 0x00, /* l %r1,0(%r1,%r12) */
+ 0x07, 0xf1, /* br %r1 */
0x00, 0x00,
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
- 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x0e, /* l %r1,14(%r1) */
+ 0xa7, 0xf4, 0x00, 0x00, /* j first plt */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00
@@ -599,32 +599,32 @@ static const bfd_byte elf_s390_plt_pic16_entry[PLT_ENTRY_SIZE] =
/* The first entry in the PLT for PIC code:
PLT0:
- ST 1,28(15) # R1 has offset into rela.plt
- L 1,4(12) # Get loader ino(object struct address)
- ST 1,24(15) # Store address
- L 1,8(12) # Entry address of loader in R1
- BR 1 # Jump to loader
+ ST 1,28(15) # R1 has offset into rela.plt
+ L 1,4(12) # Get loader ino(object struct address)
+ ST 1,24(15) # Store address
+ L 1,8(12) # Entry address of loader in R1
+ BR 1 # Jump to loader
The first entry in the PLT for static code:
PLT0:
- ST 1,28(15) # R1 has offset into rela.plt
+ ST 1,28(15) # R1 has offset into rela.plt
BASR 1,0
- L 1,18(0,1) # Get address of GOT
- MVC 24(4,15),4(1) # Move loader ino to stack
- L 1,8(1) # Get address of loader
- BR 1 # Jump to loader
- .word 0 # filler
- .long got # address of GOT */
+ L 1,18(0,1) # Get address of GOT
+ MVC 24(4,15),4(1) # Move loader ino to stack
+ L 1,8(1) # Get address of loader
+ BR 1 # Jump to loader
+ .word 0 # filler
+ .long got # address of GOT */
static const bfd_byte elf_s390_plt_first_entry[PLT_FIRST_ENTRY_SIZE] =
{
- 0x50, 0x10, 0xf0, 0x1c, /* st %r1,28(%r15) */
- 0x0d, 0x10, /* basr %r1,%r0 */
- 0x58, 0x10, 0x10, 0x12, /* l %r1,18(%r1) */
- 0xd2, 0x03, 0xf0, 0x18, 0x10, 0x04, /* mvc 24(4,%r15),4(%r1) */
- 0x58, 0x10, 0x10, 0x08, /* l %r1,8(%r1) */
- 0x07, 0xf1, /* br %r1 */
+ 0x50, 0x10, 0xf0, 0x1c, /* st %r1,28(%r15) */
+ 0x0d, 0x10, /* basr %r1,%r0 */
+ 0x58, 0x10, 0x10, 0x12, /* l %r1,18(%r1) */
+ 0xd2, 0x03, 0xf0, 0x18, 0x10, 0x04, /* mvc 24(4,%r15),4(%r1) */
+ 0x58, 0x10, 0x10, 0x08, /* l %r1,8(%r1) */
+ 0x07, 0xf1, /* br %r1 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00
@@ -632,11 +632,11 @@ static const bfd_byte elf_s390_plt_first_entry[PLT_FIRST_ENTRY_SIZE] =
static const bfd_byte elf_s390_plt_pic_first_entry[PLT_FIRST_ENTRY_SIZE] =
{
- 0x50, 0x10, 0xf0, 0x1c, /* st %r1,28(%r15) */
- 0x58, 0x10, 0xc0, 0x04, /* l %r1,4(%r12) */
- 0x50, 0x10, 0xf0, 0x18, /* st %r1,24(%r15) */
- 0x58, 0x10, 0xc0, 0x08, /* l %r1,8(%r12) */
- 0x07, 0xf1, /* br %r1 */
+ 0x50, 0x10, 0xf0, 0x1c, /* st %r1,28(%r15) */
+ 0x58, 0x10, 0xc0, 0x04, /* l %r1,4(%r12) */
+ 0x50, 0x10, 0xf0, 0x18, /* st %r1,24(%r15) */
+ 0x58, 0x10, 0xc0, 0x08, /* l %r1,8(%r12) */
+ 0x07, 0xf1, /* br %r1 */
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
@@ -1671,7 +1671,7 @@ allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
}
else
{
- h->plt.offset = (bfd_vma) -1;
+ h->plt.offset = (bfd_vma) -1;
h->needs_plt = 0;
elf_s390_adjust_gotplt((struct elf_s390_link_hash_entry *) h);
}
@@ -1962,7 +1962,7 @@ elf_s390_size_dynamic_sections (bfd *output_bfd ATTRIBUTE_UNUSED,
htab->elf.irelplt->size += RELA_ENTRY_SIZE;
}
else
- local_plt[i].plt.offset = (bfd_vma) -1;
+ local_plt[i].plt.offset = (bfd_vma) -1;
}
}
@@ -2534,7 +2534,7 @@ elf_s390_relocate_section (bfd *output_bfd,
if (s390_is_ifunc_symbol_p (h))
relocation = (htab->elf.iplt->output_section->vma
- + htab->elf.iplt->output_offset
+ + htab->elf.iplt->output_offset
+ h->plt.offset);
else
relocation = (htab->elf.splt->output_section->vma
@@ -3139,7 +3139,7 @@ elf_s390_relocate_section (bfd *output_bfd,
{
/* GD->IE transition.
brasl %r14,__tls_get_addr@plt ->
- l %r2,0(%r2,%r12) ; bcr 0,0 */
+ l %r2,0(%r2,%r12) ; bcr 0,0 */
insn = 0x5822c000;
bfd_put_16 (output_bfd, 0x0700,
contents + rel->r_offset + 4);
@@ -4044,8 +4044,8 @@ elf32_s390_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
#define elf_backend_grok_psinfo elf_s390_grok_psinfo
#define elf_backend_write_core_note elf_s390_write_core_note
#define elf_backend_plt_sym_val elf_s390_plt_sym_val
-#define elf_backend_add_symbol_hook elf_s390_add_symbol_hook
-#define elf_backend_sort_relocs_p elf_s390_elf_sort_relocs_p
+#define elf_backend_add_symbol_hook elf_s390_add_symbol_hook
+#define elf_backend_sort_relocs_p elf_s390_elf_sort_relocs_p
#define bfd_elf32_mkobject elf_s390_mkobject
#define elf_backend_object_p elf_s390_object_p