Our use of --gc-sections causes the linker to discard the symbols defined by FILE_LICENCE(), meaning that the resulting licence determination is incomplete. We must use the KEEP() directive in the linker script to force the linker to not discard the licence symbols. Using KEEP(*(COMMON)) would be undesirable, since there are some symbols in COMMON which we may wish to discard. Fix by placing symbols defined by PROVIDE_SYMBOL() (which is used by FILE_LICENCE()) into a special ".provided" section, which we then mark with KEEP(). All such symbols are zero-length, so there is no cost in terms of the final binary size. Since the symbols are no longer in COMMON, the linker will reject symbols with the same name coming from multiple objects. We therefore append the object name to the licence symbol, to ensure that it is unique. Reported-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
1011 |
|
1011 |
|
1012 |
|
1012 |
|
1013 |
|
1013 |
|
1014 |
|
|
|
|
1014 |
|
|
|
1015 |
|
|
|
1016 |
|
|
1015 |
|
1017 |
|
1016 |
|
1018 |
|
1017 |
|
1019 |
|
1018 |
|
1020 |
|
1019 |
|
1021 |
|
1020 |
|
|
|
1021 |
|
|
|
|
1022 |
|
|
|
1023 |
|
|
|
1024 |
|
|
1022 |
|
1025 |
|
|
1026 |
|
|
|
1027 |
|
|
1023 |
|
1028 |
|
1024 |
|
1029 |
|
1025 |
|
1030 |
|
|
|
||
98 |
|
98 |
|
99 |
|
99 |
|
100 |
|
100 |
|
|
101 |
|
|
|
102 |
|
|
101 |
|
103 |
|
102 |
|
104 |
|
103 |
|
105 |
|
|
|
||
109 |
|
109 |
|
110 |
|
110 |
|
111 |
|
111 |
|
|
112 |
|
|
|
113 |
|
|
112 |
|
114 |
|
113 |
|
115 |
|
114 |
|
116 |
|
|
|
||
53 |
|
53 |
|
54 |
|
54 |
|
55 |
|
55 |
|
|
56 |
|
|
|
57 |
|
|
56 |
|
58 |
|
57 |
|
59 |
|
58 |
|
60 |
|
|
|
||
55 |
|
55 |
|
56 |
|
56 |
|
57 |
|
57 |
|
|
58 |
|
|
|
59 |
|
|
58 |
|
60 |
|
59 |
|
61 |
|
60 |
|
62 |
|
|
|
||
53 |
|
53 |
|
54 |
|
54 |
|
55 |
|
55 |
|
|
56 |
|
|
|
57 |
|
|
56 |
|
58 |
|
57 |
|
59 |
|
58 |
|
60 |
|
|
|
||
60 |
|
60 |
|
61 |
|
61 |
|
62 |
|
62 |
|
|
63 |
|
|
|
64 |
|
|
63 |
|
65 |
|
64 |
|
|
|
|
66 |
|
|
|
67 |
|
|
65 |
|
68 |
|
66 |
|
69 |
|
67 |
|
|
|
68 |
|
|
|
|
70 |
|
|
|
71 |
|
|
69 |
|
72 |
|
70 |
|
73 |
|
71 |
|
74 |
|
|
|
||
652 |
|
655 |
|
653 |
|
656 |
|
654 |
|
657 |
|
655 |
|
|
|
|
658 |
|
|
656 |
|
659 |
|
657 |
|
660 |
|
658 |
|
661 |
|
|
|
||
661 |
|
664 |
|
662 |
|
665 |
|
663 |
|
666 |
|
664 |
|
|
|
|
667 |
|
|
665 |
|
668 |
|
666 |
|
669 |
|
667 |
|
670 |
|
|
|
||
670 |
|
673 |
|
671 |
|
674 |
|
672 |
|
675 |
|
673 |
|
|
|
|
676 |
|
|
674 |
|
677 |
|
675 |
|
678 |
|
676 |
|
679 |
|
|
|
||
682 |
|
685 |
|
683 |
|
686 |
|
684 |
|
687 |
|
685 |
|
|
|
|
688 |
|
|
686 |
|
689 |
|
687 |
|
690 |
|
688 |
|
691 |
|
|
|
||
707 |
|
710 |
|
708 |
|
711 |
|
709 |
|
712 |
|
710 |
|
|
|
|
713 |
|
|
711 |
|
714 |
|
712 |
|
715 |
|
713 |
|
716 |
|
|
|
||
728 |
|
731 |
|
729 |
|
732 |
|
730 |
|
733 |
|
731 |
|
|
|
|
734 |
|
|
732 |
|
735 |
|
733 |
|
736 |
|
734 |
|
737 |
|
|
|
||
738 |
|
741 |
|
739 |
|
742 |
|
740 |
|
743 |
|
741 |
|
|
|
|
744 |
|
|
742 |
|
745 |
|
743 |
|
746 |
|
744 |
|
747 |
|