[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] XFree86 4.2 and gcc 3.1



Hi!
When building XFree86 4.2 with gcc 3.1 (20020207) i get this runtime error:

<---snip--->
XFree86 Version 4.2.0 / X Window System
(protocol Version 11, revision 0, vendor release 6600)
Release Date: 18 January 2002
	If the server is older than 6-12 months, or if your card is
	newer than the above date, look for a newer version before
	reporting problems.  (See http://www.XFree86.Org/)
Build Operating System: Linux 2.4.18-pre7 alpha [ELF] 
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
         (++) from command line, (!!) notice, (II) informational,
         (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/XFree86.0.log", Time: Sat Feb  9 00:59:35 2002
(==) Using config file: "/etc/X11/XF86Config"
Elf_RelocateEntry() Unsupported relocation type 18
Elf_RelocateEntry() Unsupported relocation type 17
Elf_RelocateEntry() Unsupported relocation type 18
[ .... lots of these .... ]
Elf_RelocateEntry() Unsupported relocation type 17
Elf_RelocateEntry() Unsupported relocation type 18
Elf_RelocateEntry() Unsupported relocation type 17

Fatal server error:
Caught signal 11.  Server aborting
<---snip--->

After some investigation I made the following patch:


diff -ur xc-orig/programs/Xserver/hw/xfree86/loader/elfloader.c xc/programs/Xserver/hw/xfree86/loader/elfloader.c
--- xc-orig/programs/Xserver/hw/xfree86/loader/elfloader.c	Mon Jan 14 18:16:52 2002
+++ xc/programs/Xserver/hw/xfree86/loader/elfloader.c	Sat Feb  9 01:26:37 2002
@@ -1113,6 +1113,7 @@
 #if defined(__alpha__)
     unsigned int *dest32h;	/* address of the high 32 bit place being modified */
     unsigned long *dest64;
+    unsigned short *dest16;
 #endif
 #if defined(__ia64__)
     unsigned long *dest64;
@@ -1233,6 +1234,34 @@
 #ifdef ELFDEBUG
 	    ELFDEBUG( "*dest32=%x\n", *dest32 );
 #endif
+	    break;
+	    }
+	case R_ALPHA_GPRELLOW:
+	    {
+	    dest64=(unsigned long *)(secp+rel->r_offset);
+	    dest16=(unsigned short *)dest64;
+
+	    symval += rel->r_addend;
+	    symval = ((unsigned char *)symval)-((unsigned char *)elffile->got);
+
+	    *dest16=symval;
+	    break;
+	    }
+	case R_ALPHA_GPRELHIGH:
+	    {
+	    dest64=(unsigned long *)(secp+rel->r_offset);
+	    dest16=(unsigned short *)dest64;
+
+	    symval += rel->r_addend;
+	    symval = ((unsigned char *)symval)-((unsigned char *)elffile->got);
+	    symval = ((long)symval >> 16) + ((symval >> 15) & 1);
+	    if( (long)symval > 0x7fff ||
+	        (long)symval < -(long)0x8000 ) {
+		FatalError("R_ALPHA_GPRELHIGH symval-got is too large for %s:%lx\n",
+			ElfGetSymbolName(elffile,ELF_R_SYM(rel->r_info)),symval);
+	    }
+
+	    *dest16=symval;
 	    break;
 	    }
 	case R_ALPHA_LITERAL:


Now I can start X and it passed a first cursory test (GeForce2 MX PCI on
a Compaq DS20)

I'd like to have a comment whether this is the right fix before I send this
in to the xfree folks.

Thanks,
Thorsten

-- 
| Thorsten Kranzkowski        Internet: dl8bcu@dl8bcu.de                      |
| Mobile: ++49 170 1876134       Snail: Niemannsweg 30, 49201 Dissen, Germany |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, dl8bcu@marvin.dl8bcu.ampr.org [44.130.8.19] |





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []