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] [ARC] Disable warning on absolute relocs when symbol is local.


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

commit 9d5c718b7a9c46132940f899f40556a77ca462a0
Author: Cupertino Miranda <cmiranda@synopsys.com>
Date:   Mon Oct 24 12:52:04 2016 +0200

    [ARC] Disable warning on absolute relocs when symbol is local.
    
    R_ARC_32 and R_ARC_32_ME cannot be generated as dynamic relocs.
    However, a warning message and check_relocs was aborting when this type of
    reloc was being resolved to a local symbol.
    This is wrong as local symbols are resolvable at link time.
    
    bfd/ChangeLog:
    
        Cupertino Miranda  <cmiranda@synopsys.com>
    
    	* elf32-arc.c (elf_arc_check_relocs): Added condition to disable
    	warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.

Diff:
---
 bfd/ChangeLog   | 5 +++++
 bfd/elf32-arc.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6d8e9b1..ba36919 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,10 @@
 2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
 
+	* elf32-arc.c (elf_arc_check_relocs): Added condition to disable
+	warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
+
+2017-06-08  Cupertino Miranda  <cmiranda@synopsys.com>
+
 	* elf32-arc.c (ADD_RELA): Changed to only work when dynamic
 	object is created.
 
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 747faf9..8aec9ea 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1938,7 +1938,8 @@ elf_arc_check_relocs (bfd *			 abfd,
 	       and the dynamic linker can not resolve these.  However
 	       the error should not occur for e.g. debugging or
 	       non-readonly sections.  */
-	    if ((bfd_link_dll (info) && !bfd_link_pie (info))
+	    if (h != NULL
+		&& (bfd_link_dll (info) && !bfd_link_pie (info))
 		&& (sec->flags & SEC_ALLOC) != 0
 		&& (sec->flags & SEC_READONLY) != 0
 		&& ((sec->flags & SEC_CODE) != 0


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