]> xenbits.xensource.com Git - livepatch-build-tools.git/commitdiff
For Xen, treat PLT32 relocations like PC32
authorRoss Lagerwall <ross.lagerwall@citrix.com>
Fri, 13 Nov 2015 08:33:44 +0000 (08:33 +0000)
committerRoss Lagerwall <ross.lagerwall@citrix.com>
Wed, 20 Jan 2016 13:48:25 +0000 (13:48 +0000)
PLT32 relocations are only used because gcc doesn't support symbol
visibility for builtins like memcpy.

common.c
create-diff-object.c

index 5efaec898fb505fc327276956c127e12a8a9891e..7b714760b19a3f939f88122561003cbfc7665863 100644 (file)
--- a/common.c
+++ b/common.c
@@ -344,7 +344,8 @@ static void xsplice_create_rela_list(struct xsplice_elf *kelf,
                         * If the relocation is to a debug frame, ignore the
                         * since it encodes the line number.
                         */
-                       if (rela->type == R_X86_64_PC32) {
+                       if (rela->type == R_X86_64_PC32 ||
+                           rela->type == R_X86_64_PLT32) {
                                if (!strncmp(sec->base->name, ".text", 5)) {
                                        struct insn insn;
                                        rela_insn(sec, rela, &insn);
index e560f0c4358041b186f52d27c3e56b59e58ce1c2..04aadef04537637ef05c11f7b3dfa7a9c9dc19b5 100644 (file)
@@ -147,7 +147,8 @@ static void xsplice_replace_sections_syms(struct xsplice_elf *kelf)
                                continue;
                        }
 
-                       if (rela->type == R_X86_64_PC32) {
+                       if (rela->type == R_X86_64_PC32 ||
+                           rela->type == R_X86_64_PLT32) {
                                struct insn insn;
                                rela_insn(sec, rela, &insn);
                                add_off = (long)insn.next_byte -