I finally managed to solve it.

It seems that the project was using the wrong version of sdl.pas (the one stored in the lazarus directories). Still not sure why that caused the "Undefined symbol" errors.

@Grudzio: Your explanation seems plausible. I'll keep it in mind for when I encouter the COFF magic error again.