* elf32-arm.h (USE_REL): Provide a default define of 0.
Use #if rather than #ifdef when testing USE_REL.
* elf32-m32r.c: Likewise.
* elf32-arc.c (USE_REL): Define as 1.
* elf32-d10v.c (USE_REL): Likewise.
* elf32-m32r.c (USE_REL): Likewise.
* elf32-m68hc11.c (USE_REL): Likewise.
* elf32-m68hc12.c (USE_REL): Likewise.
* elf32-or32.c (USE_REL): Likewise.
* elfarm-nabi.c (USE_REL): Likewise.
+2002-10-17 Alan Modra <amodra@bigpond.net.au>
+
+ * elfxx-target.h (USE_REL): Don't define as 1.
+ * elf32-arm.h (USE_REL): Provide a default define of 0.
+ Use #if rather than #ifdef when testing USE_REL.
+ * elf32-m32r.c: Likewise.
+
+ * elf32-arc.c (USE_REL): Define as 1.
+ * elf32-d10v.c (USE_REL): Likewise.
+ * elf32-m32r.c (USE_REL): Likewise.
+ * elf32-m68hc11.c (USE_REL): Likewise.
+ * elf32-m68hc12.c (USE_REL): Likewise.
+ * elf32-or32.c (USE_REL): Likewise.
+ * elfarm-nabi.c (USE_REL): Likewise.
+
2002-10-16 Jakub Jelinek <jakub@redhat.com>
* config.bfd (s390-*-linux*): Add targ64_selvecs.
/* ARC-specific support for 32-bit ELF
- Copyright 1994, 1995, 1997, 1999, 2001 Free Software Foundation, Inc.
+ Copyright 1994, 1995, 1997, 1999, 2001, 2002
+ Free Software Foundation, Inc.
Contributed by Doug Evans (dje@cygnus.com).
This file is part of BFD, the Binary File Descriptor library.
/* Try to minimize the amount of space occupied by relocation tables
on the ROM (not that the ROM won't be swamped by other ELF overhead). */
-#define USE_REL
+#define USE_REL 1
static reloc_howto_type elf_arc_howto_table[] =
{
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+#ifndef USE_REL
+#define USE_REL 0
+#endif
+
typedef unsigned long int insn32;
typedef unsigned short int insn16;
PARAMS ((bfd *, struct bfd_link_info *));
static struct bfd_hash_entry * elf32_arm_link_hash_newfunc
PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *));
-#ifdef USE_REL
+#if USE_REL
static void arm_add_to_rel
PARAMS ((bfd *, bfd_byte *, reloc_howto_type *, bfd_signed_vma));
#endif
local_got_offsets = elf_local_got_offsets (input_bfd);
r_symndx = ELF32_R_SYM (rel->r_info);
-#ifdef USE_REL
+#if USE_REL
addend = bfd_get_32 (input_bfd, hit_data) & howto->src_mask;
if (addend & ((howto->src_mask + 1) >> 1))
case R_ARM_THM_ABS5:
/* Support ldr and str instructions for the thumb. */
-#ifdef USE_REL
+#if USE_REL
/* Need to refetch addend. */
addend = bfd_get_16 (input_bfd, hit_data) & howto->src_mask;
/* ??? Need to determine shift amount from operand size. */
bfd_vma check;
bfd_signed_vma signed_check;
-#ifdef USE_REL
+#if USE_REL
/* Need to refetch the addend and squish the two 11 bit pieces
together. */
{
bfd_signed_vma reloc_signed_min = ~ reloc_signed_max;
bfd_signed_vma signed_check;
-#ifdef USE_REL
+#if USE_REL
/* Need to refetch addend. */
addend = bfd_get_16 (input_bfd, hit_data) & howto->src_mask;
if (addend & ((howto->src_mask + 1) >> 1))
}
}
-#ifdef USE_REL
+#if USE_REL
/* Add INCREMENT to the reloc (of type HOWTO) at ADDRESS. */
static void
arm_add_to_rel (abfd, address, howto, increment)
Elf_Internal_Rela * relend;
const char * name;
-#ifndef USE_REL
+#if !USE_REL
if (info->relocateable)
return true;
#endif
|| r_type == R_ARM_GNU_VTINHERIT)
continue;
-#ifdef USE_REL
+#if USE_REL
elf32_arm_info_to_howto (input_bfd, & bfd_reloc,
(Elf_Internal_Rel *) rel);
#else
#endif
howto = bfd_reloc.howto;
-#ifdef USE_REL
+#if USE_REL
if (info->relocateable)
{
/* This is a relocateable link. We don't have to change
{
sym = local_syms + r_symndx;
sec = local_sections[r_symndx];
-#ifdef USE_REL
+#if USE_REL
relocation = (sec->output_section->vma
+ sec->output_offset
+ sym->st_value);
#define elf_backend_plt_readonly 1
#define elf_backend_want_got_plt 1
#define elf_backend_want_plt_sym 0
-#ifndef USE_REL
+#if !USE_REL
#define elf_backend_rela_normal 1
#endif
asection **));
/* Use REL instead of RELA to save space. */
-#define USE_REL
+#define USE_REL 1
static reloc_howto_type elf_d10v_howto_table[] =
{
This only saves space in libraries and object files, but perhaps
relocs will be put in ROM? All in all though, REL relocs are a pain
to work with. */
-#define USE_REL
+#define USE_REL 1
+
+#ifndef USE_REL
+#define USE_REL 0
+#endif
static reloc_howto_type m32r_elf_howto_table[] =
{
/* Assume success. */
boolean ret = true;
-#ifndef USE_REL
+#if !USE_REL
if (info->relocateable)
return true;
#endif
howto = m32r_elf_howto_table + r_type;
r_symndx = ELF32_R_SYM (rel->r_info);
-#ifdef USE_REL
+#if USE_REL
if (info->relocateable)
{
/* This is a relocateable link. We don't have to change
sym = local_syms + r_symndx;
sec = local_sections[r_symndx];
sym_name = "<local symbol>";
-#ifndef USE_REL
+#if !USE_REL
relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);
addend = rel->r_addend;
#else
will be at least 4 bytes closer if we can relax. It'll actually
be 4 or 8 bytes closer, but we don't know which just yet and
the difference isn't significant enough to worry about. */
-#ifndef USE_REL /* put in for learning purposes */
+#if !USE_REL /* put in for learning purposes */
pcrel_value += irel->r_addend;
#else
addend = bfd_get_signed_16 (abfd, contents + irel->r_offset + 2);
We OR in CODE just in case it's not a nop (technically,
CODE currently must be a nop, but for cleanness we
allow it to be anything). */
-#ifndef USE_REL /* put in for learning purposes */
+#if !USE_REL /* put in for learning purposes */
code = 0x7e000000 | MAKE_PARALLEL (code);
#else
code = (0x7e000000 + (((addend >> 2) & 0xff) << 16)) | MAKE_PARALLEL (code);
else
{
/* Change the seth rN,foo to a bl24 foo. */
-#ifndef USE_REL /* put in for learning purposes */
+#if !USE_REL /* put in for learning purposes */
code = 0xfe000000;
#else
code = 0xfe000000 + ((addend >> 2) & 0xffffff);
#define elf_backend_check_relocs m32r_elf_check_relocs
#define elf_backend_can_gc_sections 1
-#ifndef USE_REL
+#if !USE_REL
#define elf_backend_rela_normal 1
#endif
#if 0 /* not yet */
boolean _bfd_m68hc11_elf_print_private_bfd_data PARAMS ((bfd *, PTR));
/* Use REL instead of RELA to save space */
-#define USE_REL
+#define USE_REL 1
/* The Motorola 68HC11 microcontroler only addresses 64Kb.
We must handle 8 and 16-bit relocations. The 32-bit relocation
/* Use REL instead of RELA to save space */
-#define USE_REL
+#define USE_REL 1
/* The Motorola 68HC11 microcontroler only addresses 64Kb.
We must handle 8 and 16-bit relocations. The 32-bit relocation
/* Try to minimize the amount of space occupied by relocation tables
on the ROM (not that the ROM won't be swamped by other ELF overhead). */
-#define USE_REL
+#define USE_REL 1
static reloc_howto_type elf_or32_howto_table[] =
{
/* 32-bit ELF support for ARM new abi option.
- Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
#define NUM_ELEM(a) (sizeof (a) / (sizeof (a)[0]))
#endif
-#define USE_REL
+#define USE_REL 1
#define TARGET_LITTLE_SYM bfd_elf32_littlearm_vec
#define TARGET_LITTLE_NAME "elf32-littlearm"
For backwards compatibility, we still support this usage. */
#ifndef USE_REL
#define USE_REL 0
-#else
-#undef USE_REL
-#define USE_REL 1
#endif
/* Use these in new code. */