Comments (5)
from riscv-binutils-gdb.
One thing though, it's possible that some flags will get introduced later that don't imply ABI incompatibility. I think the main place this will show up is linking against a newer libX.a / libX.so using an older linker. (The dynamic linker doesn't check e_flags at the moment, but it probably should, so this would also be a problem with using newer executables with an older dynamic linker.)
By going forward with this, we're basically saying that each e_flags setting represents its own, incompatible ABI. One thing we could consider doing is reserving the lower half-word for ABI, and the upper half-word for other stuff that doesn't imply incompatibility.
Probably best to research what other BFD ports do.
from riscv-binutils-gdb.
One thing I was thinking of doing was having a "equal flags are compatible" check, which is in ARMv8
/* Identical flags must be compatible. */
if (in_flags == out_flags)
return TRUE;
but just for the unknown bits, so the patch would look more like
+ if ((new_flags & EF_RISCV_RESERVED) != (old_flags & EF_RISCV_RESERVED))
 + {
 + (*_bfd_error_handler)
 + (_("%B: Unknown ELF flag `%x'"),
 + ibfd, new_flags);
 + return FALSE;
 + }
but I decided not to. My reasoning had something to do with a version field, but that doesn't make any sense (so I was either too hungry or am now too full).
I don't see any EF_ in aarch64, and this http://infocenter.arm.com/help/topic/com.arm.doc.ihi0056c/IHI0056C_beta_aaelf64.pdf says "There are no processor-specific flags so [e_flags] shall contain zero." so this might not be relevant.
It looks like MIPS ran into a similar issue. I see
/* Some IRIX 6 BSD-compatibility objects have this bit set. It
doesn't seem to matter. */
new_flags &= ~EF_MIPS_XGOT;
old_flags &= ~EF_MIPS_XGOT;
the rest of the MIPS e_flags stuff is a mess, but I don't see them checking reserved bits anywhere.
Tilera doesn't appear to define any EF_ flags, they just check the target names explicitly. IIRC they never had any ISA subsets.
SPARC has some EF_ stuff, but it doesn't check them when merging.
The only reference to e_flags I can find anywhere in glibc is in ARM
if (!ret && EF_ARM_EABI_VERSION (elf32_header->e_flags) == EF_ARM_EABI_VER5)
{
if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_HARD)
*flag = FLAG_ARM_LIBHF|FLAG_ELF_LIBC6;
else if (elf32_header->e_flags & EF_ARM_ABI_FLOAT_SOFT)
*flag = FLAG_ARM_LIBSF|FLAG_ELF_LIBC6;
else
/* We must assume the unmarked objects are compatible
with all ABI variants. Such objects may have been
generated in a transitional period when the ABI
tags were not added to all objects. */
*flag = FLAG_ELF_LIBC6;
}
which makes me think that maybe it's just not worth checking the reserved bits at all.
from riscv-binutils-gdb.
Yeah, I think not checking them at all is the better thing to do.
The psABI spec is the line of defense here. If people allocate reserved flags for their own purposes, then they are knowingly making an incompatibility. If future versions of binutils start to reject their libraries, it's their fault.
from riscv-binutils-gdb.
Works for me. I'm closing this and the PR.
from riscv-binutils-gdb.
Related Issues (20)
- How gdb register csr HOT 2
- riscv64 gdb doesn't recognize riscv32 symbol tables: "Sorry, Dave" HOT 1
- GDB internal error HOT 1
- About the opcode constraints documentation. HOT 3
- What is the expected behavior upon hitting a EBREAK? HOT 3
- riscv-binutils-2.35-rvb: `_`instead of `.` ? HOT 2
- How to add a new custom instruction? HOT 6
- riscv-binutils-2.35-rvb: wrong match for xperm.h HOT 2
- a tricky one about gdb HOT 5
- Overlappings on the operand name for p ext
- Registers are interpreted as 64-bit when architecture is set to rv32 HOT 2
- ld: cannot find default versions of the ISA extension `i', when linking rv32e HOT 5
- GDB build fails on CentOS 7.9.2009 HOT 1
- Is there a way to let gdbserver instruct gdb client to use compressed breakpoints? HOT 2
- objdump cant correctly dissemble instructions that reuse other's encoding
- right way to compress branching instuction (decbnez from ZCE extension)
- Objdump and auipc: the immediate value should be displayed shifted HOT 2
- Does anyone know the status about zfh support of binutils? HOT 5
- GDB Single Step fails on RISCV, EL2 with ICCM HOT 1
- continue function not working??? HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from riscv-binutils-gdb.