This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix dladdr on hppa


On 2016-01-07 6:22 AM, Carlos O'Donell wrote:
When might we have -1 and 0-4096?

They are obviously not real fdescs, but when are they used?

>+  if ((int) addr == -1
>+      || (unsigned int) addr < 4096
>+      || !((unsigned int) addr & 2))
>+    return addr;

-1 is used in gcc's crtstuff.c to mark the end of a list of function pointers. 0-4096 is page 0 and can't be accessed on PA-RISC. Thus, these values can be
reserved for special uses.  For example, we have for signals:

/* Fake signal functions.  */
#define SIG_ERR ((__sighandler_t) -1)           /* Error return.  */
#define SIG_DFL ((__sighandler_t) 0)            /* Default action. */
#define SIG_IGN ((__sighandler_t) 1)            /* Ignore signal. */

#ifdef __USE_UNIX98
# define SIG_HOLD ((__sighandler_t) 2) /* Add signal to hold mask. */
#endif

Dave

--
John David Anglin  dave.anglin@bell.net


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]