xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Sun Mar 2 11:59:32 PST 2008


 src/r128_driver.c |    8 +++-----
 src/r128_probe.c  |    2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit a4fafa97b31bb7da01dd92236b42a418ca482992
Author: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
Date:   Sun Mar 2 14:59:30 2008 -0500

    [PATCH] Avoid usage of LoaderSymbol.
    
    It can be dangerous. This patch is based on the previous one when r128
    was in xf86-video-ati. The problem is that if gR128EntityIndex is not
    explicitly marked as a public symbol, and weird things may happen when
    compiling with hidden symbols.
    Since the symbol is in the same shared binary of its callers, just use
    it, instead of using LoaderSymbol. Could also just replace calls
    getR128EntityIndex() to direct access to gR128EntityIndex.

diff --git a/src/r128_driver.c b/src/r128_driver.c
index 0e693e0..2eb9d26 100644
--- a/src/r128_driver.c
+++ b/src/r128_driver.c
@@ -192,13 +192,11 @@ R128RAMRec R128RAM[] = {        /* Memory Specifications
     { 4, 4, 3, 3, 2, 3, 1, 16, 12, "64-bit DDR SGRAM" },
 };
 
+extern _X_EXPORT int gR128EntityIndex;
+
 int getR128EntityIndex(void)
 {
-    int *r128_entity_index = LoaderSymbol("gR128EntityIndex");
-    if (!r128_entity_index)
-        return -1;
-    else
-        return *r128_entity_index;
+    return gR128EntityIndex;
 }
 
 R128EntPtr R128EntPriv(ScrnInfoPtr pScrn)
diff --git a/src/r128_probe.c b/src/r128_probe.c
index b1f427a..bfec1eb 100644
--- a/src/r128_probe.c
+++ b/src/r128_probe.c
@@ -208,7 +208,7 @@ static const struct pci_id_match r128_device_match[] = {
 
 #endif /* XSERVER_LIBPCIACCESS */
 
-int gR128EntityIndex = -1;
+_X_EXPORT int gR128EntityIndex = -1;
 
 /* Return the options for supported chipset 'n'; NULL otherwise */
 static const OptionInfoRec *


More information about the xorg-commit mailing list