aboutsummaryrefslogtreecommitdiff
path: root/lib/csu/i386
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-164-8/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-163-6/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* csu: Implement _start using as to satisfy unwinders on i386Dmitry Chagin2023-07-113-28/+54
| | | | | | | | | | | | | | The right unwinding stop indicator should be CFI-undefined PC. https://dwarfstd.org/doc/Dwarf3.pdf - page 118: If a Return Address register is defined in the virtual unwind table, and its rule is undefined (for example, by DW_CFA_undefined), then there is no return address and no call address, and the virtual unwind of stack activations is complete. The hack localizing _start1 symbol removed. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D40624
* csu: Add the prologue and epilogue to the _init and _fini on i386Dmitry Chagin2023-07-112-4/+10
| | | | | | | | | | | | | Normally, modern unwinders uses Dwarf information to unwind stack, however in case when the code is not annotated by Dwarf instructions, unwinders fallbacks to a frame-pointer based algorithm. That is allows libunwind to unwind stack from global constructors and destructors. Also it makes gdb happy as it printed nonexistent frame before. Reviewed by: kib, imp Differential Revision: https://reviews.freebsd.org/D40948
* csu: move common code to libcKonstantin Belousov2023-03-113-111/+5
| | | | | | | | | | | | | | | | | | | | | | Why? Most trivial point, it shaves around 600 bytes from the dynamic binaries on amd64. Less trivial, the removed code is no longer part of the ABI, and we can ship updates to it with libc updates. Right now most of the csu is linked into the binaries and require us to do somewhat tricky ABI compat when it needs to change. For instance, the init_array change would be much simpler and does not require note tagging if we have init calling code in libc. This could be improved more, by splitting dynamic and static initialization. For instance, &_DYNAMIC tests can be removed then. Such change, nonetheless, would require building libc three times. I left this for later, after this change stabilizes, if ever. Reviewed by: markj Discussed with: jrtc27 (some objections, see the review), imp Tested by: markj (aarch64) Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D37220
* lib/csu: Get rid of unused fptr typedef on amd64.Gleb Popov2021-07-251-4/+2
| | | | | | | | Make i386 and riscv parts not use it. Approved by: kib Differential Revision: https://reviews.freebsd.org/D31281
* Consolidate duplicated logic in csu Makefiles to lib/csu/Makefile.inc.John Baldwin2020-07-031-32/+2
| | | | | | | | | Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25537 Notes: svn path=/head/; revision=362902
* Only include object files from .ALLSRC when linking crt1 objects.John Baldwin2020-06-261-3/+3
| | | | | | | | | | Reported by: np, peterj Reviewed by: kib, emaste Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25469 Notes: svn path=/head/; revision=362660
* Always compile the brand and ignore init ELF notes standalone.John Baldwin2020-06-242-9/+7
| | | | | | | | | Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25374 Notes: svn path=/head/; revision=362589
* Remove the sed hack for ABI tag notes.John Baldwin2020-06-153-25/+8
| | | | | | | | | | | | | | | | | | The ELF notes compiled in C were placed in a section with the wrong type (SHT_PROGBITS instead of SHT_NOTE). Previously, sed was used on the generated assembly to rewrite the section type. Instead, write the notes in assembly which permits setting the correct section type directly. While here, move inline assembly entry points out of C and into assembly for aarch64, arm, and riscv. Reviewed by: kib Tested on: amd64 (cirrus-ci), riscv64 Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D25211 Notes: svn path=/head/; revision=362203
* csu: use BSD-1-clause license on csu filesEd Maste2018-11-202-6/+0
| | | | | | | | | | Copyright on these files is held by kib@ and/or the Foundation, and both agree to this change. Approved by: kib Notes: svn path=/head/; revision=340702
* Implement a BSD licensed crtbegin/crtendAndrew Turner2018-10-251-0/+32
| | | | | | | | | | | | | | | | | These are needed for .ctors/.dtors and .jcr handling. The former needs all the function pointers to be called in the correct order from the .init/.fini section. The latter just needs to call a gcj specific function if it exists with a pointer to the start of the .jcr section. This is currently disabled until __dso_handle support is added. Reviewed by: emaste MFC after: 1 month Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17587 Notes: svn path=/head/; revision=339738
* Process irelocs for statically linked binaries from crt1 on x86.Konstantin Belousov2018-10-133-3/+94
| | | | | | | | | | | | | This makes statically linked binaries with ifuncs operational. Reported and tested by: mjg Reviewed by: emaste, markj Sponsored by: The FreeBSD Foundation Approved by: re (rgrimes) Differential revision: https://reviews.freebsd.org/D17363 Notes: svn path=/head/; revision=339351
* Rework r234502 to include a modified CFLAGS along with ACFLAGS.John Baldwin2017-04-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | On most architectures crt objects are compiled in a multiple-step process so that sed can be run on the generated assembly. As the final step, the C compiler generates an object file from the modified assembly output. Currently this last step uses $CC with only $ACFLAGS. However, for other uses in the tree, $ACFLAGS is meant to include assembly-specific compiler flags that are in addition to $CFLAGS (see default .S.o rules bsd.suffixes.mk). In particular, external toolchains may require additional flags to select a non-default target which will be present in CFLAGS but not ACFLAGS. To support this while still mitigating the issue with CFLAGS described in r234502, include a modified CFLAGS that excludes "-g" when assembling the modified assembly files. Note that normally an assembler ($AS) is used to assemble .s flags to object files (see bsd.suffixes.mk). However, llvm-based toolchains do not currently have a stand-alone assembler. Reviewed by: imp Sponsored by: DARPA / AFRL Differential Revision: https://reviews.freebsd.org/D10085 Notes: svn path=/head/; revision=316620
* Use SRCTOP-relative paths and .CURDIR with :H instead of ".." specified pathsEnji Cooper2017-01-201-3/+3
| | | | | | | | | | This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=312455
* Remove historical GNUC testEd Maste2015-12-081-6/+0
| | | | | | | | | | | | The requirement is for a GCC-compatible compiler and not necessarily GCC itself. However, we currently expect any compiler used for building the whole of FreeBSD to be GCC-compatible and many things will break if not; there's no longer a need to have an explicit test for this in csu. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=292000
* META_MODE: Remove DEP_RELDIR from Makefile.depend files.Bryan Drewery2015-09-251-2/+0
| | | | | | | | | This has not been needed since r284171 in projects/bmake. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=288226
* Fix installation of 32bit libraries after r288074.Bryan Drewery2015-09-211-0/+2
| | | | | | | | | | | | | | FILES is not used when LIBRARIES_ONLY is set, which is used to build and install the lib32 sysroot. All of the csu files do quality as "libraries" for this case so just undefine LIBRARIES_ONLY. This is still better than the previous realinstall handling as it does not hook into META_MODE properly. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=288076
* Replace realinstall: and META_MODE staging hacks with FILES mechanism.Bryan Drewery2015-09-211-5/+5
| | | | | | | | | | | | | This partially reverts r270170 for lib/csu/i386 while retaining the change for using bsd.lib.mk. These FILES groups could go into lib/csu/Makefile.inc but I've kept them in the Makefiles for clarity. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=288074
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+14
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * Merge sync of headSimon J. Gerraty2015-05-276-0/+282
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
* | All FreeBSD platforms are elf: move i386-elf to i386Ed Maste2015-05-195-0/+269
|/ | | | | | | | | | | This was a leftover from when we had both i386 a.out and ELF. Reviewed by: kib, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D2591 Notes: svn path=/head/; revision=283125
* Remnant code (broken, unhooked) from a.out which I missed.Tom Rhodes2005-01-113-527/+0
| | | | | | | Noticed by: ru Notes: svn path=/head/; revision=140077
* Drop support for COPY, -c has been the default mode of install(1)Ruslan Ermilov2002-07-291-1/+1
| | | | | | | | | for a long time now. Approved by: bde Notes: svn path=/head/; revision=100872
* Do not use __progname directly (except in [gs]etprogname(3)).Mark Murray2002-03-292-6/+9
| | | | | | | | | Also, make an internal _getprogname() that is used only inside libc. For libc, getprogname(3) is a weak symbol in case a function of the same name is defined in userland. Notes: svn path=/head/; revision=93399
* $Id$ -> $FreeBSD$Peter Wemm1999-08-283-3/+3
| | | | Notes: svn path=/head/; revision=50476
* Fixed type mismatches in args to __syscall(). One for mmap() broke onBruce Evans1998-12-271-5/+5
| | | | | | | | i386's with 64-bit longs -- the padding between mmap()'s 5th and 6th is an int, not a long. The other mismatches were benign. Notes: svn path=/head/; revision=42089
* Avoid using ld -O (as in bsd.lib.mk).Bruce Evans1998-12-271-7/+16
| | | | | | | Fixed `make cleandepend'. The default is null because SRCS is null. Notes: svn path=/head/; revision=42088
* Fixed double slashes in pathnames.Bruce Evans1998-05-311-2/+2
| | | | Notes: svn path=/head/; revision=36494
* ELF preparation step 2:Søren Schmidt1998-05-261-2/+2
| | | | | | | | | | | | | | | | | Move a.out libraries to /usr/lib/aout to make space for ELF libs. Make rtld usr /usr/lib/aout as default library path. Make ldconfig reject /usr/lib as an a.out library path. Fix various Makefiles for LIBDIR!=/usr/lib breakage. This will after a make world & reboot give a system that no longer uses /usr/lib/*, infact one could remove all the old libraries there, they are not used anymore. We are getting close to an ELF make world, but I'll let this all settle for a week or two... Notes: svn path=/head/; revision=36397
* Remove the include of <dlfcn.h> from crt0.c; it is not needed nowJohn Polstra1998-02-113-79/+3
| | | | | | | | | | that the dl* trampolines have been moved into libc. Move dlfcn.h from src/lib/csu/i386 into src/include. Nothing in src/lib/csu/i386 uses it any more. Notes: svn path=/head/; revision=33236
* Move the trampolines for dlopen and related functions from crt0.oJohn Polstra1998-02-094-481/+18
| | | | | | | | | | | | | | | | | | into libc. This reduces the size of every dynamically linked executable by 248 bytes, and it reduces the size of static executables by a lesser amount. It also eliminates some global namespace pollution. With this change in place, the source for dlfcn.h should probably be moved to "/usr/src/include". I'll save that for another day. Compatibility note: Programs which use dlopen, if compiled on systems with this change, will not run on systems with a libc from prior to this change. Very few programs use dlopen, so I think that is OK. Notes: svn path=/head/; revision=33180
* Implement dladdr.John Polstra1998-02-064-13/+169
| | | | Notes: svn path=/head/; revision=33137
* ${TARGET} -> ${.TARGET}Eivind Eklund1998-01-121-2/+2
| | | | | | | Tiny pointed hat goes to: Our Makefile-meister. Notes: svn path=/head/; revision=32484
* const correctness for dl*()Brian Somers1997-11-223-15/+15
| | | | Notes: svn path=/head/; revision=31342
* Make this file p-make clean. (Use "ld -O foo" instead of "ld; mvSatoshi Asami1997-10-111-11/+6
| | | | | | | | | a.out foo".) Reviewed by: bde (actually more like "Suggested by") Notes: svn path=/head/; revision=30291
* Sort cross refereces in section SEE ALSO.Wolfram Schneider1997-09-291-2/+3
| | | | Notes: svn path=/head/; revision=29988
* Implement dlsym(RTLD_NEXT, symbol).John Polstra1997-08-023-8/+42
| | | | Notes: svn path=/head/; revision=27838
* Use our copy of dlfcn.h, not the version in /usr/include, which may notMike Smith1997-04-301-2/+2
| | | | | | | | be up-to-date when we are building. Submitted by: Terry Lambert <terry@lambert.org> Notes: svn path=/head/; revision=25296
* Declare the constructor/destructor linker sets as extern rather thanJohn Polstra1997-04-091-3/+24
| | | | | | | | | | | | | | | | | | | | common. Add one do-nothing element to each set. This ensures that the linker realizes that they are linker sets rather than simple commons, and makes it possible to link c++rt0.o into every shared library regardless of whether it is a C++ library or not. Without this change, the constructors and destructors in the main program could be executed multiple times. This change is going to make it possible to get rid of the CPLUSPLUSLIB makefile variable once and for all. It is a piece of the solution to PR gnu/3505 (gcc -shared). Finally, it fixes a heretofore unreported bug: If CPLUSPLUSLIB was set in a makefile for a C++ shared library that had no static constructors or destructors in it, then the main program's constructors and destructors would be executed multiple times. Notes: svn path=/head/; revision=24756
* Fix an error in the previous revision that caused make world breakage.John Polstra1997-04-021-1/+3
| | | | Notes: svn path=/head/; revision=24553
* Simplified install rule.Bruce Evans1997-04-011-6/+2
| | | | Notes: svn path=/head/; revision=24488
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-223-3/+3
| | | | Notes: svn path=/head/; revision=22993
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-143-3/+3
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* Convert to mdoc format.John Polstra1997-01-121-136/+152
| | | | | | | | | | Add descriptions of RTLD_LAZY and RTLD_NOW. Correct the synopsis to agree with the actual function prototypes. Add clarifications of a few things. Clean up the wording in a few places. Notes: svn path=/head/; revision=21619
* Add definitions of RTLD_LAZY and RTLD_NOW.John Polstra1997-01-121-0/+6
| | | | Notes: svn path=/head/; revision=21616
* Set the "crt_ldso" member of the crt-to-ld.so interface structure. ThisJohn Polstra1997-01-111-1/+2
| | | | | | | | | | | | | was apparently overlooked at the time the member was added. Its absence causes some error messages from the dynamic linker to begin with "(null):" instead of with the pathname of the dynamic linker as they should. I am also adding a work-around to the dynamic linker, to cope with legacy binaries that were built with older versions of crt0. Notes: svn path=/head/; revision=21571
* Use ${COPY} instead of -C for installing non-source files. crt*.oBruce Evans1997-01-011-2/+2
| | | | | | | | should be installed using the same flag as libraries, but ${COPY} is currently used for libraries. Notes: svn path=/head/; revision=21158