Displaying 20 results from an estimated 55 matches for "sh_addr".
2011 Oct 13
0
[LLVMdev] llvm-objdump related patch
....
+ Result = false;
+ return object_error::success;
+ }
+
+ uint64_t Address;
+ getSymbolOffset(Symb, Address);
+
+ if (sym->getType() == ELF::STT_FUNC
Again, this will only work for functions. Symbols without this type
can also be in a section.
+ && Address >= sec->sh_addr
+ && Address < (sec->sh_addr + sec->sh_size))
+ Result = true;
+
return object_error::success;
}
template<support::endianness target_endianness, bool is64Bits>
relocation_iterator ELFObjectFile<target_endianness, is64Bits>
@@ -232,11 +235,11 @@ static void...
2012 Jan 23
1
[LLVMdev] ELFObjectFile changes, llvm-objdump showing 'wrong' values?
...beginning of the section that st_shndx identifies." (*)
>
> Therefore, when queried about a symbol's address what would the right answer be? In ELFObjectFile::getSymbolAddress, previously, it was simply symb->st_value (which is the relative offset to the section). Now, Section->sh_addr is added to reflect the actual address of the symbol.
>
> Ignoring for the moment the change this imposes on objdump & nm (which can be amended), what would the expected address be for clients of getSymbolAddress?
I trust your interpretation and implementation of the relevant spec's,...
2011 Oct 12
2
[LLVMdev] llvm-objdump related patch
Michael,
I have rework the patch according to your suggestion. And I have
read binutil/objdump source code and found that it has a logic that if
there's no symtab, it will use dynsym, which is missing in llvm-objdump.
Songmao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-the-address-calculation-for-llvm-objdump.patch
Type: text/x-patch
2012 Jan 23
0
[LLVMdev] ELFObjectFile changes, llvm-objdump showing 'wrong' values?
...from the beginning of the section that st_shndx identifies." (*)
Therefore, when queried about a symbol's address what would the right answer be? In ELFObjectFile::getSymbolAddress, previously, it was simply symb->st_value (which is the relative offset to the section). Now, Section->sh_addr is added to reflect the actual address of the symbol.
Ignoring for the moment the change this imposes on objdump & nm (which can be amended), what would the expected address be for clients of getSymbolAddress?
(2) Symbol offset
Again, referring to the definition of the "st_value" f...
2015 Oct 10
3
[PATCH] Extend Multiboot1 with support for ELF64 file format
...gt;e_phoff + eh64->e_phentsize * eh64->e_phnum > len)
+ eh64 = NULL; /* No valid ELF64 header found */
+
/* Is this a Solaris kernel? */
if (!set.solaris && eh && kernel_is_solaris(eh))
opt.solaris = true;
@@ -263,6 +279,112 @@
return NULL;
}
sh[i].sh_addr = addr;
+ }
+ }
+ } else if (eh64 && !(opt.aout && mbh_len &&
+ (mbh->flags & MULTIBOOT_AOUT_KLUDGE))) {
+ /* Load 64-bit ELF */
+ regs.eip = eh64->e_entry; /* Can be overridden further down... */
+
+ ph64 = (Elf64_Phdr *) (cptr + eh64->e_phoff)...
2012 Jan 23
3
[LLVMdev] ELFObjectFile changes, llvm-objdump showing 'wrong' values?
Hi all,
I'm using the MC framework for a project, and while updating to latest
trunk (r148672) encountered the following issue:
It seems that SymbolRef::getAddress and SymbolRef::getFileOffset have
been changed to add the symbol's offset to the offset of the
containing section?
This has the following implications:
To get the /actual/ fileoffset, I now need to do:
Symbol.getFileOffset()
2011 Nov 17
1
[LLVMdev] How to get ELF section virtual starting address from MCSymbolRefExpr?
...();
const MCSectionELF = dyn_cast_or_null<MCSectionELF>(Sym.getSection());
}
But can't see how to get the virtual address of the section. This is odd since I would have expected methods for accessing every part of the ELF section header entry.
How does one get the virtual address (sh_addr in ELF) starting from a MCSymbolRefExpr?
Thanks,
Jack
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111117/6999e182/attachment.html>
2023 Jun 08
3
[RFC PATCH 0/3] x86/paravirt: Get rid of paravirt patching
This is a small series getting rid of paravirt patching by switching
completely to alternative patching for the same functionality.
The basic idea is to add the capability to switch from indirect to
direct calls via a special alternative patching option.
This removes _some_ of the paravirt macro maze, but most of it needs
to stay due to the need of hiding the call instructions from the
compiler
2023 Jun 08
3
[RFC PATCH 0/3] x86/paravirt: Get rid of paravirt patching
This is a small series getting rid of paravirt patching by switching
completely to alternative patching for the same functionality.
The basic idea is to add the capability to switch from indirect to
direct calls via a special alternative patching option.
This removes _some_ of the paravirt macro maze, but most of it needs
to stay due to the need of hiding the call instructions from the
compiler
2013 Jan 18
1
[LLVMdev] ELFObjectFile::getSymbolFileOffset
...lvm/Object/ELF.h
===================================================================
--- include/llvm/Object/ELF.h (revision 172846)
+++ include/llvm/Object/ELF.h (working copy)
@@ -1000,7 +1000,7 @@
switch (symb->getType()) {
case ELF::STT_SECTION:
- Result = Section ? Section->sh_addr : UnknownAddressOrSize;
+ Result = Section ? Section->sh_offset : UnknownAddressOrSize;
return object_error::success;
case ELF::STT_FUNC:
case ELF::STT_OBJECT:
-Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail...
2007 Mar 05
7
[PATCH 2/10] linux 2.6.18: COMPAT_VDSO
...entsize < sizeof(Elf32_Shdr));
+ BUG_ON(ehdr->e_shnum >= SHN_LORESERVE);
+ for (i = 1; i < ehdr->e_shnum; ++i) {
+ Elf32_Shdr *shdr = (void *)((unsigned long)ehdr + ehdr->e_shoff + i * ehdr->e_shentsize);
+
+ if (!(shdr->sh_flags & SHF_ALLOC))
+ continue;
+ shdr->sh_addr += new_base - old_base;
+ switch(shdr->sh_type) {
+ case SHT_DYNAMIC:
+ case SHT_HASH:
+ case SHT_NOBITS:
+ case SHT_NOTE:
+ case SHT_PROGBITS:
+ case SHT_STRTAB:
+ case 0x6ffffffd: /* SHT_GNU_verdef */
+ case 0x6fffffff: /* SHT_GNU_versym */
+ break;
+ case SHT_DYNSYM:
+ BUG_ON(sh...
2007 Mar 05
7
[PATCH 2/10] linux 2.6.18: COMPAT_VDSO
...entsize < sizeof(Elf32_Shdr));
+ BUG_ON(ehdr->e_shnum >= SHN_LORESERVE);
+ for (i = 1; i < ehdr->e_shnum; ++i) {
+ Elf32_Shdr *shdr = (void *)((unsigned long)ehdr + ehdr->e_shoff + i * ehdr->e_shentsize);
+
+ if (!(shdr->sh_flags & SHF_ALLOC))
+ continue;
+ shdr->sh_addr += new_base - old_base;
+ switch(shdr->sh_type) {
+ case SHT_DYNAMIC:
+ case SHT_HASH:
+ case SHT_NOBITS:
+ case SHT_NOTE:
+ case SHT_PROGBITS:
+ case SHT_STRTAB:
+ case 0x6ffffffd: /* SHT_GNU_verdef */
+ case 0x6fffffff: /* SHT_GNU_versym */
+ break;
+ case SHT_DYNSYM:
+ BUG_ON(sh...
2007 Mar 05
7
[PATCH 2/10] linux 2.6.18: COMPAT_VDSO
...entsize < sizeof(Elf32_Shdr));
+ BUG_ON(ehdr->e_shnum >= SHN_LORESERVE);
+ for (i = 1; i < ehdr->e_shnum; ++i) {
+ Elf32_Shdr *shdr = (void *)((unsigned long)ehdr + ehdr->e_shoff + i * ehdr->e_shentsize);
+
+ if (!(shdr->sh_flags & SHF_ALLOC))
+ continue;
+ shdr->sh_addr += new_base - old_base;
+ switch(shdr->sh_type) {
+ case SHT_DYNAMIC:
+ case SHT_HASH:
+ case SHT_NOBITS:
+ case SHT_NOTE:
+ case SHT_PROGBITS:
+ case SHT_STRTAB:
+ case 0x6ffffffd: /* SHT_GNU_verdef */
+ case 0x6fffffff: /* SHT_GNU_versym */
+ break;
+ case SHT_DYNSYM:
+ BUG_ON(sh...
2017 Oct 04
1
[PATCH 11/13] x86/paravirt: Add paravirt alternatives infrastructure
...;, secstrings + s->sh_name))
+ pv_alt = s;
if (!strcmp(".smp_locks", secstrings + s->sh_name))
locks = s;
if (!strcmp(".parainstructions", secstrings + s->sh_name))
@@ -237,6 +239,11 @@ int module_finalize(const Elf_Ehdr *hdr,
void *aseg = (void *)alt->sh_addr;
apply_alternatives(aseg, aseg + alt->sh_size);
}
+ if (pv_alt) {
+ /* patch .altinstructions */
+ void *seg = (void *)pv_alt->sh_addr;
+ apply_alternatives(seg, seg + pv_alt->sh_size);
+ }
if (locks && text) {
void *lseg = (void *)locks->sh_addr;
void *tseg = (v...
2018 May 23
0
[PATCH v3 23/27] x86/modules: Adapt module loading for PIE support
...f (*pos == sym->st_value)
+ return (u64)pos + rela->r_addend;
+ }
+
+ return 0;
+}
+
+static u64 module_emit_got_entry(struct module *mod, void *loc,
+ const Elf64_Rela *rela, Elf64_Sym *sym)
+{
+ struct mod_got_sec *gotsec = &mod->arch.core;
+ u64 *got = (u64*)gotsec->got->sh_addr;
+ int i = gotsec->got_num_entries;
+ u64 ret;
+
+ /* Check if we can use the kernel GOT */
+ ret = find_got_kernel_entry(sym, rela);
+ if (ret)
+ return ret;
+
+ got[i] = sym->st_value;
+
+ /*
+ * Check if the entry we just created is a duplicate. Given that the
+ * relocations are sorted...
2008 Oct 21
5
Why could I get function names from a stripped exec?
Hello, all experts.
When I use pid provider, my Dscript with -F option output the codepath with flowindent as you know,
e.g.
-> main
-> f1
-> f2
however I realized that the exec file I used at that time was stripped.
Does anyone know the reason why I could see the function names?
Thanks in advance.
--
This message posted from opensolaris.org
2015 Oct 10
2
[PATCH 2/2] com32/mboot/map.c: removed trailing spaces
....
---
com32/mboot/map.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/com32/mboot/map.c b/com32/mboot/map.c
index 2e8641f..1992f14 100644
--- a/com32/mboot/map.c
+++ b/com32/mboot/map.c
@@ -281,7 +281,7 @@ struct multiboot_header *map_image(void *ptr, size_t len)
sh[i].sh_addr = addr;
}
}
- } else if (eh64 && !(opt.aout && mbh_len &&
+ } else if (eh64 && !(opt.aout && mbh_len &&
(mbh->flags & MULTIBOOT_AOUT_KLUDGE))) {
/* Load 64-bit ELF */
regs.eip = eh64->e_entry; /* Can be overridd...
2019 Jan 16
2
[RFC] Adding support for dynamic entries in yaml2obj
...ted later with an example.
1. For dynamic entry strings that belong in .dynstr, the string itself can
be used as the value for an entry. (ex. DT_SONAME, DT_NEEDED, DT_RPATH, and
DT_RUNPATH)
2. A section name can be used in place of an address. In this case, the
value of the dynamic entry is the sh_addr of the specified section. (ex.
DT_STRTAB, DT_SYMTAB, DT_HASH, DT_RELA, and others)
3. A value can be specified using hexadecimal or decimal (or other bases
supported by `StringRef::to_integer()`). (ex. DT_STRSZ, DT_SYMENT,
DT_RELAENT, and others)
Here's an example to illustrate this design:...
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...all DSO\n");
+
+ hdr->e_entry +=3D VDSO_HIGH_BASE;
+ sechdrs =3D (void *)hdr + hdr->e_shoff;
+ secstrings =3D (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
+
+ for (i =3D 1; i < hdr->e_shnum; i++) {
+ if (!(sechdrs[i].sh_flags & SHF_ALLOC))
+ continue;
+
+ sechdrs[i].sh_addr +=3D VDSO_HIGH_BASE;
+ if (strcmp(secstrings+sechdrs[i].sh_name, ".dynsym") =3D=3D 0) {
+ Elf32_Sym *sym =3D (void *)hdr + sechdrs[i].sh_offset;
+ n =3D sechdrs[i].sh_size / sizeof(*sym);
+ for (j =3D 1; j < n; j++) {
+ int ndx =3D sym[j].st_shndx;
+ if (ndx =3D=3D SHN_...
2007 Apr 18
2
[RFC, PATCH] Fixup COMPAT_VDSO to work with CONFIG_PARAVIRT
...all DSO\n");
+
+ hdr->e_entry +=3D VDSO_HIGH_BASE;
+ sechdrs =3D (void *)hdr + hdr->e_shoff;
+ secstrings =3D (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
+
+ for (i =3D 1; i < hdr->e_shnum; i++) {
+ if (!(sechdrs[i].sh_flags & SHF_ALLOC))
+ continue;
+
+ sechdrs[i].sh_addr +=3D VDSO_HIGH_BASE;
+ if (strcmp(secstrings+sechdrs[i].sh_name, ".dynsym") =3D=3D 0) {
+ Elf32_Sym *sym =3D (void *)hdr + sechdrs[i].sh_offset;
+ n =3D sechdrs[i].sh_size / sizeof(*sym);
+ for (j =3D 1; j < n; j++) {
+ int ndx =3D sym[j].st_shndx;
+ if (ndx =3D=3D SHN_...