/* gpu_v2_ptr_bad.c - v2 that moves the pointer to the FRONT of the struct
 * and keeps the v1 SONAME. Same size (16 bytes), so nothing overflows --
 * the only thing that changed is where the pointer lives.
 *
 * Build: gcc -shared -fPIC -Wl,-soname,libgpuptr.so.1 -o libgpuptr.so.1.1.0 gpu_v2_ptr_bad.c
 * Then:  ln -sf libgpuptr.so.1.1.0 libgpuptr.so.1
 *
 * Layout (x86-64):
 *   offset 0 : char* name         <- was gpu_id + temperature in v1
 *   offset 8 : int   gpu_id       <- v1 reads this as its char* name
 *   offset 12: int   temperature
 *   total size: 16
 */

struct gpu_info {
    const char *name;
    int gpu_id;
    int temperature;
};

void gpu_info_get(struct gpu_info *info) {
    info->name = "Tesla T4";
    info->gpu_id = 42;
    info->temperature = 99;
}
