Bug 143699

Summary: [patch] brandelf(1): extend brandelf's OS knowledge
Product: Base System Reporter: Alexander Best <alexbestms>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Open ---    
Severity: Affects Only Me CC: emaste
Priority: Normal Keywords: patch
Version: 9.0-CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Alexander Best 2010-02-09 14:00:08 UTC
this patch adds extra functionality to brandelf so it's able to brand all elf types defined by POSIX.1-2008.

the patchset has been discussed in this thread:

http://lists.freebsd.org/pipermail/freebsd-hackers/2010-January/030470.html

some people liked the idea of brandelf being extended this way, while others disliked the idea due to the fact that freebsd itself isn't able to run any elf binaries apart from FreeBSD(9) Linux(3) Solaris(6) SVR4(0).

personally i didn't see the connection between brand'elfing binaries and running them. brandelf's purpose also includes simply branding binaries without running them. think of a bunch of NetBSD/OpenBSD/... files which should be backup'ed under FreeBSD, but are brandelf'ed improperly. in this case the patch would come in handy.

cheers.
alex

Fix: Patch attached with submission follows:
Comment 1 Pedro F. Giffuni 2010-02-09 16:26:46 UTC
As I noted in private to Alexander, the elftoolchain
project has a better implementation that:
- Uses libelf
- Takes advantage of the FreeBSD headers

https://sourceforge.net/apps/trac/elftoolchain/browser/trunk/brandelf
Comment 2 Alexander Best 2010-02-09 17:42:44 UTC
thanks for the reply.

indeed the libelf project has a much better implementation of brandelf than
the one in the freebsd base dir.

hopefully at some point the libelf project's work will be included into the
base dir and replace most of the gnu (or even pre-gnu) elf binaries/libraries.

however until then i don't see why existing code - although inferior to the
libelf project's code - shouldn't be enhanced here and there.

also it's a lot easier to find a committer to add a few changes to an app
which obviously won't break stuff than to find somebody to replace an existing
binary with a whole new one.

so i completely agree with you. i'm looking forward to seeing libelf's work in
the base dir, but until then time (or better yet code) doesn't have to stand
still. ;)

cheers.
alex
Comment 3 Pedro F. Giffuni 2010-02-09 19:05:49 UTC
Actually,

The code is not too different. I am OK with seeing your patch go in too.
Comment 4 Alexander Best freebsd_committer freebsd_triage 2010-08-09 19:08:48 UTC
State Changed
From-To: open->suspended

Brandelf along with other elf-related tools will eventually be replaced by 
importing the BSD-licensed elftoolchain project into the FreeBSD tree. 
Once the import occurs this PR should be re-evaluated.
Comment 5 Ed Maste freebsd_committer freebsd_triage 2017-10-15 19:19:05 UTC
The patch can go in and be merged into ELF Tool Chain's copy from FreeBSD.
Comment 6 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:59:52 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"
Comment 7 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:36:48 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>