[patch] PIC support in Hermes

This patch is split in three parts:

  • 000_nasm_include.diff: add -I$(srcdir)/ to the nasm flags so that
    we can include files from asm files.

  • 004_propagate_pic_to_nasm.diff: fix strip_fPIC.sh so that it does
    not strip -DPIC, which is actually useful for nasm.

  • 013_hermes_pic_support.diff: fix the Hermes assembly code so that it
    generates Position-Independent Code when -DPIC is used.

I do not know what the stance of the developers about PIC is, because
there is a slight performance hit on x86, but I believe it is negligible
in the present case. Some x86 systems (such as BeOS and OS X AFAIK)
require shared libraries to be PIC. Others such as Linux can cope
with non-PIC dynamic objects, but then they are not mapped on shared
segments.

I have also had great trouble testing all these MMX and x86 routines,
is there a program somewhere that tests all of them?

Regards,–
Sam.
-------------- next part --------------
— SDL-1.2.9.patched/src/hermes/Makefile.am 2003-10-06 09:13:16 +0200
+++ SDL-1.2.9/src/hermes/Makefile.am 2006-03-01 14:00:50 +0100
@@ -7,7 +7,7 @@
SUFFIXES = .asm

.asm.lo:

  • $(LIBTOOL) --tag=CC --mode=compile $(STRIP_FPIC) $(NASM) @NASMFLAGS@ $< -o $*.o
  • $(LIBTOOL) --tag=CC --mode=compile $(STRIP_FPIC) $(NASM) -I$(srcdir)/ @NASMFLAGS@ $< -o $*.o

###########################################################################

-------------- next part --------------
— SDL-1.2.9.patched/strip_fPIC.sh 2001-05-10 22:19:50 +0200
+++ SDL-1.2.9/strip_fPIC.sh 2006-03-01 13:48:03 +0100
@@ -5,8 +5,8 @@
command=""
while [ $# -gt 0 ]; do
case “$1” in

  •    -?PIC)
    
  •        # Ignore -fPIC and -DPIC options
    
  •    -fPIC)
    
  •        # Ignore -fPIC option
           ;;
       *)
           command="$command $1"
    

-------------- next part --------------
diff -puriN SDL-1.2.9.orig/src/hermes/common.asm SDL-1.2.9/src/hermes/common.asm
— SDL-1.2.9.orig/src/hermes/common.asm 1970-01-01 01:00:00.000000000 +0100
+++ SDL-1.2.9/src/hermes/common.asm 2006-03-01 16:24:45.000000000 +0100
@@ -0,0 +1,84 @@
+;
+; PIC support for HERMES
+; Copyright © 2006 Sam Hocevar
+; This source code is licensed under the GNU LGPL
+;
+; Please refer to the file COPYING.LIB contained in the distribution for
+; licensing conditions
+
+
+; These macros are totally harmless when PIC is not defined but can ruin
+; everything if misused in PIC mode. On x86, shared objects cannot directly
+; access global variables by address, they need to go through the GOT (global
+; offset table). Most OSes do not care about it and let you load non-shared
+; .so objects (Linux, Win32…). However, OS X requires PIC code in its
+; .dylib objects.
+;
+; - GOT_* should be used as a suffix for global addressing, eg.
+; mov eax, [foo GOT_ebx]
+; instead of
+; mov eax, [foo]
+;
+; - picgetgot computes the GOT address into the given register in PIC
+; mode, otherwise does nothing. You need to do this before using GLOBAL.
+;
+; - picpush and picpop respectively push and pop the given register
+; in PIC mode, otherwise do nothing. You should always use them around
+; picgetgot except when sure that the register is no longer used and is
+; being restored later by other means.
+;
+; - picesp is defined to compensate the changing of esp when pushing
+; a register into the stack, eg.
+; mov eax, [esp + 8]
+; pushpic ebx
+; mov eax, [picesp + 12]
+; instead of
+; mov eax, [esp + 8]
+; pushpic ebx
+; mov eax, [esp + 12]
+;
+; - picjmp jumps to a global address:
+; picgetgot ebx
+; picjmp ebx, far_address
+; instead of
+; jmp far_address
+;
+%ifdef PIC

  • EXTERN GLOBAL_OFFSET_TABLE
  • %define GOT_eax + eax wrt …gotoff
  • %define GOT_ebx + ebx wrt …gotoff
  • %define GOT_ecx + ecx wrt …gotoff
  • %define GOT_edx + edx wrt …gotoff
  • %macro picgetgot 1
  •   call %%getgot
    
  •   %%getgot:
    
  •   pop %1
    
  •   add %1, _GLOBAL_OFFSET_TABLE_ + $$ - %%getgot wrt ..gotpc
    
  • %endmacro
  • %macro picpush 1
  •   push %1
    
  • %endmacro
  • %macro picpop 1
  •   pop %1
    
  • %endmacro
  • %define picesp esp+4
  • %macro picjmp 2
  •   jmp [%2 + %1 wrt ..got]
    
  • %endmacro
    +%else
  • %define GOT_eax
  • %define GOT_ebx
  • %define GOT_ecx
  • %define GOT_edx
  • %macro picgetgot 1
  • %endmacro
  • %macro picpush 1
  • %endmacro
  • %macro picpop 1
  • %endmacro
  • %define picesp esp
  • %macro picjmp 2
  •   jmp %2
    
  • %endmacro
    +%endif

