Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp171754pxb; Wed, 25 Aug 2021 23:48:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzy7G+O6VZiku/xJ6m2j+Qr1DaYqz/MFJK60+ffWJsdz6CJOBTlRM2iGnoJl0aWlCGQxXSQ X-Received: by 2002:a02:90d0:: with SMTP id c16mr2207059jag.106.1629960516471; Wed, 25 Aug 2021 23:48:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629960516; cv=none; d=google.com; s=arc-20160816; b=AqVyN7tBFInVpeaHUrp5DMUZFIb+L5VmJ5W6oheeAEr+ZaZX6Va4bNMJNP6r163f86 6e2B0h6pVMTy38dURuAEpchuk1Z/iTkH77/5dUq3L5QpinkLmVqkOQLSnnujS8YxeeFX CRHa7jYhcNCWtVg3bZCrteImxHLYkMZ3jGAUlb8xM7tacv85LmVpHeLJFZvvp61ZTRmB 22s8vqWq/390wBhcD2mIpHhHRH2nCty1SXMYFg/7N6E1N2HMIfgmIwX7gCuDUf0GbpcF 9pHhZxgh8O1lmQH55Im7x08jsiKHBdGJIQc8L3hs8++TiV/+ZlxobElAGa6vdGO0rlpq O64A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:to:from:cc:in-reply-to:subject:date:dkim-signature; bh=IfBQ9EQzqzyBufGLfayWB/BJYht5LPZwpL5oj1Hp0nE=; b=l8wjJo023f+rcfr+4Njjy4c2p2XOtiZTy7FuWbMd0tJuk2WHtguIdhh2mwz0IWpwV1 PONEG2WkUTrFaMaVBy1zIzPvmjKcBWlz7MJzJrf8JMxL74o2raaUST+Xn4PjuZUTGwYD 0VzMLtXtOuUirk9dFKyA+SNIn8q50hoQSWi0Om6sGzlfTCUV6frGIhEVjEKVypgAxtS9 Jl1Tt1GEArrXjO9sSmIYRn24TPwaGJkWsIH41mkv4MWg1jz4+O/ccdeq0zQpvhL/kuh4 JOEwZHIZxMEbddiB7Im2qyfB+77Fd3n4q7syorrZRI64beYvCpZG+iRvY97KVHUX6nCL suhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=ko9rI9c0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t1si1933681jao.24.2021.08.25.23.48.25; Wed, 25 Aug 2021 23:48:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@dabbelt-com.20150623.gappssmtp.com header.s=20150623 header.b=ko9rI9c0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240064AbhHZGrv (ORCPT + 99 others); Thu, 26 Aug 2021 02:47:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239338AbhHZGru (ORCPT ); Thu, 26 Aug 2021 02:47:50 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2D19C061757 for ; Wed, 25 Aug 2021 23:47:03 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id x16so1942024pfh.2 for ; Wed, 25 Aug 2021 23:47:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dabbelt-com.20150623.gappssmtp.com; s=20150623; h=date:subject:in-reply-to:cc:from:to:message-id:mime-version :content-transfer-encoding; bh=IfBQ9EQzqzyBufGLfayWB/BJYht5LPZwpL5oj1Hp0nE=; b=ko9rI9c02DG8tUV3UZ4LLccgE4AJB8nGYFDS6AJvgTUZUAFTvAVtZ0ZHp1A2xZF6Fl cKdhqouTOATo01CqdK27oiKOWDt0xxdqVpDIbYcZcIKSb7vOwK1+T2DhA3ZIrwLq4R9e 6Ds3ub596c5L7iZNhK5LojA0pvQ3fDGUthgXidz1+G1ABqgFOfa9qaYKYO7/lrzHdYck DGX6I4sKPiOPgpf2WIiv2ODwYgArWUF9G+neuqKFxuwZn1qgAcuiV3VPAEvYRT1xjpfJ uGid1Aqg1Y5H0ZBIZHedHUeTG3I0/VkxMiTH03yT+hJTJDe2Xf7uqU7kvXEfs6o59Jqh dUzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:subject:in-reply-to:cc:from:to:message-id :mime-version:content-transfer-encoding; bh=IfBQ9EQzqzyBufGLfayWB/BJYht5LPZwpL5oj1Hp0nE=; b=bIX2wRPsRVLdLSDqlKenRvNP0dd5Eb66MxrWeUTk68AeASj7Zo6VT8zzwA2PJAslZS sKOQhUzQoYfAUkt2aiF1VYivK1fM5Pou5Dsh5upN+7cEOM8uZCmKWbaoPgxkEeAiCdbW sVEE5EBgOv6D3ErG9RvB7e+ds+vCX/t3pf7NK/XJFm6F65jXuzViGgN81TXsqPTbgb1H 3KBz9SdL8RBul/cc4He5NDeDgw3V5Oo0Sm2h3GUFDEaoGAvbyWbtFj+f/RwCdA0rUUgJ jpmCQxCb/x/glQOyGVm79d0Eldhqhn6sBjwRKSt/KxFSnPGOj8jlY0TePJeIhIWPctPM RkyA== X-Gm-Message-State: AOAM5308SF92ZP5jwis3ys92YpD/BYzjEsUsBfcVbkQbTqyuRrouXq14 8P+iGy52mtAE/d3Wf3eUryNoig== X-Received: by 2002:aa7:8c44:0:b0:3f1:ec34:6438 with SMTP id e4-20020aa78c44000000b003f1ec346438mr2278174pfd.6.1629960423223; Wed, 25 Aug 2021 23:47:03 -0700 (PDT) Received: from localhost (76-210-143-223.lightspeed.sntcca.sbcglobal.net. [76.210.143.223]) by smtp.gmail.com with ESMTPSA id h9sm8334865pjg.9.2021.08.25.23.47.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Aug 2021 23:47:02 -0700 (PDT) Date: Wed, 25 Aug 2021 23:47:02 -0700 (PDT) X-Google-Original-Date: Wed, 25 Aug 2021 23:47:00 PDT (-0700) Subject: Re: [PATCH 0/2] riscv: improve __ex_table section handling In-Reply-To: <20210809012509.4983c1d6@xhacker> CC: Paul Walmsley , aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org From: Palmer Dabbelt To: jszhang3@mail.ustc.edu.cn Message-ID: Mime-Version: 1.0 (MHng) Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 08 Aug 2021 10:25:09 PDT (-0700), jszhang3@mail.ustc.edu.cn wrote: > From: Jisheng Zhang > > Enable BUILDTIME_TABLE_SORT to sort the exception table at build time > then move exception table to RO_DATA segment. > > Jisheng Zhang (2): > riscv: Enable BUILDTIME_TABLE_SORT > riscv: Move EXCEPTION_TABLE to RO_DATA segment > > arch/riscv/Kconfig | 1 + > arch/riscv/kernel/vmlinux-xip.lds.S | 1 - > arch/riscv/kernel/vmlinux.lds.S | 4 ++-- > scripts/sorttable.c | 1 + > 4 files changed, 4 insertions(+), 3 deletions(-) This seems reasonable, but it's failing for some configurations (at least tinyconfig) saying there is no __ex_table. I'm not entirely sure how that comes about, as we've got them for futexes and uaccess. Maybe the right thing to do here is to fix scripts/sorttable.c so it can handle files with nothing to sort? I think it's just as simple as a successful early out like this diff --git a/scripts/sorttable.h b/scripts/sorttable.h index a2baa2fefb13..207ddeddb506 100644 --- a/scripts/sorttable.h +++ b/scripts/sorttable.h @@ -294,8 +294,9 @@ static int do_sort(Elf_Ehdr *ehdr, goto out; } #endif + /* If there is no __ex_table section there is no work do to. */ if (!extab_sec) { - fprintf(stderr, "no __ex_table in file: %s\n", fname); + rc = 0; goto out; } I'm not entirely sure though -- my logic is essentially just "there's no __ex_table, so there's nothing to sort, so just don't try". All the configurations I can actually boot have an __ex_table, so I'm not sure how to test that.