This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Fix alpha visibility bug


Hi!

elf/vismain glibc test fails on alpha. The reason for this is that for
int
protlocal (void)
{
  return 0x4;
}
asm (".protected protlocal");
the .protected is output before the actual function and s_alpha_prologue
clears all those bits. If the .protected directive is manually moved to the
end of the file, then on the other side opt relaxing does not work very
well.
This patch should fix it, ok to commit?

2000-11-14  Jakub Jelinek  <jakub@redhat.com>

	* elf64-alpha.c (elf64_alpha_relax_opt_call): Only check bits used
	by STO_ALPHA constants.

	* config/tc-alpha.c (s_alpha_prologue): Preserve visibility bits.

--- bfd/elf64-alpha.c.jj	Thu Oct 19 12:07:54 2000
+++ bfd/elf64-alpha.c	Tue Nov 14 19:21:31 2000
@@ -1304,12 +1304,12 @@ elf64_alpha_relax_opt_call (info, symval
 
   /* If the symbol is marked NOPV, we are being told the function never
      needs its procedure value.  */
-  if (info->other == STO_ALPHA_NOPV)
+  if ((info->other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_NOPV)
     return symval;
 
   /* If the symbol is marked STD_GP, we are being told the function does
      a normal ldgp in the first two words.  */ 
-  else if (info->other == STO_ALPHA_STD_GPLOAD)
+  else if ((info->other & STO_ALPHA_STD_GPLOAD) == STO_ALPHA_STD_GPLOAD)
     ;
 
   /* Otherwise, we may be able to identify a GP load in the first two
--- gas/config/tc-alpha.c.jj	Fri Sep 15 13:11:19 2000
+++ gas/config/tc-alpha.c	Tue Nov 14 19:21:31 2000
@@ -4555,10 +4555,12 @@ s_alpha_prologue (ignore)
   switch (arg)
     {
       case 0: /* No PV required.  */
-	S_SET_OTHER (sym, STO_ALPHA_NOPV);
+	S_SET_OTHER (sym, STO_ALPHA_NOPV
+			  | (S_GET_OTHER (sym) & ~STO_ALPHA_STD_GPLOAD));
 	break;
       case 1: /* Std GP load.  */
-	S_SET_OTHER (sym, STO_ALPHA_STD_GPLOAD);
+	S_SET_OTHER (sym, STO_ALPHA_STD_GPLOAD
+			  | (S_GET_OTHER (sym) & ~STO_ALPHA_STD_GPLOAD));
 	break;
       case 2: /* Non-std use of PV.  */
 	break;

	Jakub

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]