From 0cfe20da406ff1f600610518fdcf93e1eda2d7ad Mon Sep 17 00:00:00 2001 From: Gabriel Marfon Date: Sat, 27 Jun 2026 12:17:51 +0300 Subject: [PATCH 1/2] Correcting the errors in dynamic-linking.ro.md Signed-off-by: Gabriel Marfon --- dynamic-linking.ro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dynamic-linking.ro.md b/dynamic-linking.ro.md index 3630d63..a090913 100644 --- a/dynamic-linking.ro.md +++ b/dynamic-linking.ro.md @@ -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) From cc382df90ea9b73810b33f20eee8ece44819c01f Mon Sep 17 00:00:00 2001 From: Gabriel Marfon Date: Mon, 29 Jun 2026 18:49:55 +0300 Subject: [PATCH 2/2] Create helloword.md and format it Signed-off-by: Gabriel Marfon --- helloworld.md | 237 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) create mode 100644 helloworld.md diff --git a/helloworld.md b/helloworld.md new file mode 100644 index 0000000..25fad00 --- /dev/null +++ b/helloworld.md @@ -0,0 +1,237 @@ +Helloworld Programs Hello, World! ![Hello World](helloworld.png) +We list below Helloworld programs for different programming languages, i.e. programs that print "Hello, World!". The specified 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 | C | GCC | build-essential +C++ | The Standard - C++ | C++ | GCC/G++ | build-essential, g++ +Dlang | D Programming Language: Home | Dlang | GCC/GDC | build-essential, gdc +Go | The Go Programming Language | Go | Go | golang +Rust | Rust Programming Language | Rust | Rust (Crate) | rust lang +Java | Java Programming Language | Java | JDK | openjdk-17-jdk +x86_64 assembly | x86 and amd64 instruction reference | x86_64 Assembly | GCC/GAS | build-essential +ARM64 assembly | Arm A64 Instruction Set Architecture | ARM64 Assembly | GCC/GAS (AArch64) | build-essential +Bash | Bash Reference Manual | Bash | Bash | bash +Python | Welcome to Python.org | Python | Python | python +Ruby | Ruby Programming Language | Ruby | Ruby | ruby +PHP | PHP: Hypertext Preprocessor | PHP | PHP | php +Perl | The Perl Programming Language | Perl | Perl | perl +Lua | The Programming Language Lua | Lua | Lua | lua C #include int main(void) { puts("Hello, World!"); return 0; } Build with: gcc -Wall -o helloworld helloworld.c Run with: ./helloworld C++ #include int main() { +std::cout << "Hello, World!" << std::endl; return 0; } Build with: g++ -Wall -o helloworld helloworld.cpp Run with: ./helloworld Dlang import std.stdio; void main() { writeln("Hello, World!"); } Build with: gdc -Wall -o helloworld helloworld.cpp Run with: ./helloworld Go package main import "fmt" func main() { fmt.Println("Hello, World!") } Build and run with: go run helloworld.go Rust fn main() { +println! ("Hello, World"); } Build with: rustc hello.rs Run with: ./helloworld Java public class Helloworld { public static void main(String[] args) { System.out.println("Hello, World!"); } } Build with: javac Helloworld.java Run with: java Helloworld x86_64 Assembly TODO Build with: TODO Run with: ./helloworld ARM64 Assembly TODO Build with: TODO Run with: ./helloworld Bash echo "Hello, World!" Run with: bash helloworld.sh Python print("Hello, World!") Run with: python helloworld.py Ruby puts "Hello, World!" Run with: ruby helloworld.rb PHP Run with: ./helloworld Perl print("Hello, World!\n") Run with: perl helloworld.pl Lua print("Hello, World!") Run with: lua helloworld.lua +# Helloworld Programs + +![Hello, World!](helloworld.png) + +We list below Helloworld programs for different programming languages, i.e. programs that print "Hello, World!". The specified 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 | [C](#c) | GCC | `build-essential` | +| C++ | The Standard - C++ | [C++](#c-1) | GCC/G++ | `build-essential`, `g++` | +| Dlang | D Programming Language: Home | [Dlang](#dlang) | GCC/GDC | `build-essential`, `gdc` | +| Go | The Go Programming Language | [Go](#go) | Go | `golang` | +| Rust | Rust Programming Language | [Rust](#rust) | Rust (Crate) | `rust lang` | +| Java | Java Programming Language | [Java](#java) | JDK | `openjdk-17-jdk` | +| x86_64 assembly | x86 and amd64 instruction reference | [x86_64 Assembly](#x86_64-assembly) | GCC/GAS | `build-essential` | +| ARM64 assembly | Arm A64 Instruction Set Architecture | [ARM64 Assembly](#arm64-assembly) | GCC/GAS (AArch64) | `build-essential` | +| Bash | Bash Reference Manual | [Bash](#bash) | Bash | `bash` | +| Python | Welcome to Python.org | [Python](#python) | Python | `python` | +| Ruby | Ruby Programming Language | [Ruby](#ruby) | Ruby | `ruby` | +| PHP | PHP: Hypertext Preprocessor | [PHP](#php) | PHP | `php` | +| Perl | The Perl Programming Language | [Perl](#perl) | Perl | `perl` | +| Lua | The Programming Language Lua | [Lua](#lua) | Lua | `lua` | + +## C + +```c +#include +int main(void) { + puts("Hello, World!"); + return 0; +} +``` +Build with: +```bash +gcc -Wall -o helloworld helloworld.c +``` +Run with: +```bash +./helloworld +``` + +## C++ + +```cpp +#include +int main() +{ + std::cout << "Hello, World!" << std::endl; + return 0; +} +``` +Build with: +```bash +g++ -Wall -o helloworld helloworld.cpp +``` +Run with: +```bash +./helloworld +``` + +## Dlang + +```d +import std.stdio; +void main() +{ + writeln("Hello, World!"); +} +``` +Build with: +```bash +gdc -Wall -o helloworld helloworld.cpp +``` +Run with: +```bash +./helloworld +``` + +## Go + +```go +package main +import "fmt" +func main() { + fmt.Println("Hello, World!") +} +``` +Build and run with: +```bash +go run helloworld.go +``` + +## Rust + +```rust +fn main() { + println! ("Hello, World"); +} +``` +Build with: +```bash +rustc hello.rs +``` +Run with: +```bash +./helloworld +``` + +## Java + +```java +public class Helloworld { + public static void main(String[] args) { + System.out.println("Hello, World!"); + } +} +``` +Build with: +```bash +javac Helloworld.java +``` +Run with: +```bash +java Helloworld +``` + +## x86_64 Assembly + +```assembly +TODO +``` +Build with: +```bash +TODO +``` +Run with: +```bash +./helloworld +``` + +## ARM64 Assembly + +```assembly +TODO +``` +Build with: +```bash +TODO +``` +Run with: +```bash +./helloworld +``` + +## Bash + +```bash +echo "Hello, World!" +``` +Run with: +```bash +bash helloworld.sh +``` + +## Python + +```python +print("Hello, World!") +``` +Run with: +```bash +python helloworld.py +``` + +## Ruby + +```ruby +puts "Hello, World!" +``` +Run with: +```bash +ruby helloworld.rb +``` + +## PHP + +```php + +``` +Run with: +```bash +./helloworld +``` + +## Perl + +```perl +print("Hello, World!\n") +``` +Run with: +```bash +perl helloworld.pl +``` + +## Lua + +```lua +print("Hello, World!") +``` +Run with: +```bash +lua helloworld.lua +```