diff -puriN SDL-1.2.9.orig/src/hermes/mmxp2_32.asm SDL-1.2.9/src/hermes/mmxp2_32.asm
— SDL-1.2.9.orig/src/hermes/mmxp2_32.asm 2006-03-01 14:30:22.000000000 +0100
+++ SDL-1.2.9/src/hermes/mmxp2_32.asm 2006-03-01 16:24:45.000000000 +0100
@@ -18,6 +18,8 @@
; are, they’re terrible on p5 MMXs, but less so on pIIs. Someone needs to
; optimise them for p5 MMXs…

+%include “common.asm”
+
BITS 32

@@ -50,8 +52,9 @@ mmx32_bgr555_mul dd 00082000h,00082000h

_ConvertMMXpII32_24RGB888:

  •    picgetgot edx ; edx is not used yet
       ; set up mm6 as the mask, mm7 as zero
    
  •    movq mm6, qword [mmx32_rgb888_mask]
    
  •    movq mm6, qword [mmx32_rgb888_mask GOT_edx]
       pxor mm7, mm7
    
       mov edx, ecx                    ; save ecx
    

@@ -108,16 +112,18 @@ _ConvertMMXpII32_24RGB888:
dec ecx
jnz .L3
.L4:

  •    jmp _mmxreturn
    
  •    picgetgot ecx
    
  •    picjmp ecx, _mmxreturn
    

_ConvertMMXpII32_16RGB565:

  •    picgetgot edx ; edx is not used yet
       ; set up masks
    
  •    movq mm5, [mmx32_rgb565_b]
    
  •    movq mm6, [mmx32_rgb565_g]
    
  •    movq mm7, [mmx32_rgb565_r]
    
  •    movq mm5, [mmx32_rgb565_b GOT_edx]
    
  •    movq mm6, [mmx32_rgb565_g GOT_edx]
    
  •    movq mm7, [mmx32_rgb565_r GOT_edx]
    
       mov edx, ecx
       shr ecx, 2
    

@@ -176,14 +182,16 @@ _ConvertMMXpII32_16RGB565:
jnz .L3

.L4:

  • jmp _mmxreturn
  • picgetgot ecx
  • picjmp ecx, _mmxreturn

