Browse Source

[build] Fix the REQUIRE_SYMBOL mechanism

At some point in the past few years, binutils became more aggressive
at removing unused symbols.  To function as a symbol requirement, a
relocation record must now be in a section marked with @progbits and
must not be in a section which gets discarded during the link (either
via --gc-sections or via /DISCARD/).

Update REQUIRE_SYMBOL() to generate relocation records meeting these
criteria.  To minimise the impact upon the final binary size, we use
existing symbols (specified via the REQUIRING_SYMBOL() macro) as the
relocation targets where possible.  We use R_386_NONE or R_X86_64_NONE
relocation types to prevent any actual unwanted relocation taking
place.  Where no suitable symbol exists for REQUIRING_SYMBOL() (such
as in config.c), the macro PROVIDE_REQUIRING_SYMBOL() can be used to
generate a one-byte-long symbol to act as the relocation target.

If there are versions of binutils for which this approach fails, then
the fallback will probably involve killing off REQUEST_SYMBOL(),
redefining REQUIRE_SYMBOL() to use the current definition of
REQUEST_SYMBOL(), and postprocessing the linked ELF file with
something along the lines of "nm -u | wc -l" to check that there are
no undefined symbols remaining.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
fbc4ba4b4e

+ 3
- 0
src/arch/i386/include/bits/compiler.h View File

@@ -3,6 +3,9 @@
3 3
 
4 4
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
5 5
 
6
+/** Dummy relocation type */
7
+#define RELOC_TYPE_NONE R_386_NONE
8
+
6 9
 #ifndef ASSEMBLY
7 10
 
8 11
 /** Declare a function with standard calling conventions */

+ 1
- 0
src/arch/i386/interface/pxe/pxe_call.c View File

@@ -346,6 +346,7 @@ int pxe_start_nbp ( void ) {
346 346
 	return 0;
347 347
 }
348 348
 
349
+REQUIRING_SYMBOL ( pxe_api_call );
349 350
 REQUIRE_OBJECT ( pxe_preboot );
350 351
 REQUIRE_OBJECT ( pxe_undi );
351 352
 REQUIRE_OBJECT ( pxe_udp );

+ 1
- 0
src/arch/i386/prefix/kkkpxeprefix.S View File

@@ -8,6 +8,7 @@
8 8
 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
9 9
 
10 10
 /* Provide the PXENV_FILE_EXIT_HOOK API call */
11
+REQUIRING_SYMBOL ( _kkkpxe_start )
11 12
 REQUIRE_OBJECT ( pxe_exit_hook )
12 13
 
13 14
 #define PXELOADER_KEEP_UNDI

+ 3
- 0
src/arch/i386/prefix/romprefix.S View File

@@ -875,5 +875,8 @@ wait_for_tick:
875 875
 	ret
876 876
 	.size wait_for_tick, . - wait_for_tick
877 877
 
878
+/* Drag in objects via _rom_start */
879
+REQUIRING_SYMBOL ( _rom_start )
880
+
878 881
 /* Drag in ROM configuration */
879 882
 REQUIRE_OBJECT ( config_romprefix )

+ 1
- 0
src/arch/i386/transitions/librm_test.c View File

@@ -118,4 +118,5 @@ struct self_test librm_test __self_test = {
118 118
 	.exec = librm_test_exec,
119 119
 };
120 120
 
121
+REQUIRING_SYMBOL ( librm_test );
121 122
 REQUIRE_OBJECT ( test );

+ 3
- 0
src/arch/x86/drivers/hyperv/hyperv.c View File

@@ -590,5 +590,8 @@ struct root_device hv_root_device __root_device = {
590 590
 	.driver = &hv_root_driver,
591 591
 };
592 592
 
593
+/* Drag in objects via hv_root_device */
594
+REQUIRING_SYMBOL ( hv_root_device );
595
+
593 596
 /* Drag in netvsc driver */
594 597
 REQUIRE_OBJECT ( netvsc );

+ 3
- 0
src/arch/x86/drivers/xen/hvm.c View File

@@ -496,5 +496,8 @@ struct pci_driver hvm_driver __pci_driver = {
496 496
 	.remove = hvm_remove,
497 497
 };
498 498
 
499
+/* Drag in objects via hvm_driver */
500
+REQUIRING_SYMBOL ( hvm_driver );
501
+
499 502
 /* Drag in netfront driver */
