PATCH/RFC: ld add -p/-P options
Matt Rice
ratmice@gmail.com
Mon Sep 14 11:59:00 GMT 2009
On Sun, Sep 13, 2009 at 5:39 PM, Alan Modra <amodra@bigpond.net.au> wrote:
> On Sat, Sep 12, 2009 at 08:21:35AM -0700, Matt Rice wrote:
>> (gld${EMULATION_NAME}_add_options): Add -p and -P options.
>
> There's a small problem here. See armelf.em:PARSE_AND_LIST_SHORTOPTS.
> You'll need to get approval from one of the ARM maintainers to remove
> that from armelf.em.
doesn't look like this is going to be an option, this is still passed
to ld by the linux kernel
http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=blob;f=arch/arm/Makefile;h=54661125a8bfff2b69a1daee5d6de3ae5ebd1395;hb=HEAD
13 LDFLAGS_vmlinux :=-p --no-undefined -X
http://sourceware.org/ml/binutils/2004-11/msg00401.html
is the thread where this option was turned into a nop.
a possible hack I hesitate to mention is to make -p on gnu-ld accept
an optional argument,
in that case '-pfoo.so' will work with both linkers, the -p in '-p
--other-option' will be a ignored, but '-p foo.so' will
fail to recognize 'foo.so' as an argument to -p though.... there is
probably some caveat i'm missing, but it
does seem to maintain compatibility with the existing -p in armelf,
and give the ability to use a command line which will also work under
solaris.
Personally, I prefer just adding --audit with no short option and
seeing if solaris won't add a long option for compatibilty with us.
then if the armelf guys feel like deprecating their -p and going
through that whole process we could add -p as a short option to
--audit.
that doesn't help in the interim, but i'm going to need configure
checks to see if ld supports the option anyways.
if the hack is wanted i can send a follow up patch.
>> +static void gld${EMULATION_NAME}_append_to_separated_string(char **, char *);
>
> No need for a prototype.
Fixed
>> +gld${EMULATION_NAME}_append_to_separated_string(char **to, char *optarg)
>
> Space before (. Other than that the patch looks good.
And fixed.
>> I guess the *.rd files might be a bit fragile if it ever decides to be
>> something other than the 4th line.
>
>Write it like this:
>#...
>.*Audit library: \[tmpdir/audit.so\].*
>#pass
Thanks,
I also removed the auditlib.c from the tests since it was unused.
2009-09-12 Matt Rice <ratmice@gmail.com>
* bfd-in.h (bfd_elf_size_dynamic_sections): Add audit and depaudit
arguments.
* elflink.c (bfd_elf_size_dynamic_sections): Generate DT_AUDIT,
DT_DEPAUDIT from audit/depaudit arguments.
(elf_finalize_dynstr): finalize DT_AUDIT and DT_DEPAUDIT strtab entries.
* bfd-in2.h: Regenerate.
2009-09-12 Matt Rice <ratmice@gmail.com>
* emultempl/elf32.em:
(gld${EMULATION_NAME}_add_options): Add --audit, --depaudit,
and -P options.
(gld${EULATION_NAME}_handle_options): Ditto.
(gld${EULATION_NAME}_list_options): Ditto.
(gld${EMULATION_NAME}_append_to_separated_string): New function for
handling rpath-like colon separated strings.
(gld${EMULATION_NAME}_before_allocation): Pass the audit and depaudit
libs to bfd.
ld.texinfo: Document new options.
2009-09-12 Matt Rice <ratmice@gmail.com>
ld-elf/audit.exp: New.
ld-elf/audit.rd: New.
ld-elf/depaudit.rd: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: audit2.diff
Type: application/octet-stream
Size: 11794 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20090914/621ab61a/attachment.obj>
More information about the Binutils
mailing list