_ConvertMMXpII32_16BGR565:

  •    movq mm5, [mmx32_rgb565_r]
    
  •    movq mm6, [mmx32_rgb565_g]
    
  •    movq mm7, [mmx32_rgb565_b]
    
  •    picgetgot edx ; edx is not used yet
    
  •    movq mm5, [mmx32_rgb565_r GOT_edx]
    
  •    movq mm6, [mmx32_rgb565_g GOT_edx]
    
  •    movq mm7, [mmx32_rgb565_b GOT_edx]
    
       mov edx, ecx
       shr ecx, 2
    

@@ -245,7 +253,8 @@ _ConvertMMXpII32_16BGR565:
jnz .L3

.L4:

  •    jmp _mmxreturn
    
  •    picgetgot ecx
    
  •    picjmp ecx, _mmxreturn
    

_ConvertMMXpII32_16BGR555:

@@ -253,7 +262,8 @@ _ConvertMMXpII32_16BGR555:
; except it uses a different multiplier for the pmaddwd
; instruction. cool huh.

  •    movq mm7, qword [mmx32_bgr555_mul]
    
  •    picgetgot ebx ; ebx is not used yet
    
  •    movq mm7, qword [mmx32_bgr555_mul GOT_ebx]
       jmp _convert_bgr555_cheat
    

; This is the same as the Intel version… they obviously went to
@@ -263,9 +273,10 @@ _ConvertMMXpII32_16BGR555:
; (I think) a more accurate name…
_ConvertMMXpII32_16RGB555:

  •    movq mm7,qword [mmx32_rgb555_mul]
    
  •    picgetgot ebx ; ebx is not used yet
    
  •    movq mm7,qword [mmx32_rgb555_mul GOT_ebx]
    

_convert_bgr555_cheat:

  •    movq mm6,qword [mmx32_rgb555_g]
    
  •    movq mm6,qword [mmx32_rgb555_g GOT_ebx]
    

    mov edx,ecx ; Save ecx

@@ -280,10 +291,10 @@ _convert_bgr555_cheat:
movq mm0,[esi]
movq mm3,mm2

  • pand mm3,qword [mmx32_rgb555_rb]
  • pand mm3,qword [mmx32_rgb555_rb GOT_ebx]
    movq mm1,mm0
  • pand mm1,qword [mmx32_rgb555_rb]
  • pand mm1,qword [mmx32_rgb555_rb GOT_ebx]
    pmaddwd mm3,mm7

    pmaddwd mm1,mm7
    @@ -302,13 +313,13 @@ _convert_bgr555_cheat:
    movq mm0,mm4
    psrld mm1,6

  • pand mm0,qword [mmx32_rgb555_rb]
  • pand mm0,qword [mmx32_rgb555_rb GOT_ebx]
    packssdw mm1,mm3

    movq mm3,mm5
    pmaddwd mm0,mm7

  • pand mm3,qword [mmx32_rgb555_rb]
  • pand mm3,qword [mmx32_rgb555_rb GOT_ebx]
    pand mm4,mm6

    movq [edi],mm1
    @@ -329,10 +340,10 @@ _convert_bgr555_cheat:
    movq mm3,mm2
    movq mm1,mm0

  • pand mm3,qword [mmx32_rgb555_rb]
  • pand mm3,qword [mmx32_rgb555_rb GOT_ebx]
    packssdw mm5,mm4
  • pand mm1,qword [mmx32_rgb555_rb]
  • pand mm1,qword [mmx32_rgb555_rb GOT_ebx]
    pand mm2,mm6

    movq [edi+8],mm5
    @@ -380,7 +391,8 @@ _convert_bgr555_cheat:
    jnz .L3

.L4:

  • jmp _mmxreturn
  • picgetgot ecx
  • picjmp ecx, _mmxreturn

