• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisión32a0481fb147de2cd08c2980b177c298b4582ce7 (tree)
Tiempo2016-07-09 16:23:33
AutorAlan Modra <amodra@gmai...>
CommiterAlan Modra

Log Message

PR20337, Objdump makes poor choice of symbols

binutils/
PR binutils/20337
* objdump.c (compare_symbols): For ELF, sort same value/type
symbols according to size.
ld/
* testsuite/ld-powerpc/elfv2exe.d: Update.

Cambiar Resumen

Diferencia incremental

--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
1+2016-07-09 Alan Modra <amodra@gmail.com>
2+
3+ PR binutils/20337
4+ * objdump.c (compare_symbols): For ELF, sort same value/type
5+ symbols according to size.
6+
17 2016-07-05 Andre Vieria <andre.simoesdiasvieira@arm.com>
28
39 * objdump.c (dump_section_header): Rename SEC_ELF_NOREAD
--- a/binutils/objdump.c
+++ b/binutils/objdump.c
@@ -738,6 +738,21 @@ compare_symbols (const void *ap, const void *bp)
738738 return 1;
739739 }
740740
741+ if (bfd_get_flavour (bfd_asymbol_bfd (a)) == bfd_target_elf_flavour
742+ && bfd_get_flavour (bfd_asymbol_bfd (b)) == bfd_target_elf_flavour)
743+ {
744+ bfd_vma asz, bsz;
745+
746+ asz = 0;
747+ if ((a->flags & BSF_SYNTHETIC) == 0)
748+ asz = ((elf_symbol_type *) a)->internal_elf_sym.st_size;
749+ bsz = 0;
750+ if ((b->flags & BSF_SYNTHETIC) == 0)
751+ bsz = ((elf_symbol_type *) b)->internal_elf_sym.st_size;
752+ if (asz != bsz)
753+ return asz > bsz ? -1 : 1;
754+ }
755+
741756 /* Symbols that start with '.' might be section names, so sort them
742757 after symbols that don't start with '.'. */
743758 if (an[0] == '.' && bn[0] != '.')
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,7 @@
1+2016-07-09 Alan Modra <amodra@gmail.com>
2+
3+ * testsuite/ld-powerpc/elfv2exe.d: Update.
4+
15 2016-07-06 James Bowman <james.bowman@ftdichip.com>
26
37 * scripttempl/ft32.sc (__PMSIZE): Correct __PMSIZE_.
--- a/ld/testsuite/ld-powerpc/elfv2exe.d
+++ b/ld/testsuite/ld-powerpc/elfv2exe.d
@@ -19,13 +19,13 @@ Disassembly of section \.text:
1919 .*: (7d 89 03 a6|a6 03 89 7d) mtctr r12
2020 .*: (4e 80 04 20|20 04 80 4e) bctr
2121
22-0+100000e0 <_start>:
22+0+100000e0 <(f1|_start)>:
2323 .*: (3c 40 10 02|02 10 40 3c) lis r2,4098
2424 .*: (38 42 82 00|00 82 42 38) addi r2,r2,-32256
2525 .*: (7c 08 02 a6|a6 02 08 7c) mflr r0
2626 .*: (f8 21 ff e1|e1 ff 21 f8) stdu r1,-32\(r1\)
2727 .*: (f8 01 00 30|30 00 01 f8) std r0,48\(r1\)
28-.*: (4b ff ff f5|f5 ff ff 4b) bl .* <_start\+0x8>
28+.*: (4b ff ff f5|f5 ff ff 4b) bl .* <(f1|_start)\+0x8>
2929 .*: (e8 62 80 08|08 80 62 e8) ld r3,-32760\(r2\)
3030 .*: (4b ff ff c5|c5 ff ff 4b) bl .*\.plt_branch\.f2>
3131 .*: (60 00 00 00|00 00 00 60) nop