Who's Online |
30 user(s) are online ( 19 user(s) are browsing Forums)
Members: 0
Guests: 30
more...
|
|
Headlines |
-
arabic_console_devicepro2.lha - driver/input
Sep 8, 2024
-
amiarcadia.lha - emulation/gamesystem
Sep 8, 2024
-
ciagent.lha - emulation/misc
Sep 8, 2024
-
deark.lha - utility/archive
Sep 6, 2024
-
amitranslate.lha - utility/text
Sep 6, 2024
-
amissl-sdk.lha - development/misc
Sep 5, 2024
-
amissl.lha - library/misc
Sep 5, 2024
-
snoopy.lha - utility/filetool
Sep 5, 2024
-
amigagpt.lha - network/chat
Sep 1, 2024
-
yt.lha - video/misc
Sep 1, 2024
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/25 13:37
#81
|
Just can't stay away
|
@MightyMax No need to worry about the specs after all. It was simply a missread of the debug output on my behalf. Everything runs as it should. Now, I have this : Quote: 3.Work4.1:STICK/ctor_test> test_dyn foo bar f 123 main result 123 3.Work4.1:STICK/ctor_test> So this is a step in the right direction. What I am doing is just to look up the .ctors section and treat it as an array of (uint32 *) pointers to functions. So far - as you can see - the foo and bar functions are called. These are coupled in a single entry through a caller function. The .ctors section is 12 bytes long (0x0c), so three pointers. The two others are NULL. I am guessing, that these other two represent the ctor() and ctor2() functions. Apparently there is an issue with incomplete relocation. Is it possible that someone could assist in analyzing the readelf output to try and figure out, which kind of relocation is missing? Thanks! EDIT: As a matter of fact, it is worth to take a look at this : Quote: 3.Work4.1:STICK/ctor_test> readelf -s lib.o
Symbol table '.symtab' contains 22 entries: Num: Value Size Type Bind Vis Ndx Name 0: 00000000 0 NOTYPE LOCAL DEFAULT UND 1: 00000000 0 FILE LOCAL DEFAULT ABS lib.c 2: 00000000 0 SECTION LOCAL DEFAULT 1 3: 00000000 0 SECTION LOCAL DEFAULT 3 4: 00000000 0 SECTION LOCAL DEFAULT 4 5: 00000000 0 SECTION LOCAL DEFAULT 5 6: 00000000 0 SECTION LOCAL DEFAULT 6 7: 000000a8 56 FUNC LOCAL DEFAULT 1 _ZN12_GLOBAL__N_115foo_ct 8: 000000a8 56 FUNC LOCAL DEFAULT 1 _ZN12_GLOBAL__N_115foo_ct 9: 00000000 1 OBJECT LOCAL DEFAULT 4 _ZN12_GLOBAL__N_1L18foo_c 10: 000000e0 56 FUNC LOCAL DEFAULT 1 _ZN12_GLOBAL__N_115bar_ct 11: 000000e0 56 FUNC LOCAL DEFAULT 1 _ZN12_GLOBAL__N_115bar_ct 12: 00000001 1 OBJECT LOCAL DEFAULT 4 _ZN12_GLOBAL__N_1L18bar_c 13: 00000184 128 FUNC LOCAL DEFAULT 1 _Z41__static_initializati 14: 00000204 60 FUNC LOCAL DEFAULT 1 _GLOBAL__sub_I_lib.c 15: 00000000 0 SECTION LOCAL DEFAULT 8 16: 00000000 0 SECTION LOCAL DEFAULT 10 17: 00000004 80 FUNC GLOBAL DEFAULT 1 _Z3foov 18: 00000000 0 NOTYPE GLOBAL DEFAULT UND puts 19: 00000058 80 FUNC GLOBAL DEFAULT 1 _Z3barv 20: 0000011c 100 FUNC GLOBAL DEFAULT 1 _Z1fi 21: 00000000 0 NOTYPE GLOBAL DEFAULT UND printf 3.Work4.1:STICK/ctor_test> Apparently the assembler has discared the ctor(2) and dtor(2) functions (they are included in the assembly). So probably this is the reason for the two vacant spaces in the .ctors section. Now - why would the assembler discard entries? The entries look almost exactly the same as the entries, that are included (in the assembly).
Edited by elfpipe on 2023/1/25 15:00:12
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/24 17:03
#82
|
Just can't stay away
|
@joerg Quote: IIRC there is no code inside crtend.o and shcrtend.o, they only include the end markers of the constuctor/destructor arrays, the code for calling the functions is in crtbegin.o and shcrtbegin.o. If there is a problem with crtend.o or shcrtend.o it can only be because of a wrong linking order, i.e. something is wrong in the specs file of GCC. This is good to know. There is definitely something wrong with the calling order, so now the question is just where. @MightyMax : Are you up for this?
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/24 16:00
#83
|
Just can't stay away
|
@MightyMax @joerg
I am presently in a bit of a mess. I have fixed InitSHLibs, so that it looks up the .ctors section. This required fixing a bug in LoadSegment. So far so good. But now I get a deadlock when the app closes down, and apparently (from what I can gather from Sashimi, before it dies) InitSHLibs is called AFTER CloseElf, which is probably the cause of the deadlock.
I cannot see any place, that this can happen from inside elf.library, so I gather the crtend.o or shcrtend.o is responsible. I cannot produce a disassembly any of of these. Can anyone else produce a disassembly?
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/23 13:07
#84
|
Just can't stay away
|
@MigthyMax Quote: I found where the __shlib_call_de-/constructors are "defined". they are part of the newlib c library and only present in the shcrtbegin.o file.
Can you post the source code for it here?
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/23 12:56
#85
|
Just can't stay away
|
|
|
|
|
Re: libpng.so 14 there is a download link, thanks
|
Posted on: 2023/1/22 18:18
#86
|
Just can't stay away
|
@white
I only have 12 and 16. Not sure, where this dependency has sneaked in.
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/22 15:04
#87
|
Just can't stay away
|
@MigthyMax InitSHLibs calls __shlib_call_constructors. Well, we can conclude, that here again the amiga is trying to do a non-standard solution, that doesn't work. I would say, that the correct solution would be to scrap the __shlib_call_constructors function and do construction by looking directly at the .ctors and .dtors sections from within elf.library. What do you think? Look here : https://maskray.me/blog/2021-11-07-init-ctors-init-array
|
|
|
|
Re: libpng.so 14 there is a download link, thanks
|
Posted on: 2023/1/21 10:58
#88
|
Just can't stay away
|
@white
I am glad to know, that the qt browsers work. Currently, as you might know, I have shifted focus from Qt4 to Qt6, and so there is not going to be more work done on the Qt4 stuff.
I can see, if I have the correct libpng on my machine. If I do, I will post a link here.
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/15 12:09
#89
|
Just can't stay away
|
@joerg
I misspoke. The 'WebKit' I am refering to is the Qt wrapper around chrome. The build system here is very complex, and the less I have to mess with it, the better. The older webkit modules from previous Qt versions was no problem.
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/14 15:48
#90
|
Just can't stay away
|
@Georg
You are completely right, and that was my first consideration. I originally planned to do Qt6 with static linking only.
BUT meeting the requirements of software, I want to build, changed my mind. I want to build qtcreator and webkit, and those build systems don't work with attempted static linking.
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/11 15:37
#91
|
Just can't stay away
|
@MigthyMax Quote: Well I cannot be 100% sure, because I have no insight in how sobjs loading is implemented. Maybe elfpipe can confirm it/look into it. From first view, it looks like the constructors are called. Also your note, that some are called while others not is valid. I could construct a test to 100% verify, that it is the case. EDIT: Maybe the file binutils/ld/emultempl/amigaos.em is a possible target for out search?
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/9 14:22
#92
|
Just can't stay away
|
@MigthyMax
Removing the '!' would give zero to 'world'. But I don't think this is the right solution. I think it is best to keep the binutils code as close to the original as possible. I trust it. Instead I suggest to adhere to the workflow, that is maintained and hinted at here. This would mean to ensure pointer equality in the cases, where st_value is non-zero, and that is exactly, what my solution does.
Edited by elfpipe on 2023/1/9 15:36:03
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/8 18:35
#93
|
Just can't stay away
|
@elfpipe A reply to myself. After consolidating the binutils 2.40 source, I have found this : Quote: if (!local_undefweak && !h->def_regular && (h->plt.offset != (bfd_vma) -1 || eh->plt_got.offset != (bfd_vma) -1)) { /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value if there were any relocations where pointer equality matters (this is a clue for the dynamic linker, to make function pointer comparisons work between an application and shared library), otherwise set it to zero. If a function is only called from a binary, there is no need to slow down shared libraries because of that. */ sym->st_shndx = SHN_UNDEF; if (!h->pointer_equality_needed) sym->st_value = 0; } The important part is the comment. As stated, the binary loader (elf.library) needs to do an active comparison, when the value is non-zero. When zero, it just performs a lookup. In the current elf.library implementation, the easiest way of meeting this requirement, is to do a default lookup, which will always result in pointer equality. Since the .plt entry is private to the main app (or the specific shared object), there is no way of having pointer equality, when the entry points to the .plt entry. And the only known cases of a non-zero st_value are the ones, where st_value points to .plt. Please discuss.
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/8 16:36
#94
|
Just can't stay away
|
@MigthyMax Actually, when looking at the original non-amiga text (as found in the patches) :
if (!h->pointer_equality_needed)
- sym->st_value = 0;
This is a bit mysterious. From my current perspective, this looks like a bug. The cases, that require pointer equality, are exactly the cases, where we need the st_value parameter to be zero. So this might be just a case of a '!' inserted in the wrong place. It will be interesting to know, what the updated binutils source says in this place.
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/8 14:10
#95
|
Just can't stay away
|
@MigthyMax Quote: I won't go for the general way to perform a lookup. As the ABI states, it should only be made if the value of the symbol is zero and a UNDEF function. Well, since the amigaos is already performing non-standard compared to the ABI, I think the argument could go either way. One could even argue, that the .plt stubs are obsolete, since they introduce no added functioning, but only helps to clutter the concept of linking. I am not sure, if there is some argument from cyber safety, that necessitates a .plt section. But from a functioning point of view, it is definitely unnecessary. IF we are to implement the ABI text and allow for linking using the st_value attribute for UNDEF entries, then we still need to figure out, why the 'world' symbol comes out non-zero in the example. Simply uncommenting the line with st_value = 0 doesn't solve that part of the problem.
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/8 10:26
#96
|
Just can't stay away
|
@kas1e Quote: Amiga bless the ones who kill the Alf !:) Is it changes was only in the file you with Max point out ? (i just about needs to commit them to adtools repo, so no one will have the same issue again) The current solution is independent of any changes to bfd. I will have to first confer with Steven Solie. If he approves of the solution, he will do the commit and release of the new elf.library. Binutils do not need to be changed.
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/7 14:44
#97
|
Just can't stay away
|
Ok, so far so good. Qt6 is rebuildt and tested. 'connect()' calls no longer fail, and the relevant ui elements perform as they should. So I just assume, that this means 'it's working'.
Also system performance seems to be unaffected, and the few other applications I have tried seems to perform normally. So - fingers crossed - I think this is a good solution.
Now, before I start donating right and left, I would like the constructor issue to be solved as well. Overall, I think it a good measuring point to require an optimally functioning version of Qt6 before giving out gifts. So : Constructur issue. Any takers?
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/7 12:36
#98
|
Just can't stay away
|
@MigthyMax Bingo! You nailed it. Now I have this : Quote: 10.STICK:shlib_test> app_dyn lib: 0x7f99d420 main: 0x7f99d420 10.STICK:shlib_test> I will have to do some further testing. What I have done is to build elf.library to default to symbol lookup for UND symbols. I will have to confirm, that this approach works in general. There is the caveat, that the 'world' symbol still is not set to 0, only 'hello' and 'printf'. Therefore the solution seems to be to do the default lookup. When I have done a few more steps on the spot, I will test Qt6 to see, if the new solution improves on performance here.
Edited by elfpipe on 2023/1/7 13:51:08
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/6 12:04
#99
|
Just can't stay away
|
If an updated binutils could be produced in an official format, it would be a step in the right direction.
|
|
|
|
Re: Qt 6 progress
|
Posted on: 2023/1/4 11:25
#100
|
Just can't stay away
|
@MigthyMax Quote: 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
|
|
|
|