This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: RFC: automagic soname generation for ibm TPF-OS
- From: Daniel Jacobowitz <drow at false dot org>
- To: Eric Christopher <echristo at redhat dot com>
- Cc: binutils at sources dot redhat dot com, uweigand at de dot ibm dot com
- Date: Thu, 14 Jul 2005 21:20:05 -0400
- Subject: Re: RFC: automagic soname generation for ibm TPF-OS
- References: <1121389768.3145.21.camel@dzur.sfbay.redhat.com>
On Thu, Jul 14, 2005 at 06:09:28PM -0700, Eric Christopher wrote:
> OK, I'm not particularly happy with this hack, but can't think of
> another way to do it offhand so I figured I'd post what I've got and see
> what people say.
>
> Basically the TPF-OS requires that each executable have an soname of the
> first 4 characters, uppercase, of the name of the executable. They've
> got other restrictions after that, but that's not something I want to
> try to solve today. :)
>
> Basically I took a page out of the irix notebook on this which has
> something similar for shared libraries. Irix uses basename () instead of
> a custom function, but the right idea is there. The problem comes in the
> emulations - I'd prefer not to add a new custom emulation for this.
>
> Any ideas?
Adding an emulation is fine; that's what they're there for. Two
things:
> Index: ld/emulparams/elf64_s390_tpf.sh
> ===================================================================
> RCS file: ld/emulparams/elf64_s390_tpf.sh
> diff -N ld/emulparams/elf64_s390_tpf.sh
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ ld/emulparams/elf64_s390_tpf.sh 15 Jul 2005 01:06:05 -0000
> @@ -0,0 +1,36 @@
> +SCRIPT_NAME=elf
> +EXTRA_EM_FILE=tpf
> +ELFSIZE=64
> +OUTPUT_FORMAT="elf64-s390"
> +TEXT_START_ADDR=0x80000000
> +MAXPAGESIZE=0x1000
... et cetera. This is indeed ugly. Don't do it. You can use "." to
source a base file; there's dozens of examples in emulparams already.
That will kill the duplication. Please add a comment to whatever file
you source reflecting that you use it (see any of the MIPS ones for an
example :-)
> +static char tpfsoname[5];
Please, friend, lose the buffer :-)
> +/* Mangle the soname for the TPF OS system. We only want the first
> + 4 characters of the base output .so name only, all upper case.
> + This runs into problems when the filename is < 4 characters. You
> + will likely get garbage. */
... and handle that more gracefully, please. Just use 'A' or
something!
--
Daniel Jacobowitz
CodeSourcery, LLC