The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] where is ecvt?
@ 2014-09-24 17:24 Mark Longridge
  2014-09-24 17:38 ` Ronald Natalie
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mark Longridge @ 2014-09-24 17:24 UTC (permalink / raw)


I've been comparing Unix v5 libc to modern linux and various other
Unix versions and I found something odd.

I made a list of functions which occur in Unix v5 libc.a and modern
linux glibc.a and while there is no problem using the ecvt function in
modern linux it doesn't seem to appear:

ar t /usr/lib/libc.a | grep ecvt

...doesn't find ecvt.

But if you do:
grep ecvt /usr/lib/libc.a
then
Binary file /usr/lib/libc.a matches

So it seems it is in there somewhere. While searching for ecvt.c I
found it as part of openbsd. I assume in modern Linux ecvt must be
part of a larger function but I couldn't find it in the glibc source.

Of course in Unix v5 things were completely straightforward as TUHS
has the file V5/usr/source/s3/ecvt.s

I just want to find all the functions that are still in modern glibc.a
which also existed in Unix v5 libc.a



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

* [TUHS] where is ecvt?
  2014-09-24 17:24 [TUHS] where is ecvt? Mark Longridge
@ 2014-09-24 17:38 ` Ronald Natalie
  2014-09-24 18:01   ` Mark Longridge
  2014-09-24 19:41 ` random832
  2014-09-24 20:36 ` John Cowan
  2 siblings, 1 reply; 7+ messages in thread
From: Ronald Natalie @ 2014-09-24 17:38 UTC (permalink / raw)


My guess is that when the libc was built ecvt.s was built into some other file other than ecvt.o and exists in the library under that name.
Ar only reports the file names inserted.   The loader looks at all the symbol tables on the contained files.    Have you tried extracting the files in the archive and running nm on them?




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

* [TUHS] where is ecvt?
  2014-09-24 17:38 ` Ronald Natalie
@ 2014-09-24 18:01   ` Mark Longridge
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Longridge @ 2014-09-24 18:01 UTC (permalink / raw)


> The loader looks at all the symbol tables on the contained files.    Have you tried
> extracting the files in the archive and running nm on them?

It seems that in glibc the file efgcvt.c just wraps ecvt to a call to
sprintf so there's really isn't a ecvt.c (and thus no ecvt.o) but
efgcvt.o instead.

Mark


On 9/24/14, Ronald Natalie <ron at ronnatalie.com> wrote:
> My guess is that when the libc was built ecvt.s was built into some other
> file other than ecvt.o and exists in the library under that name.
> Ar only reports the file names inserted.   The loader looks at all the
> symbol tables on the contained files.    Have you tried extracting the files
> in the archive and running nm on them?
>
>



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

* [TUHS] where is ecvt?
  2014-09-24 17:24 [TUHS] where is ecvt? Mark Longridge
  2014-09-24 17:38 ` Ronald Natalie
@ 2014-09-24 19:41 ` random832
  2014-09-24 23:53   ` Dan Stromberg
  2014-09-24 20:36 ` John Cowan
  2 siblings, 1 reply; 7+ messages in thread
From: random832 @ 2014-09-24 19:41 UTC (permalink / raw)


On Wed, Sep 24, 2014, at 13:24, Mark Longridge wrote:
> ar t /usr/lib/libc.a | grep ecvt
> 
> ...doesn't find ecvt.
> 
> But if you do:
> grep ecvt /usr/lib/libc.a
> then
> Binary file /usr/lib/libc.a matches

$ objdump -t libc.a

...
efgcvt.o:     file format elf64-x86-64

SYMBOL TABLE:
...
00000000000000b0 g     F .text  000000000000001e ecvt
...

On a system without a tool like objdump, the next logical step would be
ar x.



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

* [TUHS] where is ecvt?
  2014-09-24 17:24 [TUHS] where is ecvt? Mark Longridge
  2014-09-24 17:38 ` Ronald Natalie
  2014-09-24 19:41 ` random832
@ 2014-09-24 20:36 ` John Cowan
  2014-09-24 22:07   ` Dave Horsfall
  2 siblings, 1 reply; 7+ messages in thread
From: John Cowan @ 2014-09-24 20:36 UTC (permalink / raw)


Mark Longridge scripsit:

> I made a list of functions which occur in Unix v5 libc.a and modern
> linux glibc.a and while there is no problem using the ecvt function in
> modern linux it doesn't seem to appear:

ecvt() and fcvt() were deprecated in Posix 2001 in favor of printf(), and
in Posix 2008 they were removed altogether.

-- 
John Cowan          http://www.ccil.org/~cowan        cowan at ccil.org
He made the Legislature meet at one-horse tank-towns out in the alfalfa
belt, so that hardly nobody could get there and most of the leaders
would stay home and let him go to work and do things as he pleased.
    --H.L. Mencken's translation of the Declaration of Independence



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

* [TUHS] where is ecvt?
  2014-09-24 20:36 ` John Cowan
