|
2e071c3c
|
2019-08-06T19:14:29
|
|
build: Support platforms without symbol versioning
The .symver directive is ELF-specific. On non-ELF platforms, work around
this with __attribute__((__alias__)) for the default symbol, and ignore
the variant versioned symbols.
Based-on-patch-by: Aaron Dierking <aarond@fb.com>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
890699a7
|
2019-08-06T18:51:45
|
|
build: Abstract symbol versioning via new libbsd_symver_* macros
This makes it more obvious what they are doing. It will make it easier
to make these directives more portable, as they are really ELF specific.
|
|
f99b8ea5
|
2018-06-14T11:38:33
|
|
build: Disable CRT warnings on Windows
These warnings are not helpful for libbsd.
[guillem@hadrons.org:
- Rename WINDOWS conditional to OS_WINDOWS.
- Add a nil terminator to the AM_CPPFLAGS. ]
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
b0ebb0d4
|
2019-08-06T23:16:42
|
|
build: Use __register_atfork() only if really available
This is a glibc-specific symbol that has no public declaration. But is
being used by the OpenBSD and this implementation as a hack to avoid
having to link against the pthread library. This interface is at least
included in LSB 5.0 [L], and using pthread_atfork() is otherwise
problematic anyway [P].
[L] <https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/baselib---register-atfork.html>
[P] <http://austingroupbugs.net/view.php?id=851>
One problem is that we were using it whenever __GLIBC__ is defined,
which is supposed to be defined only on an actual glibc, but uClibc
defines that macro, but it does not provide the symbol on its noMMU
variant.
We add a new configure check that will try to link a program that uses
that symbol to make sure it is present.
Closes: !2
Reported-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
|
2ebe6d5a
|
2018-06-14T11:38:32
|
|
Windows support for inet_net_pton()
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
aeea1f40
|
2018-06-14T11:38:32
|
|
Windows support for HASHFileChunk()
<io.h> provides the necessary file I/O functions.
[guillem@hadrons.org: Move include before <hashinc>. ]
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
b9dee9f6
|
2018-06-14T11:38:31
|
|
Use CHAR_BIT instead of NBBY in strnvis()
<sys/param.h> is not available on Windows.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
7cfa2d45
|
2018-06-14T11:38:31
|
|
Correct Clang feature detection
Clang's __GNUC__ and __GNUC_MINOR__ definitions are not reliable and may
not be defined at all when targeting the MSVC ABI. Use feature-checking
macros when possible or check for __clang__.
[guillem@hadrons.org: Update for __ protected keyword change. ]
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
574c7a13
|
2018-06-18T00:36:44
|
|
Protect C language extensions with two leading and trailing underscores
This should make their usage safer against user macros.
|
|
81c3c3e4
|
2018-06-14T11:38:31
|
|
Replace reintroduced legacy u_* type usage in strnvis() and strnunvis()
This fixes a regression caused by 2d7de18. These types are not available
on all systems.
Fixes: commit 2d7de186e9cb19a756c0630ee85cb3f2d29b3484
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
5e0998fa
|
2018-06-09T00:08:14
|
|
Remove dead code in vis
The loop only executes while len > 0, and the trinary operator in the
function argument is checking against len >= 1 which will always be
true.
Warned-by: coverity
|
|
8e2d5504
|
2018-06-06T05:41:34
|
|
Fix vis family of functions to not leak
The code uses an internal helper function to avoid code repetition. But
to get there, the function takes a pointer to a pointer, so that the few
functions that require returning an allocated buffer can get hold of it
this way.
The problem is that the user might pass a NULL pointer and trigger an
internal allocation even if the functions are not expected to do so.
Add a new internal helper for non-allocations, that will assert that
condition, and make any other function that requires this behavior call
this one instead.
Warned-by: coverity
|
|
13c32916
|
2018-06-05T19:21:46
|
|
flopen: Add missing <fcntl.h> include
Commit 993828d84ee (Add flopenat() function from FreeBSD) dropped the
fcntl.h header. This breaks the build with musl libc:
flopen.c: In function ‘vflopenat’:
flopen.c:60:14: error: ‘O_CREAT’ undeclared (first use in this function)
if (flags & O_CREAT) {
^~~~~~~
Restore the fcntl.h header include to fix the build.
Fixes: commit 993828d84eed0468c6c15b2818e534e6b134b8e4
Submitted-also-by: parazyd <parazyd@dyne.org>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
e4e15ed2
|
2018-05-22T13:50:44
|
|
Fix strnvis() and strnunvis() NetBSD ABI break
The NetBSD implementations have different prototypes to the ones coming
from OpenBSD, which will break builds, and have caused segfaults at
run-time. We provide now both interfaces with different prototypes as
different version nodes allow selecting them at compile-time, defaulting
for now to the OpenBSD one to avoid build-time breakage, while emitting
a compile-time warning. Later on, in 0.10.0, we will be switching the
compile-time default to the NetBSD version.
Ref: http://gnats.netbsd.org/44977
Fixes: https://bugs.debian.org/899282
|
|
3cabf46b
|
2018-05-21T03:15:59
|
|
Deprecate fgetwln()
This function has the same problems as fgetln() which is already marked
as deprecated.
|
|
6eebc1f2
|
2018-05-21T03:10:12
|
|
Fix typo in fgetln() linker warning
|
|
a1730c10
|
2018-05-15T00:55:02
|
|
Add Windows support for getentropy() and arc4random()
Import from OpenBSD.
|
|
6f68c930
|
2018-05-21T00:22:38
|
|
Switch strtonum() implementation from strtoll() to strtoi()
Import from NetBSD.
|
|
e13b1a33
|
2018-05-21T00:20:49
|
|
Import strtoi() and strtou() functions from NetBSD
|
|
ef5faeb5
|
2018-05-20T19:20:33
|
|
Update few RCS keyword contents to match BSD originals
This will slightly reduce the delta, and makes it easier to compare the
sources.
|
|
2d7de186
|
2018-05-21T03:09:05
|
|
Update vis/unvis modules from NetBSD
|
|
3efad641
|
2018-05-21T01:56:33
|
|
Update readpassphrase() from OpenBSD
|
|
a6f407ab
|
2018-05-21T01:34:17
|
|
Update heapsort() from OpenBSD
|
|
21edbb4f
|
2018-05-21T00:31:15
|
|
Update fmtcheck() from NetBSD
|
|
e3979d1a
|
2018-05-20T19:22:16
|
|
Update humanize_number() from FreeBSD
Implements HN_IEC_PREFIXES.
|
|
facbddb6
|
2018-05-20T19:18:18
|
|
Update pidfile module from FreeBSD
Use EINVAL instead of EDOOFUS. Add a missing synopsis for
pidfile_fileno() in the man page. Move the definition of struct pidfh
from libutil.h into pidfile.c following upstream change.
|
|
3d88c999
|
2018-05-15T00:41:26
|
|
Update arc4random() headers from OpenBSD
Split Linux support into its own header separate from the generic Unix
to fix a Linux-specific issue with clone(). Reset rsp to NULL on failure.
|
|
e42381dc
|
2018-05-15T00:41:26
|
|
Update getentropy() code from OpenBSD
Includes changes to handle the Linux syscall blocking when there is not
enough entropy during boot, by switching it to non-blocking mode and
falling back to the alternative implementations. Man page URL reference
fixes. Build fixes for Mac OS X.
Fixes: https://bugs.debian.org/898088
|
|
993828d8
|
2018-05-21T01:11:46
|
|
Add flopenat() function from FreeBSD
|
|
f6ed7c27
|
2018-04-03T20:10:14
|
|
Fix build for openrisc with uClibc
uClibc defines EM_OR1K instead of EM_OPENRISC for the OpenRISC ELF
e_machine ID. Use EM_OR1K when EM_OPENRISC is not defined.
This fixes the following build failure:
In file included from nlist.c:44:0:
nlist.c: In function ‘__elf_is_okay__’:
local-elf.h:224:23: error: ‘EM_OPENRISC’ undeclared (first use in this function)
#define ELF_TARG_MACH EM_OPENRISC
^
nlist.c:77:26: note: in expansion of macro ‘ELF_TARG_MACH’
if (ehdr->e_machine == ELF_TARG_MACH &&
^
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
5ba8c5ba
|
2018-03-05T00:37:47
|
|
progname: Port to Windows
Define the directory separator depending on the system targetted.
Reported-by: Progyan Bhattacharya <progyanb@acm.org>
|
|
0093ca2b
|
2018-03-05T00:02:34
|
|
Handle SPARC V8+ on Sun Studio compiler
|
|
0b65d439
|
2018-03-04T23:44:52
|
|
Add support for ELF machine EM_SPARC32PLUS
32-bit SPARC on V8+ uses a different ELF machine type.
Fixes: https://bugs.gentoo.org/634550
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
2a8514d8
|
2017-07-17T00:57:07
|
|
Fix handling of non-contiguous argv + envp in setproctitle()
The two arrays might not reference contiguous memory, and assuming they
are does break at least now on GNU/Hurd, which contains an unmapped
memory block between the memory used by the two arrays.
Just check that each element is strictly after the previous one, so that
we know there are no unmapped memory blocks inbetween.
|
|
b480b7a3
|
2017-06-19T21:38:40
|
|
Fix ELF definitions for MIPS in local-elf.h
Add a check for _MIPS_SIM inside the __mips__ #elif to detect mips64el
and use ELFCLASS64 in that case. Note that we can't use defined(__mips64)
here because that is also defined when the n32 ABI is in use, which uses
ELFCLASS32.
Fixes: https://bugs.debian.org/865091
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
4cc20e23
|
2017-06-19T21:37:14
|
|
Fix ELF definitions for PowerPC in local-elf.h
* ppc64el defines both __powerpc__ and __powerpc64__ but since the
__powerpc64__ #elif is below the __powerpc__ one, it will never be hit.
* Both assumed that powerpc* was big-endian.
Fixes: https://bugs.debian.org/865091
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
8e8834d8
|
2017-06-14T02:53:35
|
|
Remove RCSID tags
These are obsolete markers, and in some cases they repeat the
information already present in the comment header.
|
|
47013bc9
|
2017-06-14T01:49:25
|
|
Fix broken mmap() usage in nlist() by switching to pread()
The offset is not page aligned, which makes mmap() return EINVAL on
Linux. Switch to use pread() which handles unaligned offset and non-page
sized reads, and because we are already loading parts of the executable
by read() calls, so there's not much point in using mmap() anyway.
|
|
e8d340de
|
2017-06-05T05:30:27
|
|
Remove a.out support from nlist()
Some libc libraries do not have an <a.out.h> header. And a.out as an
executable format is very much obsolete on pretty much all currently
supported systems, even if they might still support loading such
objects.
Remove the a.out support to increase portability.
|
|
7aede6a9
|
2016-06-27T09:21:43
|
|
Make strlcpy()/strlcat() slightly easier to read
Backport new changes from OpenBSD.
[guillem@hadrons.org:
- Update copyright years in COPYING. ]
References: https://svnweb.freebsd.org/base?view=revision&revision=281135
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
07c76b66
|
2017-06-05T06:17:27
|
|
Do not use legacy BSD u_* types
Some systems do not have these types available, and they are simply
convenience aliases. Instead use the expanded versions which are more
portable.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=101192
|
|
d6c35f61
|
2017-01-10T04:33:15
|
|
Do not provide funopen() on musl
Fixes: https://bugs.debian.org/818246
|
|
088f147e
|
2017-02-08T01:49:48
|
|
Add support for RISC-V
|
|
b2b1020d
|
2017-01-10T03:47:52
|
|
Add support for TileGX
Fixes: https://bugs.debian.org/847560
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
cbfe0ebc
|
2016-03-27T12:37:09
|
|
Add missing <fcntl.h> includes
These are required due to the O_* macro usage, but have passed
undetected on glibc-based systems due to implicit inclusions.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
b7ce33cf
|
2016-02-12T22:56:09
|
|
build: Support clock_gettime() provided in librt
In older glibc versions (< 2.17) clock_gettime() is in librt. Add a
check for this to avoid build breakage for programs/libraries that
use libbsd on such systems.
Based-on-patch-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
ed84bec5
|
2016-02-10T10:38:51
|
|
Switch URLs from http or git to https
|
|
cbe30577
|
2016-02-07T02:53:28
|
|
Fix file descriptor leak in HASHFileChunk helper
This leak only happens on error conditions, so it's not too bad.
Warned-by: coverity
|
|
5a32ea0a
|
2016-02-07T02:47:22
|
|
Fix unportable sizeof() usage
We are calculating the size of the array, and need to pass the size of
each element, not the size of a pointer to an element. Although this
happens to be the same in many cases, this is not a portable assumption.
Warned-by: coverity
|
|
c8f0723d
|
2016-01-27T15:10:11
|
|
Fix heap buffer overflow in fgetwln()
In the function fgetwln() there's a 4 byte heap overflow.
There is a while loop that has this check to see whether there's still
enough space in the buffer:
if (!fb->len || wused > fb->len) {
If this is true more memory gets allocated. However this test won't be
true if wused == fb->len, but at that point wused already points out
of the buffer. Some lines later there's a write to the buffer:
fb->wbuf[wused++] = wc;
This bug was found with the help of address sanitizer.
Warned-by: ASAN
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93881
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
7a756875
|
2015-12-14T03:03:57
|
|
Add support for GNU/Hurd to getentropy()
Reuse the getentropy code for Linux on the Hurd, which has fallbacks
for when the better interfaces are not present. And remove all the code
that is not supported currently on the Hurd. Ideally the Hurd should
get an equivalent interfaces that does not suffer from the same
problems as /dev/urandom.
|
|
da137a09
|
2015-12-07T01:53:49
|
|
Add missing copyright and license headers
|
|
d2f59a23
|
2015-12-02T04:00:58
|
|
Fix getentropy implementation to use the correct system hooks
Include getentropy_<SYSTEM>.c instead of arc4random_<SYSTEM>.c.
|
|
01b77f0d
|
2015-12-02T03:32:13
|
|
Add support for GNU/kFreeBSD for closefrom() and getentropy()
|
|
75729394
|
2015-12-02T03:08:17
|
|
Unify most arc4random Unix hooks into a single file
The Unix hook should work for most Unix-like systems, move glibc
specific code there and a FreeBSd specific comment, and remove the rest.
Also change the code to always fallback to use the generic Unix code.
This should cover GNU/Hurd and GNU/kFreeBSD among others.
|
|
8493c7f2
|
2015-12-01T03:39:10
|
|
Use local SHA512 header
Actually use the local private SHA512 header instead of relying on the
OpenSSL one for no good reason. Add definition for expected macro
SHA512_DIGEST_LENGTH.
|
|
874a0e51
|
2015-09-23T19:39:47
|
|
Update arc4random module from OpenBSD and LibreSSL
Rework arc4random_stir() and arc4random_addrandom() code over the new
internal API, and documentation in the man page. Adapt the code to the
local build system.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85827
|
|
9a9a8b2d
|
2015-09-23T19:39:47
|
|
Add private getentropy module from OpenBSD and LibreSSL
Adapt the code to the local build system.
|
|
5f9265f8
|
2015-09-23T20:13:33
|
|
Add private SHA512 module from FreeBSD
|
|
1f77cdb4
|
2015-11-30T20:39:00
|
|
Add NIOS2 support to nlist()
Add support for the NIOS2 soft-core CPU provided by Altera.
Signed-off-by: Marek Vasut <marex@denx.de>
Signed-off-by: Guillem Jover <guillem@hadrons.org>
Cc: Ley Foon Tan <lftan@altera.com>
Cc: Thomas Chou <thomas@wytron.com.tw>
Cc: Walter Goossens <waltergoossens@home.nl>
|
|
0871daf7
|
2015-11-30T04:12:02
|
|
build: Move hash/helper.c into new libbsd_la_included_sources
Use this variable in EXTRA_DIST and libbsd_la_DEPENDENCIES.
|
|
45443583
|
2015-09-23T19:37:37
|
|
Add explicit_bzero() function from OpenBSD
|
|
8641d8ae
|
2015-09-24T04:01:11
|
|
Make closefrom_procfs() fail when reallocarray() fails
|
|
0982dcd9
|
2015-09-23T07:10:18
|
|
Lock the file streams in fgetln() and fparseln()
The fparseln() function had the NetBSD uppercase macros stubbed out,
so replace them with the actual stdio ones. The fgetln() function was
missing any locking at all.
|
|
151bc71d
|
2015-09-22T16:22:56
|
|
Add compile and link-time deprecation warnings for fgetln()
Although the current implementation in libbsd is probably one of the
safest ones around, it still poses some problems when used with many
file streams. This function has now a replacement, that is both more
standard and portable. Ask users to switch to getline(3) instead.
|
|
41ff37bb
|
2015-09-22T16:21:12
|
|
build: Add support for linker warnings
|
|
53d989a2
|
2014-12-13T21:28:36
|
|
Switch fparseln() implementation from fgetln() to getline()
|
|
f50b197e
|
2015-09-22T22:30:17
|
|
test: Add fparseln() unit test
|
|
9688ab26
|
2014-12-13T08:55:59
|
|
Avoid left shift overflow in reallocarray
Some 64-bit platforms (e.g. Windows 64) have a 32-bit long. So, shifting
1UL 32-bits to the left causes an overflow. This replaces the constant
1UL with (size_t)1 so that we get the correct constant size for the
platform.
Import from OpenBSD.
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
025b4480
|
2014-11-04T05:34:46
|
|
Make mergesort setup() static
|
|
a6a101ef
|
2014-11-04T05:33:26
|
|
Use ANSI C prototypes
|
|
32388fe5
|
2014-11-03T23:21:52
|
|
Use reallocarray() instead of malloc() or realloc()
|
|
30e328cb
|
2014-11-03T00:43:27
|
|
Do not close file descriptors while scanning the /proc filesystem
Closing file descriptors changes the content of the fd directories in
the /proc filesystem, which means readdir() might get very confused.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=85663
|
|
4cc43915
|
2014-11-02T23:58:23
|
|
Move procfs based implementation into a new closefrom_procfs() function
|
|
34df1426
|
2014-11-05T20:01:53
|
|
Refactor file descriptor closure into a new closefrom_close()
|
|
3881c4fc
|
2014-11-02T00:23:00
|
|
Update closefrom() function
Import from sudo. Adapt the build system to detect the required features.
|
|
cfb4d462
|
2014-11-01T00:54:09
|
|
test: Move and activate fpurge() test case from module to a dedicated file
|
|
02b55488
|
2014-08-12T12:32:34
|
|
Use stdint integer types instead of BSD legacy ones
|
|
e8d3d041
|
2014-07-20T01:48:20
|
|
build: Remove hard requirement for GNU .init_array section support
In case the support is not available, just stop building the
libbsd-ctor.a library, which is a nice to have thing, but should not
have been a hard requirement from the start. This should allow to
build libbsd on non-glibc based systems using another libc.
|
|
faa005cb
|
2014-06-27T02:05:11
|
|
Add reallocarray() function from OpenBSD
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
36aca8c0
|
2014-06-26T21:43:55
|
|
Add stringlist module from NetBSD
|
|
e8f93003
|
2014-06-26T21:32:11
|
|
Add getbsize() function
Import code from DragonFlyBSD and man page from FreeBSD.
|
|
a88bb838
|
2014-03-06T22:10:36
|
|
Add OpenRISC support to nlist()
Signed-off-by: Guillem Jover <guillem@hadrons.org>
|
|
8d16c3df
|
2013-10-11T05:43:42
|
|
Add timeconv module from FreeBSD
Inline license information from FreeBSD root dir COPYRIGHT file.
|
|
f41fdcf1
|
2013-10-21T05:07:56
|
|
Add funopen() function
This is a wrapper over the glibc fopencookie() function.
We diverge from the FreeBSD, OpenBSD and DragonFlyBSD declarations,
because seekfn() there wrongly uses fpos_t, assuming it's an integral
type, and any code using that on a system where fpos_t is a struct
(such as GNU-based systems or NetBSD) will fail to build. In which case,
as the code has to be modified anyway, we might just as well use the
correct declaration.
|
|
61b2dbb8
|
2013-07-15T01:44:30
|
|
Fix dehumanize_number() to correctly detect overflows
Do not allow numbers greated than INT64_MAX and smaller than INT64_MIN.
Clarify the positive sign value by prefixing it with an explicit +.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66909
|
|
948bcf1d
|
2013-07-13T02:11:20
|
|
Warn when setproctitle() gets called before initialization
Try to give a helpful message in case the program is not initializing
the setproctitle() machinery.
|
|
c5b95902
|
2013-07-11T12:25:54
|
|
Move setproctitle() automatic initialization to its own library
The automatic initialization cannot be part of the main shared library,
because there is no thread-safe way to change the environ global
variable. This is not a problem if the initializaion happens just at
program load time, but becomes one if the shared library is directly or
indirectly dlopen()ed during the execution of the program, which could
have either kept references to the old environ or could change it in
some other thread. This has been observed for example on systems using
Samba NSS modules.
To avoid any other possible fallout, the constructor is split into a
new static library that needs to be linked explicitly into programs
using setproctitle(). As an additional safety measure the pkg-config
linker flags will mark the program as not allowing to be dlopen()ed
so that we avoid the problem described above.
Reported-by: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66679
|
|
3077d2ff
|
2013-07-12T22:15:58
|
|
build: Move version ABI from Makefile to configure.ac
It's easier to find there, and the value can be reused in case we have
to provide another shared library.
|
|
1bf0a555
|
2013-06-08T17:43:42
|
|
Release libbsd 0.5.2
|
|
ad613d9d
|
2013-06-07T07:11:50
|
|
Create a shallow copy of environ before replacing it in setproctitle()
Because clearenv() or setenv() might free the environ array of pointers,
we should make sure to copy it so that we can access it later on when
doing the deep copy via setenv().
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=65470
|
|
e084ce3f
|
2013-06-07T04:46:29
|
|
Specify setproctitle_stub() signature manually if typeof is missing
Do not stop exporting the function in the version node even if typeof
is not available, as that would break ABI.
|
|
50e4c55a
|
2013-06-08T17:55:19
|
|
Try to check if setproctitle() constructor got passed arguments
|
|
6faea4d2
|
2013-05-29T02:23:56
|
|
Force setproctitle() into .init_array section
The GNU .init_array support is an extension over the standard System V
ABI .init_array support, which passes the main() arguments to the init
function.
This support comes in three parts. First the dynamic linker (from glibc)
needs to support it. Then function pointers need to be placed in the
section, for example by using __attribute__((constructor)), that the
compiler (gcc or clang for example) might place in section .ctors and
the linker (from binutils) will move to .init_array on the output
object, or by placing them directly into .init_array by the compiler
when compiling. If this does not happen and the function pointers end
up in .ctors, then they will not get passed the main() arguments, which
we do really need in this case.
But this relies on recent binutils or gcc having native .init_array
support, and not having it disabled through --disable-initfini-array.
To guarantee we get the correct behaviour, let's just place the function
pointer in the .init_array section directly, so we only require a recent
enough glibc.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=65029
|
|
46633647
|
2013-05-27T06:52:05
|
|
Release libbsd 0.5.1
|
|
95878823
|
2013-05-21T04:34:34
|
|
Release libbsd 0.5.0
|
|
509841b5
|
2013-05-25T15:44:57
|
|
build: Use AM_V_at for mkdir
|
|
7c4caa67
|
2013-05-25T15:36:11
|
|
Fix comparison between signed and unsigned integer compiler warnings
|
|
30349f89
|
2013-05-25T15:35:39
|
|
Update radixsort module from NetBSD
Merge some interesting changes.
|
|
96a2dae3
|
2013-05-25T15:31:45
|
|
Update setmode module from NetBSD
Merge some interesting changes.
|