-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e30fae
commit 7ffd450
Showing
2 changed files
with
19 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
// This program is used to demonstrate the fact that binaries have | ||
// metadata stored in them that tells the linker which dynamic libraries | ||
// they need in order to run. | ||
#include <stdio.h> | ||
|
||
int main(int argc, char** argv) { | ||
printf("Hello from %s!\n", argv[0]); | ||
return 0; | ||
// We have to make printf do something non-trivial here, or the | ||
// compiler will simplify it to "puts" instead. That would just | ||
// make th example more confusing. So we have it print something | ||
// that will always be available: the name of the running | ||
// program. | ||
printf("Hello from %s!\n", argv[0]); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters