Change in 'ar' behaviour
Ian Lance Taylor
ian@wasabisystems.com
Wed Aug 11 19:00:00 GMT 2004
Jeff Baker <jbaker@qnx.com> writes:
> >>I tried the -P option to ar, but that only causes ar to add every
> > object
> >> to the file whether the full path matches or not. Is this
> >> behaviour expected?
> > It seems a little unreasonable to me..
>
> I think the behaviour is somewhat expected, but
> undesireable. '1/name.o' gets added to the archive as 'name.o'. 'ar
> -rP main.a 1/name.o' checks '1/name.o' against 'name.o', sees that
> they don't match, assumes it's a different object and adds it as
> 'name.o'. Without the path information in the archive to check
> against this is just the nature of -P. Is there anything that can
> actually be done about it?
The -P option works as documented, and it's behaviour is reasonable.
It is intended for use with archives created by other, non-POSIX, ar
programs.
My recommendation was to extend the -P option to work when creating an
archive as well.
I'm fairly certain that there is nothing else you can do to
succesfully store and modify different files in the same archive with
the same basename and different full pathnames.
Ian
More information about the Binutils
mailing list