summaryrefslogtreecommitdiffstats
path: root/lib/csu/common
Commit message (Collapse)AuthorAgeFilesLines
* Add an elf note on ARM to store the MACHINE_ARCH an executable was builtandrew2013-09-261-0/+1
| | | | | | | | | | for. This is useful for software needing to know which architecture a binary is built for as arm and armv6 have slight differences meaning only some binaries build for one will work as expected on the other. It is expected pkgng will be able to make use of this to simplify the logic to determine which package ABI to use. Approved by: re (kib)
* Only assign the environ in the startup code when environ is NULL.kib2013-01-071-5/+9
| | | | | | | | | | | | | | Preloaded library could have changed the environment, and unconditional assingment to the environ undoes the customization. The binaries needs to be recompiled to get the fix. Move the common code to set up environ and __progname into the helper. Note that ia64 possibly not fixed, due to it still using old csu. Reported and tested by: John Hein <jhein@symmetricom.com> Reviewed by: kan, scf Approved by: secteam (simon) MFC after: 2 weeks
* Stop calling _init/_fini methods from crt1 for dynamic binaries. Dokib2012-03-112-15/+126
| | | | | | | | | | | | | call preinit, init and fini arrays methods from crt1 for static binaries. Mark new crt1 with FreeBSD-specific ELF note. Move some common crt1 code into new MI file ignore_init.c, to reduce duplication. Also, conservatively adjust nearby sources for style. Reviewed by: kan Tested by: andrew (arm), flo (sparc64) MFC after: 3 weeks
* Add a header with definitions useful for constructing ELF notes.kib2012-03-111-0/+38
| | | | | Reviewed by: kan MFC after: 3 weeks
* Apply a workaround for a binutils issue with the .note.ABI-tag sectiondim2011-01-131-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | generated from lib/csu/common/crtbrand.c (which ultimately ends up in executables and shared libraries, via crt1.o, gcrt1.o or Scrt1.o). For all arches except sparc, gcc emits the section directive for the abitag struct in crtbrand.c with a PROGBITS type. However, newer versions of binutils (after 2.16.90) require the section to be of NOTE type, to guarantee that the .note.ABI-tag section correctly ends up in the first page of the final executable. Unfortunately, there is no clean way to tell gcc to use another section type, so crtbrand.c (or the C files that include it) must be compiled in multiple steps: - Compile the .c file to a .s file. - Edit the .s file to change the 'progbits' type to 'note', for the section directive that defines the .note.ABI-tag section. - Compile the .s file to an object file. These steps are done in the invididual Makefiles for each applicable arch. Reviewed by: kib
* 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
* 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.
* 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.
* Set abitag __unused.obrien2003-05-041-3/+4
|
* Fix the copyright dates.obrien2002-05-071-1/+1
|
* GC code that moved to crtbrand.c.obrien2002-01-281-4/+0
|
* Feh, it helps to include a file other than yourself... wonder howobrien2001-10-271-1/+1
| | | | | | GCC cpp liked that. Properly include the branding info.
* * Bring back the guts of crt{i,n}.S. This allows C++ exceptions to workobrien2000-10-282-18/+52
| | | | | | | | | | | | | | | | | | | when using the egcs and gcc-devel ports, along with GCC built from stock public FSF sources. With out this change, FreeBSD will be removed from the list of systems GCC 3.0 must be evaluated on before release. With the effort some of us put into getting FreeBSD on this list, we should not turn this effort into a waste, else we might not be worth fighting for in the future. (note that Alpha and IA-64 versions of crt{i,n}.S are needed) * Switch from our own crt{begin,in} to those created from GCC's crtstuff.c. This will allow us to switch to DWARF2 exceptions in the future, along with staying in sync with any future GCC requirements. * Break out our ELF branding bits into a seperate file. Currently this is now included by our crt1.c files (since this functionality was part of our native crtbegin.c). Later crtbrand.o will be merged in the creation of crti.o.
* This is step 1 in an effort to unify the start-up files for thejdp2000-05-191-7/+50
| | | | | | | | | | | | | | | | | various architectures. Now all the work is done in crtbegin.c. It doesn't contain any assembly language code, so it should work fine on all architectures. (I have tested it on the i386 and the alpha.) The old assembly language files crt[in].S are now empty shells that generate no code or data. They should not be removed any time soon, because the various versions of gcc in src and ports expect them to exist. Next I will move crtbegin.c into a new common machine-independent directory, and adjust the i386-elf Makefile to use that version. After that I will adjust the alpha Makefile to use the common version too. Requested by: obrien
* $Id$ -> $FreeBSD$peter1999-08-282-2/+2
|
* Reverse the order of processing object files within an executable orjdp1999-03-131-3/+3
| | | | | | | | | | | | | shared library when invoking global constructors and destructors. For constructors, the object files used to be processed from first to last; now they're done from last to first. (Destructors are done in the opposite order, as required by the C++ standard.) This makes us consistent with standard gcc and egcs compilers. It also eliminates ordering differences between dynamic and static executables. Bump the value of __FreeBSD_version to 400002 to reflect this change.
* Move the code for the ".init" and ".fini" sections outside of ajdp1999-03-122-13/+13
| | | | | | | | | C function so the compiler won't try to emit line numbers for it with "-g", breaking the build. This has the nice side-effect of making crtbegin.o and crtbeginS.o a little bit smaller. Remove "-Wno-unused" from the Makefile. Replace it with "__unused" on particular function and variable declarations.
* Import C startup files for ELF support.jdp1998-03-072-0/+92
Submitted by: John Polstra <jdp@polstra.com>
OpenPOWER on IntegriCloud