This is an archive of the discontinued LLVM Phabricator instance.

[llvm-objcopy] - Stop using Inputs/alloc-symtab.o.
ClosedPublic

Authored by grimar on Jul 25 2019, 6:15 AM.

Details

Summary

Initially Inputs/alloc-symtab.o was added in D42222.
It contains an allocatable .symtab section. Today
we are able to create such sections using yaml2obj.

Later people started using this input for no solid reason in their tests.
Now multiple of tests are using it.
(And those tests do not need such a specific case actually).

In this patch I removed this binary and rewrote the few tests.

Diff Detail

Repository
rL LLVM

Event Timeline

grimar created this revision.Jul 25 2019, 6:15 AM
MaskRay added inline comments.Jul 25 2019, 7:59 PM
test/tools/llvm-objcopy/ELF/binary-out-error.test
2 ↗(On Diff #211733)

not llvm-objcopy -O binary %t - 2>&1 | FileCheck %s --check-prefix=SYMTAB

test/tools/llvm-objcopy/ELF/invalid-preserve-dates.test
18 ↗(On Diff #211733)

Testing N args.

Can you improve the comment?

jhenderson added inline comments.Jul 26 2019, 3:51 AM
test/tools/llvm-objcopy/ELF/binary-out-error.test
2 ↗(On Diff #211733)

You can actually get rid of the --check-prefix entirely, since this is the only check in the file.

MaskRay added inline comments.Jul 26 2019, 6:35 PM
test/tools/llvm-objcopy/ELF/binary-out-error.test
2 ↗(On Diff #211733)

Some other "out to binary" warnings have not been tested. We can add them later, so --check-prefix=SYMTAB can be kept to make future diff smaller.

grimar updated this revision to Diff 212137.Jul 29 2019, 2:43 AM
grimar marked 2 inline comments as done.
  • Addressed review comments.
test/tools/llvm-objcopy/ELF/binary-out-error.test
2 ↗(On Diff #211733)

Some other "out to binary" warnings have not been tested. We can add them later, so --check-prefix=SYMTAB can be kept to make future diff smaller.

Yep, below is a list of candidates for testing:

void BinarySectionWriter::visit(const SectionIndexSection &Sec) {
  error("cannot write symbol section index table '" + Sec.Name + "' ");
}

void BinarySectionWriter::visit(const SymbolTableSection &Sec) {
  error("cannot write symbol table '" + Sec.Name + "' out to binary");
}

void BinarySectionWriter::visit(const RelocationSection &Sec) {
  error("cannot write relocation section '" + Sec.Name + "' out to binary");
}

void BinarySectionWriter::visit(const GnuDebugLinkSection &Sec) {
  error("cannot write '" + Sec.Name + "' out to binary");
}

void BinarySectionWriter::visit(const GroupSection &Sec) {
  error("cannot write '" + Sec.Name + "' out to binary");
}
This revision is now accepted and ready to land.Jul 29 2019, 3:49 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2019, 6:36 AM