RTEMS | What is proper file header for code cherry picked from NetBSD? (#5334)
Joel Sherrill (@joel)
gitlab at rtems.org
Tue Sep 9 22:39:33 UTC 2025
Joel Sherrill created an issue: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5334
## Summary
This issue is to answer the question of what attribution/copyright, license, and SPDX to add to files that were cherry picked from NetBSD. The following is a sample:
- ./cpukit/libdl/rtl-mdreloc-arm.c
- ./cpukit/libdl/rtl-mdreloc-i386.c
- ./cpukit/libdl/rtl-mdreloc-m68k.c
- ./cpukit/libdl/rtl-unwind-arm.c
- ./cpukit/libdl/rtl-unwind-arm.h
- ./cpukit/score/cpu/arm/include/machine/elf_machdep.h
- ./cpukit/score/cpu/i386/include/machine/elf_machdep.h
- ./cpukit/score/cpu/m68k/include/machine/elf_machdep.h
- ./cpukit/score/cpu/mips/include/machine/elf_machdep.h
- ./cpukit/score/cpu/moxie/include/machine/elf_machdep.h
- ./cpukit/score/cpu/nios2/include/machine/elf_machdep.h
- ./cpukit/score/cpu/powerpc/include/machine/elf_machdep.h
- ./cpukit/score/cpu/sparc/include/machine/elf_machdep.h
- ./cpukit/score/cpu/x86_64/include/machine/elf_machdep.h
The elf_machdep.h may be direct copies. This will have to be confirmed. But the recommendation at the end is the same.
The libdl/rtl files are more challenging. This is typical of what is at the top of one of these files:
```
/*
* Taken from NetBSD and stripped of the relocations not needed on RTEMS.
*/
/* $NetBSD: mdreloc.c,v 1.26 2010/01/14 11:58:32 skrll Exp $ */
```
@chris and I chatted a bit about this and he asked for a proposal Unfortunately, I think we do need to go back to the NetBSD source for each file to ensure we pick the right BSD license tag. For the above file which is rtl-reloc-arm.c in RTEMS libdl, it is libexec/ld.elf_so/arch/m68k/mdreloc.c in NetBSD. The current [version](https://github.com/NetBSD/src/blob/54994cf764b063801ddcb0afb35b358a8ad403ef/libexec/ld.elf_so/arch/m68k/mdreloc.c#L2) has had multiple updates but it is currently Four Paragraph BSD and has the following attribution:
```
* Copyright 1996 John D. Polstra.
* Copyright 1996 Matt Thomas <matt at 3am-software.com>
* All rights reserved.
```
My suggestion requires git archaeology on the NetBSD source but it seems the right thing to do.
1. Find the current NetBSD source for each file.
2. Copy the license/copyright block into the RTEMS version.
3. Add SPDX for the license used as line 1 of the RTEMS file
4. Add a Doxygen file block which includes the CVS Id and the comment about RTEMS changes. If there are no RTEMS changes, we probably should add a note to that effect.
Rinse and repeat for each file from NetBSD.
### Pre-set options
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/issues/5334
You're receiving this email because of your account on gitlab.rtems.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250909/08ce9d90/attachment-0001.htm>
More information about the bugs
mailing list