Commit Graph

4 Commits

Author SHA1 Message Date
Kazu Hirata c008e92b33 Apply clang-tidy fixes for modernize-use-equals-default in ELFObject.cpp (NFC) 2022-03-28 09:18:25 -07:00
Fangrui Song cce3521020 [llvm-objcopy] Simplify CompressedSection creation. NFC
Remove Expected<CompressedSection> factory functions in favor of constructors
now that zlib::compress returns void (D121512).

Reviewed By: jhenderson

Differential Revision: https://reviews.llvm.org/D121644
2022-03-14 23:15:15 -07:00
Fangrui Song 407c721ceb [Support] Change zlib::compress to return void
With a sufficiently large output buffer, the only failure is Z_MEM_ERROR.
Check it and call the noreturn report_bad_alloc_error if applicable.
resize_for_overwrite may call report_bad_alloc_error as well.

Now that there is no other error type, we can replace the return type with void
and simplify call sites.

Reviewed By: ikudrin

Differential Revision: https://reviews.llvm.org/D121512
2022-03-14 11:38:04 -07:00
Alexey Lapshin 25d7b4fb44 [objcopy][NFC] Rename files to avoid clashing of archive members.
libtool uses file names to name members of an static library.
Files, located in different directories and having matching name,
would have the same name inside an archive. This is not a problem
for ld, but may be a problem for ar. This patch renames files
from ObjCopy library to avoid names clashing.

See https://reviews.llvm.org/D88827#3335814

Differential Revision: https://reviews.llvm.org/D120345
2022-02-23 13:05:39 +03:00