aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2014-05-19 14:29:31 +0100
committerNick Clifton <nickc@redhat.com>2014-05-19 14:29:31 +0100
commit296a868924f2c47865676a04515135b03c024bcc (patch)
tree212bae25953eaf21a3e8d5a12cd14dfc5073fd82 /gas
parentfb2c6e43b8699da2057e9e33fda09007f112393a (diff)
downloadfsf-binutils-gdb-296a868924f2c47865676a04515135b03c024bcc.zip
fsf-binutils-gdb-296a868924f2c47865676a04515135b03c024bcc.tar.gz
fsf-binutils-gdb-296a868924f2c47865676a04515135b03c024bcc.tar.bz2
Extend the fix already created for PR 16858 so that it works with x86 PE targets as well.
PR gas/16858 * config/tc-i386.c (md_apply_fix): Improve the detection of code symbols for 32-bit PE targets.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-i386.c10
2 files changed, 16 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2243570..26cef7f 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2014-05-19 Nick Clifton <nickc@redhat.com>
+
+ PR gas/16858
+ * config/tc-i386.c (md_apply_fix): Improve the detection of code
+ symbols for 32-bit PE targets.
+
2014-05-18 Richard Sandiford <rdsandiford@googlemail.com>
* config/tc-mips.c (md_obj_begin): Delete.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 707ce59..341d100 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -9151,6 +9151,16 @@ md_apply_fix (fixS *fixP, valueT *valP, segT seg ATTRIBUTE_UNUSED)
/* PR 16858: Do not modify weak function references. */
&& ! fixP->fx_pcrel)
{
+#if !defined (TE_PEP)
+ /* For x86 PE weak function symbols are neither PC-relative
+ nor do they set S_IS_FUNCTION. So the only reliable way
+ to detect them is to check the flags of their containing
+ section. */
+ if (S_GET_SEGMENT (fixP->fx_addsy) != NULL
+ && S_GET_SEGMENT (fixP->fx_addsy)->flags & SEC_CODE)
+ ;
+ else
+#endif
value -= S_GET_VALUE (fixP->fx_addsy);
}
#endif