@ 2014-09-24 22:07   ` Dave Horsfall
  0 siblings, 0 replies; 7+ messages in thread
From: Dave Horsfall @ 2014-09-24 22:07 UTC (permalink / raw)


On Wed, 24 Sep 2014, John Cowan wrote:

> ecvt() and fcvt() were deprecated in Posix 2001 in favor of printf(), 
> and in Posix 2008 they were removed altogether.

I *thought* that the name was familiar, but having been whacked here before
I kept my fingers firmly buttoned up :-)

> John Cowan          http://www.ccil.org/~cowan        cowan at ccil.org
> He made the Legislature meet at one-horse tank-towns out in the alfalfa
> belt, so that hardly nobody could get there and most of the leaders
> would stay home and let him go to work and do things as he pleased.
>     --H.L. Mencken's translation of the Declaration of Independence

I was a member of an organisation like that.

-- Dave



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

* [TUHS] where is ecvt?
  2014-09-24 19:41 ` random832
@ 2014-09-24 23:53   ` Dan Stromberg
  0 siblings, 0 replies; 7+ messages in thread
From: Dan Stromberg @ 2014-09-24 23:53 UTC (permalink / raw)


On Wed, Sep 24, 2014 at 12:41 PM,  <random832 at fastmail.us> wrote:
> On Wed, Sep 24, 2014, at 13:24, Mark Longridge wrote:
> $ objdump -t libc.a
>
> ...
> efgcvt.o:     file format elf64-x86-64
>
> SYMBOL TABLE:
> ...
> 00000000000000b0 g     F .text  000000000000001e ecvt
> ...
>
> On a system without a tool like objdump, the next logical step would be
> ar x.

You can also use nm:

                    case "`uname`" in
                        IRIX*)
                            nm -B "$libpath" | sed "s#^#$libpath:#"
                            ;;
                        SunOS|OSF1)
                            # here we're munging Sun format around into linux
                            # format
                            nm -P "$libpath" | awk ' { print $3,$2,$1 } ' | \
                                sed "s#^#$libpath:#"
                            ;;
                        Linux|DragonFly)
                            nm -o "$libpath"
                            ;;
                        AIX)
                            #AIX: .popen               T     0430424        14
                            # -X bits specifies the bitwidth for the library
                            # -p says don't sort - Much faster
                            nm -X 32 -p -o "$libpath" | awk ' { print
$3,$2,$1 } ' | \
                                sed "s#^#$libpath:#"
                            nm -X 64 -p -o "$libpath" | awk ' { print
$3,$2,$1 } ' | \
                                sed "s#^#$libpath:#"
                            ;;
                    esac



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

end of thread, other threads:[~2014-09-24 23:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-24 17:24 [TUHS] where is ecvt? Mark Longridge
2014-09-24 17:38 ` Ronald Natalie
2014-09-24 18:01   ` Mark Longridge
2014-09-24 19:41 ` random832
2014-09-24 23:53   ` Dan Stromberg
2014-09-24 20:36 ` John Cowan
2014-09-24 22:07   ` Dave Horsfall

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).