public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Really hide millicode syms
@ 2001-05-17  4:23 amodra
  0 siblings, 0 replies; only message in thread
From: amodra @ 2001-05-17  4:23 UTC (permalink / raw)
  To: binutils

A change to elf32_hppa_hide_symbol meant that clobber_millicode_symbols
wasn't doing its job to prevent millicode from being exported from
shared libs.  Among other things, this resulted in stubs trying to
load from .plt - 1, which bombs with an unaligned access.

	* elf32-hppa.c (clobber_millicode_symbols): Temporarily set
	ELF_LINK_FORCED_LOCAL to suit 2001-04-30 change.
	(hppa_build_one_stub): Add an assert to check plt.offset.

-- 
Alan Modra

Index: bfd/elf32-hppa.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-hppa.c,v
retrieving revision 1.32
diff -u -p -r1.32 elf32-hppa.c
--- elf32-hppa.c	2001/04/30 16:13:26	1.32
+++ elf32-hppa.c	2001/05/17 11:02:14
@@ -938,6 +938,7 @@ hppa_build_one_stub (gen_entry, in_arg)
 
     case hppa_stub_import:
     case hppa_stub_import_shared:
+      BFD_ASSERT (stub_entry->h->elf.plt.offset < (bfd_vma) -2);
       sym_value = (stub_entry->h->elf.plt.offset
 		   + hplink->splt->output_offset
 		   + hplink->splt->output_section->vma
@@ -2147,7 +2148,13 @@ clobber_millicode_symbols (h, info)
   /* Note!  We only want to remove these from the dynamic symbol
      table.  Therefore we do not set ELF_LINK_FORCED_LOCAL.  */
   if (h->type == STT_PARISC_MILLI)
-    elf32_hppa_hide_symbol (info, h);
+    {
+      unsigned short oldflags = h->elf_link_hash_flags;
+      h->elf_link_hash_flags |= ELF_LINK_FORCED_LOCAL;
+      elf32_hppa_hide_symbol (info, h);
+      h->elf_link_hash_flags &= ~ELF_LINK_FORCED_LOCAL;
+      h->elf_link_hash_flags |= oldflags & ELF_LINK_FORCED_LOCAL;
+    }
   return true;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-05-17  4:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-17  4:23 Really hide millicode syms amodra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).