Skip to content

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

@tschwinge

Description

@tschwinge

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions