[PATCH] D75949: [llvm-objcopy] Allow empty sections in --dump-section
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 10 18:37:36 PDT 2020
MaskRay added a comment.
GNU objcopy emits `can't dump section - it has no contents` (bfd_nonfatal_message) for SHT_NOBITS, and `can't dump section - it is empty` (bfd_nonfatal_message) for a sh_size=0 section.
Some use cases are messages prefixed with `warning:` or `error:`, they are apparently intended as warnings/errors. Some are not => some may be conceptually considered as warnings, but some may just be informative.
I agree that disallowing a sh_size=0 section does not is not necessary.
================
Comment at: llvm/test/tools/llvm-objcopy/ELF/dump-section-empty.test:1
+## Test that --dump-section works on a section with no contents.
+# RUN: yaml2obj %s -o %t.o
----------------
I think placing the test with `ELF/dump-section.test` is also fine.
You can add an empty section to the existing YAML in `ELF/dump-section.test`.
================
Comment at: llvm/test/tools/llvm-objcopy/ELF/dump-section-empty.test:14
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
----------------
Decrease indentation. `Machine:` is the widest key. The values should be aligned so that `Machine: EM_X86_64` contains exactly one space.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75949/new/
https://reviews.llvm.org/D75949
More information about the llvm-commits
mailing list