Subject: Re: Enhancing sysctl support in ld.elf_so
To: None <>
From: Quentin Garnier <>
List: tech-userlevel
Date: 06/18/2004 06:21:11
This is a multi-part message in MIME format.

Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Le Fri, 18 Jun 2004 02:20:46 GMT
Christos Zoulas a ecrit :
> In article <>,
> Quentin Garnier <> wrote:
> >-=-=-=-=-=-
> >-=-=-=-=-=-
> >
> >Hi,
> >
> >I made a patch to make ld.elf_so use the new sysctl API instead of the
> >limited functionality it has now.
> >
> >It's handy, but adds 12k to ld.elf_so.
> >
> I don't think you can just do this, because the getmibinfo() function
> uses static globals and other functions non necessarily
> available/functional at dynamic link time. I could be wrong.

Well, it works (arguably only tested on my amd64 in compat_netbsd32 mode).

Here's the diff in the symbol table.  Is there anything I should worry
about in it?

Quentin Garnier - -
"Feels like I'm fiddling while Rome is burning down.
Should I lay my fiddle down and take a rifle from the ground ?"
Leigh Nash/Sixpence None The Richer, Paralyzed, Divine Discontents, 2002.

Content-Type: text/plain;
Content-Disposition: attachment;
Content-Transfer-Encoding: 7bit

--- syms2	2004-06-18 06:05:31.000000000 +0200
+++ syms	2004-06-18 06:05:35.000000000 +0200
@@ -34,14 +34,17 @@
 t .L8
 T .rtld_start
 r WS
+R _C_ctype_
+T ___learn_tree
 W ___sigprocmask14
 A __bss_start
 T __cerror
 B __cleanup
 T __cxa_atexit
 T __cxa_finalize
+T __divdi3
 D __environ_lock
 T __errno
 T __findenv
@@ -49,6 +52,7 @@
 t __i686.get_pc_thunk.bx
 D __isthreaded
+W __learn_tree
 W __libc_cond_broadcast
 T __libc_cond_catchall_stub
 W __libc_cond_destroy
@@ -105,7 +109,9 @@
 T __libc_thr_sigsetmask_stub
 W __libc_thr_yield
 T __libc_thr_yield_stub
+T __moddi3
 B __progname
+T __qdivrem
 W __sigaction14
 T __sigaction_sigtramp
 B __sigintr
@@ -117,6 +123,7 @@
 T __syscall
 T __sysctl
 W _close
+D _ctype_
 A _edata
 A _end
 T _exit
@@ -185,6 +192,8 @@
 B _rtld_xforms
 T _signal
 T _strdup
+T _strlcat
+T _strlcpy
 T _strsep
 T _sys___sigprocmask14
 T _sys_close
@@ -192,14 +201,13 @@
 T _sys_open
 T _sys_write
 T _sysctl
+T _sysctlgetmibinfo
 W _write
 T abort
 T atexit
 b buf.0
 b buf.0
 W close
-d ctl_machdep
-d ctl_toplvl
 T dladdr
 T dlclose
 T dlerror
@@ -218,7 +226,6 @@
 T getpid
 T getuid
 W kill
-D lists
 T malloc
 T memcpy
 T memset
@@ -234,21 +241,25 @@
 b pagepool_start
 b pagesz
 t protflags
+T qsort
 T realloc
 D realloc_srchlen
-D secondlevel
 W signal
 T strchr
 T strcmp
 T strcpy
 W strdup
+W strlcat
+W strlcpy
 T strlen
 T strncmp
 T strncpy
+T strpbrk
 T strrchr
 W strsep
+T strtoq
 W sysctl
-D toplevel
+W sysctlgetmibinfo
 W write
 T xcalloc
 T xerr