diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 2 | ||||
-rw-r--r-- | src/linker.rs | 4 | ||||
-rw-r--r-- | src/main.rs | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..e11d058 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,2 @@ +mod elf; +pub mod linker; diff --git a/src/linker.rs b/src/linker.rs index 8065abd..b1ee0a8 100644 --- a/src/linker.rs +++ b/src/linker.rs @@ -13,7 +13,7 @@ Position-independent code is NOT supported, and makes executables larger anyways. Make sure you compile with `-fno-pic` or equivalent. Example usage: -``` +```ignore let mut linker = Linker::new(); linker.add_input("main.o")?; linker.add_input("libc.so.6")?; @@ -50,7 +50,7 @@ This ensures that all destructors are called for local objects in main. - If you want a small executable, it's best not to use the STL. - For some reason, `std::cout` and `std::cin` don't work. If you can figure out why, please let me know. You can get around this with something like -``` +```cpp std::ofstream cout("/dev/stdout"); std::ifstream cin("/dev/stdin"); ``` diff --git a/src/main.rs b/src/main.rs index 775138a..926b1e4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,5 @@ /* @TODO: -- automated tests - what happens when a symbol has two definitions? can this happen with multiple c++ files which use the same template? - disable "warning: relocation XXX not in a data/text section" for .rel.eh_frame + maybe others - these warnings are being generated in two places. do they need to be? @@ -16,8 +15,7 @@ use clap::Parser; #[cfg(target_endian = "big")] compile_error! {"WHY do you have a big endian machine???? it's the 21st century, buddy. this program won't work fuck you"} -mod elf; -pub mod linker; +use tinyld::linker; #[derive(Parser, Debug)] struct Args { |