aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 52f4d33..af16da3 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -3714,10 +3714,10 @@ elf_i386_relocate_section (bfd *output_bfd,
/* Relocation is relative to the start of the global offset
table. */
- /* Check to make sure it isn't a protected function symbol
- for shared library since it may not be local when used
- as function address. We also need to make sure that a
- symbol is defined locally. */
+ /* Check to make sure it isn't a protected function or data
+ symbol for shared library since it may not be local when
+ used as function address or with copy relocation. We also
+ need to make sure that a symbol is defined locally. */
if (info->shared && h)
{
if (!h->def_regular)
@@ -3748,12 +3748,15 @@ elf_i386_relocate_section (bfd *output_bfd,
}
else if (!info->executable
&& !SYMBOLIC_BIND (info, h)
- && h->type == STT_FUNC
+ && (h->type == STT_FUNC
+ || h->type == STT_OBJECT)
&& ELF_ST_VISIBILITY (h->other) == STV_PROTECTED)
{
(*_bfd_error_handler)
- (_("%B: relocation R_386_GOTOFF against protected function `%s' can not be used when making a shared object"),
- input_bfd, h->root.root.string);
+ (_("%B: relocation R_386_GOTOFF against protected %s `%s' can not be used when making a shared object"),
+ input_bfd,
+ h->type == STT_FUNC ? "function" : "data",
+ h->root.root.string);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}