Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp4382838rwo; Tue, 25 Jul 2023 05:27:32 -0700 (PDT) X-Google-Smtp-Source: APBJJlH/fOt7uGw6UqZOpT50CtBXQTilAT13qhBYqI8yn2NBeo99Cc1j7+AF2uuYVnY7elQRbv0G X-Received: by 2002:a05:6a20:3d0d:b0:137:e09b:2184 with SMTP id y13-20020a056a203d0d00b00137e09b2184mr12772105pzi.29.1690288052235; Tue, 25 Jul 2023 05:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690288052; cv=none; d=google.com; s=arc-20160816; b=bz0WXE6t8jZboukqTfzdABXnSGJ2i84V4nXrXAhcl7LILRNzvzVnH3ixxf+JzC/+P8 7FTeRISdtsr1WJZfUSg8VFOSV+VNayzR0ZPohRes9KQN8U7W2sNDVsRHNYX5IYD1Qolt Xl6EAOL/JnR2iLB5iW+JT6kZayBwMNG9BfYK9axWEvLCDNadW7OTSLHx/mLqqJ6XHWgL Jh8+vGCImzETfgzTnUD9E8C0trcACQnEok+gtm3gNKomlUmA2ewonsOu9senePK4GTOc Y3zJQP7GvM5YRhsVrsnuoQn1uhoR3uir0JdE9AvLxWMwi+bXnAUkDOVz7/9B2lVRpLXr 2+1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=nDERFXrUTHMcnX/B9wmmuuCM/35oLwV5LmBLcKHQ7wo=; fh=bt+fV2PXxyEb5lcXBBKB9gibR5cwjHwaRwIF76B6+JE=; b=r1lN1IFoeGpD4Ue0ztk95m2/jIM1F7v3T190GUv0kqSKQMlqv8WQg3M3l+VAHZ5QQG y0n+1+O7To2mxVxeu4IS/0fa9ZbQ6DTqyptV3VTFQYlHz2ibCGgayLfeY3nMy710qfBR KFIU2VGKvJ2IPdC0OwS/yFZNXDwz4bm0Oq8vYM2wiiXDl+6W9f4AmrJS2GUPi62neFhH pFAgDr7VShW4E8IALGmh1/16F1BypeHxlU0tsnI9mHBNEpWkMZyUNQ/kFHFP5iTkzsAP s+vxhxv+39FKVMBnfJm6xk+qHVb/HPH0/OEFExu+UtC5AbC6BQNBzS/C1heiN+ZtDpWJ 1jEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vVrOwE9e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 12-20020a63144c000000b0053f24deef0dsi11293094pgu.312.2023.07.25.05.27.19; Tue, 25 Jul 2023 05:27:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=vVrOwE9e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233240AbjGYMAb (ORCPT + 99 others); Tue, 25 Jul 2023 08:00:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233000AbjGYMAU (ORCPT ); Tue, 25 Jul 2023 08:00:20 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 82CB810D1 for ; Tue, 25 Jul 2023 05:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=nDERFXrUTHMcnX/B9wmmuuCM/35oLwV5LmBLcKHQ7wo=; b=vVrOwE9e+Wq1O4vz+7qVdMBX2e Pbru78bvc4yve8vj0VufKsfCHTuJkwrcOHaj0Ok66ByYTJWcDmlN4oBalUd6ZG+gQOgd5m/QHvv3Q 0P9J1P2AlzlEcaV5yU4HUb9oRegnf29+wlmHTuElBXOeKYnD1safRRwtrRY/C0JjPpTcEAfxZTs9e sj6pONddrXe46B0mympuVy+warKuGeKTsbTqkjO6y6HPPILntLtnDr76drWehoYLCo3+yVSWOJiJU BJ4x6zjRQyE7YgOeTgQHsCbRh99dZtGhBxcI84n6chk2Nwv1VxQaa96J81bjQkgoTRsuQh0Efwp9d H1/xLevA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qOGhr-005RMi-IC; Tue, 25 Jul 2023 12:00:00 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 96A3030056F; Tue, 25 Jul 2023 13:59:59 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 7FCDB2612ABE5; Tue, 25 Jul 2023 13:59:59 +0200 (CEST) Date: Tue, 25 Jul 2023 13:59:59 +0200 From: Peter Zijlstra To: Tiezhu Yang Cc: Josh Poimboeuf , Huacai Chen , loongarch@lists.linux.dev, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Subject: Re: [PATCH v1 5/6] objtool: Add skipped member in struct reloc Message-ID: <20230725115959.GE3765278@hirez.programming.kicks-ass.net> References: <1690272910-11869-1-git-send-email-yangtiezhu@loongson.cn> <1690272910-11869-6-git-send-email-yangtiezhu@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1690272910-11869-6-git-send-email-yangtiezhu@loongson.cn> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 25, 2023 at 04:15:09PM +0800, Tiezhu Yang wrote: > There exist multiple relocation types in one location, such as a pair of > R_LARCH_ADD32 and R_LARCH_SUB32 in section .rela.discard.unreachable and > .rela.discard.reachable on LoongArch. > > Here is an example: > > $ readelf -rW init/main.o > > Relocation section '.rela.discard.unreachable' at offset 0x3e20 contains 2 entries: > Offset Info Type Symbol's Value Symbol's Name + Addend > 0000000000000000 0000000a00000032 R_LARCH_ADD32 0000000000000000 .init.text + 230 > 0000000000000000 0000001a00000037 R_LARCH_SUB32 0000000000000000 L0^A + 0 > Please explain; why is this? How does: #define __annotate_unreachable(c) ({ \ asm volatile(__stringify_label(c) ":\n\t" \ ".pushsection .discard.unreachable\n\t" \ ".long " __stringify_label(c) "b - .\n\t" \ ".popsection\n\t" : : "i" (c)); \ }) #define annotate_unreachable() __annotate_unreachable(__COUNTER__) Manage to generate this..