From: muta...@gmail.com   
      
   On Wednesday, March 22, 2023 at 6:19:51 AM UTC+8, Dan Cross wrote:   
      
   > Well, look at `elf.h` in your source tree for starters. Then    
   > compare, say, the structure definitions therein against the    
   > System V ABI document.   
      
   I was thinking of creating a clean room version of elf.h   
   since you seem to be implying this trivial amount of   
   code, in a relatively massive code base, is allegedly   
   copied from a copyrighted work.   
      
   I took a close look at the history. It's so long ago (for   
   me), that I've forgotten the details, but a lot of the   
   details are in either email or newsgroup posts.   
      
   Let's start with one of my involvements in ELF.   
      
   Here is my modification to elf.h:   
      
   C:\devel\pdos\bios>git show d8ec66831878a85c20a1678dd48f8b3b2aabfad4   
   commit d8ec66831878a85c20a1678dd48f8b3b2aabfad4   
   Author: Paul Edwards    
   Date: Tue Apr 20 01:33:42 2021 +1000   
      
    add Elf32_Rela   
      
   diff --git a/bios/elf.h b/bios/elf.h   
   index 60322201..70e0b505 100644   
   --- a/bios/elf.h   
   +++ b/bios/elf.h   
   @@ -15,7 +15,7 @@   
    typedef unsigned long Elf32_Addr;   
    typedef unsigned long Elf32_Off;   
    typedef unsigned long Elf32_Word;   
   -typedef signed long Elf32_SWord;   
   +typedef signed long Elf32_Sword;   
    typedef unsigned short Elf32_Half; /* 2 bytes. */   
      
    #define EI_NIDENT 16 /* Size of e_ident on all systems. */   
   @@ -132,6 +132,12 @@ typedef struct {   
    Elf32_Word r_info; /* Top byte is symbol index, bottom is rel. type. */   
    } Elf32_Rel;   
      
   +typedef struct {   
   + Elf32_Addr r_offset;   
   + Elf32_Word r_info; /* Top byte is symbol index, bottom is rel. type. */   
   + Elf32_Sword r_addend;   
   +} Elf32_Rela;   
   +   
    #define ELF32_R_SYM(r_info) ((r_info) >> 8)   
    #define ELF32_R_TYPE(r_info) ((r_info) & 0xff)   
      
      
   First you can see that I had to change sword to Sword.   
      
   That was apparently the standard name.   
      
   Alica clearly didn't cut and paste from working code - she must   
   have typed it in, but the structure that needed it didn't even exist,   
   so it was only when I went to use it that I found the issue.   
      
   I can see from this newsgroup post at the time:   
      
   https://groups.google.com/g/alt.os.development/c/mpdS-HpiMLg   
      
   that I had been looking at other public domain ELF code.   
      
   I can see that that code uses the standard names too:   
      
   Elf32_Rel reloc32;   
      
   ie the same as Alica, and apparently I used (with Rela):   
      
   C:\devel\pdos\bios>grep Elf32_Rel elf.h   
   elf.h: } Elf32_Rel;   
   elf.h: } Elf32_Rela;   
      
   I am not totally sure why I was doing ELF relocation at all.   
   It was apparently for PDOS-generic work, but I normally   
   use a.out not ELF for that.   
      
   I can see here:   
      
   C:\devel\pdos\bios>type compelf.bat   
   wcl386 -q -s -3s -zl -fpi87 -c -I. genstart.c osworld.c osfunc.c   
   wlink File genstart.obj,osworld.obj,osfunc.obj Name osworld.exe Form elf   
   Option quiet,start=__crt0   
      
   that I was using Open Watcom (on Windows) to produce an ELF executable.   
      
   I didn't have a Unix system at the time, but I was in the   
   osdev discord at the time I think, and I definitely remember   
   someone asking for a Unix version to try. But I don't know   
   when that was, and again - there is no reason why they   
   would have needed an ELF relocatable instead of an a.out   
   relocatable to do that.   
      
   I suspect it hadn't clicked at the time that I didn't need   
   a relocatable ELF.   
      
   Or it might have been very early testing (which is why the   
   bat file was in the bios directory, not generic directory),   
   where I just wanted to prove that ELF was capable of   
   being relocated. I certainly remember proving that on MVS too,   
   with MVS load modules. I mean - loaded with my loader   
   (exeload) rather than MVS 3.8J.   
      
   It is also possible that I didn't have a.out relocation working   
   at the time - I'd have to check that to see the date that I   
   patched binutils.   
      
   Regardless, I added a structure and fixed a typedef in elf.h.   
      
   I may have copied the definition from that jwasm public   
   domain code, or I may have gotten the documentation   
   from a google search.   
      
   I certainly wouldn't have copied and pasted from some   
   copyrighted code or documentation from a google   
   search, but I probably would have found the standard   
   names from that.   
      
   So when you say "look at xyz copyrighted document and   
   compare", first of all, I'm not going to look at the copyrighted   
   document that you think is definitive, because then it will   
   be harder to convince a judge that this is original work.   
      
   So - you tell me.   
      
   I don't want to fly by on "fair use".   
      
   I want genuine original work.   
      
   You are suggesting that Alica's code is not original and/or   
   my Rela and sword fix is not original. And/or the jwasm code   
   is not original.   
      
   If there is someone like you out there, then I may encounter   
   a judge like you too. And I would like to protect against that.   
      
   So you tell me, judge - how do I create a clean room elf.h   
   that passes your certification?   
      
   I have all the standard names in exeload.c, so I can   
   recreate those from that.   
      
   Getting the order and types will be a bit more difficult, as   
   I would need to look at an ELF file that uses those   
   structures.   
      
   But there's no need to do that.   
      
   You can just independently tell me what the ELF format is.   
      
   This isn't a trade secret that I have signed a non-disclosure   
   agreement to.   
      
   It's a public format.   
      
   So you can tell me that the sword in the Rela structure is   
   speced to be 32 bits, and I'll ask whether that is signed or   
   unsigned, and then define a "long".   
      
   What do I need to do so that that trivial amount of code is   
   created cleanly in your opinion?   
      
   Time to use concrete instead of sand.   
      
   To reduce the likelihood of success of the alleged original   
   copyright holder of being able to sue me.   
      
   Or are you saying that a clean room version is impossible?   
      
   BFN. Paul.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|