ELF Hello World Tutorial
Ciro Santilli 37 Updated 2025-07-01 +Created 1970-01-01
.rela.text
by Section type:
sh_type == SHT_RELA
.Common name: "relocation section".
.rela.text
holds relocation data which says how the address should be modified when the final executable is linked. This points to bytes of the text area that must be modified when linking happens to point to the correct memory locations.Basically, it translates the object text containing the placeholder 0x0 address:to the actual executable code containing the final 0x6000d8:
a: 48 be 00 00 00 00 00 movabs $0x0,%rsi
11: 00 00 00
4000ba: 48 be d8 00 60 00 00 movabs $0x6000d8,%rsi
4000c1: 00 00 00
It was pointed to by
sh_info
= 6
of the .symtab
section.readelf -r hello_world.o
outputs:Relocation section '.rela.text' at offset 0x3b0 contains 1 entries:
Offset Info Type Sym. Value Sym. Name + Addend
00000000000c 000200000001 R_X86_64_64 0000000000000000 .data + 0
The section does not exist in the executable.
The actual bytes are:
00000370 0c 00 00 00 00 00 00 00 01 00 00 00 02 00 00 00 |................|
00000380 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
The
struct
represented is:typedef struct {
Elf64_Addr r_offset;
Elf64_Xword r_info;
Elf64_Sxword r_addend;
} Elf64_Rela;
So:
- 370 0:
r_offset
= 0xC: address into the.text
whose address this relocation will modify - 370 8:
r_info
= 0x200000001. Contains 2 fields:ELF64_R_TYPE
= 0x1: meaning depends on the exact architecture.ELF64_R_SYM
= 0x2: index of the section to which the address points, so.data
which is at index 2.
The AMD64 ABI says that type1
is calledR_X86_64_64
and that it represents the operationS + A
where:This address is added to the section on which the relocation operates. - 380 0:
r_addend
= 0
ELF Hello World Tutorial Implementations by
Ciro Santilli 37 Updated 2025-07-01 +Created 1970-01-01
- Compiler toolchains generate and read ELF files.
- Operating systems read and run ELF files.
- Specialized libraries. Examples:
E. Coli Whole Cell Model by Covert Lab Other run variants by
Ciro Santilli 37 Updated 2025-07-01 +Created 1970-01-01
Besides time series run variants, conditions can also be selected directly without a time series as in:which select row indices from so
python runscripts/manual/runSim.py --variant condition 1 1
reconstruction/ecoli/flat/condition/condition_defs.tsv
. The above 1 1
would mean the second line of that file which starts with:"condition" "nutrients" "genotype perturbations" "doubling time (units.min)" "active TFs"
"basal" "minimal" {} 44.0 []
"no_oxygen" "minimal_minus_oxygen" {} 100.0 []
"with_aa" "minimal_plus_amino_acids" {} 25.0 ["CPLX-125", "MONOMER0-162", "CPLX0-7671", "CPLX0-228", "MONOMER0-155"]
1
means no_oxygen
. Mathematical, Physical and Life Sciences division of the University of Oxford by
Ciro Santilli 37 Updated 2025-07-01 +Created 1970-01-01
merlijn.sebrechts.be/blog/2020-08-02-why-one-snap-store/ has some very good comments on how
snap
is more closed than Flatpak. Cool data embedded in the Bitcoin blockchain cryptograffiti.info by
Ciro Santilli 37 Updated 2025-07-01 +Created 1970-01-01
twitter.com/cryptograffiti (marked as joined March 2014)
At some point it stopped using Bitcoin mainline and moved to Bitcoin Cash instead: www.newsbtc.com/news/bitcoin/cryptograffiti-rejects-bitcoin-core-bch-now-available-payment-method/ and therefore became useless. Existing indexes seem to have been broken as well.
Also, based on the timing of Figure "Erich Erstu", this service may be responsible for a large part of the raw JPEG images present in the blockchain from block 416527 (2016) onwards. This is also suggested by the comments at Figure "Tank Man".
A Quantitative Analysis of the Impact of Arbitrary Blockchain Content on Bitcoin gives the interesting insight that all its transactions seem to return change/fees to one or two given addresses, thus making it very easy to list all their uploads if they were consistent! So all we need are some starting points, which we have mostly due to ASCII mentions of the site on known inscriptions, all of which have a few common spent addresses at the very end:so we just have to solve get all Bitcoin transactions from and to a given address and we are done. Blockchair shows about 800 entries as of February 2024, between 4f94f97eb156b8563a213bb292314a0bd9c95b39afc521fc5965d050daab2a78 (2014-03-02) and ac5f4ea03597b43a72fb8ab42bd5384629f87f4f4abc534f38b8c15148ccaf9f (2017-10-12): blockchair.com/bitcoin/outputs?s=time(desc)&q=recipient(1MVpQJA7FtcDrwKC6zATkZvZcxqma4JixS)
- 4c903a377addab7c1e35a685d3dabc664199e406374b1e5ce2fc59e78fb5b754: 1MVpQJA7FtcDrwKC6zATkZvZcxqma4JixS
- 87aad85c6cd75a516789f364637d243c668e3424d031ae510e43c6edfe6ed206: 1MVpQJA7FtcDrwKC6zATkZvZcxqma4JixS
- c206e8fff656f07b27dac831ef9b956792bae4e76a2cb43f14f49f0298bf2c2f: 1MVpQJA7FtcDrwKC6zATkZvZcxqma4JixS
- ca4f11131eca6b4d61daf707a470cfccd1ef3d80a6f8b70f1f07616b451ca64e: 1MVpQJA7FtcDrwKC6zATkZvZcxqma4JixS
Other related transactions:
- tx 87aad85c6cd75a516789f364637d243c668e3424d031ae510e43c6edfe6ed206 block 474652 (2017-07-07) via cryptograffiti.info the default pandoc markdown pandoc.org/try markdown tutorial string! First, unseen in our ASCII dumps due to UTF-8 encoding::followed by:
Unicode test: `Ä Ö Õ Ü ä ö õ ü`.
And if ends with:An h1 header ============ Paragraphs are separated by a blank line.
Uploaded from http://cryptograffiti.info to demonstrate Markdown rendering.
TODO understand what these are:
- ae92dc4c31943955ad6e3e45a4eb0067f488fdd9aecca65c946460dd2a85488d
- 3020dbd7c850bf8c19ebacf670a2830fe50999a8b2560a202af21d536760eea4
- d65384a21cb1c327cc42416a0b1e2a78ad0296cb7a15312bdcd67ef169ecb309
- a3e3100d2b9a86e310430945c001df97a70626220a9e151208aecbb613f1f152
- a9c82ebc47fabd1eed7eeea7760d0a3c99288af3c3a17e396ec790fc280698a2
- 92bfd5c0fb0f24efa6ca568c4475f44e94dfc8d0d4d5da04dfafc6261bf17f45
- 73c22adb21b93f9220d00d2614a50350824be95b8ea966349e6f35fe5ac5537b
- 099c0fd06d18953c886121ff143ea0a20d0baf29999f424fa1ac707a81cf4987
- 3ad6677303fb6f700a4f2f977fe86e5324e0ddb0d3b33a649e513d7e88904e85
- 31a2ddaf4b146e021246e1f82e28121f5c9c8729620978309004515c7e559910
- adaae897fd286aefb64a69e88a53e9af17ee98611ea595c3c92d038f3274d723
- d8bf48e9ad3de62c695ff34a96e340912bd62e0a0282b94da6386b837c31a30d
Clear client-side storage on Chromium by
Ciro Santilli 37 Updated 2025-07-01 +Created 1970-01-01
Classification of 6-transitive groups by
Ciro Santilli 37 Updated 2025-07-01 +Created 1970-01-01
math.stackexchange.com/questions/700235/is-there-an-easy-proof-for-the-classification-of-6-transitive-finite-groups says there aren't any non-boring ones.
How to convert
Ciro Santilli 37 Updated 2025-07-01 +Created 1970-01-01
async
to sync in JavaScript by God, it's impossible! You just have to convert the entire fucking call stack all the way up to async functions. It could mean refactoring hundreds of functions.
To be fair, there is a logic to this, if you put yourself within the crappiness of the JavaScript threading model. And Python is not that much better with its Global Interpreter Lock.
The problem is that async was introduced relatively late, previously we just had to use infinitely deep callback trees, which was worse:compared to the new infinitely more readable:But now we are in an endless period of transition between both worlds.
myAsync().then(ret => myAsync2(ret).then(ret2 => myAsync3(re3)))
ret = await myAsync()
ret2 = await myAsync2(ret)
ret3 = await myAsync3(ret3)
It is also worth mentioning that callbacks are still inescapable if you really want to fan out into a non-linear dependency graph, usually with
Promise.all
:await Promise.all([
myAsync(1).then(ret => myAsync2(ret)),
myAsync(2).then(ret => myAsync2(ret)),
])
Bibliography:
- stackoverflow.com/questions/21819858/how-to-wrap-async-function-calls-into-a-sync-function-in-node-js-or-javascript
- stackoverflow.com/questions/9121902/call-an-asynchronous-javascript-function-synchronously
- stackoverflow.com/questions/47227550/using-await-inside-non-async-function
- stackoverflow.com/questions/43832490/is-it-possible-to-use-await-without-async-in-js
- stackoverflow.com/questions/6921895/synchronous-delay-in-code-execution
And then, after many many hours of this work, you might notice that the new code is way, way way slower than before, because making small functions
async
has a large performance impact: madelinemiller.dev/blog/javascript-promise-overhead/. Real world case with a 4x slowdown: github.com/ourbigbook/ourbigbook/tree/async-slow.Anyways, since you Googled here, you might as well learn the standard pattern to convert callbacks functions into async functions using a promise: stackoverflow.com/questions/4708787/get-password-from-input-using-node-js/71868483#71868483
Page contains a good summary of their hardware to date. They seem to still be the centerpiece of silicon development. There are still however people outside of Israel doing it, e.g.: www.linkedin.com/in/laurasharpless/ says as of 2021:
My team develops software for our next-generation Machine Learning accelerators: HAL, firmware, and SoC models.
2021: networking chip reports emerge: www.theverge.com/circuitbreaker/2021/3/30/22358633/amazon-reportedly-custom-network-switch-silicon-aws, presumably contesting with the likes of Cisco?
2018 onwards: Amazon AI accelerator silicon.
Although it is impossible to understand without examples in mind, try to get familiar with the manuals as soon as possible.
Intel describes paging in the Intel Manual Volume 3 System Programming Guide - 325384-056US September 2015 Chapter 4 "Paging".
Specially interesting is Figure 4-4 "Formats of CR3 and Paging-Structure Entries with 32-Bit Paging", which gives the key data structures.
x86 Paging Tutorial Example: multi-level paging scheme by
Ciro Santilli 37 Updated 2025-07-01 +Created 1970-01-01
The Translation Lookahead Buffer (TLB) is a cache for paging addresses.
Free:
- rutgers-pxk-416 chapter "Memory management: lecture notes"
- byjus.com/neet-questions/why-does-dna-contain-thymine-and-rna-uracil says Uracil cannot be repaired by DNA repair mechanisms. But it is also requires less energy to synthesize with.
There are unlisted articles, also show them or only show them.