Dear Community, > On Thu, 9 Sep 2021 11:49:36 +0200 > Lukasz Majewski wrote: > > > On Thu, 9 Sep 2021 09:18:06 +0200 > > Lukasz Majewski wrote: > > > > > On Wed, 8 Sep 2021 22:34:21 +0200 > > > Lukasz Majewski wrote: > > > > > > > Hi Adhemerval, > > > > > > > > > On 08/09/2021 12:05, Lukasz Majewski wrote: > > > > > > > > > > > > The r1 gets the 0xffffee80 (negative offset) value. It is > > > > > > then added to pc and used to calculate r2. > > > > > > > > > > > > For working code (with this patch applied) - there are NO > > > > > > such large values (like aforementioned 0xffffee80). The > > > > > > arithmetic is done on > > > > > > > > > > > > 1690: 00000020 .word 0x00000020 > > > > > > 1694: 0002be7e .word 0x0002be7e > > > > > > > > > > > > which seems to work. > > > > > > > > > > > > This shouldn't be a problem as with U2 the arithmetic shall > > > > > > work. However, I've noticed (with passing LD_DEBUG=all) that > > > > > > the ld-linux-armhf.so.3 (and init) are relocated twice > > > > > > before execution. > > > > > > > > > > > > Why do we need to relocate it? > > > > > > > > > > > > Another question is why on this particular case the large > > > > > > (i.e. negative) offset matters? > > > > > > > > > > I think it is highly unlikely the negative offset plays any > > > > > role here. Do you have a working example to trigger this > > > > > issue? > > > > > > > > I'm just using QEMU (runqemu -d y2038-image-devel nographic) > > > > from meta-y2038 build. > > > > > > > > Recent versions: > > > > poky: SHA1: 1e2e9a84d6dd81d7f6dd69c0d119d0149d10ade1 > > > > qemu_6.0.0 > > > > binutils_2.37 > > > > gcc_11.2 > > > > > > > > The QEMU board uses Cortex-A9 core. > > > > > > I've updated the poky to be the newest -master: > > > master:50293eec9a7d0602b748220ab100b070b8d3432a > > > > > > No change. > > > > > > I will try the same setup with Cortex-A5 core - maybe there is > > > some kind of subtle handling of such emulation in qemu? > > > > No change. On the qemuarm yocto/OE MACHINE the same situation is > > observed. > > > > Do you have any more ideas where to look for solution of this problem? Can we make a decision regarding this fix? The only finding, which I get, is the large negative offset added to the pc in the glibc broken (current master) code, which causes QEMU system to fail. I've shared this problem with the QEMU community [1], but no reply received till today. Shall we: 1. Apply this patch or 2. Revert the conversion (whole) patch [2] for ARM. 3. Wait till QEMU response for the problem? Links: [1] - https://lists.nongnu.org/archive/html/qemu-devel/2021-09/msg03332.html [2] - SHA1: bca0f5cbc9257c13322b99e55235c4f21ba0bd82 > > > After applying this patch the board works without issues. > > > > > > > > > > > > > > I am currently > > > > > testing arm for different compilers (gcc 6.2, gcc 10, gcc 11) > > > > > and with different configurations (armv5, armv6, armv7, with > > > > > and without thumb) and I haven't see any issue so far. > > > > > > > > > > It might binutils related, which version are you using? > > > > > > > > > > > > > > > > > > > > > > > > > Best regards, > > > > > > > > Lukasz Majewski > > > > > > > > -- > > > > > > > > DENX Software Engineering GmbH, Managing Director: Wolfgang > > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 > > > > Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: > > > > (+49)-8142-66989-80 Email: lukma@denx.de > > > > > > > > > > > > > > > Best regards, > > > > > > Lukasz Majewski > > > > > > -- > > > > > > DENX Software Engineering GmbH, Managing Director: Wolfgang > > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, > > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: > > > lukma@denx.de > > > > > > > > > > Best regards, > > > > Lukasz Majewski > > > > -- > > > > DENX Software Engineering GmbH, Managing Director: Wolfgang > > Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, > > Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: > > lukma@denx.de > > > > > Best regards, > > Lukasz Majewski > > -- > > DENX Software Engineering GmbH, Managing Director: Wolfgang Denk > HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany > Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: > lukma@denx.de Best regards, Lukasz Majewski -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de