Commit Graph

496 Commits

Author SHA1 Message Date
matt
0ac54b7e3b Don't include <machine/asm.h> 2011-07-30 15:28:58 +00:00
mrg
7c7bb760e6 revert the previous. it didn't help and wasn't the problem anyway. 2011-07-16 23:07:50 +00:00
matt
9decdbdfe4 Add missing */ 2011-07-04 21:55:09 +00:00
mrg
cd21741236 XXX: for now, build sparc64 csu with -O1 if using GCC 4.5. 2011-07-04 21:54:18 +00:00
matt
532130a31c The kernel and ld.elf_so call with a different order for
cleanup, obj, ps_strings so deal with it.
With this change, USE_COMPILERCRTSTUFF=no works.
2011-07-02 20:16:09 +00:00
matt
675a57b0bb Adapt to the new ___start calling convention 2011-07-02 20:14:10 +00:00
matt
fe30c1af31 Make this adhere to the SVR4 ABI. 2011-07-02 07:28:08 +00:00
joerg
c4cda1a2a7 Explicitly declare ___start as hidden. 2011-07-01 02:59:05 +00:00
matt
d8b68e8316 Adapt to new ___start definition.
Use PIC method to load %r13 with address of _SDA_BASE_
2011-06-30 20:10:17 +00:00
wiz
4cbd24b23f dependant -> dependent 2011-06-30 20:09:15 +00:00
matt
0d4e6aae2a Mark ___start as .hidden (for MKPIE=yes executables). 2011-06-30 20:07:35 +00:00
joerg
226567c8f9 Assert that ps_strings is valid. Use it to drop the first three
arguments to ___start to make the assembler callers simpler.
2011-06-30 19:48:43 +00:00
mrg
8f161cd6d3 remove all the code that supported HAVE_GCC=3. mostly from chuq. 2011-06-20 06:52:36 +00:00
matt
01061e574e Don't initialize %r2 for SDA2_BASE anymore. It's needed for TLS. 2011-03-12 07:56:36 +00:00
joerg
5c3ccd6eba Pass down ELF Auxillary Vectors for static NetBSD binaries too.
Rename __libc_init to _libc_init and call it explicitly from CSU code.
This enforces the constructor run order for newly linked programs.
Keep it as constructor with run-once semantic for binary compatibility.
Implement dl_iterate_phdr for statically linked programs.

This material is based upon work partially supported by
The NetBSD Foundation under a contract with Joerg Sonnenberger.
2011-03-07 05:09:09 +00:00
matt
2bf60042d7 When loading r13 and r2 with _SDA_BASE_ and _SDA2_BASE, do so in a PIC
manner.  With this change, simple programs can now run with MKPIE=yes
2011-02-26 17:11:23 +00:00
skrll
1548def5e3 Remove old hack for broken binutils. 2011-02-23 10:26:09 +00:00
joerg
9674b81ed9 Introduce __weakref_visible to handle the different required visibility
for weak references. GCC 4.2+ and Clang require static, older GCC wants
extern. Change __weak_reference to include sym. This requires changes
the existing users to not reuse the name of the symbol, but avoids
further differences between GCC 4.1 and GCC 4.2+/clang.
2011-02-22 05:45:05 +00:00
joerg
86df96f692 Allow building with the changed weakref semantic in GCC 4.2 and clang. 2011-02-18 23:37:36 +00:00
matt
af25d173e6 Distinguish between a corrupt obj pointer and a null obj pointer. 2011-02-08 02:03:13 +00:00
matt
8f55cdd3bd First pass at new crtstuff for powerpc. Doesn't quite work yet
(obj parameter to ___start seems to get corrupted sometimes)
2011-02-08 02:02:25 +00:00
drochner
953846fa39 use of .PARSEDIR just doesn't work with .OBJDIR, replace with .CURDIR 2011-01-31 17:54:20 +00:00
matt
b09982f7da Use uintptr_t instead of u_long.
When fetching argc use off the stack, use *(long *) instead of *(int *)
because on mips64 BE system, that int deference will only fetch 0.
2011-01-23 06:25:57 +00:00
joerg
c37869d883 Build assembler sources with assembler compile rules. 2010-12-07 19:51:02 +00:00
joerg
cb0b8d7cc6 Fix stack alignment for non-constructor/destructor calls.
AMD64 stack is 16 Byte aligned at the start of the function,
so always push rbx.
2010-11-30 18:37:59 +00:00
skrll
15fa0783d7 Centralise USE_COMPILERCRTSTUFF.
PCC might need help.
2010-11-28 18:40:54 +00:00
joerg
fcd549e0e4 Retire old crtbegin/crtend implementation. It is not compatible with the
expectations of modern C++
2010-08-07 18:06:59 +00:00
joerg
01bc9d5012 Switch i386 and x86_64 to the new CRT layout. The crt0.c body is shared
between all platforms and a small assembler stub in crt0.S is used for
setting up the proper stack and whatever else MD needs.

