mailing list of musl libc
 help / color / mirror / code / Atom feed
* _GLOBAL_OFFSET_TABLE_ in ldso/*/start.s?
@ 2012-06-08 20:54 Richard Pennington
  2012-06-08 22:31 ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Pennington @ 2012-06-08 20:54 UTC (permalink / raw)
  To: musl

What is the purpose of the _GLOBAL_OFFSET_TABLE_ reference in these files? It 
doesn't seem to be used by __dynlink(), although it seems to be passed a a 
third parameter.

-Rich


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

* Re: _GLOBAL_OFFSET_TABLE_ in ldso/*/start.s?
  2012-06-08 20:54 _GLOBAL_OFFSET_TABLE_ in ldso/*/start.s? Richard Pennington
@ 2012-06-08 22:31 ` Rich Felker
  2012-06-08 22:43   ` Richard Pennington
  0 siblings, 1 reply; 4+ messages in thread
From: Rich Felker @ 2012-06-08 22:31 UTC (permalink / raw)
  To: musl

On Fri, Jun 08, 2012 at 03:54:46PM -0500, Richard Pennington wrote:
> What is the purpose of the _GLOBAL_OFFSET_TABLE_ reference in these files? It 
> doesn't seem to be used by __dynlink(), although it seems to be passed a a 
> third parameter.

If you check git, you'll see that this code was removed. A much older
version of __dynlink took a third argument that was the base address
of the GOT, which was used to find a pointer to _DYNAMIC in the first
GOT slot (traditionally, it was stored there). Then people started
reporting crashes when linking with a non-binutils linker (gold? or
something from clang/llvm? I don't remember...) that didn't follow
this practice, so I replaced it with more elaborate code to find
_DYNAMIC. The unneeded code in the asm was not removed until much
later. I actually have a new idea for simplifying/replacing some of
the C code, but it won't affect the asm.

By the way, it might be a good idea to familiarize yourself with git
or even the gitweb interface. Questions like the one you had just now
can usually be answered quickly by checking the history of the
relevant files.

Rich


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

* Re: _GLOBAL_OFFSET_TABLE_ in ldso/*/start.s?
  2012-06-08 22:31 ` Rich Felker
@ 2012-06-08 22:43   ` Richard Pennington
  2012-06-08 23:21     ` Ivan Kanakarakis
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Pennington @ 2012-06-08 22:43 UTC (permalink / raw)
  To: musl

Thanks Rich. Becoming familiar with git is definitely on my todo list. 

-Rich

Sent from my iPhone

On Jun 8, 2012, at 5:31 PM, Rich Felker <dalias@aerifal.cx> wrote:

> On Fri, Jun 08, 2012 at 03:54:46PM -0500, Richard Pennington wrote:
>> What is the purpose of the _GLOBAL_OFFSET_TABLE_ reference in these files? It 
>> doesn't seem to be used by __dynlink(), although it seems to be passed a a 
>> third parameter.
> 
> If you check git, you'll see that this code was removed. A much older
> version of __dynlink took a third argument that was the base address
> of the GOT, which was used to find a pointer to _DYNAMIC in the first
> GOT slot (traditionally, it was stored there). Then people started
> reporting crashes when linking with a non-binutils linker (gold? or
> something from clang/llvm? I don't remember...) that didn't follow
> this practice, so I replaced it with more elaborate code to find
> _DYNAMIC. The unneeded code in the asm was not removed until much
> later. I actually have a new idea for simplifying/replacing some of
> the C code, but it won't affect the asm.
> 
> By the way, it might be a good idea to familiarize yourself with git
> or even the gitweb interface. Questions like the one you had just now
> can usually be answered quickly by checking the history of the
> relevant files.
> 
> Rich


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

* Re: _GLOBAL_OFFSET_TABLE_ in ldso/*/start.s?
  2012-06-08 22:43   ` Richard Pennington
@ 2012-06-08 23:21     ` Ivan Kanakarakis
  0 siblings, 0 replies; 4+ messages in thread
From: Ivan Kanakarakis @ 2012-06-08 23:21 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 2239 bytes --]

many online books out there, people tend
to like "Pro Git" [0] that was merged with
the community git book and "git ready" [1]

  [0]: http://git-scm.com/book
  [1]: http://gitready.com/


very simple stuff to get you started
looking at changes, would be:

$ git clone git://git.etalabs.net/musl
$ cd musl

# see the history for the repo
$ git log

# see the history for a file
$ git log -- Makefile

# see only the last 5 commits/changes to a file by line
$ git log -5 --oneline -- WHATSNEW

# see diff between current state and a commit/point in the past
$ git diff 2d3e2a7

# see diff between two states
$ git diff 8a35dee 2d3e2a7

# show info (message and diff from its previous state) about a commit/change
$ git show 83023d1



On 9 June 2012 01:43, Richard Pennington <rich@pennware.com> wrote:

> Thanks Rich. Becoming familiar with git is definitely on my todo list.
>
> -Rich
>
> Sent from my iPhone
>
> On Jun 8, 2012, at 5:31 PM, Rich Felker <dalias@aerifal.cx> wrote:
>
> > On Fri, Jun 08, 2012 at 03:54:46PM -0500, Richard Pennington wrote:
> >> What is the purpose of the _GLOBAL_OFFSET_TABLE_ reference in these
> files? It
> >> doesn't seem to be used by __dynlink(), although it seems to be passed
> a a
> >> third parameter.
> >
> > If you check git, you'll see that this code was removed. A much older
> > version of __dynlink took a third argument that was the base address
> > of the GOT, which was used to find a pointer to _DYNAMIC in the first
> > GOT slot (traditionally, it was stored there). Then people started
> > reporting crashes when linking with a non-binutils linker (gold? or
> > something from clang/llvm? I don't remember...) that didn't follow
> > this practice, so I replaced it with more elaborate code to find
> > _DYNAMIC. The unneeded code in the asm was not removed until much
> > later. I actually have a new idea for simplifying/replacing some of
> > the C code, but it won't affect the asm.
> >
> > By the way, it might be a good idea to familiarize yourself with git
> > or even the gitweb interface. Questions like the one you had just now
> > can usually be answered quickly by checking the history of the
> > relevant files.
> >
> > Rich
>



-- 
*Ivan c00kiemon5ter V Kanakarakis*  >:3

[-- Attachment #2: Type: text/html, Size: 3398 bytes --]

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

end of thread, other threads:[~2012-06-08 23:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-08 20:54 _GLOBAL_OFFSET_TABLE_ in ldso/*/start.s? Richard Pennington
2012-06-08 22:31 ` Rich Felker
2012-06-08 22:43   ` Richard Pennington
2012-06-08 23:21     ` Ivan Kanakarakis

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).