-
Notifications
You must be signed in to change notification settings - Fork 117
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
Unused option in file copy #2182
Comments
Nice find! I remember there was at one time a need for this, let me take a look to see what that might have been for. There was a time when we used zero-length '.keep' files in elks/target during the image creation process, but that was moved to image/Makefile handling. |
Yes, it looks like it's getting propagated
|
Thanks for digging that up, I remember what happened now - the code was originally written for Then,
That code isn't shared, so making the option static didn't change anything with
Interestingly enough, I checked the generated code output from the compilation of cp.c (using I highly suspect that after you declared the variable static the code was silently deleted by ia16-elf-gcc; this can be checked by running ia16-elf-objdump as above and searching the output for opt_nozerocopy: it will not exist, is my bet, meaning it was eliminated with the dead code elimination pass. The reason this doesn't happen when non-static is the compiler saw a global variable, and can't be sure that another function outside the current compilation unit didn't change that global, so it has to generate code for it. Only the linker knows what is finally included, and our linker doesn't do dead code elimination within .o modules specified in the command line. Thanks for your investigation. You're welcome to submit a PR to clean this up by deleting the unused code and global if you desire. |
thanks, let me check a bit more. |
Correct. The only way I could have the compiler keep the static-made opt_nocopyzero in the |
Fixed by #2187. |
elks/elkscmd/file_utils/cp.c
Line 30 in e9e445d
The option is evaluated but never set. Might either implement the option or delete the code.
The text was updated successfully, but these errors were encountered: