Path: csiph.com!weretis.net!feeder6.news.weretis.net!news.glorb.com!usenet.stanford.edu!not-for-mail From: Nicolas Gama Newsgroups: gnu.utils.bug Subject: relocation R_X86_64_32S bug in ld version 2.28 Date: Wed, 2 Aug 2017 17:58:09 +0200 Lines: 63 Approved: bug-gnu-utils@gnu.org Message-ID: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------8A2D11CDF3502104C70B1F82" X-Trace: usenet.stanford.edu 1501878040 8711 208.118.235.17 (4 Aug 2017 20:20:40 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-gnu-utils@gnu.org Envelope-to: bug-gnu-utils@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version; bh=cFeuhNjzigzv2hnIAg7SxkJQNGqOeg7FsrQVAt+YGi0=; b=tys15CHVhhTWGqRlhhV5t8Y6TGYqBFbCzcA0DQlA51qJjTPwqNnqFBsorikuEwy4SN YwL3J2lXWnMbkwfKR6n5iVfFChX7d8IgubJJjWDE0NCtQniScMksA5JZweqMcOIO38/n +Cygv44is3hASgay0d5hD9kEq6heAKrZBNnQNOU90CjLcZ9tiWwfUA7d25D4cKscSfrx jYJO/gRoAzvl82QsxagZrm9PRJH4Ys7amM1ZrIi8NLMD1WdffIJfkm0rXFCCz5l3r9I6 Y+bHHiAeJG4eFiWD9xW/wDfBuD6wjg/s024Qqkqd9X2VQB86qx02VhM3tDlsiCH1J4T3 Rnqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=cFeuhNjzigzv2hnIAg7SxkJQNGqOeg7FsrQVAt+YGi0=; b=VFNpduE0UxKGBhWe6eVMvbH78U1l1MyCHxpPMiypW8q9gsVvGwd15vDFV0h1OnqkIO 6HXZbdvjkHhRpFZRkGJ5ZNZ7s2bFpcqS6GIFFH1fmyd5+IusfS6SJKrHBjChhOhLAvqG V62U0yxgO3efkcHoWKaB3bf9GyTwOg9zK5P4Yu2vCL9SMR8yG0fo15htMh1oNX3+C8mN Nha4P7Yks7tluQjT4lvcWRqateBoO51an7JWSDh4xap+4sdcETz94i9zo8jZy2T24sC8 rOaQXAsIjBS0OV6P8r7DAkW6ZbIVhxcPuWBG+fu7B61KrFY5oWOF6zayHiKOQKZXhfEn WRuQ== X-Gm-Message-State: AIVw1122qjq7se9GgFtf4zXWFWY8YUAO1t1I4MRk86SUU/c0gRiqeeZf DLkfCobZZq72VWg4R/4= X-Received: by 10.80.145.38 with SMTP id e35mr22276243eda.8.1501689490971; Wed, 02 Aug 2017 08:58:10 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::22a X-Mailman-Approved-At: Wed, 02 Aug 2017 12:49:30 -0400 X-BeenThere: bug-gnu-utils@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Bug reports for the GNU utilities List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.utils.bug:2213 This is a multi-part message in MIME format. --------------8A2D11CDF3502104C70B1F82 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit A regression appeared with ld version 2.28: When trying to link the following assembly program (with any version of gcc, x86_64 platform) ---------------- a.s ----------------------- .globl toto toto: movq tata,%rax #trying to reference a constant ret tata: .quad 42 -------------------------------------------- The linker ld fails with the following error, even when linking a regular a.out binary (not a shared object): /usr/bin/ld: a.o: relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC Normally, this error should only occur when trying to create a shared object, but since 2.28, the error appears even for regular binaries, which is wrong. version 2.26 of ld managed to compile the program correctly (for instance on Ubuntu Xenial). Enclosed is a minimal program to reproduce the bug. (toto() function should return 42, and main should print it). Thanks in advance, Nicolas --------------8A2D11CDF3502104C70B1F82 Content-Type: application/gzip; name="bug.tar.gz" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="bug.tar.gz" H4sIAJj1gVkAA+3W306DMBQGcG7tU5xsMdmSDVvYSjKNb+AbeNNBh8SudawsGuO7W8ZcvDDu iumS73dBOXCa8idfYNmUNyreRn3igZSzdhTZnH8f90TYF6mY8TRLUplFXHCZZhHxXq/qoNl6 VRNFpVqr3/pOnb9QcWnc0pB33rF2s2B0sHa7DXnl1eS6Vq809PVbZcvQSbVe6VrbXJOi3Nnw AK0/Tqu1Z6ydtmDxplFFODRLGPvr+4SfLUP+2/ce5/2tcTL/Qh7yL2WaypB/kco58n8Ow8rm pik03W19Ubn46Z4x4/Y59240vmVs56qC1qqyozG972P+UlfWr0aDa1M82sGk6wytH0j5xWnz /6Ce9aoyuq81TuWfZ8lX/rN5CH7If8YT5P8clDELdlXmOU1zCj+CdCy6r0JXqth1taOpa6vG I+sAAAAAAAAAAAAAAAAAAP/KJxabVEEAKAAA --------------8A2D11CDF3502104C70B1F82--