Skip to contentSkip to conversation

Section conflict compile failures in net

DISCUSSION James Bottomley 3 participants 8 messages May 27, 2011 – Jun 18, 2011 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 20 lines · Michał Mirosław
Quoted 7 lines · James Bottomley

I'm now getting a ton of errors like this in git head:

  CC [M]  drivers/net/3c59x.o
  CC [M]  drivers/net/hp100.o
  CC [M]  drivers/net/ne3210.o
  CC [M]  drivers/net/3c509.o
  CC [M]  drivers/net/depca.o
Quoted 12 lines

drivers/net/ne3210.c:83: error: irq_map causes a section type conflict drivers/net/ne3210.c:85: error: shmem_map causes a section type conflict drivers/net/ne3210.c:89: error: ifmap_val causes a section type conflict drivers/net/ne3210.c:319: error: ne3210_ids causes a section type conflict make[2]: *** [drivers/net/ne3210.o] Error 1
make[2]: *** Waiting for unfinished jobs.... drivers/net/hp100.c:198: error: hp100_eisa_tbl causes a section type conflict drivers/net/hp100.c:211: error: hp100_pci_tbl causes a section type conflict make[2]: *** [drivers/net/hp100.o] Error 1 drivers/net/depca.c:544: error: de1xx_irq causes a section type conflict drivers/net/depca.c:545: error: de2xx_irq causes a section type conflict drivers/net/depca.c:546: error: de422_irq causes a section type conflict

Quoted 4 lines

[...]

Those three are only used in depca_hw_init() marked __devinit. What compiler [flags] do you use to build this?

It's a standard debian one.

jejb@ion> hppa64-linux-gnu-gcc -v
Using built-in specs.
Target: hppa64-linux-gnu
Configured with: ../src/configure --enable-languages=c --prefix=/usr --libexecdir=/usr/lib --disable-shared --disable-nls --disable-threads --disable-libffi --disable-libgomp --disable-libmudflap --disable-libssp --with-as=/usr/bin/hppa64-linux-gnu-as --with-ld=/usr/bin/hppa64-linux-gnu-ld --includedir=/usr/hppa64-linux-gnu/include --host=hppa-linux-gnu --build=hppa-linux-gnu --target=hppa64-linux-gnu
Thread model: single
gcc version 4.2.4 (Debian 4.2.4-6)

the problem is definitely the depca_irq[i] in the loop ... replace that with a constant and the error goes away.

James

#3 lore raw
Quoted 41 lines · James Bottomley
Quoted 20 lines · Michał Mirosław
Quoted 7 lines · James Bottomley

I'm now getting a ton of errors like this in git head:

  CC [M]  drivers/net/3c59x.o
  CC [M]  drivers/net/hp100.o
  CC [M]  drivers/net/ne3210.o
  CC [M]  drivers/net/3c509.o
  CC [M]  drivers/net/depca.o
Quoted 12 lines

drivers/net/ne3210.c:83: error: irq_map causes a section type conflict drivers/net/ne3210.c:85: error: shmem_map causes a section type conflict drivers/net/ne3210.c:89: error: ifmap_val causes a section type conflict drivers/net/ne3210.c:319: error: ne3210_ids causes a section type conflict make[2]: *** [drivers/net/ne3210.o] Error 1
make[2]: *** Waiting for unfinished jobs.... drivers/net/hp100.c:198: error: hp100_eisa_tbl causes a section type conflict drivers/net/hp100.c:211: error: hp100_pci_tbl causes a section type conflict make[2]: *** [drivers/net/hp100.o] Error 1 drivers/net/depca.c:544: error: de1xx_irq causes a section type conflict drivers/net/depca.c:545: error: de2xx_irq causes a section type conflict drivers/net/depca.c:546: error: de422_irq causes a section type conflict

Quoted 4 lines

[...]

Those three are only used in depca_hw_init() marked __devinit. What compiler [flags] do you use to build this?

It's a standard debian one.

jejb@ion> hppa64-linux-gnu-gcc -v
Using built-in specs.
Target: hppa64-linux-gnu
Configured with: ../src/configure --enable-languages=c --prefix=/usr --libexecdir=/usr/lib --disable-shared --disable-nls --disable-threads --disable-libffi --disable-libgomp --disable-libmudflap --disable-libssp --with-as=/usr/bin/hppa64-linux-gnu-as --with-ld=/usr/bin/hppa64-linux-gnu-ld --includedir=/usr/hppa64-linux-gnu/include --host=hppa-linux-gnu --build=hppa-linux-gnu --target=hppa64-linux-gnu
Thread model: single
gcc version 4.2.4 (Debian 4.2.4-6)

