[Ffmpeg-devel] Mac OS X local relocation entries in non-writable section...

Augie Fackler durin42
Wed Oct 25 20:46:50 CEST 2006

On Oct 16, 2006, at 5:15 PM, Ryan Martell wrote:

> I am trying to link against the ffmpeg libraries from XCode 2.4,  
> and I get the "local relocation entries in non-writable section"  
> error.  This is on a MacBook Pro (Intel Dual Core)
> /usr/bin/gcc-4.0 -bundle -arch i386 /usr/local/lib/libavcodec.a - 
> Wl,-all_load -Wl,-twolevel_namespace -Wl,-twolevel_namespace_hints - 
> Wl,-undefined -Wl,dynamic_lookup -Wl,-multiply_defined -Wl,suppress  
> -isysroot /Developer/SDKs/MacOSX10.4u.sdk -o /Users/rmartell/dev/ 
> SDLOpenGLTest/build/SDLOpenGLTest.build/Debug/SDLOpenGLTest.build/ 
> Objects-normal/i386/libavcodec.ab
> /usr/bin/ld: /usr/local/lib/libavcodec.a(bitstream.o) has local  
> relocation entries in non-writable section (__TEXT,__text)
> I know this has been posted before, and I have tried the various  
> options:
> 1) The code is compiled with -mdynamic-no-pic, which supposedly  
> caused issues in the past, but not on gcc 3.3 (i think) or later...
> 3) configure ffmpeg without the flag --enable-shared. (This is done).

I've never heard of --mdynamic-no-pic being a problem.

> I am building the libraries statically.

That's what we're doing for Perian.

> <snip>
> 1) Link with the flag '-read_only_relocs suppress',

Honestly, I think this is your best bet. We're doing this in Perian  
and it hasn't caused any problems. You might try experimenting with  
using the -dynamic linker flag either more or less, (I'm a bit fuzzy  
on which would be better based on skimming the man page for ld(1).

> Which sounds a bit scary to me.

Reading the man page makes it sound a bit less scary.

> I know that the -mdynamic-no-pic was a 5% speed boost (according to  
> Michael), so I'd like to leave it in, but I'm stymied.
> So, gcc gurus, what's my magic compiler option to fix this?

Scarcely a guru, but hopefully my 2? will be useful.

> Thanks!
> -Ryan Martell

Augie Fackler

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel

More information about the ffmpeg-devel mailing list