On 03/29/2013 06:55 PM, Alexander Ivchenko wrote: > When compiling a shared library with "-mandroid -shared" the option > -Bsymbolic for linker is turned on by default. What was the reason > behind that default? Isn't using of -Bsymbolic somehow dangerous and > should be avoided..?
Yes indeed, -Bsymbolic is dangerous. > (as e.g. is explained in the mail from Richard > Henderson http://gcc.gnu.org/ml/gcc/2001-05/msg01551.html). > > Since there is no (AFAIK) option like -Bno-symbolic we cannot use > -fno-pic binary with COPY relocations in it (android dynamic loader > will throw an error when there is COPY relocation against DT_SYMBOLIC > library..) Sure, that's true. If a library is built with -Bsymbolic then you must build executables PIC. That's just how it is. As to why Android turned it on by default -- we are not clairvoyant! :-) Andrew.