From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-110.mimecast.com (us-smtp-delivery-110.mimecast.com [216.205.24.110]) by sourceware.org (Postfix) with ESMTP id 5EC853858D35 for ; Mon, 11 Oct 2021 19:09:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5EC853858D35 Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-511-Maxm1XcVNpKej4fIK7CjjA-1; Mon, 11 Oct 2021 15:09:34 -0400 X-MC-Unique: Maxm1XcVNpKej4fIK7CjjA-1 Received: by mail-oo1-f70.google.com with SMTP id k1-20020a4a8501000000b0029ac7b9dc82so10561541ooh.17 for ; Mon, 11 Oct 2021 12:09:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=DpwIeDefcIfgH4xuDhEvHwV/CP6uiXUSg5uShVSbBPU=; b=atD7g0pdpseo9Ajr32dJPa34HawV8TNDQlokca7vr6gbn/UYAOjLLFE14qZELfyDMm QgtzV+VXQOg7MTqcUyz3KY1Lv3kl50Gh+8SAXyelvd/Oc1jrKOwT2ckW2byOKjE32IB/ tUKrm4m9bdGyI9/UBJzayqTwrJ4rXmB5bG6ucne5qSF/ve8z6rY02e/ok7NaBXkwR5MS il2nI+Y37VXxrsIlU+rpcgWKNsf6LsPp0hVVLNt4bjZzc3TYJ32lUTfaiLihUzmg0W7B DIz69zewR3nHh07tRCKjf6/MD9EMcAIpMQOfqyy+HHWrJ9zWHeTzo3WJKMQLwgrucFYa Q8gQ== X-Gm-Message-State: AOAM533ChTBFPadCxodsqZc5msGklYfxUIPINInw0Uhf2g3BXB50oWgG /JRr7lLJOfXSyzrtAtgKt6bRRUF8T4GD3kwSMEgmHOQL1chFlA0H2MI7+6WKKalOBGd/iAC1X34 G9PByJD4Hlmci7Sw0MSv4sy4XVT1s X-Received: by 2002:a4a:2f0f:: with SMTP id p15mr6084711oop.44.1633979373061; Mon, 11 Oct 2021 12:09:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6ZwTA0ad3utO/YZeU5lZK3lVtheM0PnHugFN8SeURee5/KXAone0C4nQvP2quynmxwsZxXldmvDO2recsKGc= X-Received: by 2002:a4a:2f0f:: with SMTP id p15mr6084693oop.44.1633979372733; Mon, 11 Oct 2021 12:09:32 -0700 (PDT) MIME-Version: 1.0 From: Oleh Matiusha Date: Mon, 11 Oct 2021 22:09:21 +0300 Message-ID: Subject: ELF section not represented in symbol table To: gcc-help@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: globallogic.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Oct 2021 19:09:39 -0000 Hello GCC, I am stuck debugging the compilation of my kernel module. The files and copy-pasted description of this problem can be viewed here: github.com/omatiusha/cdevmod . My dir structure is following: .. |-linux (here resides the source code for linux kernel 5.14.0-09718-g4b93c544e90e, | built with GCC Ubuntu 9.3.0-17ubuntu1~20.04 + binutils 2.3= 4) |-linux-cross (here resides the source code for linux kernel 5.14.0-09718-g4b93c544e90e, | built with x86_64-linux-gcc 8.5.0 + binutils 2.36.1 | from https://mirrors.edge.kernel.org/pub/tools/crosstool/)= . | Tried also versions 9.4 and 11.1 from there. |-extmodules - repo mentioned above. I am trying to get my module working with kpatch (github.com/dynup/kpatch) and get stuck debugging the compiler. To spot the place when everything gets wrong, I compile this module independently four times, with host or cross compiler, and patched or unpatched. make KCFLAGS=3D"-ffunction-sections -fdata-sections" for host-compiler, and CROSS_COMPILE=3Dx86_64-linux- suffix=3D-cross make KCFLAGS=3D"-ffunction-se= ctions -fdata-sections" for cross-compiler. Then I dump symbols with objdump -t cdevmod.o and full text with objdump -s cdevmod.o | grep PATCHED -C5. And notice that for a host compiler, both sections .rodata.cdev_read.str1.1 and .rodata.cdev_read.str1.8 are present in symbol table of patched version, while for a cross compiler section .rodata.cdev_read.str1.1 is present as a section, but absent in the symbol table. This causes kpatch utilities not to work properly and crash. I want the cross compiler to behave like host one. Please someone suggest why it behaves differently. Best regards, Oleh Matiusha