; Build/run from examples/shared-libs/: ; make ; make run ; ; make run prints, in order: ; 43 ; 43 ; 42 ; 42 ; 41 ; ; ABI-v2 startup-dynamic executable example. ; main-program itself defines foo(), but cpu-ld --dynamic retains CALL foo as ; a preemptible runtime relocation. cpu-run --ldpreload can therefore replace ; it before _start executes. ; ; Without preload: foo adds 1 -> result 41. ; With dynamic-liba.so: foo adds 2 -> result 42. ; With dynamic-liba.so:dynamic-libb.so: rightmost strong GLOBAL wins, so ; dynamic-libb.so foo adds 3 -> result 43. .global _life .global foo .text _start_life: LDI r64@0x00000, 40 CALL foo MOV r64@0x00018, r64@0x00000 LDI r32@0x00030, 0 EXIT r32@0x00030 foo: LDI r64@0x00008, 1 IADD r64@0x00000, r64@0x00000, r64@0x00008 RET