Robert Lunnon wrote:
I keep having problems with gcc defining -z text when building shared objects. I understand that having non -pic objects linked into a shared library prevents the text segment containing the non-pic object from being shared. How will this affect performance. From the manual it would seem that only the segment containing the non-pic code would suffer and if no other such segments were in the shared library then setting -z textoff would have no effect and the library would still be shareable?
Typical dynamic objects contain a single text, and single data segment. The text is read-only, and hence shareable between multiple processes. The data segment contains writable data, and hence losses its shareability as elements within the data segment are written to. If the text segment contains non-pic code, then the text segment must be re-mmapped to make it writable. The OS allocates sufficient swap space to back the whole text segment, and items of the text segment are written to to perform the necessary relocations. The pages of the test segment that are written to become non-sharable. Non-pic code generally results in many more relocations than pic code, thus the runtime linker must perform more work to load the object. What do you mean by "keep having problems with gcc defining -z text"? -- Rod _______________________________________________ opensolaris-discuss mailing list [email protected]
