[Bug dynamic-link/24916] New: [MIPS] Highest EI_ABIVERSION value not raised to ABSOLUTE ABI

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug dynamic-link/24916] New: [MIPS] Highest EI_ABIVERSION value not raised to ABSOLUTE ABI

adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24916

            Bug ID: 24916
           Summary: [MIPS] Highest EI_ABIVERSION value not raised to
                    ABSOLUTE ABI
           Product: glibc
           Version: 2.32
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: [hidden email]
  Target Milestone: ---

The highest possible EI_ABIVERSION value for MIPS was not raised with the
introduction of absolute symbols handling. This causes a discrepancy with the
static linker. If a shared object has its EI_ABIVERSION set to ABSOLUTE_ABI,
dynamic linker will fail with the "ABI version invalid" error.

The bug can be reproduced on o32 with this

$ cat libtest.s

    .text
    .globl      x
    .set        nomips16
    .set        nomicromips
    .ent        x
    .type       x, @function
x:
    .set noreorder
    .cpload  $25
    jr  $31
    lb  $2,%got(a)($28)

    .set reorder
    .end        x
    .size       x, .-x
    .weak       a
    .hidden     a

$ cat test.c

int *x (void);

int
do_test (void)
{
  x ();
  return 0;
}

$ gcc -shared -fPIC libtest.s -o libtest.so
$ gcc test.c libtest.so -o test
$ ./test
$ ./test: error while loading shared libraries: libtest.so: ELF file ABI
version invalid

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug dynamic-link/24916] [MIPS] Highest EI_ABIVERSION value not raised to ABSOLUTE ABI

adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24916

Mihailo Stojanovic <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[hidden email]
                   |                            |m

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug dynamic-link/24916] [MIPS] Highest EI_ABIVERSION value not raised to ABSOLUTE ABI

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24916

Mihailo Stojanovic <[hidden email]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|2.32                        |2.28

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug dynamic-link/24916] [MIPS] Highest EI_ABIVERSION value not raised to ABSOLUTE ABI

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24916

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Joseph Myers <[hidden email]>:

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=edd8d70b91e1ccef549a7c668499596cc4d56ad1

commit edd8d70b91e1ccef549a7c668499596cc4d56ad1
Author: Mihailo Stojanovic <[hidden email]>
Date:   Fri Aug 23 16:47:27 2019 +0000

    [MIPS] Raise highest supported EI_ABIVERSION value [BZ #24916]

    This bumps the highest valid EI_ABIVERSION value to ABSOLUTE ABI.

    New testcase loads the symbol from the GOT with the "lb" instruction
    so that the EI_ABIVERSION header field of the shared object is set
    to ABSOLUTE (it doesn't actually check the value of the symbol), and
    makes sure that the main executable is executed without "ABI version
    invalid" error.

    Tested for all three ABIs (o32, n32, n64) using both static linker which
    handles undefined weak symbols correctly [1] (and sets the EI_ABIVERSION
    of the test module) and the one that doesn't (EI_ABIVERSION left as 0).

    [1] https://sourceware.org/ml/binutils/2018-07/msg00268.html

        [BZ #24916]
        * sysdeps/mips/Makefile [$(subdir) = elf] (tests): Add
        tst-undefined-weak.
        [$(subdir) = elf] (modules-names): Add tst-undefined-weak-lib.
        [$(subdir) = elf] ($(objpfx)tst-undefined-weak): Add dependency.
        * sysdeps/mips/tst-undefined-weak-lib.S: New file.
        * sysdeps/mips/tst-undefined-weak.c: Likewise.
        * sysdeps/unix/sysv/linux/mips/ldsodefs.h (VALID_ELF_ABIVERSION):
        Increment highest valid ABIVERSION value.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug dynamic-link/24916] [MIPS] Highest EI_ABIVERSION value not raised to ABSOLUTE ABI

adhemerval.zanella at linaro dot org
In reply to this post by adhemerval.zanella at linaro dot org
https://sourceware.org/bugzilla/show_bug.cgi?id=24916

Joseph Myers <jsm28 at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |2.31

--- Comment #2 from Joseph Myers <jsm28 at gcc dot gnu.org> ---
Fixed for 2.31.

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