Hi mist,
Welcome to the Forum.
Thanks for sharing the solution with us!
Before I saw that you'd posted the solution I beat on it a bit myself... or it beat on me...
First, typo in your c file: "asmfunc())" has an extra ")". Easily fixed.
Next, a puzzle. My gcc didn't like "int64_t". I think that should be fine. I changed it to just "int" to shut gcc up, but I think it should be fine. Dunno what my problem was there.
I spotted the "edi" instead of "rdi" but didn't change it.
Worked for me!
I was going to suggest "rel". You can put "default rel" in your file to change 'em all. I don't know why it worked for me without it. I don't know why your gcc apparently thought you were trying to make a shared object. I have a lot to learn about 64-bit code!
Anyway, glad you got it working!
Best,
Frank