500 503
 REQUIRE_OBJECT ( netfront );

+ 3
- 0
src/arch/x86_64/include/bits/compiler.h View File

@@ -1,6 +1,9 @@
1 1
 #ifndef _BITS_COMPILER_H
2 2
 #define _BITS_COMPILER_H
3 3
 
4
+/** Dummy relocation type */
5
+#define RELOC_TYPE_NONE R_X86_64_NONE
6
+
4 7
 #ifndef ASSEMBLY
5 8
 
6 9
 /** Declare a function with standard calling conventions */

+ 2
- 0
src/config/config.c View File

@@ -44,6 +44,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
44 44
  * in the final iPXE executable built.
45 45
  */
46 46
 
47
+PROVIDE_REQUIRING_SYMBOL();
48
+
47 49
 /*
48 50
  * Drag in all requested console types
49 51
  *

+ 2
- 0
src/config/config_ethernet.c View File

@@ -29,6 +29,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
29 29
  *
30 30
  */
31 31
 
32
+PROVIDE_REQUIRING_SYMBOL();
33
+
32 34
 /*
33 35
  * Drag in Ethernet-specific protocols
34 36
  */

+ 2
- 0
src/config/config_fc.c View File

@@ -29,6 +29,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
29 29
  *
30 30
  */
31 31
 
32
+PROVIDE_REQUIRING_SYMBOL();
33
+
32 34
 /*
33 35
  * Drag in Fibre Channel-specific commands
34 36
  *

+ 2
- 0
src/config/config_infiniband.c View File

@@ -29,6 +29,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
29 29
  *
30 30
  */
31 31
 
32
+PROVIDE_REQUIRING_SYMBOL();
33
+
32 34
 /*
33 35
  * Drag in Infiniband-specific protocols
34 36
  */

+ 2
- 0
src/config/config_net80211.c View File

@@ -25,6 +25,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
25 25
  *
26 26
  */
27 27
 
28
+PROVIDE_REQUIRING_SYMBOL();
29
+
28 30
 /*
29 31
  * Drag in 802.11-specific commands
30 32
  *

+ 2
- 0
src/config/config_romprefix.c View File

@@ -29,6 +29,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
29 29
  *
30 30
  */
31 31
 
32
+PROVIDE_REQUIRING_SYMBOL();
33
+
32 34
 /*
33 35
  * Provide UNDI loader if PXE stack is requested
34 36
  *

+ 2
- 0
src/config/config_route.c View File

@@ -29,6 +29,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
29 29
  *
30 30
  */
31 31
 
32
+PROVIDE_REQUIRING_SYMBOL();
33
+
32 34
 /*
33 35
  * Drag in routing management for relevant protocols
34 36
  *

+ 2
- 0
src/config/config_usb.c View File

@@ -29,6 +29,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
29 29
  *
30 30
  */
31 31
 
32
+PROVIDE_REQUIRING_SYMBOL();
33
+
32 34
 /*
33 35
  * Drag in USB controllers
34 36
  */

+ 3
- 0
src/crypto/x509.c View File

@@ -1765,5 +1765,8 @@ int x509_validate_chain ( struct x509_chain *chain, time_t time,
1765 1765
 	return -EACCES_USELESS;
1766 1766
 }
1767 1767
 
1768
+/* Drag in objects via x509_validate() */
1769
+REQUIRING_SYMBOL ( x509_validate );
1770
+
1768 1771
 /* Drag in certificate store */
1769 1772
 REQUIRE_OBJECT ( certstore );

+ 3
- 0
src/drivers/bus/usb.c View File

@@ -1903,6 +1903,9 @@ struct usb_port * usb_root_hub_port ( struct usb_device *usb ) {
1903 1903
 	return usb->port;
1904 1904
 }
1905 1905
 
1906
+/* Drag in objects via register_usb_bus() */
1907
+REQUIRING_SYMBOL ( register_usb_bus );
1908
+
1906 1909
 /* Drag in USB configuration */
1907 1910
 REQUIRE_OBJECT ( config_usb );
1908 1911
 

+ 1
- 0
src/drivers/net/rtl818x/rtl8180.c View File

@@ -4,6 +4,7 @@ FILE_LICENCE(GPL2_OR_LATER);
4 4
 
