This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] VAX/BFD: Use section flags as the check for text sections
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: binutils at sourceware dot org
- Date: Mon, 7 May 2012 07:19:04 +0100 (BST)
- Subject: [PATCH] VAX/BFD: Use section flags as the check for text sections
Hi,
This is a change to check section flags rather than its name to warn
about unexpected relocations in text sections. No regressions for
vax-linux-gnu. This fixes some unusual formatting too. OK to apply?
2012-05-07 Maciej W. Rozycki <macro@linux-mips.org>
bfd/
* elf32-vax.c (elf_vax_relocate_section)
<R_VAX_8, R_VAX_16, R_VAX_32>: Use section flags rather than
its name as the check for text sections.
Maciej
binutils-vax-text.patch
Index: binutils/bfd/elf32-vax.c
===================================================================
--- binutils.orig/bfd/elf32-vax.c
+++ binutils/bfd/elf32-vax.c
@@ -1691,14 +1691,13 @@ elf_vax_relocate_section (bfd *output_bf
}
}
- if (!strcmp (bfd_get_section_name (input_bfd, input_section),
- ".text") != 0 ||
- (info->shared
- && ELF32_R_TYPE(outrel.r_info) != R_VAX_32
- && ELF32_R_TYPE(outrel.r_info) != R_VAX_RELATIVE
- && ELF32_R_TYPE(outrel.r_info) != R_VAX_COPY
- && ELF32_R_TYPE(outrel.r_info) != R_VAX_JMP_SLOT
- && ELF32_R_TYPE(outrel.r_info) != R_VAX_GLOB_DAT))
+ if ((input_section->flags & SEC_CODE) != 0
+ || (info->shared
+ && ELF32_R_TYPE (outrel.r_info) != R_VAX_32
+ && ELF32_R_TYPE (outrel.r_info) != R_VAX_RELATIVE
+ && ELF32_R_TYPE (outrel.r_info) != R_VAX_COPY
+ && ELF32_R_TYPE (outrel.r_info) != R_VAX_JMP_SLOT
+ && ELF32_R_TYPE (outrel.r_info) != R_VAX_GLOB_DAT))
{
if (h != NULL)
(*_bfd_error_handler)