]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Fix misaligned table entries when using gcc 4.5
authorPiotr Jaroszyński <p.jaroszynski@gmail.com>
Thu, 19 Aug 2010 21:39:17 +0000 (23:39 +0200)
committerMichael Brown <mcb30@ipxe.org>
Fri, 20 Aug 2010 09:13:04 +0000 (10:13 +0100)
Declarations without the accompanying __table_entry cause misalignment
of the table entries when using gcc 4.5.  Fix by adding the
appropriate __table_entry macro or (where possible) by removing
unnecessary forward declarations.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
14 files changed:
src/arch/i386/core/video_subr.c
src/include/ipxe/arp.h
src/include/ipxe/icmp6.h
src/include/ipxe/ip.h
src/include/ipxe/ip6.h
src/include/ipxe/rarp.h
src/include/ipxe/tcp.h
src/net/aoe.c
src/net/arp.c
src/net/eth_slow.c
src/net/icmpv6.c
src/net/ipv4.c
src/net/ipv6.c
src/net/udp.c

index b10ef7bcf4a65a9778bc91fc288f54f138125e20..4c583e5b61a1c0235a20af57b6a4707b756eca17 100644 (file)
@@ -12,7 +12,7 @@
 #include <ipxe/init.h>
 #include "vga.h"
 
-struct console_driver vga_console;
+struct console_driver vga_console __console_driver;
 
 static char *vidmem;           /* The video buffer */
 static int video_line, video_col;
index 373a95da1fb6663803b5b81a914da08a9ee5c11e..f7b99c68da04a003fa5b6e3a932fb335e92aa1ce 100644 (file)
@@ -10,9 +10,7 @@
 FILE_LICENCE ( GPL2_OR_LATER );
 
 #include <ipxe/tables.h>
