Re: Old Parrot Trac Ticket #578:
(I'm unable to post directly to the Parrot Trac, so I am posting here.)
Please see my solution to the problem of reaching a linker script when using dlopen(). You can find it on the GHC Trac, ticket #2615 (see http://hackage.haskell.org/trac/ghc/ticket/2615). The patch has been improved since I originally created it. You should look at the latest version included in GHC 7.4.2 and adapt it to Parrot.
Can you post a link to the specific patch you are talking about?
PS: Trac is read-only days, so don't take offense :)
Here's the specific patch: http://hackage.haskell.org/trac/ghc/attachment/ticket/2615/T2615a.dsend
The important part is lines 188-231 of the patch. They make use of the regular expressions in lines 74-81.
Since the original version of the patch, there have been some improvements, so you should consult the latest version of the code which can be found at http://darcs.haskell.org/cgi-bin/gitweb.cgi?p=ghc.git;a=blob;f=rts/Linker.c;h=703bc5fa0720228de00adcae015e43c4f168ab22;hb=HEAD
(1) The regular expressions (around lines 1479-1491) have been made more general. (2) Some differences in the main code (around lines 1625-1669).