From: Alan Modra Date: Wed, 24 May 2006 03:11:51 +0000 (+0000) Subject: * elf64-ppc.c (compare_symbols): Prefer strong dynamic global X-Git-Tag: gdb_6_5-20060621-release~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d9f011fb3d1dbca3d9ce10bd4979206d47b1c013;p=thirdparty%2Fbinutils-gdb.git * elf64-ppc.c (compare_symbols): Prefer strong dynamic global function syms over other syms. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index c64ae218c12..782d1a90643 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2006-05-24 Alan Modra + + * elf64-ppc.c (compare_symbols): Prefer strong dynamic global + function syms over other syms. + 2006-05-11 Michael Matz * elflink.c (match_group_member): Correctly iterate group diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 1697d532e98..b1ec94230a5 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -2626,6 +2626,32 @@ compare_symbols (const void *ap, const void *bp) if (a->value + a->section->vma > b->value + b->section->vma) return 1; + /* For syms with the same value, prefer strong dynamic global function + syms over other syms. */ + if ((a->flags & BSF_GLOBAL) != 0 && (b->flags & BSF_GLOBAL) == 0) + return -1; + + if ((a->flags & BSF_GLOBAL) == 0 && (b->flags & BSF_GLOBAL) != 0) + return 1; + + if ((a->flags & BSF_FUNCTION) != 0 && (b->flags & BSF_FUNCTION) == 0) + return -1; + + if ((a->flags & BSF_FUNCTION) == 0 && (b->flags & BSF_FUNCTION) != 0) + return 1; + + if ((a->flags & BSF_WEAK) == 0 && (b->flags & BSF_WEAK) != 0) + return -1; + + if ((a->flags & BSF_WEAK) != 0 && (b->flags & BSF_WEAK) == 0) + return 1; + + if ((a->flags & BSF_DYNAMIC) != 0 && (b->flags & BSF_DYNAMIC) == 0) + return -1; + + if ((a->flags & BSF_DYNAMIC) == 0 && (b->flags & BSF_DYNAMIC) != 0) + return 1; + return 0; }