-
-struct net_device;
-struct net_protocol;
+#include <ipxe/netdevice.h>
 
 /** A network-layer protocol that relies upon ARP */
 struct arp_net_protocol {
@@ -35,7 +33,7 @@ struct arp_net_protocol {
 /** Declare an ARP protocol */
 #define __arp_net_protocol __table_entry ( ARP_NET_PROTOCOLS, 01 )
 
-extern struct net_protocol arp_protocol;
+extern struct net_protocol arp_protocol __net_protocol;
 
 extern int arp_resolve ( struct net_device *netdev,
                         struct net_protocol *net_protocol,
index d2ab3bc1802c91691f5cc9574b008c9e1ec57de1..1d433408d2f2475efa4863985c7fba30a47b7524 100644 (file)
@@ -15,7 +15,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #define ICMP6_NSOLICIT 135
 #define ICMP6_NADVERT 136
 
-extern struct tcpip_protocol icmp6_protocol;
+extern struct tcpip_protocol icmp6_protocol __tcpip_protocol;
 
 struct icmp6_header {
        uint8_t type;
index e3445aa4777a08c223e2995a4af3095005ce25bb..3f3dc1f77d592d1494936b3151b36ec8bcf6b5bc 100644 (file)
@@ -13,10 +13,9 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #include <ipxe/in.h>
 #include <ipxe/list.h>
 #include <ipxe/retry.h>
+#include <ipxe/netdevice.h>
 
 struct io_buffer;
-struct net_device;
-struct net_protocol;
 
 /* IP constants */
 
@@ -92,6 +91,6 @@ struct frag_buffer {
 
 extern struct list_head ipv4_miniroutes;
 
-extern struct net_protocol ipv4_protocol;
+extern struct net_protocol ipv4_protocol __net_protocol;
 
 #endif /* _IPXE_IP_H */
index 70c2fad23b3ae89956702fc3b7be970dfcb7c4f4..e9584bd6fb9a41e1e025dd17e9110588b5768e17 100644 (file)
@@ -11,6 +11,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
 
 #include <stdint.h>
 #include <ipxe/in.h>
+#include <ipxe/netdevice.h>
+#include <ipxe/tcpip.h>
 
 /* IP6 constants */
 
@@ -64,11 +66,9 @@ struct ipv6_pseudo_header {
 #define IP6_NO_HEADER          0x59
 
 struct io_buffer;
-struct net_device;
-struct net_protocol;
 
-extern struct net_protocol ipv6_protocol;
-extern struct tcpip_net_protocol ipv6_tcpip_protocol;
+extern struct net_protocol ipv6_protocol __net_protocol;
+extern struct tcpip_net_protocol ipv6_tcpip_protocol __tcpip_net_protocol;
 extern char * inet6_ntoa ( struct in6_addr in6 );
 
 extern int add_ipv6_address ( struct net_device *netdev,
index 7edbe21913754def3c31ee98afba8886b2b87cb5..f84301a4389588c2b7381ec17dd3f8dfc5bc6d90 100644 (file)
@@ -9,8 +9,8 @@
 
 FILE_LICENCE ( GPL2_OR_LATER );
 
-struct net_protocol;
+#include <ipxe/netdevice.h>
 
-extern struct net_protocol rarp_protocol;
+extern struct net_protocol rarp_protocol __net_protocol;
 
 #endif /* _IPXE_RARP_H */
index b189afd736375666908e43d048c26b739a73a2f9..e64614646eaa240d99286a3135cb687aa8bcd44e 100644 (file)
@@ -342,6 +342,6 @@ static inline int tcp_in_window ( uint32_t seq, uint32_t start,
        return ( ( seq - start ) < len );
 }
 
-extern struct tcpip_protocol tcp_protocol;
+extern struct tcpip_protocol tcp_protocol __tcpip_protocol;
 
 #endif /* _IPXE_TCP_H */
index 4b700073a446c8d275bbf98ba1abfbc119743c3e..4a03e2b647ecfe4ce37fc44b30720a891f1be621 100644 (file)
@@ -44,7 +44,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
 
 FEATURE ( FEATURE_PROTOCOL, "AoE", DHCP_EB_FEATURE_AOE, 1 );
 
-struct net_protocol aoe_protocol;
+struct net_protocol aoe_protocol __net_protocol;
 
 /** List of all AoE sessions */
 static LIST_HEAD ( aoe_sessions );
index fe4dbff91a053a5e040f0327cb3f6fe83d51ce36..714b471bdfbff10c3cb4da58d0bf425ba32b77db 100644 (file)
@@ -63,7 +63,7 @@ static struct arp_entry arp_table[NUM_ARP_ENTRIES];
 
 static unsigned int next_new_arp_entry = 0;
 
-struct net_protocol arp_protocol;
+struct net_protocol arp_protocol __net_protocol;
 
 /**
  * Find entry in the ARP cache
index 86fe62c3bb4be7586dd350cddc4d8849ec2cecc7..4b2df28006eb6cf5a6f22f2407049aa1560f6d28 100644 (file)
@@ -40,7 +40,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
  * partner sends us.
  */
 
-struct net_protocol eth_slow_protocol;
+struct net_protocol eth_slow_protocol __net_protocol;
 
 /** Slow protocols multicast address */
 static const uint8_t eth_slow_address[ETH_ALEN] =
index ab8a65ec98f9079e13c2cf24653576484b3505d6..1a5aad3bada9f1a7d1da02d199aeb01fcb4e037c 100644 (file)
@@ -11,8 +11,6 @@
 #include <ipxe/tcpip.h>
 #include <ipxe/netdevice.h>
 
-struct tcpip_protocol icmp6_protocol;
-
 /**
  * Send neighbour solicitation packet
  *
index 9548652701efd8fca5b358d519d016c1a95a0b2e..a3cbdb03935df5556b96030687357245a395ca3f 100644 (file)
@@ -26,8 +26,6 @@ FILE_LICENCE ( GPL2_OR_LATER );
 /* Unique IP datagram identification number */
 static uint16_t next_ident = 0;
 
-struct net_protocol ipv4_protocol;
-
 /** List of IPv4 miniroutes */
 struct list_head ipv4_miniroutes = LIST_HEAD_INIT ( ipv4_miniroutes );
 
index 781d7628a2278e9a353cad7fe9c6003682ed60dd..ffaa558bf05428e2bf765c1e6509089c591e2459 100644 (file)
@@ -15,8 +15,6 @@
 #include <ipxe/netdevice.h>
 #include <ipxe/if_ether.h>
 
-struct net_protocol ipv6_protocol;
-
 /* Unspecified IP6 address */
 static struct in6_addr ip6_none = {
         .in6_u.u6_addr32 = { 0,0,0,0 }
index 0ed1503a273aa4397553ec299f2a5003f2420a3e..9bd80f3a35cc35b905bd2c583c050a29a416a4b4 100644 (file)
@@ -44,7 +44,7 @@ static LIST_HEAD ( udp_conns );
 
 /* Forward declatations */
 static struct interface_descriptor udp_xfer_desc;
-struct tcpip_protocol udp_protocol;
+struct tcpip_protocol udp_protocol __tcpip_protocol;
 
 /**
  * Bind UDP connection to local port