This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[PATCH] Fix recently introduced elf64-x86-64.c bug
- From: Jakub Jelinek <jakub at redhat dot com>
- To: binutils at sources dot redhat dot com
- Date: Mon, 9 Aug 2004 08:40:11 +0200
- Subject: [PATCH] Fix recently introduced elf64-x86-64.c bug
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
We want to check the section the relocation is against, not the section
the symbol is in (which is not relevant to it, can be NULL, etc.).
Committed as obvious.
2004-08-09 Jakub Jelinek <jakub@redhat.com>
* elf64-x86-64.c (elf64_x86_64_relocate_section): For -fno-pic
error, test input_section flags rather than sec.
--- bfd/elf64-x86-64.c.jj 2004-07-01 16:28:48.000000000 +0200
+++ bfd/elf64-x86-64.c 2004-08-09 10:52:27.680797679 +0200
@@ -1950,8 +1950,8 @@ elf64_x86_64_relocate_section (bfd *outp
case R_X86_64_PC32:
if (info->shared
&& !SYMBOL_REFERENCES_LOCAL (info, h)
- && (sec->flags & SEC_ALLOC) != 0
- && (sec->flags & SEC_READONLY) != 0)
+ && (input_section->flags & SEC_ALLOC) != 0
+ && (input_section->flags & SEC_READONLY) != 0)
{
(*_bfd_error_handler)
(_("%s: relocation %s against `%s' can not be used when making a shared object; recompile with -fPIC"),
Jakub