Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 29 Jan 2020 20:38:10 +0100
From: Markus Wichmann <nullplan@....net>
To: musl@...ts.openwall.com
Subject: Re: Static linking is broken after creation of DT_TEXTREL
 segment

On Wed, Jan 29, 2020 at 08:19:46PM +0100, Markus Wichmann wrote:
> On Wed, Jan 29, 2020 at 09:41:46PM +0300, Андрей Аладьев wrote:
> > gcc main.c /usr/lib/libgmp.a -o main && ./main
>
> Ooh boy, why would you do this? When there's a perfectly good -lgmp just
> waiting for you.
>

To expand upon this: libgmp makes sure not to create TEXTRELs if
compiling for PIC. The function in question uses the m4 macro LEA, which
picks the correct code for either situation. Using libgmp.a explicitly
here means you told the code it would be running statically compiled and
then used it for dynamic compilation, anyway.

Ciao,
Markus

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.