SECTION .note.GNU-stack
diff -puriN SDL-1.2.9.orig/src/hermes/x86_main.asm SDL-1.2.9/src/hermes/x86_main.asm
— SDL-1.2.9.orig/src/hermes/x86_main.asm 2006-03-01 14:12:59.000000000 +0100
+++ SDL-1.2.9/src/hermes/x86_main.asm 2006-03-01 16:28:44.000000000 +0100
@@ -9,6 +9,8 @@
; Most routines are © Glenn Fiedler (ptc at gaffer.org), used with permission
;

+%include “common.asm”
+
BITS 32

GLOBAL _ConvertX86
@@ -17,11 +19,6 @@ GLOBAL _x86return
GLOBAL _Hermes_X86_CPU

-SECTION .data

-cpu_flags dd 0

SECTION .text

;; _ConvertX86:
@@ -110,16 +107,18 @@ _Hermes_X86_CPU:
xor eax,ecx
je .L1

  • pusha
  • push ebx

  • push ecx

  • push edx

    mov eax,1
    cpuid

  • mov [cpu_flags],edx
  • popa
  • mov eax,edx
  • mov eax,[cpu_flags]
  • pop edx
  • pop ecx
  • pop ebx

.L1:
ret
diff -puriN SDL-1.2.9.orig/src/hermes/x86p_16.asm SDL-1.2.9/src/hermes/x86p_16.asm
— SDL-1.2.9.orig/src/hermes/x86p_16.asm 2006-03-01 14:12:59.000000000 +0100
+++ SDL-1.2.9/src/hermes/x86p_16.asm 2006-03-01 16:24:45.000000000 +0100
@@ -10,7 +10,8 @@
; Used with permission.
;

+%include “common.asm”
+
BITS 32

GLOBAL _ConvertX86p16_32RGB888
@@ -57,7 +58,8 @@ _ConvertX86p16_16BGR565:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; head
mov eax,edi
@@ -135,7 +137,8 @@ _ConvertX86p16_16BGR565:
add edi,BYTE 2

.L7

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -164,7 +167,8 @@ _ConvertX86p16_16RGB555:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; head
mov eax,edi
@@ -243,7 +247,8 @@ _ConvertX86p16_16RGB555:
jmp SHORT .L6

.L7 pop ebp

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -277,7 +282,8 @@ _ConvertX86p16_16BGR555:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; head
mov eax,edi
@@ -361,7 +367,8 @@ _ConvertX86p16_16BGR555:
add edi,BYTE 2

.L7

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -394,7 +401,8 @@ _ConvertX86p16_8RGB332:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 mov eax,edi
and eax,BYTE 11b
@@ -492,6 +500,7 @@ _ConvertX86p16_8RGB332:
jnz .L6

.L7 pop ebp

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

SECTION .note.GNU-stack
diff -puriN SDL-1.2.9.orig/src/hermes/x86p_32.asm SDL-1.2.9/src/hermes/x86p_32.asm
— SDL-1.2.9.orig/src/hermes/x86p_32.asm 2006-03-01 14:12:59.000000000 +0100
+++ SDL-1.2.9/src/hermes/x86p_32.asm 2006-03-01 16:24:45.000000000 +0100
@@ -9,6 +9,7 @@
; Most routines are © Glenn Fiedler (ptc at gaffer.org), used with permission
;

+%include “common.asm”

BITS 32

@@ -53,7 +54,8 @@ _ConvertX86p32_32BGR888:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; save ebp
push ebp
@@ -113,7 +115,8 @@ _ConvertX86p32_32BGR888:
jnz .L5

.L6 pop ebp

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -133,7 +136,8 @@ _ConvertX86p32_32RGBA888:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; save ebp
push ebp
@@ -184,7 +188,8 @@ _ConvertX86p32_32RGBA888:
jnz .L5

.L6 pop ebp

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -204,7 +209,8 @@ _ConvertX86p32_32BGRA888:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; save ebp
push ebp
@@ -257,7 +263,8 @@ _ConvertX86p32_32BGRA888:
jnz .L5

