Standard escape codes are prefixed with Escape
:
- Ctrl-Key:
^[
- Octal:
\033
- Unicode:
\u001b
- Hexadecimal:
\x1B
- Decimal:
27
#!/bin/sh -x | |
CC=clang-9 | |
rm -f *.o wrap nowrap | |
# build without wrapping | |
$CC -c wrap.c -o wrap.o | |
$CC -c wrap_b.c -o wrap_b.o | |
$CC wrap.o wrap_b.o -o nowrap |
#include <errno.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/ptrace.h> | |
#include <sys/types.h> | |
#include <unistd.h> | |
struct elf { |
http://llvm.org/docs/ProgrammersManual.html#the-llvm-debug-macro-and-debug-option https://clang.llvm.org/docs/UsersManual.html#controlling-size-of-debug-information
-fno-discard-value-names
-g0
Don’t generate any debug info (default).
-gline-tables-only
These are some notes from reading Ian Lance Taylor's 20-part essay on linkers. Prettified version on gist.io.
I'm not going to describe the basics of what a linker does because I know already. I talk a little about linkers in How to call Rust from assembly, and I found this Beginner's guide to linkers pretty helpful. Parts [1] and [2] of the essay also discuss "what's a linker?".
//https://twitter.com/fermatslibrary/status/937687947041701888 | |
use std::{thread, time}; | |
use std::sync::{Arc, Barrier}; | |
fn main() { | |
let elements = vec![9,8,7,6,5,4,3,2,1,0]; | |
sleep_sort(elements); | |
} | |
fn sleep_sort(dataset: Vec<i32>) { |