https://sourceware.org/bugzilla/show_bug.cgi?id=25591

            Bug ID: 25591
           Summary: Should /DISCARD/ : { *(.symtab) *(.strtab) } work?
           Product: binutils
           Version: 2.35 (HEAD)
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: i at maskray dot me
  Target Milestone: ---

In lld,

SECTIONS {
  /DISCARD/ : { *(.symtab) *(.strtab) }
}

can discard the synthesized .symtab and .strtab (probably since
https://reviews.llvm.org/D27040 ).

Discarding .shstrtab is not allowed:

  % ld.lld -T =(printf 'SECTIONS { /DISCARD/ : { *(.shstrtab) }}') a.o -o a
  ld.lld: error: discarding .shstrtab section is not allowed

Discarding *(*) triggers a similar error:

  % ld.lld -T =(printf 'SECTIONS { /DISCARD/ : { *(*) }}') a.o -o a
  ld.lld: error: discarding .shstrtab section is not allowed


GNU ld keeps .symtab, .strtab and .shstrtab

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Reply via email to