WIP MachO binutils port assisted by AI I may consider upstreaming this in the future.
0

Configure Feed

Select the types of activity you want to include in your feed.

Provide string description of definition, visibility and resolution in LTO plug-in.

ld/ChangeLog:

2019-02-26 Martin Liska <mliska@suse.cz>

* plugin.c (get_symbols): Add lto_kind_str, lto_resolution_str,
lto_visibility_str and use then to inform about plugin-symbols.
* testsuite/ld-plugin/plugin-12.d: Adjust expected pattern.

marxin (Mar 26, 2019, 3:22 PM +0100) 7ea79cb3 5fb812fc

+81 -6
+6
ld/ChangeLog
··· 1 + 2019-03-26 Martin Liska <mliska@suse.cz> 2 + 3 + * plugin.c (get_symbols): Add lto_kind_str, lto_resolution_str, 4 + lto_visibility_str and use then to inform about plugin-symbols. 5 + * testsuite/ld-plugin/plugin-12.d: Adjust expected pattern. 6 + 1 7 2019-03-25 Tamar Christina <tamar.christina@arm.com> 2 8 3 9 * testsuite/ld-arm/jump-reloc-veneers-cond-long.d: Update disassembly.
+71 -2
ld/plugin.c
··· 659 659 return FALSE; 660 660 } 661 661 662 + /* Return LTO kind string name that corresponds to INDEX enum value. */ 663 + static const char * 664 + get_lto_kind (unsigned int index) 665 + { 666 + static char buffer[64]; 667 + const char *lto_kind_str[5] = 668 + { 669 + "DEF", 670 + "WEAKDEF", 671 + "UNDEF", 672 + "WEAKUNDEF", 673 + "COMMON" 674 + }; 675 + 676 + if (index < ARRAY_SIZE (lto_kind_str)) 677 + return lto_kind_str [index]; 678 + 679 + sprintf (buffer, _("unknown LTO kind value %x"), index); 680 + return buffer; 681 + } 682 + 683 + /* Return LTO resolution string name that corresponds to INDEX enum value. */ 684 + static const char * 685 + get_lto_resolution (unsigned int index) 686 + { 687 + static char buffer[64]; 688 + static const char *lto_resolution_str[10] = 689 + { 690 + "UNKNOWN", 691 + "UNDEF", 692 + "PREVAILING_DEF", 693 + "PREVAILING_DEF_IRONLY", 694 + "PREEMPTED_REG", 695 + "PREEMPTED_IR", 696 + "RESOLVED_IR", 697 + "RESOLVED_EXEC", 698 + "RESOLVED_DYN", 699 + "PREVAILING_DEF_IRONLY_EXP", 700 + }; 701 + 702 + if (index < ARRAY_SIZE (lto_resolution_str)) 703 + return lto_resolution_str [index]; 704 + 705 + sprintf (buffer, _("unknown LTO resolution value %x"), index); 706 + return buffer; 707 + } 708 + 709 + /* Return LTO visibility string name that corresponds to INDEX enum value. */ 710 + static const char * 711 + get_lto_visibility (unsigned int index) 712 + { 713 + static char buffer[64]; 714 + const char *lto_visibility_str[4] = 715 + { 716 + "DEFAULT", 717 + "PROTECTED", 718 + "INTERNAL", 719 + "HIDDEN" 720 + }; 721 + 722 + if (index < ARRAY_SIZE (lto_visibility_str)) 723 + return lto_visibility_str [index]; 724 + 725 + sprintf (buffer, _("unknown LTO visibility value %x"), index); 726 + return buffer; 727 + } 728 + 662 729 /* Get the symbol resolution info for a plugin-claimed input file. */ 663 730 static enum ld_plugin_status 664 731 get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms, ··· 777 844 syms[n].resolution = res; 778 845 if (report_plugin_symbols) 779 846 einfo (_("%P: %pB: symbol `%s' " 780 - "definition: %d, visibility: %d, resolution: %d\n"), 847 + "definition: %s, visibility: %s, resolution: %s\n"), 781 848 abfd, syms[n].name, 782 - syms[n].def, syms[n].visibility, res); 849 + get_lto_kind (syms[n].def), 850 + get_lto_visibility (syms[n].visibility), 851 + get_lto_resolution (res)); 783 852 } 784 853 return LDPS_OK; 785 854 }
+4 -4
ld/testsuite/ld-plugin/plugin-12.d
··· 1 1 #... 2 - .*: symbol `func' definition: 0, visibility: 0, resolution: 2 3 - .*: symbol `func1' definition: 0, visibility: 1, resolution: 3 4 - .*: symbol `func2' definition: 0, visibility: 2, resolution: 3 5 - .*: symbol `func3' definition: 0, visibility: 3, resolution: 3 2 + .*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DEF 3 + .*: symbol `func1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY 4 + .*: symbol `func2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY 5 + .*: symbol `func3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY 6 6 #pass