call gcc no -fpic/-fpie only -pie?

zet feqin1023@gmail.com
Tue Jun 28 09:27:00 GMT 2016


hello, All

If I call
```
gcc -pie test.c

```
-pie will be the arguments of collect2 then ld.

I have test some programs, they are works.
But the ld manual said if specify -pie should specify -fpic etc.

static relocation type only has R_386_32/R_386_PC32, they should be
changed to dynamic relocation type R_386_COPY/R_386_GLOB_DAT etc by
ld. If so why not manual said that( if specify -pie should specify
-fpic etc) ? If not , what the details that cannot be changed to
dynamic link?

like the -pie there is a similar option -shared, under the same
questions what about -shared?

thanks, my regards
zet

-- 
业精于勤,荒于嬉.



More information about the Binutils mailing list