Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lesson 17 error #18

Closed
Skeevert opened this issue Jul 3, 2019 · 7 comments
Closed

Lesson 17 error #18

Skeevert opened this issue Jul 3, 2019 · 7 comments

Comments

@Skeevert
Copy link

Skeevert commented Jul 3, 2019

Trying to compile lesson 17 "namespace" results in error: symbol 'finished' redefined

@DGivney
Copy link
Owner

DGivney commented Jul 5, 2019

Hi Skeevert

What platform/software versions are you using?

I'm not getting any errors on:
Ubuntu 16.04
Nasm 2.11.08
GNU ld 2.26.1

@DGivney
Copy link
Owner

DGivney commented Jul 5, 2019

I can replicate the error if you remove the fullstop off one of the ".finished" labels on either line 23 or 34?

@Skeevert
Copy link
Author

Skeevert commented Jul 5, 2019

Hi. I'm using Debian 9.9 32-bit and NASM 2.12.01. I also tried copying functions.asm and namespace.asm into online compiler, which led to the same error. Yes, removing fullstop also leads to redefinition error for other finished labels

@DGivney
Copy link
Owner

DGivney commented Jul 5, 2019

Hi Skeevert,

I think you might be using a version of functions.asm which has a global "finished:" label in it.

This file got refactored, you can see the line difference between lesson 15 & lesson 17 (slen function);
https://github.com/DGivney/assemblytutorials/blob/master/code/lesson15/functions.asm#L65
https://github.com/DGivney/assemblytutorials/blob/master/code/lesson17/functions.asm#L102

If you put this code from lesson 17 (cut & pasted functions.asm + namespace.asm):
https://pastebin.com/xHAtRZ8e

Into this online nasm compiler:
https://www.jdoodle.com/compile-assembler-nasm-online

You'll see the correct output.

Can you link to a paste of the code you're trying to execute please?

@DGivney
Copy link
Owner

DGivney commented Jul 5, 2019

If that's the case I think I might do one of 2 things;

  1. Add a note on Lesson17 warning people that labels in functions.asm gets updated to use local namespace.
  2. Use local namespace labels in functions.asm from the beginning.

@Skeevert
Copy link
Author

Skeevert commented Jul 5, 2019

Ah, I see. Thanks! I really had a global label "finished" in functions.asm

@DGivney
Copy link
Owner

DGivney commented Jul 5, 2019

Perfect, thanks for contacting me.

I'll update the tutorial later this weekend to make that more clear.

@DGivney DGivney closed this as completed Jul 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants