aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog15
-rw-r--r--bfd/elf32-arc.c5
-rw-r--r--bfd/elf32-arm.h26
-rw-r--r--bfd/elf32-d10v.c2
-rw-r--r--bfd/elf32-m32r.c20
-rw-r--r--bfd/elf32-m68hc11.c2
-rw-r--r--bfd/elf32-m68hc12.c2
-rw-r--r--bfd/elf32-or32.c2
-rw-r--r--bfd/elfarm-nabi.c4
-rw-r--r--bfd/elfxx-target.h3
10 files changed, 51 insertions, 30 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 4625676..ba10387 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,18 @@
+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.
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index ff5c5f4..fad1a1e 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1,5 +1,6 @@
/* 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.
@@ -39,7 +40,7 @@ static bfd_reloc_status_type arc_elf_b22_pcrel
/* 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[] =
{
diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h
index 9ede796..5901aea 100644
--- a/bfd/elf32-arm.h
+++ b/bfd/elf32-arm.h
@@ -17,6 +17,10 @@
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;
@@ -76,7 +80,7 @@ static boolean elf32_arm_finish_dynamic_sections
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
@@ -1094,7 +1098,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
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))
@@ -1370,7 +1374,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
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. */
@@ -1402,7 +1406,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
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. */
{
@@ -1507,7 +1511,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
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))
@@ -1745,7 +1749,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
}
}
-#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)
@@ -1837,7 +1841,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
Elf_Internal_Rela * relend;
const char * name;
-#ifndef USE_REL
+#if !USE_REL
if (info->relocateable)
return true;
#endif
@@ -1866,7 +1870,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
|| 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
@@ -1874,7 +1878,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
#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
@@ -1907,7 +1911,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section,
{
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);
@@ -3676,7 +3680,7 @@ elf32_arm_reloc_type_class (rela)
#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
diff --git a/bfd/elf32-d10v.c b/bfd/elf32-d10v.c
index 1dec0b0..fe31b92 100644
--- a/bfd/elf32-d10v.c
+++ b/bfd/elf32-d10v.c
@@ -43,7 +43,7 @@ static boolean elf32_d10v_relocate_section
asection **));
/* Use REL instead of RELA to save space. */
-#define USE_REL
+#define USE_REL 1
static reloc_howto_type elf_d10v_howto_table[] =
{
diff --git a/bfd/elf32-m32r.c b/bfd/elf32-m32r.c
index 8adb1e2..7a7d500 100644
--- a/bfd/elf32-m32r.c
+++ b/bfd/elf32-m32r.c
@@ -88,7 +88,11 @@ asection * m32r_elf_gc_mark_hook
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[] =
{
@@ -982,7 +986,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
/* Assume success. */
boolean ret = true;
-#ifndef USE_REL
+#if !USE_REL
if (info->relocateable)
return true;
#endif
@@ -1026,7 +1030,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
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
@@ -1102,7 +1106,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section,
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
@@ -1507,7 +1511,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
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);
@@ -1536,7 +1540,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
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);
@@ -1546,7 +1550,7 @@ m32r_elf_relax_section (abfd, sec, link_info, again)
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);
@@ -2107,7 +2111,7 @@ m32r_elf_check_relocs (abfd, info, sec, relocs)
#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 */
diff --git a/bfd/elf32-m68hc11.c b/bfd/elf32-m68hc11.c
index ae4bb98..9f05a9e 100644
--- a/bfd/elf32-m68hc11.c
+++ b/bfd/elf32-m68hc11.c
@@ -62,7 +62,7 @@ boolean _bfd_m68hc11_elf_set_private_flags PARAMS ((bfd *, flagword));
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
diff --git a/bfd/elf32-m68hc12.c b/bfd/elf32-m68hc12.c
index 9ab8780..ea12e3b 100644
--- a/bfd/elf32-m68hc12.c
+++ b/bfd/elf32-m68hc12.c
@@ -54,7 +54,7 @@ boolean _bfd_m68hc12_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
diff --git a/bfd/elf32-or32.c b/bfd/elf32-or32.c
index a61b09d..39219e9 100644
--- a/bfd/elf32-or32.c
+++ b/bfd/elf32-or32.c
@@ -38,7 +38,7 @@ static bfd_reloc_status_type or32_elf_jumptarg_reloc PARAMS ((bfd *, a
/* 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[] =
{
diff --git a/bfd/elfarm-nabi.c b/bfd/elfarm-nabi.c
index 56c15c0..bd34a14 100644
--- a/bfd/elfarm-nabi.c
+++ b/bfd/elfarm-nabi.c
@@ -1,5 +1,5 @@
/* 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.
@@ -27,7 +27,7 @@
#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"
diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h
index 8da7256..4f5b81c 100644
--- a/bfd/elfxx-target.h
+++ b/bfd/elfxx-target.h
@@ -407,9 +407,6 @@
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. */