https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65559
Matt Breedlove <breedlove.matt at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |breedlove.matt at gmail dot com --- Comment #19 from Matt Breedlove <breedlove.matt at gmail dot com> --- Kai, This corrects issue #2 from my ML post (https://gcc.gnu.org/ml/gcc/2015-04/msg00355.html) but should this not be something like the following instead? fd = open (filename, O_RDONLY|O_BINARY); With how things are currently written in the code, archive libraries will always fail to be opened properly since the code used to parse their file names and offsets will always chuck out the work that is being done. Toward the top of the loop, we're setting "char *filename = argv[i];" and then overriding it when we hit a filename with an offset but then using the original un-parsed command-line parameter when trying to open the file to see if it exists. Ex: Parameter: libarchive.a@0x42e20 Parsed as: filename = libarchive.a offset = 0x42e20 File opened: libarchive.a@0x42e20 (instead of libarchive.a) >From looking at the code, this has been this way for quite awhile. I tested the change after modifying it to use the filename variable instead and it works successfully rather than simply failing to open any archive passed in with an offset.