https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87698

--- Comment #5 from Romain Geissler <romain.geissler at amadeus dot com> ---
Reduced test case:

> cat test.c
void f() {}

> cat test2.c
void f();

void g()
{
    f();
}

> cat test.ver
{
    local: *;
};

> gcc -g -flto -ffat-lto-objects -fPIC -o test.fat-objects.o -c test.c
> gcc -g -flto -ffat-lto-objects -fPIC -o test2.fat-objects.o -c test2.c
> gcc -g -flto -ffat-lto-objects -fPIC -shared -o test.fat-objects.so 
> test.fat-objects.o test2.fat-objects.o -Wl,-version-script=test.ver
> gcc -g -flto -fno-fat-lto-objects -fPIC -o test.slim-objects.o -c test.c
> gcc -g -flto -fno-fat-lto-objects -fPIC -o test2.slim-objects.o -c test2.c
> gcc -g -flto -fno-fat-lto-objects -fPIC -shared -o test.slim-objects.so 
> test.slim-objects.o test2.slim-objects.o -Wl,-version-script=test.ver


> readelf -a test.fat-objects.so|grep ABS
    5: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT  ABS f  <--- unexpected
symbol here
    29: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    37: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS
    40: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    42: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS
    77: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS

> readelf -a test.slim-objects.so|grep ABS
    29: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    37: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS
    40: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS crtstuff.c
    42: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS
    65: 0000000000000000     0 FILE    LOCAL  DEFAULT  ABS

Reply via email to