Skip to content

"archive:mem" input section description is not interpreted correctly when it is within quotes #680

@parth-07

Description

@parth-07

"archive:mem" input section description file pattern is not interpreted correctly when it is within quotes.

Reproducer:

#!/usr/bin/env bash

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

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

cat >script.t <<\EOF
SECTIONS {
  .foo : { "lib1.a:1.o"(.text*) }
  .text : { *(.text*) }
}
EOF


clang -target x86_64-linux-pc-gnu -o 1.o 1.c -c -ffunction-sections
clang -target x86_64-linux-pc-gnu -o main.o main.c -c -ffunction-sections
llvm-ar cr lib1.a 1.o

LDs=(ld.eld)
SFs=(eld)

for i in "${!SFs[@]}"; do
  ${LDs[$i]} -o main.${SFs[$i]}.out main.o lib1.a -T script.t -Map main.${SFs[$i]}.map.txt
done

The generated output file does not contain .foo output section, and the map-file shows that the "lib1.a:1.o" pattern is not interpreted correctly.

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