+2004-09-13 Paul Brook <paul@codesourcery.com>
+
+ * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
+ prototype.
+ * bfd-in2.h: Regenerate.
+ * libbfd.h: Regenerate.
+ * elf32-arm.h (elf32_arm_link_hash_table): Add target1_is_rel.
+ (elf32_arm_link_hash_table_create): Set target1_is_rel.
+ (bfd_elf32_arm_process_before_allocation): Ditto.
+ (elf32_arm_final_link_relocate): Handle R_ARM_TARGET1.
+ (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto.
+ * elfarm-nabi.c (elf32_arm_howto_table): Rename RELABS to TARGET1.
+ * reloc.c: Ditto.
+
2004-09-10 Joel Brobecker <brobecker@gnat.com>
* hpux-core.c (thread_section_p): New function.
(struct bfd_link_info *);
extern bfd_boolean bfd_elf32_arm_process_before_allocation
- (bfd *, struct bfd_link_info *, int, int);
+ (bfd *, struct bfd_link_info *, int, int, int);
extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
(bfd *, struct bfd_link_info *);
(struct bfd_link_info *);
extern bfd_boolean bfd_elf32_arm_process_before_allocation
- (bfd *, struct bfd_link_info *, int, int);
+ (bfd *, struct bfd_link_info *, int, int, int);
extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
(bfd *, struct bfd_link_info *);
/* Pc-relative or absolute relocation depending on target. Used for
entries in .init_array sections. */
- BFD_RELOC_ARM_RELABS32,
+ BFD_RELOC_ARM_TARGET1,
/* Read-only segment base relative address. */
BFD_RELOC_ARM_ROSEGREL32,
/* Nonzero to output a BE8 image. */
int byteswap_code;
+ /* Zero if R_ARM_TARGET1 means R_ARM_ABS32.
+ Nonzero if R_ARM_TARGET1 means R_ARM_ABS32. */
+ int target1_is_rel;
+
/* The number of bytes in the initial entry in the PLT. */
bfd_size_type plt_header_size;
ret->bfd_of_glue_owner = NULL;
ret->no_pipeline_knowledge = 0;
ret->byteswap_code = 0;
+ ret->target1_is_rel = 0;
#ifdef FOUR_WORD_PLT
ret->plt_header_size = 16;
ret->plt_entry_size = 16;
bfd_elf32_arm_process_before_allocation (bfd *abfd,
struct bfd_link_info *link_info,
int no_pipeline_knowledge,
- int byteswap_code)
+ int byteswap_code,
+ int target1_is_rel)
{
Elf_Internal_Shdr *symtab_hdr;
Elf_Internal_Rela *internal_relocs = NULL;
BFD_ASSERT (globals->bfd_of_glue_owner != NULL);
globals->no_pipeline_knowledge = no_pipeline_knowledge;
+ globals->target1_is_rel = target1_is_rel;
if (byteswap_code && !bfd_big_endian (abfd))
{
_bfd_error_handler (_("%B: BE8 images only valid in big-endian mode."),
bfd_signed_vma signed_addend;
struct elf32_arm_link_hash_table * globals;
+ globals = elf32_arm_hash_table (info);
+
+#ifndef OLD_ARM_ABI
+ /* Some relocation type map to different relocations depending on the
+ target. We pick the right one here. */
+ if (r_type == R_ARM_TARGET1)
+ {
+ if (globals->target1_is_rel)
+ r_type = R_ARM_REL32;
+ else
+ r_type = R_ARM_ABS32;
+
+ howto = &elf32_arm_howto_table[r_type];
+ }
+#endif /* OLD_ARM_ABI */
+
/* If the start address has been set, then set the EF_ARM_HASENTRY
flag. Setting this more than once is redundant, but the cost is
not too high, and it keeps the code simple.
if (bfd_get_start_address (output_bfd) != 0)
elf_elfheader (output_bfd)->e_flags |= EF_ARM_HASENTRY;
- globals = elf32_arm_hash_table (info);
-
dynobj = elf_hash_table (info)->dynobj;
if (dynobj)
{
case R_ARM_ABS32:
case R_ARM_REL32:
+ case R_ARM_TARGET1:
case R_ARM_PC24:
case R_ARM_PLT32:
r_symndx = ELF32_R_SYM (rel->r_info);
h->plt.refcount -= 1;
if (ELF32_R_TYPE (rel->r_info) == R_ARM_ABS32
- || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32)
+ || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32
+ || ELF32_R_TYPE (rel->r_info) == R_ARM_TARGET1)
{
eh = (struct elf32_arm_link_hash_entry *) h;
case R_ARM_ABS32:
case R_ARM_REL32:
+ case R_ARM_TARGET1:
case R_ARM_PC24:
case R_ARM_PLT32:
if (h != NULL)
&& (sec->flags & SEC_ALLOC) != 0
&& ((ELF32_R_TYPE (rel->r_info) != R_ARM_PC24
&& ELF32_R_TYPE (rel->r_info) != R_ARM_PLT32
- && ELF32_R_TYPE (rel->r_info) != R_ARM_REL32)
+ && ELF32_R_TYPE (rel->r_info) != R_ARM_REL32
+ && ELF32_R_TYPE (rel->r_info) != R_ARM_TARGET1)
|| (h != NULL
&& (! info->symbolic
|| (h->elf_link_hash_flags
}
if (ELF32_R_TYPE (rel->r_info) == R_ARM_ABS32
- || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32)
+ || ELF32_R_TYPE (rel->r_info) == R_ARM_REL32
+ || ELF32_R_TYPE (rel->r_info) == R_ARM_TARGET1)
p->count += 1;
}
break;
0x0ff00000, /* dst_mask */
FALSE), /* pcrel_offset */
- HOWTO (R_ARM_RELABS32, /* type */
+ HOWTO (R_ARM_TARGET1, /* type */
0, /* rightshift */
2, /* size (0 = byte, 1 = short, 2 = long) */
32, /* bitsize */
0, /* bitpos */
complain_overflow_dont,/* complain_on_overflow */
bfd_elf_generic_reloc, /* special_function */
- "R_ARM_RELABS32", /* name */
+ "R_ARM_TARGET1", /* name */
FALSE, /* partial_inplace */
0xffffffff, /* src_mask */
0xffffffff, /* dst_mask */
{BFD_RELOC_ARM_GOTPC, R_ARM_GOTPC},
{BFD_RELOC_ARM_GOT32, R_ARM_GOT32},
{BFD_RELOC_ARM_PLT32, R_ARM_PLT32},
- {BFD_RELOC_ARM_RELABS32, R_ARM_RELABS32},
+ {BFD_RELOC_ARM_TARGET1, R_ARM_TARGET1},
{BFD_RELOC_ARM_ROSEGREL32, R_ARM_ROSEGREL32},
{BFD_RELOC_ARM_SBREL32, R_ARM_SBREL32}
};
"BFD_RELOC_ARM_RELATIVE",
"BFD_RELOC_ARM_GOTOFF",
"BFD_RELOC_ARM_GOTPC",
- "BFD_RELOC_ARM_RELABS32",
+ "BFD_RELOC_ARM_TARGET1",
"BFD_RELOC_ARM_ROSEGREL32",
"BFD_RELOC_ARM_SBREL32",
"BFD_RELOC_SH_PCDISP8BY2",
These relocs are only used within the ARM assembler. They are not
(at present) written to any object files.
ENUM
- BFD_RELOC_ARM_RELABS32
+ BFD_RELOC_ARM_TARGET1
ENUMDOC
Pc-relative or absolute relocation depending on target. Used for
entries in .init_array sections.
+2004-09-13 Paul Brook <paul@codesourcery.com>
+
+ * config/tc-arm.c: Rename RELABS to TARGET1.
+
2004-09-13 Alan Modra <amodra@bigpond.net.au>
* messages.c (as_internal_value_out_of_range): Cast values passed
case BFD_RELOC_RVA:
case BFD_RELOC_32:
- case BFD_RELOC_ARM_RELABS32:
+ case BFD_RELOC_ARM_TARGET1:
case BFD_RELOC_ARM_ROSEGREL32:
case BFD_RELOC_ARM_SBREL32:
if (fixP->fx_done || fixP->fx_pcrel)
case BFD_RELOC_ARM_GOT32:
case BFD_RELOC_ARM_GOTOFF:
case BFD_RELOC_ARM_PLT32:
- case BFD_RELOC_ARM_RELABS32:
+ case BFD_RELOC_ARM_TARGET1:
case BFD_RELOC_ARM_ROSEGREL32:
case BFD_RELOC_ARM_SBREL32:
code = fixp->fx_r_type;
/* ScottB: Jan 30, 1998 - Added support for parsing "var(PLT)"
branch instructions generated by GCC for PLT relocs. */
MAP ("(plt)", BFD_RELOC_ARM_PLT32),
- MAP ("(relabs)", BFD_RELOC_ARM_RELABS32),
+ MAP ("(target1)", BFD_RELOC_ARM_TARGET1),
MAP ("(sbrel)", BFD_RELOC_ARM_SBREL32),
{ NULL, 0, BFD_RELOC_UNUSED }
#undef MAP
+2004-09-13 Paul Brook <paul@codesourcery.com>
+
+ * gas/arm/pic.d: Rename RELABS to TARGET1.
+ * gas/arm/pic.s: Ditto.
+
2004-09-03 Tomer Levi <Tomer.Levi@nsc.com>
* gas/crx: New directory.
c: R_ARM_GOT32 sym
10: R_ARM_GOTOFF sym
14: R_ARM_GOTPC _GLOBAL_OFFSET_TABLE_
- 18: R_ARM_RELABS32 foo2
+ 18: R_ARM_TARGET1 foo2
1c: R_ARM_SBREL32 foo3
.word sym(GOTOFF)
1:
.word _GLOBAL_OFFSET_TABLE_ - 1b
- .word foo2(RELABS)
+ .word foo2(TARGET1)
.word foo3(SBREL)
+2004-09-13 Paul Brook <paul@codesourcery.com>
+
+ * elf/arm.h: Rename RELABS to TARGET1.
+
2004-09-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* ansidecl.h (ATTRIBUTE_SENTINEL): Define.
RELOC_NUMBER (R_ARM_LDR_SBREL_11_0, 35)
RELOC_NUMBER (R_ARM_ALU_SBREL_19_12, 36)
RELOC_NUMBER (R_ARM_ALU_SBREL_27_20, 37)
- RELOC_NUMBER (R_ARM_RELABS32, 38)
+ RELOC_NUMBER (R_ARM_TARGET1, 38)
RELOC_NUMBER (R_ARM_ROSEGREL32, 39)
RELOC_NUMBER (R_ARM_V4BX, 40)
RELOC_NUMBER (R_ARM_STKCHK, 41)
+2004-09-13 Paul Brook <paul@codesourcery.com>
+
+ * emulparams/armsymbian.sh: Set TARGET1_IS_REL.
+ * emultempl/armelf.em: Use TARGET1_IS_REL. Add --target1-{rel,abs}.
+
2004-09-07 H.J. Lu <hongjiu.lu@intel.com>
* configure: Regenerated with autconfig 2.13.
OUTPUT_FORMAT="elf32-littlearm-symbian"
BIG_OUTPUT_FORMAT="elf32-bigarm-symbian"
LITTLE_OUTPUT_FORMAT="$OUTPUT_FORMAT"
+TARGET1_IS_REL=1
# This value should match ELF_MAXPAGESIZE in BFD. Otherwise, elf.c
# will not place read-write sections in a separate ELF segment from
static char *thumb_entry_symbol = NULL;
static bfd *bfd_for_interwork;
static int byteswap_code = 0;
+static int target1_is_rel = 0${TARGET1_IS_REL};
static void
gld${EMULATION_NAME}_before_parse (void)
{
if (!bfd_elf32_arm_process_before_allocation (is->the_bfd, & link_info,
no_pipeline_knowledge,
- byteswap_code))
+ byteswap_code,
+ target1_is_rel))
{
/* xgettext:c-format */
einfo (_("Errors encountered processing file %s"), is->filename);
PARSE_AND_LIST_PROLOGUE='
#define OPTION_THUMB_ENTRY 301
#define OPTION_BE8 302
+#define OPTION_TARGET1_REL 303
+#define OPTION_TARGET1_ABS 304
'
PARSE_AND_LIST_SHORTOPTS=p
{ "no-pipeline-knowledge", no_argument, NULL, '\'p\''},
{ "thumb-entry", required_argument, NULL, OPTION_THUMB_ENTRY},
{ "be8", no_argument, NULL, OPTION_BE8},
+ { "target1-rel", no_argument, NULL, OPTION_TARGET1_REL},
+ { "target1-abs", no_argument, NULL, OPTION_TARGET1_ABS},
'
PARSE_AND_LIST_OPTIONS='
fprintf (file, _(" -p --no-pipeline-knowledge Stop the linker knowing about the pipeline length\n"));
fprintf (file, _(" --thumb-entry=<sym> Set the entry point to be Thumb symbol <sym>\n"));
fprintf (file, _(" --be8 Oputput BE8 format image\n"));
+ fprintf (file, _(" --target1-rel Interpret R_ARM_TARGET1 as R_ARM_REL32\n"));
+ fprintf (file, _(" --target1-abs Interpret R_ARM_TARGET1 as R_ARM_ABS32\n"));
'
PARSE_AND_LIST_ARGS_CASES='
case OPTION_BE8:
byteswap_code = 1;
break;
+
+ case OPTION_TARGET1_REL:
+ target1_is_rel = 1;
+ break;
+
+ case OPTION_TARGET1_ABS:
+ target1_is_rel = 0;
+ break;
'
# We have our own after_open and before_allocation functions, but they call