.L6 pop ebp

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -282,7 +289,8 @@ _ConvertX86p32_24RGB888:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; head
mov edx,edi
@@ -354,7 +362,8 @@ _ConvertX86p32_24RGB888:
jnz .L6

.L7 pop ebp

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -380,7 +389,8 @@ _ConvertX86p32_24BGR888:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; head
mov edx,edi
@@ -455,7 +465,8 @@ _ConvertX86p32_24BGR888:

.L7
pop ebp

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -484,7 +495,8 @@ _ConvertX86p32_16RGB565:
jnz .L1

.L2: ; End of short loop

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; head
@@ -570,7 +582,8 @@ _ConvertX86p32_16RGB565:
add edi,BYTE 2

.L7:

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -599,7 +612,8 @@ _ConvertX86p32_16BGR565:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; head
mov ebx,edi
@@ -684,7 +698,8 @@ _ConvertX86p32_16BGR565:
add edi,BYTE 2

.L7

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -713,7 +728,8 @@ _ConvertX86p32_16RGB555:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; head
mov ebx,edi
@@ -795,7 +811,8 @@ _ConvertX86p32_16RGB555:
add edi,BYTE 2

.L7

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -825,7 +842,8 @@ _ConvertX86p32_16BGR555:
dec ecx
jnz .L1
.L2

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

.L3 ; head
mov ebx,edi
@@ -910,7 +928,8 @@ _ConvertX86p32_16BGR555:
add edi,BYTE 2

.L7

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

@@ -1040,5 +1059,6 @@ _ConvertX86p32_8RGB332:
jnz .L3

.L4:

  • jmp _x86return
  • picgetgot ebx
  • picjmp ebx, _x86return

again, update to cvs as some of these issues ive had resolved already

as for the rest of the stuff, i submitted a patch to fix all of these issues
before, but then asked to not have it added … rather than doing all the
funky stuff with PIC, just mark all the symbols hidden … then you dont have
to change anything else … plus you get a slight perf increase instead of a
slight perf lost
-mikeOn Wednesday 01 March 2006 18:23, Sam Hocevar wrote:

I do not know what the stance of the developers about PIC is, because
there is a slight performance hit on x86, but I believe it is negligible
in the present case. Some x86 systems (such as BeOS and OS X AFAIK)
require shared libraries to be PIC. Others such as Linux can cope
with non-PIC dynamic objects, but then they are not mapped on shared
segments.

Thanks for all the patches, I appreciate the effort. However, many
of the patches are already integrated or do not correctly merge with
CVS.

Could you submit revised patches, against current CVS?
http://www.libsdl.org/cvs/SDL-1.2.tar.gz

I’d be happy to accept the mprotect patch, go ahead and write a full
featured one and add checking for mprotect in configure.in in CVS.

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

as for the rest of the stuff, i submitted a patch to fix all of these issues
before, but then asked to not have it added … rather than doing all the
funky stuff with PIC, just mark all the symbols hidden … then you dont have
to change anything else … plus you get a slight perf increase instead of a
slight perf lost

Mmh, how does that solve the shared segment issue? Even if the
symbols are hidden, you still need to address them throught the GOT.On Wed, Mar 01, 2006, Mike Frysinger wrote:


Sam.

i’m referring to the symbols that are called/jumped (e.g. _mmxreturn) … with
PIC, they go through the PLT, but when they are hidden, the linker will
rewrite the jumps to be relative ones thus the indirect PLT jumps are not
required

as for the masks, if you update to cvs you’ll see that i had those issues
fixed by using the stack instead of the GOT (should be slightly faster
pushing constants onto the stack rather than trying to go through the GOT or
using GOTOFF) …

the cpuid issue too is fixed in cvs … it’s much easier to just push/pop ebx;
no need to push/pop ecx/edx as the ELF ABI says they are scratch registers
thus no need to worry about them being clobbered
-mikeOn Thursday 02 March 2006 14:08, Sam Hocevar wrote:

On Wed, Mar 01, 2006, Mike Frysinger wrote:

