2019-04-08 13:39:37

by Sedat Dilek

[permalink] [raw]
Subject: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

Hi Denys,

I fell over your commit "crypto: x86 - make constants readonly, allow
linker to merge them" [1] while digging into ClangBuiltLinux issue 431
[0].

I see the following in my dmesg-log:

$ grep sysfs: dmesg_5.0.4-rc1-1-amd64-cbl-asmgoto.txt
[Fri Mar 22 10:32:09 2019] sysfs: cannot create duplicate filename
'/module/usbcore/sections/.rodata.cst16'
[Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
'/module/nfsd/sections/.rodata.cst32'
[Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
'/module/iwlwifi/sections/.rodata.cst16'
[Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
'/module/i915/sections/.rodata.cst32'
[Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
'/module/mac80211/sections/.rodata.cst32'
[Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
'/module/iwlmvm/sections/.rodata.cst16'
[Fri Mar 22 10:32:20 2019] sysfs: cannot create duplicate filename
'/module/bluetooth/sections/.rodata.cst16'

Above modules have dependencies to stuff from arch/x86/crypto (see below P.S.).

Looks like LLD defaults to -ffunction-sections and -fdata-sections.
Do you happen to know what the defaults are for BFD linker?

LLD maintainers suggest me to put -fdata-sections.
But where?

I tried to put it into arch/86/Makefile:

KBUILD_CFLAGS_MODULE += -fdata-sections

No success.
Not sure if I need also to activate -ffunction-sections in this line.

Unsure if this is too aggressive...

diff --git a/Makefile b/Makefile
index ac29cd533d55..08bd1946e182 100644
--- a/Makefile
+++ b/Makefile
@@ -815,6 +815,8 @@ ifdef CONFIG_LD_DEAD_CODE_DATA_ELIMINATION
KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
LDFLAGS_vmlinux += --gc-sections
endif
+KBUILD_CFLAGS_KERNEL += -ffunction-sections -fdata-sections
+KBUILD_CFLAGS_MODULE += -ffunction-sections -fdata-sections

# arch Makefile may override CC so keep this after arch Makefile is included
NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)

...and what about the correlation with this setting init/Makefile...

ccflags-y := -fno-function-sections -fno-data-sections

More details see [0].

Maybe you have an idea?
If you need further informations, please let me know.

Thanks in advance.

Regards,
- Sedat -

[0] https://github.com/ClangBuiltLinux/linux/issues/431
[1] https://git.kernel.org/linus/e183914af00e15eb41ae666d44e323bfa154be13

P.S.: arch/x86/crypto dependencies

$ git grep -E 'rodata.cst16|rodata.cst32' | grep arch/x86
arch/x86/crypto/aegis128-aesni-asm.S:.section
.rodata.cst16.aegis128_const, "aM", @progbits, 32
arch/x86/crypto/aegis128-aesni-asm.S:.section
.rodata.cst16.aegis128_counter, "aM", @progbits, 16
arch/x86/crypto/aegis128l-aesni-asm.S:.section
.rodata.cst16.aegis128l_const, "aM", @progbits, 32
arch/x86/crypto/aegis128l-aesni-asm.S:.section
.rodata.cst16.aegis128l_counter, "aM", @progbits, 16
arch/x86/crypto/aegis256-aesni-asm.S:.section
.rodata.cst16.aegis256_const, "aM", @progbits, 32
arch/x86/crypto/aegis256-aesni-asm.S:.section
.rodata.cst16.aegis256_counter, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section
.rodata.cst16.gf128mul_x_ble_mask, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section .rodata.cst16.POLY,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section .rodata.cst16.TWOONE,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section
.rodata.cst16.SHUF_MASK, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section .rodata.cst16.MASK1,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section .rodata.cst16.MASK2,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section .rodata.cst16.ONE,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section
.rodata.cst16.F_MIN_MASK, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section .rodata.cst16.dec,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_asm.S:.section .rodata.cst16.enc,
"aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.POLY, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.POLY2, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.TWOONE, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.SHUF_MASK, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.ONE, "aM", @progbits, 16
arch/x86/crypto/aesni-intel_avx-x86_64.S:.section
.rodata.cst16.ONEf, "aM", @progbits, 16
arch/x86/crypto/camellia-aesni-avx-asm_64.S:.section .rodata.cst16,
"aM", @progbits, 16
arch/x86/crypto/camellia-aesni-avx2-asm_64.S:.section
.rodata.cst32.shufb_16x16b, "aM", @progbits, 32
arch/x86/crypto/camellia-aesni-avx2-asm_64.S:.section
.rodata.cst32.pack_bswap, "aM", @progbits, 32
arch/x86/crypto/camellia-aesni-avx2-asm_64.S:.section .rodata.cst16,
"aM", @progbits, 16
arch/x86/crypto/cast5-avx-x86_64-asm_64.S:.section
.rodata.cst16.bswap_mask, "aM", @progbits, 16
arch/x86/crypto/cast5-avx-x86_64-asm_64.S:.section
.rodata.cst16.bswap128_mask, "aM", @progbits, 16
arch/x86/crypto/cast5-avx-x86_64-asm_64.S:.section
.rodata.cst16.bswap_iv_mask, "aM", @progbits, 16
arch/x86/crypto/cast6-avx-x86_64-asm_64.S:.section .rodata.cst16,
"aM", @progbits, 16
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.ROT8,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.ROT16,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.CTRINC,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.CTR2BL,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.CTR4BL,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR2BL, "aM", @progbits, 32
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR4BL, "aM", @progbits, 32
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR8BL, "aM", @progbits, 32
arch/x86/crypto/chacha-ssse3-x86_64.S:.section .rodata.cst16.ROT8,
"aM", @progbits, 16
arch/x86/crypto/chacha-ssse3-x86_64.S:.section .rodata.cst16.ROT16,
"aM", @progbits, 16
arch/x86/crypto/chacha-ssse3-x86_64.S:.section .rodata.cst16.CTRINC,
"aM", @progbits, 16
arch/x86/crypto/crct10dif-pcl-asm_64.S:.section .rodata.cst16.mask1,
"aM", @progbits, 16
arch/x86/crypto/crct10dif-pcl-asm_64.S:.section .rodata.cst16.mask2,
"aM", @progbits, 16
arch/x86/crypto/crct10dif-pcl-asm_64.S:.section
.rodata.cst16.SHUF_MASK, "aM", @progbits, 16
arch/x86/crypto/crct10dif-pcl-asm_64.S:.section
.rodata.cst32.pshufb_shf_table, "aM", @progbits, 32
arch/x86/crypto/ghash-clmulni-intel_asm.S:.section
.rodata.cst16.bswap_mask, "aM", @progbits, 16
arch/x86/crypto/morus1280-avx2-asm.S:.section
.rodata.cst32.morus1280_const, "aM", @progbits, 32
arch/x86/crypto/morus1280-avx2-asm.S:.section
.rodata.cst32.morus1280_counter, "aM", @progbits, 32
arch/x86/crypto/morus1280-sse2-asm.S:.section
.rodata.cst16.morus640_const, "aM", @progbits, 16
arch/x86/crypto/morus1280-sse2-asm.S:.section
.rodata.cst16.morus640_counter, "aM", @progbits, 16
arch/x86/crypto/morus640-sse2-asm.S:.section
.rodata.cst16.morus640_const, "aM", @progbits, 32
arch/x86/crypto/morus640-sse2-asm.S:.section
.rodata.cst16.morus640_counter, "aM", @progbits, 16
arch/x86/crypto/poly1305-avx2-x86_64.S:.section .rodata.cst32.ANMASK,
"aM", @progbits, 32
arch/x86/crypto/poly1305-avx2-x86_64.S:.section .rodata.cst32.ORMASK,
"aM", @progbits, 32
arch/x86/crypto/poly1305-sse2-x86_64.S:.section .rodata.cst16.ANMASK,
"aM", @progbits, 16
arch/x86/crypto/poly1305-sse2-x86_64.S:.section .rodata.cst16.ORMASK,
"aM", @progbits, 16
arch/x86/crypto/serpent-avx-x86_64-asm_64.S:.section
.rodata.cst16.bswap128_mask, "aM", @progbits, 16
arch/x86/crypto/serpent-avx-x86_64-asm_64.S:.section
.rodata.cst16.xts_gf128mul_and_shl1_mask, "aM", @progbits, 16
arch/x86/crypto/serpent-avx2-asm_64.S:.section
.rodata.cst16.bswap128_mask, "aM", @progbits, 16
arch/x86/crypto/serpent-avx2-asm_64.S:.section
.rodata.cst16.xts_gf128mul_and_shl1_mask_0, "aM", @progbits, 16
arch/x86/crypto/serpent-avx2-asm_64.S:.section
.rodata.cst16.xts_gf128mul_and_shl1_mask_1, "aM", @progbits, 16
arch/x86/crypto/sha1_ni_asm.S:.section
.rodata.cst16.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 16
arch/x86/crypto/sha1_ni_asm.S:.section .rodata.cst16.UPPER_WORD_MASK,
"aM", @progbits, 16
arch/x86/crypto/sha256-avx-asm.S:.section
.rodata.cst16.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 16
arch/x86/crypto/sha256-avx-asm.S:.section
.rodata.cst16._SHUF_00BA, "aM", @progbits, 16
arch/x86/crypto/sha256-avx-asm.S:.section
.rodata.cst16._SHUF_DC00, "aM", @progbits, 16
arch/x86/crypto/sha256-avx2-asm.S:.section
.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 32
arch/x86/crypto/sha256-avx2-asm.S:.section
.rodata.cst32._SHUF_00BA, "aM", @progbits, 32
arch/x86/crypto/sha256-avx2-asm.S:.section
.rodata.cst32._SHUF_DC00, "aM", @progbits, 32
arch/x86/crypto/sha256-ssse3-asm.S:.section
.rodata.cst16.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 16
arch/x86/crypto/sha256-ssse3-asm.S:.section
.rodata.cst16._SHUF_00BA, "aM", @progbits, 16
arch/x86/crypto/sha256-ssse3-asm.S:.section
.rodata.cst16._SHUF_DC00, "aM", @progbits, 16
arch/x86/crypto/sha256_ni_asm.S:.section
.rodata.cst16.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 16
arch/x86/crypto/sha512-avx-asm.S:.section
.rodata.cst16.XMM_QWORD_BSWAP, "aM", @progbits, 16
arch/x86/crypto/sha512-avx2-asm.S:.section
.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 32
arch/x86/crypto/sha512-avx2-asm.S:.section
.rodata.cst32.MASK_YMM_LO, "aM", @progbits, 32
arch/x86/crypto/sha512-ssse3-asm.S:.section
.rodata.cst16.XMM_QWORD_BSWAP, "aM", @progbits, 16
arch/x86/crypto/twofish-avx-x86_64-asm_64.S:.section
.rodata.cst16.bswap128_mask, "aM", @progbits, 16
arch/x86/crypto/twofish-avx-x86_64-asm_64.S:.section
.rodata.cst16.xts_gf128mul_and_shl1_mask, "aM", @progbits, 16
- EOT -


2019-04-08 13:57:25

by Denys Vlasenko

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

On 4/8/19 3:36 PM, Sedat Dilek wrote:
> I fell over your commit "crypto: x86 - make constants readonly, allow
> linker to merge them" [1] while digging into ClangBuiltLinux issue 431
> [0].
>
> I see the following in my dmesg-log:
>
> $ grep sysfs: dmesg_5.0.4-rc1-1-amd64-cbl-asmgoto.txt
> [Fri Mar 22 10:32:09 2019] sysfs: cannot create duplicate filename
> '/module/usbcore/sections/.rodata.cst16'
> [Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
> '/module/nfsd/sections/.rodata.cst32'
> [Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
> '/module/iwlwifi/sections/.rodata.cst16'
> [Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
> '/module/i915/sections/.rodata.cst32'
> [Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
> '/module/mac80211/sections/.rodata.cst32'
> [Fri Mar 22 10:32:18 2019] sysfs: cannot create duplicate filename
> '/module/iwlmvm/sections/.rodata.cst16'
> [Fri Mar 22 10:32:20 2019] sysfs: cannot create duplicate filename
> '/module/bluetooth/sections/.rodata.cst16'
>
> Above modules have dependencies to stuff from arch/x86/crypto (see below P.S.).

Not sure how exactly this causes the error, but the cause seems to be
having more than one section with the same name. This occurs in only three files
(grep for ".rodata.cst16," string):

cast6-avx-x86_64-asm_64.S
camellia-aesni-avx2-asm_64.S
camellia-aesni-avx-asm_64.S

/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
.section .rodata.cst16, "aM", @progbits, 16

In other places I used .rodata.cst16.OBJECTNAME, but in these three cases
there are more than one object in the section, so I left it w/o OBJECTNAME.

I propose to change section name, append _module_ name and optionally
a comment why this is done:

/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
+/* There is more than one object in this section, let's use module name
+ as unique suffix */
-.section .rodata.cst16, "aM", @progbits, 16
+.section .rodata.cst16.cast6-avx-x86_64-asm_64, "aM", @progbits, 16


> Looks like LLD defaults to -ffunction-sections and -fdata-sections.
> Do you happen to know what the defaults are for BFD linker?

linker does not create section names. Compiler does for .c files,
for .S files they are made by a human.

2019-04-08 14:24:59

by Sedat Dilek

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

On Mon, Apr 8, 2019 at 3:58 PM Denys Vlasenko <[email protected]> wrote:
>
> On 4/8/19 3:56 PM, Denys Vlasenko wrote:
> > I propose to change section name, append _module_ name and optionally
> > a comment why this is done:
> >
> > /* NB: section is mergeable, all elements must be aligned 16-byte blocks */
> > +/* There is more than one object in this section, let's use module name
> > + as unique suffix */
>
> Probably not clear enough... maybe this is better:
>
> +/* There is more than one object in this section, let's use module name
> + instead of object name as unique suffix */
> -.section .rodata.cst16, "aM", @progbits, 16
>
> and do not use '-' in the name, replace with '_':
>
> +.section .rodata.cst16.cast6_avx_x86_64_asm_64, "aM", @progbits, 16
>
>

Hi Denys,

Thanks for the quick answer!

For the .rodata.cst16 part you mean sth. like this?

sdi@iniza:~/src/linux-kernel/linux$ git --no-pager diff
diff --git a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
index a14af6eb09cb..19b2b80258d2 100644
--- a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
+++ b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
@@ -573,8 +573,12 @@
ENDPROC(roundsm16_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
vmovdqu y7, 15 * 16(rio);


-/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
-.section .rodata.cst16, "aM", @progbits, 16
+/*
+ * NB: section is mergeable, all elements must be aligned 16-byte blocks
+ * There is more than one object in this section, let's use module name
+ * instead of object name as unique suffix
+ */
+.section .rodata.cst16.camellia-aesni-avx-asm_64, "aM", @progbits, 16
.align 16

#define SHUFB_BYTES(idx) \
diff --git a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
index b66bbfa62f50..d6ce36e82a93 100644
--- a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
+++ b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
@@ -626,8 +626,12 @@
ENDPROC(roundsm32_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
.long 0x00010203, 0x04050607, 0x80808080, 0x80808080
.long 0x00010203, 0x04050607, 0x80808080, 0x80808080

-/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
-.section .rodata.cst16, "aM", @progbits, 16
+/*
+ * NB: section is mergeable, all elements must be aligned 16-byte blocks
+ * There is more than one object in this section, let's use module name
+ * instead of object name as unique suffix
+*/
+.section .rodata.cst16.ccamellia-aesni-avx2-asm_64, "aM", @progbits, 16
.align 16

/* For CTR-mode IV byteswap */
diff --git a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
index 7f30b6f0d72c..fcd5732aba4d 100644
--- a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
@@ -225,7 +225,12 @@
vpshufb rmask, x2, x2; \
vpshufb rmask, x3, x3;

-.section .rodata.cst16, "aM", @progbits, 16
+/*
+ * NB: section is mergeable, all elements must be aligned 16-byte blocks
+ * There is more than one object in this section, let's use module name
+ * instead of object name as unique suffix
+ */
+.section .rodata.cst16.cast6_avx_x86_64_asm_64, "aM", @progbits, 16
.align 16
.Lxts_gf128mul_and_shl1_mask:
.byte 0x87, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0

Regards,
- Sedat -

2019-04-08 14:30:43

by Denys Vlasenko

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

On 4/8/19 4:23 PM, Sedat Dilek wrote:
> For the .rodata.cst16 part you mean sth. like this?

yes, see below

> --- a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> +++ b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> @@ -573,8 +573,12 @@
> ENDPROC(roundsm16_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
> vmovdqu y7, 15 * 16(rio);
>
>
> -/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
> -.section .rodata.cst16, "aM", @progbits, 16
> +/*
> + * NB: section is mergeable, all elements must be aligned 16-byte blocks
> + * There is more than one object in this section, let's use module name
> + * instead of object name as unique suffix
> + */
> +.section .rodata.cst16.camellia-aesni-avx-asm_64, "aM", @progbits, 16

dashes in the name may cause problems, replace with '_'.

> .align 16
>
> #define SHUFB_BYTES(idx) \
> diff --git a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> index b66bbfa62f50..d6ce36e82a93 100644
> --- a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> +++ b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> @@ -626,8 +626,12 @@
> ENDPROC(roundsm32_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
> .long 0x00010203, 0x04050607, 0x80808080, 0x80808080
> .long 0x00010203, 0x04050607, 0x80808080, 0x80808080
>
> -/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
> -.section .rodata.cst16, "aM", @progbits, 16
> +/*
> + * NB: section is mergeable, all elements must be aligned 16-byte blocks
> + * There is more than one object in this section, let's use module name
> + * instead of object name as unique suffix
> +*/
> +.section .rodata.cst16.ccamellia-aesni-avx2-asm_64, "aM", @progbits, 16

dashes in the name may cause problems, replace with '_'.

2019-04-08 14:43:27

by Denys Vlasenko

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

On 4/8/19 4:34 PM, Sedat Dilek wrote:
> v2:
>
> sdi@iniza:~/src/linux-kernel/linux$ git --no-pager diff
> diff --git a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> index a14af6eb09cb..712d6a7e8b8f 100644
> --- a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> +++ b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> @@ -573,8 +573,12 @@
> ENDPROC(roundsm16_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
> vmovdqu y7, 15 * 16(rio);
>
>
> -/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
> -.section .rodata.cst16, "aM", @progbits, 16
> +/*
> + * NB: section is mergeable, all elements must be aligned 16-byte blocks
> + * There is more than one object in this section, let's use module name
> + * instead of object name as unique suffix
> + */
> +.section .rodata.cst16.camellia_aesni_avx_asm_64, "aM", @progbits, 16
> .align 16
>
> #define SHUFB_BYTES(idx) \
> diff --git a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> index b66bbfa62f50..34f6b0c4196d 100644
> --- a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> +++ b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> @@ -626,8 +626,12 @@
> ENDPROC(roundsm32_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
> .long 0x00010203, 0x04050607, 0x80808080, 0x80808080
> .long 0x00010203, 0x04050607, 0x80808080, 0x80808080
>
> -/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
> -.section .rodata.cst16, "aM", @progbits, 16
> +/*
> + * NB: section is mergeable, all elements must be aligned 16-byte blocks
> + * There is more than one object in this section, let's use module name
> + * instead of object name as unique suffix
> +*/
> +.section .rodata.cst16.ccamellia_aesni_avx2_asm_64, "aM", @progbits, 16

why "ccamellia", not "camellia"?


> I tried to check for the .rodata.cst32 case, how do I identify the *.S files?

?

Looks like all .rodata.cst32 sections have suffixes, nothing to fix.

2019-04-08 14:55:54

by Denys Vlasenko

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

On 4/8/19 3:56 PM, Denys Vlasenko wrote:
> I propose to change section name, append _module_ name and optionally
> a comment why this is done:
>
>  /* NB: section is mergeable, all elements must be aligned 16-byte blocks */
> +/* There is more than one object in this section, let's use module name
> +   as unique suffix */

Probably not clear enough... maybe this is better:

+/* There is more than one object in this section, let's use module name
+ instead of object name as unique suffix */
-.section        .rodata.cst16, "aM", @progbits, 16

and do not use '-' in the name, replace with '_':

+.section        .rodata.cst16.cast6_avx_x86_64_asm_64, "aM", @progbits, 16


2019-04-08 15:06:26

by Sedat Dilek

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

On Mon, Apr 8, 2019 at 4:42 PM Denys Vlasenko <[email protected]> wrote:
>
> On 4/8/19 4:34 PM, Sedat Dilek wrote:
> > v2:
> >
> > sdi@iniza:~/src/linux-kernel/linux$ git --no-pager diff
> > diff --git a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> > b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> > index a14af6eb09cb..712d6a7e8b8f 100644
> > --- a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> > +++ b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> > @@ -573,8 +573,12 @@
> > ENDPROC(roundsm16_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
> > vmovdqu y7, 15 * 16(rio);
> >
> >
> > -/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
> > -.section .rodata.cst16, "aM", @progbits, 16
> > +/*
> > + * NB: section is mergeable, all elements must be aligned 16-byte blocks
> > + * There is more than one object in this section, let's use module name
> > + * instead of object name as unique suffix
> > + */
> > +.section .rodata.cst16.camellia_aesni_avx_asm_64, "aM", @progbits, 16
> > .align 16
> >
> > #define SHUFB_BYTES(idx) \
> > diff --git a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> > b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> > index b66bbfa62f50..34f6b0c4196d 100644
> > --- a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> > +++ b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> > @@ -626,8 +626,12 @@
> > ENDPROC(roundsm32_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
> > .long 0x00010203, 0x04050607, 0x80808080, 0x80808080
> > .long 0x00010203, 0x04050607, 0x80808080, 0x80808080
> >
> > -/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
> > -.section .rodata.cst16, "aM", @progbits, 16
> > +/*
> > + * NB: section is mergeable, all elements must be aligned 16-byte blocks
> > + * There is more than one object in this section, let's use module name
> > + * instead of object name as unique suffix
> > +*/
> > +.section .rodata.cst16.ccamellia_aesni_avx2_asm_64, "aM", @progbits, 16
>
> why "ccamellia", not "camellia"?
>

Grrr.

> > I tried to check for the .rodata.cst32 case, how do I identify the *.S files?
>
> ?
>
> Looks like all .rodata.cst32 sections have suffixes, nothing to fix.

$ for i in .rodata.cst32.pack_bswap .rodata.cst32.shufb_16x16b
.rodata.cst32.CTR2BL .rodata.cst32.CTR4BL .rodata.cst32.CTRINC
.rodata.cst32.ROT16 .rodata.cst32.ROT8 .rodata.cst32.CTR2BL
.rodata.cst32.CTR4BL .rodata.cst32.CTR8BL
.rodata.cst32.pshufb_shf_table .rodata.cst32.morus1280_const
.rodata.cst32.morus1280_counter .rodata.cst32.ANMASK
.rodata.cst32.ORMASK .rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK
.rodata.cst32._SHUF_00BA .rodata.cst32._SHUF_DC00
.rodata.cst32.MASK_YMM_LO .rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK ; do
echo [ "$i" ] ; git grep $i arch/x86 ; echo [ "/$i" ] ; echo "" ; done
[ .rodata.cst32.pack_bswap ]
arch/x86/crypto/camellia-aesni-avx2-asm_64.S:.section
.rodata.cst32.pack_bswap, "aM", @progbits, 32
[ /.rodata.cst32.pack_bswap ]

[ .rodata.cst32.shufb_16x16b ]
arch/x86/crypto/camellia-aesni-avx2-asm_64.S:.section
.rodata.cst32.shufb_16x16b, "aM", @progbits, 32
[ /.rodata.cst32.shufb_16x16b ]

[ .rodata.cst32.CTR2BL ]
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.CTR2BL,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR2BL, "aM", @progbits, 32
[ /.rodata.cst32.CTR2BL ]

[ .rodata.cst32.CTR4BL ]
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.CTR4BL,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR4BL, "aM", @progbits, 32
[ /.rodata.cst32.CTR4BL ]

[ .rodata.cst32.CTRINC ]
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.CTRINC,
"aM", @progbits, 32
[ /.rodata.cst32.CTRINC ]

[ .rodata.cst32.ROT16 ]
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.ROT16,
"aM", @progbits, 32
[ /.rodata.cst32.ROT16 ]

[ .rodata.cst32.ROT8 ]
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.ROT8,
"aM", @progbits, 32
[ /.rodata.cst32.ROT8 ]

[ .rodata.cst32.CTR2BL ]
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.CTR2BL,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR2BL, "aM", @progbits, 32
[ /.rodata.cst32.CTR2BL ]

[ .rodata.cst32.CTR4BL ]
arch/x86/crypto/chacha-avx2-x86_64.S:.section .rodata.cst32.CTR4BL,
"aM", @progbits, 32
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR4BL, "aM", @progbits, 32
[ /.rodata.cst32.CTR4BL ]

[ .rodata.cst32.CTR8BL ]
arch/x86/crypto/chacha-avx512vl-x86_64.S:.section
.rodata.cst32.CTR8BL, "aM", @progbits, 32
[ /.rodata.cst32.CTR8BL ]

[ .rodata.cst32.pshufb_shf_table ]
arch/x86/crypto/crct10dif-pcl-asm_64.S:.section
.rodata.cst32.pshufb_shf_table, "aM", @progbits, 32
[ /.rodata.cst32.pshufb_shf_table ]

[ .rodata.cst32.morus1280_const ]
arch/x86/crypto/morus1280-avx2-asm.S:.section
.rodata.cst32.morus1280_const, "aM", @progbits, 32
[ /.rodata.cst32.morus1280_const ]

[ .rodata.cst32.morus1280_counter ]
arch/x86/crypto/morus1280-avx2-asm.S:.section
.rodata.cst32.morus1280_counter, "aM", @progbits, 32
[ /.rodata.cst32.morus1280_counter ]

[ .rodata.cst32.ANMASK ]
arch/x86/crypto/poly1305-avx2-x86_64.S:.section .rodata.cst32.ANMASK,
"aM", @progbits, 32
[ /.rodata.cst32.ANMASK ]

[ .rodata.cst32.ORMASK ]
arch/x86/crypto/poly1305-avx2-x86_64.S:.section .rodata.cst32.ORMASK,
"aM", @progbits, 32
[ /.rodata.cst32.ORMASK ]

[ .rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK ]
arch/x86/crypto/sha256-avx2-asm.S:.section
.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 32
arch/x86/crypto/sha512-avx2-asm.S:.section
.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 32
[ /.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK ]

[ .rodata.cst32._SHUF_00BA ]
arch/x86/crypto/sha256-avx2-asm.S:.section
.rodata.cst32._SHUF_00BA, "aM", @progbits, 32
[ /.rodata.cst32._SHUF_00BA ]

[ .rodata.cst32._SHUF_DC00 ]
arch/x86/crypto/sha256-avx2-asm.S:.section
.rodata.cst32._SHUF_DC00, "aM", @progbits, 32
[ /.rodata.cst32._SHUF_DC00 ]

[ .rodata.cst32.MASK_YMM_LO ]
arch/x86/crypto/sha512-avx2-asm.S:.section
.rodata.cst32.MASK_YMM_LO, "aM", @progbits, 32
[ /.rodata.cst32.MASK_YMM_LO ]

[ .rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK ]
arch/x86/crypto/sha256-avx2-asm.S:.section
.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 32
arch/x86/crypto/sha512-avx2-asm.S:.section
.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK, "aM", @progbits, 32
[ /.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK ]

- Sedat -

2019-04-08 15:41:41

by Sedat Dilek

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

On Mon, Apr 8, 2019 at 4:29 PM Denys Vlasenko <[email protected]> wrote:
>
> On 4/8/19 4:23 PM, Sedat Dilek wrote:
> > For the .rodata.cst16 part you mean sth. like this?
>
> yes, see below
>
> > --- a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> > +++ b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
> > @@ -573,8 +573,12 @@
> > ENDPROC(roundsm16_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
> > vmovdqu y7, 15 * 16(rio);
> >
> >
> > -/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
> > -.section .rodata.cst16, "aM", @progbits, 16
> > +/*
> > + * NB: section is mergeable, all elements must be aligned 16-byte blocks
> > + * There is more than one object in this section, let's use module name
> > + * instead of object name as unique suffix
> > + */
> > +.section .rodata.cst16.camellia-aesni-avx-asm_64, "aM", @progbits, 16
>
> dashes in the name may cause problems, replace with '_'.
>
> > .align 16
> >
> > #define SHUFB_BYTES(idx) \
> > diff --git a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> > b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> > index b66bbfa62f50..d6ce36e82a93 100644
> > --- a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> > +++ b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
> > @@ -626,8 +626,12 @@
> > ENDPROC(roundsm32_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
> > .long 0x00010203, 0x04050607, 0x80808080, 0x80808080
> > .long 0x00010203, 0x04050607, 0x80808080, 0x80808080
> >
> > -/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
> > -.section .rodata.cst16, "aM", @progbits, 16
> > +/*
> > + * NB: section is mergeable, all elements must be aligned 16-byte blocks
> > + * There is more than one object in this section, let's use module name
> > + * instead of object name as unique suffix
> > +*/
> > +.section .rodata.cst16.ccamellia-aesni-avx2-asm_64, "aM", @progbits, 16
>
> dashes in the name may cause problems, replace with '_'.

Oops.

v2:

sdi@iniza:~/src/linux-kernel/linux$ git --no-pager diff
diff --git a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
index a14af6eb09cb..712d6a7e8b8f 100644
--- a/arch/x86/crypto/camellia-aesni-avx-asm_64.S
+++ b/arch/x86/crypto/camellia-aesni-avx-asm_64.S
@@ -573,8 +573,12 @@
ENDPROC(roundsm16_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
vmovdqu y7, 15 * 16(rio);


-/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
-.section .rodata.cst16, "aM", @progbits, 16
+/*
+ * NB: section is mergeable, all elements must be aligned 16-byte blocks
+ * There is more than one object in this section, let's use module name
+ * instead of object name as unique suffix
+ */
+.section .rodata.cst16.camellia_aesni_avx_asm_64, "aM", @progbits, 16
.align 16

#define SHUFB_BYTES(idx) \
diff --git a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
index b66bbfa62f50..34f6b0c4196d 100644
--- a/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
+++ b/arch/x86/crypto/camellia-aesni-avx2-asm_64.S
@@ -626,8 +626,12 @@
ENDPROC(roundsm32_x4_x5_x6_x7_x0_x1_x2_x3_y4_y5_y6_y7_y0_y1_y2_y3_ab)
.long 0x00010203, 0x04050607, 0x80808080, 0x80808080
.long 0x00010203, 0x04050607, 0x80808080, 0x80808080

-/* NB: section is mergeable, all elements must be aligned 16-byte blocks */
-.section .rodata.cst16, "aM", @progbits, 16
+/*
+ * NB: section is mergeable, all elements must be aligned 16-byte blocks
+ * There is more than one object in this section, let's use module name
+ * instead of object name as unique suffix
+*/
+.section .rodata.cst16.ccamellia_aesni_avx2_asm_64, "aM", @progbits, 16
.align 16

/* For CTR-mode IV byteswap */
diff --git a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
index 7f30b6f0d72c..fcd5732aba4d 100644
--- a/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
+++ b/arch/x86/crypto/cast6-avx-x86_64-asm_64.S
@@ -225,7 +225,12 @@
vpshufb rmask, x2, x2; \
vpshufb rmask, x3, x3;

-.section .rodata.cst16, "aM", @progbits, 16
+/*
+ * NB: section is mergeable, all elements must be aligned 16-byte blocks
+ * There is more than one object in this section, let's use module name
+ * instead of object name as unique suffix
+ */
+.section .rodata.cst16.cast6_avx_x86_64_asm_64, "aM", @progbits, 16
.align 16
.Lxts_gf128mul_and_shl1_mask:
.byte 0x87, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0

I tried to check for the .rodata.cst32 case, how do I identify the *.S files?

- Sedat -

2019-04-08 15:50:40

by Sedat Dilek

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

We have arch/x86/crypto/chacha-avx2-x86_64.S and
arch/x86/crypto/chacha-avx512vl-x86_64.S:

.rodata.cst32.CTR2BL
.rodata.cst32.CTR4BL
.rodata.cst32.CTR2BL
.rodata.cst32.CTR4BL

...and in arch/x86/crypto/sha256-avx2-asm.S and
arch/x86/crypto/sha512-avx2-asm.S:

.rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK

Correct?

- Sedat -

2019-04-08 15:52:51

by Denys Vlasenko

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

On 4/8/19 4:57 PM, Sedat Dilek wrote:
> We have arch/x86/crypto/chacha-avx2-x86_64.S and
> arch/x86/crypto/chacha-avx512vl-x86_64.S:
>
> .rodata.cst32.CTR2BL
> .rodata.cst32.CTR4BL
> .rodata.cst32.CTR2BL
> .rodata.cst32.CTR4BL
>
> ...and in arch/x86/crypto/sha256-avx2-asm.S and
> arch/x86/crypto/sha512-avx2-asm.S:
>
> .rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK
>
> Correct?

You mean, we have duplicate section names.

Well, this brings me to my initial response -
"Not sure how exactly this causes the error".

Duplicate section names are allowed by the linker.
There is nothing wrong with that.

The warnings you see come from some other tooling,
which does not handle correctly object files with more
than one section with the same name.

(Having unique names is still preferable,
it helps humans to more easily find where sections come from,
and for potential future --gc-sections optimization).

2019-04-08 16:01:03

by Sedat Dilek

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

On Mon, Apr 8, 2019 at 5:04 PM Denys Vlasenko <[email protected]> wrote:
>
> On 4/8/19 4:57 PM, Sedat Dilek wrote:
> > We have arch/x86/crypto/chacha-avx2-x86_64.S and
> > arch/x86/crypto/chacha-avx512vl-x86_64.S:
> >
> > .rodata.cst32.CTR2BL
> > .rodata.cst32.CTR4BL
> > .rodata.cst32.CTR2BL
> > .rodata.cst32.CTR4BL
> >
> > ...and in arch/x86/crypto/sha256-avx2-asm.S and
> > arch/x86/crypto/sha512-avx2-asm.S:
> >
> > .rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK
> >
> > Correct?
>
> You mean, we have duplicate section names.
>
> Well, this brings me to my initial response -
> "Not sure how exactly this causes the error".
>
> Duplicate section names are allowed by the linker.
> There is nothing wrong with that.
>
> The warnings you see come from some other tooling,
> which does not handle correctly object files with more
> than one section with the same name.
>
> (Having unique names is still preferable,
> it helps humans to more easily find where sections come from,
> and for potential future --gc-sections optimization).

LLD offers these options:

--check-sections Check section addresses for overlaps (default)

--ignore-data-address-equality
lld can break the address equality of data

--ignore-function-address-equality
lld can break the address equality of functions

- Sedat -

2019-04-08 17:26:25

by Sedat Dilek

[permalink] [raw]
Subject: Re: CBL issue #431: lld: x86_64: sysfs: cannot create duplicate filename $module/.rodata.cst{16,32}

On Mon, Apr 8, 2019 at 5:04 PM Denys Vlasenko <[email protected]> wrote:
>
> On 4/8/19 4:57 PM, Sedat Dilek wrote:
> > We have arch/x86/crypto/chacha-avx2-x86_64.S and
> > arch/x86/crypto/chacha-avx512vl-x86_64.S:
> >
> > .rodata.cst32.CTR2BL
> > .rodata.cst32.CTR4BL
> > .rodata.cst32.CTR2BL
> > .rodata.cst32.CTR4BL
> >
> > ...and in arch/x86/crypto/sha256-avx2-asm.S and
> > arch/x86/crypto/sha512-avx2-asm.S:
> >
> > .rodata.cst32.PSHUFFLE_BYTE_FLIP_MASK
> >
> > Correct?
>
> You mean, we have duplicate section names.
>
> Well, this brings me to my initial response -
> "Not sure how exactly this causes the error".
>
> Duplicate section names are allowed by the linker.
> There is nothing wrong with that.
>
> The warnings you see come from some other tooling,
> which does not handle correctly object files with more
> than one section with the same name.
>
> (Having unique names is still preferable,
> it helps humans to more easily find where sections come from,
> and for potential future --gc-sections optimization).

So, this is only a warning?

I can check what...

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 64d5a3327030..6df511429c28 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -167,6 +167,7 @@ config X86
select HAVE_KPROBES_ON_FTRACE
select HAVE_FUNCTION_ERROR_INJECTION
select HAVE_KRETPROBES
+ select HAVE_LD_DEAD_CODE_DATA_ELIMINATION if X86_64
select HAVE_KVM
select HAVE_LIVEPATCH if X86_64
select HAVE_MEMBLOCK_NODE_MAP

...and CONFIG_LD_DEAD_CODE_DATA_ELIMINATION=y does.

- Sedat -