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

ld: non-standard handling of options which refer to files #41

Open
tschwinge opened this issue Jun 22, 2023 · 0 comments
Open

ld: non-standard handling of options which refer to files #41

tschwinge opened this issue Jun 22, 2023 · 0 comments

Comments

@tschwinge
Copy link
Member

This ld doesn't implement standard Unix ld semantics, where "options which refer to files, such as -l [...], cause the file to be read at the point at which the option appears in the command line, relative to the object files and other file options" (GNU Binutils 2.38 ld documentation).

Instead, this ld first collects all -l options:

https://github.com/MentorEmbedded/nvptx-tools/blob/93e00909ceb9cbbc104f0fcba56c0361ffb3ca4b/nvptx-ld.cc#L409-L410

..., makes them unique:

https://github.com/MentorEmbedded/nvptx-tools/blob/93e00909ceb9cbbc104f0fcba56c0361ffb3ca4b/nvptx-ld.cc#L434-L435

..., then reads all input files on the command line:

https://github.com/MentorEmbedded/nvptx-tools/blob/93e00909ceb9cbbc104f0fcba56c0361ffb3ca4b/nvptx-ld.cc#L455-L463

..., and then processes unresolved symbols:

https://github.com/MentorEmbedded/nvptx-tools/blob/93e00909ceb9cbbc104f0fcba56c0361ffb3ca4b/nvptx-ld.cc#L534-L535

tschwinge added a commit that referenced this issue Jun 23, 2023
Handle them equally to '-l' (but without resolving via '-L').
(But beware of (pre-existing) non-standard Unix 'ld' semantics;
see <#41>
"ld: non-standard handling of options which refer to files".)
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

No branches or pull requests

1 participant