[FFmpeg-devel] TEXTRELs in fft_mmx.asm (was Re: [PATCH] split-radix FFT)

Måns Rullgård mans
Mon Nov 3 13:26:28 CET 2008


Dominik 'Rathann' Mierzejewski wrote:
> On Monday, 03 November 2008 at 05:44, Loren Merritt wrote:
>> On Sat, 1 Nov 2008, Dominik 'Rathann' Mierzejewski wrote:
>>
>> >... these 6 macros seem to be causing textrels even on x86_64.
>> >I've already given up on avoiding textrels in FFmpeg on x86_32,
>> >but on x86_64 this is the only problematic case.
>>
>> First blacklist everything Drepper has ever written, and explain in your
>> own words why you want to avoid textrels. If it's just to stop selinux
>> from complaining at you, then screw it, I'm not willing to spend any code
>> on that.
>
> Not really. I wouldn't want to sacrifice performance, either.
>
>> The only reason I support PIC on x86_64 is that ld.so doesn't support
>> 32bit textrels in 64bit shared libs. That ld.so bug does not extend to
>> prevent 64bit textrels, so I see no reason to avoid them.
>>
>> Then, does this work?
>
> I'll check that ASAP, thanks. I figured it would be something like that.
>
>> According to readelf, .rodata is loaded into the
>> main RX section. I could use .rel.data.ro, but that needs an ifdef for
>> non-elf. I could use .data, but that's counterproductive if your reason
>> for disliking textrels involves the duplication of memory pages.
>
> That's one of the reasons. The other is not having memory pages that
> are both writable and executable, which provides an additional level
> of security against "arbitrary code execution"-type bugs, IIUC.
> If we can have that without too much work and without losing performance,
> then I'm all for it.

The dynamic linker should make all text pages read-only after processing
all relocations.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list