aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-08-06 16:18:11 +0000
committerPaul Brook <paul@codesourcery.com>2004-08-06 16:18:11 +0000
commitdb6579d415fafa3833828f9528bc8d9525da3cd8 (patch)
treef0dc04dc5845967aab1b2f08fefbf2fc853c2007 /bfd
parentdeaa6723d2a35d46bc95cd4d7b295596893a158c (diff)
downloadgdb-db6579d415fafa3833828f9528bc8d9525da3cd8.zip
gdb-db6579d415fafa3833828f9528bc8d9525da3cd8.tar.gz
gdb-db6579d415fafa3833828f9528bc8d9525da3cd8.tar.bz2
bfd/
* elfarm-nabi.c (elf32_arm_howto_table): Add new EABI relocations. (elf32_arm_reloc_map): Add BFD_RELOC_ARM_RELABS32, BFD_RELOC_ARM_ROSEGREL32 and BFD_RELOC_ARM_SBREL32. * reloc.c: Add BFD_RELOC_ARM_RELABS32, BFD_RELOC_ARM_ROSEGREL32 and BFD_RELOC_ARM_SBREL32. * bfd-in2.h, bbfd.h: Regenerate. gas/ * config/tc-arm.c (md_apply_fix3, tc_gen_reloc, arm_parse_reloc): Handle new relocations. * include/elf/arm.h (elf_arm_reloc_type): Add new EABI relocations. gas/testsuite/ * gas/arm/pic.s,d: Test RELABS and SBREL relocations.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog9
-rw-r--r--bfd/bfd-in2.h10
-rw-r--r--bfd/elfarm-nabi.c97
-rw-r--r--bfd/libbfd.h3
-rw-r--r--bfd/reloc.c13
5 files changed, 127 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index c431b3e..42132ad 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,12 @@
+2004-08-06 Paul Brook <paul@codesourcery.com>
+
+ * elfarm-nabi.c (elf32_arm_howto_table): Add new EABI relocations.
+ (elf32_arm_reloc_map): Add BFD_RELOC_ARM_RELABS32,
+ BFD_RELOC_ARM_ROSEGREL32 and BFD_RELOC_ARM_SBREL32.
+ * reloc.c: Add BFD_RELOC_ARM_RELABS32, BFD_RELOC_ARM_ROSEGREL32
+ and BFD_RELOC_ARM_SBREL32.
+ * bfd-in2.h, bbfd.h: Regenerate.
+
2004-08-01 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* elfxx-mips.c (mips_elf_calculate_relocation): Test only for
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 8f5d59b..f2ec29d 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2639,6 +2639,16 @@ field in the instruction. */
BFD_RELOC_ARM_GOTOFF,
BFD_RELOC_ARM_GOTPC,
+/* PC-relative or absolute relocation depending on target. Used for
+entries in .init_array sections. */
+ BFD_RELOC_ARM_RELABS32,
+
+/* Read-only segment base relative address. */
+ BFD_RELOC_ARM_ROSEGREL32,
+
+/* Data segment base relative address. */
+ BFD_RELOC_ARM_SBREL32,
+
/* Renesas / SuperH SH relocs. Not all of these appear in object files. */
BFD_RELOC_SH_PCDISP8BY2,
BFD_RELOC_SH_PCDISP12BY2,
diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c
index e2e34f3..1abe9b1 100644
--- a/bfd/elfarm-nabi.c
+++ b/bfd/elfarm-nabi.c
@@ -188,16 +188,16 @@ static reloc_howto_type elf32_arm_howto_table[] =
HOWTO (R_ARM_SBREL32, /* type */
0, /* rightshift */
- 0, /* size (0 = byte, 1 = short, 2 = long) */
- 0, /* bitsize */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
FALSE, /* pc_relative */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
"R_ARM_SBREL32", /* name */
FALSE, /* partial_inplace */
- 0, /* src_mask */
- 0, /* dst_mask */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
FALSE), /* pcrel_offset */
HOWTO (R_ARM_THM_PC22, /* type */
@@ -557,6 +557,90 @@ static reloc_howto_type elf32_arm_howto_table[] =
0x00000fff, /* src_mask */
0x00000fff, /* dst_mask */
TRUE), /* pcrel_offset */
+
+ HOWTO (R_ARM_LDR_SBREL_11_0, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 12, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_LDR_SBREL_11_0",/* name */
+ FALSE, /* partial_inplace */
+ 0x00000fff, /* src_mask */
+ 0x00000fff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_ARM_ALU_SBREL_19_12, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 12, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ALU_SBREL_19_12",/* name */
+ FALSE, /* partial_inplace */
+ 0x000ff000, /* src_mask */
+ 0x000ff000, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_ARM_ALU_SBREL_27_20, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 8, /* bitsize */
+ FALSE, /* pc_relative */
+ 20, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ALU_SBREL_27_20",/* name */
+ FALSE, /* partial_inplace */
+ 0x0ff00000, /* src_mask */
+ 0x0ff00000, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_ARM_RELABS32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_RELABS32", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_ARM_ROSEGREL32, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_ROSEGREL32", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
+
+ HOWTO (R_ARM_V4BX, /* type */
+ 0, /* rightshift */
+ 2, /* size (0 = byte, 1 = short, 2 = long) */
+ 32, /* bitsize */
+ FALSE, /* pc_relative */
+ 0, /* bitpos */
+ complain_overflow_dont,/* complain_on_overflow */
+ bfd_elf_generic_reloc, /* special_function */
+ "R_ARM_V4BX", /* name */
+ FALSE, /* partial_inplace */
+ 0xffffffff, /* src_mask */
+ 0xffffffff, /* dst_mask */
+ FALSE), /* pcrel_offset */
};
/* GNU extension to record C++ vtable hierarchy */
@@ -689,7 +773,10 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] =
{BFD_RELOC_ARM_GOTOFF, R_ARM_GOTOFF},
{BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC},
{BFD_RELOC_ARM_GOT32, R_ARM_GOT32},
- {BFD_RELOC_ARM_PLT32, R_ARM_PLT32}
+ {BFD_RELOC_ARM_PLT32, R_ARM_PLT32},
+ {BFD_RELOC_ARM_RELABS32, R_ARM_RELABS32},
+ {BFD_RELOC_ARM_ROSEGREL32, R_ARM_ROSEGREL32},
+ {BFD_RELOC_ARM_SBREL32, R_ARM_SBREL32}
};
static reloc_howto_type *
diff --git a/bfd/libbfd.h b/bfd/libbfd.h
index f3bd57a..de3ead6 100644
--- a/bfd/libbfd.h
+++ b/bfd/libbfd.h
@@ -1134,6 +1134,9 @@ static const char *const bfd_reloc_code_real_names[] = { "@@uninitialized@@",
"BFD_RELOC_ARM_RELATIVE",
"BFD_RELOC_ARM_GOTOFF",
"BFD_RELOC_ARM_GOTPC",
+ "BFD_RELOC_ARM_RELABS32",
+ "BFD_RELOC_ARM_ROSEGREL32",
+ "BFD_RELOC_ARM_SBREL32",
"BFD_RELOC_SH_PCDISP8BY2",
"BFD_RELOC_SH_PCDISP12BY2",
"BFD_RELOC_SH_IMM3",
diff --git a/bfd/reloc.c b/bfd/reloc.c
index 74492f0..48166db 100644
--- a/bfd/reloc.c
+++ b/bfd/reloc.c
@@ -2608,6 +2608,19 @@ ENUMX
ENUMDOC
These relocs are only used within the ARM assembler. They are not
(at present) written to any object files.
+ENUM
+ BFD_RELOC_ARM_RELABS32
+ENUMDOC
+ Pc-relative or absolute relocation depending on target. Used for
+ entries in .init_array sections.
+ENUM
+ BFD_RELOC_ARM_ROSEGREL32
+ENUMDOC
+ Read-only segment base relative address.
+ENUM
+ BFD_RELOC_ARM_SBREL32
+ENUMDOC
+ Data segment base relative address.
ENUM
BFD_RELOC_SH_PCDISP8BY2