This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] For COFF and COFF/PE targets, skip relocations against absolute symbols.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=26c62da040fb9d602da269a3bdffdea13a4367c7

commit 26c62da040fb9d602da269a3bdffdea13a4367c7
Author: Leon Winter <winter-gcc@bfw-online.de>
Date:   Wed Mar 9 15:26:45 2016 +0000

    For COFF and COFF/PE targets, skip relocations against absolute symbols.
    
    	PR ld/19623
    	* cofflink.c (_bfd_coff_generic_relocate_section): Do not apply
    	relocations against absolute symbols.

Diff:
---
 bfd/ChangeLog  | 6 ++++++
 bfd/cofflink.c | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index fc63219..d0dfd9b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-09  Leon Winter  <winter-gcc@bfw-online.de>
+
+	PR ld/19623
+	* cofflink.c (_bfd_coff_generic_relocate_section): Do not apply
+	relocations against absolute symbols.
+
 2016-03-09  Alan Modra  <amodra@gmail.com>
 
 	PR binutils/19775
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 7652cc3..4756fc3 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -3007,6 +3007,12 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd,
 	  else
 	    {
 	      sec = sections[symndx];
+
+	      /* PR 19623: Relocations against symbols in
+		 the absolute sections should ignored.  */
+              if (bfd_is_abs_section (sec))
+		continue;
+
               val = (sec->output_section->vma
 		     + sec->output_offset
 		     + sym->n_value);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]