public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: "Carlos O'Donell" <carlos@systemhalted.org>
To: Peng Yu <pengyu.ut@gmail.com>
Cc: libc-help <libc-help@sourceware.org>
Subject: Re: Is there a way to distinguish binary files compiled with -D_FORTIFY_SOURCE=1 and -D_FORTIFY_SOURCE=2?
Date: Fri, 9 Apr 2021 13:17:31 -0400	[thread overview]
Message-ID: <CAE2sS1g91Z=_AuvkX-AbMNNtp83MOyrSv=bdQqbXXYT2wT14Uw@mail.gmail.com> (raw)
In-Reply-To: <CABrM6w=wj42N_1OXTN0N7RnP889+sLKFwZA7ARRkcbTbM8f6Vw@mail.gmail.com>

On Thu, Apr 8, 2021 at 8:12 PM Peng Yu via Libc-help
<libc-help@sourceware.org> wrote:
>
> https://gcc.gnu.org/legacy-ml/gcc-patches/2004-09/msg02055.html
>
> When I compile a .c file with -D_FORTIFY_SOURCE=1 and
> -D_FORTIFY_SOURCE=2, the binary files both contain symbols like
> ..._chk@...
>
> So I can not tell whether _FORTIFY_SOURCE is 1 or 2 just by whether
> symbols have ..._chk@....
>
> Is there a way to tell the difference only from the binary file?

If you want to know about this feature you want to know about all the features.

In Fedora and in RHEL we use annobin to answer this question:
https://fedoraproject.org/wiki/Changes/Annobin

Cheers,
Carlos.

      reply	other threads:[~2021-04-09 17:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-09  0:12 Peng Yu
2021-04-09 17:17 ` Carlos O'Donell [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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to='CAE2sS1g91Z=_AuvkX-AbMNNtp83MOyrSv=bdQqbXXYT2wT14Uw@mail.gmail.com' \
    --to=carlos@systemhalted.org \
    --cc=libc-help@sourceware.org \
    --cc=pengyu.ut@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).