public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Question about PIC code and GOT
@ 2021-06-11 15:20 vincent Dupaquis
  2021-07-20 17:08 ` Maciej W. Rozycki
  0 siblings, 1 reply; 2+ messages in thread
From: vincent Dupaquis @ 2021-06-11 15:20 UTC (permalink / raw)
  To: gcc


[-- Attachment #1.1: Type: text/plain, Size: 859 bytes --]

     Hello,

     I am doing PIC (Position Independant Code) code using the ARM 
compiler, and effectively try to avoid the creation of the GOT (Global 
Offset Table).

     I've got the feeling the GOT is not convinient and goes in opposite 
direction than the one we try to achieve with having PIC, at least this 
is the reason why I'm trying to avoid it.

     Any clue on the reason why it has been implemented that way ?

     I have got the feeling that its avoidable in all cases, even 
without going deep at assembly level.

     Regards,
         Vincent.

-- 

*Vincent Dupaquis*
Software security & Cryptography expert
06 24 58 17 05
/Europarc de Pichaury Bâtiment B8 1330 rue Guillibert Gautier de la 
Lauzière 13290 Aix-en-Provence/

www.trusted-objects.com <http://www.trusted-objects.com>


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question about PIC code and GOT
  2021-06-11 15:20 Question about PIC code and GOT vincent Dupaquis
@ 2021-07-20 17:08 ` Maciej W. Rozycki
  0 siblings, 0 replies; 2+ messages in thread
From: Maciej W. Rozycki @ 2021-07-20 17:08 UTC (permalink / raw)
  To: vincent Dupaquis; +Cc: gcc

On Fri, 11 Jun 2021, vincent Dupaquis wrote:

>     I've got the feeling the GOT is not convinient and goes in opposite
> direction than the one we try to achieve with having PIC, at least this is the
> reason why I'm trying to avoid it.
> 
>     Any clue on the reason why it has been implemented that way ?

 Without going into processor-specific details, which may imply additional 
requirements, you need to have a place to store final load-time addresses 
of preemptible symbols, and GOT serves exactly that place.  The only case 
you could possibly be able to avoid, again barring any processor-specific 
requirements, the creation of a GOT with PIC code is a statically-linked 
position-independent executable (PIE).

 Late answer, but HTH.

  Maciej

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-20 17:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 15:20 Question about PIC code and GOT vincent Dupaquis
2021-07-20 17:08 ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).