You are right, that the reference goes to the .plt. I could confirm that in the debug version of elf.library, that I built. And that is the problem.
Inside the shared object (libhello.so) the reference goes directly to the function. Inside the main app (app_dyn) it goes to the .plt.
By looking at how this is performed on other platforms, I can assess, that on x64 the reference in the main app is linked with @gotpcrel. I think this is correct. If the main app would fetch the address from the global offset table, it would give the correct result, which would be a link to the actual function. The problem is, that this version of the truth is no realized by neither the compiler (amiga-ppc-elf32) or by elf.library. It is quite easy to make the necessary implementation in elf.library. I have already done that in several different versions. But to get the compiler to do the .got reference is another story. I am still stuck with that. Apparently there needs to be a change to both the bfd linker and the c compiler. And this is very complex code. Maybe you have some idea?
I see you, have been much deeper down the rabbit hole than I. But i will try to follow you.
Starting with the C example at adtools@issue109, and focusing on the dynamic compilation part, e.g app_dyn and libhello.so. Could you tell me what needs to be modified in which file?
With my current understanding, it is just relocations which needs to be modified/removed/added to get the correct behavior, but enlighten me if not so.
BTW i couldn't find any source about where the PPC relocation are defined, do you have source at hand?
And I found this article, which even mention that the address of an function is not always the same. Maybe gives some more insight.
It gets worse. Static constructors and destructors no longer work with the latest adtools. This is strange, since the exact same code + elf.library worked fine a few releases ago.
With my current understanding, it is just relocations which needs to be modified/removed/added to get the correct behavior, but enlighten me if not so.
See, that's what I thought. But I am quite certain, that there needs to be implemented at least a distinction in the compiler between references to variables and references to functions ('functors' in Qt6 speech). Otherwise the linker just links function references to plt, and there is no way of making the distinction from inside elf.library.
You can take a look in the gcc source code. I am referencing 11.3.0.
Look for the folder gcc/config/rs6000. Especially in rs6000.c, rs6000-logue.c and rs6000.md there are references to functions called 'elf_high' and 'elf_low'. These are responsible for creating this assembly:
lis 9,world@ha
la 4,world@l(9)
If this could be changed to
lis 8,world@got@ha
la 9,world@got@l(8)
lwz 4,0(9)
... for function references (functors), then I would be able to fix the elf.library relocator to make the references as it should be.
Edited by elfpipe on 2022/12/31 18:14:12 Edited by elfpipe on 2022/12/31 18:16:20 Edited by elfpipe on 2022/12/31 19:59:56 Edited by elfpipe on 2023/1/1 16:56:56
It gets worse. Static constructors and destructors no longer work with the latest adtools. This is strange, since the exact same code + elf.library worked fine a few releases ago.
Do you mean in context of shared objects? I have had some headaches with library constructor calls.
I tested your example and it seems to work as long as I don't declare any __attribute__((constructor)) stuff. If I do, then only one constructor is called. I don't understand the issue at all :(
I tested the real case, replacing CONSTRUCTOR_FUNCTION tokens with __attribute__ notation. This is so bad. There are multiple shared objects, and only a selection (random?) of the constructor functions are called. This is utterly incomprehensible.
I don't know if it can be related. But I have a problem with constructors in clib2 when using shared objects and libstdc++.so. Basically c++ constructors (for examples streams constructors) are called too early. Before libc constructors and so I have a crash because libc is not initialized yet. I've tried several workarounds but with no luck. I suspect there is something in elf.library that is causing this but I don't understand what
See, that's what I thought. But I am quite certain, that there needs to be implemented at least a distinction in the compiler between references to variables and references to functions ('functors' in Qt6 speech). Otherwise the linker just links function references to plt, and there is no way of making the distinction from inside elf.library.
If you look at the ABI specification (hopefully the correct ABI for AmigaOS 4), you see in chapter 4.3.3, that the use case to use the address of an function is considered. Sadly this is a very short chapter, but the to get it working there must be a symbol table entry. The interesting part is if that entry is present in the app_dyn? So lets see if i find it:
[0]>Work:Home/Workspaces/109>readelf -s app_dyn
Symbol table '.dynsym' contains 13 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 010100d8 4 OBJECT GLOBAL DEFAULT 16 __stdiowin
2: 01001048 8 FUNC GLOBAL DEFAULT UND printf
3: 01001050 84 FUNC GLOBAL DEFAULT UND hello
4: 010100c8 0 NOTYPE GLOBAL DEFAULT 15 _DATA_BASE_
5: 01001058 28 FUNC GLOBAL DEFAULT UND world
6: 010100dc 4 OBJECT GLOBAL DEFAULT 16 __unix_path_semantics
7: 010180d8 0 NOTYPE GLOBAL DEFAULT 16 _SDA_BASE_
8: 010100e0 4 OBJECT GLOBAL DEFAULT 16 INewlib
9: 010100d8 0 NOTYPE GLOBAL DEFAULT ABS __bss_start
10: 00000001 0 NOTYPE GLOBAL DEFAULT ABS __amigaos4__
11: 010100d8 0 NOTYPE GLOBAL DEFAULT ABS _edata
12: 01010100 0 NOTYPE GLOBAL DEFAULT ABS _end
Symbol table '.symtab' contains 41 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 010000f4 0 SECTION LOCAL DEFAULT 1
2: 01000108 0 SECTION LOCAL DEFAULT 2
3: 01000150 0 SECTION LOCAL DEFAULT 3
4: 01000220 0 SECTION LOCAL DEFAULT 4
5: 010002b8 0 SECTION LOCAL DEFAULT 5
6: 010002d0 0 SECTION LOCAL DEFAULT 6
7: 010002f4 0 SECTION LOCAL DEFAULT 7
8: 01001000 0 SECTION LOCAL DEFAULT 9
9: 01002000 0 SECTION LOCAL DEFAULT 10
10: 01002040 0 SECTION LOCAL DEFAULT 11
11: 01010000 0 SECTION LOCAL DEFAULT 12
12: 01010008 0 SECTION LOCAL DEFAULT 13
13: 01010010 0 SECTION LOCAL DEFAULT 14
14: 010100c8 0 SECTION LOCAL DEFAULT 15
15: 010100d8 0 SECTION LOCAL DEFAULT 16
16: 00000000 0 SECTION LOCAL DEFAULT 17
17: 00000000 0 FILE LOCAL DEFAULT ABS main.c
18: 01010010 0 OBJECT LOCAL HIDDEN 14 _DYNAMIC
19: 010100cc 0 OBJECT LOCAL HIDDEN 15 _GLOBAL_OFFSET_TABLE_
20: 010100d8 4 OBJECT GLOBAL DEFAULT 16 __stdiowin
21: 01001048 8 FUNC GLOBAL DEFAULT UND printf
22: 010100f4 4 OBJECT GLOBAL DEFAULT 16 UtilityBase
23: 01001050 84 FUNC GLOBAL DEFAULT UND hello
24: 010100c8 0 NOTYPE GLOBAL DEFAULT 15 _DATA_BASE_
25: 010100e8 4 OBJECT GLOBAL DEFAULT 16 IExec
26: 01001058 28 FUNC GLOBAL DEFAULT UND world
27: 010100f8 4 OBJECT GLOBAL DEFAULT 16 IUtility
28: 010100dc 4 OBJECT GLOBAL DEFAULT 16 __unix_path_semantics
29: 010100f0 4 OBJECT GLOBAL DEFAULT 16 __reent_magic
30: 010100ec 4 OBJECT GLOBAL DEFAULT 16 DOSBase
31: 010002f4 1100 FUNC GLOBAL DEFAULT 7 _start
32: 010180d8 0 NOTYPE GLOBAL DEFAULT 16 _SDA_BASE_
33: 010100e0 4 OBJECT GLOBAL DEFAULT 16 INewlib
34: 010100d8 0 NOTYPE GLOBAL DEFAULT ABS __bss_start
35: 01000740 80 FUNC GLOBAL DEFAULT 7 main
36: 00000001 0 NOTYPE GLOBAL DEFAULT ABS __amigaos4__
37: 010100d8 0 NOTYPE GLOBAL DEFAULT ABS _edata
38: 01010100 0 NOTYPE GLOBAL DEFAULT ABS _end
39: 010100f0 4 OBJECT GLOBAL DEFAULT 16 SysBase
40: 010100e4 4 OBJECT GLOBAL DEFAULT 16 IDOS
As is see it, there is an entry for the world both in '.dynsym' and '.symtab' section. Interpreting chapter 4.3.3 from the ABI, the dynamic linker should behave like this:
Quote:
If the st_shndx member is SHN_UNDEF and the symbol is of type STT_FUNC and the st_value member is not zero, the dynamic linker recognizes this entry as special and uses the st_value member as the symbol’s address.
Thus the value 01001058 should be used as the symbol address. But looking at the '.rela.plt‘ section of the app_dyn:
[0]>Work:Home/Workspaces/109>readelf -r app_dyn
Relocation section '.rela.sbss' at offset 0x2b8 contains 2 entries:
Offset Info Type Sym.Value Sym. Name + Addend
010100d8 00000113 R_PPC_COPY 010100d8 __stdiowin + 0
010100dc 00000613 R_PPC_COPY 010100dc __unix_path_semantics + 0
Relocation section '.rela.plt' at offset 0x2d0 contains 3 entries:
Offset Info Type Sym.Value Sym. Name + Addend
01001048 00000215 R_PPC_JMP_SLOT 01001048 printf + 0
01001050 00000315 R_PPC_JMP_SLOT 01001050 hello + 0
01001058 00000515 R_PPC_JMP_SLOT 01001058 world + 0
So with my understanding the 'Value' value in the '.symtab' and '.dyntab' for 'world' is wrong. Am i right? And the cause for being wrong is, like you even think, that the toolchain doesn't differ if the function is called or the address used. (I probably need to compile the example under PPC 32 BE Linux and see how section look there)
I looked into the folder gcc/config/rs6000 and peeked into rs6000.c, rs6000-logue.c and rs6000.md (ignored all others). That's heavy stuff. I see why modifying 'elf_low' and 'elf_high' could solve the issue. But how to modify them is a guessing. But i have some doubt/questions about going for that way:
In your exampled how the code should look, you use additional register 8. Did you just pick it randomly? Because if modifying 'elf_low' and 'elf_high' and using an additional register could have unknown side effects.
I checked the master github of gcc the implementation of 'elf_low' and 'elf_high' in rs6000.md. They are still implementated like the ones in adtools. So it could be assumed, that modify them is a workaround, and there is probably another solution, which fixes it better. We still have to find it.
So with my understanding the 'Value' value in the '.symtab' and '.dyntab' for 'world' is wrong. Am i right?
I believe, that you are.
Quote:
In your exampled how the code should look, you use additional register 8. Did you just pick it randomly? Because if modifying 'elf_low' and 'elf_high' and using an additional register could have unknown side effects
Well, I fiddled a little with it. I don't know, if you can just use register 9 in place of the 8 I put, or whether it is a problem doing a la instruction from and to the same register. Just maybe to remember, that there might need to be another intermediate register. I am not an assembly wiz (any longer). Sorry!
Quote:
I checked the master github of gcc the implementation of 'elf_low' and 'elf_high' in rs6000.md. They are still implementated like the ones in adtools. So it could be assumed, that modify them is a workaround, and there is probably another solution, which fixes it better. We still have to find it.
I think, we not only need to modify them, but to add a replacement (pair?) that takes care of the cases of function references. Maybe there is a clue to find in gcc/gcc/config/i386 ? You can maybe perform a search for '@GOTPCREL'.
I tested the real case, replacing CONSTRUCTOR_FUNCTION tokens with __attribute__ notation. This is so bad. There are multiple shared objects, and only a selection (random?) of the constructor functions are called. This is utterly incomprehensible.
I think the address issue is worse than thought. I now think it is a bug distributed in the adtools gcc and the dynamic linker (elf.library??). Let me explain why, i think so.
With the help of skateman i got access to a compiled example under linux ppc. My idea way to look how the 'symtab' and 'dynsym' entries look like.
readelf -s app_dyn_linux | grep world
4: 00000000 0 FUNC GLOBAL DEFAULT UND world
67: 00000000 0 FUNC GLOBAL DEFAULT UND world
As one can see the value is for the linux example 00000000 and not like the amiga executable 01001058. Checking the ABI a 00000000 should trigger the dynamic linker to resolve the address of the function in the shared object file, and not the address of the PLT entry.
So i used a HEX editor to modify the amiga executable to have even a 00000000 value for the two entries, so see if running it would result in the expected behavior. Sadly is doesn't:
a) The gcc which writes a wrong entry into the 'symtab' and 'dyntab' b) The dynamic linker, which just uses the value of the 'symtab' and 'dyntab' entry for UNDEF FUNC, without triggering a resoling if the value is zero.
Point a could possible be fixed if digging into the gcc source, but for point b someone with access to the dynmaic linker implementation would be helpful.
With the help of skateman i got access to a compiled example under linux ppc. My idea way to look how the 'symtab' and 'dynsym' entries look like.
Bingo. I was hoping, you would do that.
EDIT : What do the relocations look like on linux ppc ?
Quote:
As one can see the value is for the linux example 00000000 and not like the amiga executable 01001058. Checking the ABI a 00000000 should trigger the dynamic linker to resolve the address of the function in the shared object file, and not the address of the PLT entry.
So this is a linker issue. You might want to look at binutils/bfd/elf32-amigaos.c to see, if you can spot where it happens.
EDIT : Which version of binutils is used on the linux ppc side ?
Quote:
So i used a HEX editor to modify the amiga executable to have even a 00000000 value for the two entries, so see if running it would result in the expected behavior. Sadly is doesn't:
No. It has no such thing implemented. I could fix that.
Quote:
a) The gcc which writes a wrong entry into the 'symtab' and 'dyntab' b) The dynamic linker, which just uses the value of the 'symtab' and 'dyntab' entry for UNDEF FUNC, without triggering a resoling if the value is zero.
I think, your analysis is perfect. Let's fix the beast.
Edited by elfpipe on 2023/1/4 11:59:24 Edited by elfpipe on 2023/1/4 12:11:39
The decoding of unwind sections for machine type PowerPC is not currently supported.
Symbol table '.dynsym' contains 11 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 000004b0 0 SECTION LOCAL DEFAULT 11 .init
2: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterT[...]
3: 00000000 0 FUNC GLOBAL DEFAULT UND printf@GLIBC_2.4 (2)
4: 00000000 0 FUNC GLOBAL DEFAULT UND world
5: 00000000 0 FUNC WEAK DEFAULT UND [...]@GLIBC_2.1.3 (3)
6: 00000000 0 FUNC GLOBAL DEFAULT UND hello
7: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
8: 00000000 0 FUNC GLOBAL DEFAULT UND __[...]@GLIBC_2.0 (4)
9: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMC[...]
10: 0000089c 4 OBJECT GLOBAL DEFAULT 14 _IO_stdin_used
Symbol table '.symtab' contains 85 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000154 0 SECTION LOCAL DEFAULT 1 .interp
2: 00000164 0 SECTION LOCAL DEFAULT 2 .note.gnu.build-id
3: 00000188 0 SECTION LOCAL DEFAULT 3 .note.ABI-tag
4: 000001a8 0 SECTION LOCAL DEFAULT 4 .gnu.hash
5: 000001c8 0 SECTION LOCAL DEFAULT 5 .dynsym
6: 00000278 0 SECTION LOCAL DEFAULT 6 .dynstr
7: 00000338 0 SECTION LOCAL DEFAULT 7 .gnu.version
8: 00000350 0 SECTION LOCAL DEFAULT 8 .gnu.version_r
9: 00000390 0 SECTION LOCAL DEFAULT 9 .rela.dyn
10: 00000474 0 SECTION LOCAL DEFAULT 10 .rela.plt
11: 000004b0 0 SECTION LOCAL DEFAULT 11 .init
12: 00000500 0 SECTION LOCAL DEFAULT 12 .text
13: 00000870 0 SECTION LOCAL DEFAULT 13 .fini
14: 0000089c 0 SECTION LOCAL DEFAULT 14 .rodata
15: 000008ac 0 SECTION LOCAL DEFAULT 15 .eh_frame_hdr
16: 000008d8 0 SECTION LOCAL DEFAULT 16 .eh_frame
17: 0001febc 0 SECTION LOCAL DEFAULT 17 .init_array
18: 0001fec0 0 SECTION LOCAL DEFAULT 18 .fini_array
19: 0001fec4 0 SECTION LOCAL DEFAULT 19 .got2
20: 0001fef0 0 SECTION LOCAL DEFAULT 20 .dynamic
21: 0001fff0 0 SECTION LOCAL DEFAULT 21 .got
22: 00020000 0 SECTION LOCAL DEFAULT 22 .plt
23: 00020014 0 SECTION LOCAL DEFAULT 23 .data
24: 0002002c 0 SECTION LOCAL DEFAULT 24 .bss
25: 00000000 0 SECTION LOCAL DEFAULT 25 .comment
26: 00000000 0 SECTION LOCAL DEFAULT 26 .debug_aranges
27: 00000000 0 SECTION LOCAL DEFAULT 27 .debug_info
28: 00000000 0 SECTION LOCAL DEFAULT 28 .debug_abbrev
29: 00000000 0 SECTION LOCAL DEFAULT 29 .debug_line
30: 00000000 0 SECTION LOCAL DEFAULT 30 .debug_str
31: 00000000 0 SECTION LOCAL DEFAULT 31 .debug_ranges
32: 00000000 0 FILE LOCAL DEFAULT ABS abi-note.c
33: 00000188 32 OBJECT LOCAL DEFAULT 3 __abi_tag
34: 00000000 0 FILE LOCAL DEFAULT ABS /builddir/glibc-[...]
35: 0000050c 0 NOTYPE LOCAL DEFAULT 12 got_label
36: 00000000 0 FILE LOCAL DEFAULT ABS init.c
37: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c
38: 00000534 0 FUNC LOCAL DEFAULT 12 deregister_tm_clones
39: 0000058c 0 FUNC LOCAL DEFAULT 12 register_tm_clones
40: 0002002c 1 OBJECT LOCAL DEFAULT 24 completed.0
41: 000005f0 0 FUNC LOCAL DEFAULT 12 __do_global_dtors_aux
42: 0001fec0 0 OBJECT LOCAL DEFAULT 18 __do_global_dtor[...]
43: 00000660 0 FUNC LOCAL DEFAULT 12 frame_dummy
44: 0001febc 0 OBJECT LOCAL DEFAULT 17 __frame_dummy_in[...]
45: 00000000 0 FILE LOCAL DEFAULT ABS main.c
46: 00000000 0 FILE LOCAL DEFAULT ABS crtstuff.c
47: 00000984 0 OBJECT LOCAL DEFAULT 16 __FRAME_END__
48: 00000000 0 FILE LOCAL DEFAULT ABS
49: 00000810 0 NOTYPE LOCAL DEFAULT 12 00000000.plt_pic[...]
50: 00000800 0 NOTYPE LOCAL DEFAULT 12 00000000.plt_pic[...]
51: 000007e0 0 NOTYPE LOCAL DEFAULT 12 00008000.got2.pl[...]
52: 00000830 0 NOTYPE LOCAL DEFAULT 12 __glink_PLTresolve
53: 0001fec0 0 NOTYPE LOCAL DEFAULT 17 __init_array_end
54: 0001fff4 0 OBJECT LOCAL DEFAULT 21 _SDA_BASE_
55: 000007d0 0 NOTYPE LOCAL DEFAULT 12 00008000.got2.pl[...]
56: 0001fef0 0 OBJECT LOCAL DEFAULT 20 _DYNAMIC
57: 0001febc 0 NOTYPE LOCAL DEFAULT 17 __init_array_start
58: 00000820 0 NOTYPE LOCAL DEFAULT 12 __glink
59: 000008ac 0 NOTYPE LOCAL DEFAULT 15 __GNU_EH_FRAME_HDR
60: 0001fff4 0 OBJECT LOCAL DEFAULT 21 _GLOBAL_OFFSET_TABLE_
61: 000007f0 0 NOTYPE LOCAL DEFAULT 12 00008000.got2.pl[...]
62: 000004b0 0 FUNC LOCAL DEFAULT 11 _init
63: 000007c4 12 FUNC GLOBAL DEFAULT 12 __libc_csu_fini
64: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterT[...]
65: 00020024 0 NOTYPE WEAK DEFAULT 23 data_start
66: 00000000 0 FUNC GLOBAL DEFAULT UND printf@@GLIBC_2.4
67: 00000000 0 FUNC GLOBAL DEFAULT UND world
68: 0002002c 0 NOTYPE GLOBAL DEFAULT 23 _edata
69: 00000870 0 FUNC GLOBAL HIDDEN 13 _fini
70: 00000000 0 FUNC WEAK DEFAULT UND __cxa_finalize@@[...]
71: 00000000 0 NOTYPE GLOBAL DEFAULT UND se-dynld
72: 00000000 0 FUNC GLOBAL DEFAULT UND hello
73: 00020024 0 NOTYPE GLOBAL DEFAULT 23 __data_start
74: 00000000 0 NOTYPE WEAK DEFAULT UND __gmon_start__
75: 00020028 0 OBJECT GLOBAL HIDDEN 23 __dso_handle
76: 0000089c 4 OBJECT GLOBAL DEFAULT 14 _IO_stdin_used
77: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_start_mai[...]
78: 000006c4 256 FUNC GLOBAL DEFAULT 12 __libc_csu_init
79: 00020030 0 NOTYPE GLOBAL DEFAULT 24 _end
80: 00000500 52 FUNC GLOBAL DEFAULT 12 _start
81: 0002002c 0 NOTYPE GLOBAL DEFAULT 24 __bss_start
82: 00000664 96 FUNC GLOBAL DEFAULT 12 main
83: 0002002c 0 OBJECT GLOBAL HIDDEN 23 __TMC_END__
84: 00000000 0 NOTYPE WEAK DEFAULT UND _ITM_registerTMC[...]
Histogram for `.gnu.hash' bucket list length (total of 2 buckets):
Length Number % of total Coverage
0 1 ( 50.0%)
1 1 ( 50.0%) 100.0%
Displaying notes found in: .note.gnu.build-id
Owner Data size Description
GNU 0x00000014 NT_GNU_BUILD_ID (unique build ID bitstring)
Build ID: 88d5b4a06f0423698e4f46d06c3518e7cc3bc3ac
Displaying notes found in: .note.ABI-tag
Owner Data size Description
GNU 0x00000010 NT_GNU_ABI_TAG (ABI version tag)
OS: Linux, ABI: 3.2.0
Quote:
EDIT : Which version of binutils is used on the linux ppc side ?
I don't know, maybe skateman is reading this and can answer that.
I will take a look at the binutils source and see, what i see
@MightyMax Today all oses like os3, aros and morphos have their own toolchains, and didnt use adtools anymore.
Half of year ago, i give a go and updated binutils for next version, and plan was to update step by step until reach a minimum version which support dwarf4 and stuff.
So i made next version of binutils works, binariescompiles and works, but due to that patch mess i just didnt find time to deal with proper commiting of changes (hope to do it soon than later)
But! The point is : when i start working on, i ask Sebastian (the current mantainer of adtools) why we need to keep that os3, aros and morphos code, if they long ago used their own toolchains, and he wascompletely agree to remove it all, for make better reading of code and easy to mantain. So, i was about to do so and together with new patches for next binutils commit it all, but was overflow with other projects, and didnt do so still.
Why i explain it all, its just to say to everyone that SBA1 completely ok with removing all other's oses code, and porting of binutils its not hard, just need time to be spend.
@MightyMax Of course can do so, but didn't remember if it was with or without deleting os3/mos/aros code (at least not from configure scripts for sure):
This patch just not in real adtools-path way, i just make it like this: have one original directory and another one with my changes and then just "diff -ru --new-file a b >binutls_2_24.patch"
But see the post i point out for more details and link on patch.
Maybe it's time to just do firstly only that : in the current binutils (at least in the binutils first) remove all os3/mos/aros code, and regenerate patches without (and not made for now bnutils switch, this one for later). So we will have just more readable code right now.