[Linux-Xtensa] vmlinux link failure: dangerous relocation: call8: misaligned call target

Baruch Siach baruch at tkos.co.il
Sun Jun 2 23:56:52 PDT 2013


Hi linux-xtensa list,

When building v3.10-rc4 I get the following at the vmlinux link stage:

net/built-in.o: In function `strncmp':
/home/baruch/git/stable-2.6.git/arch/xtensa/include/asm/string.h:90:(.text+0xbfd9): dangerous relocation: call8: misaligned call target: (.text.unlikely+0x47)
net/built-in.o: In function `dev_kfree_skb_irq':
/home/baruch/git/stable-2.6.git/net/core/dev.c:2087:(.text+0xc28e): dangerous relocation: call8: misaligned call target: (.text.unlikely+0x47)
make: *** [vmlinux] Error 1

The patch below "fixes" the build by getting skb_warn_bad_offload() out of 
.text.unlikely:

diff --git a/net/core/dev.c b/net/core/dev.c
index 36dd48d..c66460d 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -2172,7 +2172,7 @@ int skb_checksum_help(struct sk_buff *skb)
 	if (skb->ip_summed == CHECKSUM_COMPLETE)
 		goto out_set_summed;
 
-	if (unlikely(skb_shinfo(skb)->gso_size)) {
+	if (skb_shinfo(skb)->gso_size) {
 		skb_warn_bad_offload(skb);
 		return -EINVAL;
 	}
@@ -2305,7 +2305,7 @@ static inline bool skb_needs_check(struct sk_buff *skb, bool tx_path)
 struct sk_buff *__skb_gso_segment(struct sk_buff *skb,
 				  netdev_features_t features, bool tx_path)
 {
-	if (unlikely(skb_needs_check(skb, tx_path))) {
+	if (skb_needs_check(skb, tx_path)) {
 		int err;
 
 		skb_warn_bad_offload(skb);

The strange thing is that skb_warn_bad_offload() actually starts at 
.text.unlikely+0x50, so it is properly aligned.

Another noticeable thing that may have something to do with it is that the 
final build stage take a very long time (about 5 minutes on my old Core2 Quad 
Q6600 system), while taking 100% of one core time.

I'm using binutils version 2.22 built using crostool-NG 1.18.0.

Any suggestion?

baruch

-- 
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -


More information about the linux-xtensa mailing list