as for the rest of the stuff, i submitted a patch to fix all of these
issues before, but then asked to not have it added … rather than doing
all the funky stuff with PIC, just mark all the symbols hidden … then
you dont have to change anything else … plus you get a slight perf
increase instead of a slight perf lost

Mmh, how does that solve the shared segment issue? Even if the
symbols are hidden, you still need to address them throught the GOT.

you can find my patch to add elf visibility support to nasm here:
http://dev.gentoo.org/~vapier/patches/nasm-elf-visibility.patch

then simply add ‘hidden’ to the decl:
GLOBAL _mmxreturn:function hidden

and many of the TEXTRELs should magically vanish :slight_smile:
-mikeOn Wednesday 01 March 2006 19:32, Mike Frysinger wrote:

rather than doing all the funky stuff with PIC, just mark all the symbols
hidden … then you dont have to change anything else …

you can find my patch to add elf visibility support to nasm here:
http://dev.gentoo.org/~vapier/patches/nasm-elf-visibility.patch

then simply add ‘hidden’ to the decl:
GLOBAL _mmxreturn:function hidden

This is added to bugzilla:
https://bugzilla.libsdl.org/show_bug.cgi?id=157

I don’t really feel comfortable requiring a custom patch to nasm to
build SDL’s assembly, but it’s there in case anyone else wants to use
it.

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

i’m working with the nasm guys to get it integrated … the latest patch
(which i posted) they have no problems with … it’s just a matter of getting
them to do it … nasm development has slowed so much :frowning:

once it does get integrated, i’ll try and whip up a patch that detects whether
the host nasm supports hidden visibility and use it in the nasm source if
so … otherwise people can continue to build it on older systems, they’ll
just get TEXTRELs
-mikeOn Wednesday 08 March 2006 01:12, Sam Lantinga wrote:

you can find my patch to add elf visibility support to nasm here:
http://dev.gentoo.org/~vapier/patches/nasm-elf-visibility.patch

I don’t really feel comfortable requiring a custom patch to nasm to
build SDL’s assembly, but it’s there in case anyone else wants to use
it.

i’m working with the nasm guys to get it integrated … the latest patch
(which i posted) they have no problems with … it’s just a matter of getting
them to do it … nasm development has slowed so much :frowning:

once it does get integrated, i’ll try and whip up a patch that detects whether
the host nasm supports hidden visibility and use it in the nasm source if
so … otherwise people can continue to build it on older systems, they’ll
just get TEXTRELs

That sounds great, thanks Mike!

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

it occurred to me in a flash (shoomp!) that yasm can just as easily be used to
compile nasm source and that it officially supports hidden visibility … so
i whipped together the patch i alluded to above

the configure script will now search for ‘yasm’ and if that cant be found,
it’ll fall back to ‘nasm’ … then a small test is run to see if the selected
assembler supports the hidden syntax and if so, adds -DHIDDEN_VISIBILITY to
the nasm flags

the last piece is in the nasm source code … i replaced all ‘GLOBAL’ lines
with a call to a new ‘SDL_FUNC’ macro (i’m not really partial to the name, so
if people prefer something else, feel free to change) … if
HIDDEN_VISIBILITY is defined, then the symbol is declared with hidden
visibility … otherwise, we are left with the same state as currently

gave some quick tests on x86 using yasm 0.5.0 and my custom patched nasm …
no TEXTRELs :slight_smile:
-mike
-------------- next part --------------
A non-text attachment was scrubbed…
Name: libsdl-hidden-nasm.patch
Type: text/x-diff
Size: 4094 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060331/22855683/attachment.patchOn Wednesday 08 March 2006 02:08, Mike Frysinger wrote:

once it does get integrated, i’ll try and whip up a patch that detects
whether the host nasm supports hidden visibility and use it in the nasm
source if so … otherwise people can continue to build it on older
systems, they’ll just get TEXTRELs