aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-ppc.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2006-05-23 01:36:07 +0000
committerAlan Modra <amodra@gmail.com>2006-05-23 01:36:07 +0000
commit4d35a0aa887f736f2c349a3f20006c8f5d773452 (patch)
treee27c1b1a25965c38bc335734d11311bb50116d7a /bfd/elf64-ppc.c
parentc9fe3751afad1f4adb0678cea38a4d7fa28f5a49 (diff)
downloadgdb-4d35a0aa887f736f2c349a3f20006c8f5d773452.zip
gdb-4d35a0aa887f736f2c349a3f20006c8f5d773452.tar.gz
gdb-4d35a0aa887f736f2c349a3f20006c8f5d773452.tar.bz2
* elf64-ppc.c (compare_symbols): Prefer strong dynamic global
function syms over other syms.
Diffstat (limited to 'bfd/elf64-ppc.c')
-rw-r--r--bfd/elf64-ppc.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
index 1697d53..b1ec942 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;
}