Quoted 2 lines

the problem is definitely the depca_irq[i] in the loop ... replace that with a constant and the error goes away.

Looks like arch-specific problem. Build test passes for x86 allyesconfig.

Best Regards,
Michał Mirosław

maintainer
#4 lore raw
In reply to a message not in the archive

From: James Bottomley <[email protected]>
Date: Thu, 26 May 2011 16:39:53 -0500

BTW, linux-netdev doesn't exist, it's just plain netdev.

Quoted 8 lines

Simply reverting

commit e5cb966c0838e4da43a3b0751bdcac7fe719f7b4

Author: Micha<C5><82> Miros<C5><82>aw <[email protected]>
Date:   Mon Apr 18 13:31:20 2011 +0000

net: fix section mismatches

Quoted 8 lines

Fixes the problem.

If I look at the first problem in hp100.c, the addition of __devinitconst to the device tables is fine, but there's no corresponding sectional tag on their use, so when compiled as a module, things like hp100_eisa_driver is now in the main data section but refers to something in the init data section ... I assume all the others are the same type of problem.

Yeah I think the device ID table __devinitconst bits have to be reverted.

I'll apply something like the following:

net: Revert adding __devinitconst to driver ID tables.

If the table is hooked up to foo_driver->id_table we can't mark it __devinitconst otherwise we end up with section mismatches.

