[PATCH] D59958: [llvm-objcopy] Change SHT_NOBITS to SHT_PROBITS for some --set-section-flags

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 29 03:59:13 PDT 2019


MaskRay added a comment.

The intention makes sense. I just found this piece of code

https://sourceware.org/git/?p=binutils-gdb.git;a=blob;hb=cc00a5d100973549bf5e4840937529633f4de1fa;f=bfd/elf.c#l3136

  int
  bfd_elf_get_default_section_type (flagword flags)
  {
    if ((flags & (SEC_ALLOC | SEC_IS_COMMON)) != 0
        && (flags & (SEC_LOAD | SEC_HAS_CONTENTS)) == 0)
      return SHT_NOBITS;
    return SHT_PROGBITS;
  }

Can the `SectionFlag` rules be simplified?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59958/new/

https://reviews.llvm.org/D59958





More information about the llvm-commits mailing list