This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 2/9] [ARC] Disable warning on absolute relocs when symbol is local.
- From: Cupertino Miranda <Cupertino dot Miranda at synopsys dot com>
- To: binutils at sourceware dot org
- Cc: Cupertino dot Miranda at synopsys dot com, Claudiu dot Zissulescu at synopsys dot com, Francois dot Bedard at synopsys dot com
- Date: Tue, 23 May 2017 17:40:49 +0200
- Subject: [PATCH 2/9] [ARC] Disable warning on absolute relocs when symbol is local.
- Authentication-results: sourceware.org; auth=none
- References: <20170523154056.19234-1-cmiranda@synopsys.com>
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.
---
bfd/elf32-arc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/bfd/elf32-arc.c b/bfd/elf32-arc.c
index 33166f2..fd17128 100644
--- a/bfd/elf32-arc.c
+++ b/bfd/elf32-arc.c
@@ -1934,7 +1934,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
--
2.9.0