drivers/net/3c509.c +3 -3
index 5f25889..f6eaf6f 100644
@@ -395,7 +395,7 @@ static struct isa_driver el3_isa_driver = {
 static int isa_registered;
 
 #ifdef CONFIG_PNP
-static const struct pnp_device_id el3_pnp_ids[] __devinitconst = {
+static const struct pnp_device_id el3_pnp_ids[] = {
 	{ .id = "TCM5090" }, /* 3Com Etherlink III (TP) */
 	{ .id = "TCM5091" }, /* 3Com Etherlink III */
 	{ .id = "TCM5094" }, /* 3Com Etherlink III (combo) */
@@ -478,7 +478,7 @@ static int pnp_registered;
 #endif /* CONFIG_PNP */
 
 #ifdef CONFIG_EISA
-static const struct eisa_device_id el3_eisa_ids[] __devinitconst = {
+static const struct eisa_device_id el3_eisa_ids[] = {
 		{ "TCM5090" },
 		{ "TCM5091" },
 		{ "TCM5092" },
@@ -508,7 +508,7 @@ static int eisa_registered;
 #ifdef CONFIG_MCA
 static int el3_mca_probe(struct device *dev);
 
-static const short el3_mca_adapter_ids[] __devinitconst = {
+static const short el3_mca_adapter_ids[] = {
 		0x627c,
 		0x627d,
 		0x62db,
drivers/net/3c59x.c +1 -1
index 99f43d2..9ff7f37 100644
@@ -901,7 +901,7 @@ static const struct dev_pm_ops vortex_pm_ops = {
 #endif /* !CONFIG_PM */
 
 #ifdef CONFIG_EISA
-static const struct eisa_device_id vortex_eisa_ids[] __devinitconst = {
+static const struct eisa_device_id vortex_eisa_ids[] = {
 	{ "TCM5920", CH_3C592 },
 	{ "TCM5970", CH_3C597 },
 	{ "" }
drivers/net/depca.c +1 -1
index 1765405..645182b 100644
@@ -342,7 +342,7 @@ static const char depca_string[] = "depca";
 static int depca_device_remove (struct device *device);
 
 #ifdef CONFIG_EISA
-static const struct eisa_device_id depca_eisa_ids[] __devinitconst = {
+static const struct eisa_device_id depca_eisa_ids[] = {
 	{ "DEC4220", de422 },
 	{ "" }
 };
drivers/net/hp100.c +1 -1
index c52a1df..ea8d345 100644
@@ -195,7 +195,7 @@ static const char *const hp100_isa_tbl[] __devinitconst = {
 #endif
 
 #ifdef CONFIG_EISA
-static const struct eisa_device_id hp100_eisa_tbl[] __devinitconst = {
+static const struct eisa_device_id hp100_eisa_tbl[] = {
 	{ "HWPF180" }, /* HP J2577 rev A */
 	{ "HWP1920" }, /* HP 27248B */
 	{ "HWP1940" }, /* HP J2577 */
drivers/net/ibmlana.c +1 -1
index 136d754..00b1a2c 100644
@@ -895,7 +895,7 @@ static int ibmlana_irq;
 static int ibmlana_io;
 static int startslot;		/* counts through slots when probing multiple devices */
 
-static const short ibmlana_adapter_ids[] __devinitconst = {
+static const short ibmlana_adapter_ids[] = {
 	IBM_LANA_ID,
 	0x0000
 };
drivers/net/irda/smsc-ircc2.c +1 -1
index 69b5707..76929e4 100644
@@ -366,7 +366,7 @@ static inline void register_bank(int iobase, int bank)
 }
 
 /* PNP hotplug support */
-static const struct pnp_device_id smsc_ircc_pnp_table[] __devinitconst = {
+static const struct pnp_device_id smsc_ircc_pnp_table[] = {
 	{ .id = "SMCf010", .driver_data = 0 },
 	/* and presumably others */
 	{ }
drivers/net/ne3210.c +1 -1
index e8984b0..3e7fb5b 100644
@@ -316,7 +316,7 @@ static void ne3210_block_output(struct net_device *dev, int count,
 	memcpy_toio(shmem, buf, count);
 }
 
-static const struct eisa_device_id ne3210_ids[] __devinitconst = {
+static const struct eisa_device_id ne3210_ids[] = {
 	{ "EGL0101" },
 	{ "NVL1801" },
 	{ "" },
drivers/net/smc-mca.c +1 -1
index 0f29f26..76abd94 100644
@@ -156,7 +156,7 @@ static const struct {
    { 14, 15 }
 };
 
-static const short smc_mca_adapter_ids[] __devinitconst = {
+static const short smc_mca_adapter_ids[] = {
 	0x61c8,
 	0x61c9,
 	0x6fc0,
drivers/net/tokenring/madgemc.c +1 -1
index 1313aa1..44b96f2 100644
@@ -727,7 +727,7 @@ static int __devexit madgemc_remove(struct device *device)
 	return 0;
 }
 
-static const short madgemc_adapter_ids[] __devinitconst = {
+static const short madgemc_adapter_ids[] = {
 	0x002d,
 	0x0000
 };
drivers/net/tulip/de4x5.c +1 -1
index 45144d5..40c0aa2 100644
@@ -2097,7 +2097,7 @@ static int __devexit de4x5_eisa_remove (struct device *device)
 	return 0;
 }
 
-static const struct eisa_device_id de4x5_eisa_ids[] __devinitconst = {
+static const struct eisa_device_id de4x5_eisa_ids[] = {
         { "DEC4250", 0 },	/* 0 is the board name index... */
         { "" }
 };
#5 lore raw
Quoted 15 lines · David Miller

From: James Bottomley <[email protected]>
Date: Thu, 26 May 2011 16:39:53 -0500

BTW, linux-netdev doesn't exist, it's just plain netdev.

Quoted 10 lines

Simply reverting

commit e5cb966c0838e4da43a3b0751bdcac7fe719f7b4

Author: Micha<C5><82> Miros<C5><82>aw <[email protected]>
Date:   Mon Apr 18 13:31:20 2011 +0000

net: fix section mismatches

Fixes the problem.

Quoted 8 lines
Quoted 6 lines

If I look at the first problem in hp100.c, the addition of __devinitconst to the device tables is fine, but there's no corresponding sectional tag on their use, so when compiled as a module, things like hp100_eisa_driver is now in the main data section but refers to something in the init data section ... I assume all the others are the same type of problem.

Yeah I think the device ID table __devinitconst bits have to be reverted.

__devinitconst ID tables do work for PCI drivers. What's different for EISA, and why is it working in x86 allyesconfig build but not in hppa?

Best Regards,
Michał Mirosław

maintainer
#6 lore raw

From: Michał Mirosław <[email protected]>
Date: Wed, 1 Jun 2011 03:27:40 +0200

Quoted 2 lines

__devinitconst ID tables do work for PCI drivers. What's different for EISA, and why is it working in x86 allyesconfig build but not in hppa?

James shows that it doesn't work for PCI drivers either.

#7 lore raw
In reply to David Miller
Quoted 4 lines · David Miller

From: James Bottomley <[email protected]>
Date: Thu, 26 May 2011 16:39:53 -0500

BTW, linux-netdev doesn't exist, it's just plain netdev.

Um, yes ... I thought it was netdev, then I checked MARC and it had linux-netdev. I'll remember for next time (well, at least for the next six months).

Quoted 22 lines
Quoted 8 lines

Simply reverting

commit e5cb966c0838e4da43a3b0751bdcac7fe719f7b4

Author: Micha<C5><82> Miros<C5><82>aw <[email protected]>
Date:   Mon Apr 18 13:31:20 2011 +0000

net: fix section mismatches

Quoted 8 lines

Fixes the problem.

If I look at the first problem in hp100.c, the addition of __devinitconst to the device tables is fine, but there's no corresponding sectional tag on their use, so when compiled as a module, things like hp100_eisa_driver is now in the main data section but refers to something in the init data section ... I assume all the others are the same type of problem.

Yeah I think the device ID table __devinitconst bits have to be reverted.

I'll apply something like the following:

Quoted 8 lines

net: Revert adding __devinitconst to driver ID tables.

If the table is hooked up to foo_driver->id_table we can't mark it __devinitconst otherwise we end up with section mismatches.

That fixes some but not all; the pci tables still cause a section conflict:

drivers/net/hp100.c:211: error: hp100_pci_tbl causes a section type conflict make[2]: *** [drivers/net/hp100.o] Error 1

It's really, as has been said, a compiler problem: the compiler is confused about the read only sections. However, 4.2 is a pretty common compiler (especially for non-x86), so if the compiler can't do the read only section tracking, just not using the __devinitconst designation globally seems to be the best thing, just change it to __devinitdata instead.

James

maintainer
#8 lore raw

From: James Bottomley <[email protected]>
Date: Wed, 01 Jun 2011 10:42:50 +0900

Quoted 6 lines

It's really, as has been said, a compiler problem: the compiler is confused about the read only sections. However, 4.2 is a pretty common compiler (especially for non-x86), so if the compiler can't do the read only section tracking, just not using the __devinitconst designation globally seems to be the best thing, just change it to __devinitdata instead.

I think I'm just going to do a full revert then.

You guys work out how to arrive at a solution that solves the problem he was originally trying to solve, yet doesn't break this gcc-4.2 case.

Thanks.

#9 lore raw
In reply to James Bottomley
Quoted 48 lines · James Bottomley
Quoted 4 lines · David Miller

From: James Bottomley <[email protected]>
Date: Thu, 26 May 2011 16:39:53 -0500

BTW, linux-netdev doesn't exist, it's just plain netdev.

Um, yes ... I thought it was netdev, then I checked MARC and it had linux-netdev. I'll remember for next time (well, at least for the next six months).

Quoted 22 lines
Quoted 8 lines

Simply reverting

commit e5cb966c0838e4da43a3b0751bdcac7fe719f7b4

Author: Micha<C5><82> Miros<C5><82>aw <[email protected]>
Date:   Mon Apr 18 13:31:20 2011 +0000

net: fix section mismatches

Quoted 8 lines

Fixes the problem.

If I look at the first problem in hp100.c, the addition of __devinitconst to the device tables is fine, but there's no corresponding sectional tag on their use, so when compiled as a module, things like hp100_eisa_driver is now in the main data section but refers to something in the init data section ... I assume all the others are the same type of problem.

Yeah I think the device ID table __devinitconst bits have to be reverted.

I'll apply something like the following:

Quoted 8 lines

net: Revert adding __devinitconst to driver ID tables.

If the table is hooked up to foo_driver->id_table we can't mark it __devinitconst otherwise we end up with section mismatches.

That fixes some but not all; the pci tables still cause a section conflict:

drivers/net/hp100.c:211: error: hp100_pci_tbl causes a section type conflict make[2]: *** [drivers/net/hp100.o] Error 1

Quoted 6 lines

It's really, as has been said, a compiler problem: the compiler is confused about the read only sections. However, 4.2 is a pretty common compiler (especially for non-x86), so if the compiler can't do the read only section tracking, just not using the __devinitconst designation globally seems to be the best thing, just change it to __devinitdata instead.

So maybe just #define __devinitconst __devinitdata for those broken gcc versions?

Best Regards,
Michał Mirosław