Skip to content

[AIX] add -bdbg:namedsects:ss link arg#156159

Open
daltenty wants to merge 1 commit intorust-lang:mainfrom
daltenty:daltenty/namesects
Open

[AIX] add -bdbg:namedsects:ss link arg#156159
daltenty wants to merge 1 commit intorust-lang:mainfrom
daltenty:daltenty/namesects

Conversation

@daltenty
Copy link
Copy Markdown
Contributor

@daltenty daltenty commented May 4, 2026

On AIX, the PGO runtime and ifunc runtime support requires the named section linker feature which collects the name sections together and generates start/stop symbols for them.

This change adds the option to the default linker args for the target.

On AIX, PGO runtimes and ifunc support requires the named section linker feature which collects the name sections together and generates start/stop symbols for them.

This change adds the option to the default linker args for the target.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 4, 2026

These commits modify compiler targets.
(See the Target Tier Policy.)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 4, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 4, 2026

r? @tiif

rustbot has assigned @tiif.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 73 candidates
  • Random selection from 21 candidates

@workingjubilee
Copy link
Copy Markdown
Member

workingjubilee commented May 5, 2026

I see no significant reason to not simply r+ this aside from "is there any meaningful negative effect on linked executables and libraries when you're not doing PGO?"

This is just a small per-section binary size overhead, right?

And ifuncs? Defining new ifuncs, calling them, or both?

Happy to sign off on it either way if I understand correctly, just want to make sure I actually do.

@daltenty
Copy link
Copy Markdown
Contributor Author

daltenty commented May 5, 2026

"is there any meaningful negative effect on linked executables and libraries when you're not doing PGO?"

That's a great question, I ran this past our linker experts. The option itself creates no extra cost on the binary as it only has an effect on the layout of existing data in the binary. It causes the linker to layout existing data in the name sections1 in the binary (if they exist) contiguously in memory and fills in the address of stop/start pointers to those sections (again if they exist).

This is done because the PGO and ifunc runtimes need to walk this global data during program startup in their initializers, so they need them to be contiguous. If you use PGO or ifuncs when building your program on AIX, you have this data already (and you pay the cost of the extra initializers on program startup). If you don't, there's no extra cost.

Footnotes

  1. we define a named section to be a csect whose csect name is an internal symbol (C_HIDEXT),
    and whose storage-mapping class is XMC_RO (for a .text-section symbol) or XMC_RW (for a .data-
    section symbol).

@workingjubilee
Copy link
Copy Markdown
Member

Cool, thanks for explaining that! It sounds like the difference if any is even more marginal than I first thought it was and would only occur due to padding-to-alignment types of things.

@bors r+

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 5, 2026

📌 Commit ad582a5 has been approved by workingjubilee

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 5, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request May 5, 2026
…kingjubilee

[AIX] add -bdbg:namedsects:ss link arg

On AIX, the PGO runtime and ifunc runtime support requires the named section linker feature which collects the name sections together and generates start/stop symbols for them.

This change adds the option to the default linker args for the target.
rust-bors Bot pushed a commit that referenced this pull request May 5, 2026
Rollup of 12 pull requests

Successful merges:

 - #155341 (generic_const_args: allow paths to non type consts)
 - #156062 (Added command-line argument support for `wasm32-wali-linux-musl`)
 - #156159 ([AIX] add -bdbg:namedsects:ss link arg)
 - #156174 (Wasm: remove implicit `__heap_base`/`__data_end` exports)
 - #156186 (fix: remap ci-llvm debug paths via `-ffile-prefix-map`)
 - #156193 (port `rustc_ast*` crates from `box_` to `deref_patterns`)
 - #156201 (Don't run ui-fulldeps tests twice in stage 1)
 - #155808 (Always use `ConstFn` context for `const` closures)
 - #156105 (interpret: correctly deal with repr(transparent) enums)
 - #156148 (Use `all_impls` instead of handrolling it)
 - #156156 (Adjust getMCSubtargetInfo signature for LLVM 23+)
 - #156205 (move generalization test)
jhpratt added a commit to jhpratt/rust that referenced this pull request May 6, 2026
…kingjubilee

[AIX] add -bdbg:namedsects:ss link arg

On AIX, the PGO runtime and ifunc runtime support requires the named section linker feature which collects the name sections together and generates start/stop symbols for them.

This change adds the option to the default linker args for the target.
rust-bors Bot pushed a commit that referenced this pull request May 6, 2026
Rollup of 15 pull requests

Successful merges:

 - #151122 (fix: more descriptive error message for enum to integer)
 - #155341 (generic_const_args: allow paths to non type consts)
 - #156062 (Added command-line argument support for `wasm32-wali-linux-musl`)
 - #156159 ([AIX] add -bdbg:namedsects:ss link arg)
 - #156174 (Wasm: remove implicit `__heap_base`/`__data_end` exports)
 - #156186 (fix: remap ci-llvm debug paths via `-ffile-prefix-map`)
 - #156193 (port `rustc_ast*` crates from `box_` to `deref_patterns`)
 - #156201 (Don't run ui-fulldeps tests twice in stage 1)
 - #155808 (Always use `ConstFn` context for `const` closures)
 - #156105 (interpret: correctly deal with repr(transparent) enums)
 - #156148 (Use `all_impls` instead of handrolling it)
 - #156156 (Adjust getMCSubtargetInfo signature for LLVM 23+)
 - #156170 (add known-bug test for coroutine 'static-yields-non-'static unsoundness (#144442))
 - #156195 (Move tests codegen)
 - #156205 (move generalization test)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants