summaryrefslogtreecommitdiffstats
path: root/lib/csu
Commit message (Collapse)AuthorAgeFilesLines
* Do not create *.gmon files for PIE executables on i386.jilles2010-03-201-1/+1
| | | | | | | | | | | | Scrt1_c.o was accidentally compiled with -DGCRT (profiling), like gcrt1_c.o. This problem is i386-specific, the other architectures are OK. If you have problems with PIE executables such as samba and cups leaving behind gmon files, rebuild them after installing this change. PR: ports/143924 Reviewed by: kib MFC after: 3 days
* Fix spelling of noreorder.jmallett2010-03-131-1/+1
|
* Use default WARNS setting (of 6) for lib/csu.uqs2010-03-056-15/+7
| | | | | | PR: bin/140089 Reviewed by: jmallett Approved by: ed (co-mentor)
* Properly declare non-extern functions in crt1uqs2010-03-055-5/+13
| | | | | | | | Also move the declarations after __progname consistently to make the distinction clearer. Reviewed by: jmallett Approved by: ed (co-mentor)
* Use ABI neutral macrosaimp2010-03-032-29/+51
| | | | Submitted by: jmallet
* __main and __gccmain are no longer required, so eliminate them.imp2010-03-031-3/+0
| | | | Submitted by: jmallet@
* Build lib/ with WARNS=6 by default.ed2010-01-024-1/+6
| | | | | | | | | Similar to libexec/, do the same with lib/. Make WARNS=6 the norm and lower it when needed. I'm setting WARNS?=0 for secure/. It seems secure/ includes the Makefile.inc provided by lib/. I'm not going to touch that directory. Most of the code there is contributed anyway.
* Properly support -fPIE by linking PIE binaries with specially-builtkib2009-12-029-35/+93
| | | | | | | | | | | | | | Scrt1.o instead of crt1.o, since the later is built as non-PIC. Separate i386-elf crt1.c into the pure assembler part and C code, supplying all data extracted by assembler stub as explicit parameters [1]. Hide and localize _start1 symbol used as an interface between asm and C code. In collaboration with: kan Inspired by: PR i386/127387 [1] Prodded and tested by: rdivacky [1] MFC after: 3 weeks
* Fix build when WITH_SSP is set explicitly.ru2009-02-211-1/+1
| | | | Submitted by: Jeremie Le Hen
* Add -fno-omit-frame-pointer to CFLAGS used to compile crt1.c on amd64.kib2008-08-221-0/+1
| | | | | | | | | | For gcc' __builtin_frame_address() to work, all call frames need to save frame pointer. In particular, this is important for the upper frame that should terminate the chain. No objections from: jhb PR: amd64/126543 MFC after: 1 week
* Enable GCC stack protection (aka Propolice) for userland:ru2008-06-251-0/+3
| | | | | | | | | | | | | | | | | | | | | - It is opt-out for now so as to give it maximum testing, but it may be turned opt-in for stable branches depending on the consensus. You can turn it off with WITHOUT_SSP. - WITHOUT_SSP was previously used to disable the build of GNU libssp. It is harmless to steal the knob as SSP symbols have been provided by libc for a long time, GNU libssp should not have been much used. - SSP is disabled in a few corners such as system bootstrap programs (sys/boot), process bootstrap code (rtld, csu) and SSP symbols themselves. - It should be safe to use -fstack-protector-all to build world, however libc will be automatically downgraded to -fstack-protector because it breaks rtld otherwise. - This option is unavailable on ia64. Enable GCC stack protection (aka Propolice) for kernel: - It is opt-out for now so as to give it maximum testing. - Do not compile your kernel with -fstack-protector-all, it won't work. Submitted by: Jeremie Le Hen <jeremie@le-hen.org>
* Bring C runtime bits for FreeBSD/mips from p4 mips2-jnpr branch.gonzo2008-05-034-0/+191
| | | | Approved by: cognet (mentor)
* The __used (== __attribute__((__used)) ) silences the warning producedkib2007-12-041-1/+1
| | | | | | by unreferenced symbol. Apply __used instead of rev. 1.5. Requested by: kan
* Restore the branding of the ELF executables. The structure was optimized out.kib2007-12-031-1/+1
| | | | MFC after: 3 days
* Fix TLS on sparc64 for statically and dynamically linked binarieskmacy2006-10-081-4/+3
| | | | | Approved by: rwatson (mentor) Reviewed by: jmg and marcel
* Remove alpha left-overs.ru2006-08-224-233/+0
|
* GC these crt{begin,end}.c, which are unused since the last FreeBSD platformmarius2006-05-222-114/+0
| | | | switched to those created from GCC's crtstuff.c 4 years ago.
* Fixed profiling of main() for amd64 and i386. This started rottingbde2005-10-072-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | in 1993 in rev.1.5 of the i386 a.out version (csu/i386/crt0.c). Profiling uses a magic label "eprol" to delimit the start of the part of the text section covered by profiling. This label must be placed before the call to main() to get main() properly profiled. It was placed there in rev.1.1 of crt0.c. Rev.1.5 imported the initial implementation of shared libraries in FreeBSD and misplaced the label. Fortunately, the misplaced label was misspelled and the old label wasn't removed, so the new label had no effect. Unfortunately, when profiling was implemented for the ELF in 1998 in rev.1.2 of csu/i386-elf/crt1.c, only the incorrectly placed label was copied (after fixing its name). The bug was then copied to all other arches. The label seems to be still misplaced in NetBSD for most arches. It is in common.c for most arches so it is even further from being inside the function that calls main(). I think "eprol" is short for "end of prologue", but it must be placed before the end of the prologue so that it covers main(). crt0.c has it before the calls atexit(_mcleanup) and monstartup(...), but it cannot affect these calls so I moved it after the call to monstartup(). It now also covers the call to _init() but not the newer call to _init_tls(). Profiling of _init() seems to be harmless, and the call to _init_tls() seems to be misplaced. Reviewed by: jdp (long ago, for a slightly different i386 version)
* Align the stack to a 16 byte boundary so that we can safely call functionsdfr2005-05-191-0/+3
| | | | | | | | | that use SSE. The compiler does attempt to do this in main() but not very successfully - it still manages to use unaligned offsets from %ebp in some cases. Also we need to have an aligned stack in case something uses SSE via _init(). MFC After: 1 week
* Keep the stack aligned to a 16 byte boundary when calling init functionsdfr2005-05-192-0/+4
| | | | | | | so that we don't cause a bus error if they start storing SSE math stuff on the stack. MFC After: 1 week
* Remnant code (broken, unhooked) from a.out which I missed.trhodes2005-01-113-527/+0
| | | | Noticed by: ru
* Implement .init and .fini.cognet2004-09-233-8/+27
|
* Back out the call to _init_tls() - something is broken there and itdfr2004-08-211-2/+0
| | | | prevents all static binaries from running.
* Bring ia64 back from the dead. After a call one needs to restore themarcel2004-08-181-1/+1
| | | | | | | | | GP register, because it's clobbered for calls across load modules. The previous commit inserted the call to _init_tls() between the call to atexit() and the restoration of the GP register clobbered by it. Fix: restore GP before we call _init_tls(). Pointy hat: dfr@
* Add support for TLS in statically linked programs.dfr2004-08-157-0/+17
|
* C runtime support for FreeBSD/arm.cognet2004-05-144-0/+169
|
* Adjust stack alignment so that when the 'call xxx' functions arepeter2004-03-212-0/+4
| | | | | gathered into the middle of the _init and _fini sections, they get executed with their expected stack alignment.
* The <bsd.files.mk> API seems the best to use here.ru2004-01-201-11/+7
|
* Explicitly specify an alignment for abitag. Without it, gcc specifies apeter2003-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | section alignnment of 16 bytes for amd64 and this breaks file(1). Before: ./cp: ELF 64-bit LSB executable, AMD x86-64, version 1 (FreeBSD), for \ FreeBSD 127.7.9, statically linked, stripped after: ^^^^^^^ ./ls: ELF 64-bit LSB executable, AMD x86-64, version 1 (FreeBSD), for \ FreeBSD 5.0.1, dynamically linked (uses shared libs), stripped The reason for this is that the NOTE sections are not contiguous internally. If the note section has an alignment of 16, then anything that looks for the data is supposed to round up the payload start to the next multiple of the alignment. But FreeBSD/amd64 broke because the structure is declared as a single structure, not a (header,payload) group, where the payload had an explicit alignment roundup. The alternative is to change things like file(1) to ignore the ELF payload alignment rules for the PT_NOTE section only for FreeBSD.
* Fix typo: Passing the first argument to exit() in out2 does not work.marcel2003-07-151-1/+1
| | | | Trust me.
* _start() needed to be written in assembly. See crt1.S.marcel2003-07-141-124/+0
|
* Rewite _start(). We cannot use a C function due to the fact that wemarcel2003-07-132-2/+193
| | | | | | | | | | | | | | | | | don't call it according to the runtime specification and especially WRT to gp this can cause trouble. The gcc 3.3.1 import broke the ia64 runtime because the compiler saved gp prior to us being able to set it properly. Restoring gp after the calls would then invalidate gp and cause segmentation faults later on. By rewriting _start() as an assembly function, we also avoided even more gcc dependences, by trying to use gcc specific features to work around the problem. This version of _start() does not reference _DYNAMIC. We register the cleanup function when it's a non-NULL pointer. The kernel will always pass a NULL pointer and dynamic linkers may pass a non-NULL pointer. The machine independent code to set __progname now unfortunately is written in assembly. So be it.
* MFi386: revision 1.19.ru2003-06-301-3/+1
|
* Removed garbage:bde2003-06-041-3/+1
| | | | | | | - -elf in CFLAGS had no effect except to reduce portability. - -elf in LDFLAGS had even less effect, since LDFLAGS is not used. - -Wall in CFLAGS had no effect except to reduce portability and break overriding of WARNS, since the setting of WARNS implies -Wall.
* This is now Gcc 3.3 WARNS 6 clean.obrien2003-05-041-0/+1
|
* Set abitag __unused.obrien2003-05-041-3/+4
|
* Update for AMD64. repocopied from i386-elf/crt1.c. Deal with regparmpeter2003-04-301-20/+5
| | | | | argument passing rather than stack based args. The kernel passes the base of the argument/env vector in %rdi (arg1).
* Very minor EOL whitespace diff-reducer.markm2003-01-261-1/+1
|
* Missed a bit of cleanup.markm2003-01-261-2/+0
|
* make these more useful for lint(1). Minor diff-reductions while I'mmarkm2003-01-266-1/+7
| | | | about it.
* Remove the get_term() function. It pretty much can't work formarkm2003-01-261-36/+7
| | | | | | | | FreeBSD, and makes ugly diffs with the other crt1.c's. Leave behind a comment (words supplied by Thomas Moestl) that explain the issue. OK'ed by: tmm
* Backed out previous commit (alignment suitable for RELENG_4) as plannedbde2002-12-012-66/+0
| | | | | | | | since it has been MFC'ed. See the log message for the previous commit for more details. The alignment bug in gcc-3 has not been fixed, but it is not very serious and the previous commit just moved it (as intended). Approved by: re (murray)
* Align the stack suitably for the version of gcc in FreeBSD-4 (providedbde2002-09-292-0/+66
| | | | | | | | | | | | | | | | | | | -fomit-frame-pointer is not used). This is mostly moot for -current because gcc-3 does the alignment (slightly incorrectly) in main(). This patch is intended for easy MFC'ing and should be backed out in -current soon since it causes compiler warnings and better fixes are possible in -current. The best fix is to do nothing here and wait for gcc to do stack alignment right. gcc-3 aligns the stack in main(), but does it too late for main()'s local variables and too late for anything called before main(). A misaligned stack is now more than an efficiency problem, since some SSE instructions in some or all (hardware) implementations trap on misaligned operands even if alignment checking is not enabled. PR: 41528: Submitted by: NIIMI Satoshi <sa2c@sa2c.net> (original version) MFC after: 3 days
* Remove a prototype for a function that is no longer called.markm2002-09-201-1/+0
|
* Don't need to install the signal trampoline here anymore.jake2002-09-031-1/+0
|
* Drop support for COPY, -c has been the default mode of install(1)ru2002-07-297-7/+7
| | | | | | for a long time now. Approved by: bde
* The main reason for this is to reduce diffs between all the crt1.c's.markm2002-07-166-91/+140
| | | | | | | | | | | | | | | | | | | Assembler macros are tidied up and made as similar as sanely possible. The macros are translated into C (__inline static) functions for lint. Declaration orders are made the same. Declarations are all ISOfied and tidied up. Comment contents have gratuitous diffs removed. The net result is a bunch of crt1.c's that are 90% the same. It may be possible to now encapsulate the differences in one MD header, and have only one MI crt1.c file (although the macros to do this may be ugly). Helpful comments by: obrien, bde Alpha tested by: des i386-elf tested by: markm
* Whitespace diffs only; this brings this file into the same whitespacemarkm2002-07-032-52/+54
| | | | | | convention as src/lib/csu/*/crt1.c. This will make the follow up diffs easier to see and extract.
* WARNS=6'ify.obrien2002-06-251-7/+5
| | | | Style nits.
* Prototype _start.obrien2002-06-251-2/+4
| | | | | | Submitted by: markm Mark some _start formal parameters __unused.
OpenPOWER on IntegriCloud