From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id B2EB538582A7 for ; Fri, 15 Jul 2022 05:13:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B2EB538582A7 Received: by mail-ej1-x62d.google.com with SMTP id sz17so7014543ejc.9 for ; Thu, 14 Jul 2022 22:13:13 -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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=48/ekHW5uNzxHkfv5YAdds5AE2fYOOwvoNMHiTHXpVM=; b=glEKiaUXOIUN5odwR1oG8RiOfsXoYTgrgEh7bqsIpX+PPikNzmpHJwrKid1uUD8XeU dipNd/bPE9Mwll3Iv0PgyNWSRpVRgLGGiPYT8flothIsa/wISWbpSF70QsAkrku1OT28 NQhY66ydz7wU4kBtQ3DtebICbRleOQ/ciHQo1LOZLH11A2atOibbh9w3krwz3iYb6+Yx 7aj8o1588W0+EkuG6XkwkIi7PGsbOBFlZaODOzxyKhGP23y9uueDQQVrohSXNasQOMZY vpRfcreB35S+P/j+csesPXaujQfy40tNgGanONl6AHNKPr7ZblpQ6UtdheQI9N7DQSGE A2Ow== X-Gm-Message-State: AJIora9WGGoVa2TsRwHfwLkZe3b6SNWzs4WExVB+oqy092vpBv/lPDl3 g0MME4I+VUjIo9FM1foras8DYrFi1sv5QXBNvJCXIXC8 X-Google-Smtp-Source: AGRyM1sZoXMOipAUPUOwbWSVlmuFuFBxpa3wwZ6US5P8qCpwdSFwc59++YuOCRvb+wJS2iOXodTyQgGGKjGKYX49rGQ= X-Received: by 2002:a17:907:28ca:b0:72b:110a:b34e with SMTP id en10-20020a17090728ca00b0072b110ab34emr11938503ejc.113.1657861992406; Thu, 14 Jul 2022 22:13:12 -0700 (PDT) MIME-Version: 1.0 References: <20220714212651.297902-1-ghostmansd@gmail.com> In-Reply-To: From: Dmitry Selyutin Date: Fri, 15 Jul 2022 08:13:01 +0300 Message-ID: Subject: Re: [PATCH] gas/symbols: do not panic upon resolving O_md To: Alan Modra Cc: Binutils , Luke Kenneth Casson Leighton X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jul 2022 05:13:15 -0000 On Fri, Jul 15, 2022, 07:50 Alan Modra wrote: > On Fri, Jul 15, 2022 at 12:26:52AM +0300, Dmitry Selyutin wrote: > > + case O_md1...O_md32: > > Please don't use gcc extensions. > My initial impression was that the code uses them (e.g. ATTRIBUTE_UNUSED). But OK, actually the first thing I did was a simple "if" in the default section; I only thought that ranges would be more evident. Alternatively, we could have a bunch of O_md cases; 32 cases with just a simple break might be way too much, though. With md_resolve_symbol this makes more sense, I think. This might avoid the fatal error, but will still hit an error later > due to resolved not being set. I assume you mean symbol->flags.resolving = 0, right? If so, this is set after the switch (including this break). I think this calls for an > md_resolve_symbol. > Do you mean letting the caller define this as macro? I suggest calling it in "default:" section then, with the corresponding ifdef check.