Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
67 user(s) are online (45 user(s) are browsing Forums)

Members: 2
Guests: 65

beworld, BillE, more...

Headlines

 
  Register To Post  

« 1 ... 6 7 8 (9) 10 11 12 ... 20 »
Re: Qt 6 progress
Just popping in
Just popping in


See User information
@alfkil

What do you mean usage? You simply set -fPIC Which stands for Position Independent Code, AFAIK you should never use it in ordinary code under windows and Linux (except libraries and -usually- plugins maybe also device drivers)... the strange part is shouldn't it be enabled by default for Amiga, since all code should be position independent on it...

Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
@thread

Nope. I tried both -mlongcall and forcing -fPIC for shared library objects. Nothing works.

Basically, there is a single symbol (in this case a function) that changes value from when it is called in the main executable to when it is called from within the shared object. The content resides in the shared object and is linked from the main executable. This does very much sound like an issue with either -mlongcall or -fPIC, but at this point at least I haven't cracked the code to make it work. This begins to annoy me...

Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
@trgswe

So maybe I should try disabling it?? This begins to become very hairy...

Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
I have officially given up.

The current base can be used under cross environment on linux, if you build it yourself and use the supplied toolchain. If you configure it to use static linking, it works fine. If you configure it to use dynamic linking and build Qt libs as shared objects, then you need to keep in mind, that all of your QObject::connect() calls will fail, unless you change the notation to the old style from Qt4.

Go to top
Re: Qt 6 progress
Amigans Defender
Amigans Defender


See User information
can you give me a point where to start? I mean try to configure it as static lib?
I want to try to compile it and try to understand what is wrong. I know very well that is hard to work on this kind of projects alone and with tools that doesn't works very well. It is hard for us..

i'm really tired...
Go to top
Re: Qt 6 progress
Just popping in
Just popping in


See User information
@alfkil

No keep it off for main programs, but enable it for all libraries (Including standard qt libraries, but excluding link libraries), one needs to checkout how amiga really handles sobjs, would it be better to go with amiga style libraries? (but then you have rewrite issues, maintenance issues),

Go to top
Re: Qt 6 progress
Amigans Defender
Amigans Defender


See User information
However there is something strange in libstdc++ library
or better maybe in binutils
I'm trying to fix a problem on clib2. I've added a cout in an c++ include file that was causing the problem and now i get this error when i try to compile a simply c++ file

usr/lib/gcc/ppc-amigaos/11.1.0/../../../../ppc-amigaos/bin/ld: Dwarf Error: found dwarf version '5', this reader only handles version 2, 3 and 4 information.
/usr/lib/gcc/ppc-amigaos/11.1.0/../../../../ppc-amigaos/lib/clib2/libstdc++.a(ext11-inst.o): In function `_ZN9__gnu_cxx13stdio_filebufIcSt11char_traitsIcEEC2EP4FILESt13_Ios_Openmodej'

And i have restored that include file.
Previously i had no error but lseek in clib2 was called with third parameter with a non sense value.
Also that dwarf error is not so clear to me..

i'm really tired...
Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
@afxgroup

There is a file

configure-amiga.sh

in the root of the repo.

In this file, change

AmigaOS

to

Generic

and it will produce a static build.

Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
@afxgroup

And follow instructions on the GitHub page.

Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
@trgswe

Thanks you for the link to the video. I watched it, and it is very good at talking about modern syntax in these things.

Basically, what is the problem with the current Qt6 for Amiga is, that the newer version of the connect statement uses a template, that somehow gets the function address wrong for the connecting signal. Why this happens is a huge mystery, and I have already spent too much energy on trying to find a fix. If someone solves this, I will buy beer and send gifts.

Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
I'm linking to the error report test case here, in case anyone wants to get snappy with it. Who knows, there could be a solution, we haven't thought of?

https://drive.google.com/file/d/1dTrUx ... fBcwhYy1/view?usp=sharing

When run, it will output two different addresses for the same symbol. This is the bug, that I can't fix, and I am pretty sure, that it is either the compiler or linker, that has a problem. It has been tested against GCC 11 and 8.

Go to top
Re: Qt 6 progress
Not too shy to talk
Not too shy to talk


See User information
when i've seen this kind of error before it's because there are duplicate symbols, and the compiler and linker differ in which one they give priority to. what happens if you globally change the name of the function?

Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
@NinjaCyborg

I am not sure exactly what you mean. It is the same symbol, referenced in exactly the same way, just from two different places. It doesn't seem to have anything to do with the function name, rather it must be the way it is referenced (by &object::function() ). You are correct, that there are two instances of the symbol : One is instantiated inside the shared object and is a symbol of type .text with an address and a size. The other is an UND* (undefined symbol), residing inside the main executable, and this one should be linked to the first one upon execution by the runtime linker. You can confirm this by using objdump -t on the executable and the shared object and searching the resulting texts for the function name.

This is exactly the same pattern as with a shitload of other symbols in the Qt libraries and executables, that all end up linking perfectly well with the code executing as it should. I am really troubled to understand, why it would fail in this case. But the test shows very clearly, that the exact same printf statement executed in two different places produce different addresses for the exact same symbol referenced in exactly the same way. So there must be a bug somewhere.

Preferably, someone with an updated system (latest system files) should test this to confirm, that it is not just happening on my system.

Go to top
Re: Qt 6 progress
Home away from home
Home away from home


See User information
@alfkil
Yeah, tested your test case, exactly 2 different addresses on my x5000 as well, and the test case compiled via GCC 11.1 + latest SDK... But at least you have a test case! That half of fix :)

Join us to improve dopus5!
AmigaOS4 on youtube
Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
@kas1e

Thank you! :)

Yes, that is true - it is very clear, now. But why it happens to just this one type of symbol... I would have to know a great deal more about how the compiler works, to answer that!

Go to top
Re: Qt 6 progress
Not too shy to talk
Not too shy to talk


See User information
@alfkil
I'm currently working on adding proper share-group handling to ogles2.library.
This might be of interest for you and your QT6 project because it should allow sharing of textures etc. among contexts which didn't really work until now.
When I say "should" I actually mean "likely it already does" with the latest wip version 3.3. I guess I'm done but it's not really tested yet

There's a new aglCreateContext2 tag OGLES2_CCT_SHARE_WITH <ogles2-context-pointer>. This optional tag instructs ogles2 to share the same internal Nova-context (with a different render-state-object) and the same set of textures, VBOs, shaders and shader-programs of the given other gl-context.
So you create context 1 and then use its handle with OGLES2_CCT_SHARE_WITH for the creation of another context. The number of sharing contexts is unlimited and you e.g. may destroy context 1 and the resources will still be available for context 2. And the handle of context 2 can of course also be used to create another shared context.

Check it out (if you don't have an account there, contact Matthew to get one):
http://www.amiga.org/developer/bugreports/view.php?id=896

Go to top
Re: Qt 6 progress
Just popping in
Just popping in


See User information
@alfkil

Uncertain, but I spent some time to download Qt's Repository (82
repos) and when I compare it with your repo I wonder if you are
missing some repos/part of repos for instance webkit is not only
webkit it is Qtwebengine-chromium, Qtwebengine, QtwebView,
qtWebSocket's, qtHttp, QtWebKit, QtFTP... some are purely IMO
test/development modules but if they repracated they are put into
the qt5-compat library which is also missing in your repo IIRC
in Qt4 the Qt3-compat library was very important, and so in Qt5
the Qt4-compat is/was very important.

My Qt 6 Folder is 3.24 Gb in Size
Your Qt6 Folder is 512 Mb in Size

alot can have been missing in those Gb's to make it uncompilable.


Edited by trgswe on 2022/6/19 14:57:23
Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
@trgswe

I know all this. I have most of the modules, you are mentioning, in ready-built versions on my linux hd. I was able to build qt-creator, which needs the Qt5-compat library, so I am pretty sure, that everything I did has been set up correctly. The only problem, in fact, seems to be the link error I have been talking about and just a few other things, for instance qmake doesn't work natively yet.

If we could fix the link error, I would be able to proceed.

Go to top
Re: Qt 6 progress
Just can't stay away
Just can't stay away


See User information
After a bit of a rough work period, I will now give an official update on Qt6.

Due to a problem with gcc (adtools) and dynamic linking, I have not been able to release a version of Qt6 with shared objects.

The plan now is to backtrace and do a version, that uses only static linking.

The problem is described here : Issue #109 at github (adtools).

If anyone manages to flip the issue, I will donate much. Until then I have officially given up.

Go to top
Re: Qt 6 progress
Just popping in
Just popping in


See User information
After reading an article about how linker and how dynamic loading is realized in the elf format, i thought about you problem.
My first thought about your problem with the different address of the method, muts be that you get in the dynamic linked app,
the address of the stub method of the PLT.
So i started to investigate the C example at issue 109. First i took a look at the static linked app:

Quote:
[0]>Work:Home/Workspaces/109>objdump -d app_static

app_static: file format elf32-amigaos

Disassembly of section .text:

01000074 <_start>:
1000074: 94 21 ff b0 stwu r1,-80(r1)
1000078: 7c 08 02 a6 mflr r0
100007c: 3d 20 01 02 lis r9,258
1000080: 3d 40 01 01 lis r10,257
1000084: 90 aa 00 28 stw r5,40(r10)
1000088: 90 01 00 54 stw r0,84(r1)
100008c: 93 e1 00 4c stw r31,76(r1)
1000090: 93 41 00 38 stw r26,56(r1)
1000094: 7d ba 6b 78 mr r26,r13
1000098: 39 a9 80 18 addi r13,r9,-32744
100009c: 83 e5 02 78 lwz r31,632(r5)
10000a0: 93 01 00 30 stw r24,48(r1)
10000a4: 7c 98 23 78 mr r24,r4
10000a8: 81 3f 00 3c lwz r9,60(r31)
10000ac: 93 21 00 34 stw r25,52(r1)
10000b0: 7c 79 1b 78 mr r25,r3
10000b4: 7f e3 fb 78 mr r3,r31
10000b8: 7d 29 03 a6 mtctr r9
10000bc: 93 81 00 40 stw r28,64(r1)
10000c0: 93 c1 00 48 stw r30,72(r1)
10000c4: 4e 80 04 21 bctrl
10000c8: 81 3f 01 a8 lwz r9,424(r31)
10000cc: 3d 40 01 01 lis r10,257
10000d0: 3c 80 01 00 lis r4,256
10000d4: 93 ea 00 20 stw r31,32(r10)
10000d8: 7f e3 fb 78 mr r3,r31
10000dc: 38 84 10 00 addi r4,r4,4096
10000e0: 38 a0 00 32 li r5,50
10000e4: 7d 29 03 a6 mtctr r9
10000e8: 4e 80 04 21 bctrl
10000ec: 7c 7c 1b 79 mr. r28,r3
10000f0: 41 c2 03 50 beq- 1000440 <_start+0x3cc>
10000f4: 81 3f 01 c0 lwz r9,448(r31)
10000f8: 3f c0 01 00 lis r30,256
10000fc: 38 e0 00 00 li r7,0
1000100: 3b de 10 10 addi r30,r30,4112
1000104: 93 a1 00 44 stw r29,68(r1)
1000108: 38 c0 00 01 li r6,1
100010c: 7f c5 f3 78 mr r5,r30
1000110: 7f 84 e3 78 mr r4,r28
1000114: 7f e3 fb 78 mr r3,r31
1000118: 7d 29 03 a6 mtctr r9
100011c: 4e 80 04 21 bctrl
1000120: 7c 7d 1b 79 mr. r29,r3
1000124: 41 c2 03 44 beq- 1000468 <_start+0x3f4>
1000128: 81 5d 00 10 lwz r10,16(r29)
100012c: 3d 20 01 01 lis r9,257
1000130: 3c 80 01 00 lis r4,256
1000134: 93 61 00 3c stw r27,60(r1)
1000138: 3f 60 01 01 lis r27,257
100013c: 38 a0 00 34 li r5,52
1000140: 91 49 00 2c stw r10,44(r9)
1000144: 38 84 10 18 addi r4,r4,4120
1000148: 7f e3 fb 78 mr r3,r31
100014c: 81 3f 01 a8 lwz r9,424(r31)
1000150: 93 bb 00 30 stw r29,48(r27)
1000154: 7d 29 03 a6 mtctr r9
1000158: 4e 80 04 21 bctrl
100015c: 7c 7d 1b 79 mr. r29,r3
1000160: 41 c2 01 c0 beq- 1000320 <_start+0x2ac>
1000164: 81 3f 01 c0 lwz r9,448(r31)
1000168: 38 e0 00 00 li r7,0
100016c: 38 c0 00 01 li r6,1
1000170: 7f c5 f3 78 mr r5,r30
1000174: 7f a4 eb 78 mr r4,r29
1000178: 7f e3 fb 78 mr r3,r31
100017c: 7d 29 03 a6 mtctr r9
1000180: 4e 80 04 21 bctrl
1000184: 7c 7c 1b 79 mr. r28,r3
1000188: 41 c2 01 84 beq- 100030c <_start+0x298>
100018c: 3d 20 01 01 lis r9,257
1000190: 92 c1 00 28 stw r22,40(r1)
1000194: 3d 00 01 00 lis r8,256
1000198: 81 49 00 38 lwz r10,56(r9)
100019c: 3d 20 00 34 lis r9,52
10001a0: 39 08 10 4c addi r8,r8,4172
10001a4: 92 e1 00 2c stw r23,44(r1)
10001a8: 61 29 00 14 ori r9,r9,20
10001ac: 3b a0 00 00 li r29,0
10001b0: 80 fc 00 10 lwz r7,16(r28)
10001b4: 55 4a 07 fe clrlwi r10,r10,31
10001b8: 7f 9d 48 40 cmplw cr7,r29,r9
10001bc: 40 dc 00 08 bge- cr7,10001c4 <_start+0x150>
10001c0: 7d 3d 4b 78 mr r29,r9
10001c4: 85 28 00 04 lwzu r9,4(r8)
10001c8: 2f 89 00 00 cmpwi cr7,r9,0
10001cc: 40 fe ff ec bne- cr7,10001b8 <_start+0x144>
10001d0: 81 27 00 14 lwz r9,20(r7)
10001d4: 3d 00 01 01 lis r8,257
10001d8: 93 88 00 18 stw r28,24(r8)
10001dc: 3d 29 ff cc addis r9,r9,-52
10001e0: 39 29 ff d9 addi r9,r9,-39
10001e4: 2b 89 ff f7 cmplwi cr7,r9,65527
10001e8: 41 dd 00 14 bgt- cr7,10001fc <_start+0x188>
10001ec: 3d 20 00 34 lis r9,52
10001f0: 61 29 00 26 ori r9,r9,38
10001f4: 7f 9d 48 40 cmplw cr7,r29,r9
10001f8: 41 dd 01 5c bgt- cr7,1000354 <_start+0x2e0>
10001fc: 3d 00 01 01 lis r8,257
1000200: 3d 20 01 01 lis r9,257
1000204: 39 08 00 08 addi r8,r8,8
1000208: 39 29 00 00 addi r9,r9,0
100020c: 38 c0 00 01 li r6,1
1000210: 91 01 00 10 stw r8,16(r1)
1000214: 3c 60 01 01 lis r3,257
1000218: 91 21 00 0c stw r9,12(r1)
100021c: 3d 00 01 00 lis r8,256
1000220: 3c e0 01 01 lis r7,257
1000224: 90 c1 00 08 stw r6,8(r1)
1000228: 3c c0 01 01 lis r6,257
100022c: 7f 05 c3 78 mr r5,r24
1000230: 81 23 00 34 lwz r9,52(r3)
1000234: 7f 24 cb 78 mr r4,r25
1000238: 7f a3 eb 78 mr r3,r29
100023c: 39 08 04 c0 addi r8,r8,1216
1000240: 38 e7 00 1c addi r7,r7,28
1000244: 81 7c 00 50 lwz r11,80(r28)
1000248: 38 c6 00 24 addi r6,r6,36
100024c: 7d 69 03 a6 mtctr r11
1000250: 4e 80 04 21 bctrl
1000254: 7c 7e 1b 78 mr r30,r3
1000258: 81 3f 01 c8 lwz r9,456(r31)
100025c: 7f 84 e3 78 mr r4,r28
1000260: 7f e3 fb 78 mr r3,r31
1000264: 83 bc 00 10 lwz r29,16(r28)
1000268: 7d 29 03 a6 mtctr r9
100026c: 4e 80 04 21 bctrl
1000270: 81 3f 01 ac lwz r9,428(r31)
1000274: 7f a4 eb 78 mr r4,r29
1000278: 7f e3 fb 78 mr r3,r31
100027c: 7d 29 03 a6 mtctr r9
1000280: 4e 80 04 21 bctrl
1000284: 81 3b 00 30 lwz r9,48(r27)
1000288: 82 c1 00 28 lwz r22,40(r1)
100028c: 2f 89 00 00 cmpwi cr7,r9,0
1000290: 82 e1 00 2c lwz r23,44(r1)
1000294: 41 de 00 b4 beq- cr7,1000348 <_start+0x2d4>
1000298: 81 5f 01 c8 lwz r10,456(r31)
100029c: 7d 24 4b 78 mr r4,r9
10002a0: 7f e3 fb 78 mr r3,r31
10002a4: 83 a9 00 10 lwz r29,16(r9)
10002a8: 7d 49 03 a6 mtctr r10
10002ac: 4e 80 04 21 bctrl
10002b0: 81 3f 01 ac lwz r9,428(r31)
10002b4: 7f a4 eb 78 mr r4,r29
10002b8: 7f e3 fb 78 mr r3,r31
10002bc: 7d 29 03 a6 mtctr r9
10002c0: 4e 80 04 21 bctrl
10002c4: 83 61 00 3c lwz r27,60(r1)
10002c8: 83 a1 00 44 lwz r29,68(r1)
10002cc: 81 3f 00 40 lwz r9,64(r31)
10002d0: 7f e3 fb 78 mr r3,r31
10002d4: 7d 29 03 a6 mtctr r9
10002d8: 4e 80 04 21 bctrl
10002dc: 80 01 00 54 lwz r0,84(r1)
10002e0: 7f c3 f3 78 mr r3,r30
10002e4: 7f 4d d3 78 mr r13,r26
10002e8: 83 01 00 30 lwz r24,48(r1)
10002ec: 83 21 00 34 lwz r25,52(r1)
10002f0: 7c 08 03 a6 mtlr r0
10002f4: 83 41 00 38 lwz r26,56(r1)
10002f8: 83 81 00 40 lwz r28,64(r1)
10002fc: 83 c1 00 48 lwz r30,72(r1)
1000300: 83 e1 00 4c lwz r31,76(r1)
1000304: 38 21 00 50 addi r1,r1,80
1000308: 4e 80 00 20 blr
100030c: 81 3f 01 ac lwz r9,428(r31)
1000310: 7f a4 eb 78 mr r4,r29
1000314: 7f e3 fb 78 mr r3,r31
1000318: 7d 29 03 a6 mtctr r9
100031c: 4e 80 04 21 bctrl
1000320: 81 3f 02 3c lwz r9,572(r31)
1000324: 3c 80 00 03 lis r4,3
1000328: 7f e3 fb 78 mr r3,r31
100032c: 60 84 80 0e ori r4,r4,32782
1000330: 3b c0 00 14 li r30,20
1000334: 7d 29 03 a6 mtctr r9
1000338: 4e 80 04 21 bctrl
100033c: 81 3b 00 30 lwz r9,48(r27)
1000340: 2f 89 00 00 cmpwi cr7,r9,0
1000344: 40 fe ff 54 bne- cr7,1000298 <_start+0x224>
1000348: 83 61 00 3c lwz r27,60(r1)
100034c: 83 a1 00 44 lwz r29,68(r1)
1000350: 4b ff ff 7c b 10002cc <_start+0x258>
1000354: 81 3f 01 a8 lwz r9,424(r31)
1000358: 3c 80 01 00 lis r4,256
100035c: 38 a0 00 32 li r5,50
1000360: 38 84 10 28 addi r4,r4,4136
1000364: 7f e3 fb 78 mr r3,r31
1000368: 91 41 00 18 stw r10,24(r1)
100036c: 7d 29 03 a6 mtctr r9
1000370: 4e 80 04 21 bctrl
1000374: 7c 76 1b 79 mr. r22,r3
1000378: 41 c2 01 28 beq- 10004a0 <_start+0x42c>
100037c: 81 3f 01 c0 lwz r9,448(r31)
1000380: 7f c5 f3 78 mr r5,r30
1000384: 38 e0 00 00 li r7,0
1000388: 38 c0 00 01 li r6,1
100038c: 7e c4 b3 78 mr r4,r22
1000390: 7f e3 fb 78 mr r3,r31
1000394: 7d 29 03 a6 mtctr r9
1000398: 4e 80 04 21 bctrl
100039c: 81 41 00 18 lwz r10,24(r1)
10003a0: 7c 77 1b 79 mr. r23,r3
10003a4: 41 82 00 e8 beq- 100048c <_start+0x418>
10003a8: 3d 00 01 01 lis r8,257
10003ac: 3d 20 01 01 lis r9,257
10003b0: 80 77 00 10 lwz r3,16(r23)
10003b4: 39 08 00 08 addi r8,r8,8
10003b8: 39 29 00 00 addi r9,r9,0
10003bc: 38 a0 00 01 li r5,1
10003c0: 91 01 00 10 stw r8,16(r1)
10003c4: 3c c0 01 01 lis r6,257
10003c8: 91 21 00 0c stw r9,12(r1)
10003cc: 3c e0 01 01 lis r7,257
10003d0: 3d 20 01 01 lis r9,257
10003d4: 90 a1 00 08 stw r5,8(r1)
10003d8: 3d 00 01 00 lis r8,256
10003dc: 7f 05 c3 78 mr r5,r24
10003e0: 7f 24 cb 78 mr r4,r25
10003e4: 90 66 00 24 stw r3,36(r6)
10003e8: 39 08 04 c0 addi r8,r8,1216
10003ec: 92 e7 00 1c stw r23,28(r7)
10003f0: 38 c0 00 00 li r6,0
10003f4: 38 e0 00 00 li r7,0
10003f8: 81 7c 00 50 lwz r11,80(r28)
10003fc: 7f a3 eb 78 mr r3,r29
1000400: 81 29 00 34 lwz r9,52(r9)
1000404: 7d 69 03 a6 mtctr r11
1000408: 4e 80 04 21 bctrl
100040c: 81 3f 01 c8 lwz r9,456(r31)
1000410: 7e e4 bb 78 mr r4,r23
1000414: 7c 7e 1b 78 mr r30,r3
1000418: 7f e3 fb 78 mr r3,r31
100041c: 83 b7 00 10 lwz r29,16(r23)
1000420: 7d 29 03 a6 mtctr r9
1000424: 4e 80 04 21 bctrl
1000428: 81 3f 01 ac lwz r9,428(r31)
100042c: 7f a4 eb 78 mr r4,r29
1000430: 7f e3 fb 78 mr r3,r31
1000434: 7d 29 03 a6 mtctr r9
1000438: 4e 80 04 21 bctrl
100043c: 4b ff fe 1c b 1000258 <_start+0x1e4>
1000440: 3d 20 01 01 lis r9,257
1000444: 93 89 00 30 stw r28,48(r9)
1000448: 81 3f 02 3c lwz r9,572(r31)
100044c: 3c 80 00 03 lis r4,3
1000450: 7f e3 fb 78 mr r3,r31
1000454: 60 84 80 0c ori r4,r4,32780
1000458: 3b c0 00 14 li r30,20
100045c: 7d 29 03 a6 mtctr r9
1000460: 4e 80 04 21 bctrl
1000464: 4b ff fe 68 b 10002cc <_start+0x258>
1000468: 81 3f 01 ac lwz r9,428(r31)
100046c: 7f 84 e3 78 mr r4,r28
1000470: 7f e3 fb 78 mr r3,r31
1000474: 7d 29 03 a6 mtctr r9
1000478: 4e 80 04 21 bctrl
100047c: 3d 20 01 01 lis r9,257
1000480: 93 a9 00 30 stw r29,48(r9)
1000484: 83 a1 00 44 lwz r29,68(r1)
1000488: 4b ff ff c0 b 1000448 <_start+0x3d4>
100048c: 81 3f 01 ac lwz r9,428(r31)
1000490: 7e c4 b3 78 mr r4,r22
1000494: 7f e3 fb 78 mr r3,r31
1000498: 7d 29 03 a6 mtctr r9
100049c: 4e 80 04 21 bctrl
10004a0: 81 3f 02 3c lwz r9,572(r31)
10004a4: 3c 80 00 03 lis r4,3
10004a8: 7f e3 fb 78 mr r3,r31
10004ac: 60 84 80 07 ori r4,r4,32775
10004b0: 3b c0 00 14 li r30,20
10004b4: 7d 29 03 a6 mtctr r9
10004b8: 4e 80 04 21 bctrl
10004bc: 4b ff fd 9c b 1000258 <_start+0x1e4>

010004c0 <main>:
10004c0: 94 21 ff f0 stwu r1,-16(r1)
10004c4: 7c 08 02 a6 mflr r0
10004c8: 93 e1 00 0c stw r31,12(r1)
10004cc: 90 01 00 14 stw r0,20(r1)
10004d0: 7c 3f 0b 78 mr r31,r1
10004d4: 48 00 00 41 bl 1000514 <hello>
10004d8: 3d 20 01 00 lis r9,256
10004dc: 38 69 10 34 addi r3,r9,4148
10004e0: 3d 20 01 00 lis r9,256
10004e4: 38 89 05 68 addi r4,r9,1384
10004e8: 4c c6 31 82 crclr 4*cr1+eq
10004ec: 48 00 00 99 bl 1000584 <printf>
10004f0: 38 00 00 00 li r0,0
10004f4: 7c 03 03 78 mr r3,r0
10004f8: 81 61 00 00 lwz r11,0(r1)
10004fc: 80 0b 00 04 lwz r0,4(r11)
1000500: 7c 08 03 a6 mtlr r0
1000504: 83 eb ff fc lwz r31,-4(r11)
1000508: 7d 61 5b 78 mr r1,r11
100050c: 4e 80 00 20 blr
1000510: 00 01 7a e0 .long 0x17ae0

01000514 <hello>:
1000514: 94 21 ff f0 stwu r1,-16(r1)
1000518: 7c 08 02 a6 mflr r0
100051c: 93 c1 00 08 stw r30,8(r1)
1000520: 93 e1 00 0c stw r31,12(r1)
1000524: 90 01 00 14 stw r0,20(r1)
1000528: 7c 3f 0b 78 mr r31,r1
100052c: 42 9f 00 05 bcl- 20,4*cr7+so,1000530 <hello+0x1c>
1000530: 7f c8 02 a6 mflr r30
1000534: 80 1e ff e0 lwz r0,-32(r30)
1000538: 7f c0 f2 14 add r30,r0,r30
100053c: 80 7e 80 00 lwz r3,-32768(r30)
1000540: 80 9e 80 04 lwz r4,-32764(r30)
1000544: 4c c6 31 82 crclr 4*cr1+eq
1000548: 48 00 00 3d bl 1000584 <printf>
100054c: 81 61 00 00 lwz r11,0(r1)
1000550: 80 0b 00 04 lwz r0,4(r11)
1000554: 7c 08 03 a6 mtlr r0
1000558: 83 cb ff f8 lwz r30,-8(r11)
100055c: 83 eb ff fc lwz r31,-4(r11)
1000560: 7d 61 5b 78 mr r1,r11
1000564: 4e 80 00 20 blr

01000568 <world>:
1000568: 94 21 ff f0 stwu r1,-16(r1)
100056c: 93 e1 00 08 stw r31,8(r1)
1000570: 7c 3f 0b 78 mr r31,r1
1000574: 81 61 00 00 lwz r11,0(r1)
1000578: 83 eb ff f8 lwz r31,-8(r11)
100057c: 7d 61 5b 78 mr r1,r11
1000580: 4e 80 00 20 blr

01000584 <printf>:
1000584: 39 80 04 b0 li r12,1200
1000588: 48 00 00 04 b 100058c <__NewlibCall>

0100058c <__NewlibCall>:
100058c: 3d 60 01 01 lis r11,257
1000590: 80 0b 00 18 lwz r0,24(r11)
1000594: 7d 6c 00 2e lwzx r11,r12,r0
1000598: 7d 69 03 a6 mtctr r11
100059c: 4e 80 04 20 bctr


The interesting part is address 10004e0 & 10004e4;

Quote:
10004e0: 3d 20 01 00 lis r9,256
10004e4: 38 89 05 68 addi r4,r9,1384


Performing the these two operations result the following address 0x010000568,
which is the wanted address of the world method:

Quote:
01000568 <world>:
1000568: 94 21 ff f0 stwu r1,-16(r1)
100056c: 93 e1 00 08 stw r31,8(r1)
1000570: 7c 3f 0b 78 mr r31,r1
1000574: 81 61 00 00 lwz r11,0(r1)
1000578: 83 eb ff f8 lwz r31,-8(r11)
100057c: 7d 61 5b 78 mr r1,r11
1000580: 4e 80 00 20 blr


To have the correct address of the world method in the main method, the flowing relocation were present
in the object file fr the main.c. The main.o file isn't build by the makefile , you need to build it by
yourself with cc -o app_static.o -c main.c -L. -lhello -athread=single<[font=Haettenschweiler]world:

Quote:
[0]>Work:Home/Workspaces/109>readelf -r app_static.o

Relocation section '.rela.text' at offset 0x354 contains 6 entries:
Offset Info Type Sym.Value Sym. Name + Addend
00000014 0000080a R_PPC_REL24 00000000 hello + 0
0000001a 00000906 R_PPC_ADDR16_HA 00000000 world + 0
0000001e 00000904 R_PPC_ADDR16_LO 00000000 world + 0
00000022 00000506 R_PPC_ADDR16_HA 00000000 .rodata + 0
00000026 00000504 R_PPC_ADDR16_LO 00000000 .rodata + 0
0000002c 00000a0a R_PPC_REL24 00000000 printf + 0


And its the second and third relocation, which is responsible for correct behavior in the static linking.

Thus my thought was that the relocation must be wrong in the dynamic variant. So taking a look at the relocation
of dynamic linked app should reveal it:

Quote:
[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

Relocation section '.rela.text' at offset 0x104e4 contains 60 entries:
Offset Info Type Sym.Value Sym. Name + Addend
010002fe 00002006 R_PPC_ADDR16_HA 010180d8 _SDA_BASE_ + 0
01000302 00002706 R_PPC_ADDR16_HA 010100f0 SysBase + 0
01000306 00002704 R_PPC_ADDR16_LO 010100f0 SysBase + 0
0100031a 00002004 R_PPC_ADDR16_LO 010180d8 _SDA_BASE_ + 0
0100034e 00001906 R_PPC_ADDR16_HA 010100e8 IExec + 0
01000352 00000906 R_PPC_ADDR16_HA 01002000 .rodata + 0
01000356 00001904 R_PPC_ADDR16_LO 010100e8 IExec + 0
0100035e 00000904 R_PPC_ADDR16_LO 01002000 .rodata + 0
0100037a 00000906 R_PPC_ADDR16_HA 01002000 .rodata + 10
01000382 00000904 R_PPC_ADDR16_LO 01002000 .rodata + 10
010003ae 00001606 R_PPC_ADDR16_HA 010100f4 UtilityBase + 0
010003b2 00000906 R_PPC_ADDR16_HA 01002000 .rodata + 18
010003ba 00001b06 R_PPC_ADDR16_HA 010100f8 IUtility + 0
010003c2 00001604 R_PPC_ADDR16_LO 010100f4 UtilityBase + 0
010003c6 00000904 R_PPC_ADDR16_LO 01002000 .rodata + 18
010003d2 00001b04 R_PPC_ADDR16_LO 010100f8 IUtility + 0
0100040e 00001c06 R_PPC_ADDR16_HA 010100dc __unix_path_semantics + 0
01000416 00000a06 R_PPC_ADDR16_HA 01002040 .__newlib_version + 0
0100041a 00001c04 R_PPC_ADDR16_LO 010100dc __unix_path_semantics + 0
01000422 00000a04 R_PPC_ADDR16_LO 01002040 .__newlib_version + 0
01000456 00002106 R_PPC_ADDR16_HA 010100e0 INewlib + 0
0100045a 00002104 R_PPC_ADDR16_LO 010100e0 INewlib + 0
0100047e 00000c06 R_PPC_ADDR16_HA 01010008 .dtors + 0
01000482 00000b06 R_PPC_ADDR16_HA 01010000 .ctors + 0
01000486 00000c04 R_PPC_ADDR16_LO 01010008 .dtors + 0
0100048a 00000b04 R_PPC_ADDR16_LO 01010000 .ctors + 0
01000496 00001406 R_PPC_ADDR16_HA 010100d8 __stdiowin + 0
0100049e 00002306 R_PPC_ADDR16_HA 01000740 main + 0
010004a2 00002806 R_PPC_ADDR16_HA 010100e4 IDOS + 0
010004aa 00001e06 R_PPC_ADDR16_HA 010100ec DOSBase + 0
010004b2 00001404 R_PPC_ADDR16_LO 010100d8 __stdiowin + 0
010004be 00002304 R_PPC_ADDR16_LO 01000740 main + 0
010004c2 00002804 R_PPC_ADDR16_LO 010100e4 IDOS + 0
010004ca 00001e04 R_PPC_ADDR16_LO 010100ec DOSBase + 0
01000506 00001b04 R_PPC_ADDR16_LO 010100f8 IUtility + 0
010005be 00001b04 R_PPC_ADDR16_LO 010100f8 IUtility + 0
010005da 00000906 R_PPC_ADDR16_HA 01002000 .rodata + 28
010005e2 00000904 R_PPC_ADDR16_LO 01002000 .rodata + 28
0100062a 00000c06 R_PPC_ADDR16_HA 01010008 .dtors + 0
0100062e 00000b06 R_PPC_ADDR16_HA 01010000 .ctors + 0
01000636 00000c04 R_PPC_ADDR16_LO 01010008 .dtors + 0
0100063a 00000b04 R_PPC_ADDR16_LO 01010000 .ctors + 0
01000646 00001e06 R_PPC_ADDR16_HA 010100ec DOSBase + 0
0100064e 00002806 R_PPC_ADDR16_HA 010100e4 IDOS + 0
01000652 00001406 R_PPC_ADDR16_HA 010100d8 __stdiowin + 0
0100065a 00002306 R_PPC_ADDR16_HA 01000740 main + 0
01000666 00001e04 R_PPC_ADDR16_LO 010100ec DOSBase + 0
0100066a 00002304 R_PPC_ADDR16_LO 01000740 main + 0
0100066e 00002804 R_PPC_ADDR16_LO 010100e4 IDOS + 0
01000682 00001404 R_PPC_ADDR16_LO 010100d8 __stdiowin + 0
010006c2 00001b06 R_PPC_ADDR16_HA 010100f8 IUtility + 0
010006c6 00001b04 R_PPC_ADDR16_LO 010100f8 IUtility + 0
010006fe 00001b06 R_PPC_ADDR16_HA 010100f8 IUtility + 0
01000702 00001b04 R_PPC_ADDR16_LO 010100f8 IUtility + 0
01000754 0000170a R_PPC_REL24 01001050 hello + 0
0100075a 00000906 R_PPC_ADDR16_HA 01002000 .rodata + 34
0100075e 00000904 R_PPC_ADDR16_LO 01002000 .rodata + 34
01000762 00001a06 R_PPC_ADDR16_HA 01001058 world + 0
01000766 00001a04 R_PPC_ADDR16_LO 01001058 world + 0
0100076c 0000150a R_PPC_REL24 01001048 printf + 0


But as we can see the second and third last relocation are just the relocation needed for the main method
to get the address of the world method and not as i thought the PLT stub function.
You can verify that the relocation addresse the same instruction in the main method, with an objdump -d app_dyn.

As a conclusion, i don't think that it is an bug in the compiler. I think that it is a bug in the
OS and how dynamic linkage of so files is implemented. I couldn't find ayn deeper information
how dynamic so linking in AmigaOS 4 is realized, os it my conclusion is just a vague hint that
the cause lies in the OS. But maybe someone more involved in the OS part can pick that and investigate
it further,

Go to top

  Register To Post
« 1 ... 6 7 8 (9) 10 11 12 ... 20 »

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project