From 8fb8824599f37a726685197a1728e92bc7a953e5 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Mon, 26 Apr 2021 10:39:45 +0200 Subject: [PATCH] x86: add IS_ELF to check whether to resolve @size reloc This may not be strictly needed, as BFD_RELOC_SIZE* shouldn't appear from elsewhere for non-ELF, but let's be on the safe side. --- gas/ChangeLog | 5 +++++ gas/config/tc-i386.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 93b3fa67276..03ba1964176 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2021-04-26 Jan Beulich + + * config/tc-i386.c (tc_gen_reloc): Check IS_ELF for + BFD_RELOC_SIZE*. + 2021-04-26 Jan Beulich * config/tc-i386.c (tc_gen_reloc): Limit BFD_RELOC_SIZE32 diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 147c8204b60..99f990464cd 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -14205,7 +14205,8 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED, fixS *fixp) #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF) case BFD_RELOC_SIZE32: case BFD_RELOC_SIZE64: - if (S_IS_DEFINED (fixp->fx_addsy) + if (IS_ELF + && S_IS_DEFINED (fixp->fx_addsy) && !S_IS_EXTERNAL (fixp->fx_addsy)) { /* Resolve size relocation against local symbol to size of -- 2.30.2