Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comment: fix GNU ld and as files #1034

Merged
merged 4 commits into from
Jul 8, 2024

Conversation

Thannoy
Copy link

@Thannoy Thannoy commented Jul 4, 2024

comment: fix GNU as comment style (*.s)

As well described by sourceware website [1]:
There are two ways of rendering comments to as:

  • Anything from /* through the next */ is a comment.
  • The line comment character is target specific

We therefore better should use the C style comment instead of any single-line comment which can't fit every cases.

Wikipedia [2] provides a list of target-specific GNU as single-line comments:

  • A hash symbol (#) — i386, x86-64, i960, 68HC11, 68HC12, VAX, V850, M32R,
    PowerPC, MIPS, M680x0, and RISC-V
  • A semicolon (;) — AMD 29k family, ARC, H8/300 family, HPPA, PDP-11,
    picoJava, Motorola, and M32C
  • The at sign (@) — 32-bit ARM
  • A double slash (//) — AArch64
  • A vertical bar (|) — M680x0
  • An exclamation mark (!) — Renesas SH

Hash symbol is currently used, this PR make it /* */

comment: fix GNU ld comment style (*.ld)

As per documentation: "You may include comments in linker scripts just as in C: delimited by /* and */."

Link: https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html#SEC6


  • Added a change log entry in changelog.d/<directory>/.
  • Added self to copyright blurb of touched files.
  • Added self to AUTHORS.rst.
  • [ ] Wrote tests. ==> Don't think this desserves a new test
  • [ ] Documented my changes in docs/man/ or elsewhere. ==> Don't think this desserves a doc
  • My changes do not contradict
    the current specification.
  • I agree to license my contribution under the licenses indicated in the
    changed files.

Anthony Loiseau added 4 commits July 4, 2024 21:56
As per documentation:
"You may include comments in linker scripts
 just as in C: delimited by `/*' and `*/'."

Link: https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_chapter/ld_3.html#SEC6
Signed-off-by: Anthony Loiseau <[email protected]>
As well described by sourceware website [1]:
There are two ways of rendering comments to as:
- Anything from ‘/*’ through the next ‘*/’ is a comment.
- The line comment character is target specific

We therefore better should use the C style comment instead of any
single-line comment which can't fit every cases.

Wikipedia [2] provides a list of target-specific GNU as single-line comments:
- A hash symbol (#) — i386, x86-64, i960, 68HC11, 68HC12, VAX, V850, M32R,
                      PowerPC, MIPS, M680x0, and RISC-V
- A semicolon (;) — AMD 29k family, ARC, H8/300 family, HPPA, PDP-11,
                    picoJava, Motorola, and M32C
- The at sign (@) — 32-bit ARM
- A double slash (//) — AArch64
- A vertical bar (|) — M680x0
- An exclamation mark (!) — Renesas SH

[1]: https://sourceware.org/binutils/docs/as.html#Comments
[2]: https://en.wikipedia.org/wiki/GNU_Assembler

Signed-off-by: Anthony Loiseau <[email protected]>
As per pull request checklist.

Signed-off-by: Anthony Loiseau <[email protected]>
@Thannoy
Copy link
Author

Thannoy commented Jul 4, 2024

Ping @monacofj for comments since this PR touches its recent PR #928 work targeting issue #927

@Thannoy Thannoy marked this pull request as ready for review July 4, 2024 20:42
@monacofj
Copy link
Contributor

monacofj commented Jul 4, 2024

Ping @monacofj for comments since this PR touches its recent PR #928 work targeting issue #927

Thanks @Thannoy for the kind ping.
Good call, I think C-style comment for .s files seems more appropriate than the x86-specific character.

Copy link
Member

@carmenbianca carmenbianca left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @Thannoy, and thanks also to @monacofj for your feedback!

@carmenbianca carmenbianca merged commit cc63716 into fsfe:main Jul 8, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants