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

            Bug ID: 27565
           Summary: ld: Support input section description keyword: REVERSE
           Product: binutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: i at maskray dot me
  Target Milestone: ---

REVERSE complements SORT, e.g.

  SECTIONS { .aaa : { *(REVERSE(SORT_BY_NAME(.aaa.*))) } }

If the user wants to detect some static initialization order fiasco issues,
they can specify:

  # If https://sourceware.org/bugzilla/show_bug.cgi?id=26404 is supported,
  # the user can provide a fragment instead of a full linker script

  .init_array : {
     *(SORT_BY_INIT_PRIORITY(REVERSE(.init_array.* .ctors.*)))
     *(REVERSE(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o
*crtend?.o ) .ctors))
   }

which runs static constructors in a reversed order.

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

Reply via email to