Ticket #1383 (reopened enhancement)

Opened 11 months ago

Last modified 4 months ago

libi420_rgb_mmx_plugin.so contains text relocations on x86 due to absolute memory references being used in inline asm

Reported by: aballier Assigned to: funman
Priority: high Milestone: 1.0.0 bugs
Component: Filters Version: master
Severity: normal Keywords:
Cc: aballier2 Platform(s): all
Difficulty: easy Work status: Not started

Description

libi420_rgb_mmx_plugin.so contains text relocations on x86, which I think is bad for shared objects for various reasons (mainly because this prevents marking TEXT pages readonly).

I'll attach a patch that will add the various memory references that are used to gcc inline asm input constraints, so that'll let it choose how to address them. It'll use relative to the pic register references in pic mode, and absolute references in non pic mode. This also removes the need to manually do (%pic) relative addressing on x86_64.

As a side effect, it might fix the build of this plugin on intel mac osx (though I cannot check this).

Attachments

i420_mmx_pic.patch (8.9 kB) - added by aballier on 29/11/07 13:59:51.
let gcc choose how to reference memory addresses

Change History

29/11/07 13:59:51 changed by aballier

  • attachment i420_mmx_pic.patch added.

let gcc choose how to reference memory addresses

06/12/07 02:56:52 changed by funman

  • milestone set to 0.9.0 bugs.

03/01/08 12:41:15 changed by aballier

  • owner changed.
  • component changed from Build system to Filters.

just a note that it would fail to build with -fforce-addr in cflags, but as seen on: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33713 and: http://gcc.gnu.org/ml/gcc-patches/2007-11/msg01651.html

it seems its going away from future gcc releases due to the exact same problems.

26/03/08 07:29:07 changed by funman

  • status changed from new to assigned.
  • owner set to funman.

26/03/08 07:32:22 changed by funman

  • status changed from assigned to closed.
  • resolution set to fixed.

26/03/08 08:04:54 changed by funman

  • status changed from closed to reopened.
  • resolution deleted.

breaks on OSX

i420_rgb16.c: In function 'I420_R5G5B5__0_9_0i':
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'
i420_rgb16.c:503: error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'

04/04/08 22:09:44 changed by fkuehne

  • status changed from reopened to closed.
  • resolution set to wontfix.

Using Xcode 3.1 solves this issue on Mac OS X. Xcode 3.0 shouldn't be used. Use either Xcode 2.4.1 or 3.1, but nothing in between.

04/04/08 22:15:56 changed by funman

  • priority changed from normal to high.
  • status changed from closed to reopened.
  • resolution deleted.

I guess applying the patch would close the ticket

29/06/08 11:10:29 changed by aballier2

  • cc set to aballier2.