Re: section mismatch test doesn't work reliably on arm64

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Fri, Sep 29, 2023 at 10:15:40AM +0200, Uwe Kleine-König wrote:
> by manual inspection I found a section mismatch in
> drivers/hwtracing/coresight/coresight-etm4x-core.c where
> etm4_platform_driver (which lives in ".data") contains a reference to
> etm4_remove_platform_dev() (which lives in ".exit.text").
> 
> However building with CONFIG_DEBUG_SECTION_MISMATCH=y +
> CONFIG_CORESIGHT_SOURCE_ETM4X=y doesn't warn about that one.

Arnd had the right hint in irc: If I do

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 34a5386d444a..070e53be1ea2 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -1017,7 +1017,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,
 
 	/* symbols in data sections that may refer to meminit/exit sections */
 	if (match(fromsec, PATTERNS(DATA_SECTIONS)) &&
-	    match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS, ALL_EXIT_SECTIONS)) &&
+	    match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS, ALL_XXXEXIT_SECTIONS)) &&
 	    match(fromsym, PATTERNS("*driver")))
 		return 0;
 
I get a mismatch warning:

WARNING: modpost: vmlinux: section mismatch in reference: etm4x_amba_driver+0x98 (section: .data) -> etm4_remove_amba (section: .exit.text)
WARNING: modpost: vmlinux: section mismatch in reference: etm4_platform_driver+0x8 (section: .data) -> etm4_remove_platform_dev (section: .exit.text)
ERROR: modpost: Section mismatches detected.

I remember that back in the times of CONFIG_HOTPLUG references to
".devinit.text" and ".devexit.text" were ok. Is a reference to
.exit.text ever ok?

I started an allyesconfig build on a few archs with the above patch
applied. This will take some time, when it's done I will report what it
found.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux