From patchwork Thu Jan 28 12:55:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Wielaard X-Patchwork-Id: 10653 Received: (qmail 553 invoked by alias); 28 Jan 2016 12:56:00 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 536 invoked by uid 89); 28 Jan 2016 12:56:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, SPF_PASS autolearn=ham version=3.3.2 spammy=SUN, msg, rex, reserved X-HELO: gnu.wildebeest.org From: Mark Wielaard To: libc-alpha@sourceware.org Cc: Mark Wielaard Subject: [PATCH] elf/elf.h: Add new 386 and X86_64 relocations from binutils. Date: Thu, 28 Jan 2016 13:55:06 +0100 Message-Id: <1453985706-30030-1-git-send-email-mjw@redhat.com> X-Spam-Score: -2.9 (--) The following new 386 and X86_64 were added to binutils. They are non-dynamic relocations, so don't need direct handling in glibc. But other programs, like elfutils, use the glibc elf.h definitions for the names and numbers when inspecting ET_REL files. R_386_GOT32X was proposed in https://groups.google.com/forum/#!topic/ia32-abi/GbJJskkid4I X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX were proposed in https://groups.google.com/forum/#!topic/x86-64-abi/n9AWHogmVY0 There also used to be R_X86_64_PC32_BND (39) and R_X86_64_PLT32_BND (40) but those already got deprecated and now the numbers are simply reserved. See https://groups.google.com/d/msg/x86-64-abi/-hdQyMixt8Y/XFDOvioG85cJ They are still in current binutils master, but given that they should not be used I didn't add them to elf.h. * elf/elf.h (R_386_GOT32X): New. (R_386_NUM): Update. (R_X86_64_GOTPCRELX: New. (R_X86_64_REX_GOTPCRELX): New. (R_X86_64_NUM): Update. OK to commit? diff --git a/elf/elf.h b/elf/elf.h index 15f5a75..1a7000b 100644 --- a/elf/elf.h +++ b/elf/elf.h @@ -1269,8 +1269,10 @@ typedef struct argument, returning the TLS offset for the symbol. */ #define R_386_IRELATIVE 42 /* Adjust indirectly by program base */ +#define R_386_GOT32X 43 /* Load from 32 bit GOT entry, + relaxable. */ /* Keep this the last entry. */ -#define R_386_NUM 43 +#define R_386_NUM 44 /* SUN SPARC specific definitions. */ @@ -3144,8 +3146,15 @@ enum #define R_X86_64_TLSDESC 36 /* TLS descriptor. */ #define R_X86_64_IRELATIVE 37 /* Adjust indirectly by program base */ #define R_X86_64_RELATIVE64 38 /* 64-bit adjust by program base */ - -#define R_X86_64_NUM 39 + /* 39 Reserved was R_X86_64_PC32_BND */ + /* 40 Reserved was R_X86_64_PLT32_BND */ +#define R_X86_64_GOTPCRELX 41 /* Load from 32 bit signed pc relative + offset to GOT entry without REX + prefix, relaxable. */ +#define R_X86_64_REX_GOTPCRELX 42 /* Load from 32 bit signed pc relative + offset to GOT entry with REX prefix, + relaxable. */ +#define R_X86_64_NUM 43 /* AM33 relocations. */