aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorGunther Nikl <gnikl@justmail.de>2020-04-08 12:28:10 +0100
committerNick Clifton <nickc@redhat.com>2020-04-08 12:28:10 +0100
commit9ad4cfa8c35395322230bd7534611d85951645a3 (patch)
treebbae493882eab8048c00153fd43b0ec2e6398f20 /gas
parentd9f1988553be73217c29d48cb8979b82d624b91c (diff)
downloadfsf-binutils-gdb-9ad4cfa8c35395322230bd7534611d85951645a3.zip
fsf-binutils-gdb-9ad4cfa8c35395322230bd7534611d85951645a3.tar.gz
fsf-binutils-gdb-9ad4cfa8c35395322230bd7534611d85951645a3.tar.bz2
[PATCH 4/4]: Add generic prototype for md_pcrel_from_section
This patch removes the need for target headers to provide a custom prototype for md_pcrel_from_section. * tc.h (md_pcrel_from_section): Add prototype. * config/tc-aarch64.h (md_pcrel_from_section): Remove prototype. * config/tc-arc.h (md_pcrel_from_section): Likewise. * config/tc-arm.h (md_pcrel_from_section): Likewise. * config/tc-avr.h (md_pcrel_from_section): Likewise. * config/tc-bfin.h (md_pcrel_from_section): Likewise. * config/tc-bpf.h (md_pcrel_from_section): Likewise. * config/tc-csky.h (md_pcrel_from_section): Likewise. * config/tc-d10v.h (md_pcrel_from_section): Likewise. * config/tc-d30v.h (md_pcrel_from_section): Likewise. * config/tc-epiphany.h (md_pcrel_from_section): Likewise. * config/tc-fr30.h (md_pcrel_from_section): Likewise. * config/tc-frv.h (md_pcrel_from_section): Likewise. * config/tc-iq2000.h (md_pcrel_from_section): Likewise. * config/tc-lm32.h (md_pcrel_from_section): Likewise. * config/tc-m32c.h (md_pcrel_from_section): Likewise. * config/tc-m32r.h (md_pcrel_from_section): Likewise. * config/tc-mcore.h (md_pcrel_from_section): Likewise. * config/tc-mep.h (md_pcrel_from_section): Likewise. * config/tc-metag.h (md_pcrel_from_section): Likewise. * config/tc-microblaze.h (md_pcrel_from_section): Likewise. * config/tc-mmix.h (md_pcrel_from_section): Likewise. * config/tc-moxie.h (md_pcrel_from_section): Likewise. * config/tc-msp430.h (md_pcrel_from_section): Likewise. * config/tc-mt.h (md_pcrel_from_section): Likewise. * config/tc-or1k.h (md_pcrel_from_section): Likewise. * config/tc-ppc.h (md_pcrel_from_section): Likewise. * config/tc-rl78.h (md_pcrel_from_section): Likewise. * config/tc-rx.h (md_pcrel_from_section): Likewise. * config/tc-s390.h (md_pcrel_from_section): Likewise. * config/tc-sh.h (md_pcrel_from_section): Likewise. * config/tc-xc16x.h (md_pcrel_from_section): Likewise. * config/tc-xstormy16.h (md_pcrel_from_section): Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog33
-rw-r--r--gas/config/tc-aarch64.h1
-rw-r--r--gas/config/tc-arc.h1
-rw-r--r--gas/config/tc-arm.h1
-rw-r--r--gas/config/tc-avr.h1
-rw-r--r--gas/config/tc-bfin.h1
-rw-r--r--gas/config/tc-bpf.h1
-rw-r--r--gas/config/tc-csky.h1
-rw-r--r--gas/config/tc-d10v.h4
-rw-r--r--gas/config/tc-d30v.h2
-rw-r--r--gas/config/tc-epiphany.h1
-rw-r--r--gas/config/tc-fr30.h1
-rw-r--r--gas/config/tc-frv.h1
-rw-r--r--gas/config/tc-iq2000.h1
-rw-r--r--gas/config/tc-lm32.h1
-rw-r--r--gas/config/tc-m32c.h1
-rw-r--r--gas/config/tc-m32r.h1
-rw-r--r--gas/config/tc-mcore.h1
-rw-r--r--gas/config/tc-mep.h1
-rw-r--r--gas/config/tc-metag.h1
-rw-r--r--gas/config/tc-microblaze.h2
-rw-r--r--gas/config/tc-mmix.h1
-rw-r--r--gas/config/tc-msp430.h2
-rw-r--r--gas/config/tc-mt.h1
-rw-r--r--gas/config/tc-or1k.h1
-rw-r--r--gas/config/tc-ppc.h1
-rw-r--r--gas/config/tc-rl78.h1
-rw-r--r--gas/config/tc-rx.h1
-rw-r--r--gas/config/tc-s390.h1
-rw-r--r--gas/config/tc-sh.h1
-rw-r--r--gas/config/tc-xc16x.h1
-rw-r--r--gas/config/tc-xstormy16.h1
-rw-r--r--gas/tc.h3
33 files changed, 39 insertions, 34 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 0fb3964..2991823 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -5,6 +5,39 @@
* config/tc-m32c.h (MD_PCREL_FROM_SECTION): Delete duplicate
define.
(md_pcrel_from_section): Remove duplicate prototype.
+ * tc.h (md_pcrel_from_section): Add prototype.
+ * config/tc-aarch64.h (md_pcrel_from_section): Remove prototype.
+ * config/tc-arc.h (md_pcrel_from_section): Likewise.
+ * config/tc-arm.h (md_pcrel_from_section): Likewise.
+ * config/tc-avr.h (md_pcrel_from_section): Likewise.
+ * config/tc-bfin.h (md_pcrel_from_section): Likewise.
+ * config/tc-bpf.h (md_pcrel_from_section): Likewise.
+ * config/tc-csky.h (md_pcrel_from_section): Likewise.
+ * config/tc-d10v.h (md_pcrel_from_section): Likewise.
+ * config/tc-d30v.h (md_pcrel_from_section): Likewise.
+ * config/tc-epiphany.h (md_pcrel_from_section): Likewise.
+ * config/tc-fr30.h (md_pcrel_from_section): Likewise.
+ * config/tc-frv.h (md_pcrel_from_section): Likewise.
+ * config/tc-iq2000.h (md_pcrel_from_section): Likewise.
+ * config/tc-lm32.h (md_pcrel_from_section): Likewise.
+ * config/tc-m32c.h (md_pcrel_from_section): Likewise.
+ * config/tc-m32r.h (md_pcrel_from_section): Likewise.
+ * config/tc-mcore.h (md_pcrel_from_section): Likewise.
+ * config/tc-mep.h (md_pcrel_from_section): Likewise.
+ * config/tc-metag.h (md_pcrel_from_section): Likewise.
+ * config/tc-microblaze.h (md_pcrel_from_section): Likewise.
+ * config/tc-mmix.h (md_pcrel_from_section): Likewise.
+ * config/tc-moxie.h (md_pcrel_from_section): Likewise.
+ * config/tc-msp430.h (md_pcrel_from_section): Likewise.
+ * config/tc-mt.h (md_pcrel_from_section): Likewise.
+ * config/tc-or1k.h (md_pcrel_from_section): Likewise.
+ * config/tc-ppc.h (md_pcrel_from_section): Likewise.
+ * config/tc-rl78.h (md_pcrel_from_section): Likewise.
+ * config/tc-rx.h (md_pcrel_from_section): Likewise.
+ * config/tc-s390.h (md_pcrel_from_section): Likewise.
+ * config/tc-sh.h (md_pcrel_from_section): Likewise.
+ * config/tc-xc16x.h (md_pcrel_from_section): Likewise.
+ * config/tc-xstormy16.h (md_pcrel_from_section): Likewise.
2020-04-07 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/gas/config/tc-aarch64.h b/gas/config/tc-aarch64.h
index e3fd688..fad4da1 100644
--- a/gas/config/tc-aarch64.h
+++ b/gas/config/tc-aarch64.h
@@ -255,7 +255,6 @@ extern void aarch64_after_parse_args (void);
#define MD_PCREL_FROM_SECTION(F,S) md_pcrel_from_section(F,S)
-extern long md_pcrel_from_section (struct fix *, segT);
extern void aarch64_frag_align_code (int, int);
extern const char * elf64_aarch64_target_format (void);
extern int aarch64_force_relocation (struct fix *);
diff --git a/gas/config/tc-arc.h b/gas/config/tc-arc.h
index b8eee4f..2aa61e0 100644
--- a/gas/config/tc-arc.h
+++ b/gas/config/tc-arc.h
@@ -101,7 +101,6 @@ extern const char *arc_target_format;
instruction, plus the address of the PC relative fixup. The latter
can be calculated as fixp->fx_where +
fixp->fx_frag->fr_address. */
-extern long md_pcrel_from_section (struct fix *, segT);
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
/* [ ] is index operator. */
diff --git a/gas/config/tc-arm.h b/gas/config/tc-arm.h
index c01223f..5e32eac 100644
--- a/gas/config/tc-arm.h
+++ b/gas/config/tc-arm.h
@@ -340,7 +340,6 @@ struct arm_segment_info_type
#define MD_PCREL_FROM_SECTION(F,S) md_pcrel_from_section(F,S)
-extern long md_pcrel_from_section (struct fix *, segT);
extern void arm_frag_align_code (int, int);
extern void arm_validate_fix (struct fix *);
extern const char * elf32_arm_target_format (void);
diff --git a/gas/config/tc-avr.h b/gas/config/tc-avr.h
index 1920873..154bf8a 100644
--- a/gas/config/tc-avr.h
+++ b/gas/config/tc-avr.h
@@ -136,7 +136,6 @@ extern int avr_force_relocation (struct fix *);
of a PC relative instruction is the next instruction, so this
macro would return the length of an instruction. */
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
/* The number of bytes to put into a word in a listing. This affects
the way the bytes are clumped together in the listing. For
diff --git a/gas/config/tc-bfin.h b/gas/config/tc-bfin.h
index c4b1507..b9bc06b 100644
--- a/gas/config/tc-bfin.h
+++ b/gas/config/tc-bfin.h
@@ -68,7 +68,6 @@ extern int bfin_force_relocation (struct fix *);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
/* Values passed to md_apply_fix3 don't include symbol values. */
#define MD_APPLY_SYM_VALUE(FIX) 0
diff --git a/gas/config/tc-bpf.h b/gas/config/tc-bpf.h
index 5f50a65..5765833 100644
--- a/gas/config/tc-bpf.h
+++ b/gas/config/tc-bpf.h
@@ -41,7 +41,6 @@
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
/* We don't need to handle .word strangely. */
#define WORKING_DOT_WORD
diff --git a/gas/config/tc-csky.h b/gas/config/tc-csky.h
index f982475..e39e106 100644
--- a/gas/config/tc-csky.h
+++ b/gas/config/tc-csky.h
@@ -91,7 +91,6 @@ struct tls_addend
extern const relax_typeS csky_relax_table [];
extern void md_csky_end (void);
-extern long md_pcrel_from_section (fixS *, segT);
extern void csky_cons_fix_new (fragS *,
unsigned int off,
unsigned int len,
diff --git a/gas/config/tc-d10v.h b/gas/config/tc-d10v.h
index da6dcc7..fcd1674 100644
--- a/gas/config/tc-d10v.h
+++ b/gas/config/tc-d10v.h
@@ -21,6 +21,8 @@
#define TC_D10V
+struct fix;
+
#define TARGET_BYTES_BIG_ENDIAN 1
/* The target BFD architecture. */
@@ -30,8 +32,6 @@
/* Call md_pcrel_from_section, not md_pcrel_from. */
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
-struct fix;
-long md_pcrel_from_section (struct fix *, segT);
/* Permit temporary numeric labels. */
#define LOCAL_LABELS_FB 1
diff --git a/gas/config/tc-d30v.h b/gas/config/tc-d30v.h
index 65a7ec6..0454d44 100644
--- a/gas/config/tc-d30v.h
+++ b/gas/config/tc-d30v.h
@@ -29,8 +29,6 @@
#define md_operand(x)
/* Call md_pcrel_from_section, not md_pcrel_from. */
-struct fix;
-extern long md_pcrel_from_section (struct fix *, segT);
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
/* Permit temporary numeric labels. */
diff --git a/gas/config/tc-epiphany.h b/gas/config/tc-epiphany.h
index 19f5b13..2f6c2cc 100644
--- a/gas/config/tc-epiphany.h
+++ b/gas/config/tc-epiphany.h
@@ -48,7 +48,6 @@
#define tc_fix_adjustable(FIX) epiphany_fix_adjustable (FIX)
extern bfd_boolean epiphany_fix_adjustable (struct fix *);
-extern long md_pcrel_from_section (struct fix *, segT);
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP,SEC)
#define TC_HANDLES_FX_DONE
diff --git a/gas/config/tc-fr30.h b/gas/config/tc-fr30.h
index a633f1e..8169d68 100644
--- a/gas/config/tc-fr30.h
+++ b/gas/config/tc-fr30.h
@@ -50,7 +50,6 @@ extern bfd_boolean fr30_fix_adjustable (struct fix *);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
/* For 8 vs 16 vs 32 bit branch selection. */
#define TC_GENERIC_RELAX_TABLE md_relax_table
diff --git a/gas/config/tc-frv.h b/gas/config/tc-frv.h
index f43376c..444b26b 100644
--- a/gas/config/tc-frv.h
+++ b/gas/config/tc-frv.h
@@ -76,7 +76,6 @@ void frv_frob_label (symbolS *);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
/* After all of the symbols have been adjusted, go over the file looking
for any relocations that pic won't support. */
diff --git a/gas/config/tc-iq2000.h b/gas/config/tc-iq2000.h
index ad098e3..31ed49f 100644
--- a/gas/config/tc-iq2000.h
+++ b/gas/config/tc-iq2000.h
@@ -62,4 +62,3 @@
extern void iq2000_frob_file (void);
extern bfd_boolean iq2000_fix_adjustable (struct fix *);
extern int iq2000_force_relocation (struct fix *);
-extern long md_pcrel_from_section (struct fix *, segT);
diff --git a/gas/config/tc-lm32.h b/gas/config/tc-lm32.h
index a0231c0..930106f 100644
--- a/gas/config/tc-lm32.h
+++ b/gas/config/tc-lm32.h
@@ -40,7 +40,6 @@
#define tc_gen_reloc gas_cgen_tc_gen_reloc
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
-extern long md_pcrel_from_section (struct fix *, segT);
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
extern bfd_boolean lm32_fix_adjustable (struct fix *);
diff --git a/gas/config/tc-m32c.h b/gas/config/tc-m32c.h
index 0e809ae..5be7197 100644
--- a/gas/config/tc-m32c.h
+++ b/gas/config/tc-m32c.h
@@ -67,7 +67,6 @@ extern void m32c_prepare_relax_scan (fragS *, offsetT *, relax_substateT);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
/* We need a special version of the TC_START_LABEL macro so that we
allow the :Z, :S, :Q and :G suffixes to be
diff --git a/gas/config/tc-m32r.h b/gas/config/tc-m32r.h
index d56916b..c123bdc 100644
--- a/gas/config/tc-m32r.h
+++ b/gas/config/tc-m32r.h
@@ -37,7 +37,6 @@ extern const char *m32r_target_format (void);
#endif
/* Call md_pcrel_from_section, not md_pcrel_from. */
-long md_pcrel_from_section (struct fix *, segT);
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section(FIX, SEC)
/* Permit temporary numeric labels. */
diff --git a/gas/config/tc-mcore.h b/gas/config/tc-mcore.h
index 370a319..e4fba15 100644
--- a/gas/config/tc-mcore.h
+++ b/gas/config/tc-mcore.h
@@ -87,7 +87,6 @@ struct mcore_tc_sy
#include "write.h" /* For definition of fixS */
extern void md_mcore_end (void);
-extern long md_pcrel_from_section (fixS *, segT);
extern arelent * tc_gen_reloc (asection *, fixS *);
extern int mcore_force_relocation (fixS *);
extern bfd_boolean mcore_fix_adjustable (fixS *);
diff --git a/gas/config/tc-mep.h b/gas/config/tc-mep.h
index 69535bc..d3eb3d7 100644
--- a/gas/config/tc-mep.h
+++ b/gas/config/tc-mep.h
@@ -53,7 +53,6 @@ extern void mep_apply_fix (struct fix *, valueT *, segT);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
#define tc_frob_file() mep_frob_file ()
extern void mep_frob_file (void);
diff --git a/gas/config/tc-metag.h b/gas/config/tc-metag.h
index 69016fe..27ed167 100644
--- a/gas/config/tc-metag.h
+++ b/gas/config/tc-metag.h
@@ -51,7 +51,6 @@ extern int metag_force_relocation (struct fix *);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
#define HANDLE_ALIGN(fragp) metag_handle_align (fragp)
extern void metag_handle_align (struct frag *);
diff --git a/gas/config/tc-microblaze.h b/gas/config/tc-microblaze.h
index a84e7e4..bc0ca37 100644
--- a/gas/config/tc-microblaze.h
+++ b/gas/config/tc-microblaze.h
@@ -94,7 +94,7 @@ extern const struct relax_type md_relax_table[];
# error No target format specified.
#endif
-#include "write.h" /* For definition of fixS */
+#include "write.h" /* For definition of fixS. */
extern void md_begin (void);
extern void md_assemble (char *);
diff --git a/gas/config/tc-mmix.h b/gas/config/tc-mmix.h
index 2f5cf31..d9e8599 100644
--- a/gas/config/tc-mmix.h
+++ b/gas/config/tc-mmix.h
@@ -168,7 +168,6 @@ extern int mmix_force_relocation (struct fix *);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
#define md_section_align(seg, size) (size)
diff --git a/gas/config/tc-msp430.h b/gas/config/tc-msp430.h
index 50feca4..4fb40ed 100644
--- a/gas/config/tc-msp430.h
+++ b/gas/config/tc-msp430.h
@@ -91,8 +91,6 @@
of a PC relative instruction is the next instruction, so this
macro would return the length of an instruction. */
-extern long md_pcrel_from_section (struct fix *, segT);
-
#define LISTING_WORD_SIZE 2
/* The number of bytes to put into a word in a listing. This affects
the way the bytes are clumped together in the listing. For
diff --git a/gas/config/tc-mt.h b/gas/config/tc-mt.h
index 54c753a..aacb287 100644
--- a/gas/config/tc-mt.h
+++ b/gas/config/tc-mt.h
@@ -48,7 +48,6 @@ extern void mt_apply_fix (struct fix *, valueT *, segT);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
#define obj_fix_adjustable(fixP) iq2000_fix_adjustable (fixP)
extern bfd_boolean mt_fix_adjustable (struct fix *);
diff --git a/gas/config/tc-or1k.h b/gas/config/tc-or1k.h
index 6dce33a..0242dd4 100644
--- a/gas/config/tc-or1k.h
+++ b/gas/config/tc-or1k.h
@@ -50,7 +50,6 @@ extern bfd_boolean or1k_fix_adjustable (struct fix *);
#define tc_fix_adjustable(FIX) or1k_fix_adjustable (FIX)
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
-extern long md_pcrel_from_section (struct fix *, segT);
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
/* For 8 vs 16 vs 32 bit branch selection. */
diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h
index 4df7982..bfe6129 100644
--- a/gas/config/tc-ppc.h
+++ b/gas/config/tc-ppc.h
@@ -297,7 +297,6 @@ extern void ppc_frob_label (symbolS *);
/* call md_pcrel_from_section, not md_pcrel_from */
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section(FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
#define md_parse_name(name, exp, mode, c) ppc_parse_name (name, exp)
extern int ppc_parse_name (const char *, struct expressionS *);
diff --git a/gas/config/tc-rl78.h b/gas/config/tc-rl78.h
index f69458d..d0680ba 100644
--- a/gas/config/tc-rl78.h
+++ b/gas/config/tc-rl78.h
@@ -58,7 +58,6 @@ extern void rl78_frag_init (fragS *);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
/* RL78 doesn't have a 32 bit PCREL relocations. */
#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX, SEG) 1
diff --git a/gas/config/tc-rx.h b/gas/config/tc-rx.h
index 1448c64..0bb25e8 100644
--- a/gas/config/tc-rx.h
+++ b/gas/config/tc-rx.h
@@ -70,7 +70,6 @@ extern void rx_frag_init (fragS *);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section (FIXP, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
/* RX doesn't have a 32 bit PCREL relocations. */
#define TC_FORCE_RELOCATION_SUB_LOCAL(FIX, SEG) 1
diff --git a/gas/config/tc-s390.h b/gas/config/tc-s390.h
index 0f54f5a..d9bc231 100644
--- a/gas/config/tc-s390.h
+++ b/gas/config/tc-s390.h
@@ -75,7 +75,6 @@ extern int target_big_endian;
/* call md_pcrel_from_section, not md_pcrel_from */
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section(FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
#define md_operand(x)
diff --git a/gas/config/tc-sh.h b/gas/config/tc-sh.h
index d7dd764..2526332 100644
--- a/gas/config/tc-sh.h
+++ b/gas/config/tc-sh.h
@@ -87,7 +87,6 @@ extern int sh_force_relocation (struct fix *);
&& sh_relax && SWITCH_TABLE (FIX))
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
/* SH_COUNT relocs are allowed outside of frag.
The target is also buggy and sets fix size too large for other relocs. */
diff --git a/gas/config/tc-xc16x.h b/gas/config/tc-xc16x.h
index 032f47a..c210b6e 100644
--- a/gas/config/tc-xc16x.h
+++ b/gas/config/tc-xc16x.h
@@ -55,6 +55,5 @@ extern void tc_reloc_mangle (struct fix *, struct internal_reloc *, bfd_vma);
#define LISTING_HEADER "Infineon XC16X GAS "
#define NEED_FX_R_TYPE 1
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
#define md_operand(x)
diff --git a/gas/config/tc-xstormy16.h b/gas/config/tc-xstormy16.h
index d08fa90..8d7231b 100644
--- a/gas/config/tc-xstormy16.h
+++ b/gas/config/tc-xstormy16.h
@@ -54,7 +54,6 @@ extern int xstormy16_force_relocation (struct fix *);
/* Call md_pcrel_from_section(), not md_pcrel_from(). */
#define MD_PCREL_FROM_SECTION(FIX, SEC) md_pcrel_from_section (FIX, SEC)
-extern long md_pcrel_from_section (struct fix *, segT);
#define TC_CONS_FIX_NEW xstormy16_cons_fix_new
extern void xstormy16_cons_fix_new (fragS *f, int, int, expressionS *,
diff --git a/gas/tc.h b/gas/tc.h
index 8be65fd..da1738d 100644
--- a/gas/tc.h
+++ b/gas/tc.h
@@ -54,6 +54,9 @@ void md_create_short_jump (char *, addressT, addressT, fragS *, symbolS *);
#ifndef md_pcrel_from
long md_pcrel_from (fixS *);
#endif
+#ifndef md_pcrel_from_section
+long md_pcrel_from_section (fixS *, segT);
+#endif
#ifndef md_operand
void md_operand (expressionS *);
#endif