aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/crunch/crunchide
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 nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-163-6/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Mark usage function as __dead2 in programs where it does not returnAlfonso Gregory2023-07-071-1/+1
| | | | | | | | In most cases, usage does not return, so mark them as __dead2. For the cases where they do return, they have not been marked __dead2. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/735
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* crunchide(1): Fix a typo in a commentGordon Bergling2022-07-161-1/+1
| | | | | | | - s/maek/make/ Obtained from: NetBSD MFC after: 3 days
* crunchgen: remove -dc from linker invocationFangrui Song2022-02-091-4/+2
| | | | | | | | | | | | | | | | | | | | | In GNU ld and ld.lld, -dc is used with -r to allocate space to COMMON symbols. It is presumably to work around legacy code which cannot handle COMMON symbols in relocatable output. ld.lld may remove -dc or make it a no-op for the 15.0.0 release. As of 7420b323a014 crunch/crunchide does not require -dc, as the symbol hiding technique no longer relied on making symbols local. In addition -fno-common is now the default in Clang and GCC, so -dc serves no purpose as the compiler does not generate COMMON symbols anyway. See https://maskray.me/blog/2022-02-06-all-about-common-symbols for more detail on common symbols. Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D34215
* crunchide: static'ify remaining non-exported functionsKyle Evans2021-08-191-8/+8
| | | | | Reviewed by: arichardson, imp Differential Revision: https://reviews.freebsd.org/D31609
* crunchide: address complaints from WARNS=6Kyle Evans2021-08-192-9/+9
| | | | | | | | | | - One (1) constify - One (1) argument is unused - One (1) local shadows a global - Various globals that should be static Reviewed by: arichardson, imp Differential Revision: https://reviews.freebsd.org/D31608
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-273-3/+10
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Teach crunchide about EM_S390 to make bootstrapping from futureBjoern A. Zeeb2017-01-101-0/+1
| | | | | | | | | | releases easier unless someone will fix the PR properly. MFC after: 3 days PR: 215940 Notes: svn path=/head/; revision=311876
* crunchide: report explicit error for combined string tableEd Maste2016-11-171-0/+4
| | | | | | | | | | | | | | | | | Some tools produce objects with a combined strtab and shstrtab. These objects are not supported by crunchide since it rewrites the symtab and strtab to "hide" symbols. This invalidates section header offsets into a combined strtab/shstrtab. In the future we could support these objects (by ensuring that we retain unmodified section name strings in the output .strtab, and then rewriting each section header's sh_name). MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=308772
* crunchide: remove obsolete a.out header and commentEd Maste2016-11-161-2/+1
| | | | | | | | | | crunchide(1) gained ELF support in r39172, and lost the unused a.out and non-functional ECOFF suport in r281655. Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=308734
* crunchide: add RISC-V to supported machine typesEd Maste2015-12-111-0/+4
| | | | | | | | MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=292106
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-275-259/+27
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-191-2/+0
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-193-9/+6
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | Sync with HEAD.David E. O'Brien2013-02-081-64/+166
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246555
| * \ \ \ Sync from headSimon J. Gerraty2012-11-042-14/+18
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | crunchide: remove EOL whitespaceEd Maste2015-05-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/head/; revision=282824
* | | | | | crunchide: Restore local EM_AARCH64 constant for bootstrappingEd Maste2015-04-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the EM_* constants are available in all supported host branches, but EM_AARCH64 was added relatively recently. Add it back to fix building HEAD on 10.x. Noticed by: adrian, jmallett Notes: svn path=/head/; revision=282291
* | | | | | crunchide: add basic string table sanity checksEd Maste2015-04-281-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reported by: Coverity Scan CID: 978805, 980919 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=282144
* | | | | | crunchide: Remove local EM_* ELF definitions provided by system ELF headersEd Maste2015-04-201-24/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggested by: imp (in review D2314) Notes: svn path=/head/; revision=281781
* | | | | | crunchide: always include both 32- and 64-bit ELF supportEd Maste2015-04-182-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids the need to build a target-specific crunchide for cross- uilds. Differential Revision: https://reviews.freebsd.org/D2314 Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281674
* | | | | | crunchide: remove unused a.out and non-functional ECOFF supportEd Maste2015-04-174-217/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Differential Revision: https://reviews.freebsd.org/D2311 Reviewed by: imp Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281655
* | | | | | crunchide: arm64 supportEd Maste2015-03-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Submitted by: andrew@ Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=280769
* | | | | | crunchide: Correct 64-bit section header offsetEd Maste2015-01-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For 64-bit binaries the Elf_Ehdr e_shoff is at offset 40, not 44. Instead of using an incorrect hardcoded offset, let the compiler figure it out for us with offsetof(). Differential Revision: https://reviews.freebsd.org/D1543 MFC after: 1 week Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=277259
* | | | | | Add support to crunchide for handling AArch64 (arm64) ELF files.Andrew Turner2015-01-061-0/+4
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=276764
* | | | | Revert r267233 for now. PIE support needs to be reworked.Bryan Drewery2014-08-191-2/+0
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other build-only utility libraries. 2. Another 40% is fixed by generating _pic.a variants of various libraries. 3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR) where it never would work anyhow, such as csu or loader. This suggests there may be better ways of adding support to the tree. Many of these cases can be fixed such that -fPIE will work but there is really no reason to have it in those cases. 4. Some of the uses are working around hacks done to some Makefiles that are really building libraries but have been using bsd.prog.mk because the code is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have been needed. We likely do want to enable PIE by default (opt-out) for non-tree consumers (such as ports). For in-tree though we probably want to only enable PIE (opt-in) for common attack targets such as remote service daemons and setuid utilities. This is also a great performance compromise since ASLR is expected to reduce performance. As such it does not make sense to enable it in all utilities such as ls(1) that have little benefit to having it enabled. Reported by: kib Notes: svn path=/head/; revision=270168
* | | | Remove ia64.Marcel Moolenaar2014-07-072-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This includes: o All directories named *ia64* o All files named *ia64* o All ia64-specific code guarded by __ia64__ o All ia64-specific makefile logic o Mention of ia64 in comments and documentation This excludes: o Everything under contrib/ o Everything under crypto/ o sys/xen/interface o sys/sys/elf_common.h Discussed at: BSDcan Notes: svn path=/head/; revision=268351
* | | | use .Mt to mark up email addresses consistently (part2)Baptiste Daroussin2014-06-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco@lastsummer.de> Notes: svn path=/head/; revision=267668
* | | | In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.Bryan Drewery2014-06-081-0/+2
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is currently an opt-in build flag. Once ASLR support is ready and stable it should changed to opt-out and be enabled by default along with ASLR. Each application Makefile uses opt-out to ensure that ASLR will be enabled by default in new directories when the system is compiled with PIE/ASLR. [2] Mark known build failures as NO_PIE for now. The only known runtime failure was rtld. [1] http://www.bsdcan.org/2014/schedule/events/452.en.html Submitted by: Shawn Webb <lattera@gmail.com> Discussed between: des@ and Shawn Webb [2] Notes: svn path=/head/; revision=267233
* | | crunchide(1): Put e_shnum into a local variable.Pedro F. Giffuni2013-02-031-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simplifies the code a bit. Submitted by: Cristoph Mallon MFC after: 2 weeks Notes: svn path=/head/; revision=246298
* | | crunchide(1): support non-custom elf object layoutPedro F. Giffuni2013-02-031-60/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The crunchide utility presumes the last 3 chunks of an ELF object layout are section headers, symbol table, and then string table. However, this is not specified in the ELF standards, and linkers may generate different layouts when doing partial linking (-r). This change is required to build FreeBSD with mclinker or the gold linker. PR: bin/174011 Submitted by: Pete Chou Reviewed by: Cristoph Mallon MFC after: 2 weeks Notes: svn path=/head/; revision=246296
* | | crunch: Sync some NetBSD changesPedro F. Giffuni2013-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a couple of free's in previous commit. Obtained from: NetBSD MFC after: 1 week Notes: svn path=/head/; revision=246278
* | | crunch: Sync some NetBSD changes.Pedro F. Giffuni2013-02-021-8/+8
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | crunchide: Apr 11, 2009: fix some -Wsign-compare issues. Sep 20, 1999: Free the right thing. crunchgen: Apr 14, 2009: Fix some WARNS=4 issues (-Wshadow -Wcast-qual) Oct 30, 2004: Add (unsigned char) cast to ctype functions Feb 5, 2001: fix nested extern. examples: Aug 30, 2007: NetBSD 36867 - trsp references are deprecated Obtained from: NetBSD MFC after: 1 week Notes: svn path=/head/; revision=246256
* | Some amount of style(9)David E. O'Brien2012-06-271-12/+17
| | | | | | | | | | | | | | -- function definitions, header ordering, and $FreeBSD$. Notes: svn path=/head/; revision=237625
* | Remove variables which are initialized but never used thereafter reported by ↵Eitan Adler2012-06-191-2/+1
|/ | | | | | | | | | gcc46 warning Approved by: cperciva MFC After: 3 days Notes: svn path=/head/; revision=237254
* Fix crunchide on MIPS with other than the O32 ABI.Juli Mallett2012-03-131-1/+2
| | | | Notes: svn path=/head/; revision=232911
* It turns out that TARGET_CPUARCH doesn't buy us much here, if anything, butWarner Losh2010-09-131-11/+2
| | | | | | | | | | | | costs us another copy of the transform. Revert it. # Maybe makefile.inc1 should set TARGET_CPUARCH for the cross-tools, but # it doesn't now. That would solve problems in other places too. Submitted by: jmallet@ Notes: svn path=/head/; revision=212537