On 08/05/16 00:56, Irfan Ahmad wrote:

1. In the absence of lazy binding (that is almost always the case in embedded
systems), GOT is practically read-only - it needs to be modified only during

'practically' as in 'almost', or is it really read only?

linking by the dynamic linker, after that it can be considered and marked
read-only (e.g. read-only attribute set to be enforced by some MMU or MPU).

True, but I don't see how that's related to the -mNPDITR flag. (Your statement is about lazy binding).

2. If you only need a simple dynamic object model - where you just need dynamic
loading and dynamic linking - but do not need to maintain multiple data states
for the object like you need in a traditional shared object model, then one
instance of GOT per dynamic object is enough.

Again, correct, but unrelated to the flag. You seem to be claiming that unix-like ABIS require more than one GOT per dynamic object?

From #1: GOT is read-only so keeping it with CODE segment is a natural choice.
Now as there is no need to move it to RAM so there is no need for a mechanism
(-mSPB) that would enable controlling the GOT location independently of CODE
segment.

That's correct, but again unrelated to the -mNPDITR flag.


2. If you only need a simple dynamic object model - where you just need dynamic 
loading and dynamic linking - but do not need to maintain multiple data states 
for the object like you need in a traditional shared object model, then one 
instance of GOT per dynamic object is enough.

What 'multiple data states?' Are you talking about lazy binfing again (unrelated to -mNPDITR), or something else (what?)

So when both #1 and #2 are met, you only need -mno-pic-data-is-text-relative.

Your conclusion doesn't follow.  You can satisfy them with regular GOT behavior.

nathan

Reply via email to