public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Fangrui Song <i@maskray.me>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] ELF: Updated comments for ET_EXEC and ET_DYN
Date: Tue, 26 May 2020 10:45:51 -0700	[thread overview]
Message-ID: <MWHPR12MB1456C9F5A5C6F40FB62CBDE6CBB00@MWHPR12MB1456.namprd12.prod.outlook.com> (raw)
In-Reply-To: <20200525182830.744267-1-hjl.tools@gmail.com>

Looks good. Ali in the generic-abi proposed a more generic form:

#define ET_EXEC 2 /* Position-dependent object */
#define ET_DYN 3 /* Position-independent object */


I just filed https://sourceware.org/bugzilla/show_bug.cgi?id=26047 We
may consider disallowing ET_EXEC as linker input.
Happy to know if there are legitimate cases, though.

On Mon, May 25, 2020 at 11:28 AM H.J. Lu via Binutils
<binutils@sourceware.org> wrote:
>
> include/elf/common.h has
>
>  #define ET_EXEC         2       /* Executable file */
>  #define ET_DYN          3       /* Shared object file */
>
> These predate PIE:
>
> https://groups.google.com/forum/#!topic/generic-abi/mBKlSNldFW4
>
> Updated comments to
>
>  #define ET_EXEC         2       /* Position-dependent executable file */
>  #define ET_DYN          3       /* Position-independent executable or
>                                     shared object file */
>
>         * elf/common.h: Update comments for ET_EXEC and ET_DYN.
> ---
>  include/ChangeLog    | 4 ++++
>  include/elf/common.h | 5 +++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/include/ChangeLog b/include/ChangeLog
> index c309780544..53f50e513f 100644
> --- a/include/ChangeLog
> +++ b/include/ChangeLog
> @@ -1,3 +1,7 @@
> +2020-05-25  H.J. Lu  <hongjiu.lu@intel.com>
> +
> +       * elf/common.h: Update comments for ET_EXEC and ET_DYN.
> +
>  2020-05-20  Nelson Chu  <nelson.chu@sifive.com>
>
>         * opcode/riscv.h: Include "bfd.h" to support bfd_boolean.
> diff --git a/include/elf/common.h b/include/elf/common.h
> index 26e6fbc8e6..4d94c4fd5b 100644
> --- a/include/elf/common.h
> +++ b/include/elf/common.h
> @@ -91,8 +91,9 @@
>
>  #define ET_NONE                0       /* No file type */
>  #define ET_REL         1       /* Relocatable file */
> -#define ET_EXEC                2       /* Executable file */
> -#define ET_DYN         3       /* Shared object file */
> +#define ET_EXEC                2       /* Position-dependent executable file */
> +#define ET_DYN         3       /* Position-independent executable or
> +                                  shared object file */
>  #define ET_CORE                4       /* Core file */
>  #define ET_LOOS                0xFE00  /* Operating system-specific */
>  #define ET_HIOS                0xFEFF  /* Operating system-specific */
> --
> 2.26.2
>

  reply	other threads:[~2020-05-26 17:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25 18:28 H.J. Lu
2020-05-26 17:45 ` Fangrui Song [this message]
     [not found] ` <CAN30aBHV0wxmp0NvLFeyH1Yoed64UOJ0B74ejQgwrQNY-d93qg@mail.gmail.com>
2020-05-30  0:59   ` Fangrui Song
     [not found]   ` <MWHPR12MB14566C7EDEE9DC0828E00DA2CB8C0@MWHPR12MB1456.namprd12.prod.outlook.com>
2020-05-30  1:10     ` H.J. Lu
2020-05-30 17:17       ` Fangrui Song
2020-05-30 20:13       ` Pedro Alves

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=MWHPR12MB1456C9F5A5C6F40FB62CBDE6CBB00@MWHPR12MB1456.namprd12.prod.outlook.com \
    --to=i@maskray.me \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@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).