Skip to content

[DesignDocuments] Rationale for GNU Properties in sysvabi#229

Open
smithp35 wants to merge 2 commits intoARM-software:mainfrom
smithp35:elfmarkrationale
Open

[DesignDocuments] Rationale for GNU Properties in sysvabi#229
smithp35 wants to merge 2 commits intoARM-software:mainfrom
smithp35:elfmarkrationale

Conversation

@smithp35
Copy link
Contributor

@smithp35 smithp35 commented Nov 3, 2023

Add a design rationale for use of GNU properties as well as guidelines for how these should be used for properties in the AArch64 processor space.

Pull request #228 moves the GNU properties and other dynamic section properties specific to SystemV ABI to the SystemV ABI document.

Arm has typically left metadata in exectuables and shared-libraries to the platform. Only defining metadata for relocatable objects. With platforms such as Linux the most frequently run software on AArch64, Arm needs to document the metadata that it is using for SystemV platforms.

We have chosen to use GNU properties and to document these in the sysvabi64.rst document.

@smithp35
Copy link
Contributor Author

smithp35 commented Nov 3, 2023

I don't think the PDF creation is to do with this pull-request as I didn't add the directory to the generate-pdfs script and the same attribute error happens in other documents.

Looks like we may need to upgrade rst2pdf to 0.101 for python 3.12 compatibility.

@@ -0,0 +1,496 @@
..
Copyright (c) 2023, Arm Limited and its affiliates. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: update copyright year

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack

The design goals of an ELF marking scheme are:

- Utilize existing ELF marking standards where possible. Platforms
may already have an implementation existing standards that can be
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: did you mean "implementation of existing..."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, now updated.


To permit an ELF loader to reason about feature compatibility and take
extra actions as a result of features some additional metadata must be
recorded in the ELF file. This document will use the team ELF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "team ELF"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A typo for "term ELF"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now updated to "term ELF"

======================

GNU program properties are a linux extension defined in
(``LINUX_ABI_``). They are encoded in ``SHT_NOTE`` sections with a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: some references are written with double inverse quotes ` and as a result they are not rendered as links.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the double inverse quotes from the references.

platforms running on different hardware. Platform specific software
can be customized for the hardware that it runs on.

Only require features that can't be tested at runtime
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have properties for PAC, BTI, and GCS all of which can be tested at run time via HWCAP. The next paragraph about hint space features explains this but this paragraph seems to contradict what exists in practice.

The properties for PAC, BTI, and GCS inform the loader that the binary is supposed to work with the respective features if they are present in the system (so it is safe to enable them when the run time check passes).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think what I need to do is restrict this paragraph to "use of non-hint space instructions from an architectural extension".

Main thing to get over is that if function multiversioning is used then we don't need to record all the architecture features used in the alternative implementations, just the baseline.

BTI and GCS are (or can be) orthogonal to this. For example BTI only uses hint-space instructions, but requires action from the loader to enable BTI. In this case we record "I am compatible with BTI", and not "I require armv8.5-a for BTI instructions".

I'll have a go at rewriting.

Add a design rationale for use of GNU properties as well as
guidelines for how these should be used for properties in
the AArch64 processor space.

Pull request ARM-software#228 moves
the GNU properties and other dynamic section properties specific
to SystemV ABI to the SystemV ABI document.

Arm has typically left metadata in exectuables and shared-libraries
to the platform. Only defining metadata for relocatable objects.
With platforms such as Linux the most frequently run software on
AArch64, Arm needs to document the metadata that it is using for
SystemV platforms.

We have chosen to use GNU properties and to document these in
the sysvabi64.rst document.
* Fix copyright dates.
* Update changelog.
* Fix double quotes around links.
* Clarify that runtime testing applies to architectural features
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants