mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <>
To: Markus Wichmann <>
Cc:, Rui Ueyama <>
Subject: Re: [musl] [PATCH] Explicitly pass the -fno-common flag
Date: Mon, 10 Jan 2022 19:45:27 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <20220110165015.GA2046@voyager>

* Markus Wichmann <> [2022-01-10 17:50:15 +0100]:
> On Sat, Jan 08, 2022 at 08:49:17PM -0500, Rich Felker wrote:
> > The one time bss is significantly preferable to common is for
> > zero-initialized const objects (rare but they might appear in some
> > places) since commons don't actually get made const. I don't think we
> > have any of those that are commons now though.
> >
> Wait, that's a possibility? I thought all constant data would be added
> to .rodata. I thought that was the whole point of .rodata.

const int x;

with -fcommon the x is a common symbol.
(the fact that it was const is lost in the .o)

common symbol is treated as bss at link time,
if there is no actual definition, and thus writable.

with -fno-common x is rodata.

      reply	other threads:[~2022-01-10 18:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-08  7:45 Rui Ueyama
2022-01-08 23:25 ` Szabolcs Nagy
2022-01-09  1:49   ` Rich Felker
2022-01-10 16:50     ` Markus Wichmann
2022-01-10 18:45       ` Szabolcs Nagy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: [musl] [PATCH] Explicitly pass the -fno-common flag' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).