Bug 1552018 - annobin: Cannot generate function-specific annotations for functions with asm aliases
Summary: annobin: Cannot generate function-specific annotations for functions with asm...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: annobin
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1548438
TreeView+ depends on / blocked
 
Reported: 2018-03-06 10:45 UTC by Florian Weimer
Modified: 2018-03-06 11:47 UTC (History)
2 users (show)

Fixed In Version: annobin-3.5-1
Clone Of:
Environment:
Last Closed: 2018-03-06 11:47:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2018-03-06 10:45:47 UTC
This example:

void * foo_ifunc (void) __asm__ ("foo");
void *
__attribute__ ((__optimize__ ("-fno-stack-protector")))
foo_ifunc (void)
{
  return 0;
}

extracted from a glibc test results in:

ifuncmod1.s: Assembler messages:
ifuncmod1.s:122: Error: bad expression
ifuncmod1.s:122: Error: junk at end of line, first unrecognized character is `f'
ifuncmod1.s:123: Error: bad expression
ifuncmod1.s:123: Error: junk at end of line, first unrecognized character is `f'
ifuncmod1.s:126: Error: junk at end of line, first unrecognized character is `*'

when compiled with these flags:

gcc -c -O2 -fstack-protector-strong  -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 --save-temps

The assembler input looks like this:

        .globl  foo
        .type   foo, @function
foo:
.LFB0:
        .cfi_startproc
        xorl    %eax, %eax
        ret
        .cfi_endproc
.LFE0:
        .size   foo, .-foo
        .pushsection .gnu.build.attributes
        .dc.l 6         # size of name
        .dc.l 16        # descsz = sizeof (addresses)
        .dc.l 0x101     # type = FUNC
        .dc.b 0x47, 0x41, 0x2a, 0x2, 0, 0       # name (numeric: -fstack-protector status)
        .dc.b 0, 0      # Padding
        .quad *foo
        .quad *foo_end  # description (symbol name)
        .popsection

*foo_end:

Comment 1 Nick Clifton 2018-03-06 11:28:16 UTC
Hi Florian,

  Thanks for reporting this bug.  To be clear, the issue here is not
  that an ifunc resolver is involved, but rather than the asm() function
  attribute has been used to provide a specific assembler name.

  The new annobin-3.5 source release contains a patch that fixes this bug,
  and there should now be an annobin-3.5-1.fc29 rpm available.

Cheers
  Nick

Comment 2 Florian Weimer 2018-03-06 11:47:55 UTC
(In reply to Nick Clifton from comment #1)
>   Thanks for reporting this bug.  To be clear, the issue here is not
>   that an ifunc resolver is involved, but rather than the asm() function
>   attribute has been used to provide a specific assembler name.

Right, I reduced it past the IFUNC resolver.

>   The new annobin-3.5 source release contains a patch that fixes this bug,
>   and there should now be an annobin-3.5-1.fc29 rpm available.

Thanks for fixing it so quickly!


Note You need to log in before you can comment on or make changes to this bug.