5 5
 #include <ipxe/pci.h>
6 6
 
7
+PROVIDE_REQUIRING_SYMBOL();
7 8
 REQUIRE_OBJECT(rtl818x);
8 9
 REQUIRE_OBJECT(rtl8180_grf5101);
9 10
 REQUIRE_OBJECT(rtl8180_max2820);

+ 1
- 0
src/drivers/net/rtl818x/rtl8185.c View File

@@ -4,6 +4,7 @@ FILE_LICENCE(GPL2_OR_LATER);
4 4
 
5 5
 #include <ipxe/pci.h>
6 6
 
7
+PROVIDE_REQUIRING_SYMBOL();
7 8
 REQUIRE_OBJECT(rtl818x);
8 9
 REQUIRE_OBJECT(rtl8185_rtl8225);
9 10
 

+ 1
- 0
src/drivers/net/vxge/vxge.c View File

@@ -9,6 +9,7 @@ FILE_LICENCE(GPL2_OR_LATER);
9 9
 
10 10
 #include <ipxe/pci.h>
11 11
 
12
+PROVIDE_REQUIRING_SYMBOL();
12 13
 REQUIRE_OBJECT(vxge_main);
13 14
 
14 15
 /** vxge PCI IDs for util/parserom.pl which are put into bin/NIC */

+ 3
- 0
src/hci/commands/image_trust_cmd.c View File

@@ -173,6 +173,9 @@ struct command image_trust_commands[] __command = {
173 173
 	},
174 174
 };
175 175
 
176
+/* Drag in objects via command list */
177
+REQUIRING_SYMBOL ( image_trust_commands );
178
+
176 179
 /* Drag in objects typically required for signature verification */
177 180
 REQUIRE_OBJECT ( rsa );
178 181
 REQUIRE_OBJECT ( md5 );

+ 107
- 42
src/include/compiler.h View File

