bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/18296] New: gold fails to properly handle R_386_GOTOFF


From: hjl.tools at gmail dot com
Subject: [Bug gold/18296] New: gold fails to properly handle R_386_GOTOFF
Date: Wed, 22 Apr 2015 12:48:17 +0000

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

            Bug ID: 18296
           Summary: gold fails to properly handle R_386_GOTOFF
           Product: binutils
           Version: 2.26 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: hjl.tools at gmail dot com
                CC: ian at airs dot com

address@hidden pr17689]$ cat x.S
    .section    .text.startup,"ax",@progbits
    .p2align 4,,15
    .globl    main
    .type    main, @function
main:
    leal    4(%esp), %ecx
    andl    $-16, %esp
    pushl    -4(%ecx)
    pushl    %ebp
    movl    %esp, %ebp
    pushl    %ebx
    pushl    %ecx
    call    __x86.get_pc_thunk.bx
    addl    $_GLOBAL_OFFSET_TABLE_, %ebx
    subl    $12, %esp
    pushl    address@hidden(%ebx)
    call    address@hidden
    popl    %eax
    movl    address@hidden(%ebx), %eax
    pushl    (%eax)
    call    address@hidden
    addl    $16, %esp
    leal    -8(%ebp), %esp
    xorl    %eax, %eax
    popl    %ecx
    popl    %ebx
    popl    %ebp
    leal    -4(%ecx), %esp
    ret
    .size    main, .-main
    .globl    ptr
    .section    .data.rel.local,"aw",@progbits
    .align 4
    .type    ptr, @object
    .size    ptr, 4
ptr:
    .long    bar_alias
    .section   
.text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
    .globl    __x86.get_pc_thunk.bx
    .hidden    __x86.get_pc_thunk.bx
    .type    __x86.get_pc_thunk.bx, @function
__x86.get_pc_thunk.bx:
    movl    (%esp), %ebx
    ret
address@hidden pr17689]$ cat bar.c 
#include <stdio.h>

char *bar = "PASS";
extern char *bar_alias __attribute__ ((weak, alias ("bar")));

void
foo (char *x)
{
  printf ("%s\n", x);
}
address@hidden pr17689]$ make
gcc -m32 -B./ -pie -O3 -fPIE -fpie  -c -o x.o x.S
gcc -m32 -B./ -pie -O3 -fPIE -fpic    -c -o bar.o bar.c
gcc -m32 -B./ -pie  -shared -o libbar.so bar.o
gcc -m32 -B./ -pie -O3 -fPIE -o x x.o libbar.so -Wl,-R,.
./x
make: *** [all] Segmentation fault
address@hidden pr17689]$

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]