[llvm-ar] Fix support for archives with members larger than 4GB
authorOwen Reynolds <gbreynoo@gmail.com>
Tue, 23 Jul 2019 14:44:21 +0000 (14:44 +0000)
committerOwen Reynolds <gbreynoo@gmail.com>
Tue, 23 Jul 2019 14:44:21 +0000 (14:44 +0000)
commit24f3e102a678e2d102ac5660371fba1c2cfccd25
tree8aae50fd303b854a6adb07b656efb2a5f53c1975
parent4389cb9cf1b9493ad44bbfd97fe5d54450061988
[llvm-ar] Fix support for archives with members larger than 4GB

llvm-ar outputs a strange error message when handling archives with
members larger than 4GB due to not checking file size when passing the
value as an unsigned 32 bit integer. This overflow issue caused
malformed archives to be created.:

https://bugs.llvm.org/show_bug.cgi?id=38058

This change allows for members above 4GB and will error in a case that
is over the formats size limit, a 10 digit decimal integer.

Differential Revision: https://reviews.llvm.org/D65093

llvm-svn: 366813
llvm/include/llvm/Object/Archive.h
llvm/lib/Object/Archive.cpp
llvm/lib/Object/ArchiveWriter.cpp