Skip to content

A error diagnostic for non-existent PHDR would be helpful #142927

Open
@parth-07

Description

@parth-07

LLD allows to refer to non-existent PHDR when no PHDRS command is specified. It should be an error to do so.

Reproducible example:

#!/usr/bin/env bash

cat >1.c <<\EOF
int foo() { return 1; }

int var = 3;
EOF

cat >script.t <<\EOF
SECTIONS {
  .text : { *(.text.*) } :C
  .data : { *(.data.*) }
}
EOF

clang -o 1.o 1.c -c -ffunction-sections -fdata-sections
ld.lld -o 1.out 1.o -T script.t  # No error/warning for non-existent PHDR C

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions