From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb2c.google.com (mail-yb1-xb2c.google.com [IPv6:2607:f8b0:4864:20::b2c]) by sourceware.org (Postfix) with ESMTPS id 8F8E83858C20 for ; Tue, 23 Jan 2024 12:50:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F8E83858C20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8F8E83858C20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::b2c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706014262; cv=none; b=Ili5pXgHlKsu18PWVtrvsz9MKoJwKjEv7w9huYQQc2i7zGDGhNORA+wH9oSNigvlYjqE4FqCzparmEjo+BVq0D887T3Qldm96qA6vbenmA2GdB9UEDFUfi+sIljmArEK1BHupKLe15tRWLjF/mfF2RZ95bjeFxIXstJaPjTJZW0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706014262; c=relaxed/simple; bh=UGTDjrj104HX6EASE2mIqnsdug8oS/Lyrdwt1W8Js3s=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=L1q2YzBFWF68qlEAo2YMqFMWbbpjEAonjs9eFToY3K1SZsCdidwzfotRnd5ANavq0L5q7S669zJm5qrRzr12Ge8o2Y+c0r8c1ybtzjbiCSxI3JntW55vUnWme6KYl8+DGfybspyV/54+ysxC68UgMnVcVmUVAhr8jcje/7vofTU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yb1-xb2c.google.com with SMTP id 3f1490d57ef6-dc236729a2bso3557386276.0 for ; Tue, 23 Jan 2024 04:50:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706014258; x=1706619058; darn=sourceware.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1VA09551M52OPG87BcuvtsUag9iB2mH4tfChXsFDW3o=; b=E5WibW47nuGMA2damtIexhitZXBSvcS3U0HJPFqBwVhPSDNbSsbiNGVJJs3rQwKeMX nJWHZVRP8oERUhwFkGjwROzkinx/Jb2p1HsziQRZZmJqlqfZf87azPD0ZJLFnbEkb95H GnRv8cTZTeS/SI3gRonrx1R9eBT/ot3YUlcn/3RDAnyThMV/wXj18zfh2FfaJqnVkcnQ xkHjGBHUZicVD5/EG4zy6vQY0iBstAjMN0eog/rIs6q1mudkYxtJRa3JylJUvSVKh2ca swxmqF28g4xQBwZpcAnpTAc6zwoC8A4r9b+M56927bmCQUsAwuf+ehltFBGnjpCSOl27 NrMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706014258; x=1706619058; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1VA09551M52OPG87BcuvtsUag9iB2mH4tfChXsFDW3o=; b=FMZVOvqoTdya22HkPKsqygAWnKmQbzs1pZ2fGmULRTcmcmDy8n9gMgJW1TZtoNu9MS YwdMl3bA5g3dVYv5IyJBJSpogcQKZ0QIcLaK9XDGxXaNEV94D60OhdDErF/YHI69bTSz W6d50sjKeD65Ll6nhRzarWYb+c09G46viMj651suhA8yKKtDXg6enVe8eK4YIPhNfi5G idoTzK3OVZCC8Bszc5E44fgNKTEVZtFBgQGPrg86R/E0+oUiq+ynvgQBQVfaQq63OtmX wDUroZdVvaZm2O5ljDPNYyloNWrf3VSra6ZD5vBQLh/TPzYl+Iq2bB3vi06FbpXFxHjl RvbQ== X-Gm-Message-State: AOJu0YzIraG5lVTyJhO1su28MubtZrvIu1/2sFNHevLBlmvZbwbqzfHZ f3GdF6mp+awAC950BhPQQo7uMQGsWxuAVLmvS3c5vZWpJ2jwNqTlRzYYCi2+6RBpCGXycAR7G0z vVkPfTdqQfBOJ3255t1H9RktqFziNMfDmTL8= X-Google-Smtp-Source: AGHT+IGlQjwtZiyymvpmc5rzXt3L69/MhXNrxtw31Sm7Iyw1T0KV8aeMDyiqPsLX/8yc3KS604S2gbSbLb5O/Jrd8Ko= X-Received: by 2002:a05:6902:1ac6:b0:dbd:2e77:7ad2 with SMTP id db6-20020a0569021ac600b00dbd2e777ad2mr3846690ybb.17.1706014257911; Tue, 23 Jan 2024 04:50:57 -0800 (PST) MIME-Version: 1.0 References: <87fryomdy6.fsf@redhat.com> In-Reply-To: From: "H.J. Lu" Date: Tue, 23 Jan 2024 04:50:21 -0800 Message-ID: Subject: Re: RFC: Document unexpected behaviour of --fatal-warnings To: Jan Beulich Cc: Nick Clifton , serge.guelton@telecom-bretagne.eu, binutils@sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-3015.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Jan 23, 2024 at 4:39=E2=80=AFAM Jan Beulich wro= te: > > On 23.01.2024 13:28, Nick Clifton wrote: > > Hi Guys, > > > > It was recently pointed out to me that the bfd linker's > > --fatal-warnings option can behave in an unexpected manner. For > > example: > > > > $ ld.bfd -z bad-option --fatal-warnings -e 0/dev/null > > ld.bfd: warning: -z bad-option ignored > > $ echo $? > > 0 > > > > ie the warning about the ignored option is not being treated as an > > error. This happens because the --fatal-warnings option only takes > > affect after it has been processed, and we process the options in a > > linear order. So the following works: > > > > $ ld.bfd --fatal-warnings -z bad-option -e 0 /dev/null > > ld.bfd: warning: -z bad-option ignored > > $ echo $? > > 1 > > > > This behaviour differs from gold and lld, both of which honour > > --fatal-warnings no matter where it occurs on the command line. > > > > So we could fix the linker, create a two pass argument scan and the > > problem would be solved. But a) I am lazy and b) we already have a > > precedent for options on the command line only affecting options that > > come after it. (I am thinking of the -L option here, although there > > are probably several others). So instead I am considering documentin= g > > the current behaviour as expected. (See the patch below). > > > > What do people think ? > > I'd be fine either way, and I agree documenting is cheaper and sufficient= . > > Jan We should give a warning or an error if --fatal-warnings isn't the first command-line option. --=20 H.J.