@@ -57,54 +57,101 @@
57 57
  * @{
58 58
  */
59 59
 
60
-/** Provide a symbol within this object file */
60
+/**
61
+ * Provide a symbol within this object file
62
+ *
63
+ * @v symbol		Symbol name
64
+ */
61 65
 #ifdef ASSEMBLY
62
-#define PROVIDE_SYMBOL( _sym )				\
63
-	.section ".provided", "a", @nobits ;		\
64
-	.hidden _sym ;					\
65
-	.globl	_sym ;					\
66
-	_sym: ;						\
66
+#define PROVIDE_SYMBOL( symbol )				\
67
+	.section ".provided", "a", @nobits ;			\
68
+	.hidden symbol ;					\
69
+	.globl	symbol ;					\
70
+	symbol: ;						\
67 71
 	.previous
68
-#else /* ASSEMBLY */
69
-#define PROVIDE_SYMBOL( _sym )				\
70
-	char _sym[0]					\
72
+#else
73
+#define PROVIDE_SYMBOL( symbol )				\
74
+	char symbol[0]						\
71 75
 	  __attribute__ (( section ( ".provided" ) ))
72
-#endif /* ASSEMBLY */
76
+#endif
73 77
 
74
-/** Require a symbol within this object file
78
+/**
79
+ * Request a symbol
80
+ *
81
+ * @v symbol		Symbol name
75 82
  *
76
- * The symbol is referenced by a relocation in a discarded section, so
77
- * if it is not available at link time the link will fail.
83
+ * Request a symbol to be included within the link.  If the symbol
84
+ * cannot be found, the link will succeed anyway.
78 85
  */
79 86
 #ifdef ASSEMBLY
80
-#define REQUIRE_SYMBOL( _sym )				\
81
-	.section ".discard", "a", @progbits ;		\
82
-	.extern	_sym ;					\
83
-	.long	_sym ;					\
84
-	.previous
85
-#else /* ASSEMBLY */
86
-#define REQUIRE_SYMBOL( _sym )				\
87
-	extern char _sym;				\
88
-	static char * _C2 ( _C2 ( __require_, _sym ), _C2 ( _, __LINE__ ) ) \
89
-		__attribute__ (( section ( ".discard" ), used )) \
90
-		= &_sym
87
+#define REQUEST_SYMBOL( symbol )				\
88
+	.equ __request_ ## symbol, symbol
89
+#else
90
+#define REQUEST_SYMBOL( symbol )				\
91
+	__asm__ ( ".equ __request_" #symbol ", " #symbol )
91 92
 #endif
92 93
 
93
-/** Request that a symbol be available at runtime
94
+/**
95
+ * Require a symbol
94 96
  *
95
- * The requested symbol is entered as undefined into the symbol table
96
- * for this object, so the linker will pull in other object files as
97
- * necessary to satisfy the reference. However, the undefined symbol
98
- * is not referenced in any relocations, so the link can still succeed
99
- * if no file contains it.
97
+ * @v symbol		Symbol name
98
+ *
99
+ * Require a symbol to be included within the link.  If the symbol
100
+ * cannot be found, the link will fail.
101
+ *
102
+ * To use this macro within a file, you must also specify the file's
103
+ * "requiring symbol" using the REQUIRING_SYMBOL() or
104
+ * PROVIDE_REQUIRING_SYMBOL() macros.
100 105
  */
101 106
 #ifdef ASSEMBLY
102
-#define REQUEST_SYMBOL( _sym )				\
103
-	.equ	__need_ ## _sym, _sym
104
-#else /* ASSEMBLY */
105
-#define REQUEST_SYMBOL( _sym )				\
106
-	__asm__ ( ".equ\t__need_" #_sym ", " #_sym )
107
-#endif /* ASSEMBLY */
107
+#define REQUIRE_SYMBOL( symbol )				\
108
+	.reloc __requiring_symbol__, RELOC_TYPE_NONE, symbol
109
+#else
110
+#define REQUIRE_SYMBOL( symbol )				\
111
+	__asm__ ( ".reloc __requiring_symbol__, "		\
112
+		  _S2 ( RELOC_TYPE_NONE ) ", " #symbol )
113
+#endif
114
+
115
+/**
116
+ * Specify the file's requiring symbol
117
+ *
118
+ * @v symbol		Symbol name
119
+ *
120
+ * REQUIRE_SYMBOL() works by defining a dummy relocation record
121
+ * against a nominated "requiring symbol".  The presence of the
122
+ * nominated requiring symbol will drag in all of the symbols
123
+ * specified using REQUIRE_SYMBOL().
124
+ */
125
+#ifdef ASSEMBLY
126
+#define REQUIRING_SYMBOL( symbol )				\
127
+	.equ __requiring_symbol__, symbol
128
+#else
129
+#define REQUIRING_SYMBOL( symbol )				\
130
+	__asm__ ( ".equ __requiring_symbol__, " #symbol )
131
+#endif
132
+
133
+/**
134
+ * Provide a file's requiring symbol
135
+ *
136
+ * If the file contains no symbols that can be used as the requiring
137
+ * symbol, you can provide a dummy one-byte-long symbol using
138
+ * PROVIDE_REQUIRING_SYMBOL().
139
+ */
140
+#ifdef ASSEMBLY
141
+#define PROVIDE_REQUIRING_SYMBOL()				\
142
+	.section ".tbl.requiring_symbols", "a", @progbits ;	\
143
+	__requiring_symbol__:	.byte 0 ;			\
144
+	.size __requiring_symbol__, . - __requiring_symbol__ ;	\
145
+	.previous
146
+#else
147
+#define PROVIDE_REQUIRING_SYMBOL()				\
148
+	__asm__ ( ".section \".tbl.requiring_symbols\", "	\
149
+		  "         \"a\", @progbits\n"			\
150
+		  "__requiring_symbol__:\t.byte 0\n"		\
151
+		  ".size __requiring_symbol__, "		\
152
+		  "      . - __requiring_symbol__\n"		\
153
+		  ".previous" )
154
+#endif
108 155
 
109 156
 /** @} */
110 157
 
@@ -119,11 +166,29 @@
119 166
 /** Always provide the symbol for the current object (defined by -DOBJECT) */
120 167
 PROVIDE_SYMBOL ( OBJECT_SYMBOL );
121 168
 
122
-/** Explicitly require another object */
123
-#define REQUIRE_OBJECT( _obj ) REQUIRE_SYMBOL ( obj_ ## _obj )
169
+/**
170
+ * Request an object
171
+ *
172
+ * @v object		Object name
173
+ *
174
+ * Request an object to be included within the link.  If the object
175
+ * cannot be found, the link will succeed anyway.
176
+ */
177
+#define REQUEST_OBJECT( object ) REQUEST_SYMBOL ( obj_ ## object )
124 178
 
125
-/** Pull in another object if it exists */
126
-#define REQUEST_OBJECT( _obj ) REQUEST_SYMBOL ( obj_ ## _obj )
179
+/**
180
+ * Require an object
181
+ *
182
+ * @v object		Object name
183
+ *
184
+ * Require an object to be included within the link.  If the object
185
+ * cannot be found, the link will fail.
186
+ *
187
+ * To use this macro within a file, you must also specify the file's
188
+ * "requiring symbol" using the REQUIRING_SYMBOL() or
189
+ * PROVIDE_REQUIRING_SYMBOL() macros.
190
+ */
191
+#define REQUIRE_OBJECT( object ) REQUIRE_SYMBOL ( obj_ ## object )
127 192
 
128 193
 /** @} */
129 194
 
@@ -685,8 +750,8 @@ int __debug_disable;
685 750
 
686 751
 /** @} */
687 752
 
688
-/* This file itself is under GPLv2-or-later */
689
-FILE_LICENCE ( GPL2_OR_LATER );
753
+/* This file itself is under GPLv2+/UBDL */
754
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
690 755
 
691 756
 #include <bits/compiler.h>
692 757
 

+ 2
- 1
src/include/nic.h View File

@@ -276,6 +276,7 @@ static inline void * legacy_isa_get_drvdata ( void *hwdev ) {
276 276
 	_name ## _isa_legacy_remove ( struct isa_device *isa ) {	  \
277 277
 		return legacy_remove ( isa, legacy_isa_get_drvdata,	  \
278 278
 				       _name ## _disable );		  \
279
-	}
279
+	}								  \
280
+	PROVIDE_REQUIRING_SYMBOL()
280 281
 
281 282
 #endif	/* NIC_H */

+ 3
- 0
src/net/80211/net80211.c View File

@@ -2827,5 +2827,8 @@ struct errortab common_wireless_errors[] __errortab = {
2827 2827
 	__einfo_errortab ( EINFO_ECONNREFUSED_AUTH_ALGO_UNSUPP ),
2828 2828
 };
2829 2829
 
2830
+/* Drag in objects via net80211_ll_protocol */
2831
+REQUIRING_SYMBOL ( net80211_ll_protocol );
2832
+
2830 2833
 /* Drag in 802.11 configuration */
2831 2834
 REQUIRE_OBJECT ( config_net80211 );

+ 1
- 0
src/net/80211/wpa.c View File

@@ -912,4 +912,5 @@ struct eapol_handler eapol_key_handler __eapol_handler = {
912 912
 };
913 913
 
914 914
 /* WPA always needs EAPOL in order to be useful */
915
+REQUIRING_SYMBOL ( eapol_key_handler );
915 916
 REQUIRE_OBJECT ( eapol );

+ 3
- 0
src/net/ethernet.c View File

@@ -239,6 +239,9 @@ struct net_device * alloc_etherdev ( size_t priv_size ) {
239 239
 	return netdev;
240 240
 }
241 241
 
242
+/* Drag in objects via ethernet_protocol */
243
+REQUIRING_SYMBOL ( ethernet_protocol );
244
+
242 245
 /* Drag in Ethernet configuration */
243 246
 REQUIRE_OBJECT ( config_ethernet );
244 247
 

+ 3
- 0
src/net/fc.c View File

@@ -1940,5 +1940,8 @@ struct fc_ulp * fc_ulp_get_port_id_type ( struct fc_port *port,
1940 1940
 	return NULL;
1941 1941
 }
1942 1942
 
1943
+/* Drag in objects via fc_ports */
1944
+REQUIRING_SYMBOL ( fc_ports );
1945
+
1943 1946
 /* Drag in Fibre Channel configuration */
1944 1947
 REQUIRE_OBJECT ( config_fc );

+ 3
- 0
src/net/infiniband.c View File

@@ -999,6 +999,9 @@ struct ib_device * last_opened_ibdev ( void ) {
999 999
 	return ibdev;
1000 1000
 }
1001 1001
 
1002
+/* Drag in objects via register_ibdev() */
1003
+REQUIRING_SYMBOL ( register_ibdev );
1004
+
1002 1005
 /* Drag in Infiniband configuration */
1003 1006
 REQUIRE_OBJECT ( config_infiniband );
1004 1007
 

+ 3
- 0
src/net/ipv4.c View File

@@ -841,5 +841,8 @@ struct settings_applicator ipv4_settings_applicator __settings_applicator = {
841 841
 	.apply = ipv4_create_routes,
842 842
 };
843 843
 
844
+/* Drag in objects via ipv4_protocol */
845
+REQUIRING_SYMBOL ( ipv4_protocol );
846
+
844 847
 /* Drag in ICMPv4 */
845 848
 REQUIRE_OBJECT ( icmpv4 );

+ 3
- 0
src/net/ipv6.c View File

@@ -1104,6 +1104,9 @@ struct net_driver ipv6_driver __net_driver = {
1104 1104
 	.remove = ipv6_remove,
1105 1105
 };
1106 1106
 
1107
+/* Drag in objects via ipv6_protocol */
1108
+REQUIRING_SYMBOL ( ipv6_protocol );
1109
+
1107 1110
 /* Drag in ICMPv6 */
1108 1111
 REQUIRE_OBJECT ( icmpv6 );
1109 1112
 

+ 1
- 0
src/tests/cms_test.c View File

@@ -1474,6 +1474,7 @@ struct self_test cms_test __self_test = {
1474 1474
 };
1475 1475
 
1476 1476
 /* Drag in algorithms required for tests */
1477
+REQUIRING_SYMBOL ( cms_test );
1477 1478
 REQUIRE_OBJECT ( rsa );
1478 1479
 REQUIRE_OBJECT ( md5 );
1479 1480
 REQUIRE_OBJECT ( sha1 );

+ 1
- 0
src/tests/ocsp_test.c View File

@@ -1861,5 +1861,6 @@ struct self_test ocsp_test __self_test = {
1861 1861
 };
1862 1862
 
1863 1863
 /* Drag in algorithms required for tests */
1864
+REQUIRING_SYMBOL ( ocsp_test );
1864 1865
 REQUIRE_OBJECT ( rsa );
1865 1866
 REQUIRE_OBJECT ( sha1 );

+ 1
- 0
src/tests/tests.c View File

@@ -30,6 +30,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
30 30
  */
31 31
 
32 32
 /* Drag in all applicable self-tests */
33
+PROVIDE_REQUIRING_SYMBOL();
33 34
 REQUIRE_OBJECT ( memset_test );
34 35
 REQUIRE_OBJECT ( memcpy_test );
35 36
 REQUIRE_OBJECT ( string_test );

+ 1
- 0
src/tests/x509_test.c View File

@@ -1109,6 +1109,7 @@ struct self_test x509_test __self_test = {
1109 1109
 };
1110 1110
 
1111 1111
 /* Drag in algorithms required for tests */
1112
+REQUIRING_SYMBOL ( x509_test );
1112 1113
 REQUIRE_OBJECT ( rsa );
1113 1114
 REQUIRE_OBJECT ( sha1 );
1114 1115
 REQUIRE_OBJECT ( sha256 );

+ 1
- 0
src/usr/route.c View File

@@ -48,4 +48,5 @@ void route ( void ) {
48 48
 }
49 49
 
50 50
 /* Drag in routing management configuration */
51
+REQUIRING_SYMBOL ( route );
51 52
 REQUIRE_OBJECT ( config_route );

+ 3
- 0
src/util/elf2efi.c View File

@@ -478,6 +478,9 @@ static void process_reloc ( bfd *bfd __attribute__ (( unused )),
478 478
 		/* Skip absolute symbols; the symbol value won't
479 479
 		 * change when the object is loaded.
480 480
 		 */
481
+	} else if ( ( strcmp ( howto->name, "R_386_NONE" ) == 0 ) ||
482
+		    ( strcmp ( howto->name, "R_X86_64_NONE" ) == 0 ) ) {
483
+		/* Ignore dummy relocations used by REQUIRE_SYMBOL() */
481 484
 	} else if ( strcmp ( howto->name, "R_X86_64_64" ) == 0 ) {
482 485
 		/* Generate an 8-byte PE relocation */
483 486
 		generate_pe_reloc ( pe_reltab, offset, 8 );

Loading…
Cancel
Save