Git Product home page Git Product logo

Comments (5)

pcc avatar pcc commented on May 26, 2024

Are there figures on how many regular relative relocations are transformed into R_AARCH64_AUTH_RELATIVE under PAuthABI?

The 32b limit was chosen on the basis that in the vast majority of cases (small code model, position independent code) the addend is going to be within the 0..2^32 range. So I would say that in a typical userspace, pretty much every relocation is going to use this.

from abi-aa.

MaskRay avatar MaskRay commented on May 26, 2024

I agree that in the majority of cases linkers don't need to move a relocation from .relr.auth.dyn to .rela.dyn.
The question is do we need this RELR variant?

If we use CREL (while size(.crel.dyn)/size(.relr.dyn) may be 3.5x, size(.crel.dyn)/size(.o) is just 0.3%), supporting AUTH relative will take very few lines in https://github.com/MaskRay/llvm-project/blob/demo-crel/lld/ELF/SyntheticSections.cpp around CrelSection<uint>::updateAllocSize, and the code will be centralized in one place.

from abi-aa.

pcc avatar pcc commented on May 26, 2024

Got it, I misread your earlier message and thought you were asking about .rela.dyn -> .relr.auth.dyn rather than R_AARCH64_ABS64 -> R_AARCH64_AUTH_ABS64. Let me see if I can collect those numbers for AOSP.

from abi-aa.

pcc avatar pcc commented on May 26, 2024

I built AOSP with PAuth ABI disabled and enabled for the Cuttlefish (i.e. emulator) arm64 target and ran the following commands from the symbols directory of the build directory, which contains unstripped versions of all built binaries shipped on the device.

$ llvm-readelf -rW (find -type f) | grep 000000000000e20| wc -l
524144
$ llvm-readelf -rW (find -type f) | grep R_AARCH64_RELATIVE| wc -l
725136

So around 40% of R_AARCH64_RELATIVE relocations become R_AARCH64_AUTH_RELATIVE.

Also, the total size of all SHT_RELR sections in a tree of binaries built with PAuth ABI disabled is 460824 bytes and with PAuth ABI enabled is 307032 bytes. So we can estimate that the total DT_AARCH64_AUTH_RELR size if it were implemented would be around 150KB. Assuming a 3.5x ratio for CREL vs RELR that would mean it would cost 375KB in the shipped image not to have DT_AARCH64_AUTH_RELR (i.e. 0.04% of the total image size of 1.1GB), but I would expect the actual ratio to be higher than for DT_RELR since each relocation contains more information.

from abi-aa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.