public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: liuzhensong <liuzhensong@loongson.cn>
To: Alan Modra <amodra@gmail.com>
Cc: binutils@sourceware.org
Subject: Re: [PATCH] objcopy: Add elf header e_flags option in objcopy.
Date: Fri, 15 Apr 2022 15:24:12 +0800	[thread overview]
Message-ID: <cb9c0666-17ea-b93e-2085-e68a3c75f2ca@loongson.cn> (raw)
In-Reply-To: <YljSdWJH9kkkKePS@squeak.grove.modra.org>


On 2022/4/15 上午10:03, Alan Modra wrote:
> On Thu, Apr 14, 2022 at 07:29:06PM +0800, liuzhensong wrote:
>> @@ -660,6 +666,7 @@ copy_usage (FILE *stream, int exit_status)
>>        --weaken-symbols <file>       -W for all symbols listed in <file>\n\
>>        --add-symbol <name>=[<section>:]<value>[,<flags>]  Add a symbol\n\
>>        --alt-machine-code <index>    Use the target's <index>'th alternative machine\n\
>> +     --alt-elf-eflags=<value> 	   Use the alternative elf header e_flags\n\
> Don't use tabs in help messages.
>
>>        --writable-text               Mark the output text as writable\n\
>>        --readonly-text               Make the output text write protected\n\
>>        --pure                        Mark the output file as demand paged\n\
>> @@ -3496,6 +3503,11 @@ copy_object (bfd *ibfd, bfd *obfd, const bfd_arch_info_type *input_arch)
>>   	}
>>       }
>>   
>> +  if (alt_elf_eflags_set)
>> +    {
>> +      elf_elfheader (obfd)->e_flags = alt_elf_eflags;
>> +    }
>> +
> Needs a check bfd_get_flavour (obfd) == bfd_target_elf_flavour before
> writing a field only in ELF bfd, and no need for braces.
>
> Also, please update binutils/doc.texi with the new objcopy option.
>

I will send a v2 with the requested changes.
Thanks for the review.

--
liuzhensong


      reply	other threads:[~2022-04-15  7:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-14 11:29 liuzhensong
2022-04-15  2:03 ` Alan Modra
2022-04-15  7:24   ` liuzhensong [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=cb9c0666-17ea-b93e-2085-e68a3c75f2ca@loongson.cn \
    --to=liuzhensong@loongson.cn \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    /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).