mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jens Gustedt <jens.gustedt@inria.fr>
To: musl@lists.openwall.com
Subject: reserved symbol violations
Date: Sat, 02 Aug 2014 18:28:03 +0200	[thread overview]
Message-ID: <1406996883.8274.181.camel@eris.loria.fr> (raw)


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

Hi,
 by digging into the symbols that are dragged into a C11 thread
executable I noticed that there are some hotspots that should perhaps
be worth looking at. I attach a file that summarizes the findings.

One is simple, I'd change the reference to clock_gettime in
__timedwait to __clock_gettime.

There are bunch of others, that look simple to resolve, tell me if I
should look into that.

One looks weird, though, lock_ptc.o It is only linked (via __synccall)
if setrlimit or setxid are. But then it drags a whole bunch of pthread
symbols in, which looks wrong to me. Also I think that this doesn't
really capture the need, because the code is only active if both
setrlimit *and* pthread_create are *used*.

So in the absence of either of it, __syncall shouldn't be linked. But
I wouldn't know how to achieve this with weak symbols, I have to
admit.

Jens

-- 
:: INRIA Nancy Grand Est ::: AlGorille ::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::




[-- Attachment #1.2: musl-symbol-violations.txt --]
[-- Type: text/plain, Size: 1863 bytes --]

Observed reserved symbol violations as of current musl

setxid.o:
setrlimit.o:
	U __synccall

synccall.o:
	U __inhibit_ptc		-> lock_ptc.o
	U sem_init
	U sem_post
	U sem_wait
	U sigfillset
	U sigqueue

lock_ptc.o:
	U pthread_rwlock_rdlock
	U pthread_rwlock_unlock
	U pthread_rwlock_wrlock

pthread_rwlock_wrlock.o:
	U pthread_rwlock_timedwrlock

pthread_rwlock_rdlock.o:
	U pthread_rwlock_timedrdlock

pthread_cond_timedwait.o:
pthread_join.o:
pthread_mutex_timedlock.o:
pthread_rwlock_timedrdlock.o:
pthread_rwlock_timedwrlock.o:
sem_timedwait.o:
	U __timedwait

__timedwait.o:
	U clock_gettime

sigqueue.o:
	U getpid
	U getuid
	U memset

sem_open.o (also sem_close):
	U access
	U calloc
	U clock_gettime
	U close
	U fstat
	U link
	U mmap
	U munmap
	U open
	U pthread_setcancelstate
	U snprintf
	U unlink
	U write

sem_unlink.o:
	U shm_unlink

shm_open.o (also shm_unlink):
	U memcpy
	U open
	U pthread_setcancelstate
	U unlink

__asctime.o:
	U snprintf

getdate.o:
	U fclose
	U fgets
	U fopen
	U getenv
	U pthread_setcancelstate
	U strptime

strftime.o:
	U abs
	U memcpy
	U snprintf
	U strlen
	U strtoul

strptime.o:
	U isspace
	U nl_langinfo
	U strlen
	U strncasecmp
	U strtoul

sleep.o:
        U nanosleep

__init_tls.o:
	U memcpy

__libc_start_main.o:
	U exit

__reset_tls.o:
	U memcpy
	U memset

__stack_chk_fail.o:
	U memcpy

getenv.o:
	U strchr
	U strlen
	U strncmp

putenv.o:
	U memcmp
	U memcpy
	U strchr

setenv.o:
	U memcpy
	U strchr
	U strlen

unsetenv.o:
	U memcmp
	U strchr
	U strlen

assert.o:
	U abort
	U fflush
	U fprintf
	U stderr

timer_create.o:
	U longjmp
	U pthread_attr_init
	U pthread_attr_setdetachstate
	U pthread_barrier_init
	U pthread_barrier_wait
	U pthread_create
	U pthread_once
	U setjmp

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

             reply	other threads:[~2014-08-02 16:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-02 16:28 Jens Gustedt [this message]
2014-08-02 16:37 ` Rich Felker
2014-08-02 16:57   ` Jens Gustedt
2014-08-02 17:34     ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406996883.8274.181.camel@eris.loria.fr \
    --to=jens.gustedt@inria.fr \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).