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 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