diff --git a/README.md b/README.md index bbbf366..6ab48c8 100644 --- a/README.md +++ b/README.md @@ -177,11 +177,17 @@ Create the `helloworld.md` file that will generate that precise GitHub view. Make sure you do the following: 1. Start by creating a branch where you do your work. + Use `helloworld` for the branch name: + + ```console + git checkout -b helloworld + ``` + This will be the branch **from** where you will create a pull request. As usual, the future pull request will target your assigned branch in the [upstream repository](https://github.com/rosedu/workshop-markdown). 1. Copy-paste contents from the PDF file. - Do not write programs by hand. + Open the `helloworld-print.pdf` file in a PDF viewer, select text, copy in the `helloworld.md` file. 1. Use correct syntax items for typewriter format, links to sections, code snippet format, tables. See [the GitHub Markdown spec](https://github.github.com/gfm/). @@ -195,21 +201,18 @@ Make sure you do the following: After each push, check the GitHub view of the work branch in your fork of the GitHub repository. -1. After completing the task, submit the `helloworld.md` Markdown file as part of a pull request. - -Follow the instructions above to create the pull request. -Make sure you have good commit messages and a good pull request description. + Check the contents of the `helloworld.md` file on your GitHub fork and see if it is now rendered correctly. -Target the pull request **to** your assigned branch. +1. After completing the task, submit the `helloworld.md` Markdown file as part of a pull request. -Ask the instructors to review your pull request. -Make updates as required. -Have your pull request approved and merged on top of your assigned branch. + Follow the instructions above to create the pull request. + Make sure you have good commit messages and a good pull request description. -Check the GitHub web view of the [upstream repository](https://github.com/rosedu/workshop-markdown) for your assigned branch. -Click on the button with `main` (the branch button) and select your branch. + Target the pull request **to** your assigned branch. -Check the contents of the `helloworld.md` file and see if it is now rendered correctly. +1. Ask the instructors to review your pull request. + Make updates as required. + Have your pull request approved and merged on top of your assigned branch. ### Clean Up After Pull Request diff --git a/dynamic-linking.ro.md b/dynamic-linking.ro.md index 3630d63..75a102e 100644 --- a/dynamic-linking.ro.md +++ b/dynamic-linking.ro.md @@ -1,7 +1,7 @@ # Linkare dinamică Linkarea dinamică înseamnă că în executabil nu sunt incluse componentele folosite din bibliotecă. -Acestea vor fi incluse mai târziu, la încărcare (*load time*) sau chiar la rulare (*runtime). +Acestea vor fi incluse mai târziu, la încărcare (*load time*) sau chiar la rulare (*runtime*). În urma linkării dinamice, executabilul reține referințe la bibliotecile folosite și la simbolurile folosite din cadrul acestora. Aceste referințe sunt similare unor simboluri nedefinite. Rezolvarea acestor simboluri are loc mai târziu, prin folosirea unui loader / linker dinamic. @@ -13,7 +13,7 @@ Diferența este că acum, folosim linkare dinamică în loc de linkare statică Pentru aceasta, am renunțat la argumentul `-static` folosit la linkare. Pentru acest exemplu, obținem un singur executabil `main`, din legarea statică cu biblioteca `libinc.a` și legarea dinamică cu biblioteca standard C. -Similar exemplului din directorul `05-static/, folosim comanda `make` pentru a obține executabilul `main`: +Similar exemplului din directorul `05-static/`, folosim comanda `make` pentru a obține executabilul `main`: ```console [..]/06-dynamic$ ls @@ -39,7 +39,7 @@ main: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically link [..]/06-dynamic$ file ../05-static/main ../05-static/main: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, for GNU/Linux 3.2.0, BuildID[sha1]=60adf8390374c898998c0b713a8b1ea0c255af38, not stripped -`` +``` Fișierul executabil `main` obținut prin linkare dinamică are un comportament identic fișierului executabil `main` obținut prin linkare statică. Observăm că dimensiunea sa este mult mai redusă: ocupă `7 KB` comparativ cu `600 KB` cât avea varianta sa statică. @@ -66,7 +66,7 @@ Investigăm simbolurile executabilului: Simbolurile obținute din modulul obiect `main.o` și din biblioteca statică `libinc.o` sunt rezolvate și au adrese stabilite. Observăm că folosirea bibliotecii standard C a dus la existența simboblului `_start`, care este entry pointul programului. -Dar, simbolurile din biblioteca standard C, (`printf`, __libc_start_main`) sunt marcate ca nedefinite (`U`). +Dar, simbolurile din biblioteca standard C, (`printf`,` __libc_start_main`) sunt marcate ca nedefinite (`U`). Aceste simboluri nu sunt prezente în executabil: rezolvarea, stabilirea adreselor și relocarea lor se va realiza mai târziu, la încărcare (load time). La încărcare, o altă componentă software a sistemului, loaderul / linkerul dinamic, se va ocupa de: @@ -77,7 +77,7 @@ La încărcare, o altă componentă software a sistemului, loaderul / linkerul d Putem investiga bibliotecile dinamice folosite de un executabil prin intermediul utilitarului `ldd`: -``console +```console [..]/06-dynamic$ ldd main linux-gate.so.1 (0xf7f97000) libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7d8a000) @@ -186,4 +186,4 @@ num_items: 1 Variabila de mediu `LD_LIBRARY_PATH` pentru loader este echivalentul opțiunii `-L` în comanda de linkare: precizează directoarele în care să fie căutate biblioteci pentru a fi încărcate, respectiv linkate. Folosirea variabilei de mediu `LD_LIBRARY_PATH` este recomandată pentru teste. -Pentru o folosire robustă, există alte mijloace de precizare a căilor de căutare a bibliotecilor partajate, documentate în (pagina de manual a loaderului / linkerului dinamic)(https://man7.org/linux/man-pages/man8/ld.so.8.html#DESCRIPTION). +Pentru o folosire robustă, există alte mijloace de precizare a căilor de căutare a bibliotecilor partajate, documentate în [pagina de manual a loaderului / linkerului dinamic](https://man7.org/linux/man-pages/man8/ld.so.8.html#DESCRIPTION). diff --git a/helloworld.md b/helloworld.md new file mode 100644 index 0000000..4158fe1 --- /dev/null +++ b/helloworld.md @@ -0,0 +1,57 @@ +# Helloworld Programs + +![pozahello](/helloworld.png) + +We list below Helloworld programs for different programming languages, i.e. programs that print "Hello, World!". Thespecified compiler or interpreter is required for each programming languages. + +The table below summarizes the programs: + +| Language | Language (Spec) Site | Section | Build / Run Toolchain | Debian / Ubuntu Packages | +| :--------|:--------------------:|:-------:|:---------------------:|-------------------------:| +| C | [The Standard - C](https://www.iso-9899.info/wiki/The_Standard)|[C](https://www.admiterepoli.com)|GCC|`build-essential`| +| C++| [The Standard - C++](https://isocpp.org/std/the-standard)|[C++](https://www.admiterepoli.com)|GCC/G+|`build-essential, g++`| +| Python | [Welcome to python.org](https://www.python.org/)| [Python](https://www.python.org/downloads/)|Python|`Python`| + +# C +```C +#include + +int main(void){ + + puts("Hello, World!"); + + return 0; +} +``` +### Build With: +`gcc -Wall -o helloworld helloworld.c` + +### Run With: + +`./helloworld` + +# C++ +```C++ +#include + +int main(){ + + std::cout << "Hello, World!" << std::endl; + + return 0; +} +``` + +### Build With: +`g++ -Wall -o helloworld helloworld.cpp` + +### Run With: +`g++ -Wall -o helloworld helloworld.cpp` + +# Python +```Python +print("Hello, World!") +``` + +### Run With: +`python helloworld.py` \ No newline at end of file