diff options
author | Petr Machata <pmachata@redhat.com> | 2013-02-05 01:48:21 +0100 |
---|---|---|
committer | Petr Machata <pmachata@redhat.com> | 2013-03-12 00:08:52 +0100 |
commit | 99b19eb1bb736d7066026894aa69e70de8a03094 (patch) | |
tree | 22e4df61c48c7d333f264ee103ed22b037b4c3eb /ltrace-elf.h | |
parent | f2d5f79591fdb1a22b4e7c8e4cbb8274dc7daa40 (diff) | |
download | ltrace-99b19eb1bb736d7066026894aa69e70de8a03094.tar.gz |
elf_get_section_* should return 0 if section wasn't found
Otherwise it won't be possible to differentiate between an error and
not-found condition. It seems some callers (MIPS, PPC backends) already
count on that behavior anyway.
Diffstat (limited to 'ltrace-elf.h')
-rw-r--r-- | ltrace-elf.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ltrace-elf.h b/ltrace-elf.h index b76d1eb..ab599eb 100644 --- a/ltrace-elf.h +++ b/ltrace-elf.h @@ -1,6 +1,6 @@ /* * This file is part of ltrace. - * Copyright (C) 2006,2010,2012 Petr Machata, Red Hat Inc. + * Copyright (C) 2006,2010,2012,2013 Petr Machata, Red Hat Inc. * Copyright (C) 2010 Zachary T Welch * Copyright (C) 2001,2004,2007,2009 Juan Cespedes * Copyright (C) 2006 Ian Wienand @@ -95,6 +95,12 @@ int elf_get_sym_info(struct ltelf *lte, const char *filename, size_t sym_index, GElf_Rela *rela, GElf_Sym *sym); Elf_Data *elf_loaddata(Elf_Scn *scn, GElf_Shdr *shdr); + +/* The following three look for sections based on various criteria. + * They return 0 if there was no error, or a negative value if there + * was. If the section was found, it is returned in *TGT_SEC, and the + * header is stored te TGT_SHDR. If it wasn't found, *TGT_SEC is set + * to NULL. */ int elf_get_section_covering(struct ltelf *lte, GElf_Addr addr, Elf_Scn **tgt_sec, GElf_Shdr *tgt_shdr); int elf_get_section_type(struct ltelf *lte, GElf_Word type, |