https://bugs.llvm.org/show_bug.cgi?id=44265

            Bug ID: 44265
           Summary: LLD does not implement INPUT_SECTION_FLAGS, but parses
                    them as if it does
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: ELF
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

LLD doesn't implement the INPUT_SECTION_FLAGS feature
(https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html)
yet it seems to parse INPUT_SECTION_FLAGS as if it were a file name, hence
ignoring it.

Consider the following example:
SECTIONS {
  .foo : { INPUT_SECTION_FLAGS (SHF_WRITE) *(.foo) }
  .foo2 :  { INPUT_SECTION_FLAGS (!SHF_WRITE) *(.foo) }
}
with obj1.o containing:
        .section .foo, "wa", %progbits
        .global d1
d1:     
        .word 0
and obj2.o containing:
        .section .foo, "a", %progbits
        .global d2
d2:     
        .word 0

The INPUT_SECTION_FLAGS are supposed to constrain the match, so .foo from
obj1.o goes into OutputSection .foo, and .foo from obj2.o goes into
OutuptSection .foo2

This feature can be very useful to filter sections by flag when it is not known
what the names are. Until we support it we should fault INPUT_SECTION_FLAGS if
we see it as a filename in an InputSectionDescription.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to