Extract crti.S and crtn. from the old dot_init.h files. Prepare other
platforms that use the 6-argument form of __(_)start for this.

Rewrite the crtbegin and crtend modules in assembler to make them
compiler independent. Document the interface in README.
2010-08-07 18:01:32 +00:00
mrg
4f893703d8 delete all the a.out csu code. 2010-07-05 21:27:55 +00:00
matt
1e301281a1 Merge from matt-nb5-mips64 2009-12-14 01:00:46 +00:00
mrg
6b59d31236 move the include for <bsd.own.mk> down a little. 2009-12-13 08:52:38 +00:00
mrg
cba14cb13e look for ${CSU_MACHINE_ARCH}_elf directory first. 2009-12-13 08:03:44 +00:00
skrll
7a915839ac Make lib/csu compile. XXX somewhat bogus. 2009-11-09 14:34:42 +00:00
christos
ad57574aad strip .ident, if MKSTRIPIDENT. From Adam Ciarci 2009-02-18 15:21:52 +00:00
gmcgarry
3c9a95916d Wrap compiler-specific flags with HAVE_GCC and HAVE_PCC as necessary. Add a few flags for PCC. 2008-08-29 00:02:21 +00:00
lukem
ae07e87382 Enable MAKEVERBOSE support. 2008-07-21 15:34:58 +00:00
gmcgarry
38541e9dad Remove old GCC bug work-around which relied on GCC extension. 2008-06-21 00:52:52 +00:00
mrg
c2b95373bf remove clause #3 from my license where there are no other
copyright holders involved.
2008-05-29 14:51:25 +00:00
martin
5d1469bd77 Backout previous: the license sweep touched these files in error, so
restore the old license.
2008-05-10 15:31:03 +00:00
martin
3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
rearnsha
00f0061ae9 ARM/Thumb interworking support 2008-03-15 10:46:24 +00:00
simonb
ccab3b34ce Remove support for NetBSD/pc532. 2008-01-10 13:40:36 +00:00
skrll
587600728d Fix things so that crti.o doesn't contain a completely bogus unwind entry
that covers far too much and confuses gdb.

While here remove useless dave/restore of r4.
2007-12-02 13:55:38 +00:00
yamt
c2ad33834a CLEANFILES=${OBJS} 2007-12-01 11:06:36 +00:00
yamt
82f3754f04 ___start: remove a stale comment. 2007-12-01 10:16:06 +00:00
skrll
6e57c35ead Remove an include that's not required. 2007-11-13 08:41:50 +00:00
dogcow
b8d6c11ba4 <machine/profile.h> needs <sys/types.h>; why crt0.c needs <machine/profile.h>
(and only on amd64) is another question altogether.
2007-09-27 10:51:18 +00:00
skrll
795d937239 All platforms are MD_DO_NOT_NEED_FALLTHRU now so no need to keep it
conditional.
2007-05-15 16:51:37 +00:00
skrll
c97173f648 MD_DO_NOT_NEED_FALLTHRU for amd64.
Thanks to Juan Romero Pardines for testing.
2007-05-15 16:48:13 +00:00